Skip to content

Commit 113a787

Browse files
0xBoxercursoragent
andauthored
feat: add explicit EVM compatibility views (#9895)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 011255e commit 113a787

4 files changed

Lines changed: 290 additions & 1 deletion

File tree

dbt_subprojects/dex/models/trades/_schema.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,43 @@ models:
8484
- &evt_index
8585
name: evt_index
8686
description: "Index of the event in the transaction. Can be used to uniquely identify the order of trades within in a transaction"
87-
- name: _updated_at
87+
- &_updated_at
88+
name: _updated_at
8889
description: "Timestamp when this row was last written or updated by the pipeline"
90+
91+
- name: dex_evm_trades
92+
meta:
93+
sector: dex_evm
94+
short_description: "DEX trades across EVM-compatible chains, exposed under the explicit dex_evm namespace."
95+
contributors: 0xRob, hosuke, jeff-dude, tomfutago, viniabussafi
96+
config:
97+
tags: ['dex', 'trades', 'evm']
98+
description: >
99+
Compatibility view over dex.trades. It exposes the same column contract and chain coverage
100+
under dex_evm.trades for consumers that need an explicitly EVM-scoped namespace.
101+
columns:
102+
- <<: *blockchain
103+
- <<: *project
104+
- <<: *version
105+
- <<: *block_month
106+
- <<: *block_date
107+
- <<: *block_time
108+
- <<: *block_number
109+
- <<: *token_bought_symbol
110+
- <<: *token_sold_symbol
111+
- <<: *token_pair
112+
- <<: *token_bought_amount
113+
- <<: *token_sold_amount
114+
- <<: *token_bought_amount_raw
115+
- <<: *token_sold_amount_raw
116+
- <<: *amount_usd
117+
- <<: *token_bought_address
118+
- <<: *token_sold_address
119+
- <<: *taker
120+
- <<: *maker
121+
- <<: *project_contract_address
122+
- <<: *tx_hash
123+
- <<: *tx_from
124+
- <<: *tx_to
125+
- <<: *evt_index
126+
- <<: *_updated_at
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{% set chains = [
2+
'abstract'
3+
, 'apechain'
4+
, 'arbitrum'
5+
, 'avalanche_c'
6+
, 'base'
7+
, 'berachain'
8+
, 'blast'
9+
, 'bnb'
10+
, 'boba'
11+
, 'celo'
12+
, 'corn'
13+
, 'cronos'
14+
, 'ethereum'
15+
, 'fantom'
16+
, 'flare'
17+
, 'flow'
18+
, 'gnosis'
19+
, 'hemi'
20+
, 'hyperevm'
21+
, 'ink'
22+
, 'kaia'
23+
, 'katana'
24+
, 'linea'
25+
, 'mantle'
26+
, 'megaeth'
27+
, 'mezo'
28+
, 'monad'
29+
, 'morph'
30+
, 'nova'
31+
, 'opbnb'
32+
, 'optimism'
33+
, 'peaq'
34+
, 'plasma'
35+
, 'plume'
36+
, 'polygon'
37+
, 'robinhood'
38+
, 'ronin'
39+
, 'scroll'
40+
, 'sei'
41+
, 'shape'
42+
, 'somnia'
43+
, 'sonic'
44+
, 'sophon'
45+
, 'story'
46+
, 'superseed'
47+
, 'tac'
48+
, 'taiko'
49+
, 'tempo'
50+
, 'tezos_evm'
51+
, 'unichain'
52+
, 'worldchain'
53+
, 'xlayer'
54+
, 'zkevm'
55+
, 'zksync'
56+
, 'zora'
57+
] %}
58+
59+
{{ config(
60+
schema = 'dex_evm'
61+
, alias = 'trades'
62+
, materialized = 'view'
63+
, post_hook = '{{ expose_spells(blockchains = \'["' + chains | join('","') + '"]\',
64+
spell_type = "sector",
65+
spell_name = "dex_evm",
66+
contributors = \'["hosuke", "0xrob", "jeff-dude", "tomfutago", "viniabussafi", "krishhh", "kryptaki"]\') }}'
67+
)
68+
}}
69+
70+
select
71+
blockchain
72+
, project
73+
, version
74+
, block_month
75+
, block_date
76+
, block_time
77+
, block_number
78+
, token_bought_symbol
79+
, token_sold_symbol
80+
, token_pair
81+
, token_bought_amount
82+
, token_sold_amount
83+
, token_bought_amount_raw
84+
, token_sold_amount_raw
85+
, amount_usd
86+
, token_bought_address
87+
, token_sold_address
88+
, taker
89+
, maker
90+
, project_contract_address
91+
, tx_hash
92+
, tx_from
93+
, tx_to
94+
, evt_index
95+
, _updated_at
96+
from {{ ref('dex_trades') }}

dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/_schema.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,59 @@ models:
7979
- &type
8080
name: type
8181
description: "Transaction type"
82+
83+
- name: gas_evm_fees
84+
meta:
85+
sector: gas_evm
86+
short_description: "Transaction gas fees across EVM-compatible chains under the explicit gas_evm namespace."
87+
contributors: soispoke, ilemi, 0xRob, jeff-dude, hosuke, tomfutago
88+
config:
89+
tags: ['gas', 'fees', 'evm']
90+
description: >
91+
Compatibility view over gas.fees that excludes the non-EVM Tron rows and exposes the
92+
aggregate's EVM-compatible chain coverage under gas_evm.fees.
93+
columns:
94+
- name: blockchain
95+
description: "Blockchain on which the transaction occurred"
96+
- name: block_month
97+
description: "UTC month of the transaction block"
98+
- name: block_date
99+
description: "UTC date of the transaction block"
100+
- name: block_time
101+
description: "UTC timestamp of the transaction block"
102+
- name: block_number
103+
description: "Number of the block containing the transaction"
104+
- name: tx_hash
105+
description: "Hash of the transaction"
106+
- name: tx_index
107+
description: "Index position of the transaction within its block"
108+
- name: tx_from
109+
description: "Address that initiated the transaction"
110+
- name: tx_to
111+
description: "Address called by the transaction"
112+
- name: gas_price
113+
description: "Gas price paid per unit of gas"
114+
- name: gas_used
115+
description: "Amount of gas consumed by the transaction"
116+
- name: currency_symbol
117+
description: "Symbol of the blockchain's native fee currency"
118+
- name: tx_fee
119+
description: "Total transaction fee denominated in the native fee currency"
120+
- name: tx_fee_usd
121+
description: "Total transaction fee denominated in USD"
122+
- name: tx_fee_raw
123+
description: "Total transaction fee in the native currency's base unit"
124+
- name: tx_fee_breakdown
125+
description: "Transaction fee components denominated in the native fee currency"
126+
- name: tx_fee_breakdown_usd
127+
description: "Transaction fee components denominated in USD"
128+
- name: tx_fee_breakdown_raw
129+
description: "Transaction fee components in the native currency's base unit"
130+
- name: tx_fee_currency
131+
description: "Token address or identifier of the currency used to pay transaction fees"
132+
- name: block_proposer
133+
description: "Address of the validator or proposer for the transaction's block"
134+
- name: gas_limit
135+
description: "Maximum amount of gas available to the transaction"
136+
- name: gas_limit_usage
137+
description: "Share of the transaction gas limit that was consumed"
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{% set chains = [
2+
'abstract'
3+
, 'apechain'
4+
, 'arbitrum'
5+
, 'avalanche_c'
6+
, 'b3'
7+
, 'base'
8+
, 'berachain'
9+
, 'blast'
10+
, 'bnb'
11+
, 'bob'
12+
, 'boba'
13+
, 'celo'
14+
, 'corn'
15+
, 'cronos'
16+
, 'degen'
17+
, 'ethereum'
18+
, 'fantom'
19+
, 'flare'
20+
, 'gnosis'
21+
, 'hemi'
22+
, 'henesys'
23+
, 'hyperevm'
24+
, 'ink'
25+
, 'kaia'
26+
, 'katana'
27+
, 'lens'
28+
, 'linea'
29+
, 'mantle'
30+
, 'megaeth'
31+
, 'mezo'
32+
, 'monad'
33+
, 'morph'
34+
, 'nova'
35+
, 'opbnb'
36+
, 'optimism'
37+
, 'peaq'
38+
, 'plasma'
39+
, 'plume'
40+
, 'polygon'
41+
, 'robinhood'
42+
, 'ronin'
43+
, 'rise'
44+
, 'scroll'
45+
, 'sei'
46+
, 'shape'
47+
, 'somnia'
48+
, 'sonic'
49+
, 'sophon'
50+
, 'story'
51+
, 'superseed'
52+
, 'tac'
53+
, 'taiko'
54+
, 'tempo'
55+
, 'tezos_evm'
56+
, 'unichain'
57+
, 'worldchain'
58+
, 'xlayer'
59+
, 'zkevm'
60+
, 'zksync'
61+
, 'zora'
62+
] %}
63+
64+
{{ config(
65+
schema = 'gas_evm'
66+
, alias = 'fees'
67+
, materialized = 'view'
68+
, post_hook = '{{ expose_spells(blockchains = \'["' + chains | join('","') + '"]\',
69+
spell_type = "sector",
70+
spell_name = "gas_evm",
71+
contributors = \'["soispoke", "ilemi", "0xRob", "jeff-dude", "krishhh", "tomfutago"]\') }}'
72+
)
73+
}}
74+
75+
select
76+
blockchain
77+
, block_month
78+
, block_date
79+
, block_time
80+
, block_number
81+
, tx_hash
82+
, tx_index
83+
, tx_from
84+
, tx_to
85+
, gas_price
86+
, gas_used
87+
, currency_symbol
88+
, tx_fee
89+
, tx_fee_usd
90+
, tx_fee_raw
91+
, tx_fee_breakdown
92+
, tx_fee_breakdown_usd
93+
, tx_fee_breakdown_raw
94+
, tx_fee_currency
95+
, block_proposer
96+
, gas_limit
97+
, gas_limit_usage
98+
from {{ ref('gas_fees') }}
99+
where blockchain != 'tron'

0 commit comments

Comments
 (0)