diff --git a/dbt_subprojects/dex/macros/models/_decoding/evm_event_decoding_base.sql b/dbt_subprojects/dex/macros/models/_decoding/evm_event_decoding_base.sql new file mode 100644 index 00000000000..9626630e6e5 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_decoding/evm_event_decoding_base.sql @@ -0,0 +1,27 @@ +{% macro evm_event_decoding_base( + logs = null, + abi = null, + topic0 = null + ) +%} + +SELECT +* + +FROM TABLE ( + decode_evm_event ( + abi => '{{abi}}', + input => TABLE ( + SELECT l.* + FROM {{logs}} l + WHERE topic0 = {{topic0}} + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% else %} + AND block_date >= (SELECT MIN(block_date) FROM {{logs}} WHERE topic0 = {{topic0}}) + {% endif %} + ) + ) + ) + +{% endmacro %} diff --git a/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_factory_event_decoding.sql b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_factory_event_decoding.sql new file mode 100644 index 00000000000..38c18bbce3e --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_factory_event_decoding.sql @@ -0,0 +1,39 @@ +{% macro uniswap_v2_factory_event_decoding(logs) %} + +{% set abi = '{ + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token0", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token1", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "pair", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "pair_index", + "type": "uint256" + } + ], + "name": "PairCreated", + "type": "event" +}' %} + +{% set topic0 = '0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9' %} + +{{ evm_event_decoding_base(logs, abi, topic0) }} + +{% endmacro %} diff --git a/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_pool_event_decoding.sql b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_pool_event_decoding.sql new file mode 100644 index 00000000000..a067aaecd0b --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_pool_event_decoding.sql @@ -0,0 +1,51 @@ +{% macro uniswap_v2_pool_event_decoding(logs) %} + +{% set abi = '{ + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0Out", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1Out", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Swap", + "type": "event" +}' %} + +{% set topic0 = '0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822' %} + +{{ evm_event_decoding_base(logs, abi, topic0) }} + +{% endmacro %} diff --git a/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_trades.sql b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_trades.sql new file mode 100644 index 00000000000..75c84abf704 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v2/uniswap_v2_trades.sql @@ -0,0 +1,124 @@ +{% macro uniswap_v2_forks_trades( + blockchain = null + , dex_type = 'uni-v2' + , project = null + , version = null + , Pair_evt_Swap = null + , Factory_evt_PairCreated = null + , pair_column_name = 'pair' + ) +%} + +WITH evt_swap AS ( + SELECT + block_number + , block_time + , to + , contract_address + , tx_hash + , index + , amount0In + , amount0Out + , amount1In + , amount1Out + FROM {{ Pair_evt_Swap }} + {% if is_incremental() %} + WHERE {{ incremental_predicate('block_time') }} + {% endif %} +) + +, dexs AS +( + SELECT + t.block_number + , t.block_time + , t.to AS taker + , t.contract_address AS maker + , CASE WHEN amount0Out = UINT256 '0' THEN amount1Out ELSE amount0Out END AS token_bought_amount_raw + , CASE WHEN amount0In = UINT256 '0' OR amount1Out = UINT256 '0' THEN amount1In ELSE amount0In END AS token_sold_amount_raw + , CASE WHEN amount0Out = UINT256 '0' THEN f.token1 ELSE f.token0 END AS token_bought_address + , CASE WHEN amount0In = UINT256 '0' OR amount1Out = UINT256 '0' THEN f.token1 ELSE f.token0 END AS token_sold_address + , t.contract_address AS project_contract_address + , t.tx_hash + , t.index AS evt_index + , f.contract_address as factory_address + FROM + evt_swap t + INNER JOIN + {{ Factory_evt_PairCreated }} f + ON f.{{ pair_column_name }} = t.contract_address + INNER JOIN {{ source(blockchain, 'creation_traces') }} ct + ON f.{{ pair_column_name }} = ct.address + AND f.contract_address = ct."from" +) + +, base_trades AS ( + SELECT + '{{ blockchain }}' AS blockchain + , '{{project}}' AS project + , '{{ version }}' AS version + , '{{dex_type}}' AS dex_type + , CAST(date_trunc('month', dexs.block_time) AS date) AS block_month + , CAST(date_trunc('day', dexs.block_time) AS date) AS block_date + , dexs.block_time + , dexs.block_number + , dexs.token_bought_amount_raw + , dexs.token_sold_amount_raw + , dexs.token_bought_address + , dexs.token_sold_address + , dexs.taker + , dexs.maker + , dexs.project_contract_address + , dexs.tx_hash + , dexs.evt_index + , dexs.factory_address + FROM + dexs +) + +SELECT base_trades.blockchain + , COALESCE(contracts.namespace, base_trades.project) AS project + , base_trades.version + , base_trades.dex_type + , base_trades.factory_address + , base_trades.block_month + , base_trades.block_date + , base_trades.block_time + , base_trades.block_number + , base_trades.token_bought_amount_raw + , base_trades.token_sold_amount_raw + , base_trades.token_bought_address + , base_trades.token_sold_address + , base_trades.taker + , base_trades.maker + , base_trades.project_contract_address + , base_trades.tx_hash + , base_trades.evt_index +FROM base_trades +INNER JOIN ( + SELECT + tx_hash, + array_agg(DISTINCT contract_address) as contract_addresses + FROM {{ source('tokens', 'transfers') }} + WHERE blockchain = '{{ blockchain }}' + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% endif %} + GROUP BY tx_hash +) AS transfers +ON transfers.tx_hash = base_trades.tx_hash + AND contains(transfers.contract_addresses, base_trades.token_bought_address) + AND contains(transfers.contract_addresses, base_trades.token_sold_address) +LEFT JOIN ( + SELECT + address, + blockchain, + namespace + FROM {{ source('evms', 'contracts') }} + WHERE blockchain = '{{ blockchain }}' + AND namespace IS NOT NULL +) AS contracts +ON base_trades.project_contract_address = contracts.address + AND base_trades.blockchain = contracts.blockchain + +{% endmacro %} diff --git a/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_factory_event_decoding.sql b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_factory_event_decoding.sql new file mode 100644 index 00000000000..84555211d72 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_factory_event_decoding.sql @@ -0,0 +1,12 @@ +{% macro uniswap_v3_factory_event_decoding(logs) %} + +{% set abi = ' +{"name":"PoolCreated","type":"event","inputs":[{"name":"token0","type":"address","indexed":true,"internalType":"address"},{"name":"token1","type":"address","indexed":true,"internalType":"address"},{"name":"fee","type":"uint24","indexed":true,"internalType":"uint24"},{"name":"tickSpacing","type":"int24","indexed":false,"internalType":"int24"},{"name":"pool","type":"address","indexed":false,"internalType":"address"}],"anonymous":false} +' %} + +{% set topic0 = '0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118' %} + +{{ evm_event_decoding_base(logs, abi, topic0) }} + +{% endmacro %} + diff --git a/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_pool_event_decoding.sql b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_pool_event_decoding.sql new file mode 100644 index 00000000000..e768727b0ad --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_pool_event_decoding.sql @@ -0,0 +1,12 @@ +{% macro uniswap_v3_pool_event_decoding(logs) %} + +{% set abi = ' +{"name":"Swap","type":"event","inputs":[{"name":"sender","type":"address","indexed":true,"internalType":"address"},{"name":"recipient","type":"address","indexed":true,"internalType":"address"},{"name":"amount0","type":"int256","indexed":false,"internalType":"int256"},{"name":"amount1","type":"int256","indexed":false,"internalType":"int256"},{"name":"sqrtPriceX96","type":"uint160","indexed":false,"internalType":"uint160"},{"name":"liquidity","type":"uint128","indexed":false,"internalType":"uint128"},{"name":"tick","type":"int24","indexed":false,"internalType":"int24"}],"anonymous":false} +' %} + +{% set topic0 = '0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67' %} + +{{ evm_event_decoding_base(logs, abi, topic0) }} + +{% endmacro %} + diff --git a/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_trades.sql b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_trades.sql new file mode 100644 index 00000000000..20984854366 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_decoding/uniswap_v3/uniswap_v3_trades.sql @@ -0,0 +1,131 @@ +{% macro uniswap_v3_forks_trades( + blockchain = null + , dex_type = 'uni-v3' + , project = null + , version = null + , Pair_evt_Swap = null + , Factory_evt_PoolCreated = null + , pair_column_name = 'pool' + , taker_column_name = 'recipient' + , maker_column_name = null + ) +%} + +WITH evt_swap AS ( + SELECT + block_number + , block_time + , {{ taker_column_name }} + {% if maker_column_name %} + , {{ maker_column_name }} + {% endif %} + , amount0 + , amount1 + , contract_address + , tx_hash + , index + FROM {{ Pair_evt_Swap }} + {% if is_incremental() %} + WHERE {{ incremental_predicate('block_time') }} + {% endif %} +) + +, dexs AS +( + SELECT + t.block_number + ,t.block_time + , t.{{ taker_column_name }} AS taker + , {% if maker_column_name %} + t.{{ maker_column_name }} + {% else %} + cast(null as varbinary) + {% endif %} as maker + , CASE WHEN amount0 < INT256 '0' THEN abs(amount0) ELSE abs(amount1) END AS token_bought_amount_raw + , CASE WHEN amount0 < INT256 '0' THEN abs(amount1) ELSE abs(amount0) END AS token_sold_amount_raw + , CASE WHEN amount0 < INT256 '0' THEN f.token0 ELSE f.token1 END AS token_bought_address + , CASE WHEN amount0 < INT256 '0' THEN f.token1 ELSE f.token0 END AS token_sold_address + , t.contract_address as project_contract_address + , t.tx_hash + , t.index as evt_index + , f.contract_address as factory_address + FROM + evt_swap t + INNER JOIN + {{ Factory_evt_PoolCreated }} f + ON f.{{ pair_column_name }} = t.contract_address + INNER JOIN {{ source(blockchain, 'creation_traces') }} ct + ON f.{{ pair_column_name }} = ct.address + AND f.contract_address = ct."from" +) + +, base_trades AS ( + SELECT + '{{ blockchain }}' AS blockchain + , '{{ project }}' AS project + , '{{ version }}' AS version + , '{{dex_type}}' AS dex_type + , CAST(date_trunc('month', dexs.block_time) AS date) AS block_month + , CAST(date_trunc('day', dexs.block_time) AS date) AS block_date + , dexs.block_time + , dexs.block_number + , CAST(dexs.token_bought_amount_raw AS UINT256) AS token_bought_amount_raw + , CAST(dexs.token_sold_amount_raw AS UINT256) AS token_sold_amount_raw + , dexs.token_bought_address + , dexs.token_sold_address + , dexs.taker + , dexs.maker + , dexs.project_contract_address + , dexs.tx_hash + , dexs.evt_index + , dexs.factory_address + FROM + dexs +) + +SELECT base_trades.blockchain + , COALESCE(contracts.namespace, base_trades.project) AS project + , base_trades.version + , base_trades.dex_type + , base_trades.factory_address + , base_trades.block_month + , base_trades.block_date + , base_trades.block_time + , base_trades.block_number + , base_trades.token_bought_amount_raw + , base_trades.token_sold_amount_raw + , base_trades.token_bought_address + , base_trades.token_sold_address + , base_trades.taker + , base_trades.maker + , base_trades.project_contract_address + , base_trades.tx_hash + , base_trades.evt_index +FROM base_trades +INNER JOIN ( + SELECT + tx_hash, + array_agg(DISTINCT contract_address) as contract_addresses + FROM {{ source('tokens', 'transfers') }} + WHERE blockchain = '{{ blockchain }}' + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% endif %} + GROUP BY tx_hash +) AS transfers +ON transfers.tx_hash = base_trades.tx_hash + AND contains(transfers.contract_addresses, base_trades.token_bought_address) + AND contains(transfers.contract_addresses, base_trades.token_sold_address) +LEFT JOIN ( + SELECT + address, + blockchain, + namespace + FROM {{ source('evms', 'contracts') }} + WHERE blockchain = '{{ blockchain }}' + AND namespace IS NOT NULL +) AS contracts +ON base_trades.project_contract_address = contracts.address + AND base_trades.blockchain = contracts.blockchain + +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/log_decoded_enrich_dex_trades.sql b/dbt_subprojects/dex/macros/models/log_decoded_enrich_dex_trades.sql new file mode 100644 index 00000000000..4edaf818d37 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/log_decoded_enrich_dex_trades.sql @@ -0,0 +1,101 @@ +{% macro log_decoded_enrich_dex_trades( + base_trades = null + , filter = null + , tokens_erc20_model = null + ) +%} + +WITH base_trades as ( + SELECT + * + FROM + {{ base_trades }} + WHERE + {{ filter }} + {% if is_incremental() %} + AND + {{ incremental_predicate('block_time') }} + {% endif %} +) + +, enrichments AS ( + SELECT + base_trades.blockchain + , base_trades.project + , base_trades.version + , base_trades.factory_address + , base_trades.dex_type + , base_trades.block_month + , base_trades.block_date + , base_trades.block_time + , base_trades.block_number + , erc20_bought.symbol AS token_bought_symbol + , erc20_sold.symbol AS token_sold_symbol + , case + when lower(erc20_bought.symbol) > lower(erc20_sold.symbol) then concat(erc20_sold.symbol, '-', erc20_bought.symbol) + else concat(erc20_bought.symbol, '-', erc20_sold.symbol) + end AS token_pair + , base_trades.token_bought_amount_raw / power(10, erc20_bought.decimals) AS token_bought_amount + , base_trades.token_sold_amount_raw / power(10, erc20_sold.decimals) AS token_sold_amount + , base_trades.token_bought_amount_raw + , base_trades.token_sold_amount_raw + , base_trades.token_bought_address + , base_trades.token_sold_address + , coalesce(base_trades.taker, base_trades.tx_from) AS taker + , base_trades.maker + , base_trades.project_contract_address + , base_trades.tx_hash + , base_trades.tx_from + , base_trades.tx_to + , base_trades.evt_index + FROM + base_trades + LEFT JOIN + {{ tokens_erc20_model }} as erc20_bought + ON erc20_bought.contract_address = base_trades.token_bought_address + AND erc20_bought.blockchain = base_trades.blockchain + LEFT JOIN + {{ tokens_erc20_model }} as erc20_sold + ON erc20_sold.contract_address = base_trades.token_sold_address + AND erc20_sold.blockchain = base_trades.blockchain +) + +, enrichments_with_prices AS ( + {{ + add_amount_usd( + trades_cte = 'enrichments' + ) + }} +) + +SELECT + blockchain + , project + , version + , factory_address + , dex_type + , block_month + , block_date + , block_time + , block_number + , token_bought_symbol + , token_sold_symbol + , token_pair + , token_bought_amount + , token_sold_amount + , token_bought_amount_raw + , token_sold_amount_raw + , amount_usd + , token_bought_address + , token_sold_address + , taker + , maker + , project_contract_address + , tx_hash + , tx_from + , tx_to + , evt_index +FROM + enrichments_with_prices + +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/automated_trades/_schema.yml b/dbt_subprojects/dex/models/automated_trades/_schema.yml new file mode 100644 index 00000000000..46367ad6ef8 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/_schema.yml @@ -0,0 +1,136 @@ +version: 2 + +models: + - name: dex_automated_trades + meta: + docs_slug: /curated/trading/DEX/dex-trades + blockchain: arbitrum, avalanche_c, base, bnb, celo, ethereum, fantom, gnosis, optimism, polygon, scroll, zksync, linea, blast, sei + sector: dex + short_description: The `dex.trades` table captures detailed data on trades executed via decentralized exchanges (DEXs). This table contains a detailed breakdown of trade execution containing one or many trades per transaction. + contributors: 0xBoxer, hosuke + config: + tags: [ 'dex', 'trades'] + description: '{{ doc("dex_trades_doc") }}' + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - project + - version + - tx_hash + - evt_index + columns: + - &blockchain + name: blockchain + description: "Blockchain on which this trade occurred" + - &project + name: project + description: "Name of the dex on which the trade occurred" +# data_tests: +# - relationships: +# to: ref('dex_info') +# field: project + - &version + name: version + description: "Version of the DEX protocol/contract" + - &block_month + name: block_month + description: "UTC event block month" + - &block_date + name: block_date + description: "UTC event block date" + - &block_time + name: block_time + description: "UTC event block time" + - &block_number + name: block_number + description: "Block number of the block in which the trade occurred" + - &token_bought_symbol + name: token_bought_symbol + description: "Symbol of the token bought in the trade" + - &token_sold_symbol + name: token_sold_symbol + description: "Symbol of the token sold in the trade" + - &token_pair + name: token_pair + description: "symbol pair for the tokens involved in the trade. e.g. 'ETH/USDC'. Always alphabetical order, not trade order." + - &token_bought_amount + name: token_bought_amount + description: "Amount of the token bought in the display unit" + - &token_sold_amount + name: token_sold_amount + description: "Amount of the token sold in the display unit" + - &token_bought_amount_raw + name: token_bought_amount_raw + description: "Amount of the token bought in the base unit" + - &token_sold_amount_raw + name: token_sold_amount_raw + description: "Amount of the token sold in the base unit" + - &amount_usd + name: amount_usd + description: "USD value of the trade at time of execution. Can be null if we don't have enough data to calculate the value." + data_tests: + - dbt_utils.accepted_range: + max_value: 1000000000 # $1b is an arbitrary number, intended to flag outlier amounts early + - &token_bought_address + name: token_bought_address + description: "Contract address of the token bought" + - &token_sold_address + name: token_sold_address + description: "Contract address of the token sold" + - &taker + name: taker + description: "Address of account which purchased tokens. Can be contracts or EOA addresses. " + - &maker + name: maker + description: "Address of account which sold tokens. Can be contracts or EOA addresses." + - &project_contract_address + name: project_contract_address + description: "Smart contract address which emitted the event associated with this trade. Can be the a Pool Contract, Router Contract, or other contract associated with the DEX." + - &tx_hash + name: tx_hash + description: "The hash of the transaction that this trade was included in" + - &tx_from + name: tx_from + description: "EOA address that sent the trade transaction, usually the trader's address, but can also be keeper bots, arbitrage bots, etc." + - &tx_to + name: tx_to + description: "Address that got called in the first call of this transaction" + - &evt_index + name: evt_index + description: "Index of the event in the transaction. Can be used to uniquely identify the order of trades within in a transaction" + + - name: dex_automated_base_trades + meta: + blockchain: arbitrum, avalanche_c, base, bnb, celo, ethereum, fantom, gnosis, optimism, polygon, scroll, zksync, linea, blast, sei + sector: dex + contributors: 0xBoxer, hosuke + config: + tags: [ 'dex' ] + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - project + - version + - tx_hash + - evt_index + columns: + - *blockchain + - *project + - *version + - *block_month + - *block_date + - *block_time + - *block_number + - *token_bought_amount_raw + - *token_sold_amount_raw + - *token_bought_address + - *token_sold_address + - *taker + - *maker + - *project_contract_address + - *tx_hash + - *evt_index + - *tx_from + - *tx_to diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/_schema.yml b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/_schema.yml new file mode 100644 index 00000000000..5605486ee3a --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/_schema.yml @@ -0,0 +1,77 @@ +version: 2 + +models: + - name: dex_arbitrum_automated_base_trades + description: "all dex trades on arbitrum, mass decoded" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + + - name: uniswap_v2_arbitrum_decoded_factory_evt + description: > + mass decoding of all forks of uniswap v2 factory contract on arbitrum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v2_arbitrum_decoded_pool_evt_swap + description: > + mass decoding of all forks of uniswap v2 pool contracts on arbitrum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v2_arbitrum_automated_base_trades + meta: + blockchain: arbitrum + sector: dex + project: uniswap + contributors: 0xboxer + config: + tags: [ 'arbitrum', 'dex', 'trades', 'uniswap', 'v2', 'forks' ] + description: "base trades for all forks of uniswap v2 on arbitrum" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + + - name: uniswap_v3_arbitrum_decoded_factory_evt + description: > + mass decoding of all forks of uniswap v3 factory contract on arbitrum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v3_arbitrum_decoded_pool_evt_swap + description: > + mass decoding of all forks of uniswap v3 pool contracts on arbitrum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v3_arbitrum_automated_base_trades + meta: + blockchain: arbitrum + sector: dex + project: uniswap + contributors: 0xboxer + config: + tags: [ 'arbitrum', 'dex', 'trades', 'uniswap', 'v3', 'forks' ] + description: "base trades for all forks of uniswap v3 on arbitrum" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/dex_arbitrum_automated_base_trades.sql b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/dex_arbitrum_automated_base_trades.sql new file mode 100644 index 00000000000..69325a32714 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/dex_arbitrum_automated_base_trades.sql @@ -0,0 +1,52 @@ +{{ config( + schema = 'dex_arbitrum' + , alias = 'automated_base_trades' + , materialized = 'view' + ) +}} + +{% set base_models = [ + ref('uniswap_v2_arbitrum_automated_base_trades') + , ref('uniswap_v3_arbitrum_automated_base_trades') +] %} + +WITH base_union AS ( + SELECT * + FROM ( + {% for base_model in base_models %} + SELECT + blockchain + , project + , version + , dex_type + , factory_address + , block_month + , block_date + , block_time + , block_number + , token_bought_amount_raw + , token_sold_amount_raw + , token_bought_address + , token_sold_address + , taker + , maker + , project_contract_address + , tx_hash + , evt_index + FROM + {{ base_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} + ) +) + +{{ + add_tx_columns( + model_cte = 'base_union' + , blockchain = 'arbitrum' + , columns = ['from', 'to', 'index'] + ) +}} + diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_automated_base_trades.sql b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_automated_base_trades.sql new file mode 100644 index 00000000000..77e547862ef --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_automated_base_trades.sql @@ -0,0 +1,21 @@ +{{ config( + schema = 'uniswap_v2_arbitrum', + alias = 'automated_base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_v2_forks_trades( + blockchain = 'arbitrum' + , version = '2' + , project = 'null' + , Pair_evt_Swap = ref('uniswap_v2_arbitrum_decoded_pool_evt_swap') + , Factory_evt_PairCreated = ref('uniswap_v2_arbitrum_decoded_factory_evt') + ) +}} diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_decoded_factory_evt.sql b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_decoded_factory_evt.sql new file mode 100644 index 00000000000..78f1344d510 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_decoded_factory_evt.sql @@ -0,0 +1,15 @@ +{{ config( + schema = 'uniswap_v2_arbitrum', + alias = 'decoded_factory_evt', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v2_factory_event_decoding( + logs = source('arbitrum', 'logs') +)}} diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_decoded_pool_evt_swap.sql b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_decoded_pool_evt_swap.sql new file mode 100644 index 00000000000..ffb9ffd6c79 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v2_arbitrum_decoded_pool_evt_swap.sql @@ -0,0 +1,15 @@ +{{ config( + schema = 'uniswap_v2_arbitrum', + alias = 'decoded_pool_evt_swap', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v2_pool_event_decoding( + logs = source('arbitrum', 'logs') +)}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_automated_base_trades.sql b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_automated_base_trades.sql new file mode 100644 index 00000000000..c387499d008 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_automated_base_trades.sql @@ -0,0 +1,21 @@ +{{ config( + schema = 'uniswap_v3_arbitrum', + alias = 'automated_base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_v3_forks_trades( + blockchain = 'arbitrum' + , version = '3' + , project = 'null' + , Pair_evt_Swap = ref('uniswap_v3_arbitrum_decoded_pool_evt_swap') + , Factory_evt_PoolCreated = ref('uniswap_v3_arbitrum_decoded_factory_evt') + ) +}} diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_decoded_factory_evt.sql b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_decoded_factory_evt.sql new file mode 100644 index 00000000000..a9c4e6e8c6e --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_decoded_factory_evt.sql @@ -0,0 +1,16 @@ +{{ config( + schema = 'uniswap_v3_arbitrum', + alias = 'decoded_factory_evt', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v3_factory_event_decoding( + logs = source('arbitrum', 'logs') +)}} + diff --git a/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_decoded_pool_evt_swap.sql b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_decoded_pool_evt_swap.sql new file mode 100644 index 00000000000..21aacb7f581 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/arbitrum/projects/uniswap/uniswap_v3_arbitrum_decoded_pool_evt_swap.sql @@ -0,0 +1,15 @@ +{{ config( + schema = 'uniswap_v3_arbitrum', + alias = 'decoded_pool_evt_swap', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v3_pool_event_decoding( + logs = source('arbitrum', 'logs') +)}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/automated_trades/dex_automated_base_trades.sql b/dbt_subprojects/dex/models/automated_trades/dex_automated_base_trades.sql new file mode 100644 index 00000000000..52ccf9c4547 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/dex_automated_base_trades.sql @@ -0,0 +1,63 @@ +{{ config( + schema = 'dex' + , alias = 'automated_base_trades' + , partition_by = ['block_month', 'blockchain', 'project'] + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['blockchain', 'project', 'version', 'tx_hash', 'evt_index'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{% set models = [ + ref('dex_ethereum_automated_base_trades') + , ref('dex_arbitrum_automated_base_trades') +] %} + +with base_union as ( + SELECT * + FROM + ( + {% for model in models %} + SELECT + blockchain + , project + , version + , factory_address + , dex_type + , block_month + , block_date + , block_time + , block_number + , cast(token_bought_amount_raw as uint256) as token_bought_amount_raw + , cast(token_sold_amount_raw as uint256) as token_sold_amount_raw + , token_bought_address + , token_sold_address + , taker + , maker + , project_contract_address + , tx_hash + , evt_index + , tx_from + , tx_to + , row_number() over (partition by tx_hash, evt_index order by tx_hash) as duplicates_rank + FROM + {{ model }} + WHERE + token_sold_amount_raw >= 0 and token_bought_amount_raw >= 0 + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% endif %} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} + ) + WHERE + duplicates_rank = 1 +) +select + * +from + base_union diff --git a/dbt_subprojects/dex/models/automated_trades/dex_automated_trades.sql b/dbt_subprojects/dex/models/automated_trades/dex_automated_trades.sql new file mode 100644 index 00000000000..fa5c23865b8 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/dex_automated_trades.sql @@ -0,0 +1,47 @@ +{{ config( + schema = 'dex' + , alias = 'automated_trades' + , partition_by = ['block_month', 'blockchain', 'project'] + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['blockchain', 'project', 'version', 'tx_hash', 'evt_index'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + , post_hook='{{ expose_spells(\'[ + "arbitrum" + , "avalanche_c" + , "base" + , "blast" + , "bnb" + , "celo" + , "ethereum" + , "fantom" + , "gnosis" + , "linea" + , "mantle" + , "nova" + , "optimism" + , "polygon" + , "scroll" + , "sei" + , "zkevm" + , "zksync" + , "zora" + ]\', + "sector", + "dex", + \'["hosuke", "0xrob", "jeff-dude", "tomfutago"]\') }}') +}} + +with dexs AS ( + {{ + log_decoded_enrich_dex_trades( + base_trades = ref('dex_automated_base_trades') + , filter = "project != 'curve'" + , tokens_erc20_model = source('tokens', 'erc20') + ) + }} +) + +Select * from dexs + diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/_schema.yml b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/_schema.yml new file mode 100644 index 00000000000..ddbc973307c --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/_schema.yml @@ -0,0 +1,76 @@ +version: 2 + +models: + - name: dex_ethereum_automated_base_trades + description: "all dex trades on ethereum, mass decoded" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + + - name: uniswap_v2_ethereum_decoded_factory_evt + description: > + mass decoding of all forks of uniswap v2 factory contract on ethereum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v2_ethereum_decoded_pool_evt_swap + description: > + mass decoding of all forks of uniswap v2 pool contracts on ethereum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v2_ethereum_automated_base_trades + meta: + blockchain: ethereum + sector: dex + project: uniswap + contributors: 0xboxer + config: + tags: [ 'ethereum', 'dex', 'trades', 'uniswap', 'v2', 'forks' ] + description: "base trades for all forks of uniswap v2 on ethereum" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + + - name: uniswap_v3_ethereum_decoded_factory_evt + description: > + mass decoding of all forks of uniswap v3 factory contract on ethereum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v3_ethereum_decoded_pool_evt_swap + description: > + mass decoding of all forks of uniswap v3 pool contracts on ethereum + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - index + + - name: uniswap_v3_ethereum_automated_base_trades + meta: + blockchain: ethereum + sector: dex + project: uniswap + contributors: 0xboxer + config: + tags: [ 'ethereum', 'dex', 'trades', 'uniswap', 'v3', 'forks' ] + description: "base trades for all forks of uniswap v3 on ethereum" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/dex_ethereum_automated_base_trades.sql b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/dex_ethereum_automated_base_trades.sql new file mode 100644 index 00000000000..554f94d4b76 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/dex_ethereum_automated_base_trades.sql @@ -0,0 +1,52 @@ +{{ config( + schema = 'dex_ethereum' + , alias = 'automated_base_trades' + , materialized = 'view' + ) +}} + +{% set base_models = [ + ref('uniswap_v2_ethereum_automated_base_trades') + , ref('uniswap_v3_ethereum_automated_base_trades') +] %} + +WITH base_union AS ( + SELECT * + FROM ( + {% for base_model in base_models %} + SELECT + blockchain + , project + , version + , dex_type + , factory_address + , block_month + , block_date + , block_time + , block_number + , token_bought_amount_raw + , token_sold_amount_raw + , token_bought_address + , token_sold_address + , taker + , maker + , project_contract_address + , tx_hash + , evt_index + FROM + {{ base_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} + ) +) + +{{ + add_tx_columns( + model_cte = 'base_union' + , blockchain = 'ethereum' + , columns = ['from', 'to', 'index'] + ) +}} + diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_automated_base_trades.sql b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_automated_base_trades.sql new file mode 100644 index 00000000000..97db55d2a31 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_automated_base_trades.sql @@ -0,0 +1,21 @@ +{{ config( + schema = 'uniswap_v2_ethereum', + alias = 'automated_base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_v2_forks_trades( + blockchain = 'ethereum' + , version = '2' + , project = 'null' + , Pair_evt_Swap = ref('uniswap_v2_ethereum_decoded_pool_evt_swap') + , Factory_evt_PairCreated = ref('uniswap_v2_ethereum_decoded_factory_evt') + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_decoded_factory_evt.sql b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_decoded_factory_evt.sql new file mode 100644 index 00000000000..8d42c7e3700 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_decoded_factory_evt.sql @@ -0,0 +1,15 @@ +{{ config( + schema = 'uniswap_v2_ethereum', + alias = 'decoded_factory_evt', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v2_factory_event_decoding( + logs = source('ethereum', 'logs') +)}} diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_decoded_pool_evt_swap.sql b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_decoded_pool_evt_swap.sql new file mode 100644 index 00000000000..e6346f30ac8 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v2_ethereum_decoded_pool_evt_swap.sql @@ -0,0 +1,15 @@ +{{ config( + schema = 'uniswap_v2_ethereum', + alias = 'decoded_pool_evt_swap', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v2_pool_event_decoding( + logs = source('ethereum', 'logs') +)}} diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_automated_base_trades.sql b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_automated_base_trades.sql new file mode 100644 index 00000000000..7568e8732e9 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_automated_base_trades.sql @@ -0,0 +1,21 @@ +{{ config( + schema = 'uniswap_v3_ethereum', + alias = 'automated_base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_v3_forks_trades( + blockchain = 'ethereum' + , version = '3' + , project = 'null' + , Pair_evt_Swap = ref('uniswap_v3_ethereum_decoded_pool_evt_swap') + , Factory_evt_PoolCreated = ref('uniswap_v3_ethereum_decoded_factory_evt') + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_decoded_factory_evt.sql b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_decoded_factory_evt.sql new file mode 100644 index 00000000000..36d02272d4d --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_decoded_factory_evt.sql @@ -0,0 +1,16 @@ +{{ config( + schema = 'uniswap_v3_ethereum', + alias = 'decoded_factory_evt', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v3_factory_event_decoding( + logs = source('ethereum', 'logs') +)}} + diff --git a/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_decoded_pool_evt_swap.sql b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_decoded_pool_evt_swap.sql new file mode 100644 index 00000000000..d8c6b9d7fe9 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/ethereum/projects/uniswap/uniswap_v3_ethereum_decoded_pool_evt_swap.sql @@ -0,0 +1,15 @@ +{{ config( + schema = 'uniswap_v3_ethereum', + alias = 'decoded_pool_evt_swap', + partition_by = ['block_date'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{uniswap_v3_pool_event_decoding( + logs = source('ethereum', 'logs') +)}} diff --git a/dbt_subprojects/dex/models/automated_trades/log_decoded_dex_docs_block.md b/dbt_subprojects/dex/models/automated_trades/log_decoded_dex_docs_block.md new file mode 100644 index 00000000000..f282e88c5d4 --- /dev/null +++ b/dbt_subprojects/dex/models/automated_trades/log_decoded_dex_docs_block.md @@ -0,0 +1,22 @@ +{% docs log_decoded_dex_trades_doc %} + +## Table Description + +The `dex.trades` table captures detailed data on trades executed via decentralized exchanges (DEXs). This table captures all trade events that happen across different liqudity sources. + +## Functional Overview + +The `dex.trades` table provides an in-depth view of trades on decentralized exchanges like uniswap or curve. This table includes entries for each segment of a trade that passes through different liquidity pools, as well as single-step trades. For example, a user may initiate a trade to swap USDC for PEPE. If this trade is executed through multiple liquidity pools, such as USDC-WETH and WETH-PEPE, the `dex.trades` table will record each segment of the trade as a separate entry. Conversely, a single-step trade, such as directly swapping USDC for ETH, will be recorded as a single entry. + +This detailed approach allows for granular analysis of trade execution paths, enabling users to: + +- **Analyze Liquidity Sources**: Understand which liquidity pools are used and how they interact in both single-step and multi-step trades. +- **Track Trade Execution Paths**: Follow the exact route a trade takes across different DEXs and liquidity pools. +- **Assess Slippage and Execution Quality**: Evaluate the impact of each step on the overall trade execution, including slippage and price changes. +- **Monitor Market Dynamics**: Gain insights into the behavior and dynamics of different liquidity pools and DEXs over time. + +By providing comprehensive trade details, the `dex.trades` table supports advanced analytics and research into DEX trading behavior and liquidity management. + +Complimentary tables include `dex_aggregator.trades`, in which trade-intents that are routed through aggregators are recorded. The volume routed through aggregators is also recorded in the dex.trades table, one row in dex_aggregator trades corresponds to one or more rows in dex.trades. + +{% enddocs %} \ No newline at end of file diff --git a/sources/_subprojects_outputs/daily_spellbook/_sources.yml b/sources/_subprojects_outputs/daily_spellbook/_sources.yml index 98825e0b5b7..e086d2254ef 100644 --- a/sources/_subprojects_outputs/daily_spellbook/_sources.yml +++ b/sources/_subprojects_outputs/daily_spellbook/_sources.yml @@ -30,8 +30,15 @@ sources: description: "Blockchain metadata for all EVM compatible chains" - name: evm_smart_account_method_ids - name: base_evm_smart_account_method_ids + - name: contracts + - name: blocks + - name: creation_traces + - name: traces + - name: traces_decoded - name: transactions + - name: logs - name: ethereum tables: - - name: blobs_submissions \ No newline at end of file + - name: blobs_submissions + \ No newline at end of file