Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gas fees for new chains #7635

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'abstract' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2

models:
- name: gas_abstract_fees
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta:
blockchain: abstract
sector: gas
contributors: hosuke
config:
tags: ['abstract', 'gas', 'fees']
description: >
Gas Fees on Abstract. Note that Abstract uses a unique gas fee mechanism that includes both offchain (fixed) and onchain (variable) components,
with a smart refund system for unused resources and overpayments.
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- block_month
- block_number
- tx_hash
- check_seed:
seed_file: ref('evm_gas_fees')
filter:
blockchain: abstract
match_columns:
- blockchain
- tx_hash
check_columns:
- tx_fee_raw
- dbt_utils.expression_is_true:
expression: "tx_fee_raw >= 0"
config:
where: "block_time > now() - interval '7' day"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'boba' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2

models:
- name: gas_boba_fees
meta:
blockchain: boba
sector: gas
contributors: hosuke
config:
tags: ['boba', 'gas', 'fees']
description: >
Gas Fees on Boba
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- block_month
- block_number
- tx_hash
- check_seed:
seed_file: ref('evm_gas_fees')
filter:
blockchain: boba
match_columns:
- blockchain
- tx_hash
check_columns:
- tx_fee_raw
- dbt_utils.expression_is_true:
expression: "tx_fee_raw = reduce(map_values(tx_fee_breakdown_raw),uint256 '0',(s, x) -> s + x,s -> s)"
config:
where: "block_time > now() - interval '7' day"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'corn' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2

models:
- name: gas_corn_fees
meta:
blockchain: corn
sector: gas
contributors: hosuke
config:
tags: ['corn', 'gas', 'fees']
description: >
Gas Fees on Corn
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- block_month
- block_number
- tx_hash
- check_seed:
seed_file: ref('evm_gas_fees')
filter:
blockchain: corn
match_columns:
- blockchain
- tx_hash
check_columns:
- tx_fee_raw
- dbt_utils.expression_is_true:
expression: "tx_fee_raw = reduce(map_values(tx_fee_breakdown_raw),uint256 '0',(s, x) -> s + x,s -> s)"
config:
where: "block_time > now() - interval '7' day"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'flare' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2

models:
- name: gas_flare_fees
meta:
blockchain: flare
sector: gas
contributors: hosuke
config:
tags: ['flare', 'gas', 'fees']
description: >
Gas Fees on Flare
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- block_month
- block_number
- tx_hash
- check_seed:
seed_file: ref('evm_gas_fees')
filter:
blockchain: flare
match_columns:
- blockchain
- tx_hash
check_columns:
- tx_fee_raw
- dbt_utils.expression_is_true:
expression: "tx_fee_raw = reduce(map_values(tx_fee_breakdown_raw),uint256 '0',(s, x) -> s + x,s -> s)"
config:
where: "block_time > now() - interval '7' day"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'ink' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2

models:
- name: gas_ink_fees
meta:
blockchain: ink
sector: gas
contributors: hosuke
config:
tags: ['ink', 'gas', 'fees']
description: >
Gas Fees on Ink
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- block_month
- block_number
- tx_hash
- check_seed:
seed_file: ref('evm_gas_fees')
filter:
blockchain: ink
match_columns:
- blockchain
- tx_hash
check_columns:
- tx_fee_raw
- dbt_utils.expression_is_true:
expression: "tx_fee_raw = reduce(map_values(tx_fee_breakdown_raw),uint256 '0',(s, x) -> s + x,s -> s)"
config:
where: "block_time > now() - interval '7' day"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'kaia' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2

models:
- name: gas_kaia_fees
meta:
blockchain: kaia
sector: gas
contributors: hosuke
config:
tags: ['kaia', 'gas', 'fees']
description: >
Gas Fees on Kaia
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- block_month
- block_number
- tx_hash
- check_seed:
seed_file: ref('evm_gas_fees')
filter:
blockchain: kaia
match_columns:
- blockchain
- tx_hash
check_columns:
- tx_fee_raw
- dbt_utils.expression_is_true:
expression: "tx_fee_raw = reduce(map_values(tx_fee_breakdown_raw),uint256 '0',(s, x) -> s + x,s -> s)"
config:
where: "block_time > now() - interval '7' day"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'nova' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2

models:
- name: gas_nova_fees
meta:
blockchain: nova
sector: gas
contributors: hosuke
config:
tags: ['nova', 'gas', 'fees']
description: >
Gas Fees on Nova
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- block_month
- block_number
- tx_hash
- check_seed:
seed_file: ref('evm_gas_fees')
filter:
blockchain: nova
match_columns:
- blockchain
- tx_hash
check_columns:
- tx_fee_raw
- dbt_utils.expression_is_true:
expression: "tx_fee_raw = reduce(map_values(tx_fee_breakdown_raw),uint256 '0',(s, x) -> s + x,s -> s)"
config:
where: "block_time > now() - interval '7' day"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% set blockchain = 'sonic' %}

{{ config(
schema = 'gas_' + blockchain
,alias = 'fees'
,partition_by = ['block_month']
,materialized = 'incremental'
,file_format = 'delta'
,incremental_strategy='merge'
,unique_key = ['block_month', 'tx_hash']
,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
gas_fees(blockchain = blockchain)
}}
Loading
Loading