diff --git a/.gitignore b/.gitignore index 1a1c62c9df8..46f99d09f96 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ dbt_macros/dune/create_views_of_dependencies.sql dbt_macros/dune/alter_table_locations.sql scripts/integration_test/test_diffs_tokens/* .vs +dbt_subprojects/manifests/* + # Byte-compiled / optimized / DLL files __pycache__/ @@ -146,3 +148,4 @@ logs/ !target/manifest.json !target/run_results.json !target/sources.json + diff --git a/README.md b/README.md index 8e3396fa47b..33a62bdbf87 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Please note: the test tables built in the CI pipeline will exist for ~24 hours. ### Connecting with other wizards -We use Discord to connect with our community. Head over to spellbook channel on [Dune's Discord](https://discord.gg/dunecom) for questions or to ask for help with a particular PR. We encourage you to learn by doing, and leverage our vibrant community to help you get going. +We use Discord to connect with our community. Head over to spellbook channel on [Dune's Discord](https://discord.com/invite/ErrzwBz) for questions or to ask for help with a particular PR. We encourage you to learn by doing, and leverage our vibrant community to help you get going. ## Setting up your Local Dev Environment @@ -118,6 +118,12 @@ cd user\directory\github\spellbook # Change this to wherever spellbook is stored locally on your machine. ``` +Within Spellbook repo, there are multiple dbt projects, located in the root directory. Navigate to the correct project, depending on your use case. + +```console +cd ../spellbook/dbt_subprojects// +``` + Using the pipfile located in the spellbook repo, run the below install command to create a pipenv. ```console @@ -199,7 +205,6 @@ models: error_after: { count: 24, period: hour } tables: - name: traces - loaded_at_field: block_time ``` See links to more docs on dbt below. diff --git a/dbt_macros/shared/balancer/balancer_liquidity_macro.sql b/dbt_macros/shared/balancer/balancer_liquidity_macro.sql index 6dfabad878b..f4d4704028c 100644 --- a/dbt_macros/shared/balancer/balancer_liquidity_macro.sql +++ b/dbt_macros/shared/balancer/balancer_liquidity_macro.sql @@ -18,7 +18,7 @@ WITH pool_labels AS ( date_trunc('day', minute) AS day, contract_address AS token, decimals, - AVG(price) AS price + APPROX_PERCENTILE(price, 0.5) AS price FROM {{ source('prices', 'usd') }} WHERE blockchain = '{{blockchain}}' GROUP BY 1, 2, 3 @@ -74,7 +74,8 @@ WITH pool_labels AS ( DATE_TRUNC('day', minute) as day, AVG(price) as eth_price FROM {{ source('prices', 'usd') }} - WHERE symbol = 'ETH' + WHERE blockchain = 'ethereum' + AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 GROUP BY 1 ), diff --git a/dbt_macros/shared/balances_incremental_subset_daily.sql b/dbt_macros/shared/balances_incremental_subset_daily.sql new file mode 100644 index 00000000000..9e330747b25 --- /dev/null +++ b/dbt_macros/shared/balances_incremental_subset_daily.sql @@ -0,0 +1,162 @@ +{# @DEV here + + @NOTICE this macro constructs the address level token balances table for given input table + @NOTICE aka, you give lists of tokens and/or address, it generates table with daily balances of the address-token pair + + @PARAM blockchain -- blockchain name + @PARAM address_list -- must have an address column, can be none if only filtering on tokens + @PARAM token_list -- must have a token_address column, can be none if only filtering on tokens + @PARAM address_token_list -- for advanced usage, must have both (address, token_address) columns, can be none + @PARAM start_date -- the start_date, used to generate the daily timeseries + +#} + +{%- macro balances_incremental_subset_daily( + blockchain, + start_date, + address_list = none, + token_list = none, + address_token_list = none + ) +%} + +WITH +filtered_daily_agg_balances as ( + select + b.blockchain, + b.day, + b.block_number, + b.block_time, + b.address, + b.token_address, + b.token_standard, + b.balance_raw, + CASE + WHEN b.token_standard = 'erc20' THEN b.balance_raw / power(10, erc20_tokens.decimals) + WHEN b.token_standard = 'native' THEN b.balance_raw / power(10, 18) + ELSE b.balance_raw + END as balance, + erc20_tokens.symbol as token_symbol, + token_id + from {{source('tokens_'~blockchain,'balances_daily_agg_base')}} b + {% if address_list is not none %} + inner join (select distinct address from {{address_list}}) f1 + on f1.address = b.address + {% endif %} + {% if token_list is not none %} + inner join (select distinct token_address from {{token_list}}) f2 + on f2.token_address = b.token_address + {% endif %} + {% if address_token_list is not none %} + inner join (select distinct address, token_address from {{address_token_list}}) f3 + on f3.token_address = b.token_address + and f3.address = b.address + {% endif %} + left join {{ source('tokens', 'erc20') }} erc20_tokens on + erc20_tokens.blockchain = '{{blockchain}}' + AND erc20_tokens.contract_address = b.token_address + AND b.token_standard = 'erc20' + where day >= cast('{{start_date}}' as date) + +) +,changed_balances as ( + select * + , lead(cast(day as timestamp)) over (partition by token_address,address,token_id order by day asc) as next_update_day + from ( + select * from ( + select + blockchain + ,day + ,address + ,token_symbol + ,token_address + ,token_standard + ,token_id + ,balance + from filtered_daily_agg_balances + where day >= cast('{{start_date}}' as date) + {% if is_incremental() %} + and {{ incremental_predicate('day') }} + {% endif %} + ) + -- if we're running incremental, we need to retrieve the last known balance updates from before the current window + -- so we can correctly populate the forward fill. + {% if is_incremental() %} + UNION ALL + select * from ( + select + blockchain + ,max(day) as day + ,address + ,token_symbol + ,token_address + ,token_standard + ,token_id + ,max_by(balance, day) as balance + from filtered_daily_agg_balances + where day >= cast('{{start_date}}' as date) + and not {{ incremental_predicate('day') }} + group by 1,3,4,5,6,7 + ) + {% endif %} + ) +), + +days as ( + select * + from unnest( + sequence(cast('{{start_date}}' as date) + , date(date_trunc('day',now())) + , interval '1' day + ) + ) as foo(day) +), +forward_fill as ( + select + blockchain, + cast(d.day as timestamp) as day, + address, + token_symbol, + token_address, + token_standard, + token_id, + balance, + b.day as last_updated, + b.next_update_day as next_update + from days d + left join changed_balances b + ON d.day >= b.day + and (b.next_update_day is null OR d.day < b.next_update_day) -- perform forward fill +) + +select + b.blockchain, + b.day, + b.address, + b.token_symbol, + b.token_address, + b.token_standard, + b.token_id, + b.balance, + b.balance * p.price as balance_usd, + b.last_updated, + b.next_update +from( + select * from forward_fill + where balance > 0 + {% if is_incremental() %} + and {{ incremental_predicate('day') }} + {% endif %} + +) b +left join {{source('prices','usd')}} p + on (token_standard = 'erc20' + and p.blockchain = '{{blockchain}}' + and b.token_address = p.contract_address + and b.day = p.minute) + or (token_standard = 'native' + and p.blockchain is null + and p.contract_address is null + and p.symbol = (select native_token_symbol from {{source('evms','info')}} where blockchain = '{{blockchain}}') + and b.day = p.minute) +{% endmacro %} diff --git a/dbt_subprojects/daily_spellbook/dbt_project.yml b/dbt_subprojects/daily_spellbook/dbt_project.yml index dfb8ba12c2a..56ca7fef3b8 100644 --- a/dbt_subprojects/daily_spellbook/dbt_project.yml +++ b/dbt_subprojects/daily_spellbook/dbt_project.yml @@ -289,11 +289,6 @@ models: fantom: +schema: beethoven_x_fantom - rocifi: - +schema: rocifi - polygon: - +schema: rocifi_polygon - pooltogether: +schema: pooltogether ethereum: diff --git a/dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_mapped_contracts_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_mapped_contracts_macro.sql index b733e2417db..13d4a83d6f1 100644 --- a/dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_mapped_contracts_macro.sql +++ b/dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_mapped_contracts_macro.sql @@ -60,6 +60,7 @@ , ('0xbbbbbBB520d69a9775E85b458C58c648259FAD5F', 'true', 'Bebop' , 'BebopSettlement' , ['ethereum']) , ('0xf4D3269fACF1FfD633195715e5d1357f0d4489d5', 'true', 'Bebop' , 'BebopSettlement' , ['base']) , ('0x3a6d8ca21d1cf76f653a67577fa0d27453350dd8', 'true', 'BiSwap' , 'UNDEFINED' , ['bnb']) + , ('0xd1ca1f4dbb645710f5d5a9917aa984a47524f49a', 'true', 'BitGet' , 'BKSwapRouter' , ['base','fantom','arbitrum','optimism','ethereum','avalanche_c','bnb','polygon']) , ('0x6f5ac65ca70f2a44d73c8f711cb2bdf425d9f304', 'true', 'BitKeep' , 'UNDEFINED' , ['bnb']) , ('0xf5bfcbda96de6a55a3a80af5175a1cbb088d5338', 'true', 'BitKeep' , 'UNDEFINED' , ['polygon']) , ('0xf6463845b0b9d9d33d8e2bcb6c628bc5cb1ad133', 'true', 'BitKeep' , 'UNDEFINED' , ['polygon']) @@ -88,6 +89,7 @@ , ('0x9d0950c595786aba7c26dfddf270d66a8b18b4fa', 'true', 'DfxFinance' , 'Router' , ['ethereum']) , ('0xa102072a4c07f06ec3b4900fdc4c7b80b6c57429', 'true', 'Dfyn' , 'UniswapV2Router02' , ['polygon']) , ('0x3af3cc4930ef88f4afe0b695ac95c230e1a108ec', 'true', 'Dzap' , 'DZapAggregator' , ['polygon']) + , ('0xcace8d78269ba00f1c4d5fc3b1228c7df0a7c8ba', 'true', 'FastLane' , 'FastLaneAuctionHandler' , ['polygon']) , ('0x0c6134abc08a1eafc3e2dc9a5ad023bb08da86c3', 'true', 'Firebird' , 'FireBirdRouter' , ['optimism']) , ('0x92e4f29be975c1b1eb72e77de24dccf11432a5bd', 'true', 'Firebird' , 'FireBirdRouter' , ['bnb']) , ('0xb31d1b1ea48ce4bf10ed697d44b747287e785ad4', 'true', 'Firebird' , 'FireBirdRouter' , ['polygon']) @@ -113,12 +115,16 @@ , ('0x1fc3607fa67b58deddb0faf7a116f417a20c551c', 'true', 'Kyber' , 'AggregationRouter' , ['fantom']) , ('0x546c79662e028b661dfb4767664d0273184e4dd1', 'true', 'Kyber' , 'AggregationRouter' , ['polygon']) , ('0x617dee16b86534a5d792a4d7a62fb491b544111e', 'true', 'Kyber' , 'MetaAggregationRouterV1' , ['ethereum','polygon','fantom']) - , ('0x6131b5fae19ea4f9d964eac0408e4408b66337b5', 'true', 'Kyber' , 'MetaAggregationRouterV2' , ['ethereum','bnb','polygon','arbitrum','avalanche_c','optimism','fantom']) + , ('0x6131b5fae19ea4f9d964eac0408e4408b66337b5', 'true', 'Kyber' , 'MetaAggregationRouterV2' , ['ethereum','bnb','polygon','arbitrum','avalanche_c','optimism','fantom','base']) + , ('0x3f95ef3f2eaca871858dbe20a93c01daf6c2e923', 'true', 'Kyber' , 'MetaAggregationRouterV2' , ['zksync']) , ('0xdf1a1b60f2d438842916c0adc43748768353ec25', 'true', 'Kyber' , 'AggregationRouterV2' , ['polygon','fantom']) , ('0xb18d4f69627f8320619a696202ad2c430cef7c53', 'true', 'LevinSwap' , 'UniswapV2Router02' , ['gnosis']) , ('0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae', 'true', 'LiFi' , 'DiamondV2' , ['ethereum','bnb','polygon','arbitrum','avalanche_c','gnosis','optimism','fantom']) , ('0x62c1a0d92b09d0912f7bb9c96c5ecdc7f2b87059', 'true', 'Mdex' , 'MdexRouter' , ['bnb']) , ('0x7dae51bd3e3376b8c7c4900e9107f12be3af1ba8', 'true', 'Mdex' , 'MdexRouter' , ['bnb']) + , ('0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e', 'true', 'Maestro' , 'MaestroSniperBot' , ['ethereum']) + , ('0x013bb8a204499523ddf717e0abaa14e6dc849060', 'true', 'Maestro' , 'MaestroSniperBot' , ['base','bnb']) + , ('0xa6a147946facac9e0b99824870b36088764f969f', 'true', 'Maestro' , 'MaestroSniperBot' , ['arbitrum']) , ('0xbbf1ee38152e9d8e3470dc47947eaa65dca94913', 'true', 'Maverick' , 'Router' , ['ethereum']) , ('0x39e098a153ad69834a9dac32f0fca92066ad03f4', 'true', 'Maverick' , 'Router' , ['zksync']) , ('0xd53a9f3fae2bd46d35e9a30ba58112a585542869', 'true', 'Maverick' , 'Router' , ['bnb']) @@ -147,7 +153,15 @@ , ('0xd0c22a5435f4e8e5770c1fafb5374015fc12f7cd', 'true', 'Odos' , 'OdosRouterV2' , ['fantom']) , ('0x4bba932e9792a2b917d47830c93a9bc79320e4f7', 'true', 'Odos' , 'OdosRouterV2' , ['zksync']) , ('0x3b3ae790df4f312e745d270119c6052904fb6790', 'true', 'OKXDEX' , 'DEX' , ['ethereum']) - , ('0x6352a56caadc4f1e25cd6c75970fa768a3304e64', 'true', 'OpenOcean' , 'ExchangeV2' , ['ethereum','bnb','polygon','avalanche_c','optimism','fantom']) + , ('0xf3de3c0d654fda23dad170f0f320a92172509127', 'true', 'OKXDEX' , 'DexAggregationRouter' , ['ethereum']) + , ('0x9333c74bdd1e118634fe5664aca7a9710b108bab', 'true', 'OKXDEX' , 'DexAggregationRouter' , ['bnb']) + , ('0xf332761c673b59b21ff6dfa8ada44d78c12def09', 'true', 'OKXDEX' , 'DexAggregationRouter' , ['optimism','arbitrum','fantom']) + , ('0x6b2c0c7be2048daa9b5527982c29f48062b34d58', 'true', 'OKXDEX' , 'DexAggregationRouter' , ['base']) + , ('0xb9061e38fee7d30134f56aef7117e2f6d1580666', 'true', 'OKXDEX' , 'DexAggregationRouter' , ['zksync']) + , ('0xa748d6573aca135af68f2635be60cb80278bd855', 'true', 'OKXDEX' , 'DexAggregationRouter' , ['polygon']) + , ('0x1dac23e41fc8ce857e86fd8c1ae5b6121c67d96d', 'true', 'OKXDEX' , 'DexAggregationRouter' , ['avalanche_c']) + , ('0x6352a56caadc4f1e25cd6c75970fa768a3304e64', 'true', 'OpenOcean' , 'ExchangeV2' , ['ethereum','bnb','polygon','avalanche_c','optimism','fantom','base','arbitrum','gnosis']) + , ('0x36a1acbbcafca2468b85011ddd16e7cb4d673230', 'true', 'OpenOcean' , 'ExchangeV2' , ['zksync']) , ('0x05ff2b0db69458a0750badebc4f9e13add608c7f', 'true', 'PancakeSwap' , 'PancakeRouter' , ['bnb']) , ('0x10ed43c718714eb63d5aa57b78b54704e256024e', 'true', 'PancakeSwap' , 'PancakeswapV2' , ['bnb']) , ('0x5aeaf2883fbf30f3d62471154eda3c0c1b05942d', 'true', 'PancakeSwap' , 'PancakeswapV2' , ['zksync']) @@ -177,6 +191,7 @@ , ('0x135896de8421be2ec868e0b811006171d9df802a', 'true', 'Paraswap' , 'LiquiditySwapAdapter' , ['ethereum']) , ('0x6a000f20005980200259b80c5102003040001068', 'true', 'Paraswap' , 'AugustusV6v2' , ['ethereum','bnb','polygon','arbitrum','avalanche_c','gnosis','optimism','fantom','base']) , ('0x30030701590a20B0Fb08000010400A034050C860', 'true', 'Paraswap' , 'AugustusV6v2' , ['bnb','optimism']) + , ('0x1d7405df25fd2fe80390da3a696dcfd5120ca9ce', 'true', 'Paraswap' , 'ParaswapDeltaV1' , ['ethereum']) , ('0xe92b586627cca7a83dc919cc7127196d70f55a06', 'true', 'Paraswap' , 'AugustusRFQ' , ['ethereum']) , ('0x0927fd43a7a87e3e8b81df2c44b03c4756849f6d', 'true', 'Paraswap' , 'AugustusRFQ' , ['arbitrum','optimism']) , ('0x2DF17455B96Dde3618FD6B1C3a9AA06D6aB89347', 'true', 'Paraswap' , 'AugustusRFQ' , ['fantom']) @@ -215,6 +230,13 @@ , ('0x7a4af156379f512de147ed3b96393047226d923f', 'true', 'SushiSwap' , 'SushiXSwap' , ['bnb']) , ('0x8b396ddf906d552b2f98a8e7d743dd58cd0d920f', 'true', 'SushiSwap' , 'SushiXSwap' , ['optimism']) , ('0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f', 'true', 'SushiSwap' , 'Router02' , ['ethereum']) + , ('0x544ba588efd839d2692fc31ea991cd39993c135f', 'true', 'SushiSwap' , 'RouteProcessor4' , ['arbitrum']) + , ('0xe43ca1dee3f0fc1e2df73a0745674545f11a59f5', 'true', 'SushiSwap' , 'RouteProcessor4' , ['ethereum']) + , ('0x0389879e0156033202c44bf784ac18fc02edee4f', 'true', 'SushiSwap' , 'RouteProcessor4' , ['base']) + , ('0x46b3fdf7b5cde91ac049936bf0bdb12c5d22202e', 'true', 'SushiSwap' , 'RouteProcessor4' , ['polygon','gnosis','fantom']) + , ('0x1f2fcf1d036b375b384012e61d3aa33f8c256bbe', 'true', 'SushiSwap' , 'RouteProcessor4' , ['optimism']) + , ('0x33d91116e0370970444b0281ab117e161febfcdd', 'true', 'SushiSwap' , 'RouteProcessor4' , ['bnb']) + , ('0xcdbcd51a5e8728e0af4895ce5771b7d17ff71959', 'true', 'SushiSwap' , 'RouteProcessor4' , ['avalanche_c']) , ('0x2da10a1e27bf85cedd8ffb1abbe97e53391c0295', 'true', 'SyncSwap' , 'Router' , ['zksync']) , ('0x80e38291e06339d10aab483c65695d004dbd5c69', 'true', 'SyncSwap' , 'Router' , ['scroll']) , ('0xb9960d9bca016e9748be75dd52f02188b9d0829f', 'true', 'Swapr' , 'Swapr' , ['ethereum']) @@ -251,8 +273,10 @@ , ('0xb971ef87ede563556b2ed4b1c0b0019111dd85d2', 'true', 'Uniswap' , 'UNDEFINED' , ['bnb']) , ('0x2626664c2603336e57b271c5c0b26f421741e481', 'true', 'Uniswap' , 'UNDEFINED' , ['base']) , ('0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc', 'true', 'Uniswap' , 'UNDEFINED' , ['base']) - , ('0xe80bf394d190851e215d5f67b67f8f5a52783f1e', 'true', 'Uniswap' , 'UniswapX' , ['ethereum']) - , ('0x6000da47483062a0d734ba3dc7576ce6a0b645c4', 'true', 'Uniswap' , 'UniswapX' , ['ethereum']) + , ('0xe80bf394d190851e215d5f67b67f8f5a52783f1e', 'true', 'Uniswap' , 'UniswapXV1' , ['ethereum']) + , ('0x6000da47483062a0d734ba3dc7576ce6a0b645c4', 'true', 'Uniswap' , 'UniswapXV1' , ['ethereum']) + , ('0x00000011f84b9aa48e5f8aa8b9897600006289be', 'true', 'Uniswap' , 'UniswapXV2' , ['ethereum']) + , ('0x1bd1aAdc9E230626C44a139d7E70d842749351eb', 'true', 'Uniswap' , 'UniswapXV2' , ['arbitrum']) , ('0x9c12939390052919af3155f41bf4160fd3666a6f', 'true', 'Velodrome' , 'Router' , ['optimism']) , ('0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9', 'true', 'Velodrome' , 'Router' , ['optimism']) , ('0x777777773fdd8b28bb03377d10fcea75ad9768da', 'true', 'Viarouter' , 'ViaRouter' , ['polygon','arbitrum','optimism']) @@ -264,6 +288,8 @@ , ('0xdf37f7a85d4563f39a78494568824b4df8669b7a', 'true', 'WooFi' , 'WooCrossChainRouter' , ['avalanche_c']) , ('0xeaf1ac8e89ea0ae13e0f03634a4ff23502527024', 'true', 'WooFi' , 'WooRouter' , ['optimism']) , ('0xc4729e56b831d74bbc18797e0e17a295fa77488c', 'true', 'Yield' , 'YakRouter' , ['avalanche_c']) + , ('0xd7f1dd5d49206349cae8b585fcb0ce3d96f1696f', 'true', 'Zerion' , 'Router' , ['ethereum','bnb','polygon','arbitrum','avalanche_c','gnosis','optimism','fantom','base']) + , ('0xe4c82643a4f9fd288322cc6fbd7c48ab068b38d3', 'true', 'Zerion' , 'Router' , ['zksync']) , ('0xdef1c0ded9bec7f1a1670819833240f027b25eff', 'true', 'ZeroEx' , 'ExchangeProxy' , ['ethereum','bnb','polygon','arbitrum','avalanche_c','base','fantom','optimism']) , ('0xe66b31678d6c16e9ebf358268a790b763c133750', 'true', 'ZeroEx' , 'ExchangeProxy' , ['ethereum']) , ('0xdef189deaef76e379df891899eb5a00a94cbc250', 'true', 'ZeroEx' , 'ExchangeProxy' , ['fantom']) @@ -272,20 +298,44 @@ , ('0x3f93c3d9304a70c9104642ab8cd37b1e2a7c203a', 'true', 'ZeroEx' , 'ExchangeV2' , ['bnb']) , ('0x145f83ad6108391cbf9ed554e5ce1dbd984437f8', 'true', 'ZeroEx' , 'ExchangeV2' , ['bnb','polygon']) , ('0x61935cbdd02287b511119ddb11aeb42f1593b7ef', 'true', 'ZeroEx' , 'ExchangeV3' , ['ethereum']) - , ('0x7f6cee965959295cc64d0e6c00d99d6532d8e86b', 'true', 'ZeroEx' , 'SettlerV1' , ['ethereum']) - , ('0x7600f49428e551af89d5c6b8e77b8cf3e198f936', 'true', 'ZeroEx' , 'SettlerV1' , ['optimism']) - , ('0x6aec4d9f02d6d4b9a09c588922ebc81a532b94d0', 'true', 'ZeroEx' , 'SettlerV1' , ['polygon']) + , ('0xc8e09d4ac2bf8b83a842068a0a6e79e118414a1d', 'true', 'ZeroEx' , 'SettlerV1' , ['arbitrum']) + , ('0x2b6625aafc65373e5a82a0349f777fa11f7f04d1', 'true', 'ZeroEx' , 'SettlerV1' , ['arbitrum']) + , ('0x845a4dae544147ffe8cb536079b58ee43f320067', 'true', 'ZeroEx' , 'SettlerV1' , ['arbitrum']) , ('0x466da4a5809665d640048177baa9c4975dc4e5e6', 'true', 'ZeroEx' , 'SettlerV1' , ['avalanche_c']) + , ('0x4147ef0dc9156db568ac8cbe2c98be0fc9ea175c', 'true', 'ZeroEx' , 'SettlerV1' , ['avalanche_c']) + , ('0xd92b96e1e5aee3bad2a1c112147e313bc1724da9', 'true', 'ZeroEx' , 'SettlerV1' , ['avalanche_c']) , ('0x55873e4b1dd63ab3fea3ca47c10277655ac2dce0', 'true', 'ZeroEx' , 'SettlerV1' , ['base']) + , ('0x163631ebf9550476156d78748dff6b1c691d89e1', 'true', 'ZeroEx' , 'SettlerV1' , ['base']) + , ('0xf15c6ec20e5863351d3bbc9e742f9208e3a343ff', 'true', 'ZeroEx' , 'SettlerV1' , ['base']) , ('0xb2845bb0e9166357938445539eb9be94338594f2', 'true', 'ZeroEx' , 'SettlerV1' , ['bnb']) - , ('0x2b6625aafc65373e5a82a0349f777fa11f7f04d1', 'true', 'ZeroEx' , 'SettlerV1' , ['arbitrum']) - , ('0x07e594aa718bb872b526e93eed830a8d2a6a1071', 'true', 'ZeroEx' , 'SettlerV2' , ['ethereum']) - , ('0x1a3b48ea0c6e9a52511a196a287fa8371e5ee7a0', 'true', 'ZeroEx' , 'SettlerV2' , ['optimism']) - , ('0xd2aeae6dc50a8efa8919e7783125cacde3b4e930', 'true', 'ZeroEx' , 'SettlerV2' , ['polygon']) - , ('0x4147ef0dc9156db568ac8cbe2c98be0fc9ea175c', 'true', 'ZeroEx' , 'SettlerV2' , ['avalanche_c']) - , ('0x163631ebf9550476156d78748dff6b1c691d89e1', 'true', 'ZeroEx' , 'SettlerV2' , ['base']) - , ('0x0be366a2cffa54901b05c19b76c7a29f5608ad25', 'true', 'ZeroEx' , 'SettlerV2' , ['bnb']) - , ('0xc8e09d4ac2bf8b83a842068a0a6e79e118414a1d', 'true', 'ZeroEx' , 'SettlerV2' , ['arbitrum']) + , ('0x0be366a2cffa54901b05c19b76c7a29f5608ad25', 'true', 'ZeroEx' , 'SettlerV1' , ['bnb']) + , ('0xff48d64d1aeae4c17b6a6aa43e002345e21b8c51', 'true', 'ZeroEx' , 'SettlerV1' , ['bnb']) + , ('0x7f6cee965959295cc64d0e6c00d99d6532d8e86b', 'true', 'ZeroEx' , 'SettlerV1' , ['ethereum']) + , ('0x07e594aa718bb872b526e93eed830a8d2a6a1071', 'true', 'ZeroEx' , 'SettlerV1' , ['ethereum']) + , ('0x2c4b05349418ef279184f07590e61af27cf3a86b', 'true', 'ZeroEx' , 'SettlerV1' , ['ethereum']) + , ('0x7600f49428e551af89d5c6b8e77b8cf3e198f936', 'true', 'ZeroEx' , 'SettlerV1' , ['optimism']) + , ('0x1a3b48ea0c6e9a52511a196a287fa8371e5ee7a0', 'true', 'ZeroEx' , 'SettlerV1' , ['optimism']) + , ('0x733d95e5cb3ca43eab2752f1d4f1a0d2686965c6', 'true', 'ZeroEx' , 'SettlerV1' , ['optimism']) + , ('0x6aec4d9f02d6d4b9a09c588922ebc81a532b94d0', 'true', 'ZeroEx' , 'SettlerV1' , ['polygon']) + , ('0xd2aeae6dc50a8efa8919e7783125cacde3b4e930', 'true', 'ZeroEx' , 'SettlerV1' , ['polygon']) + , ('0x88530dd3a2e72c2a6580f45ac9c2197e9b75a642', 'true', 'ZeroEx' , 'SettlerV1' , ['polygon']) + , ('0xd29b634d35e9e22379241ead1f5ba431af6dbba3', 'true', 'ZeroEx' , 'SettlerV1' , ['polygon']) + , ('0x25b81ce58ab0c4877d25a96ad644491ceab81048', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['ethereum']) + , ('0x7c39a136ea20b3483e402ea031c1f3c019bab24b', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['ethereum']) + , ('0xae11b95c8ebb5247548c279a00120b0acadc7451', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['ethereum']) + , ('0xf9332450385291b6dce301917af6905e28e8f35f', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['polygon']) + , ('0xf8745182e29d951d6555fa7054f8e198ccf4e508', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['polygon']) + , ('0xa9d4e424845fad578685cab695ca06ef95f43ad2', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['polygon']) + , ('0x135bede7ccb55eee58e92657a24f79a1e1319776', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['polygon']) + , ('0x1aa84eb5cb62f686fc0d908afd85864f4a05d5ee', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['arbitrum']) + , ('0xc9619fb4a96be2ee28115fab4815ff010a025169', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['arbitrum']) + , ('0x4a7618263f8235411824fec0c1af74fef87eac9b', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['arbitrum']) + , ('0x607798c55fb37e842b8fa92a148cd51dba8bb22f', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['optimism']) + , ('0x4069560a180ebd76bb1af947f5119fe555bb4ea0', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['optimism']) + , ('0x79d04a87f1c3b101d042a609d8618020bee91b26', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['optimism']) + , ('0x3c7d7284e915518b1d05efb49e198306ba94b516', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['base']) + , ('0x5ce929ddb01804bff35b2f5c77b735bdb094aac8', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['base']) + , ('0x1d49ea51279185ef557f07215341c037e4988aac', 'true', 'ZeroEx' , 'SettlerMetaTxnV1' , ['base']) , ('0x18381c0f738146fb694de18d1106bde2be040fa4', 'true', 'ZkSwap' , 'Router' , ['zksync']) , ('0xe7b0ce0526fbe3969035a145c9e9691d4d9d216c', 'false', 'Clipper' , 'Clipper' , ['ethereum','arbitrum']) , ('0x655edce464cc797526600a462a8154650eee4b77', 'false', 'Clipper' , 'Clipper' , ['ethereum']) @@ -328,6 +378,7 @@ , ('0x41d7b3abcfecf1f1b4b1b962da8f086114b6cc5a', 'false', 'Native' , 'NativeRouterV1' , ['base']) , ('0xc6f7a7ba5388bfb5774bfaa87d350b7793fd9ef1', 'false', 'Native' , 'NativeRouterV1' , ['mantle']) , ('0xd315a9c38ec871068fec378e4ce78af528c76293', 'false', 'Swaap' , 'Vault' , ['ethereum','polygon','arbitrum']) + , ('0x03C01Acae3D0173a93d819efDc832C7C4F153B06', 'false', 'Swaap' , 'Vault' , ['bnb','base']) , ('0xa57bd00134b2850b2a1c55860c9e9ea100fdd6cf', 'false', 'MEVBot' , 'MEVBot' , ['ethereum']) , ('0xa69babef1ca67a37ffaf7a485dfff3382056e78c', 'false', 'MEVBot' , 'MEVBot' , ['ethereum']) , ('0x00000000003b3cc22af3ae1eac0440bcee416b40', 'false', 'MEVBot' , 'MEVBot' , ['ethereum']) diff --git a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql index fd3d44007a6..b65b6a2eb23 100644 --- a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql +++ b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql @@ -138,6 +138,17 @@ "taking_amount": "substr(data , 32*3 + 1 , 32)", "order_hash": "substr(topic1 , 1 , 32)", }, + "0xece0e513cbaa408206d1b097118463feab4b263a1c43dd6896e8951cdb53e7d9": { + "project": "Paraswap", + "name": "OrderSettled", + "maker": "substr(topic1 , 12 + 1 , 20)", + "receiver": "substr(topic3 , 12 + 1 , 20)", + "maker_asset": "substr(data , 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(data , 32*1 + 12 + 1 , 20)", + "making_amount": "substr(data , 32*2 + 1 , 32)", + "taker_min_amount": "substr(data , 32*3 + 1 , 32)", + "taking_amount": "substr(data , 32*4 + 1 , 32)", + }, "0xa07a543ab8a018198e99ca0184c93fe9050a79400a0a723441f84de1d972cc17": { "project": "CoWSwap", "name": "Trade", diff --git a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql index 768ed1d70cd..9afcded3291 100644 --- a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql +++ b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql @@ -1,550 +1,734 @@ {% macro oneinch_project_orders_cfg_methods_macro() %} --- METHODS CONFIG -{% - set cfg = { - "ZeroEx": { - "0xb4be83d5": { - "name": "fillOrder", - "event": "0x0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c371129", - "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*10 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*11 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "taking_amount": "substr(output , 32*1 + 1 , 32)", - }, - "0xf6274f66": { - "name": "fillLimitOrder", - "event": "0xab614d2b738543c0ea21f56347cf696a3a0c42a7cbec3212a5ca22a4dcff2124", - "maker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x414e4ccf": { - "name": "_fillLimitOrder", - "event": "0xab614d2b738543c0ea21f56347cf696a3a0c42a7cbec3212a5ca22a4dcff2124", - "maker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x9240529c": { - "name": "fillOrKillLimitOrder", - "event": "0xab614d2b738543c0ea21f56347cf696a3a0c42a7cbec3212a5ca22a4dcff2124", - "maker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x64a3bc15": { - "name": "fillOrKillOrder", - "event": "0x0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c371129", - "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*10 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*11 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "taking_amount": "substr(output , 32*1 + 1 , 32)", - }, - "0xdac748d4": { - "name": "fillOtcOrder", - "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0xe4ba8439": { - "name": "_fillOtcOrder", - "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0xa578efaf": { - "name": "fillOtcOrderForEth", - "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x706394d5": { - "name": "fillOtcOrderWithEth", - "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x724d3953": { - "name": "fillTakerSignedOtcOrderForEth", - "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - }, - "0x4f948110": { - "name": "fillTakerSignedOtcOrder", - "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - }, - "0xaa77476c": { - "name": "fillRfqOrder", - "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0xaa6b21cd": { - "name": "_fillRfqOrder", - "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0xa656186b": { - "name": "_fillRfqOrder", - "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*1 + 1 , 32)", - "taking_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x438cdfc5": { - "name": "fillOrKillRfqOrder", - "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x3e228bae": { - "name": "fillOrderNoThrow", - "event": "0x0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c371129", - "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*10 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*11 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "taking_amount": "substr(output , 32*1 + 1 , 32)", - }, - "0x9b44d556": { - "name": "fillOrder", - "event": "0x6869791f0a34781b29882982cc39e882768cf2c96995c2a110c577c53bc932d5", - "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*10 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*11 + 24 + 1, 8)) + 32*1 + 4 + 12 + 1, 20)", - "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "taking_amount": "substr(output , 32*1 + 1 , 32)", - }, - }, - "Hashflow": { - "0x1e9a2e92": { - "name": "tradeSingleHop", - "event": "0xb709ddcc6550418e9b89df1f4938071eeaa3f6376309904c77e15d46b16066f5", - "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "maker_external": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*7 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*6 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*10 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*9 + 1 , 32)", - }, - "0xf0210929": { - "name": "tradeSingleHop", - "event": "0x8cf3dec1929508e5677d7db003124e74802bfba7250a572205a9986d86ca9f1e", - "maker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_external": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*6 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*9 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", - }, - "0xc52ac720": { - "name": "tradeRFQT", - "event": "0x34f57786fb01682fb4eec88d340387ef01a168fe345ea5b76f709d4e560c10eb", - "maker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "maker_external": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*6 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*9 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", - "order_hash": "substr(input , 4 + 32*12 + 1 , 32)", - }, - }, - "Native": { - "0xe525b10b": { - "name": "tradeRFQT", - "event": "0x32f38ef2842789f9cd8fd5ae2497e7acfd3ca27d341fa0878305c3072b63a06d", - "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "taker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", - "order_hash": "substr(input , 4 + 32*11 + 1 , 16)", - }, - "0xc7cd9748": { - "name": "exactInputSingle", - "event": "0x0c3ca67555399daacbfbeef89219bf4eca6380fdc58f2ed80cdc0841616c5818", - "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*3 + 1, 20)", - "taker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*4 + 1, 20)", - "maker_min_amount": "substr(input , 4 + 32*4 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "order_hash": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*8 + 24 + 1, 16)", - }, - "0x2794949c": { - "name": "exactInputSingle", - "event": "null", - "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*3 + 1, 20)", - "taker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*4 + 1, 20)", - "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "taking_amount": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*5 + 32*1 + 1, 32)", - }, - "0x5dc7b981": { - "name": "exactInput", - "event": "null", - "maker": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 1, 20)", - "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*14 + 5 + 1, 20)", - "taker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*4 + 1, 20)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "taking_amount": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*5 + 32*1 + 1, 32)", - }, - "0x68ab0bdb": { - "name": "exactInput", - "event": "null", - "maker": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 1, 20)", - "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "maker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*14 + 5 + 1, 20)", - "taker_asset": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*4 + 1, 20)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - "taking_amount": "substr(input, 4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8)) + 32*2 + 20*5 + 32*1 + 1, 32)", - }, - }, - "Clipper": { - "0x2b651a6c": { - "name": "swap", - "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", - "taker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - }, - "0x4cb6864c": { - "name": "sellTokenForEth", - "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", - "taker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", - }, - "0x27a9b424": { - "name": "sellEthForToken", - "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", - "taker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "taker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - "maker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", - }, - "0x3b26e4eb": { - "name": "transmitAndSwap", - "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", - "taker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", - }, - }, - "Swaap": { - "0x52bbbe29": { - "name": "swap", - "event": "0x2170c741c41531aec20e7c107c24eecfdd15e69c9bb0a8dd37b1840b9e0b207b", - "taker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "pool": "substr(input , 4 + 32*7 + 1 , 32)", - "maker_asset": "substr(input , 4 + 32*10 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*9 + 12 + 1 , 20)", - "taker_max_amount": "substr(input , 4 + 32*11 + 1 , 32)", - "deadline": "substr(input , 4 + 32*6 + 1 , 32)", - }, - }, - "Paraswap": { - "0x98f9b46b": { - "name": "fillOrder", - "event": "0x6621486d9c28838df4a87d2cca5007bc2aaf6a5b5de083b1db8faf709302c473", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - }, - "0xc88ae6dc": { - "name": "partialFillOrder", - "event": "0x6621486d9c28838df4a87d2cca5007bc2aaf6a5b5de083b1db8faf709302c473", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - }, - "0x24abf828": { - "name": "partialFillOrderWithTarget", - "event": "0x6621486d9c28838df4a87d2cca5007bc2aaf6a5b5de083b1db8faf709302c473", - "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*3 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "making_amount": "substr(output , 32*0 + 1 , 32)", - }, - }, - "CoWSwap": { - "0x13d79a0b": { - "name": "settle", - "event": "0xa07a543ab8a018198e99ca0184c93fe9050a79400a0a723441f84de1d972cc17", - "number": "coalesce(try(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 24 + 1, 8))), 1)", - "_order_beginning": "4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8))", - "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*0 + 24 + 1, 8)) + 1) + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) + 1) + 12 + 1, 20)", - "receiver": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*2 + 12 + 1, 20)", - "maker_max_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*3 + 1, 32)", - "taker_max_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*4 + 1, 32)", - "deadline": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*5 + 24 + 1, 8)", - "fee_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*7 + 1, 32)", - "_executed_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*9 + 1, 32)", - "making_amount": "if( - bitwise_and( - bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*8 + 31 + 1, 1)) - , bytearray_to_bigint(0x01) - ) = 0 - , substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*9 + 1, 32) - )", - "taking_amount": "if( - bitwise_and( - bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*8 + 31 + 1, 1)) - , bytearray_to_bigint(0x01) - ) > 0 - , substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 32*x + 24 + 1, 8)) + 32*9 + 1, 32) - )", - "condition": "bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8)) + 24 + 1, 8)) > 0", - }, - }, - "UniswapX": { - "0x3f62192e": { - "name": "execute", - "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", - "maker": "substr(input , 4 + 32*15 + 12 + 1 , 20)", - "receiver": "substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*5 + 12 + 1, 20)", - "maker_asset": "substr(input , 4 + 32*10 + 12 + 1 , 20)", - "taker_asset": "substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*2 + 12 + 1, 20)", - "maker_max_amount": "substr(input , 4 + 32*11 + 1 , 32)", - "maker_min_amount": "substr(input , 4 + 32*12 + 1 , 32)", - "taker_max_amount": "substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*3 + 1, 32)", - "taker_min_amount": "substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*4 + 1, 32)", - "start": "substr(input , 4 + 32*6 + 1 , 32)", - "end": "substr(input , 4 + 32*7 + 1 , 32)", - "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + 32*17 + 1, 32))) as varbinary)", - "nonce": "substr(input , 4 + 32*16 + 1 , 32)", - "fee_asset": "if(bytearray_to_bigint(substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*6 + 12 + 1, 20))", - "fee_max_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*7 + 1, 32))", - "fee_min_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*8 + 1, 32))", - "fee_receiver": "if(bytearray_to_bigint(substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) + 32*9 + 12 + 1, 20))", - }, - "0x0d335884": { - "name": "executeWithCallback", - "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", - "maker": "substr(input , 4 + 32*16 + 12 + 1 , 20)", - "receiver": "substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*5 + 12 + 1, 20)", - "maker_asset": "substr(input , 4 + 32*11 + 12 + 1 , 20)", - "taker_asset": "substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*2 + 12 + 1, 20)", - "maker_max_amount": "substr(input , 4 + 32*12 + 1 , 32)", - "maker_min_amount": "substr(input , 4 + 32*13 + 1 , 32)", - "taker_max_amount": "substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*3 + 1, 32)", - "taker_min_amount": "substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*4 + 1, 32)", - "start": "substr(input , 4 + 32*7 + 1 , 32)", - "end": "substr(input , 4 + 32*8 + 1 , 32)", - "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + 32*18 + 1, 32))) as varbinary)", - "nonce": "substr(input , 4 + 32*17 + 1 , 32)", - "fee_asset": "if(bytearray_to_bigint(substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*6 + 12 + 1, 20))", - "fee_max_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*7 + 1, 32))", - "fee_min_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*8 + 1, 32))", - "fee_receiver": "if(bytearray_to_bigint(substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)) > 1, substr(input, 4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8)) + 32*9 + 12 + 1, 20))", - }, - "0x0d7a16c3": { - "name": "executeBatch", - "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", - "number": "coalesce(try(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 24 + 1, 8))), 1)", - "_order_beginning": "4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8))", - "maker": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*14 + 12 + 1, 20)", - "receiver": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*8 + 12 + 1, 20)", - "maker_asset": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*9 + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*5 + 12 + 1, 20)", - "maker_max_amount": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*10 + 1, 32)", - "maker_min_amount": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*11 + 1, 32)", - "taker_max_amount": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*6 + 1, 32)", - "taker_min_amount": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*7 + 1, 32)", - "start": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*5 + 1, 32)", - "end": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*6 + 1, 32)", - "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*16 + 1, 32))) as varbinary)", - "nonce": "substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*15 + 1, 32)", - "fee_asset": "if(bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*9 + 12 + 1, 20))", - "fee_max_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*10 + 1, 32))", - "fee_min_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*11 + 1, 32))", - "fee_receiver": "if(bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*12 + 12 + 1, 20))", - }, - "0x13fb72c7": { - "name": "executeBatchWithCallback", - "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", - "number": "coalesce(try(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 24 + 1, 8))), 1)", - "_order_beginning": "4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8))", - "maker": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*14 + 12 + 1, 20)", - "receiver": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*8 + 12 + 1, 20)", - "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*9 + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*5 + 12 + 1, 20)", - "maker_max_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*10 + 1, 32)", - "maker_min_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*11 + 1, 32)", - "taker_max_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*6 + 1, 32)", - "taker_min_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*7 + 1, 32)", - "start": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*5 + 1, 32)", - "end": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*6 + 1, 32)", - "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*16 + 1, 32))) as varbinary)", - "nonce": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*15 + 1, 32)", - "fee_asset": "if(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*9 + 12 + 1, 20))", - "fee_max_amount": "if(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*10 + 1, 32))", - "fee_min_amount": "if(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*11 + 1, 32))", - "fee_receiver": "if(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) > 1, substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 32*(x - 1) + 24 + 1, 8)) + 32*12 + 24 + 1, 8)) + 32*12 + 12 + 1, 20))", - }, - }, - "Bebop": { - "0x1a499026": { - "name": "settleSingle", - "event": "0xadd7095becdaa725f0f33243630938c861b0bba83dfd217d4055701aa768ec2e", - "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "taker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "receiver": "substr(input , 4 + 32*8 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", - "making_amount": "substr(input , 4 + 32*14 + 1 , 32)", - "taking_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) = 1, substr(input, 4 + 32*6 + 1, 32), substr(input, 4 + 32*12 + 1, 32))", - "deadline": "substr(input , 4 + 32*1 + 24 + 1 , 8)", - "nonce": "substr(input , 4 + 32*3 + 1 , 32)", - "order_hash": "substr(input , 4 + 32*10 + 1 , 16)", - }, - "0x38ec0211": { - "name": "settleSingleAndSignPermit2", - "event": "0xadd7095becdaa725f0f33243630938c861b0bba83dfd217d4055701aa768ec2e", - "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", - "taker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", - "receiver": "substr(input , 4 + 32*8 + 12 + 1 , 20)", - "maker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", - "taker_asset": "substr(input , 4 + 32*4 + 12 + 1 , 20)", - "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", - "taker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", - "making_amount": "substr(input , 4 + 32*14 + 1 , 32)", - "taking_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) = 1, substr(input, 4 + 32*6 + 1, 32), substr(input, 4 + 32*12 + 1, 32))", - "deadline": "substr(input , 4 + 32*1 + 24 + 1 , 8)", - "nonce": "substr(input , 4 + 32*3 + 1 , 32)", - "order_hash": "substr(input , 4 + 32*10 + 1 , 16)", - }, - "0xefe34fe6": { - "name": "settleMulti", - "event": "0xadd7095becdaa725f0f33243630938c861b0bba83dfd217d4055701aa768ec2e", - "_order_beginning": "4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8))", - "number": "coalesce(try(greatest( - bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) + 24 + 1, 8)) - , bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*5 + 24 + 1, 8)) + 24 + 1, 8)) - )), 1)", - "_maker_parts": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*5 + 24 + 1, 8)) + 24 + 1, 8)", - "_taker_parts": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) + 24 + 1, 8)", - "maker": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*2 + 12 + 1, 20)", - "taker": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 12 + 1, 20)", - "receiver": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*8 + 12 + 1, 20)", - "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*5 + 24 + 1, 8)) + 32 * least(x, bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*5 + 24 + 1, 8)) + 24 + 1, 8))) + 12 + 1, 20)", - "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) + 32 * least(x, bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*4 + 24 + 1, 8)) + 24 + 1, 8))) + 12 + 1, 20)", - "making_amount": "substr( - input - , 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) - + bytearray_to_bigint(substr( - input - , 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*7 + 24 + 1 - , 8 - )) - + 32 * least(x, bytearray_to_bigint(substr( - input - , 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) - + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*7 + 24 + 1, 8)) - + 24 + 1 - , 8 - ))) - + 1 - , 32 - )", - "taking_amount": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*6 + 24 + 1, 8)) + 32 * least(x, bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*6 + 24 + 1, 8)) + 24 + 1, 8))) + 1, 32)", - "deadline": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1 + 24 + 1, 8)", - "nonce": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*3 + 1, 32)", - "order_hash": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*10 + 1, 16)", - } - }, - } -%} +-- designing methods -{{ return(cfg) }} +{% set methods = [] %} + +-- ZeroEx -- + +{% set _beginning = "4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8))" %} +{% set _maker_data = "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*10 + 24 + 1, 8))" %} +{% set _taker_data = "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*11 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xb4be83d5", + "name": "fillOrder", + "event": "0x0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c371129", + "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_asset": "substr(input , " ~ _beginning ~ " + " ~ _maker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "taker_asset": "substr(input , " ~ _beginning ~ " + " ~ _taker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "taking_amount": "substr(output , 32*1 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x9b44d556", + "name": "fillOrder", + "event": "0x6869791f0a34781b29882982cc39e882768cf2c96995c2a110c577c53bc932d5", + "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_asset": "substr(input , " ~ _beginning ~ " + " ~ _maker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "taker_asset": "substr(input , " ~ _beginning ~ " + " ~ _taker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "taking_amount": "substr(output , 32*1 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x64a3bc15", + "name": "fillOrKillOrder", + "event": "0x0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c371129", + "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_asset": "substr(input , " ~ _beginning ~ " + " ~ _maker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "taker_asset": "substr(input , " ~ _beginning ~ " + " ~ _taker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "taking_amount": "substr(output , 32*1 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x3e228bae", + "name": "fillOrderNoThrow", + "event": "0x0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c371129", + "maker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_asset": "substr(input , " ~ _beginning ~ " + " ~ _maker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "taker_asset": "substr(input , " ~ _beginning ~ " + " ~ _taker_data ~ " + 32*1 + 4 + 12 + 1, 20)", + "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "taking_amount": "substr(output , 32*1 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xf6274f66", + "name": "fillLimitOrder", + "event": "0xab614d2b738543c0ea21f56347cf696a3a0c42a7cbec3212a5ca22a4dcff2124", + "maker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x414e4ccf", + "name": "_fillLimitOrder", + "event": "0xab614d2b738543c0ea21f56347cf696a3a0c42a7cbec3212a5ca22a4dcff2124", + "maker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x9240529c", + "name": "fillOrKillLimitOrder", + "event": "0xab614d2b738543c0ea21f56347cf696a3a0c42a7cbec3212a5ca22a4dcff2124", + "maker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xdac748d4", + "name": "fillOtcOrder", + "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xe4ba8439", + "name": "_fillOtcOrder", + "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xa578efaf", + "name": "fillOtcOrderForEth", + "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x706394d5", + "name": "fillOtcOrderWithEth", + "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x724d3953", + "name": "fillTakerSignedOtcOrderForEth", + "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x4f948110", + "name": "fillTakerSignedOtcOrder", + "event": "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xaa77476c", + "name": "fillRfqOrder", + "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xaa6b21cd", + "name": "_fillRfqOrder", + "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0xa656186b", + "name": "_fillRfqOrder", + "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*1 + 1 , 32)", + "taking_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "ZeroEx", + "selector": "0x438cdfc5", + "name": "fillOrKillRfqOrder", + "event": "0x829fa99d94dc4636925b38632e625736a614c154d55006b7ab6bea979c210c32", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", +}] %} + +-- Hashflow -- + +{% set methods = methods + [{ + "project": "Hashflow", + "selector": "0x1e9a2e92", + "name": "tradeSingleHop", + "event": "0xb709ddcc6550418e9b89df1f4938071eeaa3f6376309904c77e15d46b16066f5", + "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "maker_external": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*7 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*6 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*10 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*9 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Hashflow", + "selector": "0xf0210929", + "name": "tradeSingleHop", + "event": "0x8cf3dec1929508e5677d7db003124e74802bfba7250a572205a9986d86ca9f1e", + "maker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_external": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*6 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*9 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Hashflow", + "selector": "0xc52ac720", + "name": "tradeRFQT", + "event": "0x34f57786fb01682fb4eec88d340387ef01a168fe345ea5b76f709d4e560c10eb", + "maker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "maker_external": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*6 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*9 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", + "order_hash": "substr(input , 4 + 32*12 + 1 , 32)", +}] %} + +-- Native -- + +{% set methods = methods + [{ + "project": "Native", + "selector": "0xe525b10b", + "name": "tradeRFQT", + "event": "0x32f38ef2842789f9cd8fd5ae2497e7acfd3ca27d341fa0878305c3072b63a06d", + "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "taker": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*8 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", + "order_hash": "substr(input , 4 + 32*11 + 1 , 16)", +}] %} +{% set _beginning = "4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*1 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Native", + "selector": "0xc7cd9748", + "name": "exactInputSingle", + "event": "0x0c3ca67555399daacbfbeef89219bf4eca6380fdc58f2ed80cdc0841616c5818", + "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "maker_asset": "substr(input , " ~ _beginning ~ " + 32*2 + 20*3 + 1, 20)", + "taker_asset": "substr(input , " ~ _beginning ~ " + 32*2 + 20*4 + 1, 20)", + "maker_min_amount": "substr(input , 4 + 32*4 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "order_hash": "substr(input , " ~ _beginning ~ " + 32*8 + 24 + 1, 16)", +}] %} +{% set methods = methods + [{ + "project": "Native", + "selector": "0x2794949c", + "name": "exactInputSingle", + "event": "null", + "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "maker_asset": "substr(input , " ~ _beginning ~ " + 32*2 + 20*3 + 1, 20)", + "taker_asset": "substr(input , " ~ _beginning ~ " + 32*2 + 20*4 + 1, 20)", + "taker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "taking_amount": "substr(input , " ~ _beginning ~ " + 32*2 + 20*5 + 32*1 + 1, 32)", +}] %} +{% set _order_length = "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Native", + "selector": "0x5dc7b981", + "name": "exactInput", + "event": "null", + "maker": "substr(input, " ~ _beginning ~ " + 32*2 + 1, 20)", + "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "maker_asset": "substr(input, " ~ _beginning ~ " + 32*1 + " ~ _order_length ~ " / 32 * 32 - 32*6 - 18 + 1, 20)", + "taker_asset": "substr(input, " ~ _beginning ~ " + 32*2 + 20*4 + 1, 20)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "taking_amount": "substr(input, " ~ _beginning ~ " + 32*2 + 20*5 + 32*1 + 1, 32)", +}] %} +{% set methods = methods + [{ + "project": "Native", + "selector": "0x68ab0bdb", + "name": "exactInput", + "event": "null", + "maker": "substr(input, " ~ _beginning ~ " + 32*2 + 1, 20)", + "taker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "maker_asset": "substr(input, " ~ _beginning ~ " + 32*14 + 5 + 1, 20)", + "taker_asset": "substr(input, " ~ _beginning ~ " + 32*2 + 20*4 + 1, 20)", + "making_amount": "substr(output , 32*0 + 1 , 32)", + "taking_amount": "substr(input, " ~ _beginning ~ " + 32*2 + 20*5 + 32*1 + 1, 32)", +}] %} + +-- Clipper -- + +{% set methods = methods + [{ + "project": "Clipper", + "selector": "0x2b651a6c", + "name": "swap", + "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", + "taker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Clipper", + "selector": "0x4cb6864c", + "name": "sellTokenForEth", + "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", + "taker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Clipper", + "selector": "0x27a9b424", + "name": "sellEthForToken", + "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", + "taker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "taker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", + "maker_max_amount": "substr(input , 4 + 32*1 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Clipper", + "selector": "0x3b26e4eb", + "name": "transmitAndSwap", + "event": "0x4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c8", + "taker": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*0 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*3 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*2 + 1 , 32)", +}] %} + +-- Swaap -- + +{% set methods = methods + [{ + "project": "Swaap", + "selector": "0x52bbbe29", + "name": "swap", + "event": "0x2170c741c41531aec20e7c107c24eecfdd15e69c9bb0a8dd37b1840b9e0b207b", + "taker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "pool": "substr(input , 4 + 32*7 + 1 , 32)", + "maker_asset": "substr(input , 4 + 32*10 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*9 + 12 + 1 , 20)", + "taker_max_amount": "substr(input , 4 + 32*11 + 1 , 32)", + "deadline": "substr(input , 4 + 32*6 + 1 , 32)", +}] %} + +-- Paraswap -- + +{% set methods = methods + [{ + "project": "Paraswap", + "selector": "0x98f9b46b", + "name": "fillOrder", + "event": "0x6621486d9c28838df4a87d2cca5007bc2aaf6a5b5de083b1db8faf709302c473", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Paraswap", + "selector": "0xc88ae6dc", + "name": "partialFillOrder", + "event": "0x6621486d9c28838df4a87d2cca5007bc2aaf6a5b5de083b1db8faf709302c473", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Paraswap", + "selector": "0x24abf828", + "name": "partialFillOrderWithTarget", + "event": "0x6621486d9c28838df4a87d2cca5007bc2aaf6a5b5de083b1db8faf709302c473", + "maker": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*3 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "making_amount": "substr(output , 32*0 + 1 , 32)", +}] %} +{% set methods = methods + [{ + "project": "Paraswap", + "selector": "0xfbc69a30", + "name": "settleSwap", + "auction": "true", + "event": "0xece0e513cbaa408206d1b097118463feab4b263a1c43dd6896e8951cdb53e7d9", + "maker": "substr(input , 4 + 32*10 + 12 + 1 , 20)", + "receiver": "substr(input , 4 + 32*11 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*12 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*13 + 12 + 1 , 20)", + "taker_min_amount": "substr(input , 4 + 32*15 + 1 , 32)", + "making_amount": "substr(input , 4 + 32*14 + 1 , 32)", + "deadline": "substr(input , 4 + 32*16 + 1 , 32)", + "end": "cast(bytearray_to_uint256(substr(input, 4 + 32*17 + 1, 32)) / 1000 as varbinary)", +}] %} + +-- CoWSwap -- + +{% set _beginning = "4 + bytearray_to_bigint(substr(input, 4 + 32*2 + 24 + 1, 8))" %} +{% set _order_beginning = _beginning ~ " + 32*1 + bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*x + 24 + 1, 8))" %} +{% set _executed_amount = "substr(input, " ~ _order_beginning ~ " + 32*9 + 1, 32)" %} +{% set methods = methods + [{ + "project": "CoWSwap", + "selector": "0x13d79a0b", + "name": "settle", + "auction": "true", + "event": "0xa07a543ab8a018198e99ca0184c93fe9050a79400a0a723441f84de1d972cc17", + "number": "coalesce(try(bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 24 + 1, 8))), 1)", + "maker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*(bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + 32*0 + 24 + 1, 8)) + 1) + 12 + 1, 20)", + "taker_asset": "substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*(bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + 32*1 + 24 + 1, 8)) + 1) + 12 + 1, 20)", + "receiver": "substr(input, " ~ _order_beginning ~ " + 32*2 + 12 + 1, 20)", + "maker_max_amount": "substr(input, " ~ _order_beginning ~ " + 32*3 + 1, 32)", + "taker_max_amount": "substr(input, " ~ _order_beginning ~ " + 32*4 + 1, 32)", + "deadline": "substr(input, " ~ _order_beginning ~ " + 32*5 + 1, 32)", + "fee_amount": "substr(input, " ~ _order_beginning ~ " + 32*7 + 1, 32)", + "making_amount": "if(bitwise_and(bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + 32*8 + 31 + 1, 1)), bytearray_to_bigint(0x01)) = 0, " ~ _executed_amount ~ ")", + "taking_amount": "if(bitwise_and(bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + 32*8 + 31 + 1, 1)), bytearray_to_bigint(0x01)) > 0, " ~ _executed_amount ~ ")", + "condition": "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 24 + 1, 8)) > 0", +}] %} + +-- Uniswap -- + +{% set _taker_data = "4 + 32*4 + bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8))" %} +{% set _recipients = "bytearray_to_bigint(substr(input, " ~ _taker_data ~ " + 32*1 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Uniswap", + "selector": "0x3f62192e", + "tag": "'UniswapXV1'", + "name": "execute", + "auction": "true", + "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", + "maker": "substr(input, 4 + 32*15 + 12 + 1 , 20)", + "receiver": "substr(input, " ~ _taker_data ~ " + 32*5 + 12 + 1, 20)", + "maker_asset": "substr(input, 4 + 32*10 + 12 + 1 , 20)", + "taker_asset": "substr(input, " ~ _taker_data ~ " + 32*2 + 12 + 1, 20)", + "maker_max_amount": "substr(input, 4 + 32*11 + 1 , 32)", + "maker_min_amount": "substr(input, 4 + 32*12 + 1 , 32)", + "taker_max_amount": "substr(input, " ~ _taker_data ~ " + 32*3 + 1, 32)", + "taker_min_amount": "substr(input, " ~ _taker_data ~ " + 32*4 + 1, 32)", + "start": "substr(input, 4 + 32*6 + 1 , 32)", + "end": "substr(input, 4 + 32*7 + 1 , 32)", + "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + 32*17 + 1, 32))) as varbinary)", + "nonce": "substr(input, 4 + 32*16 + 1 , 32)", + "fee_asset": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*6 + 12 + 1, 20))", + "fee_max_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*7 + 1, 32))", + "fee_min_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*8 + 1, 32))", + "fee_receiver": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*9 + 12 + 1, 20))", +}] %} +{% set _taker_data = "4 + 32*5 + bytearray_to_bigint(substr(input, 4 + 32*14 + 24 + 1, 8))" %} +{% set _recipients = "bytearray_to_bigint(substr(input, " ~ _taker_data ~ " + 32*1 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Uniswap", + "selector": "0x0d335884", + "tag": "'UniswapXV1'", + "name": "executeWithCallback", + "auction": "true", + "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", + "maker": "substr(input, 4 + 32*16 + 12 + 1 , 20)", + "receiver": "substr(input, " ~ _taker_data ~ " + 32*5 + 12 + 1, 20)", + "maker_asset": "substr(input, 4 + 32*11 + 12 + 1 , 20)", + "taker_asset": "substr(input, " ~ _taker_data ~ " + 32*2 + 12 + 1, 20)", + "maker_max_amount": "substr(input, 4 + 32*12 + 1 , 32)", + "maker_min_amount": "substr(input, 4 + 32*13 + 1 , 32)", + "taker_max_amount": "substr(input, " ~ _taker_data ~ " + 32*3 + 1, 32)", + "taker_min_amount": "substr(input, " ~ _taker_data ~ " + 32*4 + 1, 32)", + "start": "substr(input, 4 + 32*7 + 1 , 32)", + "end": "substr(input, 4 + 32*8 + 1 , 32)", + "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + 32*18 + 1, 32))) as varbinary)", + "nonce": "substr(input, 4 + 32*17 + 1 , 32)", + "fee_asset": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*6 + 12 + 1, 20))", + "fee_max_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*7 + 1, 32))", + "fee_min_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*8 + 1, 32))", + "fee_receiver": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*9 + 12 + 1, 20))", +}] %} +{% set _order_beginning = "4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*2 + 32*(x - 1) + 24 + 1, 8))" %} +{% set _taker_data = "bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + 32*12 + 24 + 1, 8))" %} +{% set _recipients = "bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*4 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Uniswap", + "selector": "0x0d7a16c3", + "tag": "'UniswapXV1'", + "name": "executeBatch", + "auction": "true", + "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", + "number": "coalesce(try(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 24 + 1, 8))), 1)", + "maker": "substr(input, " ~ _order_beginning ~ " + 32*14 + 12 + 1, 20)", + "receiver": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*8 + 12 + 1, 20)", + "maker_asset": "substr(input, " ~ _order_beginning ~ " + 32*9 + 12 + 1, 20)", + "taker_asset": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*5 + 12 + 1, 20)", + "maker_max_amount": "substr(input, " ~ _order_beginning ~ " + 32*10 + 1, 32)", + "maker_min_amount": "substr(input, " ~ _order_beginning ~ " + 32*11 + 1, 32)", + "taker_max_amount": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*6 + 1, 32)", + "taker_min_amount": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*7 + 1, 32)", + "start": "substr(input, " ~ _order_beginning ~ " + 32*5 + 1, 32)", + "end": "substr(input, " ~ _order_beginning ~ " + 32*6 + 1, 32)", + "deadline": "cast(abs(bytearray_to_int256(substr(input, " ~ _order_beginning ~ " + 32*16 + 1, 32))) as varbinary)", + "nonce": "substr(input, " ~ _order_beginning ~ " + 32*15 + 1, 32)", + "fee_asset": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*9 + 12 + 1, 20))", + "fee_max_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*10 + 1, 32))", + "fee_min_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*11 + 1, 32))", + "fee_receiver": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*12 + 12 + 1, 20))", +}] %} +{% set _beginning = "4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1" %} +{% set _order_beginning = _beginning ~ " + bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*(x - 1) + 24 + 1, 8))" %} +{% set _taker_data = "bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + 32*12 + 24 + 1, 8))" %} +{% set _recipients = "bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*4 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Uniswap", + "selector": "0x13fb72c7", + "tag": "'UniswapXV1'", + "name": "executeBatchWithCallback", + "auction": "true", + "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", + "number": "coalesce(try(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 24 + 1, 8))), 1)", + "maker": "substr(input, " ~ _order_beginning ~ " + 32*14 + 12 + 1, 20)", + "receiver": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*8 + 12 + 1, 20)", + "maker_asset": "substr(input, " ~ _order_beginning ~ " + 32*9 + 12 + 1, 20)", + "taker_asset": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*5 + 12 + 1, 20)", + "maker_max_amount": "substr(input, " ~ _order_beginning ~ " + 32*10 + 1, 32)", + "maker_min_amount": "substr(input, " ~ _order_beginning ~ " + 32*11 + 1, 32)", + "taker_max_amount": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*6 + 1, 32)", + "taker_min_amount": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*7 + 1, 32)", + "start": "substr(input, " ~ _order_beginning ~ " + 32*5 + 1, 32)", + "end": "substr(input, " ~ _order_beginning ~ " + 32*6 + 1, 32)", + "deadline": "cast(abs(bytearray_to_int256(substr(input, " ~ _order_beginning ~ " + 32*16 + 1, 32))) as varbinary)", + "nonce": "substr(input, " ~ _order_beginning ~ " + 32*15 + 1, 32)", + "fee_asset": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*9 + 12 + 1, 20))", + "fee_max_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*10 + 1, 32))", + "fee_min_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*11 + 1, 32))", + "fee_receiver": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*12 + 12 + 1, 20))", +}] %} +{% set _taker_data = "4 + 32*1 + bytearray_to_bigint(substr(input, 4 + 32*10 + 24 + 1, 8))" %} +{% set _recipients = "bytearray_to_bigint(substr(input, " ~ _taker_data ~ " + 32*4 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Uniswap", + "selector": "0x3f62192e", + "tag": "'UniswapXV2'", + "name": "execute", + "auction": "true", + "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", + "maker": "substr(input, 4 + 32*14 + 12 + 1 , 20)", + "receiver": "substr(input, " ~ _taker_data ~ " + 32*8 + 12 + 1, 20)", + "maker_asset": "substr(input, 4 + 32*7 + 12 + 1 , 20)", + "taker_asset": "substr(input, " ~ _taker_data ~ " + 32*5 + 12 + 1, 20)", + "maker_max_amount": "substr(input, 4 + 32*8 + 1 , 32)", + "maker_min_amount": "substr(input, 4 + 32*9 + 1 , 32)", + "taker_max_amount": "substr(input, " ~ _taker_data ~ " + 32*6 + 1, 32)", + "taker_min_amount": "substr(input, " ~ _taker_data ~ " + 32*7 + 1, 32)", + "start": "substr(input, " ~ _taker_data ~ " + 32*4 + 32*1 + 32*4*(" ~ _recipients ~ ") + 1, 32)", + "end": "substr(input, " ~ _taker_data ~ " + 32*4 + 32*1 + 32*4*(" ~ _recipients ~ ") + 32*1 + 1, 32)", + "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + 32*16 + 1, 32))) as varbinary)", + "nonce": "substr(input, 4 + 32*15 + 1 , 32)", + "fee_asset": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*9 + 12 + 1, 20))", + "fee_max_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*10 + 1, 32))", + "fee_min_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*11 + 1, 32))", + "fee_receiver": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*12 + 12 + 1, 20))", +}] %} +{% set _taker_data = "4 + 32*2 + bytearray_to_bigint(substr(input, 4 + 32*11 + 24 + 1, 8))" %} +{% set _recipients = "bytearray_to_bigint(substr(input, " ~ _taker_data ~ " + 32*4 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Uniswap", + "selector": "0x0d335884", + "tag": "'UniswapXV2'", + "name": "executeWithCallback", + "auction": "true", + "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", + "maker": "substr(input, 4 + 32*15 + 12 + 1 , 20)", + "receiver": "substr(input, " ~ _taker_data ~ " + 32*8 + 12 + 1, 20)", + "maker_asset": "substr(input, 4 + 32*8 + 12 + 1 , 20)", + "taker_asset": "substr(input, " ~ _taker_data ~ " + 32*5 + 12 + 1, 20)", + "maker_max_amount": "substr(input, 4 + 32*9 + 1 , 32)", + "maker_min_amount": "substr(input, 4 + 32*10 + 1 , 32)", + "taker_max_amount": "substr(input, " ~ _taker_data ~ " + 32*6 + 1, 32)", + "taker_min_amount": "substr(input, " ~ _taker_data ~ " + 32*7 + 1, 32)", + "start": "substr(input, " ~ _taker_data ~ " + 32*4 + 32*1 + 32*4*(" ~ _recipients ~ ") + 1, 32)", + "end": "substr(input, " ~ _taker_data ~ " + 32*4 + 32*1 + 32*4*(" ~ _recipients ~ ") + 32*1 + 1, 32)", + "deadline": "cast(abs(bytearray_to_int256(substr(input, 4 + 32*17 + 1, 32))) as varbinary)", + "nonce": "substr(input, 4 + 32*16 + 1 , 32)", + "fee_asset": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*9 + 12 + 1, 20))", + "fee_max_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*10 + 1, 32))", + "fee_min_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*11 + 1, 32))", + "fee_receiver": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _taker_data ~ " + 32*12 + 12 + 1, 20))", +}] %} +{% set _beginning = "4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 32*1" %} +{% set _order_beginning = _beginning ~ " + bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*(x - 1) + 24 + 1, 8))" %} +{% set _taker_data = "bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + 32*9 + 24 + 1, 8))" %} +{% set _recipients = "bytearray_to_bigint(substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*4 + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Uniswap", + "selector": "0x13fb72c7", + "tag": "'UniswapXV2'", + "name": "executeBatchWithCallback", + "auction": "true", + "event": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66", + "number": "coalesce(try(bytearray_to_bigint(substr(input, 4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8)) + 24 + 1, 8))), 1)", + "maker": "substr(input, " ~ _order_beginning ~ " + 32*13 + 12 + 1, 20)", + "receiver": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*8 + 12 + 1, 20)", + "maker_asset": "substr(input, " ~ _order_beginning ~ " + 32*6 + 12 + 1, 20)", + "taker_asset": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*5 + 12 + 1, 20)", + "maker_max_amount": "substr(input, " ~ _order_beginning ~ " + 32*7 + 1, 32)", + "maker_min_amount": "substr(input, " ~ _order_beginning ~ " + 32*8 + 1, 32)", + "taker_max_amount": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*6 + 1, 32)", + "taker_min_amount": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*7 + 1, 32)", + "start": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*4 + 32*1 + 32*4*(" ~ _recipients ~ ") + 1, 32)", + "end": "substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*4 + 32*1 + 32*4*(" ~ _recipients ~ ") + 32*1 + 1, 32)", + "deadline": "cast(abs(bytearray_to_int256(substr(input, " ~ _order_beginning ~ " + 32*15 + 1, 32))) as varbinary)", + "nonce": "substr(input, " ~ _order_beginning ~ " + 32*14 + 1, 32)", + "fee_asset": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*9 + 12 + 1, 20))", + "fee_max_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*10 + 1, 32))", + "fee_min_amount": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*11 + 1, 32))", + "fee_receiver": "if(" ~ _recipients ~ " > 1, substr(input, " ~ _order_beginning ~ " + " ~ _taker_data ~ " + 32*12 + 12 + 1, 20))", +}] %} + +-- Bebop -- + +{% set methods = methods + [{ + "project": "Bebop", + "selector": "0x1a499026", + "name": "settleSingle", + "auction": "true", + "event": "0xadd7095becdaa725f0f33243630938c861b0bba83dfd217d4055701aa768ec2e", + "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "taker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "receiver": "substr(input , 4 + 32*8 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", + "making_amount": "substr(input , 4 + 32*14 + 1 , 32)", + "taking_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) = 1, substr(input, 4 + 32*6 + 1, 32), substr(input, 4 + 32*12 + 1, 32))", + "deadline": "substr(input , 4 + 32*1 + 1 , 32)", + "nonce": "substr(input , 4 + 32*3 + 1 , 32)", + "order_hash": "substr(input , 4 + 32*10 + 1 , 16)", +}] %} +{% set methods = methods + [{ + "project": "Bebop", + "selector": "0x38ec0211", + "name": "settleSingleAndSignPermit2", + "auction": "true", + "event": "0xadd7095becdaa725f0f33243630938c861b0bba83dfd217d4055701aa768ec2e", + "maker": "substr(input , 4 + 32*2 + 12 + 1 , 20)", + "taker": "substr(input , 4 + 32*1 + 12 + 1 , 20)", + "receiver": "substr(input , 4 + 32*8 + 12 + 1 , 20)", + "maker_asset": "substr(input , 4 + 32*5 + 12 + 1 , 20)", + "taker_asset": "substr(input , 4 + 32*4 + 12 + 1 , 20)", + "maker_max_amount": "substr(input , 4 + 32*7 + 1 , 32)", + "taker_max_amount": "substr(input , 4 + 32*6 + 1 , 32)", + "making_amount": "substr(input , 4 + 32*14 + 1 , 32)", + "taking_amount": "if(bytearray_to_bigint(substr(input, 4 + 32*13 + 24 + 1, 8)) = 1, substr(input, 4 + 32*6 + 1, 32), substr(input, 4 + 32*12 + 1, 32))", + "deadline": "substr(input , 4 + 32*1 + 1 , 32)", + "nonce": "substr(input , 4 + 32*3 + 1 , 32)", + "order_hash": "substr(input , 4 + 32*10 + 1 , 16)", +}] %} +{% set _beginning = "4 + bytearray_to_bigint(substr(input, 4 + 24 + 1, 8))" %} +{% set _maker_data = "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*5 + 24 + 1, 8))" %} +{% set _taker_data = "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*4 + 24 + 1, 8))" %} +{% set _maker_parts = "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + " ~ _maker_data ~ " + 24 + 1, 8))" %} +{% set _taker_parts = "bytearray_to_bigint(substr(input, " ~ _beginning ~ " + " ~ _taker_data ~ " + 24 + 1, 8))" %} +{% set methods = methods + [{ + "project": "Bebop", + "selector": "0xefe34fe6", + "name": "settleMulti", + "auction": "true", + "event": "0xadd7095becdaa725f0f33243630938c861b0bba83dfd217d4055701aa768ec2e", + "number": "coalesce(try(greatest(" ~ _maker_parts ~ ", " ~ _taker_parts ~ ")), 1)", + "_maker_parts": "substr(input, " ~ _beginning ~ " + " ~ _maker_data ~ " + 24 + 1, 8)", + "_taker_parts": "substr(input, " ~ _beginning ~ " + " ~ _taker_data ~ " + 24 + 1, 8)", + "maker": "substr(input, " ~ _beginning ~ " + 32*2 + 12 + 1 , 20)", + "taker": "substr(input, " ~ _beginning ~ " + 32*1 + 12 + 1 , 20)", + "receiver": "substr(input, " ~ _beginning ~ " + 32*8 + 12 + 1 , 20)", + "maker_asset": "substr(input, " ~ _beginning ~ " + " ~ _maker_data ~ " + 32 * least(x, " ~ _maker_parts ~ ") + 12 + 1, 20)", + "taker_asset": "substr(input, " ~ _beginning ~ " + " ~ _taker_data ~ " + 32 * least(x, " ~ _taker_parts ~ ") + 12 + 1, 20)", + "making_amount": "substr(input, " ~ _beginning ~ " + bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*7 + 24 + 1, 8)) + 32 * least(x, bytearray_to_bigint(substr(input, " ~ _beginning ~ " + bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*7 + 24 + 1, 8)) + 24 + 1, 8))) + 1, 32)", + "taking_amount": "substr(input, " ~ _beginning ~ " + bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*6 + 24 + 1, 8)) + 32 * least(x, bytearray_to_bigint(substr(input, " ~ _beginning ~ " + bytearray_to_bigint(substr(input, " ~ _beginning ~ " + 32*6 + 24 + 1, 8)) + 24 + 1, 8))) + 1, 32)", + "deadline": "substr(input, " ~ _beginning ~ " + 32*1 + 1 , 32)", + "nonce": "substr(input, " ~ _beginning ~ " + 32*3 + 1 , 32)", + "order_hash": "substr(input, " ~ _beginning ~ " + 32*10 + 1 , 16)", +}] %} + +{{ return(methods) }} {% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_macro.sql index db88d73c2f8..38baf0dec05 100644 --- a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_macro.sql +++ b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_macro.sql @@ -80,6 +80,7 @@ logs as ( , call_type , call_error , method + , auction , topic0 , trade['trade'] as call_trade , trade['maker'] as call_maker @@ -110,8 +111,7 @@ logs as ( , input , output from ( - {% for project, selectors in oneinch_project_orders_cfg_methods_macro().items() %} - {% for selector, method_data in selectors.items() %} + {% for item in oneinch_project_orders_cfg_methods_macro() %} select blockchain , project @@ -129,35 +129,36 @@ logs as ( , gas_used as call_gas_used , call_type , error as call_error - , '{{ method_data["name"] }}' as method - , {{ method_data["event"] }} as topic0 - , coalesce({{ method_data.get("number", "1") }}, 1) as call_trades -- total trades in the call - , transform(sequence(1, coalesce({{ method_data.get("number", "1") }}, 1)), x -> map_from_entries(array[ + , '{{ item["name"] }}' as method + , {{ item.get("auction", "false") }} as auction + , {{ item.get("event", "null") }} as topic0 + , coalesce({{ item.get("number", "1") }}, 1) as call_trades -- total trades in the call + , transform(sequence(1, coalesce({{ item.get("number", "1") }}, 1)), x -> map_from_entries(array[ ('trade', try(to_big_endian_64(x))) - , ('maker', {{ method_data.get("maker", "null") }}) - , ('taker', {{ method_data.get("taker", "null") }}) - , ('receiver', {{ method_data.get("receiver", "null") }}) - , ('pool', {{ method_data.get("pool", "null") }}) - , ('maker_asset', {{ method_data.get("maker_asset", "null") }}) - , ('taker_asset', {{ method_data.get("taker_asset", "null") }}) - , ('maker_max_amount', {{ method_data.get("maker_max_amount", "null") }}) - , ('taker_max_amount', {{ method_data.get("taker_max_amount", "null") }}) - , ('maker_min_amount', {{ method_data.get("maker_min_amount", "null") }}) - , ('taker_min_amount', {{ method_data.get("taker_min_amount", "null") }}) - , ('making_amount', {{ method_data.get("making_amount", "null") }}) - , ('taking_amount', {{ method_data.get("taking_amount", "null") }}) - , ('start', {{ method_data.get("start", "null") }}) - , ('end', {{ method_data.get("end", "null") }}) - , ('deadline', {{ method_data.get("deadline", "null") }}) - , ('fee_asset', {{ method_data.get("fee_asset", "null") }}) - , ('fee_max_amount', {{ method_data.get("fee_max_amount", "null") }}) - , ('fee_min_amount', {{ method_data.get("fee_min_amount", "null") }}) - , ('fee_amount', {{ method_data.get("fee_amount", "null") }}) - , ('fee_receiver', {{ method_data.get("fee_receiver", "null") }}) - , ('nonce', {{ method_data.get("nonce", "null") }}) - , ('order_hash', {{ method_data.get("order_hash", "null") }}) - , ('_maker_parts', {{ method_data.get("_maker_parts", "0x01") }}) - , ('_taker_parts', {{ method_data.get("_taker_parts", "0x01") }}) + , ('maker', {{ item.get("maker", "null") }}) + , ('taker', {{ item.get("taker", "null") }}) + , ('receiver', {{ item.get("receiver", "null") }}) + , ('pool', {{ item.get("pool", "null") }}) + , ('maker_asset', {{ item.get("maker_asset", "null") }}) + , ('taker_asset', {{ item.get("taker_asset", "null") }}) + , ('maker_max_amount', {{ item.get("maker_max_amount", "null") }}) + , ('taker_max_amount', {{ item.get("taker_max_amount", "null") }}) + , ('maker_min_amount', {{ item.get("maker_min_amount", "null") }}) + , ('taker_min_amount', {{ item.get("taker_min_amount", "null") }}) + , ('making_amount', {{ item.get("making_amount", "null") }}) + , ('taking_amount', {{ item.get("taking_amount", "null") }}) + , ('start', {{ item.get("start", "null") }}) + , ('end', {{ item.get("end", "null") }}) + , ('deadline', {{ item.get("deadline", "null") }}) + , ('fee_asset', {{ item.get("fee_asset", "null") }}) + , ('fee_max_amount', {{ item.get("fee_max_amount", "null") }}) + , ('fee_min_amount', {{ item.get("fee_min_amount", "null") }}) + , ('fee_amount', {{ item.get("fee_amount", "null") }}) + , ('fee_receiver', {{ item.get("fee_receiver", "null") }}) + , ('nonce', {{ item.get("nonce", "null") }}) + , ('order_hash', {{ item.get("order_hash", "null") }}) + , ('_maker_parts', {{ item.get("_maker_parts", "0x01") }}) + , ('_taker_parts', {{ item.get("_taker_parts", "0x01") }}) ])) as trades , input , output @@ -167,18 +168,17 @@ logs as ( from {{ ref('oneinch_' + blockchain + '_mapped_contracts') }} where blockchain = '{{ blockchain }}' - and '{{ project }}' in (project, tag) + and project = '{{ item["project"] }}' + and coalesce({{ item.get("tag", "null") }} = tag, true) ) using("to") where {% if is_incremental() %}{{ incremental_predicate('block_time') }} {% else %}block_time > greatest(first_created_at, timestamp '{{date_from}}'){% endif %} - and substr(input, 1, 4) = {{ selector }} - and {{ method_data.get("condition", "true") }} + and substr(input, 1, 4) = {{ item["selector"] }} + and {{ item.get("condition", "true") }} {% if not loop.last %}union all{% endif %} {% endfor %} - {% if not loop.last %}union all{% endif %} - {% endfor %} ), unnest(trades) as trades(trade) ) ) @@ -245,7 +245,7 @@ select , project , tag , map_concat(flags, map_from_entries(array[ - ('auction', coalesce(order_end - order_start, uint256 '0') > uint256 '0' or project in ('CoWSwap', 'Bebop')) + ('auction', coalesce(auction, false) and coalesce(try(order_end - order_start > uint256 '0'), true)) ])) as flags , block_number , block_time @@ -272,8 +272,8 @@ select , taker_max_amount , maker_min_amount , taker_min_amount - , coalesce(making_amount, if(order_start = uint256 '0' or order_start = order_end, maker_max_amount, maker_max_amount - cast(to_unixtime(block_time) - order_start as double) / (order_end - order_start) * (cast(maker_max_amount as double) - cast(maker_min_amount as double))), maker_max_amount, maker_min_amount) as making_amount - , coalesce(taking_amount, if(order_start = uint256 '0' or order_start = order_end, taker_max_amount, taker_max_amount - cast(to_unixtime(block_time) - order_start as double) / (order_end - order_start) * (cast(taker_max_amount as double) - cast(taker_min_amount as double))), taker_max_amount, taker_min_amount) as taking_amount + , coalesce(making_amount, try(if(order_start = uint256 '0' or order_start = order_end, maker_max_amount, maker_max_amount - cast(to_unixtime(block_time) - order_start as double) / (order_end - order_start) * (cast(maker_max_amount as double) - cast(maker_min_amount as double)))), maker_max_amount, maker_min_amount) as making_amount + , coalesce(taking_amount, try(if(order_start = uint256 '0' or order_start = order_end, taker_max_amount, taker_max_amount - cast(to_unixtime(block_time) - order_start as double) / (order_end - order_start) * (cast(taker_max_amount as double) - cast(taker_min_amount as double)))), taker_max_amount, taker_min_amount) as taking_amount , order_start , order_end , order_deadline diff --git a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql index 065c9017ae7..3ee6371651d 100644 --- a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql +++ b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql @@ -28,13 +28,11 @@ where {% endif %} and substr(input, 1, 4) in ( - {% set selectors_array = [] %} - {% for selectors in oneinch_project_orders_cfg_methods_macro().values() %} - {% for selector in selectors.keys() %} - {% do selectors_array.append(selector) %} - {% endfor %} + {% set selectors = [] %} + {% for item in oneinch_project_orders_cfg_methods_macro() %} + {% do selectors.append(item["selector"]) %} {% endfor %} - {{ ','.join(selectors_array) }} + {{ ','.join(selectors) }} ) {% endmacro %} diff --git a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_ptfc_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_ptfc_macro.sql new file mode 100644 index 00000000000..d56172ed36a --- /dev/null +++ b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_ptfc_macro.sql @@ -0,0 +1,104 @@ +{% macro + oneinch_project_ptfc_macro( + blockchain + ) +%} + + + +{% set transfer_selector = '0xa9059cbb' %} +{% set transferFrom_selector = '0x23b872dd' %} +{% set mint_selector = '0x40c10f19' %} +{% set burn_selector = '0x9dc29fac' %} +{% set deposit_selector = '0xd0e30db0' %} +{% set withdraw_selector = '0x2e1a7d4d' %} +{% set selector = 'substr(input, 1, 4)' %} +{% set null_address = '0x0000000000000000000000000000000000000000' %} +{% set native_address = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' %} + + + +with + +transfers as ( + select + '{{ blockchain }}' as blockchain + , block_number + , block_time + , tx_hash + , trace_address as transfer_trace_address + , case + when {{ selector }} = {{ transfer_selector }} then 'transfer' + when {{ selector }} = {{ transferFrom_selector }} then 'transferFrom' + when {{ selector }} = {{ mint_selector }} then 'mint' + when {{ selector }} = {{ burn_selector }} then 'burn' + when {{ selector }} = {{ deposit_selector }} then 'deposit' + when {{ selector }} = {{ withdraw_selector }} then 'withdraw' + else 'native' + end as type + , if(value > uint256 '0', 'native', 'erc20') as token_standard + , if(value > uint256 '0', {{ native_address }}, "to") as contract_address + , case + when {{ selector }} in ({{ transfer_selector }}, {{ mint_selector }}, {{ burn_selector }}) then bytearray_to_uint256(substr(input, 37, 32)) -- transfer, mint, burn + when {{ selector }} = {{ transferFrom_selector }} then bytearray_to_uint256(substr(input, 69, 32)) -- transferFrom + when {{ selector }} = {{ withdraw_selector }} then bytearray_to_uint256(substr(input, 5, 32)) -- withdraw + else value -- native, deposit + end as amount + , case + when {{ selector }} in ({{ transferFrom_selector }}, {{ burn_selector }}) then substr(input, 17, 20) -- transferFrom, burn + when {{ selector }} = {{ mint_selector }} then {{ null_address }} -- mint + when {{ selector }} = {{ withdraw_selector }} then "from" -- withdraw + else "from" -- transfer, native, deposit + end as transfer_from + , case + when {{ selector }} in ({{ transfer_selector }}, {{ mint_selector }}) then substr(input, 17, 20) -- transfer, mint + when {{ selector }} = {{ transferFrom_selector }} then substr(input, 49, 20) -- transferFrom + when {{ selector }} = {{ burn_selector }} then {{ null_address }} -- burn + when {{ selector }} = {{ withdraw_selector }} then "to" -- withdraw + else "to" -- native, deposit + end as transfer_to + from {{ source(blockchain, 'traces') }} + where + ( + length(input) >= 68 and {{ selector }} in ({{ transfer_selector }}, {{ mint_selector }}, {{ burn_selector }}) -- transfer, mint, burn + or length(input) >= 100 and {{ selector }} = {{ transferFrom_selector }} -- transferFrom + or length(input) >= 36 and {{ selector }} = {{ withdraw_selector }} -- withdraw + or value > uint256 '0' -- native, deposit + ) + and call_type = 'call' + and (tx_success or tx_success is null) + and success + {% if is_incremental() %}and {{ incremental_predicate('block_time') }}{% endif %} +) +-- the wrapper deposit includes two transfers: native and wrapper + +-- output + +select * +from transfers + +union all + +-- adding wrapper transfers when deposit +select + blockchain + , block_number + , block_time + , tx_hash + , transfer_trace_address + , type + , token_standard + , transfer_to as contract_address + , amount + , transfer_to as transfer_from + , transfer_from as transfer_to +from transfers +join ( + select wrapped_native_token_address as transfer_to + from {{ source('oneinch', 'blockchains') }} + where blockchain = '{{blockchain}}' +) using(transfer_to) +where + type = 'deposit' + +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_swaps_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_swaps_macro.sql index e4422aefe8c..fa58ad4863f 100644 --- a/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_swaps_macro.sql +++ b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_swaps_macro.sql @@ -6,6 +6,8 @@ %} {% set native_addresses = '(0x0000000000000000000000000000000000000000, 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)' %} +{% set native_address = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' %} +{% set zero_address = '0x0000000000000000000000000000000000000000' %} @@ -58,15 +60,14 @@ meta as ( , flags as order_flags from ( select *, row_number() over(partition by block_number, tx_hash order by call_trace_address) as counter - from {{ source('oneinch', 'lop') }} + from {{ source('oneinch_' + blockchain, 'lop') }} where - blockchain = '{{blockchain}}' + call_success {% if is_incremental() %} and {{ incremental_predicate('block_time') }} {% else %} and block_time >= timestamp '{{date_from}}' {% endif %} - and call_success ) ) @@ -88,9 +89,9 @@ meta as ( , order_hash , order_flags , maker - , maker_asset + , replace(maker_asset, {{ zero_address }}, {{ native_address }}) as maker_asset , making_amount - , taker_asset + , replace(taker_asset, {{ zero_address }}, {{ native_address }}) as taker_asset , taking_amount , array_agg(call_trace_address) over(partition by block_number, tx_hash, project) as call_trace_addresses -- to update the array after filtering nested calls of the project , if(maker_asset in {{native_addresses}}, wrapped_native_token_address, maker_asset) as _maker_asset @@ -126,6 +127,14 @@ meta as ( where blockchain = '{{blockchain}}' ) +, trusted_tokens as ( + select + distinct contract_address + , true as trusted + from {{ source('prices', 'trusted_tokens') }} + where blockchain = '{{blockchain}}' +) + , prices as ( select contract_address @@ -179,15 +188,25 @@ meta as ( ) as row( project varchar , call_trace_address array(bigint) - , tokens array(varchar) + , tokens array(row(symbol varchar, contract_address_raw varbinary)) , amount_usd double , intent boolean )) ) over(partition by block_number, tx_hash) as tx_swaps - , if( - user_amount_usd is null or caller_amount_usd is null - , coalesce(user_amount_usd, caller_amount_usd, call_amount_usd) - , greatest(user_amount_usd, caller_amount_usd) + , if(user_amount_usd_trusted is null or caller_amount_usd_trusted is null + , if( + user_amount_usd is null or caller_amount_usd is null + , coalesce( + user_amount_usd_trusted + , caller_amount_usd_trusted + , user_amount_usd + , caller_amount_usd + , call_amount_usd_trusted + , call_amount_usd + ) + , greatest(user_amount_usd, caller_amount_usd) + ) -- the user_amount & caller_amount of untrusted tokens takes precedence over the call_amount of trusted tokens + , greatest(user_amount_usd_trusted, caller_amount_usd_trusted) ) as amount_usd from ( select @@ -195,7 +214,7 @@ meta as ( , calls.block_number , calls.tx_hash , calls.call_trace_address - , call_trade_id + , calls.call_trade_id , any_value(block_time) as block_time , any_value(tx_from) as tx_from , any_value(tx_to) as tx_to @@ -213,10 +232,24 @@ meta as ( , any_value(taker_asset) as taker_asset , any_value(taking_amount) as taking_amount , any_value(order_flags) as order_flags - , array_agg(distinct if(native, native_symbol, symbol)) as tokens + , array_agg(distinct + cast(row(if(native, native_symbol, symbol), contract_address_raw) + as row(symbol varchar, contract_address_raw varbinary)) + ) as tokens + , array_agg(distinct + cast(row(if(native, native_symbol, symbol), contract_address_raw) + as row(symbol varchar, contract_address_raw varbinary)) + ) filter(where creations_from.block_number is null or creations_to.block_number is null) as user_tokens + , array_agg(distinct + cast(row(if(native, native_symbol, symbol), contract_address_raw) + as row(symbol varchar, contract_address_raw varbinary)) + ) filter(where transfer_from = call_from or transfer_to = call_from) as caller_tokens , max(amount * price / pow(10, decimals)) as call_amount_usd + , max(amount * price / pow(10, decimals)) filter(where trusted) as call_amount_usd_trusted , max(amount * price / pow(10, decimals)) filter(where creations_from.block_number is null or creations_to.block_number is null) as user_amount_usd + , max(amount * price / pow(10, decimals)) filter(where (creations_from.block_number is null or creations_to.block_number is null) and trusted) as user_amount_usd_trusted , max(amount * price / pow(10, decimals)) filter(where transfer_from = call_from or transfer_to = call_from) as caller_amount_usd + , max(amount * price / pow(10, decimals)) filter(where (transfer_from = call_from or transfer_to = call_from) and trusted) as caller_amount_usd_trusted , array_agg(distinct transfer_from) filter(where creations_from.block_number is null) as senders , array_agg(distinct transfer_to) filter(where creations_to.block_number is null) as receivers from calls @@ -226,16 +259,22 @@ meta as ( , block_time , tx_hash , transfer_trace_address - , if(type = 'native', wrapped_native_token_address, contract_address) as contract_address - , type = 'native' as native + , contract_address as contract_address_raw + , if(contract_address = {{ native_address }}, wrapped_native_token_address, contract_address) as contract_address + , contract_address = {{ native_address }} as native , amount , native_symbol , transfer_from , transfer_to , date_trunc('minute', block_time) as minute from ( - select * from {{ source('oneinch', 'parsed_transfers_from_calls') }} - where blockchain = '{{blockchain}}' + select * from ({{ oneinch_project_ptfc_macro(blockchain) }}) + where + {% if is_incremental() %} + {{ incremental_predicate('block_time') }} + {% else %} + block_time >= timestamp '{{date_from}}' + {% endif %} ), meta where {% if is_incremental() %} @@ -251,6 +290,7 @@ meta as ( and (order_hash is null or contract_address in (_maker_asset, _taker_asset) and maker in (transfer_from, transfer_to)) -- transfers related to the order only left join prices using(contract_address, minute) left join tokens using(contract_address) + left join trusted_tokens using(contract_address) left join creations as creations_from on creations_from.address = transfers.transfer_from left join creations as creations_to on creations_to.address = transfers.transfer_to group by 1, 2, 3, 4, 5 @@ -282,10 +322,15 @@ select , taking_amount , order_flags , tokens + , user_tokens + , caller_tokens , amount_usd , user_amount_usd + , user_amount_usd_trusted , caller_amount_usd + , caller_amount_usd_trusted , call_amount_usd + , call_amount_usd_trusted , tx_swaps , if(cardinality(users) = 0 or order_hash is null, array_union(users, array[tx_from]), users) as users , users as direct_users diff --git a/dbt_subprojects/daily_spellbook/models/_projects/fantasy/_schema.yml b/dbt_subprojects/daily_spellbook/models/_projects/fantasy/_schema.yml new file mode 100644 index 00000000000..6baed668877 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/fantasy/_schema.yml @@ -0,0 +1,67 @@ +version: 2 + +models: + - name: fantasy_events + meta: + blockchain: blast + project: fantasy + contributors: hildobby + config: + tags: ['blast', 'fantasy', 'events'] + description: > + All fantasy.top related events on Blast + columns: + - name: block_time + description: "UTC time of transaction" + - name: block_number + description: "Transaction block number on Blast" + - name: block_date + description: "UTC date of transaction" + - name: evt_type + description: "Type of fantasy event" + - name: user_address + description: "Address of fantasy.top user" + - name: whitelist + description: "Was this transaction only possible with a whitelist" + - name: collection + description: "The token address of the NFT involved in the transaction" + - name: cards_minted + description: "The number of minted fantasy.top cards" + - name: cards_burned + description: "The number of burned fantasy.top cards" + - name: minted_ids + description: "The list of minted fantasy.top card token ids" + - name: burned_ids + description: "The list of burned fantasy.top card token ids" + - name: traded_with + description: "Who was on the other side of this executed trade" + - name: tx_from + description: "Which address executed the transaction" + - name: tx_to + description: "The address towards which the transaction was pointed" + - name: tx_hash + description: "The hash of the transaction" + - name: tx_index + description: "The index of the transaction in the block" + - name: contract_address + description: "The address of the used smart contract" + - name: is_wash_trade + description: "Is this trade a wash trade?" + - name: token_symbol + description: "The token symbol of the used fungible" + - name: token_address + description: "The address of the used token" + - name: token_amount + description: "The amount of tokens involved in the transaction" + - name: price_usd + description: "The USD price of the fungibles used in the transaction" + - name: heroes_revenue + description: "The revenue generated for heroes" + - name: heroes_revenue_usd + description: "The revenue generated for heroes in USD" + - name: to_fantasy_treasury + description: "The amount going to fantasy's treasury excluding direct hero rewards" + - name: to_fantasy_treasury_usd + description: "The amount in USD going to fantasy's treasury excluding direct hero rewards" + - name: tactics_bought + description: "The amount of tactics tickets bought" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/fantasy/fantasy_events.sql b/dbt_subprojects/daily_spellbook/models/_projects/fantasy/fantasy_events.sql new file mode 100644 index 00000000000..4ee6c7bc4f4 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/fantasy/fantasy_events.sql @@ -0,0 +1,219 @@ +{{ config( + schema = 'fantasy', + alias = 'events', + materialized = 'view', + post_hook = '{{ expose_spells( + blockchains = \'["blast"]\', + spell_type = "project", + spell_name = "events", + contributors = \'["hildobby"]\') }}' + ) +}} + +WITH fantasy_configs AS ( + SELECT evt_block_time AS block_time + , evt_block_number AS block_number + , evt_block_date AS block_date + , mintConfigId AS config_id + , requiresWhitelist AS whitelist + , maxPacksPerAddress AS max_pack_per_address + , fixedPrice/POWER(10, 18) AS token_amount + , NULL AS traded_with + , paymentToken AS token_address + , maxPacks AS max_packs + , cardsPerPack AS cards_per_pack + , collection + , expirationTimestamp AS expiration + , merkleRoot AS merkle_root + , evt_tx_from AS tx_from + , evt_tx_to AS tx_to + , evt_tx_hash AS tx_hash + , evt_index + , contract_address + , NULL AS is_wash_trade + FROM {{ source('fantasy_blast', 'Minter_evt_NewMintConfig')}} + ) + +-- Mints +SELECT m.evt_block_time AS block_time +, m.evt_block_number AS block_number +, m.evt_block_date AS block_date +, 'Mint' AS evt_type +, m.buyer AS user_address +, c.whitelist +, c.collection +, CAST(m.lastTokenId-m.firstTokenId+1 AS double) AS cards_minted +, CAST(0 AS double) AS cards_burned +, filter(ARRAY[ + m.firstTokenId, m.firstTokenId+1, m.firstTokenId+2, m.firstTokenId+3, m.firstTokenId+4, m.firstTokenId+5, m.firstTokenId+6, m.firstTokenId+7, m.firstTokenId+8, m.firstTokenId+9 +, m.firstTokenId+10, m.firstTokenId+11, m.firstTokenId+12, m.firstTokenId+13, m.firstTokenId+14, m.firstTokenId+15, m.firstTokenId+16, m.firstTokenId+17, m.firstTokenId+18, m.firstTokenId+19 +, m.firstTokenId+20, m.firstTokenId+21, m.firstTokenId+22, m.firstTokenId+23, m.firstTokenId+24, m.firstTokenId+25, m.firstTokenId+26, m.firstTokenId+27, m.firstTokenId+28, m.firstTokenId+29 +, m.firstTokenId+30, m.firstTokenId+31, m.firstTokenId+32, m.firstTokenId+33, m.firstTokenId+34, m.firstTokenId+35, m.firstTokenId+36, m.firstTokenId+37, m.firstTokenId+38, m.firstTokenId+39 +, m.firstTokenId+40, m.firstTokenId+41, m.firstTokenId+42, m.firstTokenId+43, m.firstTokenId+44, m.firstTokenId+45, m.firstTokenId+46, m.firstTokenId+47, m.firstTokenId+48, m.firstTokenId+49 +, m.firstTokenId+50, m.firstTokenId+51, m.firstTokenId+52, m.firstTokenId+53, m.firstTokenId+54, m.firstTokenId+55, m.firstTokenId+56, m.firstTokenId+57, m.firstTokenId+58, m.firstTokenId+59 +, m.firstTokenId+60, m.firstTokenId+61, m.firstTokenId+62, m.firstTokenId+63, m.firstTokenId+64, m.firstTokenId+65, m.firstTokenId+66, m.firstTokenId+67, m.firstTokenId+68, m.firstTokenId+69 +, m.firstTokenId+70, m.firstTokenId+71, m.firstTokenId+72, m.firstTokenId+73, m.firstTokenId+74, m.firstTokenId+75, m.firstTokenId+76, m.firstTokenId+77, m.firstTokenId+78, m.firstTokenId+79 +, m.firstTokenId+80, m.firstTokenId+81, m.firstTokenId+82, m.firstTokenId+83, m.firstTokenId+84, m.firstTokenId+85, m.firstTokenId+86, m.firstTokenId+87, m.firstTokenId+88, m.firstTokenId+89 +, m.firstTokenId+90, m.firstTokenId+91, m.firstTokenId+92, m.firstTokenId+93, m.firstTokenId+94, m.firstTokenId+95, m.firstTokenId+96, m.firstTokenId+97, m.firstTokenId+98, m.firstTokenId+99 + ], x -> x <= lastTokenId) AS minted_ids +, NULL AS burned_ids +, NULL AS traded_with +, m.evt_tx_from AS tx_from +, m.evt_tx_to AS tx_to +, m.evt_tx_hash AS tx_hash +, m.evt_tx_index AS tx_index +, m.contract_address +, NULL AS is_wash_trade +, 'WETH' AS token_symbol +, 0x4300000000000000000000000000000000000004 AS token_address +, m.price/POWER(10, 18) AS token_amount +, m.price/POWER(10, 18)*pu.price AS price_usd +, 0.1*m.price/POWER(10, 18) AS heroes_revenue +, 0.1*m.price/POWER(10, 18)*pu.price AS heroes_revenue_usd +, 0.9*m.price/POWER(10, 18) AS to_fantasy_treasury +, 0.9*m.price/POWER(10, 18)*pu.price AS to_fantasy_treasury_usd +, 0 AS tactics_bought +FROM {{ source('fantasy_blast', 'Minter_evt_Mint')}} m +INNER JOIN fantasy_configs c ON m.mintConfigId=c.config_id +LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.blockchain='blast' + AND pu.contract_address=0x4300000000000000000000000000000000000004 + AND pu.minute=date_trunc('minute', m.evt_block_time) + +UNION ALL + +-- Level Ups +SELECT evt_block_time AS block_time +, evt_block_number AS block_number +, evt_block_date AS block_date +, 'Level Up' AS evt_type +, caller AS user_address +, NULL AS whitelist +, collection +, CAST(1 AS double) AS cards_minted +, CAST(cardinality(burntTokenIds) AS double) AS cards_burned +, ARRAY[mintedTokenId] AS minted_ids +, burntTokenIds AS burned_ids +, NULL AS traded_with +, evt_tx_from AS tx_from +, evt_tx_to AS tx_to +, evt_tx_hash AS tx_hash +, evt_tx_index AS tx_index +, contract_address +, NULL AS is_wash_trade +, NULL AS token_symbol +, CAST(NULL AS varbinary) AS token_address +, 0 AS token_amount +, 0 AS price_usd +, 0 AS heroes_revenue +, 0 AS heroes_revenue_usd +, 0 AS to_fantasy_treasury +, 0 AS to_fantasy_treasury_usd +, 0 AS tactics_bought +FROM {{ source('fantasy_blast', 'Minter_evt_LevelUp')}} + +UNION ALL + +-- Burns to Draw +SELECT evt_block_time AS block_time +, evt_block_number AS block_number +, evt_block_date AS block_date +, 'Burn to Draw' AS evt_type +, caller AS user_address +, NULL AS whitelist +, collection +, CAST(cardinality(mintedTokenIds) AS double) AS cards_minted +, CAST(cardinality(burntTokenIds) AS double) AS cards_burned +, mintedTokenIds AS minted_ids +, burntTokenIds AS burned_ids +, NULL AS traded_with +, evt_tx_from AS tx_from +, evt_tx_to AS tx_to +, evt_tx_hash AS tx_hash +, evt_tx_index AS tx_index +, contract_address +, NULL AS is_wash_trade +, NULL AS token_symbol +, CAST(NULL AS varbinary) AS token_address +, 0 AS token_amount +, 0 AS price_usd +, 0 AS heroes_revenue +, 0 AS heroes_revenue_usd +, 0 AS to_fantasy_treasury +, 0 AS to_fantasy_treasury_usd +, 0 AS tactics_bought +FROM {{ source('fantasy_blast', 'Minter_evt_BurnToDraw')}} + +UNION ALL + +-- Trades +SELECT nftt.block_time +, nftt.block_number +, nftt.block_date +, 'Trade' AS evt_type +, nftt.tx_from AS user_address +, false AS whitelist +, nftt.nft_contract_address AS collection +, CAST(0 AS double) AS cards_minted +, CAST(0 AS double) AS cards_burned +, NULL AS minted_ids +, NULL AS burned_ids +, CASE WHEN nftt.trade_category='Buy' THEN nftt.seller ELSE nftt.buyer END AS traded_with +, nftt.tx_from +, nftt.tx_to +, nftt.tx_hash +, txs.index AS tx_index +, nftt.project_contract_address AS contract_address +, wt.is_wash_trade +, nftt.currency_symbol AS token_symbol +, nftt.currency_contract AS token_address +, nftt.amount_original AS token_amount +, nftt.amount_usd AS price_usd +, royalty_fee_amount AS heroes_revenue +, royalty_fee_amount_usd AS heroes_revenue_usd +, platform_fee_amount AS to_fantasy_treasury +, platform_fee_amount_usd AS to_fantasy_treasury_usd +, 0 AS tactics_bought +FROM {{ source('nft', 'trades') }} nftt +INNER JOIN {{ source('blast', 'transactions') }} txs ON txs.block_number=nftt.block_number + AND txs.hash=nftt.tx_hash +LEFT JOIN {{source('nft_blast', 'wash_trades')}} wt ON wt.project = 'fantasy' + AND wt.block_number=nftt.block_number + AND wt.tx_hash=nftt.tx_hash +WHERE nftt.blockchain = 'blast' +AND nftt.project = 'fantasy' + +UNION ALL + +-- Tactics Purchases +SELECT block_time +, block_number +, block_date +, 'Tactics Purchase' AS evt_type +, tx_from AS user_address +, false AS whitelist +, NULL AS collection +, CAST(0 AS double) AS cards_minted +, CAST(0 AS double) AS cards_burned +, NULL AS minted_ids +, NULL AS burned_ids +, NULL AS traded_with +, tx_from +, tx_to +, tx_hash +, tx_index +, NULL AS contract_address +, NULL AS is_wash_trade +, symbol AS token_symbol +, contract_address AS token_address +, amount AS token_amount +, amount_usd AS price_usd +, 0.015*amount AS heroes_revenue +, 0.015*amount_usd AS heroes_revenue_usd +, 0.06*amount AS to_fantasy_treasury +, 0.06*amount_usd AS to_fantasy_treasury_usd +, ROUND(amount_usd/19.99) AS tactics_bought +FROM {{ source('tokens_blast', 'transfers') }} tt +WHERE block_number >= 4917909 +AND to = 0x4af1f00f50efbfcdf7a8f2ac02e9bc24825438ac +AND contract_address = 0x4300000000000000000000000000000000000004 +AND amount > 0 \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_event_schema.yml b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_event_schema.yml new file mode 100644 index 00000000000..73b2bedf455 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_event_schema.yml @@ -0,0 +1,821 @@ +version: 2 + +models: + - name: gmx_v2_arbitrum_order_created + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'order_created'] + description: | + Extracts and decodes the `OrderCreated` event log data from the Arbitrum blockchain. + This model processes log entries related to created orders, extracting key variables such as + account addresses, event keys, and strings representing the reason for cancellation. + + columns: + - &blockchain + name: blockchain + description: The blockchain network where the event occurred (Arbitrum) + tests: + - not_null + - &block_time + name: block_time + description: The timestamp of the block when the event was recorded + tests: + - not_null + - &block_date + name: block_date + description: The date extracted from the block timestamp, representing the day the block was created + tests: + - not_null + - &block_number + name: block_number + description: The block number where the event is included + tests: + - not_null + - &tx_hash + name: tx_hash + description: The hash of the transaction where the event was logged + tests: + - not_null + - &index + name: index + description: The position of the event within the transaction + tests: + - not_null + - &contract_address + name: contract_address + description: The contract address associated with the event + tests: + - not_null + - &tx_from + name: tx_from + description: The originating address of the transaction, usually representing the sender + tests: + - not_null + - &tx_to + name: tx_to + description: The destination address of the transaction, representing the receiver + tests: + - not_null + - name: event_name + description: The type of event recorded, always 'OrderCreated' for this model. + tests: + - not_null + - &msg_sender + name: msg_sender + description: The address of the sender of the message or transaction. + tests: + - not_null + - name: account + description: The address associated with the order. + - name: receiver + description: The address designated as the receiver in the order. + tests: + - not_null + - name: callback_contract + description: The contract address for callback functions. + tests: + - not_null + - name: ui_fee_receiver + description: The address designated to receive UI fees. + tests: + - not_null + - name: market + description: The market in which the order was created. + tests: + - not_null + - name: initial_collateral_token + description: The token used as initial collateral in the order. + tests: + - not_null + - name: swap_path + description: JSON array of markets through which the swap was routed. + tests: + - not_null + - &order_type + name: order_type + description: | + The type of order executed. The following table describes each order type: + - MarketSwap: Swap token A to token B at the current market price. The order will be cancelled if the minOutputAmount cannot be fulfilled. + - LimitSwap: Swap token A to token B if the minOutputAmount can be fulfilled. + - MarketIncrease: Increase position at the current market price. The order will be cancelled if the position cannot be increased at the acceptablePrice. + - LimitIncrease: Increase position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - MarketDecrease: Decrease position at the current market price. The order will be cancelled if the position cannot be decreased at the acceptablePrice. + - LimitDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - StopLossDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - Liquidation: Allows liquidation of positions if the criteria for liquidation are met. + tests: + - not_null + - accepted_values: + values: ['MarketSwap','LimitSwap','MarketIncrease','LimitIncrease','MarketDecrease','LimitDecrease','StopLossDecrease','Liquidation'] + - name: decrease_position_swap_type + description: | + The type of swap for decreasing position, with possible values: + - 'NoSwap' + - 'SwapPnlTokenToCollateralToken' + - 'SwapCollateralTokenToPnlToken' + - &size_delta_usd + name: size_delta_usd + description: The change in position size in USD + tests: + - not_null + - name: initial_collateral_delta_amount + description: The change in initial collateral amount. + tests: + - not_null + - name: trigger_price + description: The price that triggers the order execution. + tests: + - not_null + - name: acceptable_price + description: The minimum acceptable price for order execution. + tests: + - not_null + - name: execution_fee + description: The fee paid for executing the order in native tokens + tests: + - not_null + - name: callback_gas_limit + description: The gas limit set for callback functions. + tests: + - not_null + - name: min_output_amount + description: The minimum amount of output tokens expected from the order, based on the markets in the swap path. + tests: + - not_null + - name: updated_at_block + description: The block number at which the order was last updated. + tests: + - not_null + - name: updated_at_time + description: The timestamp when the order was last updated. + - &is_long + name: is_long + description: A boolean indicating whether the position is long + tests: + - not_null + - name: should_unwrap_native_token + description: Boolean indicating if the native token should be unwrapped. + - name: is_frozen + description: Boolean indicating if the order is frozen. + - name: key + description: The unique identifier for the order, stored as a bytes32 value. + tests: + - not_null + - unique + + + - name: gmx_v2_arbitrum_order_executed + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'order_executed'] + description: | + Extracts and decodes the `OrderExecuted` event log data from the Arbitrum blockchain. + This model processes log entries related to executed orders, extracting key variables such as + account addresses, event keys, and integer values. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'OrderExecuted' for this model + tests: + - not_null + - *msg_sender + - name: key + description: The key associated with the executed order. Extracted as a bytes32 value. + tests: + - not_null + - unique + - name: account + description: The address associated with the order + - name: secondary_order_type + description: | + The type of secondary order associated with the executed order. + This column indicates the nature of any additional order handling or adjustments made. + + The `secondary_order_type` is represented as an unsigned integer with the following possible values: + - `0`: **None** - No secondary order type is applied. + - `1`: **Adl (Auto-Deleveraging)** - Indicates that the order is associated with the Auto-Deleveraging mechanism. ADL is used to manage risk by automatically reducing or closing positions that are at risk of liquidation due to insufficient margin or other factors. This mechanism helps in maintaining the stability of the trading platform. + tests: + - not_null + + + - name: gmx_v2_arbitrum_order_cancelled + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'order_cancelled'] + description: | + Extracts and decodes the `OrderCancelled` event log data from the Arbitrum blockchain. + This model processes log entries related to cancelled orders, extracting key variables such as + account addresses, event keys, and strings representing the reason for cancellation. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'OrderCancelled' for this model + tests: + - not_null + - *msg_sender + - name: key + description: The key associated with the cancelled order. Extracted as a bytes32 value + tests: + - not_null + - unique + - name: account + description: The address associated with the order + - name: reason_bytes + description: The reason for the cancellation in byte format. + tests: + - not_null + - name: reason + description: The reason for the cancellation in string format. + tests: + - not_null + + + - name: gmx_v2_arbitrum_market_created + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'market_created'] + description: | + This model extracts and parses `MarketCreated` events from the Arbitrum blockchain. + It includes transaction details, addresses, and other relevant metrics related to + the creation of markets within the GMX protocol. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'MarketCreated' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - &market_token + name: market_token + description: The token used to represent the market + tests: + - not_null + - unique + - &index_token + name: index_token + description: The token used as the index in the market + tests: + - not_null + - &long_token + name: long_token + description: The token used for long positions in the market + tests: + - not_null + - &short_token + name: short_token + description: The token used for short positions in the market + tests: + - not_null + - &salt + name: salt + description: A unique value used to prevent hash collisions + tests: + - not_null + - &spot_only + name: spot_only + description: Indicates if the market is spot-only (true when index_token is the zero address) + tests: + - not_null + - &market_token_symbol + name: market_token_symbol + description: The symbol of the market token (hardcoded as 'GM' in this model) + tests: + - not_null + - &market_token_decimals + name: market_token_decimals + description: The decimal precision of the market token (hardcoded as 18 in this model) + tests: + - not_null + + + - name: gmx_v2_arbitrum_position_increase + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum','gmx','event','position_increase'] + description: | + This model extracts and parses `PositionIncrease` events from the Arbitrum blockchain. + It includes transaction details, addresses, and various metrics related to the event, + such as market data, collateral amounts, price impacts, and more. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionIncrease' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position increase + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position increase + tests: + - not_null + - &size_in_usd + name: size_in_usd + description: The size of the position in USD + tests: + - not_null + - &size_in_tokens + name: size_in_tokens + description: The size of the position in index tokens + tests: + - not_null + - name: collateral_amount + description: The amount of collateral in the position after it was increased + tests: + - not_null + - &borrowing_factor + name: borrowing_factor + description: The cumulative borrowing factor applied to the position over time + tests: + - not_null + - &funding_fee_amount_per_size + name: funding_fee_amount_per_size + description: The cumulative funding fee amount per size + tests: + - not_null + - &long_token_claimable_funding_amount_per_size + name: long_token_claimable_funding_amount_per_size + description: The cumulative claimable funding amount per size for long tokens + tests: + - not_null + - &short_token_claimable_funding_amount_per_size + name: short_token_claimable_funding_amount_per_size + description: The cumulative claimable funding amount per size for short tokens + tests: + - not_null + - &execution_price + name: execution_price + description: The execution price of the position after price impact + tests: + - not_null + - &index_token_price_max + name: index_token_price_max + description: The maximum price of the index token during the event + tests: + - not_null + - &index_token_price_min + name: index_token_price_min + description: The minimum price of the index token during the event + tests: + - not_null + - &collateral_token_price_max + name: collateral_token_price_max + description: The maximum price of the collateral token during the event + tests: + - not_null + - &collateral_token_price_min + name: collateral_token_price_min + description: The minimum price of the collateral token during the event + tests: + - not_null + - *size_delta_usd + - &size_delta_in_tokens + name: size_delta_in_tokens + description: The change in position size in tokens + tests: + - not_null + - *order_type + - name: increased_at_time + description: The block timestamp when the position was increased + - &collateral_delta_amount + name: collateral_delta_amount + description: The change in collateral amount + tests: + - not_null + - &price_impact_usd + name: price_impact_usd + description: The impact on price in USD + tests: + - not_null + - &price_impact_amount + name: price_impact_amount + description: The impact on price in index token amount + tests: + - not_null + - *is_long + - &order_key + name: order_key + description: A unique key identifying the order + tests: + - not_null + - unique + - &position_key + name: position_key + description: A unique key identifying the position + + + - name: gmx_v2_arbitrum_position_decrease + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum','gmx','event','position_decrease'] + description: | + This model extracts and parses `PositionDecrease` events from the Arbitrum blockchain. + It includes transaction details, addresses, and various metrics related to the event, + such as market data, collateral amounts, price impacts, and more. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionDecrease' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position decrease + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position decrease + tests: + - not_null + - *size_in_usd + - *size_in_tokens + - name: collateral_amount + description: The amount of collateral in the position after it was decreased + tests: + - not_null + - *borrowing_factor + - *funding_fee_amount_per_size + - *long_token_claimable_funding_amount_per_size + - *short_token_claimable_funding_amount_per_size + - *execution_price + - *index_token_price_max + - *index_token_price_min + - *collateral_token_price_max + - *collateral_token_price_min + - *size_delta_usd + - *size_delta_in_tokens + - *collateral_delta_amount + - &impact_diff_usd + name: impact_diff_usd + description: The difference in price impact in USD compared to a baseline or previous value, considering the maximum price impact limit + tests: + - not_null + - *order_type + - &decreased_at_time + name: decreased_at_time + description: The block timestamp when the position was decreased + - *price_impact_usd + - &base_pnl_usd + name: base_pnl_usd + description: The base profit and loss in USD for the position + tests: + - not_null + - &uncapped_base_pnl_usd + name: uncapped_base_pnl_usd + description: The uncapped base profit and loss in USD, without any limits or caps applied + tests: + - not_null + - *is_long + - *order_key + - *position_key + + + - name: gmx_v2_arbitrum_position_fees_collected + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'position_fees_collected'] + description: | + This model extracts and parses `PositionFeesCollected` events from the Arbitrum blockchain. + It includes details about the transaction, addresses involved, and various metrics related to + fees collected from positions, including fee amounts and related market data. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionFeesCollected' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position fees collected event + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position fees collected event + tests: + - not_null + - &affiliate + name: affiliate + description: The affiliate address + tests: + - not_null + - &trader + name: trader + description: The trader's address + tests: + - not_null + - &ui_fee_receiver + name: ui_fee_receiver + description: The address receiving the UI fee + tests: + - not_null + - *collateral_token_price_min + - *collateral_token_price_max + - &trade_size_usd + name: trade_size_usd + description: The size of the trade in USD + tests: + - not_null + - &total_rebate_factor + name: total_rebate_factor + description: The total rebate factor for the position + tests: + - not_null + - &trader_discount_factor + name: trader_discount_factor + description: The discount factor applied to the trader + tests: + - not_null + - &total_rebate_amount + name: total_rebate_amount + description: The total amount of rebate given + tests: + - not_null + - &trader_discount_amount + name: trader_discount_amount + description: The amount of discount given to the trader + tests: + - not_null + - &affiliate_reward_amount + name: affiliate_reward_amount + description: The reward amount given to the affiliate + tests: + - not_null + - &funding_fee_amount + name: funding_fee_amount + description: The amount of funding fee charged + tests: + - not_null + - &claimable_long_token_amount + name: claimable_long_token_amount + description: The amount of long tokens claimable + tests: + - not_null + - &claimable_short_token_amount + name: claimable_short_token_amount + description: The amount of short tokens claimable + tests: + - not_null + - &latest_funding_fee_amount_per_size + name: latest_funding_fee_amount_per_size + description: The latest funding fee amount per size + tests: + - not_null + - &latest_long_token_claimable_funding_amount_per_size + name: latest_long_token_claimable_funding_amount_per_size + description: The latest claimable long token funding amount per size + tests: + - not_null + - &latest_short_token_claimable_funding_amount_per_size + name: latest_short_token_claimable_funding_amount_per_size + description: The latest claimable short token funding amount per size + tests: + - not_null + - &borrowing_fee_usd + name: borrowing_fee_usd + description: The borrowing fee amount in USD + tests: + - not_null + - &borrowing_fee_amount + name: borrowing_fee_amount + description: The amount of borrowing fee charged + tests: + - not_null + - &borrowing_fee_receiver_factor + name: borrowing_fee_receiver_factor + description: The factor used to calculate the borrowing fee amount for the fee receiver + tests: + - not_null + - &borrowing_fee_amount_for_fee_receiver + name: borrowing_fee_amount_for_fee_receiver + description: The amount of borrowing fee allocated for the fee receiver + tests: + - not_null + - &position_fee_factor + name: position_fee_factor + description: The fee factor for the position + tests: + - not_null + - &protocol_fee_amount + name: protocol_fee_amount + description: The amount of protocol fee charged + tests: + - not_null + - &position_fee_receiver_factor + name: position_fee_receiver_factor + description: The factor used to calculate the position fee amount for the receiver + tests: + - not_null + - &fee_receiver_amount + name: fee_receiver_amount + description: The amount of fee received by the fee receiver + tests: + - not_null + - &fee_amount_for_pool + name: fee_amount_for_pool + description: The amount of fee allocated for the pool + tests: + - not_null + - &position_fee_amount_for_pool + name: position_fee_amount_for_pool + description: The amount of position fee allocated for the pool + tests: + - not_null + - &position_fee_amount + name: position_fee_amount + description: The total position fee amount + tests: + - not_null + - &total_cost_amount + name: total_cost_amount + description: The total cost amount for the position + tests: + - not_null + - &ui_fee_receiver_factor + name: ui_fee_receiver_factor + description: The factor used to calculate the UI fee amount for the receiver + tests: + - not_null + - &ui_fee_amount + name: ui_fee_amount + description: The total amount of UI fee collected + tests: + - not_null + - &is_increase + name: is_increase + description: Indicates whether the position is increased (true) or decreased (false) + tests: + - not_null + - *order_key + - *position_key + - &referral_code + name: referral_code + description: The referral code associated with the position + tests: + - not_null + + + - name: gmx_v2_arbitrum_position_fees_info + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'position_fees_info'] + description: | + This model extracts and parses `PositionFeesInfo` events from the Arbitrum blockchain. + It includes details about the transaction, addresses involved, and various metrics related to + position fees, including fee amounts and related market data. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionFeesInfo' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position fees info event + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position fees info event + tests: + - not_null + - *affiliate + - *trader + - *ui_fee_receiver + - *collateral_token_price_min + - *collateral_token_price_max + - *trade_size_usd + - *total_rebate_factor + - *trader_discount_factor + - *total_rebate_amount + - *trader_discount_amount + - *affiliate_reward_amount + - *funding_fee_amount + - *claimable_long_token_amount + - *claimable_short_token_amount + - *latest_funding_fee_amount_per_size + - *latest_long_token_claimable_funding_amount_per_size + - *latest_short_token_claimable_funding_amount_per_size + - *borrowing_fee_usd + - *borrowing_fee_amount + - *borrowing_fee_receiver_factor + - *borrowing_fee_amount_for_fee_receiver + - *position_fee_factor + - *protocol_fee_amount + - *position_fee_receiver_factor + - *fee_receiver_amount + - *fee_amount_for_pool + - *position_fee_amount_for_pool + - *position_fee_amount + - *total_cost_amount + - *ui_fee_receiver_factor + - *ui_fee_amount + - *is_increase + - *order_key + - *position_key + - *referral_code \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_market_created.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_market_created.sql new file mode 100644 index 00000000000..58a6f6bcb5e --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_market_created.sql @@ -0,0 +1,154 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'market_created', + materialized = 'table' + ) +}} + +{%- set event_name = 'MarketCreated' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic1, 13, 20) as account + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic2, 13, 20) as account + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'marketToken' THEN value END) AS market_token, + MAX(CASE WHEN key_name = 'indexToken' THEN value END) AS index_token, + MAX(CASE WHEN key_name = 'longToken' THEN value END) AS long_token, + MAX(CASE WHEN key_name = 'shortToken' THEN value END) AS short_token, + MAX(CASE WHEN key_name = 'salt' THEN value END) AS salt + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + account, + + from_hex(market_token) AS market_token, + from_hex(index_token) AS index_token, + from_hex(long_token) AS long_token, + from_hex(short_token) AS short_token, + from_hex(salt) AS salt, + CASE + WHEN index_token = '0x0000000000000000000000000000000000000000' THEN true + ELSE false + END AS spot_only, + 'GM' AS market_token_symbol, + 18 AS market_token_decimals + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_cancelled.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_cancelled.sql new file mode 100644 index 00000000000..84fe7f7b326 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_cancelled.sql @@ -0,0 +1,178 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'order_cancelled', + materialized = 'table' + ) +}} + +{%- set event_name = 'OrderCancelled' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.bytesItems' OMIT QUOTES) AS bytes_items, + json_query(data, 'lax $.stringItems' OMIT QUOTES) AS string_items + + FROM + evt_data +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, string_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(string_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM bytes32_items_parsed + UNION ALL + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM bytes_items_parsed + UNION ALL + SELECT * + FROM string_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'key' THEN value END) AS key, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'reasonBytes' THEN value END) AS reason_bytes, + MAX(CASE WHEN key_name = 'reason' THEN value END) AS reason + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(key) AS key, + from_hex(account) AS account, + from_hex(reason_bytes) AS reason_bytes, + reason + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_created.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_created.sql new file mode 100644 index 00000000000..97aa0cdc6aa --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_created.sql @@ -0,0 +1,304 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'order_created', + materialized = 'table' + ) +}} + +{%- set event_name = 'OrderCreated' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION DISTINCT + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, address_array_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_format(json_extract(CAST(item AS VARCHAR), '$.value')) AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.arrayItems') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM address_array_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed + +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'receiver' THEN value END) AS receiver, + MAX(CASE WHEN key_name = 'callbackContract' THEN value END) AS callback_contract, + MAX(CASE WHEN key_name = 'uiFeeReceiver' THEN value END) AS ui_fee_receiver, + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'initialCollateralToken' THEN value END) AS initial_collateral_token, + + MAX(CASE WHEN key_name = 'swapPath' THEN value END) AS swap_path, + MAX(CASE WHEN key_name = 'orderType' THEN value END) AS order_type, + MAX(CASE WHEN key_name = 'decreasePositionSwapType' THEN value END) AS decrease_position_swap_type, + MAX(CASE WHEN key_name = 'sizeDeltaUsd' THEN value END) AS size_delta_usd, + MAX(CASE WHEN key_name = 'initialCollateralDeltaAmount' THEN value END) AS initial_collateral_delta_amount, + MAX(CASE WHEN key_name = 'triggerPrice' THEN value END) AS trigger_price, + MAX(CASE WHEN key_name = 'acceptablePrice' THEN value END) AS acceptable_price, + MAX(CASE WHEN key_name = 'executionFee' THEN value END) AS execution_fee, + MAX(CASE WHEN key_name = 'callbackGasLimit' THEN value END) AS callback_gas_limit, + MAX(CASE WHEN key_name = 'minOutputAmount' THEN value END) AS min_output_amount, + + MAX(CASE WHEN key_name = 'updatedAtBlock' THEN value END) AS updated_at_block, + MAX(CASE WHEN key_name = 'updatedAtTime' THEN value END) AS updated_at_time, + + MAX(CASE WHEN key_name = 'isLong' THEN value END) AS is_long, + MAX(CASE WHEN key_name = 'shouldUnwrapNativeToken' THEN value END) AS should_unwrap_native_token, + MAX(CASE WHEN key_name = 'isFrozen' THEN value END) AS is_frozen, + + MAX(CASE WHEN key_name = 'key' THEN value END) AS key + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(account) AS account, + from_hex(receiver) AS receiver, + from_hex(callback_contract) AS callback_contract, + from_hex(ui_fee_receiver) AS ui_fee_receiver, + from_hex(market) AS market, + from_hex(initial_collateral_token) AS initial_collateral_token, + + swap_path, + TRY_CAST(order_type AS INTEGER) AS order_type, + TRY_CAST(decrease_position_swap_type AS INTEGER) AS decrease_position_swap_type, + TRY_CAST(size_delta_usd AS DOUBLE) AS size_delta_usd, + TRY_CAST(initial_collateral_delta_amount AS DOUBLE) AS initial_collateral_delta_amount, + TRY_CAST(trigger_price AS DOUBLE) AS trigger_price, + TRY_CAST(acceptable_price AS DOUBLE) AS acceptable_price, + TRY_CAST(execution_fee AS DOUBLE) AS execution_fee, + TRY_CAST(callback_gas_limit AS DOUBLE) AS callback_gas_limit, + TRY_CAST(min_output_amount AS DOUBLE) AS min_output_amount, + TRY_CAST(updated_at_block AS BIGINT) AS updated_at_block, + TRY_CAST(updated_at_time AS DOUBLE) AS updated_at_time, + TRY_CAST(is_long AS BOOLEAN) AS is_long, + TRY_CAST(should_unwrap_native_token AS BOOLEAN) AS should_unwrap_native_token, + TRY_CAST(is_frozen AS BOOLEAN) AS is_frozen, + from_hex(key) AS key + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + + account, + receiver, + callback_contract, + ui_fee_receiver, + ED.market, + ED.initial_collateral_token, + swap_path, + + CASE + WHEN order_type = 0 THEN 'MarketSwap' + WHEN order_type = 1 THEN 'LimitSwap' + WHEN order_type = 2 THEN 'MarketIncrease' + WHEN order_type = 3 THEN 'LimitIncrease' + WHEN order_type = 4 THEN 'MarketDecrease' + WHEN order_type = 5 THEN 'LimitDecrease' + WHEN order_type = 6 THEN 'StopLossDecrease' + WHEN order_type = 7 THEN 'Liquidation' + ELSE NULL + END AS order_type, + CASE + WHEN decrease_position_swap_type = 0 THEN 'NoSwap' + WHEN decrease_position_swap_type = 1 THEN 'SwapPnlTokenToCollateralToken' + WHEN decrease_position_swap_type = 2 THEN 'SwapCollateralTokenToPnlToken' + ELSE NULL + END AS decrease_position_swap_type, + + size_delta_usd / POWER(10, 30) AS size_delta_usd, + initial_collateral_delta_amount / POWER(10, collateral_token_decimals) AS initial_collateral_delta_amount, + CASE + WHEN index_token_decimals IS NULL THEN trigger_price / POWER(10, 30) + ELSE trigger_price / POWER(10, 30 - index_token_decimals) + END AS trigger_price, + CASE + WHEN index_token_decimals IS NULL THEN acceptable_price / POWER(10, 30) + ELSE acceptable_price / POWER(10, 30 - index_token_decimals) + END AS acceptable_price, + execution_fee / POWER(10, 18) AS execution_fee, + callback_gas_limit, + min_output_amount AS min_output_amount, + + updated_at_block, + CASE + WHEN updated_at_time = 0 THEN NULL + ELSE updated_at_time + END AS updated_at_time, + is_long, + should_unwrap_native_token, + is_frozen, + key + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_arbitrum_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_arbitrum_collateral_tokens_data') }} AS CTD + ON ED.initial_collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_executed.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_executed.sql new file mode 100644 index 00000000000..b373d356708 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_order_executed.sql @@ -0,0 +1,159 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'order_executed', + materialized = 'table' + ) +}} + +{%- set event_name = 'OrderExecuted' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed + +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'key' THEN value END) AS key, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'secondaryOrderType' THEN value END) AS secondary_order_type + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(key) AS key, + from_hex(account) AS account, + TRY_CAST(secondary_order_type AS INTEGER) AS secondary_order_type + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_decrease.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_decrease.sql new file mode 100644 index 00000000000..d5cfa5c134e --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_decrease.sql @@ -0,0 +1,301 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'position_decrease', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionDecrease' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.intItems' OMIT QUOTES) AS int_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, int_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(int_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM int_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'sizeInUsd' THEN value END) AS size_in_usd, + MAX(CASE WHEN key_name = 'sizeInTokens' THEN value END) AS size_in_tokens, + MAX(CASE WHEN key_name = 'collateralAmount' THEN value END) AS collateral_amount, + MAX(CASE WHEN key_name = 'borrowingFactor' THEN value END) AS borrowing_factor, + MAX(CASE WHEN key_name = 'fundingFeeAmountPerSize' THEN value END) AS funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'longTokenClaimableFundingAmountPerSize' THEN value END) AS long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'shortTokenClaimableFundingAmountPerSize' THEN value END) AS short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'executionPrice' THEN value END) AS execution_price, + MAX(CASE WHEN key_name = 'indexTokenPrice.max' THEN value END) AS index_token_price_max, + MAX(CASE WHEN key_name = 'indexTokenPrice.min' THEN value END) AS index_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'sizeDeltaUsd' THEN value END) AS size_delta_usd, + MAX(CASE WHEN key_name = 'sizeDeltaInTokens' THEN value END) AS size_delta_in_tokens, + MAX(CASE WHEN key_name = 'collateralDeltaAmount' THEN value END) AS collateral_delta_amount, + MAX(CASE WHEN key_name = 'values.priceImpactDiffUsd' THEN value END) AS values_price_impact_diff_usd, + MAX(CASE WHEN key_name = 'orderType' THEN value END) AS order_type, + MAX(CASE WHEN key_name = 'decreasedAtTime' THEN value END) AS decreased_at_time, + MAX(CASE WHEN key_name = 'priceImpactUsd' THEN value END) AS price_impact_usd, + MAX(CASE WHEN key_name = 'basePnlUsd' THEN value END) AS base_pnl_usd, + MAX(CASE WHEN key_name = 'uncappedBasePnlUsd' THEN value END) AS uncapped_base_pnl_usd, + MAX(CASE WHEN key_name = 'isLong' THEN value END) AS is_long, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(account) AS account, + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + TRY_CAST(size_in_usd AS DOUBLE) AS size_in_usd, + TRY_CAST(size_in_tokens AS DOUBLE) AS size_in_tokens, + TRY_CAST(collateral_amount AS DOUBLE) AS collateral_amount, + TRY_CAST(borrowing_factor AS DOUBLE) AS borrowing_factor, + TRY_CAST(funding_fee_amount_per_size AS DOUBLE) AS funding_fee_amount_per_size, + TRY_CAST(long_token_claimable_funding_amount_per_size AS DOUBLE) AS long_token_claimable_funding_amount_per_size, + TRY_CAST(short_token_claimable_funding_amount_per_size AS DOUBLE) AS short_token_claimable_funding_amount_per_size, + TRY_CAST(execution_price AS DOUBLE) AS execution_price, + TRY_CAST(index_token_price_max AS DOUBLE) AS index_token_price_max, + TRY_CAST(index_token_price_min AS DOUBLE) AS index_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(size_delta_usd AS DOUBLE) AS size_delta_usd, + TRY_CAST(size_delta_in_tokens AS DOUBLE) AS size_delta_in_tokens, + TRY_CAST(collateral_delta_amount AS DOUBLE) AS collateral_delta_amount, + TRY_CAST(values_price_impact_diff_usd AS DOUBLE) AS values_price_impact_diff_usd, + TRY_CAST(order_type AS INTEGER) AS order_type, + TRY_CAST(decreased_at_time AS DOUBLE) AS decreased_at_time, + TRY_CAST(price_impact_usd AS DOUBLE) AS price_impact_usd, + TRY_CAST(base_pnl_usd AS DOUBLE) AS base_pnl_usd, + TRY_CAST(uncapped_base_pnl_usd AS DOUBLE) AS uncapped_base_pnl_usd, + TRY_CAST(is_long AS BOOLEAN) AS is_long, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + + account, + ED.market AS market, + ED.collateral_token AS collateral_token, + size_in_usd / POWER(10, 30) AS size_in_usd, + size_in_tokens / POWER(10, index_token_decimals) AS size_in_tokens, + collateral_amount / POWER(10, collateral_token_decimals) AS collateral_amount, + borrowing_factor / POWER(10, 30) AS borrowing_factor, + funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount_per_size, + long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS long_token_claimable_funding_amount_per_size, + short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS short_token_claimable_funding_amount_per_size, + execution_price / POWER(10, 30 - index_token_decimals) AS execution_price, + index_token_price_max / POWER(10, 30 - index_token_decimals) AS index_token_price_max, + index_token_price_min / POWER(10, 30 - index_token_decimals) AS index_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + size_delta_usd / POWER(10, 30) AS size_delta_usd, + size_delta_in_tokens / POWER(10, index_token_decimals) AS size_delta_in_tokens, + collateral_delta_amount / POWER(10, collateral_token_decimals) AS collateral_delta_amount, + values_price_impact_diff_usd / POWER(10, 30 - index_token_decimals) AS impact_diff_usd, + CASE + WHEN order_type = 0 THEN 'MarketSwap' + WHEN order_type = 1 THEN 'LimitSwap' + WHEN order_type = 2 THEN 'MarketIncrease' + WHEN order_type = 3 THEN 'LimitIncrease' + WHEN order_type = 4 THEN 'MarketDecrease' + WHEN order_type = 5 THEN 'LimitDecrease' + WHEN order_type = 6 THEN 'StopLossDecrease' + WHEN order_type = 7 THEN 'Liquidation' + ELSE NULL + END AS order_type, + CASE + WHEN decreased_at_time = 0 THEN NULL + ELSE decreased_at_time + END AS decreased_at_time, + price_impact_usd / POWER(10, 30) AS price_impact_usd, + base_pnl_usd / POWER(10, 30) AS base_pnl_usd, + uncapped_base_pnl_usd / POWER(10, 30) AS uncapped_base_pnl_usd, + is_long, + order_key, + position_key + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_arbitrum_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_arbitrum_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_fees_collected.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_fees_collected.sql new file mode 100644 index 00000000000..7e25ec829e2 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_fees_collected.sql @@ -0,0 +1,307 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'position_fees_collected', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionFeesCollected' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic1, 13, 20) as account + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic2, 13, 20) as account + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'affiliate' THEN value END) AS affiliate, + MAX(CASE WHEN key_name = 'trader' THEN value END) AS trader, + MAX(CASE WHEN key_name = 'uiFeeReceiver' THEN value END) AS ui_fee_receiver, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'tradeSizeUsd' THEN value END) AS trade_size_usd, + MAX(CASE WHEN key_name = 'totalRebateFactor' THEN value END) AS total_rebate_factor, + MAX(CASE WHEN key_name = 'traderDiscountFactor' THEN value END) AS trader_discount_factor, + MAX(CASE WHEN key_name = 'totalRebateAmount' THEN value END) AS total_rebate_amount, + MAX(CASE WHEN key_name = 'traderDiscountAmount' THEN value END) AS trader_discount_amount, + MAX(CASE WHEN key_name = 'affiliateRewardAmount' THEN value END) AS affiliate_reward_amount, + MAX(CASE WHEN key_name = 'fundingFeeAmount' THEN value END) AS funding_fee_amount, + MAX(CASE WHEN key_name = 'claimableLongTokenAmount' THEN value END) AS claimable_long_token_amount, + MAX(CASE WHEN key_name = 'claimableShortTokenAmount' THEN value END) AS claimable_short_token_amount, + MAX(CASE WHEN key_name = 'latestFundingFeeAmountPerSize' THEN value END) AS latest_funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'latestLongTokenClaimableFundingAmountPerSize' THEN value END) AS latest_long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'latestShortTokenClaimableFundingAmountPerSize' THEN value END) AS latest_short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'borrowingFeeUsd' THEN value END) AS borrowing_fee_usd, + MAX(CASE WHEN key_name = 'borrowingFeeAmount' THEN value END) AS borrowing_fee_amount, + MAX(CASE WHEN key_name = 'borrowingFeeReceiverFactor' THEN value END) AS borrowing_fee_receiver_factor, + MAX(CASE WHEN key_name = 'borrowingFeeAmountForFeeReceiver' THEN value END) AS borrowing_fee_amount_for_fee_receiver, + MAX(CASE WHEN key_name = 'positionFeeFactor' THEN value END) AS position_fee_factor, + MAX(CASE WHEN key_name = 'protocolFeeAmount' THEN value END) AS protocol_fee_amount, + MAX(CASE WHEN key_name = 'positionFeeReceiverFactor' THEN value END) AS position_fee_receiver_factor, + MAX(CASE WHEN key_name = 'feeReceiverAmount' THEN value END) AS fee_receiver_amount, + MAX(CASE WHEN key_name = 'feeAmountForPool' THEN value END) AS fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmountForPool' THEN value END) AS position_fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmount' THEN value END) AS position_fee_amount, + MAX(CASE WHEN key_name = 'totalCostAmount' THEN value END) AS total_cost_amount, + MAX(CASE WHEN key_name = 'uiFeeReceiverFactor' THEN value END) AS ui_fee_receiver_factor, + MAX(CASE WHEN key_name = 'uiFeeAmount' THEN value END) AS ui_fee_amount, + MAX(CASE WHEN key_name = 'isIncrease' THEN value END) AS is_increase, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key, + MAX(CASE WHEN key_name = 'referralCode' THEN value END) AS referral_code + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + account, + + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + from_hex(affiliate) AS affiliate, + from_hex(trader) AS trader, + from_hex(ui_fee_receiver) AS ui_fee_receiver, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(trade_size_usd AS DOUBLE) AS trade_size_usd, + TRY_CAST(total_rebate_factor AS DOUBLE) AS total_rebate_factor, + TRY_CAST(trader_discount_factor AS DOUBLE) AS trader_discount_factor, + TRY_CAST(total_rebate_amount AS DOUBLE) AS total_rebate_amount, + TRY_CAST(trader_discount_amount AS DOUBLE) AS trader_discount_amount, + TRY_CAST(affiliate_reward_amount AS DOUBLE) AS affiliate_reward_amount, + TRY_CAST(funding_fee_amount AS DOUBLE) AS funding_fee_amount, + TRY_CAST(claimable_long_token_amount AS DOUBLE) AS claimable_long_token_amount, + TRY_CAST(claimable_short_token_amount AS DOUBLE) AS claimable_short_token_amount, + TRY_CAST(latest_funding_fee_amount_per_size AS DOUBLE) AS latest_funding_fee_amount_per_size, + TRY_CAST(latest_long_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_long_token_claimable_funding_amount_per_size, + TRY_CAST(latest_short_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_short_token_claimable_funding_amount_per_size, + TRY_CAST(borrowing_fee_usd AS DOUBLE) AS borrowing_fee_usd, + TRY_CAST(borrowing_fee_amount AS DOUBLE) AS borrowing_fee_amount, + TRY_CAST(borrowing_fee_receiver_factor AS DOUBLE) AS borrowing_fee_receiver_factor, + TRY_CAST(borrowing_fee_amount_for_fee_receiver AS DOUBLE) AS borrowing_fee_amount_for_fee_receiver, + TRY_CAST(position_fee_factor AS DOUBLE) AS position_fee_factor, + TRY_CAST(protocol_fee_amount AS DOUBLE) AS protocol_fee_amount, + TRY_CAST(position_fee_receiver_factor AS DOUBLE) AS position_fee_receiver_factor, + TRY_CAST(fee_receiver_amount AS DOUBLE) AS fee_receiver_amount, + TRY_CAST(fee_amount_for_pool AS DOUBLE) AS fee_amount_for_pool, + TRY_CAST(position_fee_amount_for_pool AS DOUBLE) AS position_fee_amount_for_pool, + TRY_CAST(position_fee_amount AS DOUBLE) AS position_fee_amount, + TRY_CAST(total_cost_amount AS DOUBLE) AS total_cost_amount, + TRY_CAST(ui_fee_receiver_factor AS DOUBLE) AS ui_fee_receiver_factor, + TRY_CAST(ui_fee_amount AS DOUBLE) AS ui_fee_amount, + TRY_CAST(is_increase AS BOOLEAN) AS is_increase, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key, + from_hex(referral_code) AS referral_code + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + account, + + ED.market AS market, + ED.collateral_token, + affiliate, + trader, + ui_fee_receiver, + + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + trade_size_usd / POWER(10, 30) AS trade_size_usd, + total_rebate_factor / POWER(10, 30) AS total_rebate_factor, + trader_discount_factor / POWER(10, 30) AS trader_discount_factor, + total_rebate_amount / POWER(10, collateral_token_decimals) AS total_rebate_amount, + trader_discount_amount / POWER(10, collateral_token_decimals) AS trader_discount_amount, + affiliate_reward_amount / POWER(10, collateral_token_decimals) AS affiliate_reward_amount, + funding_fee_amount / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount, + claimable_long_token_amount / POWER(10, long_token_decimals + 15) AS claimable_long_token_amount, + claimable_short_token_amount / POWER(10, short_token_decimals + 15) AS claimable_short_token_amount, + latest_funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS latest_funding_fee_amount_per_size, + latest_long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS latest_long_token_claimable_funding_amount_per_size, + latest_short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS latest_short_token_claimable_funding_amount_per_size, + borrowing_fee_usd / POWER(10, 30) AS borrowing_fee_usd, + borrowing_fee_amount / POWER(10, collateral_token_decimals) AS borrowing_fee_amount, + borrowing_fee_receiver_factor / POWER(10, 30) AS borrowing_fee_receiver_factor, + borrowing_fee_amount_for_fee_receiver / POWER(10, collateral_token_decimals) AS borrowing_fee_amount_for_fee_receiver, + position_fee_factor / POWER(10, 30) AS position_fee_factor, + protocol_fee_amount / POWER(10, collateral_token_decimals) AS protocol_fee_amount, + position_fee_receiver_factor / POWER(10, 30) AS position_fee_receiver_factor, + fee_receiver_amount / POWER(10, collateral_token_decimals) AS fee_receiver_amount, + fee_amount_for_pool / POWER(10, collateral_token_decimals) AS fee_amount_for_pool, + position_fee_amount_for_pool / POWER(10, collateral_token_decimals) AS position_fee_amount_for_pool, + position_fee_amount / POWER(10, collateral_token_decimals) AS position_fee_amount, + total_cost_amount / POWER(10, collateral_token_decimals) AS total_cost_amount, + ui_fee_receiver_factor / POWER(10, 30) AS ui_fee_receiver_factor, + ui_fee_amount / POWER(10, collateral_token_decimals) AS ui_fee_amount, + is_increase, + order_key, + position_key, + referral_code + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_arbitrum_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_arbitrum_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_fees_info.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_fees_info.sql new file mode 100644 index 00000000000..176ed51efc5 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_fees_info.sql @@ -0,0 +1,307 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'position_fees_info', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionFeesInfo' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic1, 13, 20) as account + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic2, 13, 20) as account + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'affiliate' THEN value END) AS affiliate, + MAX(CASE WHEN key_name = 'trader' THEN value END) AS trader, + MAX(CASE WHEN key_name = 'uiFeeReceiver' THEN value END) AS ui_fee_receiver, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'tradeSizeUsd' THEN value END) AS trade_size_usd, + MAX(CASE WHEN key_name = 'totalRebateFactor' THEN value END) AS total_rebate_factor, + MAX(CASE WHEN key_name = 'traderDiscountFactor' THEN value END) AS trader_discount_factor, + MAX(CASE WHEN key_name = 'totalRebateAmount' THEN value END) AS total_rebate_amount, + MAX(CASE WHEN key_name = 'traderDiscountAmount' THEN value END) AS trader_discount_amount, + MAX(CASE WHEN key_name = 'affiliateRewardAmount' THEN value END) AS affiliate_reward_amount, + MAX(CASE WHEN key_name = 'fundingFeeAmount' THEN value END) AS funding_fee_amount, + MAX(CASE WHEN key_name = 'claimableLongTokenAmount' THEN value END) AS claimable_long_token_amount, + MAX(CASE WHEN key_name = 'claimableShortTokenAmount' THEN value END) AS claimable_short_token_amount, + MAX(CASE WHEN key_name = 'latestFundingFeeAmountPerSize' THEN value END) AS latest_funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'latestLongTokenClaimableFundingAmountPerSize' THEN value END) AS latest_long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'latestShortTokenClaimableFundingAmountPerSize' THEN value END) AS latest_short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'borrowingFeeUsd' THEN value END) AS borrowing_fee_usd, + MAX(CASE WHEN key_name = 'borrowingFeeAmount' THEN value END) AS borrowing_fee_amount, + MAX(CASE WHEN key_name = 'borrowingFeeReceiverFactor' THEN value END) AS borrowing_fee_receiver_factor, + MAX(CASE WHEN key_name = 'borrowingFeeAmountForFeeReceiver' THEN value END) AS borrowing_fee_amount_for_fee_receiver, + MAX(CASE WHEN key_name = 'positionFeeFactor' THEN value END) AS position_fee_factor, + MAX(CASE WHEN key_name = 'protocolFeeAmount' THEN value END) AS protocol_fee_amount, + MAX(CASE WHEN key_name = 'positionFeeReceiverFactor' THEN value END) AS position_fee_receiver_factor, + MAX(CASE WHEN key_name = 'feeReceiverAmount' THEN value END) AS fee_receiver_amount, + MAX(CASE WHEN key_name = 'feeAmountForPool' THEN value END) AS fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmountForPool' THEN value END) AS position_fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmount' THEN value END) AS position_fee_amount, + MAX(CASE WHEN key_name = 'totalCostAmount' THEN value END) AS total_cost_amount, + MAX(CASE WHEN key_name = 'uiFeeReceiverFactor' THEN value END) AS ui_fee_receiver_factor, + MAX(CASE WHEN key_name = 'uiFeeAmount' THEN value END) AS ui_fee_amount, + MAX(CASE WHEN key_name = 'isIncrease' THEN value END) AS is_increase, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key, + MAX(CASE WHEN key_name = 'referralCode' THEN value END) AS referral_code + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + account, + + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + from_hex(affiliate) AS affiliate, + from_hex(trader) AS trader, + from_hex(ui_fee_receiver) AS ui_fee_receiver, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(trade_size_usd AS DOUBLE) AS trade_size_usd, + TRY_CAST(total_rebate_factor AS DOUBLE) AS total_rebate_factor, + TRY_CAST(trader_discount_factor AS DOUBLE) AS trader_discount_factor, + TRY_CAST(total_rebate_amount AS DOUBLE) AS total_rebate_amount, + TRY_CAST(trader_discount_amount AS DOUBLE) AS trader_discount_amount, + TRY_CAST(affiliate_reward_amount AS DOUBLE) AS affiliate_reward_amount, + TRY_CAST(funding_fee_amount AS DOUBLE) AS funding_fee_amount, + TRY_CAST(claimable_long_token_amount AS DOUBLE) AS claimable_long_token_amount, + TRY_CAST(claimable_short_token_amount AS DOUBLE) AS claimable_short_token_amount, + TRY_CAST(latest_funding_fee_amount_per_size AS DOUBLE) AS latest_funding_fee_amount_per_size, + TRY_CAST(latest_long_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_long_token_claimable_funding_amount_per_size, + TRY_CAST(latest_short_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_short_token_claimable_funding_amount_per_size, + TRY_CAST(borrowing_fee_usd AS DOUBLE) AS borrowing_fee_usd, + TRY_CAST(borrowing_fee_amount AS DOUBLE) AS borrowing_fee_amount, + TRY_CAST(borrowing_fee_receiver_factor AS DOUBLE) AS borrowing_fee_receiver_factor, + TRY_CAST(borrowing_fee_amount_for_fee_receiver AS DOUBLE) AS borrowing_fee_amount_for_fee_receiver, + TRY_CAST(position_fee_factor AS DOUBLE) AS position_fee_factor, + TRY_CAST(protocol_fee_amount AS DOUBLE) AS protocol_fee_amount, + TRY_CAST(position_fee_receiver_factor AS DOUBLE) AS position_fee_receiver_factor, + TRY_CAST(fee_receiver_amount AS DOUBLE) AS fee_receiver_amount, + TRY_CAST(fee_amount_for_pool AS DOUBLE) AS fee_amount_for_pool, + TRY_CAST(position_fee_amount_for_pool AS DOUBLE) AS position_fee_amount_for_pool, + TRY_CAST(position_fee_amount AS DOUBLE) AS position_fee_amount, + TRY_CAST(total_cost_amount AS DOUBLE) AS total_cost_amount, + TRY_CAST(ui_fee_receiver_factor AS DOUBLE) AS ui_fee_receiver_factor, + TRY_CAST(ui_fee_amount AS DOUBLE) AS ui_fee_amount, + TRY_CAST(is_increase AS BOOLEAN) AS is_increase, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key, + from_hex(referral_code) AS referral_code + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + account, + + ED.market AS market, + ED.collateral_token, + affiliate, + trader, + ui_fee_receiver, + + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + trade_size_usd / POWER(10, 30) AS trade_size_usd, + total_rebate_factor / POWER(10, 30) AS total_rebate_factor, + trader_discount_factor / POWER(10, 30) AS trader_discount_factor, + total_rebate_amount / POWER(10, collateral_token_decimals) AS total_rebate_amount, + trader_discount_amount / POWER(10, collateral_token_decimals) AS trader_discount_amount, + affiliate_reward_amount / POWER(10, collateral_token_decimals) AS affiliate_reward_amount, + funding_fee_amount / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount, + claimable_long_token_amount / POWER(10, long_token_decimals + 15) AS claimable_long_token_amount, + claimable_short_token_amount / POWER(10, short_token_decimals + 15) AS claimable_short_token_amount, + latest_funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS latest_funding_fee_amount_per_size, + latest_long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS latest_long_token_claimable_funding_amount_per_size, + latest_short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS latest_short_token_claimable_funding_amount_per_size, + borrowing_fee_usd / POWER(10, 30) AS borrowing_fee_usd, + borrowing_fee_amount / POWER(10, collateral_token_decimals) AS borrowing_fee_amount, + borrowing_fee_receiver_factor / POWER(10, 30) AS borrowing_fee_receiver_factor, + borrowing_fee_amount_for_fee_receiver / POWER(10, collateral_token_decimals) AS borrowing_fee_amount_for_fee_receiver, + position_fee_factor / POWER(10, 30) AS position_fee_factor, + protocol_fee_amount / POWER(10, collateral_token_decimals) AS protocol_fee_amount, + position_fee_receiver_factor / POWER(10, 30) AS position_fee_receiver_factor, + fee_receiver_amount / POWER(10, collateral_token_decimals) AS fee_receiver_amount, + fee_amount_for_pool / POWER(10, collateral_token_decimals) AS fee_amount_for_pool, + position_fee_amount_for_pool / POWER(10, collateral_token_decimals) AS position_fee_amount_for_pool, + position_fee_amount / POWER(10, collateral_token_decimals) AS position_fee_amount, + total_cost_amount / POWER(10, collateral_token_decimals) AS total_cost_amount, + ui_fee_receiver_factor / POWER(10, 30) AS ui_fee_receiver_factor, + ui_fee_amount / POWER(10, collateral_token_decimals) AS ui_fee_amount, + is_increase, + order_key, + position_key, + referral_code + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_arbitrum_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_arbitrum_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_increase.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_increase.sql new file mode 100644 index 00000000000..bddd6f5c9f6 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/arbitrum/gmx_v2_arbitrum_position_increase.sql @@ -0,0 +1,295 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'position_increase', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionIncrease' -%} +{%- set blockchain_name = 'arbitrum' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_arbitrum','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.intItems' OMIT QUOTES) AS int_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, int_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(int_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM int_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'sizeInUsd' THEN value END) AS size_in_usd, + MAX(CASE WHEN key_name = 'sizeInTokens' THEN value END) AS size_in_tokens, + MAX(CASE WHEN key_name = 'collateralAmount' THEN value END) AS collateral_amount, + MAX(CASE WHEN key_name = 'borrowingFactor' THEN value END) AS borrowing_factor, + MAX(CASE WHEN key_name = 'fundingFeeAmountPerSize' THEN value END) AS funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'longTokenClaimableFundingAmountPerSize' THEN value END) AS long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'shortTokenClaimableFundingAmountPerSize' THEN value END) AS short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'executionPrice' THEN value END) AS execution_price, + MAX(CASE WHEN key_name = 'indexTokenPrice.max' THEN value END) AS index_token_price_max, + MAX(CASE WHEN key_name = 'indexTokenPrice.min' THEN value END) AS index_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'sizeDeltaUsd' THEN value END) AS size_delta_usd, + MAX(CASE WHEN key_name = 'sizeDeltaInTokens' THEN value END) AS size_delta_in_tokens, + MAX(CASE WHEN key_name = 'orderType' THEN value END) AS order_type, + MAX(CASE WHEN key_name = 'increasedAtTime' THEN value END) AS increased_at_time, + MAX(CASE WHEN key_name = 'collateralDeltaAmount' THEN value END) AS collateral_delta_amount, + MAX(CASE WHEN key_name = 'priceImpactUsd' THEN value END) AS price_impact_usd, + MAX(CASE WHEN key_name = 'priceImpactAmount' THEN value END) AS price_impact_amount, + MAX(CASE WHEN key_name = 'isLong' THEN value END) AS is_long, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(account) AS account, + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + TRY_CAST(size_in_usd AS DOUBLE) AS size_in_usd, + TRY_CAST(size_in_tokens AS DOUBLE) AS size_in_tokens, + TRY_CAST(collateral_amount AS DOUBLE) AS collateral_amount, + TRY_CAST(borrowing_factor AS DOUBLE) AS borrowing_factor, + TRY_CAST(funding_fee_amount_per_size AS DOUBLE) AS funding_fee_amount_per_size, + TRY_CAST(long_token_claimable_funding_amount_per_size AS DOUBLE) AS long_token_claimable_funding_amount_per_size, + TRY_CAST(short_token_claimable_funding_amount_per_size AS DOUBLE) AS short_token_claimable_funding_amount_per_size, + TRY_CAST(execution_price AS DOUBLE) AS execution_price, + TRY_CAST(index_token_price_max AS DOUBLE) AS index_token_price_max, + TRY_CAST(index_token_price_min AS DOUBLE) AS index_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(size_delta_usd AS DOUBLE) AS size_delta_usd, + TRY_CAST(size_delta_in_tokens AS DOUBLE) AS size_delta_in_tokens, + TRY_CAST(order_type AS INTEGER) AS order_type, + TRY_CAST(increased_at_time AS DOUBLE) AS increased_at_time, + TRY_CAST(collateral_delta_amount AS DOUBLE) AS collateral_delta_amount, + TRY_CAST(price_impact_usd AS DOUBLE) AS price_impact_usd, + TRY_CAST(price_impact_amount AS DOUBLE) AS price_impact_amount, + TRY_CAST(is_long AS BOOLEAN) AS is_long, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + + account, + ED.market AS market, + ED.collateral_token AS collateral_token, + size_in_usd / POWER(10, 30) AS size_in_usd, + size_in_tokens / POWER(10, index_token_decimals) AS size_in_tokens, + collateral_amount / POWER(10, collateral_token_decimals) AS collateral_amount, + borrowing_factor / POWER(10, 30) AS borrowing_factor, + funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount_per_size, + long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS long_token_claimable_funding_amount_per_size, + short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS short_token_claimable_funding_amount_per_size, + execution_price / POWER(10, 30 - index_token_decimals) AS execution_price, + index_token_price_max / POWER(10, 30 - index_token_decimals) AS index_token_price_max, + index_token_price_min / POWER(10, 30 - index_token_decimals) AS index_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + size_delta_usd / POWER(10, 30) AS size_delta_usd, + size_delta_in_tokens / POWER(10, index_token_decimals) AS size_delta_in_tokens, + CASE + WHEN order_type = 0 THEN 'MarketSwap' + WHEN order_type = 1 THEN 'LimitSwap' + WHEN order_type = 2 THEN 'MarketIncrease' + WHEN order_type = 3 THEN 'LimitIncrease' + WHEN order_type = 4 THEN 'MarketDecrease' + WHEN order_type = 5 THEN 'LimitDecrease' + WHEN order_type = 6 THEN 'StopLossDecrease' + WHEN order_type = 7 THEN 'Liquidation' + ELSE NULL + END AS order_type, + CASE + WHEN increased_at_time = 0 THEN NULL + ELSE increased_at_time + END AS increased_at_time, + collateral_delta_amount / POWER(10, collateral_token_decimals) AS collateral_delta_amount, + price_impact_usd / POWER(10, 30) AS price_impact_usd, + price_impact_amount / POWER(10, index_token_decimals) AS price_impact_amount, + is_long, + order_key, + position_key + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_arbitrum_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_arbitrum_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_event_schema.yml b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_event_schema.yml new file mode 100644 index 00000000000..1ad13d266cc --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_event_schema.yml @@ -0,0 +1,821 @@ +version: 2 + +models: + - name: gmx_v2_avalanche_c_order_created + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'order_created'] + description: | + Extracts and decodes the `OrderCreated` event log data from the Avalanche blockchain. + This model processes log entries related to created orders, extracting key variables such as + account addresses, event keys, and strings representing the reason for cancellation. + + columns: + - &blockchain + name: blockchain + description: The blockchain network where the event occurred (Avalanche) + tests: + - not_null + - &block_time + name: block_time + description: The timestamp of the block when the event was recorded + tests: + - not_null + - &block_date + name: block_date + description: The date extracted from the block timestamp, representing the day the block was created + tests: + - not_null + - &block_number + name: block_number + description: The block number where the event is included + tests: + - not_null + - &tx_hash + name: tx_hash + description: The hash of the transaction where the event was logged + tests: + - not_null + - &index + name: index + description: The position of the event within the transaction + tests: + - not_null + - &contract_address + name: contract_address + description: The contract address associated with the event + tests: + - not_null + - &tx_from + name: tx_from + description: The originating address of the transaction, usually representing the sender + tests: + - not_null + - &tx_to + name: tx_to + description: The destination address of the transaction, representing the receiver + tests: + - not_null + - name: event_name + description: The type of event recorded, always 'OrderCreated' for this model. + tests: + - not_null + - &msg_sender + name: msg_sender + description: The address of the sender of the message or transaction. + tests: + - not_null + - name: account + description: The address associated with the order. + - name: receiver + description: The address designated as the receiver in the order. + tests: + - not_null + - name: callback_contract + description: The contract address for callback functions. + tests: + - not_null + - name: ui_fee_receiver + description: The address designated to receive UI fees. + tests: + - not_null + - name: market + description: The market in which the order was created. + tests: + - not_null + - name: initial_collateral_token + description: The token used as initial collateral in the order. + tests: + - not_null + - name: swap_path + description: JSON array of markets through which the swap was routed. + tests: + - not_null + - &order_type + name: order_type + description: | + The type of order executed. The following table describes each order type: + - MarketSwap: Swap token A to token B at the current market price. The order will be cancelled if the minOutputAmount cannot be fulfilled. + - LimitSwap: Swap token A to token B if the minOutputAmount can be fulfilled. + - MarketIncrease: Increase position at the current market price. The order will be cancelled if the position cannot be increased at the acceptablePrice. + - LimitIncrease: Increase position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - MarketDecrease: Decrease position at the current market price. The order will be cancelled if the position cannot be decreased at the acceptablePrice. + - LimitDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - StopLossDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - Liquidation: Allows liquidation of positions if the criteria for liquidation are met. + tests: + - not_null + - accepted_values: + values: ['MarketSwap','LimitSwap','MarketIncrease','LimitIncrease','MarketDecrease','LimitDecrease','StopLossDecrease','Liquidation'] + - name: decrease_position_swap_type + description: | + The type of swap for decreasing position, with possible values: + - 'NoSwap' + - 'SwapPnlTokenToCollateralToken' + - 'SwapCollateralTokenToPnlToken' + - &size_delta_usd + name: size_delta_usd + description: The change in position size in USD + tests: + - not_null + - name: initial_collateral_delta_amount + description: The change in initial collateral amount. + tests: + - not_null + - name: trigger_price + description: The price that triggers the order execution. + tests: + - not_null + - name: acceptable_price + description: The minimum acceptable price for order execution. + tests: + - not_null + - name: execution_fee + description: The fee paid for executing the order in native tokens + tests: + - not_null + - name: callback_gas_limit + description: The gas limit set for callback functions. + tests: + - not_null + - name: min_output_amount + description: The minimum amount of output tokens expected from the order, based on the markets in the swap path. + tests: + - not_null + - name: updated_at_block + description: The block number at which the order was last updated. + tests: + - not_null + - name: updated_at_time + description: The timestamp when the order was last updated. + - &is_long + name: is_long + description: A boolean indicating whether the position is long + tests: + - not_null + - name: should_unwrap_native_token + description: Boolean indicating if the native token should be unwrapped. + - name: is_frozen + description: Boolean indicating if the order is frozen. + - name: key + description: The unique identifier for the order, stored as a bytes32 value. + tests: + - not_null + - unique + + + - name: gmx_v2_avalanche_c_order_executed + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'order_executed'] + description: | + Extracts and decodes the `OrderExecuted` event log data from the Avalanche blockchain. + This model processes log entries related to executed orders, extracting key variables such as + account addresses, event keys, and integer values. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'OrderExecuted' for this model + tests: + - not_null + - *msg_sender + - name: key + description: The key associated with the executed order. Extracted as a bytes32 value. + tests: + - not_null + - unique + - name: account + description: The address associated with the order + - name: secondary_order_type + description: | + The type of secondary order associated with the executed order. + This column indicates the nature of any additional order handling or adjustments made. + + The `secondary_order_type` is represented as an unsigned integer with the following possible values: + - `0`: **None** - No secondary order type is applied. + - `1`: **Adl (Auto-Deleveraging)** - Indicates that the order is associated with the Auto-Deleveraging mechanism. ADL is used to manage risk by automatically reducing or closing positions that are at risk of liquidation due to insufficient margin or other factors. This mechanism helps in maintaining the stability of the trading platform. + tests: + - not_null + + + - name: gmx_v2_avalanche_c_order_cancelled + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'order_cancelled'] + description: | + Extracts and decodes the `OrderCancelled` event log data from the Avalanche blockchain. + This model processes log entries related to cancelled orders, extracting key variables such as + account addresses, event keys, and strings representing the reason for cancellation. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'OrderCancelled' for this model + tests: + - not_null + - *msg_sender + - name: key + description: The key associated with the cancelled order. Extracted as a bytes32 value + tests: + - not_null + - unique + - name: account + description: The address associated with the order + - name: reason_bytes + description: The reason for the cancellation in byte format. + tests: + - not_null + - name: reason + description: The reason for the cancellation in string format. + tests: + - not_null + + + - name: gmx_v2_avalanche_c_market_created + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'market_created'] + description: | + This model extracts and parses `MarketCreated` events from the Avalanche blockchain. + It includes transaction details, addresses, and other relevant metrics related to + the creation of markets within the GMX protocol. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'MarketCreated' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - &market_token + name: market_token + description: The token used to represent the market + tests: + - not_null + - unique + - &index_token + name: index_token + description: The token used as the index in the market + tests: + - not_null + - &long_token + name: long_token + description: The token used for long positions in the market + tests: + - not_null + - &short_token + name: short_token + description: The token used for short positions in the market + tests: + - not_null + - &salt + name: salt + description: A unique value used to prevent hash collisions + tests: + - not_null + - &spot_only + name: spot_only + description: Indicates if the market is spot-only (true when index_token is the zero address) + tests: + - not_null + - &market_token_symbol + name: market_token_symbol + description: The symbol of the market token (hardcoded as 'GM' in this model) + tests: + - not_null + - &market_token_decimals + name: market_token_decimals + description: The decimal precision of the market token (hardcoded as 18 in this model) + tests: + - not_null + + + - name: gmx_v2_avalanche_c_position_increase + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c','gmx','event','position_increase'] + description: | + This model extracts and parses `PositionIncrease` events from the Avalanche blockchain. + It includes transaction details, addresses, and various metrics related to the event, + such as market data, collateral amounts, price impacts, and more. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionIncrease' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position increase + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position increase + tests: + - not_null + - &size_in_usd + name: size_in_usd + description: The size of the position in USD + tests: + - not_null + - &size_in_tokens + name: size_in_tokens + description: The size of the position in index tokens + tests: + - not_null + - name: collateral_amount + description: The amount of collateral in the position after it was increased + tests: + - not_null + - &borrowing_factor + name: borrowing_factor + description: The cumulative borrowing factor applied to the position over time + tests: + - not_null + - &funding_fee_amount_per_size + name: funding_fee_amount_per_size + description: The cumulative funding fee amount per size + tests: + - not_null + - &long_token_claimable_funding_amount_per_size + name: long_token_claimable_funding_amount_per_size + description: The cumulative claimable funding amount per size for long tokens + tests: + - not_null + - &short_token_claimable_funding_amount_per_size + name: short_token_claimable_funding_amount_per_size + description: The cumulative claimable funding amount per size for short tokens + tests: + - not_null + - &execution_price + name: execution_price + description: The execution price of the position after price impact + tests: + - not_null + - &index_token_price_max + name: index_token_price_max + description: The maximum price of the index token during the event + tests: + - not_null + - &index_token_price_min + name: index_token_price_min + description: The minimum price of the index token during the event + tests: + - not_null + - &collateral_token_price_max + name: collateral_token_price_max + description: The maximum price of the collateral token during the event + tests: + - not_null + - &collateral_token_price_min + name: collateral_token_price_min + description: The minimum price of the collateral token during the event + tests: + - not_null + - *size_delta_usd + - &size_delta_in_tokens + name: size_delta_in_tokens + description: The change in position size in tokens + tests: + - not_null + - *order_type + - name: increased_at_time + description: The block timestamp when the position was increased + - &collateral_delta_amount + name: collateral_delta_amount + description: The change in collateral amount + tests: + - not_null + - &price_impact_usd + name: price_impact_usd + description: The impact on price in USD + tests: + - not_null + - &price_impact_amount + name: price_impact_amount + description: The impact on price in index token amount + tests: + - not_null + - *is_long + - &order_key + name: order_key + description: A unique key identifying the order + tests: + - not_null + - unique + - &position_key + name: position_key + description: A unique key identifying the position + + + - name: gmx_v2_avalanche_c_position_decrease + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c','gmx','event','position_decrease'] + description: | + This model extracts and parses `PositionDecrease` events from the Avalanche blockchain. + It includes transaction details, addresses, and various metrics related to the event, + such as market data, collateral amounts, price impacts, and more. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionDecrease' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position decrease + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position decrease + tests: + - not_null + - *size_in_usd + - *size_in_tokens + - name: collateral_amount + description: The amount of collateral in the position after it was decreased + tests: + - not_null + - *borrowing_factor + - *funding_fee_amount_per_size + - *long_token_claimable_funding_amount_per_size + - *short_token_claimable_funding_amount_per_size + - *execution_price + - *index_token_price_max + - *index_token_price_min + - *collateral_token_price_max + - *collateral_token_price_min + - *size_delta_usd + - *size_delta_in_tokens + - *collateral_delta_amount + - &impact_diff_usd + name: impact_diff_usd + description: The difference in price impact in USD compared to a baseline or previous value, considering the maximum price impact limit + tests: + - not_null + - *order_type + - &decreased_at_time + name: decreased_at_time + description: The block timestamp when the position was decreased + - *price_impact_usd + - &base_pnl_usd + name: base_pnl_usd + description: The base profit and loss in USD for the position + tests: + - not_null + - &uncapped_base_pnl_usd + name: uncapped_base_pnl_usd + description: The uncapped base profit and loss in USD, without any limits or caps applied + tests: + - not_null + - *is_long + - *order_key + - *position_key + + + - name: gmx_v2_avalanche_c_position_fees_collected + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'position_fees_collected'] + description: | + This model extracts and parses `PositionFeesCollected` events from the Avalanche blockchain. + It includes details about the transaction, addresses involved, and various metrics related to + fees collected from positions, including fee amounts and related market data. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionFeesCollected' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position fees collected event + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position fees collected event + tests: + - not_null + - &affiliate + name: affiliate + description: The affiliate address + tests: + - not_null + - &trader + name: trader + description: The trader's address + tests: + - not_null + - &ui_fee_receiver + name: ui_fee_receiver + description: The address receiving the UI fee + tests: + - not_null + - *collateral_token_price_min + - *collateral_token_price_max + - &trade_size_usd + name: trade_size_usd + description: The size of the trade in USD + tests: + - not_null + - &total_rebate_factor + name: total_rebate_factor + description: The total rebate factor for the position + tests: + - not_null + - &trader_discount_factor + name: trader_discount_factor + description: The discount factor applied to the trader + tests: + - not_null + - &total_rebate_amount + name: total_rebate_amount + description: The total amount of rebate given + tests: + - not_null + - &trader_discount_amount + name: trader_discount_amount + description: The amount of discount given to the trader + tests: + - not_null + - &affiliate_reward_amount + name: affiliate_reward_amount + description: The reward amount given to the affiliate + tests: + - not_null + - &funding_fee_amount + name: funding_fee_amount + description: The amount of funding fee charged + tests: + - not_null + - &claimable_long_token_amount + name: claimable_long_token_amount + description: The amount of long tokens claimable + tests: + - not_null + - &claimable_short_token_amount + name: claimable_short_token_amount + description: The amount of short tokens claimable + tests: + - not_null + - &latest_funding_fee_amount_per_size + name: latest_funding_fee_amount_per_size + description: The latest funding fee amount per size + tests: + - not_null + - &latest_long_token_claimable_funding_amount_per_size + name: latest_long_token_claimable_funding_amount_per_size + description: The latest claimable long token funding amount per size + tests: + - not_null + - &latest_short_token_claimable_funding_amount_per_size + name: latest_short_token_claimable_funding_amount_per_size + description: The latest claimable short token funding amount per size + tests: + - not_null + - &borrowing_fee_usd + name: borrowing_fee_usd + description: The borrowing fee amount in USD + tests: + - not_null + - &borrowing_fee_amount + name: borrowing_fee_amount + description: The amount of borrowing fee charged + tests: + - not_null + - &borrowing_fee_receiver_factor + name: borrowing_fee_receiver_factor + description: The factor used to calculate the borrowing fee amount for the fee receiver + tests: + - not_null + - &borrowing_fee_amount_for_fee_receiver + name: borrowing_fee_amount_for_fee_receiver + description: The amount of borrowing fee allocated for the fee receiver + tests: + - not_null + - &position_fee_factor + name: position_fee_factor + description: The fee factor for the position + tests: + - not_null + - &protocol_fee_amount + name: protocol_fee_amount + description: The amount of protocol fee charged + tests: + - not_null + - &position_fee_receiver_factor + name: position_fee_receiver_factor + description: The factor used to calculate the position fee amount for the receiver + tests: + - not_null + - &fee_receiver_amount + name: fee_receiver_amount + description: The amount of fee received by the fee receiver + tests: + - not_null + - &fee_amount_for_pool + name: fee_amount_for_pool + description: The amount of fee allocated for the pool + tests: + - not_null + - &position_fee_amount_for_pool + name: position_fee_amount_for_pool + description: The amount of position fee allocated for the pool + tests: + - not_null + - &position_fee_amount + name: position_fee_amount + description: The total position fee amount + tests: + - not_null + - &total_cost_amount + name: total_cost_amount + description: The total cost amount for the position + tests: + - not_null + - &ui_fee_receiver_factor + name: ui_fee_receiver_factor + description: The factor used to calculate the UI fee amount for the receiver + tests: + - not_null + - &ui_fee_amount + name: ui_fee_amount + description: The total amount of UI fee collected + tests: + - not_null + - &is_increase + name: is_increase + description: Indicates whether the position is increased (true) or decreased (false) + tests: + - not_null + - *order_key + - *position_key + - &referral_code + name: referral_code + description: The referral code associated with the position + tests: + - not_null + + + - name: gmx_v2_avalanche_c_position_fees_info + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'position_fees_info'] + description: | + This model extracts and parses `PositionFeesInfo` events from the Avalanche blockchain. + It includes details about the transaction, addresses involved, and various metrics related to + position fees, including fee amounts and related market data. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionFeesInfo' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position fees info event + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position fees info event + tests: + - not_null + - *affiliate + - *trader + - *ui_fee_receiver + - *collateral_token_price_min + - *collateral_token_price_max + - *trade_size_usd + - *total_rebate_factor + - *trader_discount_factor + - *total_rebate_amount + - *trader_discount_amount + - *affiliate_reward_amount + - *funding_fee_amount + - *claimable_long_token_amount + - *claimable_short_token_amount + - *latest_funding_fee_amount_per_size + - *latest_long_token_claimable_funding_amount_per_size + - *latest_short_token_claimable_funding_amount_per_size + - *borrowing_fee_usd + - *borrowing_fee_amount + - *borrowing_fee_receiver_factor + - *borrowing_fee_amount_for_fee_receiver + - *position_fee_factor + - *protocol_fee_amount + - *position_fee_receiver_factor + - *fee_receiver_amount + - *fee_amount_for_pool + - *position_fee_amount_for_pool + - *position_fee_amount + - *total_cost_amount + - *ui_fee_receiver_factor + - *ui_fee_amount + - *is_increase + - *order_key + - *position_key + - *referral_code \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_market_created.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_market_created.sql new file mode 100644 index 00000000000..9979092e3ef --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_market_created.sql @@ -0,0 +1,153 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'market_created', + materialized = 'table' + ) +}} + +{%- set event_name = 'MarketCreated' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic1, 13, 20) as account + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic2, 13, 20) as account + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'marketToken' THEN value END) AS market_token, + MAX(CASE WHEN key_name = 'indexToken' THEN value END) AS index_token, + MAX(CASE WHEN key_name = 'longToken' THEN value END) AS long_token, + MAX(CASE WHEN key_name = 'shortToken' THEN value END) AS short_token, + MAX(CASE WHEN key_name = 'salt' THEN value END) AS salt + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + account, + + from_hex(market_token) AS market_token, + from_hex(index_token) AS index_token, + from_hex(long_token) AS long_token, + from_hex(short_token) AS short_token, + from_hex(salt) AS salt, + CASE + WHEN index_token = '0x0000000000000000000000000000000000000000' THEN true + ELSE false + END AS spot_only, + 'GM' AS market_token_symbol, + 18 AS market_token_decimals + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_cancelled.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_cancelled.sql new file mode 100644 index 00000000000..ce8206ba85c --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_cancelled.sql @@ -0,0 +1,178 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'order_cancelled', + materialized = 'table' + ) +}} + +{%- set event_name = 'OrderCancelled' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.bytesItems' OMIT QUOTES) AS bytes_items, + json_query(data, 'lax $.stringItems' OMIT QUOTES) AS string_items + + FROM + evt_data +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, string_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(string_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM bytes32_items_parsed + UNION ALL + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM bytes_items_parsed + UNION ALL + SELECT * + FROM string_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'key' THEN value END) AS key, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'reasonBytes' THEN value END) AS reason_bytes, + MAX(CASE WHEN key_name = 'reason' THEN value END) AS reason + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(key) AS key, + from_hex(account) AS account, + from_hex(reason_bytes) AS reason_bytes, + reason + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_created.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_created.sql new file mode 100644 index 00000000000..79bf89a1d44 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_created.sql @@ -0,0 +1,304 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'order_created', + materialized = 'table' + ) +}} + +{%- set event_name = 'OrderCreated' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION DISTINCT + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, address_array_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_format(json_extract(CAST(item AS VARCHAR), '$.value')) AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.arrayItems') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM address_array_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed + +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'receiver' THEN value END) AS receiver, + MAX(CASE WHEN key_name = 'callbackContract' THEN value END) AS callback_contract, + MAX(CASE WHEN key_name = 'uiFeeReceiver' THEN value END) AS ui_fee_receiver, + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'initialCollateralToken' THEN value END) AS initial_collateral_token, + + MAX(CASE WHEN key_name = 'swapPath' THEN value END) AS swap_path, + MAX(CASE WHEN key_name = 'orderType' THEN value END) AS order_type, + MAX(CASE WHEN key_name = 'decreasePositionSwapType' THEN value END) AS decrease_position_swap_type, + MAX(CASE WHEN key_name = 'sizeDeltaUsd' THEN value END) AS size_delta_usd, + MAX(CASE WHEN key_name = 'initialCollateralDeltaAmount' THEN value END) AS initial_collateral_delta_amount, + MAX(CASE WHEN key_name = 'triggerPrice' THEN value END) AS trigger_price, + MAX(CASE WHEN key_name = 'acceptablePrice' THEN value END) AS acceptable_price, + MAX(CASE WHEN key_name = 'executionFee' THEN value END) AS execution_fee, + MAX(CASE WHEN key_name = 'callbackGasLimit' THEN value END) AS callback_gas_limit, + MAX(CASE WHEN key_name = 'minOutputAmount' THEN value END) AS min_output_amount, + + MAX(CASE WHEN key_name = 'updatedAtBlock' THEN value END) AS updated_at_block, + MAX(CASE WHEN key_name = 'updatedAtTime' THEN value END) AS updated_at_time, + + MAX(CASE WHEN key_name = 'isLong' THEN value END) AS is_long, + MAX(CASE WHEN key_name = 'shouldUnwrapNativeToken' THEN value END) AS should_unwrap_native_token, + MAX(CASE WHEN key_name = 'isFrozen' THEN value END) AS is_frozen, + + MAX(CASE WHEN key_name = 'key' THEN value END) AS key + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(account) AS account, + from_hex(receiver) AS receiver, + from_hex(callback_contract) AS callback_contract, + from_hex(ui_fee_receiver) AS ui_fee_receiver, + from_hex(market) AS market, + from_hex(initial_collateral_token) AS initial_collateral_token, + + swap_path, + TRY_CAST(order_type AS INTEGER) AS order_type, + TRY_CAST(decrease_position_swap_type AS INTEGER) AS decrease_position_swap_type, + TRY_CAST(size_delta_usd AS DOUBLE) AS size_delta_usd, + TRY_CAST(initial_collateral_delta_amount AS DOUBLE) AS initial_collateral_delta_amount, + TRY_CAST(trigger_price AS DOUBLE) AS trigger_price, + TRY_CAST(acceptable_price AS DOUBLE) AS acceptable_price, + TRY_CAST(execution_fee AS DOUBLE) AS execution_fee, + TRY_CAST(callback_gas_limit AS DOUBLE) AS callback_gas_limit, + TRY_CAST(min_output_amount AS DOUBLE) AS min_output_amount, + TRY_CAST(updated_at_block AS BIGINT) AS updated_at_block, + TRY_CAST(updated_at_time AS DOUBLE) AS updated_at_time, + TRY_CAST(is_long AS BOOLEAN) AS is_long, + TRY_CAST(should_unwrap_native_token AS BOOLEAN) AS should_unwrap_native_token, + TRY_CAST(is_frozen AS BOOLEAN) AS is_frozen, + from_hex(key) AS key + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + + account, + receiver, + callback_contract, + ui_fee_receiver, + ED.market, + ED.initial_collateral_token, + swap_path, + + CASE + WHEN order_type = 0 THEN 'MarketSwap' + WHEN order_type = 1 THEN 'LimitSwap' + WHEN order_type = 2 THEN 'MarketIncrease' + WHEN order_type = 3 THEN 'LimitIncrease' + WHEN order_type = 4 THEN 'MarketDecrease' + WHEN order_type = 5 THEN 'LimitDecrease' + WHEN order_type = 6 THEN 'StopLossDecrease' + WHEN order_type = 7 THEN 'Liquidation' + ELSE NULL + END AS order_type, + CASE + WHEN decrease_position_swap_type = 0 THEN 'NoSwap' + WHEN decrease_position_swap_type = 1 THEN 'SwapPnlTokenToCollateralToken' + WHEN decrease_position_swap_type = 2 THEN 'SwapCollateralTokenToPnlToken' + ELSE NULL + END AS decrease_position_swap_type, + + size_delta_usd / POWER(10, 30) AS size_delta_usd, + initial_collateral_delta_amount / POWER(10, collateral_token_decimals) AS initial_collateral_delta_amount, + CASE + WHEN index_token_decimals IS NULL THEN trigger_price / POWER(10, 30) + ELSE trigger_price / POWER(10, 30 - index_token_decimals) + END AS trigger_price, + CASE + WHEN index_token_decimals IS NULL THEN acceptable_price / POWER(10, 30) + ELSE acceptable_price / POWER(10, 30 - index_token_decimals) + END AS acceptable_price, + execution_fee / POWER(10, 18) AS execution_fee, + callback_gas_limit, + min_output_amount AS min_output_amount, + + updated_at_block, + CASE + WHEN updated_at_time = 0 THEN NULL + ELSE updated_at_time + END AS updated_at_time, + is_long, + should_unwrap_native_token, + is_frozen, + key + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_avalanche_c_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_avalanche_c_collateral_tokens_data') }} AS CTD + ON ED.initial_collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_executed.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_executed.sql new file mode 100644 index 00000000000..677afcce2bd --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_order_executed.sql @@ -0,0 +1,159 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'order_executed', + materialized = 'table' + ) +}} + +{%- set event_name = 'OrderExecuted' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed + +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'key' THEN value END) AS key, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'secondaryOrderType' THEN value END) AS secondary_order_type + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(key) AS key, + from_hex(account) AS account, + TRY_CAST(secondary_order_type AS INTEGER) AS secondary_order_type + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_decrease.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_decrease.sql new file mode 100644 index 00000000000..e82cce31001 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_decrease.sql @@ -0,0 +1,301 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'position_decrease', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionDecrease' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.intItems' OMIT QUOTES) AS int_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, int_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(int_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM int_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'sizeInUsd' THEN value END) AS size_in_usd, + MAX(CASE WHEN key_name = 'sizeInTokens' THEN value END) AS size_in_tokens, + MAX(CASE WHEN key_name = 'collateralAmount' THEN value END) AS collateral_amount, + MAX(CASE WHEN key_name = 'borrowingFactor' THEN value END) AS borrowing_factor, + MAX(CASE WHEN key_name = 'fundingFeeAmountPerSize' THEN value END) AS funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'longTokenClaimableFundingAmountPerSize' THEN value END) AS long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'shortTokenClaimableFundingAmountPerSize' THEN value END) AS short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'executionPrice' THEN value END) AS execution_price, + MAX(CASE WHEN key_name = 'indexTokenPrice.max' THEN value END) AS index_token_price_max, + MAX(CASE WHEN key_name = 'indexTokenPrice.min' THEN value END) AS index_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'sizeDeltaUsd' THEN value END) AS size_delta_usd, + MAX(CASE WHEN key_name = 'sizeDeltaInTokens' THEN value END) AS size_delta_in_tokens, + MAX(CASE WHEN key_name = 'collateralDeltaAmount' THEN value END) AS collateral_delta_amount, + MAX(CASE WHEN key_name = 'values.priceImpactDiffUsd' THEN value END) AS values_price_impact_diff_usd, + MAX(CASE WHEN key_name = 'orderType' THEN value END) AS order_type, + MAX(CASE WHEN key_name = 'decreasedAtTime' THEN value END) AS decreased_at_time, + MAX(CASE WHEN key_name = 'priceImpactUsd' THEN value END) AS price_impact_usd, + MAX(CASE WHEN key_name = 'basePnlUsd' THEN value END) AS base_pnl_usd, + MAX(CASE WHEN key_name = 'uncappedBasePnlUsd' THEN value END) AS uncapped_base_pnl_usd, + MAX(CASE WHEN key_name = 'isLong' THEN value END) AS is_long, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(account) AS account, + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + TRY_CAST(size_in_usd AS DOUBLE) AS size_in_usd, + TRY_CAST(size_in_tokens AS DOUBLE) AS size_in_tokens, + TRY_CAST(collateral_amount AS DOUBLE) AS collateral_amount, + TRY_CAST(borrowing_factor AS DOUBLE) AS borrowing_factor, + TRY_CAST(funding_fee_amount_per_size AS DOUBLE) AS funding_fee_amount_per_size, + TRY_CAST(long_token_claimable_funding_amount_per_size AS DOUBLE) AS long_token_claimable_funding_amount_per_size, + TRY_CAST(short_token_claimable_funding_amount_per_size AS DOUBLE) AS short_token_claimable_funding_amount_per_size, + TRY_CAST(execution_price AS DOUBLE) AS execution_price, + TRY_CAST(index_token_price_max AS DOUBLE) AS index_token_price_max, + TRY_CAST(index_token_price_min AS DOUBLE) AS index_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(size_delta_usd AS DOUBLE) AS size_delta_usd, + TRY_CAST(size_delta_in_tokens AS DOUBLE) AS size_delta_in_tokens, + TRY_CAST(collateral_delta_amount AS DOUBLE) AS collateral_delta_amount, + TRY_CAST(values_price_impact_diff_usd AS DOUBLE) AS values_price_impact_diff_usd, + TRY_CAST(order_type AS INTEGER) AS order_type, + TRY_CAST(decreased_at_time AS DOUBLE) AS decreased_at_time, + TRY_CAST(price_impact_usd AS DOUBLE) AS price_impact_usd, + TRY_CAST(base_pnl_usd AS DOUBLE) AS base_pnl_usd, + TRY_CAST(uncapped_base_pnl_usd AS DOUBLE) AS uncapped_base_pnl_usd, + TRY_CAST(is_long AS BOOLEAN) AS is_long, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + + account, + ED.market AS market, + ED.collateral_token AS collateral_token, + size_in_usd / POWER(10, 30) AS size_in_usd, + size_in_tokens / POWER(10, index_token_decimals) AS size_in_tokens, + collateral_amount / POWER(10, collateral_token_decimals) AS collateral_amount, + borrowing_factor / POWER(10, 30) AS borrowing_factor, + funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount_per_size, + long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS long_token_claimable_funding_amount_per_size, + short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS short_token_claimable_funding_amount_per_size, + execution_price / POWER(10, 30 - index_token_decimals) AS execution_price, + index_token_price_max / POWER(10, 30 - index_token_decimals) AS index_token_price_max, + index_token_price_min / POWER(10, 30 - index_token_decimals) AS index_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + size_delta_usd / POWER(10, 30) AS size_delta_usd, + size_delta_in_tokens / POWER(10, index_token_decimals) AS size_delta_in_tokens, + collateral_delta_amount / POWER(10, collateral_token_decimals) AS collateral_delta_amount, + values_price_impact_diff_usd / POWER(10, 30 - index_token_decimals) AS impact_diff_usd, + CASE + WHEN order_type = 0 THEN 'MarketSwap' + WHEN order_type = 1 THEN 'LimitSwap' + WHEN order_type = 2 THEN 'MarketIncrease' + WHEN order_type = 3 THEN 'LimitIncrease' + WHEN order_type = 4 THEN 'MarketDecrease' + WHEN order_type = 5 THEN 'LimitDecrease' + WHEN order_type = 6 THEN 'StopLossDecrease' + WHEN order_type = 7 THEN 'Liquidation' + ELSE NULL + END AS order_type, + CASE + WHEN decreased_at_time = 0 THEN NULL + ELSE decreased_at_time + END AS decreased_at_time, + price_impact_usd / POWER(10, 30) AS price_impact_usd, + base_pnl_usd / POWER(10, 30) AS base_pnl_usd, + uncapped_base_pnl_usd / POWER(10, 30) AS uncapped_base_pnl_usd, + is_long, + order_key, + position_key + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_avalanche_c_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_avalanche_c_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_fees_collected.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_fees_collected.sql new file mode 100644 index 00000000000..e6256403cd2 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_fees_collected.sql @@ -0,0 +1,307 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'position_fees_collected', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionFeesCollected' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic1, 13, 20) as account + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic2, 13, 20) as account + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'affiliate' THEN value END) AS affiliate, + MAX(CASE WHEN key_name = 'trader' THEN value END) AS trader, + MAX(CASE WHEN key_name = 'uiFeeReceiver' THEN value END) AS ui_fee_receiver, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'tradeSizeUsd' THEN value END) AS trade_size_usd, + MAX(CASE WHEN key_name = 'totalRebateFactor' THEN value END) AS total_rebate_factor, + MAX(CASE WHEN key_name = 'traderDiscountFactor' THEN value END) AS trader_discount_factor, + MAX(CASE WHEN key_name = 'totalRebateAmount' THEN value END) AS total_rebate_amount, + MAX(CASE WHEN key_name = 'traderDiscountAmount' THEN value END) AS trader_discount_amount, + MAX(CASE WHEN key_name = 'affiliateRewardAmount' THEN value END) AS affiliate_reward_amount, + MAX(CASE WHEN key_name = 'fundingFeeAmount' THEN value END) AS funding_fee_amount, + MAX(CASE WHEN key_name = 'claimableLongTokenAmount' THEN value END) AS claimable_long_token_amount, + MAX(CASE WHEN key_name = 'claimableShortTokenAmount' THEN value END) AS claimable_short_token_amount, + MAX(CASE WHEN key_name = 'latestFundingFeeAmountPerSize' THEN value END) AS latest_funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'latestLongTokenClaimableFundingAmountPerSize' THEN value END) AS latest_long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'latestShortTokenClaimableFundingAmountPerSize' THEN value END) AS latest_short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'borrowingFeeUsd' THEN value END) AS borrowing_fee_usd, + MAX(CASE WHEN key_name = 'borrowingFeeAmount' THEN value END) AS borrowing_fee_amount, + MAX(CASE WHEN key_name = 'borrowingFeeReceiverFactor' THEN value END) AS borrowing_fee_receiver_factor, + MAX(CASE WHEN key_name = 'borrowingFeeAmountForFeeReceiver' THEN value END) AS borrowing_fee_amount_for_fee_receiver, + MAX(CASE WHEN key_name = 'positionFeeFactor' THEN value END) AS position_fee_factor, + MAX(CASE WHEN key_name = 'protocolFeeAmount' THEN value END) AS protocol_fee_amount, + MAX(CASE WHEN key_name = 'positionFeeReceiverFactor' THEN value END) AS position_fee_receiver_factor, + MAX(CASE WHEN key_name = 'feeReceiverAmount' THEN value END) AS fee_receiver_amount, + MAX(CASE WHEN key_name = 'feeAmountForPool' THEN value END) AS fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmountForPool' THEN value END) AS position_fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmount' THEN value END) AS position_fee_amount, + MAX(CASE WHEN key_name = 'totalCostAmount' THEN value END) AS total_cost_amount, + MAX(CASE WHEN key_name = 'uiFeeReceiverFactor' THEN value END) AS ui_fee_receiver_factor, + MAX(CASE WHEN key_name = 'uiFeeAmount' THEN value END) AS ui_fee_amount, + MAX(CASE WHEN key_name = 'isIncrease' THEN value END) AS is_increase, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key, + MAX(CASE WHEN key_name = 'referralCode' THEN value END) AS referral_code + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + account, + + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + from_hex(affiliate) AS affiliate, + from_hex(trader) AS trader, + from_hex(ui_fee_receiver) AS ui_fee_receiver, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(trade_size_usd AS DOUBLE) AS trade_size_usd, + TRY_CAST(total_rebate_factor AS DOUBLE) AS total_rebate_factor, + TRY_CAST(trader_discount_factor AS DOUBLE) AS trader_discount_factor, + TRY_CAST(total_rebate_amount AS DOUBLE) AS total_rebate_amount, + TRY_CAST(trader_discount_amount AS DOUBLE) AS trader_discount_amount, + TRY_CAST(affiliate_reward_amount AS DOUBLE) AS affiliate_reward_amount, + TRY_CAST(funding_fee_amount AS DOUBLE) AS funding_fee_amount, + TRY_CAST(claimable_long_token_amount AS DOUBLE) AS claimable_long_token_amount, + TRY_CAST(claimable_short_token_amount AS DOUBLE) AS claimable_short_token_amount, + TRY_CAST(latest_funding_fee_amount_per_size AS DOUBLE) AS latest_funding_fee_amount_per_size, + TRY_CAST(latest_long_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_long_token_claimable_funding_amount_per_size, + TRY_CAST(latest_short_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_short_token_claimable_funding_amount_per_size, + TRY_CAST(borrowing_fee_usd AS DOUBLE) AS borrowing_fee_usd, + TRY_CAST(borrowing_fee_amount AS DOUBLE) AS borrowing_fee_amount, + TRY_CAST(borrowing_fee_receiver_factor AS DOUBLE) AS borrowing_fee_receiver_factor, + TRY_CAST(borrowing_fee_amount_for_fee_receiver AS DOUBLE) AS borrowing_fee_amount_for_fee_receiver, + TRY_CAST(position_fee_factor AS DOUBLE) AS position_fee_factor, + TRY_CAST(protocol_fee_amount AS DOUBLE) AS protocol_fee_amount, + TRY_CAST(position_fee_receiver_factor AS DOUBLE) AS position_fee_receiver_factor, + TRY_CAST(fee_receiver_amount AS DOUBLE) AS fee_receiver_amount, + TRY_CAST(fee_amount_for_pool AS DOUBLE) AS fee_amount_for_pool, + TRY_CAST(position_fee_amount_for_pool AS DOUBLE) AS position_fee_amount_for_pool, + TRY_CAST(position_fee_amount AS DOUBLE) AS position_fee_amount, + TRY_CAST(total_cost_amount AS DOUBLE) AS total_cost_amount, + TRY_CAST(ui_fee_receiver_factor AS DOUBLE) AS ui_fee_receiver_factor, + TRY_CAST(ui_fee_amount AS DOUBLE) AS ui_fee_amount, + TRY_CAST(is_increase AS BOOLEAN) AS is_increase, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key, + from_hex(referral_code) AS referral_code + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + account, + + ED.market AS market, + ED.collateral_token, + affiliate, + trader, + ui_fee_receiver, + + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + trade_size_usd / POWER(10, 30) AS trade_size_usd, + total_rebate_factor / POWER(10, 30) AS total_rebate_factor, + trader_discount_factor / POWER(10, 30) AS trader_discount_factor, + total_rebate_amount / POWER(10, collateral_token_decimals) AS total_rebate_amount, + trader_discount_amount / POWER(10, collateral_token_decimals) AS trader_discount_amount, + affiliate_reward_amount / POWER(10, collateral_token_decimals) AS affiliate_reward_amount, + funding_fee_amount / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount, + claimable_long_token_amount / POWER(10, long_token_decimals + 15) AS claimable_long_token_amount, + claimable_short_token_amount / POWER(10, short_token_decimals + 15) AS claimable_short_token_amount, + latest_funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS latest_funding_fee_amount_per_size, + latest_long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS latest_long_token_claimable_funding_amount_per_size, + latest_short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS latest_short_token_claimable_funding_amount_per_size, + borrowing_fee_usd / POWER(10, 30) AS borrowing_fee_usd, + borrowing_fee_amount / POWER(10, collateral_token_decimals) AS borrowing_fee_amount, + borrowing_fee_receiver_factor / POWER(10, 30) AS borrowing_fee_receiver_factor, + borrowing_fee_amount_for_fee_receiver / POWER(10, collateral_token_decimals) AS borrowing_fee_amount_for_fee_receiver, + position_fee_factor / POWER(10, 30) AS position_fee_factor, + protocol_fee_amount / POWER(10, collateral_token_decimals) AS protocol_fee_amount, + position_fee_receiver_factor / POWER(10, 30) AS position_fee_receiver_factor, + fee_receiver_amount / POWER(10, collateral_token_decimals) AS fee_receiver_amount, + fee_amount_for_pool / POWER(10, collateral_token_decimals) AS fee_amount_for_pool, + position_fee_amount_for_pool / POWER(10, collateral_token_decimals) AS position_fee_amount_for_pool, + position_fee_amount / POWER(10, collateral_token_decimals) AS position_fee_amount, + total_cost_amount / POWER(10, collateral_token_decimals) AS total_cost_amount, + ui_fee_receiver_factor / POWER(10, 30) AS ui_fee_receiver_factor, + ui_fee_amount / POWER(10, collateral_token_decimals) AS ui_fee_amount, + is_increase, + order_key, + position_key, + referral_code + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_avalanche_c_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_avalanche_c_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_fees_info.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_fees_info.sql new file mode 100644 index 00000000000..0da855cb8ef --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_fees_info.sql @@ -0,0 +1,307 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'position_fees_info', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionFeesInfo' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic1, 13, 20) as account + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender, + varbinary_substring(topic2, 13, 20) as account + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'affiliate' THEN value END) AS affiliate, + MAX(CASE WHEN key_name = 'trader' THEN value END) AS trader, + MAX(CASE WHEN key_name = 'uiFeeReceiver' THEN value END) AS ui_fee_receiver, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'tradeSizeUsd' THEN value END) AS trade_size_usd, + MAX(CASE WHEN key_name = 'totalRebateFactor' THEN value END) AS total_rebate_factor, + MAX(CASE WHEN key_name = 'traderDiscountFactor' THEN value END) AS trader_discount_factor, + MAX(CASE WHEN key_name = 'totalRebateAmount' THEN value END) AS total_rebate_amount, + MAX(CASE WHEN key_name = 'traderDiscountAmount' THEN value END) AS trader_discount_amount, + MAX(CASE WHEN key_name = 'affiliateRewardAmount' THEN value END) AS affiliate_reward_amount, + MAX(CASE WHEN key_name = 'fundingFeeAmount' THEN value END) AS funding_fee_amount, + MAX(CASE WHEN key_name = 'claimableLongTokenAmount' THEN value END) AS claimable_long_token_amount, + MAX(CASE WHEN key_name = 'claimableShortTokenAmount' THEN value END) AS claimable_short_token_amount, + MAX(CASE WHEN key_name = 'latestFundingFeeAmountPerSize' THEN value END) AS latest_funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'latestLongTokenClaimableFundingAmountPerSize' THEN value END) AS latest_long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'latestShortTokenClaimableFundingAmountPerSize' THEN value END) AS latest_short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'borrowingFeeUsd' THEN value END) AS borrowing_fee_usd, + MAX(CASE WHEN key_name = 'borrowingFeeAmount' THEN value END) AS borrowing_fee_amount, + MAX(CASE WHEN key_name = 'borrowingFeeReceiverFactor' THEN value END) AS borrowing_fee_receiver_factor, + MAX(CASE WHEN key_name = 'borrowingFeeAmountForFeeReceiver' THEN value END) AS borrowing_fee_amount_for_fee_receiver, + MAX(CASE WHEN key_name = 'positionFeeFactor' THEN value END) AS position_fee_factor, + MAX(CASE WHEN key_name = 'protocolFeeAmount' THEN value END) AS protocol_fee_amount, + MAX(CASE WHEN key_name = 'positionFeeReceiverFactor' THEN value END) AS position_fee_receiver_factor, + MAX(CASE WHEN key_name = 'feeReceiverAmount' THEN value END) AS fee_receiver_amount, + MAX(CASE WHEN key_name = 'feeAmountForPool' THEN value END) AS fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmountForPool' THEN value END) AS position_fee_amount_for_pool, + MAX(CASE WHEN key_name = 'positionFeeAmount' THEN value END) AS position_fee_amount, + MAX(CASE WHEN key_name = 'totalCostAmount' THEN value END) AS total_cost_amount, + MAX(CASE WHEN key_name = 'uiFeeReceiverFactor' THEN value END) AS ui_fee_receiver_factor, + MAX(CASE WHEN key_name = 'uiFeeAmount' THEN value END) AS ui_fee_amount, + MAX(CASE WHEN key_name = 'isIncrease' THEN value END) AS is_increase, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key, + MAX(CASE WHEN key_name = 'referralCode' THEN value END) AS referral_code + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + account, + + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + from_hex(affiliate) AS affiliate, + from_hex(trader) AS trader, + from_hex(ui_fee_receiver) AS ui_fee_receiver, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(trade_size_usd AS DOUBLE) AS trade_size_usd, + TRY_CAST(total_rebate_factor AS DOUBLE) AS total_rebate_factor, + TRY_CAST(trader_discount_factor AS DOUBLE) AS trader_discount_factor, + TRY_CAST(total_rebate_amount AS DOUBLE) AS total_rebate_amount, + TRY_CAST(trader_discount_amount AS DOUBLE) AS trader_discount_amount, + TRY_CAST(affiliate_reward_amount AS DOUBLE) AS affiliate_reward_amount, + TRY_CAST(funding_fee_amount AS DOUBLE) AS funding_fee_amount, + TRY_CAST(claimable_long_token_amount AS DOUBLE) AS claimable_long_token_amount, + TRY_CAST(claimable_short_token_amount AS DOUBLE) AS claimable_short_token_amount, + TRY_CAST(latest_funding_fee_amount_per_size AS DOUBLE) AS latest_funding_fee_amount_per_size, + TRY_CAST(latest_long_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_long_token_claimable_funding_amount_per_size, + TRY_CAST(latest_short_token_claimable_funding_amount_per_size AS DOUBLE) AS latest_short_token_claimable_funding_amount_per_size, + TRY_CAST(borrowing_fee_usd AS DOUBLE) AS borrowing_fee_usd, + TRY_CAST(borrowing_fee_amount AS DOUBLE) AS borrowing_fee_amount, + TRY_CAST(borrowing_fee_receiver_factor AS DOUBLE) AS borrowing_fee_receiver_factor, + TRY_CAST(borrowing_fee_amount_for_fee_receiver AS DOUBLE) AS borrowing_fee_amount_for_fee_receiver, + TRY_CAST(position_fee_factor AS DOUBLE) AS position_fee_factor, + TRY_CAST(protocol_fee_amount AS DOUBLE) AS protocol_fee_amount, + TRY_CAST(position_fee_receiver_factor AS DOUBLE) AS position_fee_receiver_factor, + TRY_CAST(fee_receiver_amount AS DOUBLE) AS fee_receiver_amount, + TRY_CAST(fee_amount_for_pool AS DOUBLE) AS fee_amount_for_pool, + TRY_CAST(position_fee_amount_for_pool AS DOUBLE) AS position_fee_amount_for_pool, + TRY_CAST(position_fee_amount AS DOUBLE) AS position_fee_amount, + TRY_CAST(total_cost_amount AS DOUBLE) AS total_cost_amount, + TRY_CAST(ui_fee_receiver_factor AS DOUBLE) AS ui_fee_receiver_factor, + TRY_CAST(ui_fee_amount AS DOUBLE) AS ui_fee_amount, + TRY_CAST(is_increase AS BOOLEAN) AS is_increase, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key, + from_hex(referral_code) AS referral_code + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + account, + + ED.market AS market, + ED.collateral_token, + affiliate, + trader, + ui_fee_receiver, + + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + trade_size_usd / POWER(10, 30) AS trade_size_usd, + total_rebate_factor / POWER(10, 30) AS total_rebate_factor, + trader_discount_factor / POWER(10, 30) AS trader_discount_factor, + total_rebate_amount / POWER(10, collateral_token_decimals) AS total_rebate_amount, + trader_discount_amount / POWER(10, collateral_token_decimals) AS trader_discount_amount, + affiliate_reward_amount / POWER(10, collateral_token_decimals) AS affiliate_reward_amount, + funding_fee_amount / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount, + claimable_long_token_amount / POWER(10, long_token_decimals + 15) AS claimable_long_token_amount, + claimable_short_token_amount / POWER(10, short_token_decimals + 15) AS claimable_short_token_amount, + latest_funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS latest_funding_fee_amount_per_size, + latest_long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS latest_long_token_claimable_funding_amount_per_size, + latest_short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS latest_short_token_claimable_funding_amount_per_size, + borrowing_fee_usd / POWER(10, 30) AS borrowing_fee_usd, + borrowing_fee_amount / POWER(10, collateral_token_decimals) AS borrowing_fee_amount, + borrowing_fee_receiver_factor / POWER(10, 30) AS borrowing_fee_receiver_factor, + borrowing_fee_amount_for_fee_receiver / POWER(10, collateral_token_decimals) AS borrowing_fee_amount_for_fee_receiver, + position_fee_factor / POWER(10, 30) AS position_fee_factor, + protocol_fee_amount / POWER(10, collateral_token_decimals) AS protocol_fee_amount, + position_fee_receiver_factor / POWER(10, 30) AS position_fee_receiver_factor, + fee_receiver_amount / POWER(10, collateral_token_decimals) AS fee_receiver_amount, + fee_amount_for_pool / POWER(10, collateral_token_decimals) AS fee_amount_for_pool, + position_fee_amount_for_pool / POWER(10, collateral_token_decimals) AS position_fee_amount_for_pool, + position_fee_amount / POWER(10, collateral_token_decimals) AS position_fee_amount, + total_cost_amount / POWER(10, collateral_token_decimals) AS total_cost_amount, + ui_fee_receiver_factor / POWER(10, 30) AS ui_fee_receiver_factor, + ui_fee_amount / POWER(10, collateral_token_decimals) AS ui_fee_amount, + is_increase, + order_key, + position_key, + referral_code + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_avalanche_c_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_avalanche_c_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_increase.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_increase.sql new file mode 100644 index 00000000000..a4b6b107a40 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/avalanche_c/gmx_v2_avalanche_c_position_increase.sql @@ -0,0 +1,295 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'position_increase', + materialized = 'table' + ) +}} + +{%- set event_name = 'PositionIncrease' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +WITH evt_data_1 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog1')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +, evt_data_2 AS ( + SELECT + -- Main Variables + '{{ blockchain_name }}' AS blockchain, + evt_block_time AS block_time, + evt_block_number AS block_number, + evt_tx_hash AS tx_hash, + evt_index AS index, + contract_address, + eventName AS event_name, + eventData AS data, + msgSender AS msg_sender + FROM {{ source('gmx_v2_avalanche_c','EventEmitter_evt_EventLog2')}} + WHERE eventName = '{{ event_name }}' + ORDER BY evt_block_time ASC +) + +-- unite 2 tables +, evt_data AS ( + SELECT * + FROM evt_data_1 + UNION + SELECT * + FROM evt_data_2 +) + +, parsed_data AS ( + SELECT + tx_hash, + index, + json_query(data, 'lax $.addressItems' OMIT QUOTES) AS address_items, + json_query(data, 'lax $.uintItems' OMIT QUOTES) AS uint_items, + json_query(data, 'lax $.intItems' OMIT QUOTES) AS int_items, + json_query(data, 'lax $.boolItems' OMIT QUOTES) AS bool_items, + json_query(data, 'lax $.bytes32Items' OMIT QUOTES) AS bytes32_items + FROM + evt_data +) + +, address_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(address_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, uint_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(uint_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, int_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(int_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bool_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bool_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, bytes32_items_parsed AS ( + SELECT + tx_hash, + index, + json_extract_scalar(CAST(item AS VARCHAR), '$.key') AS key_name, + json_extract_scalar(CAST(item AS VARCHAR), '$.value') AS value + FROM + parsed_data, + UNNEST( + CAST(json_extract(bytes32_items, '$.items') AS ARRAY(JSON)) + ) AS t(item) +) + +, combined AS ( + SELECT * + FROM address_items_parsed + UNION ALL + SELECT * + FROM uint_items_parsed + UNION ALL + SELECT * + FROM int_items_parsed + UNION ALL + SELECT * + FROM bool_items_parsed + UNION ALL + SELECT * + FROM bytes32_items_parsed +) + +, evt_data_parsed AS ( + SELECT + tx_hash, + index, + MAX(CASE WHEN key_name = 'account' THEN value END) AS account, + MAX(CASE WHEN key_name = 'market' THEN value END) AS market, + MAX(CASE WHEN key_name = 'collateralToken' THEN value END) AS collateral_token, + MAX(CASE WHEN key_name = 'sizeInUsd' THEN value END) AS size_in_usd, + MAX(CASE WHEN key_name = 'sizeInTokens' THEN value END) AS size_in_tokens, + MAX(CASE WHEN key_name = 'collateralAmount' THEN value END) AS collateral_amount, + MAX(CASE WHEN key_name = 'borrowingFactor' THEN value END) AS borrowing_factor, + MAX(CASE WHEN key_name = 'fundingFeeAmountPerSize' THEN value END) AS funding_fee_amount_per_size, + MAX(CASE WHEN key_name = 'longTokenClaimableFundingAmountPerSize' THEN value END) AS long_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'shortTokenClaimableFundingAmountPerSize' THEN value END) AS short_token_claimable_funding_amount_per_size, + MAX(CASE WHEN key_name = 'executionPrice' THEN value END) AS execution_price, + MAX(CASE WHEN key_name = 'indexTokenPrice.max' THEN value END) AS index_token_price_max, + MAX(CASE WHEN key_name = 'indexTokenPrice.min' THEN value END) AS index_token_price_min, + MAX(CASE WHEN key_name = 'collateralTokenPrice.max' THEN value END) AS collateral_token_price_max, + MAX(CASE WHEN key_name = 'collateralTokenPrice.min' THEN value END) AS collateral_token_price_min, + MAX(CASE WHEN key_name = 'sizeDeltaUsd' THEN value END) AS size_delta_usd, + MAX(CASE WHEN key_name = 'sizeDeltaInTokens' THEN value END) AS size_delta_in_tokens, + MAX(CASE WHEN key_name = 'orderType' THEN value END) AS order_type, + MAX(CASE WHEN key_name = 'increasedAtTime' THEN value END) AS increased_at_time, + MAX(CASE WHEN key_name = 'collateralDeltaAmount' THEN value END) AS collateral_delta_amount, + MAX(CASE WHEN key_name = 'priceImpactUsd' THEN value END) AS price_impact_usd, + MAX(CASE WHEN key_name = 'priceImpactAmount' THEN value END) AS price_impact_amount, + MAX(CASE WHEN key_name = 'isLong' THEN value END) AS is_long, + MAX(CASE WHEN key_name = 'orderKey' THEN value END) AS order_key, + MAX(CASE WHEN key_name = 'positionKey' THEN value END) AS position_key + + FROM + combined + GROUP BY tx_hash, index +) + +-- full data +, event_data AS ( + SELECT + blockchain, + block_time, + block_number, + ED.tx_hash, + ED.index, + contract_address, + event_name, + msg_sender, + + from_hex(account) AS account, + from_hex(market) AS market, + from_hex(collateral_token) AS collateral_token, + TRY_CAST(size_in_usd AS DOUBLE) AS size_in_usd, + TRY_CAST(size_in_tokens AS DOUBLE) AS size_in_tokens, + TRY_CAST(collateral_amount AS DOUBLE) AS collateral_amount, + TRY_CAST(borrowing_factor AS DOUBLE) AS borrowing_factor, + TRY_CAST(funding_fee_amount_per_size AS DOUBLE) AS funding_fee_amount_per_size, + TRY_CAST(long_token_claimable_funding_amount_per_size AS DOUBLE) AS long_token_claimable_funding_amount_per_size, + TRY_CAST(short_token_claimable_funding_amount_per_size AS DOUBLE) AS short_token_claimable_funding_amount_per_size, + TRY_CAST(execution_price AS DOUBLE) AS execution_price, + TRY_CAST(index_token_price_max AS DOUBLE) AS index_token_price_max, + TRY_CAST(index_token_price_min AS DOUBLE) AS index_token_price_min, + TRY_CAST(collateral_token_price_max AS DOUBLE) AS collateral_token_price_max, + TRY_CAST(collateral_token_price_min AS DOUBLE) AS collateral_token_price_min, + TRY_CAST(size_delta_usd AS DOUBLE) AS size_delta_usd, + TRY_CAST(size_delta_in_tokens AS DOUBLE) AS size_delta_in_tokens, + TRY_CAST(order_type AS INTEGER) AS order_type, + TRY_CAST(increased_at_time AS DOUBLE) AS increased_at_time, + TRY_CAST(collateral_delta_amount AS DOUBLE) AS collateral_delta_amount, + TRY_CAST(price_impact_usd AS DOUBLE) AS price_impact_usd, + TRY_CAST(price_impact_amount AS DOUBLE) AS price_impact_amount, + TRY_CAST(is_long AS BOOLEAN) AS is_long, + from_hex(order_key) AS order_key, + from_hex(position_key) AS position_key + + FROM evt_data AS ED + LEFT JOIN evt_data_parsed AS EDP + ON ED.tx_hash = EDP.tx_hash + AND ED.index = EDP.index +) + +-- full data +, full_data AS ( + SELECT + blockchain, + block_time, + DATE(block_time) AS block_date, + block_number, + tx_hash, + index, + contract_address, + event_name, + msg_sender, + + account, + ED.market AS market, + ED.collateral_token AS collateral_token, + size_in_usd / POWER(10, 30) AS size_in_usd, + size_in_tokens / POWER(10, index_token_decimals) AS size_in_tokens, + collateral_amount / POWER(10, collateral_token_decimals) AS collateral_amount, + borrowing_factor / POWER(10, 30) AS borrowing_factor, + funding_fee_amount_per_size / POWER(10, collateral_token_decimals + 15) AS funding_fee_amount_per_size, + long_token_claimable_funding_amount_per_size / POWER(10, long_token_decimals + 15) AS long_token_claimable_funding_amount_per_size, + short_token_claimable_funding_amount_per_size / POWER(10, short_token_decimals + 15) AS short_token_claimable_funding_amount_per_size, + execution_price / POWER(10, 30 - index_token_decimals) AS execution_price, + index_token_price_max / POWER(10, 30 - index_token_decimals) AS index_token_price_max, + index_token_price_min / POWER(10, 30 - index_token_decimals) AS index_token_price_min, + collateral_token_price_max / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_max, + collateral_token_price_min / POWER(10, 30 - collateral_token_decimals) AS collateral_token_price_min, + size_delta_usd / POWER(10, 30) AS size_delta_usd, + size_delta_in_tokens / POWER(10, index_token_decimals) AS size_delta_in_tokens, + CASE + WHEN order_type = 0 THEN 'MarketSwap' + WHEN order_type = 1 THEN 'LimitSwap' + WHEN order_type = 2 THEN 'MarketIncrease' + WHEN order_type = 3 THEN 'LimitIncrease' + WHEN order_type = 4 THEN 'MarketDecrease' + WHEN order_type = 5 THEN 'LimitDecrease' + WHEN order_type = 6 THEN 'StopLossDecrease' + WHEN order_type = 7 THEN 'Liquidation' + ELSE NULL + END AS order_type, + CASE + WHEN increased_at_time = 0 THEN NULL + ELSE increased_at_time + END AS increased_at_time, + collateral_delta_amount / POWER(10, collateral_token_decimals) AS collateral_delta_amount, + price_impact_usd / POWER(10, 30) AS price_impact_usd, + price_impact_amount / POWER(10, index_token_decimals) AS price_impact_amount, + is_long, + order_key, + position_key + + FROM event_data AS ED + LEFT JOIN {{ ref('gmx_v2_avalanche_c_markets_data') }} AS MD + ON ED.market = MD.market + LEFT JOIN {{ ref('gmx_v2_avalanche_c_collateral_tokens_data') }} AS CTD + ON ED.collateral_token = CTD.collateral_token +) + +--can be removed once decoded tables are fully denormalized +{{ + add_tx_columns( + model_cte = 'full_data' + , blockchain = blockchain_name + , columns = ['from', 'to'] + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_event_schema.yml b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_event_schema.yml new file mode 100644 index 00000000000..e39685590bc --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_event_schema.yml @@ -0,0 +1,821 @@ +version: 2 + +models: + - name: gmx_v2_order_created + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'avalanche_c', 'gmx', 'event', 'order_created'] + description: | + Extracts and decodes the `OrderCreated` event log data from the Arbitrum and Avalanche blockchains. + This model processes log entries related to created orders, extracting key variables such as + account addresses, event keys, and strings representing the reason for cancellation. + + columns: + - &blockchain + name: blockchain + description: The blockchain network where the event occurred + tests: + - not_null + - &block_time + name: block_time + description: The timestamp of the block when the event was recorded + tests: + - not_null + - &block_date + name: block_date + description: The date extracted from the block timestamp, representing the day the block was created + tests: + - not_null + - &block_number + name: block_number + description: The block number where the event is included + tests: + - not_null + - &tx_hash + name: tx_hash + description: The hash of the transaction where the event was logged + tests: + - not_null + - &index + name: index + description: The position of the event within the transaction + tests: + - not_null + - &contract_address + name: contract_address + description: The contract address associated with the event + tests: + - not_null + - &tx_from + name: tx_from + description: The originating address of the transaction, usually representing the sender + tests: + - not_null + - &tx_to + name: tx_to + description: The destination address of the transaction, representing the receiver + tests: + - not_null + - name: event_name + description: The type of event recorded, always 'OrderCreated' for this model. + tests: + - not_null + - &msg_sender + name: msg_sender + description: The address of the sender of the message or transaction. + tests: + - not_null + - name: account + description: The address associated with the order. + - name: receiver + description: The address designated as the receiver in the order. + tests: + - not_null + - name: callback_contract + description: The contract address for callback functions. + tests: + - not_null + - name: ui_fee_receiver + description: The address designated to receive UI fees. + tests: + - not_null + - name: market + description: The market in which the order was created. + tests: + - not_null + - name: initial_collateral_token + description: The token used as initial collateral in the order. + tests: + - not_null + - name: swap_path + description: JSON array of markets through which the swap was routed. + tests: + - not_null + - &order_type + name: order_type + description: | + The type of order executed. The following table describes each order type: + - MarketSwap: Swap token A to token B at the current market price. The order will be cancelled if the minOutputAmount cannot be fulfilled. + - LimitSwap: Swap token A to token B if the minOutputAmount can be fulfilled. + - MarketIncrease: Increase position at the current market price. The order will be cancelled if the position cannot be increased at the acceptablePrice. + - LimitIncrease: Increase position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - MarketDecrease: Decrease position at the current market price. The order will be cancelled if the position cannot be decreased at the acceptablePrice. + - LimitDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - StopLossDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled. + - Liquidation: Allows liquidation of positions if the criteria for liquidation are met. + tests: + - not_null + - accepted_values: + values: ['MarketSwap','LimitSwap','MarketIncrease','LimitIncrease','MarketDecrease','LimitDecrease','StopLossDecrease','Liquidation'] + - name: decrease_position_swap_type + description: | + The type of swap for decreasing position, with possible values: + - 'NoSwap' + - 'SwapPnlTokenToCollateralToken' + - 'SwapCollateralTokenToPnlToken' + - &size_delta_usd + name: size_delta_usd + description: The change in position size in USD + tests: + - not_null + - name: initial_collateral_delta_amount + description: The change in initial collateral amount. + tests: + - not_null + - name: trigger_price + description: The price that triggers the order execution. + tests: + - not_null + - name: acceptable_price + description: The minimum acceptable price for order execution. + tests: + - not_null + - name: execution_fee + description: The fee paid for executing the order in native tokens + tests: + - not_null + - name: callback_gas_limit + description: The gas limit set for callback functions. + tests: + - not_null + - name: min_output_amount + description: The minimum amount of output tokens expected from the order, based on the markets in the swap path. + tests: + - not_null + - name: updated_at_block + description: The block number at which the order was last updated. + tests: + - not_null + - name: updated_at_time + description: The timestamp when the order was last updated. + - &is_long + name: is_long + description: A boolean indicating whether the position is long + tests: + - not_null + - name: should_unwrap_native_token + description: Boolean indicating if the native token should be unwrapped. + - name: is_frozen + description: Boolean indicating if the order is frozen. + - name: key + description: The unique identifier for the order, stored as a bytes32 value. + tests: + - not_null + - unique + + + - name: gmx_v2_order_executed + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'avalanche_c', 'gmx', 'event', 'order_executed'] + description: | + Extracts and decodes the `OrderExecuted` event log data from the Arbitrum and Avalanche blockchains. + This model processes log entries related to executed orders, extracting key variables such as + account addresses, event keys, and integer values. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'OrderExecuted' for this model + tests: + - not_null + - *msg_sender + - name: key + description: The key associated with the executed order. Extracted as a bytes32 value. + tests: + - not_null + - unique + - name: account + description: The address associated with the order + - name: secondary_order_type + description: | + The type of secondary order associated with the executed order. + This column indicates the nature of any additional order handling or adjustments made. + + The `secondary_order_type` is represented as an unsigned integer with the following possible values: + - `0`: **None** - No secondary order type is applied. + - `1`: **Adl (Auto-Deleveraging)** - Indicates that the order is associated with the Auto-Deleveraging mechanism. ADL is used to manage risk by automatically reducing or closing positions that are at risk of liquidation due to insufficient margin or other factors. This mechanism helps in maintaining the stability of the trading platform. + tests: + - not_null + + + - name: gmx_v2_order_cancelled + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'avalanche_c', 'gmx', 'event', 'order_cancelled'] + description: | + Extracts and decodes the `OrderCancelled` event log data from the Arbitrum and Avalanche blockchains. + This model processes log entries related to cancelled orders, extracting key variables such as + account addresses, event keys, and strings representing the reason for cancellation. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'OrderCancelled' for this model + tests: + - not_null + - *msg_sender + - name: key + description: The key associated with the cancelled order. Extracted as a bytes32 value + tests: + - not_null + - unique + - name: account + description: The address associated with the order + - name: reason_bytes + description: The reason for the cancellation in byte format. + tests: + - not_null + - name: reason + description: The reason for the cancellation in string format. + tests: + - not_null + + + - name: gmx_v2_market_created + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'avalanche_c', 'gmx', 'event', 'market_created'] + description: | + This model extracts and parses `MarketCreated` events from the Arbitrum and Avalanche blockchains. + It includes transaction details, addresses, and other relevant metrics related to + the creation of markets within the GMX protocol. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'MarketCreated' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - &market_token + name: market_token + description: The token used to represent the market + tests: + - not_null + - unique + - &index_token + name: index_token + description: The token used as the index in the market + tests: + - not_null + - &long_token + name: long_token + description: The token used for long positions in the market + tests: + - not_null + - &short_token + name: short_token + description: The token used for short positions in the market + tests: + - not_null + - &salt + name: salt + description: A unique value used to prevent hash collisions + tests: + - not_null + - &spot_only + name: spot_only + description: Indicates if the market is spot-only (true when index_token is the zero address) + tests: + - not_null + - &market_token_symbol + name: market_token_symbol + description: The symbol of the market token (hardcoded as 'GM' in this model) + tests: + - not_null + - &market_token_decimals + name: market_token_decimals + description: The decimal precision of the market token (hardcoded as 18 in this model) + tests: + - not_null + + + - name: gmx_v2_position_increase + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum','avalanche_c','gmx','event','position_increase'] + description: | + This model extracts and parses `PositionIncrease` events from the Arbitrum and Avalanche blockchains. + It includes transaction details, addresses, and various metrics related to the event, + such as market data, collateral amounts, price impacts, and more. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionIncrease' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position increase + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position increase + tests: + - not_null + - &size_in_usd + name: size_in_usd + description: The size of the position in USD + tests: + - not_null + - &size_in_tokens + name: size_in_tokens + description: The size of the position in index tokens + tests: + - not_null + - name: collateral_amount + description: The amount of collateral in the position after it was increased + tests: + - not_null + - &borrowing_factor + name: borrowing_factor + description: The cumulative borrowing factor applied to the position over time + tests: + - not_null + - &funding_fee_amount_per_size + name: funding_fee_amount_per_size + description: The cumulative funding fee amount per size + tests: + - not_null + - &long_token_claimable_funding_amount_per_size + name: long_token_claimable_funding_amount_per_size + description: The cumulative claimable funding amount per size for long tokens + tests: + - not_null + - &short_token_claimable_funding_amount_per_size + name: short_token_claimable_funding_amount_per_size + description: The cumulative claimable funding amount per size for short tokens + tests: + - not_null + - &execution_price + name: execution_price + description: The execution price of the position after price impact + tests: + - not_null + - &index_token_price_max + name: index_token_price_max + description: The maximum price of the index token during the event + tests: + - not_null + - &index_token_price_min + name: index_token_price_min + description: The minimum price of the index token during the event + tests: + - not_null + - &collateral_token_price_max + name: collateral_token_price_max + description: The maximum price of the collateral token during the event + tests: + - not_null + - &collateral_token_price_min + name: collateral_token_price_min + description: The minimum price of the collateral token during the event + tests: + - not_null + - *size_delta_usd + - &size_delta_in_tokens + name: size_delta_in_tokens + description: The change in position size in tokens + tests: + - not_null + - *order_type + - name: increased_at_time + description: The block timestamp when the position was increased + - &collateral_delta_amount + name: collateral_delta_amount + description: The change in collateral amount + tests: + - not_null + - &price_impact_usd + name: price_impact_usd + description: The impact on price in USD + tests: + - not_null + - &price_impact_amount + name: price_impact_amount + description: The impact on price in index token amount + tests: + - not_null + - *is_long + - &order_key + name: order_key + description: A unique key identifying the order + tests: + - not_null + - unique + - &position_key + name: position_key + description: A unique key identifying the position + + + - name: gmx_v2_position_decrease + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum','avalanche_c','gmx','event','position_decrease'] + description: | + This model extracts and parses `PositionDecrease` events from the Arbitrum and Avalanche blockchains. + It includes transaction details, addresses, and various metrics related to the event, + such as market data, collateral amounts, price impacts, and more. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionDecrease' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position decrease + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position decrease + tests: + - not_null + - *size_in_usd + - *size_in_tokens + - name: collateral_amount + description: The amount of collateral in the position after it was decreased + tests: + - not_null + - *borrowing_factor + - *funding_fee_amount_per_size + - *long_token_claimable_funding_amount_per_size + - *short_token_claimable_funding_amount_per_size + - *execution_price + - *index_token_price_max + - *index_token_price_min + - *collateral_token_price_max + - *collateral_token_price_min + - *size_delta_usd + - *size_delta_in_tokens + - *collateral_delta_amount + - &impact_diff_usd + name: impact_diff_usd + description: The difference in price impact in USD compared to a baseline or previous value, considering the maximum price impact limit + tests: + - not_null + - *order_type + - &decreased_at_time + name: decreased_at_time + description: The block timestamp when the position was decreased + - *price_impact_usd + - &base_pnl_usd + name: base_pnl_usd + description: The base profit and loss in USD for the position + tests: + - not_null + - &uncapped_base_pnl_usd + name: uncapped_base_pnl_usd + description: The uncapped base profit and loss in USD, without any limits or caps applied + tests: + - not_null + - *is_long + - *order_key + - *position_key + + + - name: gmx_v2_position_fees_collected + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum','avalanche_c', 'gmx', 'event', 'position_fees_collected'] + description: | + This model extracts and parses `PositionFeesCollected` events from the Arbitrum and Avalanche blockchains. + It includes details about the transaction, addresses involved, and various metrics related to + fees collected from positions, including fee amounts and related market data. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionFeesCollected' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position fees collected event + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position fees collected event + tests: + - not_null + - &affiliate + name: affiliate + description: The affiliate address + tests: + - not_null + - &trader + name: trader + description: The trader's address + tests: + - not_null + - &ui_fee_receiver + name: ui_fee_receiver + description: The address receiving the UI fee + tests: + - not_null + - *collateral_token_price_min + - *collateral_token_price_max + - &trade_size_usd + name: trade_size_usd + description: The size of the trade in USD + tests: + - not_null + - &total_rebate_factor + name: total_rebate_factor + description: The total rebate factor for the position + tests: + - not_null + - &trader_discount_factor + name: trader_discount_factor + description: The discount factor applied to the trader + tests: + - not_null + - &total_rebate_amount + name: total_rebate_amount + description: The total amount of rebate given + tests: + - not_null + - &trader_discount_amount + name: trader_discount_amount + description: The amount of discount given to the trader + tests: + - not_null + - &affiliate_reward_amount + name: affiliate_reward_amount + description: The reward amount given to the affiliate + tests: + - not_null + - &funding_fee_amount + name: funding_fee_amount + description: The amount of funding fee charged + tests: + - not_null + - &claimable_long_token_amount + name: claimable_long_token_amount + description: The amount of long tokens claimable + tests: + - not_null + - &claimable_short_token_amount + name: claimable_short_token_amount + description: The amount of short tokens claimable + tests: + - not_null + - &latest_funding_fee_amount_per_size + name: latest_funding_fee_amount_per_size + description: The latest funding fee amount per size + tests: + - not_null + - &latest_long_token_claimable_funding_amount_per_size + name: latest_long_token_claimable_funding_amount_per_size + description: The latest claimable long token funding amount per size + tests: + - not_null + - &latest_short_token_claimable_funding_amount_per_size + name: latest_short_token_claimable_funding_amount_per_size + description: The latest claimable short token funding amount per size + tests: + - not_null + - &borrowing_fee_usd + name: borrowing_fee_usd + description: The borrowing fee amount in USD + tests: + - not_null + - &borrowing_fee_amount + name: borrowing_fee_amount + description: The amount of borrowing fee charged + tests: + - not_null + - &borrowing_fee_receiver_factor + name: borrowing_fee_receiver_factor + description: The factor used to calculate the borrowing fee amount for the fee receiver + tests: + - not_null + - &borrowing_fee_amount_for_fee_receiver + name: borrowing_fee_amount_for_fee_receiver + description: The amount of borrowing fee allocated for the fee receiver + tests: + - not_null + - &position_fee_factor + name: position_fee_factor + description: The fee factor for the position + tests: + - not_null + - &protocol_fee_amount + name: protocol_fee_amount + description: The amount of protocol fee charged + tests: + - not_null + - &position_fee_receiver_factor + name: position_fee_receiver_factor + description: The factor used to calculate the position fee amount for the receiver + tests: + - not_null + - &fee_receiver_amount + name: fee_receiver_amount + description: The amount of fee received by the fee receiver + tests: + - not_null + - &fee_amount_for_pool + name: fee_amount_for_pool + description: The amount of fee allocated for the pool + tests: + - not_null + - &position_fee_amount_for_pool + name: position_fee_amount_for_pool + description: The amount of position fee allocated for the pool + tests: + - not_null + - &position_fee_amount + name: position_fee_amount + description: The total position fee amount + tests: + - not_null + - &total_cost_amount + name: total_cost_amount + description: The total cost amount for the position + tests: + - not_null + - &ui_fee_receiver_factor + name: ui_fee_receiver_factor + description: The factor used to calculate the UI fee amount for the receiver + tests: + - not_null + - &ui_fee_amount + name: ui_fee_amount + description: The total amount of UI fee collected + tests: + - not_null + - &is_increase + name: is_increase + description: Indicates whether the position is increased (true) or decreased (false) + tests: + - not_null + - *order_key + - *position_key + - &referral_code + name: referral_code + description: The referral code associated with the position + tests: + - not_null + + + - name: gmx_v2_position_fees_info + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum','avalanche_c', 'gmx', 'event', 'position_fees_info'] + description: | + This model extracts and parses `PositionFeesInfo` events from the Arbitrum and Avalanche blockchains. + It includes details about the transaction, addresses involved, and various metrics related to + position fees, including fee amounts and related market data. + + columns: + - *blockchain + - *block_time + - *block_date + - *block_number + - *tx_hash + - *index + - *contract_address + - *tx_from + - *tx_to + - name: event_name + description: The type of event recorded, always 'PositionFeesInfo' for this model + tests: + - not_null + - *msg_sender + - name: account + description: The address associated with the event + - name: market + description: The market associated with the position fees info event + tests: + - not_null + - name: collateral_token + description: The collateral token used in the position fees info event + tests: + - not_null + - *affiliate + - *trader + - *ui_fee_receiver + - *collateral_token_price_min + - *collateral_token_price_max + - *trade_size_usd + - *total_rebate_factor + - *trader_discount_factor + - *total_rebate_amount + - *trader_discount_amount + - *affiliate_reward_amount + - *funding_fee_amount + - *claimable_long_token_amount + - *claimable_short_token_amount + - *latest_funding_fee_amount_per_size + - *latest_long_token_claimable_funding_amount_per_size + - *latest_short_token_claimable_funding_amount_per_size + - *borrowing_fee_usd + - *borrowing_fee_amount + - *borrowing_fee_receiver_factor + - *borrowing_fee_amount_for_fee_receiver + - *position_fee_factor + - *protocol_fee_amount + - *position_fee_receiver_factor + - *fee_receiver_amount + - *fee_amount_for_pool + - *position_fee_amount_for_pool + - *position_fee_amount + - *total_cost_amount + - *ui_fee_receiver_factor + - *ui_fee_amount + - *is_increase + - *order_key + - *position_key + - *referral_code \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_market_created.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_market_created.sql new file mode 100644 index 00000000000..602bdc0f30e --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_market_created.sql @@ -0,0 +1,42 @@ +{{ config( + schema='gmx_v2', + alias = 'market_created', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + account, + market_token, + index_token, + long_token, + short_token, + salt, + spot_only, + market_token_symbol, + market_token_decimals +FROM {{ ref('gmx_v2_' ~ chain ~ '_market_created') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_cancelled.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_cancelled.sql new file mode 100644 index 00000000000..1509a4b81d8 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_cancelled.sql @@ -0,0 +1,37 @@ +{{ config( + schema='gmx_v2', + alias = 'order_cancelled', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + key, + account, + reason_bytes, + reason +FROM {{ ref('gmx_v2_' ~ chain ~ '_order_cancelled') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_created.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_created.sql new file mode 100644 index 00000000000..6356fd3f027 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_created.sql @@ -0,0 +1,55 @@ +{{ config( + schema='gmx_v2', + alias = 'order_created', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + account, + receiver, + callback_contract, + ui_fee_receiver, + market, + initial_collateral_token, + swap_path, + order_type, + decrease_position_swap_type, + size_delta_usd, + initial_collateral_delta_amount, + trigger_price, + acceptable_price, + execution_fee, + callback_gas_limit, + min_output_amount, + updated_at_block, + updated_at_time, + is_long, + should_unwrap_native_token, + is_frozen, + key +FROM {{ ref('gmx_v2_' ~ chain ~ '_order_created') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_executed.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_executed.sql new file mode 100644 index 00000000000..30619ed6292 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_order_executed.sql @@ -0,0 +1,36 @@ +{{ config( + schema='gmx_v2', + alias = 'order_executed', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + key, + account, + secondary_order_type +FROM {{ ref('gmx_v2_' ~ chain ~ '_order_executed') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_decrease.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_decrease.sql new file mode 100644 index 00000000000..1970473375e --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_decrease.sql @@ -0,0 +1,60 @@ +{{ config( + schema='gmx_v2', + alias = 'position_decrease', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + account, + market, + collateral_token, + size_in_usd, + size_in_tokens, + collateral_amount, + borrowing_factor, + funding_fee_amount_per_size, + long_token_claimable_funding_amount_per_size, + short_token_claimable_funding_amount_per_size, + execution_price, + index_token_price_max, + index_token_price_min, + collateral_token_price_max, + collateral_token_price_min, + size_delta_usd, + size_delta_in_tokens, + collateral_delta_amount, + impact_diff_usd, + order_type, + decreased_at_time, + price_impact_usd, + base_pnl_usd, + uncapped_base_pnl_usd, + is_long, + order_key, + position_key +FROM {{ ref('gmx_v2_' ~ chain ~ '_position_decrease') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_fees_collected.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_fees_collected.sql new file mode 100644 index 00000000000..462a15cd4e2 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_fees_collected.sql @@ -0,0 +1,71 @@ +{{ config( + schema='gmx_v2', + alias = 'position_fees_collected', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + account, + market, + collateral_token, + affiliate, + trader, + ui_fee_receiver, + collateral_token_price_min, + collateral_token_price_max, + trade_size_usd, + total_rebate_factor, + trader_discount_factor, + total_rebate_amount, + trader_discount_amount, + affiliate_reward_amount, + funding_fee_amount, + claimable_long_token_amount, + claimable_short_token_amount, + latest_funding_fee_amount_per_size, + latest_long_token_claimable_funding_amount_per_size, + latest_short_token_claimable_funding_amount_per_size, + borrowing_fee_usd, + borrowing_fee_amount, + borrowing_fee_receiver_factor, + borrowing_fee_amount_for_fee_receiver, + position_fee_factor, + protocol_fee_amount, + position_fee_receiver_factor, + fee_receiver_amount, + fee_amount_for_pool, + position_fee_amount_for_pool, + position_fee_amount, + total_cost_amount, + ui_fee_receiver_factor, + ui_fee_amount, + is_increase, + order_key, + position_key, + referral_code +FROM {{ ref('gmx_v2_' ~ chain ~ '_position_fees_collected') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_fees_info.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_fees_info.sql new file mode 100644 index 00000000000..5599bc46dc6 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_fees_info.sql @@ -0,0 +1,71 @@ +{{ config( + schema='gmx_v2', + alias = 'position_fees_info', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + account, + market, + collateral_token, + affiliate, + trader, + ui_fee_receiver, + collateral_token_price_min, + collateral_token_price_max, + trade_size_usd, + total_rebate_factor, + trader_discount_factor, + total_rebate_amount, + trader_discount_amount, + affiliate_reward_amount, + funding_fee_amount, + claimable_long_token_amount, + claimable_short_token_amount, + latest_funding_fee_amount_per_size, + latest_long_token_claimable_funding_amount_per_size, + latest_short_token_claimable_funding_amount_per_size, + borrowing_fee_usd, + borrowing_fee_amount, + borrowing_fee_receiver_factor, + borrowing_fee_amount_for_fee_receiver, + position_fee_factor, + protocol_fee_amount, + position_fee_receiver_factor, + fee_receiver_amount, + fee_amount_for_pool, + position_fee_amount_for_pool, + position_fee_amount, + total_cost_amount, + ui_fee_receiver_factor, + ui_fee_amount, + is_increase, + order_key, + position_key, + referral_code +FROM {{ ref('gmx_v2_' ~ chain ~ '_position_fees_info') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_increase.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_increase.sql new file mode 100644 index 00000000000..3ad8fe76548 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/event/gmx_v2_position_increase.sql @@ -0,0 +1,58 @@ +{{ config( + schema='gmx_v2', + alias = 'position_increase', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + block_time, + block_date, + block_number, + tx_hash, + index, + contract_address, + tx_from, + tx_to, + event_name, + msg_sender, + account, + market, + collateral_token, + size_in_usd, + size_in_tokens, + collateral_amount, + borrowing_factor, + funding_fee_amount_per_size, + long_token_claimable_funding_amount_per_size, + short_token_claimable_funding_amount_per_size, + execution_price, + index_token_price_max, + index_token_price_min, + collateral_token_price_max, + collateral_token_price_min, + size_delta_usd, + size_delta_in_tokens, + order_type, + increased_at_time, + collateral_delta_amount, + price_impact_usd, + price_impact_amount, + is_long, + order_key, + position_key +FROM {{ ref('gmx_v2_' ~ chain ~ '_position_increase') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_collateral_tokens_data.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_collateral_tokens_data.sql new file mode 100644 index 00000000000..e55a1eb7464 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_collateral_tokens_data.sql @@ -0,0 +1,13 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'collateral_tokens_data', + materialized = 'view' + ) +}} + +SELECT + contract_address AS collateral_token, + decimals AS collateral_token_decimals +FROM + {{ ref('gmx_v2_arbitrum_erc20') }} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_erc20.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_erc20.sql new file mode 100644 index 00000000000..a7c6f4a40d5 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_erc20.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'erc20', + materialized = 'view' + ) +}} + +{%- set url_path = 'https://arbitrum-api.gmxinfra.io/tokens/dune' -%} +{%- set blockchain_name = 'arbitrum' -%} + +SELECT + '{{ blockchain_name }}' AS blockchain, + 'gmx_v2' AS project, + json_extract_scalar(token, '$.symbol') AS symbol, + from_hex(json_extract_scalar(token, '$.address')) AS contract_address, + CAST(json_extract_scalar(token, '$.decimals') AS INTEGER) AS decimals, + COALESCE(CAST(json_extract_scalar(token, '$.synthetic') AS BOOLEAN), false) AS synthetic, + CURRENT_TIMESTAMP AS last_update_utc +FROM + UNNEST(CAST(json_parse(http_get('{{ url_path }}')) AS ARRAY(JSON))) AS t(token) diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_markets_data.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_markets_data.sql new file mode 100644 index 00000000000..b107f7ef61f --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_markets_data.sql @@ -0,0 +1,26 @@ +{{ + config( + schema = 'gmx_v2_arbitrum', + alias = 'markets_data', + materialized = 'view' + ) +}} + +SELECT + MCE.market_token AS market, + CONCAT(ERC20_IT.symbol, '/USD [', ERC20_LT.symbol, '-', ERC20_ST.symbol, ']') AS market_name, + 'GM' AS market_token_symbol, + 18 AS market_token_decimals, + ERC20_IT.symbol AS index_token_symbol, + ERC20_IT.decimals AS index_token_decimals, + ERC20_LT.symbol AS long_token_symbol, + ERC20_LT.decimals AS long_token_decimals, + ERC20_ST.symbol AS short_token_symbol, + ERC20_ST.decimals AS short_token_decimals +FROM {{ ref('gmx_v2_arbitrum_market_created') }} AS MCE +LEFT JOIN {{ ref('gmx_v2_arbitrum_erc20') }} AS ERC20_IT + ON ERC20_IT.contract_address = MCE.index_token +LEFT JOIN {{ ref('gmx_v2_arbitrum_erc20') }} AS ERC20_LT + ON ERC20_LT.contract_address = MCE.long_token +LEFT JOIN {{ ref('gmx_v2_arbitrum_erc20') }} AS ERC20_ST + ON ERC20_ST.contract_address = MCE.short_token \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_tokens_schema.yml b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_tokens_schema.yml new file mode 100644 index 00000000000..f40b6579a65 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/arbitrum/gmx_v2_arbitrum_tokens_schema.yml @@ -0,0 +1,132 @@ +version: 2 + +models: + - name: gmx_v2_arbitrum_collateral_tokens_data + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'collateral_tokens'] + description: | + Extracts token information related to collateral from the Arbitrum API. + This model retrieves details such as contract addresses and decimals of tokens used as collateral + in the GMX perpetual trading DEX on the Arbitrum blockchain. + + columns: + - name: collateral_token + description: The contract address of the token used as collateral. + tests: + - not_null + - name: collateral_token_decimals + description: The number of decimal places for the collateral token. + tests: + - not_null + + - name: gmx_v2_arbitrum_erc20 + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'tokens', 'erc20'] + description: | + This model extracts and parses ERC20 token information from the public GMX API. + It includes token symbols, contract addresses, decimals, and whether the token is synthetic. + The data reflects all available tokens on the decentralized exchange. + + columns: + - &blockchain + name: blockchain + description: The blockchain network where the token information was retrieved (Arbitrum) + tests: + - not_null + - &project + name: project + description: The project related to the tokens (GMX v2) + tests: + - not_null + - &symbol + name: symbol + description: The symbol of the ERC20 token + tests: + - not_null + - &contract_address + name: contract_address + description: The contract address of the ERC20 token + tests: + - not_null + - unique + - &decimals + name: decimals + description: The number of decimal places the token supports + tests: + - not_null + - &synthetic + name: synthetic + description: Indicates whether the token is synthetic or not + tests: + - not_null + - &last_update_utc + name: last_update_utc + description: The timestamp of when the data was last updated + tests: + - not_null + + + - name: gmx_v2_arbitrum_markets_data + meta: + blockchain: arbitrum + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'gmx', 'event', 'markets'] + description: | + This model retrieves market data for GMX on the Arbitrum blockchain, including information + about the index token, long token, and short token. The data is extracted from various tables + containing market creation events and ERC-20 token details, providing insights into the + market tokens used within the GMX perpetual trading DEX. The `market_name` column is + constructed using the format `index_token/USD [long_token-short_token]`, which represents + the market pair. + + columns: + - name: market + description: The contract address of the market token. + tests: + - not_null + - name: market_name + description: | + The name of the market, formatted as `index_token/USD [long_token-short_token]`, + where `index_token` is the symbol of the index token, `short_token` is the symbol + of the short token used in the market, and `long_token` is the symbol of the long token used in the market. + - name: market_token_symbol + description: The symbol representing the market token. + tests: + - not_null + - name: market_token_decimals + description: The number of decimal places for the market token. + tests: + - not_null + - name: index_token_symbol + description: The symbol representing the index token in the market. + - name: index_token_decimals + description: The number of decimal places for the index token used in the market. + - name: long_token_symbol + description: The symbol representing the long token in the market. + tests: + - not_null + - name: long_token_decimals + description: The number of decimal places for the long token used in the market. + tests: + - not_null + - name: short_token_symbol + description: The symbol representing the short token in the market. + tests: + - not_null + - name: short_token_decimals + description: The number of decimal places for the short token used in the market. + tests: + - not_null \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_collateral_tokens_data.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_collateral_tokens_data.sql new file mode 100644 index 00000000000..a0860c16b49 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_collateral_tokens_data.sql @@ -0,0 +1,13 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'collateral_tokens_data', + materialized = 'view' + ) +}} + +SELECT + contract_address AS collateral_token, + decimals AS collateral_token_decimals +FROM + {{ ref('gmx_v2_avalanche_c_erc20') }} diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_erc20.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_erc20.sql new file mode 100644 index 00000000000..abb2922bb26 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_erc20.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'erc20', + materialized = 'view' + ) +}} + +{%- set url_path = 'https://avalanche-api.gmxinfra.io/tokens/dune' -%} +{%- set blockchain_name = 'avalanche_c' -%} + +SELECT + '{{ blockchain_name }}' AS blockchain, + 'gmx_v2' AS project, + json_extract_scalar(token, '$.symbol') AS symbol, + from_hex(json_extract_scalar(token, '$.address')) AS contract_address, + CAST(json_extract_scalar(token, '$.decimals') AS INTEGER) AS decimals, + COALESCE(CAST(json_extract_scalar(token, '$.synthetic') AS BOOLEAN), false) AS synthetic, + CURRENT_TIMESTAMP AS last_update_utc +FROM + UNNEST(CAST(json_parse(http_get('{{ url_path }}')) AS ARRAY(JSON))) AS t(token) diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_markets_data.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_markets_data.sql new file mode 100644 index 00000000000..7a55c753da4 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_markets_data.sql @@ -0,0 +1,26 @@ +{{ + config( + schema = 'gmx_v2_avalanche_c', + alias = 'markets_data', + materialized = 'view' + ) +}} + +SELECT + MCE.market_token AS market, + CONCAT(ERC20_IT.symbol, '/USD [', ERC20_LT.symbol, '-', ERC20_ST.symbol, ']') AS market_name, + 'GM' AS market_token_symbol, + 18 AS market_token_decimals, + ERC20_IT.symbol AS index_token_symbol, + ERC20_IT.decimals AS index_token_decimals, + ERC20_LT.symbol AS long_token_symbol, + ERC20_LT.decimals AS long_token_decimals, + ERC20_ST.symbol AS short_token_symbol, + ERC20_ST.decimals AS short_token_decimals +FROM {{ ref('gmx_v2_avalanche_c_market_created') }} AS MCE +LEFT JOIN {{ ref('gmx_v2_avalanche_c_erc20') }} AS ERC20_IT + ON ERC20_IT.contract_address = MCE.index_token +LEFT JOIN {{ ref('gmx_v2_avalanche_c_erc20') }} AS ERC20_LT + ON ERC20_LT.contract_address = MCE.long_token +LEFT JOIN {{ ref('gmx_v2_avalanche_c_erc20') }} AS ERC20_ST + ON ERC20_ST.contract_address = MCE.short_token \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_tokens_schema.yml b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_tokens_schema.yml new file mode 100644 index 00000000000..90371ad9f7d --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/avalanche_c/gmx_v2_avalanche_c_tokens_schema.yml @@ -0,0 +1,131 @@ +version: 2 + +models: + - name: gmx_v2_avalanche_c_collateral_tokens_data + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'collateral_tokens'] + description: | + Extracts token information related to collateral from the Avalanche API. + This model retrieves details such as contract addresses and decimals of tokens used as collateral + in the GMX perpetual trading DEX on the Avalanche blockchain. + + columns: + - name: collateral_token + description: The contract address of the token used as collateral. + tests: + - not_null + - name: collateral_token_decimals + description: The number of decimal places for the collateral token. + tests: + - not_null + + - name: gmx_v2_avalanche_c_erc20 + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'tokens', 'erc20'] + description: | + This model extracts and parses ERC20 token information from the public GMX API. + It includes token symbols, contract addresses, decimals, and whether the token is synthetic. + The data reflects all available tokens on the decentralized exchange. + + columns: + - &blockchain + name: blockchain + description: The blockchain network where the token information was retrieved (Avalanche) + tests: + - not_null + - &project + name: project + description: The project related to the tokens (GMX v2) + tests: + - not_null + - &symbol + name: symbol + description: The symbol of the ERC20 token + tests: + - not_null + - &contract_address + name: contract_address + description: The contract address of the ERC20 token + tests: + - not_null + - unique + - &decimals + name: decimals + description: The number of decimal places the token supports + tests: + - not_null + - &synthetic + name: synthetic + description: Indicates whether the token is synthetic or not + tests: + - not_null + - &last_update_utc + name: last_update_utc + description: The timestamp of when the data was last updated + tests: + - not_null + + - name: gmx_v2_avalanche_c_markets_data + meta: + blockchain: avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['avalanche_c', 'gmx', 'event', 'markets'] + description: | + This model retrieves market data for GMX on the Avalanche blockchain, including information + about the index token, long token, and short token. The data is extracted from various tables + containing market creation events and ERC-20 token details, providing insights into the + market tokens used within the GMX perpetual trading DEX. The `market_name` column is + constructed using the format `index_token/USD [long_token-short_token]`, which represents + the market pair. + + columns: + - name: market + description: The contract address of the market token. + tests: + - not_null + - name: market_name + description: | + The name of the market, formatted as `index_token/USD [long_token-short_token]`, + where `index_token` is the symbol of the index token, `short_token` is the symbol + of the short token used in the market, and `long_token` is the symbol of the long token used in the market. + - name: market_token_symbol + description: The symbol representing the market token. + tests: + - not_null + - name: market_token_decimals + description: The number of decimal places for the market token. + tests: + - not_null + - name: index_token_symbol + description: The symbol representing the index token in the market. + - name: index_token_decimals + description: The number of decimal places for the index token used in the market. + - name: long_token_symbol + description: The symbol representing the long token in the market. + tests: + - not_null + - name: long_token_decimals + description: The number of decimal places for the long token used in the market. + tests: + - not_null + - name: short_token_symbol + description: The symbol representing the short token in the market. + tests: + - not_null + - name: short_token_decimals + description: The number of decimal places for the short token used in the market. + tests: + - not_null diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_collateral_tokens_data.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_collateral_tokens_data.sql new file mode 100644 index 00000000000..6fde517024e --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_collateral_tokens_data.sql @@ -0,0 +1,21 @@ +{{ config( + schema='gmx_v2', + alias = 'collateral_tokens_data', + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + '{{ chain }}' AS "blockchain", + collateral_token, + collateral_token_decimals +FROM {{ ref('gmx_v2_' ~ chain ~ '_collateral_tokens_data') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_erc20.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_erc20.sql new file mode 100644 index 00000000000..358c210091c --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_erc20.sql @@ -0,0 +1,29 @@ +{{ config( + schema='gmx_v2', + alias = 'erc20', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + blockchain, + project, + symbol, + contract_address, + decimals, + synthetic, + last_update_utc +FROM {{ ref('gmx_v2_' ~ chain ~ '_erc20') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_markets_data.sql b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_markets_data.sql new file mode 100644 index 00000000000..0c0951fee6f --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_markets_data.sql @@ -0,0 +1,33 @@ +{{ config( + schema='gmx_v2', + alias = 'markets_data', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c"]\', + "project", + "gmx", + \'["ai_data_master","gmx-io"]\') }}' + ) +}} + +{%- set chains = [ + 'arbitrum', + 'avalanche_c', +] -%} + +{%- for chain in chains -%} +SELECT + '{{ chain }}' AS "blockchain", + market, + market_name, + market_token_symbol, + market_token_decimals, + index_token_symbol, + index_token_decimals, + long_token_symbol, + long_token_decimals, + short_token_symbol, + short_token_decimals +FROM {{ ref('gmx_v2_' ~ chain ~ '_markets_data') }} +{% if not loop.last %} +UNION ALL +{% endif %} +{%- endfor -%} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_tokens_schema.yml b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_tokens_schema.yml new file mode 100644 index 00000000000..b317f3e2af2 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_projects/gmx/tokens/gmx_v2_tokens_schema.yml @@ -0,0 +1,132 @@ +version: 2 + +models: + - name: gmx_v2_collateral_tokens_data + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'avalanche_c', 'gmx', 'event', 'collateral_tokens'] + description: | + Extracts token information related to collateral from the public GMX API for Arbitrum and Avalanche blockchains. + This model retrieves details such as contract addresses and decimals of tokens used as collateral + in the GMX perpetual trading DEX on the Arbitrum blockchain. + + columns: + - &blockchain + name: blockchain + description: The blockchain network where the token information was retrieved + tests: + - not_null + - name: collateral_token + description: The contract address of the token used as collateral. + tests: + - not_null + - name: collateral_token_decimals + description: The number of decimal places for the collateral token. + tests: + - not_null + + - name: gmx_v2_erc20 + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'avalanche_c', 'gmx', 'tokens', 'erc20'] + description: | + This model extracts and parses ERC20 token information from the public GMX API. + It includes token symbols, contract addresses, decimals, and whether the token is synthetic. + The data reflects all available tokens on the decentralized exchange. + + columns: + - *blockchain + - &project + name: project + description: The project related to the tokens (GMX v2) + tests: + - not_null + - &symbol + name: symbol + description: The symbol of the ERC20 token + tests: + - not_null + - &contract_address + name: contract_address + description: The contract address of the ERC20 token + tests: + - not_null + - unique + - &decimals + name: decimals + description: The number of decimal places the token supports + tests: + - not_null + - &synthetic + name: synthetic + description: Indicates whether the token is synthetic or not + tests: + - not_null + - &last_update_utc + name: last_update_utc + description: The timestamp of when the data was last updated + tests: + - not_null + + + - name: gmx_v2_markets_data + meta: + blockchain: arbitrum, avalanche_c + sector: dex + project: gmx + contributors: ai_data_master, gmx-io + config: + tags: ['arbitrum', 'avalanche_c', 'gmx', 'event', 'markets'] + description: | + This model retrieves market data for GMX on the Arbitrum and Avalanche blockchains, including information + about the index token, long token, and short token. The data is extracted from various tables + containing market creation events and ERC-20 token details, providing insights into the + market tokens used within the GMX perpetual trading DEX. + + columns: + - *blockchain + - name: market + description: The contract address of the market token. + tests: + - not_null + - name: market_name + description: | + The name of the market, formatted as `index_token/USD [long_token-short_token]`, + where `index_token` is the symbol of the index token, `short_token` is the symbol + of the short token used in the market, and `long_token` is the symbol of the long token used in the market. + - name: market_token_symbol + description: The symbol representing the market token. + tests: + - not_null + - name: market_token_decimals + description: The number of decimal places for the market token. + tests: + - not_null + - name: index_token_symbol + description: The symbol representing the index token in the market. + - name: index_token_decimals + description: The number of decimal places for the index token used in the market. + - name: long_token_symbol + description: The symbol representing the long token in the market. + tests: + - not_null + - name: long_token_decimals + description: The number of decimal places for the long token used in the market. + tests: + - not_null + - name: short_token_symbol + description: The symbol representing the short token in the market. + tests: + - not_null + - name: short_token_decimals + description: The number of decimal places for the short token used in the market. + tests: + - not_null \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/oneinch/oneinch_project_orders.sql b/dbt_subprojects/daily_spellbook/models/_projects/oneinch/oneinch_project_orders.sql index d933422edd9..10c5ba818e2 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/oneinch/oneinch_project_orders.sql +++ b/dbt_subprojects/daily_spellbook/models/_projects/oneinch/oneinch_project_orders.sql @@ -94,6 +94,14 @@ meta as ( {% endif %} ) +, trusted_tokens as ( + select + distinct blockchain + , contract_address + , true as trusted + from {{ source('prices', 'trusted_tokens') }} +) + , prices as ( select blockchain @@ -131,6 +139,8 @@ meta as ( , any_value(taking_amount) as taking_amount , any_value(making_amount * price / pow(10, decimals)) filter(where contract_address = assets[1]) as making_amount_usd , any_value(taking_amount * price / pow(10, decimals)) filter(where contract_address = assets[2]) as taking_amount_usd + , any_value(making_amount * price / pow(10, decimals)) filter(where contract_address = assets[1] and trusted) as making_amount_usd_trusted + , any_value(taking_amount * price / pow(10, decimals)) filter(where contract_address = assets[2] and trusted) as taking_amount_usd_trusted , any_value(order_start) as order_start , any_value(order_end) as order_end , any_value(order_deadline) as order_deadline @@ -139,6 +149,7 @@ meta as ( , any_value(tag) as tag from (select * from orders, unnest(assets) as a(contract_address)) left join prices using(blockchain, contract_address, minute) + left join trusted_tokens using(blockchain, contract_address) group by 1, 2, 3, 4, 5, 6 ) @@ -164,7 +175,14 @@ select , taking_amount , making_amount_usd , taking_amount_usd - , greatest(coalesce(making_amount_usd, 0), coalesce(taking_amount_usd, 0)) as amount_usd + , coalesce( + greatest(making_amount_usd_trusted, taking_amount_usd_trusted) + , making_amount_usd_trusted + , taking_amount_usd_trusted + , greatest(making_amount_usd, taking_amount_usd) + , making_amount_usd + , taking_amount_usd + ) as amount_usd , order_hash , order_start , order_end diff --git a/dbt_subprojects/daily_spellbook/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql b/dbt_subprojects/daily_spellbook/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql index bc7df505196..9a2cc3155b7 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql @@ -28,20 +28,19 @@ SELECT 'ethereum' AS blockchain , t.evt_block_number AS block_number , 'x2y2' AS project , 1 AS airdrop_number -, t.to AS recipient +, t.receiver AS recipient , t.contract_address , t.evt_tx_hash AS tx_hash -, t.value AS amount_raw -, CAST(t.value/POWER(10, 18) AS double) AS amount_original -, CASE WHEN t.evt_block_time >= (SELECT minute FROM early_price) THEN CAST(pu.price*t.value/POWER(10, 18) AS double) - ELSE CAST((SELECT price FROM early_price)*t.value/POWER(10, 18) AS double) +, t.amount AS amount_raw +, CAST(t.amount/POWER(10, 18) AS double) AS amount_original +, CASE WHEN t.evt_block_time >= (SELECT minute FROM early_price) THEN CAST(pu.price*t.amount/POWER(10, 18) AS double) + ELSE CAST((SELECT price FROM early_price)*t.amount/POWER(10, 18) AS double) END AS amount_usd , {{xtyt_token_address}} AS token_address , 'X2Y2' AS token_symbol , t.evt_index -FROM {{ source('erc20_ethereum', 'evt_transfer') }} t -LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +FROM {{ source('x2y2_ethereum', 'X2Y2Drop_evt_Airdrop') }} t +LEFT JOIN {{ source('prices', 'usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{xtyt_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) WHERE t.evt_block_time BETWEEN timestamp '2022-02-15' AND timestamp '2022-03-31' - AND t.contract_address = {{xtyt_token_address}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/_schema.yml index 189944e753a..d70fac5266c 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/_schema.yml @@ -3,7 +3,7 @@ version: 2 models: - name: eas_schemas meta: - blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo + blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo, linea, nova sector: attestation contributors: tomfutago config: @@ -70,7 +70,7 @@ models: - name: eas_schema_details meta: - blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo + blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo, linea, nova sector: attestation contributors: tomfutago config: @@ -107,7 +107,7 @@ models: - name: eas_attestations meta: - blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo + blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo, linea, nova sector: attestation contributors: tomfutago config: @@ -170,7 +170,7 @@ models: - name: eas_attestation_details meta: - blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo + blockchain: arbitrum, base, ethereum, optimism, polygon, scroll, celo, linea, nova sector: attestation contributors: tomfutago config: diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestation_details.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestation_details.sql index 5efdef6e658..590c2e783d3 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestation_details.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestation_details.sql @@ -21,7 +21,9 @@ ref('eas_optimism_attestation_details'), ref('eas_polygon_attestation_details'), ref('eas_scroll_attestation_details'), - ref('eas_celo_attestation_details') + ref('eas_celo_attestation_details'), + ref('eas_linea_attestation_details'), + ref('eas_nova_attestation_details') ] %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestations.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestations.sql index bc613514ff6..862e40bcb17 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestations.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_attestations.sql @@ -21,7 +21,9 @@ ref('eas_optimism_attestations'), ref('eas_polygon_attestations'), ref('eas_scroll_attestations'), - ref('eas_celo_attestations') + ref('eas_celo_attestations'), + ref('eas_linea_attestations'), + ref('eas_nova_attestations') ] %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schema_details.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schema_details.sql index 24d1aa68688..15b66ac4e78 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schema_details.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schema_details.sql @@ -19,7 +19,9 @@ ref('eas_optimism_schema_details'), ref('eas_polygon_schema_details'), ref('eas_scroll_schema_details'), - ref('eas_celo_schema_details') + ref('eas_celo_schema_details'), + ref('eas_linea_schema_details'), + ref('eas_nova_schema_details') ] %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schemas.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schemas.sql index c7a3bf873dc..62507309f7f 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schemas.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/eas_schemas.sql @@ -21,7 +21,9 @@ ref('eas_optimism_schemas'), ref('eas_polygon_schemas'), ref('eas_scroll_schemas'), - ref('eas_celo_schemas') + ref('eas_celo_schemas'), + ref('eas_linea_schemas'), + ref('eas_nova_schemas') ] %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/_schema.yml new file mode 100644 index 00000000000..57511439e03 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/_schema.yml @@ -0,0 +1,86 @@ +version: 2 + +models: + - name: eas_linea_schemas + meta: + blockchain: linea + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'linea' ] + description: "EAS schema registry on Linea" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + columns: + - &schema_uid + name: schema_uid + description: "Schema unique identifier" + tests: + - not_null + + - name: eas_linea_schema_details + meta: + blockchain: linea + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'linea' ] + description: "EAS schema registry details on Linea" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + - ordinality + columns: + - *schema_uid + - &ordinality + name: ordinality + description: "Incremental unique number to order fields within each Schema" + tests: + - not_null + + - name: eas_linea_attestations + meta: + blockchain: linea + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'linea' ] + description: "EAS attestations on Linea" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + - attestation_uid + columns: + - *schema_uid + - &attestation_uid + name: attestation_uid + description: "Attestation unique identifier" + tests: + - not_null + + - name: eas_linea_attestation_details + meta: + blockchain: linea + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'linea' ] + description: "EAS attestation details on Linea" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + - attestation_uid + - ordinality + columns: + - *schema_uid + - *attestation_uid + - *ordinality diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_attestation_details.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_attestation_details.sql new file mode 100644 index 00000000000..a106f9cc7d3 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_attestation_details.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'eas_linea', + alias = 'attestation_details', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['schema_uid', 'attestation_uid', 'ordinality'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + eas_attestation_details( + blockchain = 'linea', + project = 'eas', + version = '1' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_attestations.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_attestations.sql new file mode 100644 index 00000000000..6c07406bbf8 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_attestations.sql @@ -0,0 +1,20 @@ +{{ + config( + schema = 'eas_linea', + alias = 'attestations', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['schema_uid', 'attestation_uid'] + ) +}} + +{{ + eas_attestations( + blockchain = 'linea', + project = 'eas', + version = '1', + decoded_project_name = 'attestationstation_v1', + schema_column_name = 'schemaUID' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_schema_details.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_schema_details.sql new file mode 100644 index 00000000000..f868a014061 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_schema_details.sql @@ -0,0 +1,16 @@ +{{ + config( + schema = 'eas_linea', + alias = 'schema_details', + materialized = 'view', + unique_key = ['schema_uid', 'ordinality'] + ) +}} + +{{ + eas_schema_details( + blockchain = 'linea', + project = 'eas', + version = '1' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_schemas.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_schemas.sql new file mode 100644 index 00000000000..2c03de47bfa --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/linea/eas_linea_schemas.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'eas_linea', + alias = 'schemas', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['schema_uid'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + eas_schemas( + blockchain = 'linea', + project = 'eas', + version = '1' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/_schema.yml new file mode 100644 index 00000000000..2c39ad8347f --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/_schema.yml @@ -0,0 +1,86 @@ +version: 2 + +models: + - name: eas_nova_schemas + meta: + blockchain: nova + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'nova' ] + description: "EAS schema registry on Nova" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + columns: + - &schema_uid + name: schema_uid + description: "Schema unique identifier" + tests: + - not_null + + - name: eas_nova_schema_details + meta: + blockchain: nova + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'nova' ] + description: "EAS schema registry details on Nova" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + - ordinality + columns: + - *schema_uid + - &ordinality + name: ordinality + description: "Incremental unique number to order fields within each Schema" + tests: + - not_null + + - name: eas_nova_attestations + meta: + blockchain: nova + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'nova' ] + description: "EAS attestations on Nova" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + - attestation_uid + columns: + - *schema_uid + - &attestation_uid + name: attestation_uid + description: "Attestation unique identifier" + tests: + - not_null + + - name: eas_nova_attestation_details + meta: + blockchain: nova + sector: attestation + project: eas + contributors: tomfutago + config: + tags: [ 'attestation', 'eas', 'nova' ] + description: "EAS attestation details on Nova" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - schema_uid + - attestation_uid + - ordinality + columns: + - *schema_uid + - *attestation_uid + - *ordinality diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_attestation_details.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_attestation_details.sql new file mode 100644 index 00000000000..11e026767b7 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_attestation_details.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'eas_nova', + alias = 'attestation_details', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['schema_uid', 'attestation_uid', 'ordinality'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + eas_attestation_details( + blockchain = 'nova', + project = 'eas', + version = '1' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_attestations.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_attestations.sql new file mode 100644 index 00000000000..42081b50d72 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_attestations.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'eas_nova', + alias = 'attestations', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['schema_uid', 'attestation_uid'] + ) +}} + +{{ + eas_attestations( + blockchain = 'nova', + project = 'eas', + version = '1', + schema_column_name = 'schemaUID' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_schema_details.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_schema_details.sql new file mode 100644 index 00000000000..3b5cfe0797b --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_schema_details.sql @@ -0,0 +1,16 @@ +{{ + config( + schema = 'eas_nova', + alias = 'schema_details', + materialized = 'view', + unique_key = ['schema_uid', 'ordinality'] + ) +}} + +{{ + eas_schema_details( + blockchain = 'nova', + project = 'eas', + version = '1' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_schemas.sql b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_schemas.sql new file mode 100644 index 00000000000..2b84c29a48d --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/attestation/eas/nova/eas_nova_schemas.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'eas_nova', + alias = 'schemas', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['schema_uid'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + eas_schemas( + blockchain = 'nova', + project = 'eas', + version = '1' + ) +}} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/dex/pools/dex_pools_metrics_daily.sql b/dbt_subprojects/daily_spellbook/models/_sector/dex/pools/dex_pools_metrics_daily.sql index 94423f60d12..8a893d7096d 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/dex/pools/dex_pools_metrics_daily.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/dex/pools/dex_pools_metrics_daily.sql @@ -14,7 +14,9 @@ }} {% set dex_pool_metrics_models = [ - source('balancer','pools_metrics_daily') + source('balancer','pools_metrics_daily'), + source('beethoven_x_fantom','pools_metrics_daily'), + source('jelly_swap_sei','pools_metrics_daily') ] %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees.sql deleted file mode 100644 index deafec33444..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees.sql +++ /dev/null @@ -1,56 +0,0 @@ -{{ config( - schema = 'gas_arbitrum', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash','block_number'] - ) -}} - -SELECT - 'arbitrum' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - (effective_gas_price / 1e18) * txns.gas_used as tx_fee_native, - (effective_gas_price / 1e18) * txns.gas_used * p.price AS tx_fee_usd, - cast(NULL as double) AS burned_native, -- Not applicable for L2s - cast(NULL as double) AS burned_usd, -- Not applicable for L2s - cast(NULL as varbinary) as validator, -- Not applicable for L2s - txns.effective_gas_price/1e9 as gas_price_gwei, - txns.effective_gas_price/1e18 * p.price as gas_price_usd, - txns.gas_price/1e9 as gas_price_bid_gwei, - txns.gas_price/1e18 * p.price as gas_price_bid_usd, - txns.gas_used as gas_used, - txns.gas_limit as gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - gas_used_for_l1 as l1_gas_used, - type as transaction_type -FROM {{ source('arbitrum','transactions') }} txns -JOIN {{ source('arbitrum','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices','usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.blockchain = 'arbitrum' -AND p.symbol = 'WETH' -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees_schema.yml deleted file mode 100644 index 87f07f20448..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees_schema.yml +++ /dev/null @@ -1,147 +0,0 @@ -version: 2 - -models: - - name: gas_arbitrum_fees - meta: - blockchain: arbitrum - sector: gas - contributors: soispoke - config: - tags: ['arbitrum', 'gas', 'fees'] - description: > - Gas Fees on Arbitrum rollup Layer 2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_number - - tx_hash - columns: - - &blokchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactionsonly indirectly burn gas on L1" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactionsonly indirectly burn gas on L1" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_price_bid_gwei - name: gas_price_bid_gwei - description: "Gas price (per gas unit) estimated by ArbOs with a buffer denoted in gwei. All excess is refunded" - - &gas_price_bid_usd - name: gas_price_bid_usd - description: "Gas price (per gas unit) estimated by ArbOs with a buffer denoted in $USD. All excess is refunded" - - &gas_used - name: gas_used - description: "Amount of L2 gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction on Optimism L2" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit on Optimism L2" - - &l1_gas_used - name: l1_gas_used - description: "Amount of L1 gas units consumed by the transaction" - - &type - name: type - description: "Transaction type: Legacy (Pre EIP 1559) or DynamicFee (Post EIP-1559)" - - - name: gas_arbitrum_fees_traces - meta: - blockchain: arbitrum - sector: gas - contributors: hildobby - config: - tags: ['arbitrum', 'gas', 'fees', 'traces'] - description: > - Gas Fees per Trace on Arbitrum - columns: - - name: blockchain - description: "Blockchain name" - - name: block_time - description: "Timestamp for block event time in UTC" - - name: block_date - description: "UTC Date of transaction in UTC" - - name: block_number - description: "Block number" - - name: tx_hash - description: "Primary key of the transaction" - - name: trace_from - description: "Address address that initiated the trace" - - name: trace_to - description: "Address address that received the trace" - - name: tx_from - description: "Address address that initiated the transaction" - - name: tx_to - description: "Address address that received the transaction" - - name: trace - description: "Trace" - - name: trace_method - description: "Trace method" - - name: tx_method - description: "Function method" - - name: trace_input - - name: gas_used_original - description: "Gas used in trace and its subtraces" - - name: gas_used_trace - description: "Gas used in trace (excluding gas spent in subtraces)" - - name: tx_gas_used - description: "Total gas used in the transaction" - - name: gas_used_original_percentage - description: "Percentage of trace (and subtraces) gas used out of the total gas used in the transaction" - - name: gas_used_trace_percentage - description: "Percentage of trace gas used out of the total gas used in the transaction" - - name: tx_gas_price - description: "Transaction gas price" - - name: trace_type - description: "Trace type" - - name: trace_value - description: "Trace value" - - name: trace_success - description: "Was the trace successful?" - - name: tx_success - description: "Was the transaction successful?" - - name: gas_fee_spent_trace - description: "Amount of ETH spent in gas fees" - - name: gas_fee_spent_trace_usd - description: "USD value of the amount of ETH spent in gas fees" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees_traces.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees_traces.sql deleted file mode 100644 index 14399c0df50..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees_traces.sql +++ /dev/null @@ -1,115 +0,0 @@ -{{ config( -tags=['prod_exclude'], - schema = 'gas_arbitrum', - alias = 'fees_traces', - partition_by = ['block_date'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'trace'], - ) -}} - -/* - note: this spell has not been migrated to dunesql, therefore is only a view on spark - please migrate to dunesql to ensure up-to-date logic & data -*/ - -WITH traces AS ( - SELECT traces.block_time - , traces.block_number - , traces.tx_hash - , MAX(traces.from) AS trace_from - , MAX(traces.to) AS trace_to - , traces.trace - , MAX(traces.input) AS trace_input - , substring(MAX(traces.input),1,10) AS trace_method - , SUM(traces.gas_used_original) AS gas_used_original - , SUM(traces.gas_used_trace) AS gas_used_trace - , MAX(traces.trace_type) AS trace_type - , MAX(traces.trace_value) AS trace_value - , MAX(traces.trace_success) AS trace_success - , MAX(traces.tx_success) AS tx_success - FROM ( - SELECT from - , to - , tx_hash - , trace_address AS trace - , gas_used AS gas_used_original - , gas_used AS gas_used_trace - , block_time - , block_number - , input - , type AS trace_type - , value AS trace_value - , success AS trace_success - , tx_success - FROM {{ source('arbitrum','traces') }} - {% if is_incremental() %} - WHERE {{ incremental_predicate('block_time') }} - {% endif %} - - UNION ALL - - SELECT CAST(NULL AS varchar(1)) AS from - , CAST(NULL AS varchar(1)) AS to - , tx_hash - , slice(trace_address, 1, cardinality(trace_address) - 1) AS trace - , CAST(NULL AS double) AS gas_used_original - , -gas_used AS gas_used_trace - , block_time - , block_number - , CAST(NULL AS varchar(1)) AS input - , CAST(NULL AS varchar(1)) AS trace_type - , CAST(NULL AS varchar(1)) AS trace_value - , CAST(NULL AS boolean) AS trace_success - , CAST(NULL AS boolean) AS tx_success - FROM {{ source('arbitrum','traces') }} - WHERE cardinality(trace_address) > 0 - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} - ) traces - GROUP BY traces.tx_hash, traces.trace, traces.block_time, traces.block_number - ) - -SELECT 'arbitrum' AS blockchain -, traces.block_time -, date_trunc('day', traces.block_time) AS block_date -, traces.block_number -, traces.tx_hash -, traces.trace_from -, traces.trace_to -, txs.from AS tx_from -, txs.to AS tx_to -, traces.trace -, traces.trace_method -, substring(txs.data,1,10) AS tx_method -, traces.trace_input -, traces.gas_used_original -, traces.gas_used_trace -, txs.gas_used AS tx_gas_used -, traces.gas_used_original/txs.gas_used AS gas_used_original_percentage -, traces.gas_used_trace/txs.gas_used AS gas_used_trace_percentage -, txs.gas_price AS tx_gas_price -, traces.trace_type -, traces.trace_value -, traces.trace_success -, traces.tx_success -, (traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original -, (pu.price*traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original_usd -, (traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace -, (pu.price*traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace_usd -FROM traces -INNER JOIN {{ source('arbitrum','transactions') }} txs ON txs.block_time=traces.block_time - AND txs.hash=traces.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('txs.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.minute=date_trunc('minute', traces.block_time) - AND pu.blockchain='arbitrum' - AND pu.contract_address='0x82af49447d8a07e3bd95bd0d56f35241523fbab1' - {% if is_incremental() %} - AND {{ incremental_predicate('pu.minute') }} - {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees.sql deleted file mode 100644 index fd9502baad9..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees.sql +++ /dev/null @@ -1,70 +0,0 @@ -{{ config( - schema = 'gas_avalanche_c', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash'] - ) -}} - - -SELECT - 'avalanche_c' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'AVAX' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - CASE WHEN type = 'Legacy' THEN (gas_price/1e18) * txns.gas_used - WHEN type = 'DynamicFee' THEN ((base_fee_per_gas + priority_fee_per_gas)/1e18) * txns.gas_used - END AS tx_fee_native, - CASE WHEN type = 'Legacy' THEN (gas_price/1e18) * txns.gas_used * p.price - WHEN type = 'DynamicFee' THEN ((base_fee_per_gas + priority_fee_per_gas)/1e18 * txns.gas_used) * p.price - END AS tx_fee_usd, - CASE WHEN type = 'Legacy' THEN (gas_price/1e18) * txns.gas_used - WHEN type = 'DynamicFee' THEN ((base_fee_per_gas + priority_fee_per_gas)/1e18) * txns.gas_used - END AS burned_native, - CASE WHEN type = 'Legacy' THEN (gas_price /1e18) * txns.gas_used * p.price - WHEN type = 'DynamicFee' THEN ((base_fee_per_gas + priority_fee_per_gas)/1e18) * txns.gas_used * p.price - END AS burned_usd, - (max_fee_per_gas - priority_fee_per_gas - base_fee_per_gas) / 1e18 * txns.gas_used AS tx_savings_native, - (max_fee_per_gas - priority_fee_per_gas - base_fee_per_gas) / 1e18 * txns.gas_used * p.price AS tx_savings_usd, - miner AS validator, -- or block_proposer since Proposer Builder Separation (PBS) happened ? - max_fee_per_gas / 1e9 AS max_fee_gwei, - max_fee_per_gas / 1e18 * p.price AS max_fee_usd, - base_fee_per_gas / 1e9 AS base_fee_gwei, - base_fee_per_gas / 1e18 * p.price AS base_fee_usd, - priority_fee_per_gas / 1e9 AS priority_fee_gwei, - priority_fee_per_gas / 1e18 * p.price AS priority_fee_usd, - gas_price / 1e9 AS gas_price_gwei, - gas_price / 1e18 * p.price AS gas_price_usd, - txns.gas_used, - txns.gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - difficulty, - type AS transaction_type -FROM {{ source('avalanche_c','transactions') }} txns -JOIN {{ source('avalanche_c','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices','usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.symbol = 'AVAX' and p.blockchain is null -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees_traces.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees_traces.sql deleted file mode 100644 index 2388ec14886..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees_traces.sql +++ /dev/null @@ -1,115 +0,0 @@ -{{ config( -tags=['prod_exclude'], - schema = 'gas_avalanche_c', - alias = 'fees_traces', - partition_by = ['block_date'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'trace'], - ) -}} - -/* - note: this spell has not been migrated to dunesql, therefore is only a view on spark - please migrate to dunesql to ensure up-to-date logic & data -*/ - -WITH traces AS ( - SELECT traces.block_time - , traces.block_number - , traces.tx_hash - , MAX(traces.from) AS trace_from - , MAX(traces.to) AS trace_to - , traces.trace - , MAX(traces.input) AS trace_input - , substring(MAX(traces.input),1,10) AS trace_method - , SUM(traces.gas_used_original) AS gas_used_original - , SUM(traces.gas_used_trace) AS gas_used_trace - , MAX(traces.trace_type) AS trace_type - , MAX(traces.trace_value) AS trace_value - , MAX(traces.trace_success) AS trace_success - , MAX(traces.tx_success) AS tx_success - FROM ( - SELECT from - , to - , tx_hash - , trace_address AS trace - , gas_used AS gas_used_original - , gas_used AS gas_used_trace - , block_time - , block_number - , input - , type AS trace_type - , value AS trace_value - , success AS trace_success - , tx_success - FROM {{ source('avalanche_c','traces') }} - {% if is_incremental() %} - WHERE {{ incremental_predicate('block_time') }} - {% endif %} - - UNION ALL - - SELECT CAST(NULL AS varchar(1)) AS from - , CAST(NULL AS varchar(1)) AS to - , tx_hash - , slice(trace_address, 1, cardinality(trace_address) - 1) AS trace - , CAST(NULL AS double) AS gas_used_original - , -gas_used AS gas_used_trace - , block_time - , block_number - , CAST(NULL AS varchar(1)) AS input - , CAST(NULL AS varchar(1)) AS trace_type - , CAST(NULL AS varchar(1)) AS trace_value - , CAST(NULL AS boolean) AS trace_success - , CAST(NULL AS boolean) AS tx_success - FROM {{ source('avalanche_c','traces') }} - WHERE cardinality(trace_address) > 0 - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} - ) traces - GROUP BY traces.tx_hash, traces.trace, traces.block_time, traces.block_number - ) - -SELECT 'avalanche_c' AS blockchain -, traces.block_time -, date_trunc('day', traces.block_time) AS block_date -, traces.block_number -, traces.tx_hash -, traces.trace_from -, traces.trace_to -, txs.from AS tx_from -, txs.to AS tx_to -, traces.trace -, traces.trace_method -, substring(txs.data,1,10) AS tx_method -, traces.trace_input -, traces.gas_used_original -, traces.gas_used_trace -, txs.gas_used AS tx_gas_used -, traces.gas_used_original/txs.gas_used AS gas_used_original_percentage -, traces.gas_used_trace/txs.gas_used AS gas_used_trace_percentage -, txs.gas_price AS tx_gas_price -, traces.trace_type -, traces.trace_value -, traces.trace_success -, traces.tx_success -, (traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original -, (pu.price*traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original_usd -, (traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace -, (pu.price*traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace_usd -FROM traces -INNER JOIN {{ source('avalanche_c','transactions') }} txs ON txs.block_time=traces.block_time - AND txs.hash=traces.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('txs.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.minute=date_trunc('minute', traces.block_time) - AND pu.blockchain='avalanche_c' - AND pu.contract_address='0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7' - {% if is_incremental() %} - AND {{ incremental_predicate('pu.minute') }} - {% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_schema.yml deleted file mode 100644 index 3ab2014f5e0..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_schema.yml +++ /dev/null @@ -1,163 +0,0 @@ -version: 2 - -models: - - name: gas_avalanche_c_fees - meta: - blockchain: avalanche_c - sector: gas - contributors: soispoke - config: - tags: ['avalanche_c', 'gas', 'fees'] - description: > - Gas Fees on Avalanche - columns: - - &blokchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (AVAX) for the Avalanche Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (AVAX) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (AVAX) paid in gas fees -- Pre Apricot Upgrade: Gas Price * Gas Used; Post Apricot Upgrade: Gas Price * Gas Used ; Base fee + Priority fee) * Gas used" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (AVAX) burned for this transaction, is equal to the total transaction fee for the Avalanche blockchain" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction" - - &tx_savings_native - name: tx_savings_native - description: "Total amount of native tokens (AVAX) refunded to the user if the max fee exceeded the total transaction fee after the transaction execution" - - &tx_savings_usd - name: tx_savings_usd - description: "Total amount of $USD refunded to the user" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &max_fee_gwei - name: max_fee_gwei - description: "Maximum amount of gas (in Gwei) willing to be paid for the transaction: Is refunded if exceeds the total transaction fee once the transaction is executed" - - &max_fee_usd - name: max_fee_usd - description: "Maximum amount of gas (in $USD) willing to be paid for the transaction: Is refunded if exceeds the total transaction fee once the transaction is executed" - - &base_fee_gwei - name: base_fee_gwei - description: "Market price for gas (in Gwei)" - - &base_fee_usd - name: base_fee_usd - description: "Market price for gas (in $USD)" - - &priority_fee_gwei - name: priority_fee_gwei - description: "Maximum amount of gas (in Gwei) to be included as a tip to the miner/validator" - - &priority_fee_usd - name: priority_fee_usd - description: "Maximum amount of gas (in $USD) to be included as a tip to the miner/validator" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit" - - &difficulty - name: difficulty - description: "Maximum amount of gas units that can be consumed by the transaction" - - &type - name: type - description: "Transaction type: Legacy (Pre EIP 1559) or DynamicFee (Post EIP-1559)" - - - name: gas_avalanche_c_fees_traces - meta: - blockchain: avalanche_c - sector: gas - contributors: hildobby - config: - tags: ['avalanche_c', 'gas', 'fees', 'traces'] - description: > - Gas Fees per Trace on Avalanche - columns: - - name: blockchain - description: "Blockchain name" - - name: block_time - description: "Timestamp for block event time in UTC" - - name: block_date - description: "UTC Date of transaction in UTC" - - name: block_number - description: "Block number" - - name: tx_hash - description: "Primary key of the transaction" - - name: trace_from - description: "Address address that initiated the trace" - - name: trace_to - description: "Address address that received the trace" - - name: tx_from - description: "Address address that initiated the transaction" - - name: tx_to - description: "Address address that received the transaction" - - name: trace - description: "Trace" - - name: trace_method - description: "Trace method" - - name: tx_method - description: "Function method" - - name: trace_input - - name: gas_used_original - description: "Gas used in trace and its subtraces" - - name: gas_used_trace - description: "Gas used in trace (excluding gas spent in subtraces)" - - name: tx_gas_used - description: "Total gas used in the transaction" - - name: gas_used_original_percentage - description: "Percentage of trace (and subtraces) gas used out of the total gas used in the transaction" - - name: gas_used_trace_percentage - description: "Percentage of trace gas used out of the total gas used in the transaction" - - name: tx_gas_price - description: "Transaction gas price" - - name: trace_type - description: "Trace type" - - name: trace_value - description: "Trace value" - - name: trace_success - description: "Was the trace successful?" - - name: tx_success - description: "Was the transaction successful?" - - name: gas_fee_spent_trace - description: "Amount of ETH spent in gas fees" - - name: gas_fee_spent_trace_usd - description: "USD value of the amount of ETH spent in gas fees" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/base/gas_base_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/base/gas_base_fees.sql deleted file mode 100644 index db43b4783cd..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/base/gas_base_fees.sql +++ /dev/null @@ -1,53 +0,0 @@ -{{ config( - schema = 'gas_base', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash','block_number'] - ) -}} - -SELECT - 'base' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) as tx_fee_native, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) * p.price AS tx_fee_usd, - cast(NULL as double) AS burned_native, -- Not applicable for L2s - cast(NULL as double) AS burned_usd, -- Not applicable for L2s - cast(NULL as VARBINARY) as validator, -- Not applicable for L2s - txns.gas_price/1e9 as gas_price_gwei, - txns.gas_price/1e18 * p.price as gas_price_usd, - txns.gas_used as gas_used, - txns.gas_limit as gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - type as transaction_type -FROM {{ source('base','transactions') }} txns -JOIN {{ source('base','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('txns.block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices','usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.blockchain = 'base' -AND p.symbol = 'WETH' -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('txns.block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/base/gas_base_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/base/gas_base_schema.yml deleted file mode 100644 index 90c2448553f..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/base/gas_base_schema.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2 - -models: - - name: gas_base_fees - meta: - blockchain: base - sector: gas - contributors: soispoke, lgingerich - config: - tags: ['base', 'gas', 'fees'] - description: > - Gas Fees on Base rollup Layer 2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_number - - tx_hash - columns: - - &blockchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of L2 gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction on zksync L2" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit on zksync L2" - - &type - name: type - description: "Legacy (Pre Typed-Transactions), AccessList (EIP-2930), DynamicFee (EIP-1559), EIP-712, or Priority (L1 -> L2 Transactions)" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/bnb/gas_bnb_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/bnb/gas_bnb_fees.sql deleted file mode 100644 index 292598b21ce..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/bnb/gas_bnb_fees.sql +++ /dev/null @@ -1,56 +0,0 @@ -{{ config( - schema = 'gas_bnb', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash'] - ) -}} - -SELECT - 'bnb' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'BNB' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - gas_price / 1e18 * txns.gas_used AS tx_fee_native, - gas_price / 1e18 * txns.gas_used * p.price AS tx_fee_usd, - CASE WHEN block_number >= 13082000 AND txns.to = 0x0000000000000000000000000000000000001000 THEN value/1e18 * 10 / 100 - ELSE cast(NULL as double) END AS burned_native, -- change after BEP95 - CASE WHEN block_number >= 13082000 AND txns.to = 0x0000000000000000000000000000000000001000 THEN value/1e18 * 10 / 100 * p.price - ELSE cast(NULL as double) END AS burned_usd, -- change after BEP95 - miner AS validator, - gas_price /1e9 AS gas_price_gwei, - gas_price / 1e18 * p.price AS gas_price_usd, - txns.gas_used, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - txns.gas_limit, - difficulty, - type AS transaction_type -FROM {{ source('bnb','transactions') }} txns -JOIN {{ source('bnb','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices', 'usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.blockchain = 'ethereum' -AND p.symbol = 'BNB' -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/bnb/gas_bnb_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/bnb/gas_bnb_schema.yml deleted file mode 100644 index 21419228737..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/bnb/gas_bnb_schema.yml +++ /dev/null @@ -1,76 +0,0 @@ -version: 2 - -models: - - name: gas_bnb_fees - meta: - blockchain: bnb - sector: gas - contributors: soispoke - config: - tags: ['bnb', 'gas', 'fees'] - description: > - Gas Fees on BNB chain - columns: - - &blokchain - name: blockchain - description: "Blockchain name" - - &block_number - name: block_number - description: "Block number" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (BNB) for the BNB chain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (BNB) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (BNB) paid in gas fees -- Gas Price * Gas Used" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (BNB) burned for this transaction, Post BEP-95: 10% of transaction fee" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, Post BEP-95: 10% of transaction fee" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit" - - &transaction_type - name: transaction_type - description: "Transaction type" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql deleted file mode 100644 index 2a8c193676f..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql +++ /dev/null @@ -1,76 +0,0 @@ -{{ config( - schema = 'gas_ethereum', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash'] - ) -}} - -SELECT - 'ethereum' as blockchain, - date_trunc('day', txns.block_time) AS block_date, - CAST(date_trunc('month', txns.block_time) AS DATE) AS block_month, - txns.block_number, - txns.block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - txns.value/1e18 AS tx_amount_native, - txns.value/1e18 * p.price AS tx_amount_usd, - CASE WHEN type = 'Legacy' THEN (cast(txns.gas_price as double)/1e18 * cast(txns.gas_used as double)) - WHEN type = 'AccessList' THEN (cast(txns.gas_price as double)/1e18 * cast(txns.gas_used as double)) - WHEN type = 'DynamicFee' THEN ((cast(blocks.base_fee_per_gas as double)/1e18 + cast(txns.priority_fee_per_gas as double)/1e18)* cast(txns.gas_used as double)) - WHEN type = '3' THEN ((cast(txns.gas_price as double)/1e18 * cast(txns.gas_used as double)) + (cast(blob.blob_base_fee as double)/1e18 * cast(blob.blob_gas_used as double))) - END AS tx_fee_native, - CASE WHEN type = 'Legacy' THEN (cast(txns.gas_price as double)/1e18 * cast(txns.gas_used as double)) * p.price - WHEN type = 'AccessList' THEN (cast(txns.gas_price as double)/1e18 * cast(txns.gas_used as double)) * p.price - WHEN type = 'DynamicFee' THEN ((cast(blocks.base_fee_per_gas as double)/1e18 + cast(txns.priority_fee_per_gas as double)/1e18)* cast(txns.gas_used as double)) * p.price - WHEN type = '3' THEN ((cast(txns.gas_price as double)/1e18 * cast(txns.gas_used as double)) + (cast(blob.blob_base_fee as double)/1e18 * cast(blob.blob_gas_used as double))) * p.price - END AS tx_fee_usd, - blocks.base_fee_per_gas / 1e18 * txns.gas_used AS burned_native, - blocks.base_fee_per_gas / 1e18 * txns.gas_used * p.price AS burned_usd, - (txns.max_fee_per_gas - txns.priority_fee_per_gas - blocks.base_fee_per_gas) / 1e18 * txns.gas_used AS tx_savings_native, - ((txns.max_fee_per_gas - txns.priority_fee_per_gas - blocks.base_fee_per_gas) /1e18 * txns.gas_used) * p.price AS tx_savings_usd, - blocks.miner AS validator, -- or block_proposer since Proposer Builder Separation (PBS) happened ? - txns.max_fee_per_gas / 1e9 AS max_fee_gwei, - txns.max_fee_per_gas / 1e18 * p.price AS max_fee_usd, - blocks.base_fee_per_gas / 1e9 AS base_fee_gwei, - blocks.base_fee_per_gas / 1e18 * p.price AS base_fee_usd, - txns.priority_fee_per_gas / 1e9 AS priority_fee_gwei, - txns.priority_fee_per_gas / 1e18 * p.price AS priority_fee_usd, - txns.gas_price /1e9 AS gas_price_gwei, - txns.gas_price / 1e18 * p.price AS gas_price_usd, - txns.gas_used, - txns.gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - blocks.difficulty, - txns.type AS transaction_type -FROM {{ source('ethereum', 'transactions') }} txns -INNER JOIN {{ source('ethereum', 'blocks') }} blocks - ON txns.block_number = blocks.number - {% if is_incremental() %} - AND {{ incremental_predicate('blocks.time') }} - {% endif %} -LEFT JOIN {{ source('ethereum', 'blobs_submissions') }} blob - ON txns.hash = blob.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('blob.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} p - ON p.minute = date_trunc('minute', txns.block_time) - AND p.blockchain = 'ethereum' - AND p.symbol = 'WETH' - {% if is_incremental() %} - AND {{ incremental_predicate('p.minute') }} - {% endif %} -{% if is_incremental() %} -WHERE {{ incremental_predicate('txns.block_time') }} -{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees_traces.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees_traces.sql deleted file mode 100644 index 3c2d28a706a..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees_traces.sql +++ /dev/null @@ -1,115 +0,0 @@ -{{ config( -tags=['prod_exclude'], - schema = 'gas_ethereum', - alias = 'fees_traces', - partition_by = ['block_date'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'trace'], - ) -}} - -/* - note: this spell has not been migrated to dunesql, therefore is only a view on spark - please migrate to dunesql to ensure up-to-date logic & data -*/ - -WITH traces AS ( - SELECT traces.block_time - , traces.block_number - , traces.tx_hash - , MAX(traces.from) AS trace_from - , MAX(traces.to) AS trace_to - , traces.trace - , MAX(traces.input) AS trace_input - , substring(MAX(traces.input),1,10) AS trace_method - , SUM(traces.gas_used_original) AS gas_used_original - , SUM(traces.gas_used_trace) AS gas_used_trace - , MAX(traces.trace_type) AS trace_type - , MAX(traces.trace_value) AS trace_value - , MAX(traces.trace_success) AS trace_success - , MAX(traces.tx_success) AS tx_success - FROM ( - SELECT from - , to - , tx_hash - , trace_address AS trace - , gas_used AS gas_used_original - , gas_used AS gas_used_trace - , block_time - , block_number - , input - , type AS trace_type - , value AS trace_value - , success AS trace_success - , tx_success - FROM {{ source('ethereum','traces') }} - {% if is_incremental() %} - WHERE {{ incremental_predicate('block_time') }} - {% endif %} - - UNION ALL - - SELECT CAST(NULL AS varchar(1)) AS from - , CAST(NULL AS varchar(1)) AS to - , tx_hash - , slice(trace_address, 1, cardinality(trace_address) - 1) AS trace - , CAST(NULL AS double) AS gas_used_original - , -gas_used AS gas_used_trace - , block_time - , block_number - , CAST(NULL AS varchar(1)) AS input - , CAST(NULL AS varchar(1)) AS trace_type - , CAST(NULL AS varchar(1)) AS trace_value - , CAST(NULL AS boolean) AS trace_success - , CAST(NULL AS boolean) AS tx_success - FROM {{ source('ethereum','traces') }} - WHERE cardinality(trace_address) > 0 - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} - ) traces - GROUP BY traces.tx_hash, traces.trace, traces.block_time, traces.block_number - ) - -SELECT 'ethereum' AS blockchain -, traces.block_time -, date_trunc('day', traces.block_time) AS block_date -, traces.block_number -, traces.tx_hash -, traces.trace_from -, traces.trace_to -, txs.from AS tx_from -, txs.to AS tx_to -, traces.trace -, traces.trace_method -, substring(txs.data,1,10) AS tx_method -, traces.trace_input -, traces.gas_used_original -, traces.gas_used_trace -, txs.gas_used AS tx_gas_used -, traces.gas_used_original/txs.gas_used AS gas_used_original_percentage -, traces.gas_used_trace/txs.gas_used AS gas_used_trace_percentage -, txs.gas_price AS tx_gas_price -, traces.trace_type -, traces.trace_value -, traces.trace_success -, traces.tx_success -, (traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original -, (pu.price*traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original_usd -, (traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace -, (pu.price*traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace_usd -FROM traces -INNER JOIN {{ source('ethereum','transactions') }} txs ON txs.block_time=traces.block_time - AND txs.hash=traces.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('txs.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.minute=date_trunc('minute', traces.block_time) - AND pu.blockchain='ethereum' - AND pu.contract_address='0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' - {% if is_incremental() %} - AND {{ incremental_predicate('pu.minute') }} - {% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_schema.yml deleted file mode 100644 index 3d6ac9bca16..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_schema.yml +++ /dev/null @@ -1,162 +0,0 @@ -version: 2 - -models: - - name: gas_ethereum_fees - meta: - blockchain: ethereum - sector: gas - contributors: soispoke - config: - tags: ['ethereum', 'gas', 'fees'] - description: > - Gas Fees on Ethereum - columns: - - &blockchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees -- Pre EIP 1559: Gas Price * Gas Used; Post EIP 1559: Gas Price * Gas Used ; Base fee + Priority fee) * Gas used" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, Post EIP 1559: Is equal to the Base Fee" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction" - - &tx_savings_native - name: tx_savings_native - description: "Total amount of native tokens (ETH) refunded to the user if the max fee exceeded the total transaction fee after the transaction execution" - - &tx_savings_usd - name: tx_savings_usd - description: "Total amount of $USD refunded to the user" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &max_fee_gwei - name: max_fee_gwei - description: "Maximum amount of gas (in Gwei) willing to be paid for the transaction: Is refunded if exceeds the total transaction fee once the transaction is executed" - - &max_fee_usd - name: max_fee_usd - description: "Maximum amount of gas (in $USD) willing to be paid for the transaction: Is refunded if exceeds the total transaction fee once the transaction is executed" - - &base_fee_gwei - name: base_fee_gwei - description: "Market price for gas (in Gwei)" - - &base_fee_usd - name: base_fee_usd - description: "Market price for gas (in $USD)" - - &priority_fee_gwei - name: priority_fee_gwei - description: "Maximum amount of gas (in Gwei) to be included as a tip to the miner/validator" - - &priority_fee_usd - name: priority_fee_usd - description: "Maximum amount of gas (in $USD) to be included as a tip to the miner/validator" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - name: gas_used - description: "Amount of gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit" - - &difficulty - name: difficulty - description: "Maximum amount of gas units that can be consumed by the transaction" - - &type - name: type - description: "Transaction type: Legacy (Pre EIP 1559) or DynamicFee (Post EIP-1559)" - - - name: gas_ethereum_fees_traces - meta: - blockchain: ethereum - sector: gas - contributors: hildobby - config: - tags: ['ethereum', 'gas', 'fees', 'traces'] - description: > - Gas Fees per Trace on Ethereum - columns: - - name: blockchain - description: "Blockchain name" - - name: block_time - description: "Timestamp for block event time in UTC" - - name: block_date - description: "UTC Date of transaction in UTC" - - name: block_number - description: "Block number" - - name: tx_hash - description: "Primary key of the transaction" - - name: trace_from - description: "Address address that initiated the trace" - - name: trace_to - description: "Address address that received the trace" - - name: tx_from - description: "Address address that initiated the transaction" - - name: tx_to - description: "Address address that received the transaction" - - name: trace - description: "Trace" - - name: trace_method - description: "Trace method" - - name: tx_method - description: "Function method" - - name: trace_input - - name: gas_used_original - description: "Gas used in trace and its subtraces" - - name: gas_used_trace - description: "Gas used in trace (excluding gas spent in subtraces)" - - name: tx_gas_used - description: "Total gas used in the transaction" - - name: gas_used_original_percentage - description: "Percentage of trace (and subtraces) gas used out of the total gas used in the transaction" - - name: gas_used_trace_percentage - description: "Percentage of trace gas used out of the total gas used in the transaction" - - name: tx_gas_price - description: "Transaction gas price" - - name: trace_type - description: "Trace type" - - name: trace_value - description: "Trace value" - - name: trace_success - description: "Was the trace successful?" - - name: tx_success - description: "Was the transaction successful?" - - name: gas_fee_spent_trace - description: "Amount of ETH spent in gas fees" - - name: gas_fee_spent_trace_usd - description: "USD value of the amount of ETH spent in gas fees" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/fantom/gas_fantom_fees_traces.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/fantom/gas_fantom_fees_traces.sql deleted file mode 100644 index 276d997b4fa..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/fantom/gas_fantom_fees_traces.sql +++ /dev/null @@ -1,115 +0,0 @@ -{{ config( -tags=['prod_exclude'], - schema = 'gas_fantom', - alias = 'fees_traces', - partition_by = ['block_date'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'trace'], - ) -}} - -/* - note: this spell has not been migrated to dunesql, therefore is only a view on spark - please migrate to dunesql to ensure up-to-date logic & data -*/ - -WITH traces AS ( - SELECT traces.block_time - , traces.block_number - , traces.tx_hash - , MAX(traces.from) AS trace_from - , MAX(traces.to) AS trace_to - , traces.trace - , MAX(traces.input) AS trace_input - , substring(MAX(traces.input),1,10) AS trace_method - , SUM(traces.gas_used_original) AS gas_used_original - , SUM(traces.gas_used_trace) AS gas_used_trace - , MAX(traces.trace_type) AS trace_type - , MAX(traces.trace_value) AS trace_value - , MAX(traces.trace_success) AS trace_success - , MAX(traces.tx_success) AS tx_success - FROM ( - SELECT from - , to - , tx_hash - , trace_address AS trace - , gas_used AS gas_used_original - , gas_used AS gas_used_trace - , block_time - , block_number - , input - , type AS trace_type - , value AS trace_value - , success AS trace_success - , tx_success - FROM {{ source('fantom','traces') }} - {% if is_incremental() %} - WHERE {{ incremental_predicate('block_time') }} - {% endif %} - - UNION ALL - - SELECT CAST(NULL AS varchar(1)) AS from - , CAST(NULL AS varchar(1)) AS to - , tx_hash - , slice(trace_address, 1, cardinality(trace_address) - 1) AS trace - , CAST(NULL AS double) AS gas_used_original - , -gas_used AS gas_used_trace - , block_time - , block_number - , CAST(NULL AS varchar(1)) AS input - , CAST(NULL AS varchar(1)) AS trace_type - , CAST(NULL AS varchar(1)) AS trace_value - , CAST(NULL AS boolean) AS trace_success - , CAST(NULL AS boolean) AS tx_success - FROM {{ source('fantom','traces') }} - WHERE cardinality(trace_address) > 0 - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} - ) traces - GROUP BY traces.tx_hash, traces.trace, traces.block_time, traces.block_number - ) - -SELECT 'fantom' AS blockchain -, traces.block_time -, date_trunc('day', traces.block_time) AS block_date -, traces.block_number -, traces.tx_hash -, traces.trace_from -, traces.trace_to -, txs.from AS tx_from -, txs.to AS tx_to -, traces.trace -, traces.trace_method -, substring(txs.data,1,10) AS tx_method -, traces.trace_input -, traces.gas_used_original -, traces.gas_used_trace -, txs.gas_used AS tx_gas_used -, traces.gas_used_original/txs.gas_used AS gas_used_original_percentage -, traces.gas_used_trace/txs.gas_used AS gas_used_trace_percentage -, txs.gas_price AS tx_gas_price -, traces.trace_type -, traces.trace_value -, traces.trace_success -, traces.tx_success -, (traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original -, (pu.price*traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original_usd -, (traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace -, (pu.price*traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace_usd -FROM traces -INNER JOIN {{ source('fantom','transactions') }} txs ON txs.block_time=traces.block_time - AND txs.hash=traces.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('txs.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.minute=date_trunc('minute', traces.block_time) - AND pu.blockchain='fantom' - AND pu.contract_address='0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83' - {% if is_incremental() %} - AND {{ incremental_predicate('pu.minute') }} - {% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/fantom/gas_fantom_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/fantom/gas_fantom_schema.yml deleted file mode 100644 index 565c29893f2..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/fantom/gas_fantom_schema.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: 2 - -models: - - name: gas_fantom_fees_traces - meta: - blockchain: fantom - sector: gas - contributors: hildobby - config: - tags: ['fantom', 'gas', 'fees', 'traces'] - description: > - Gas Fees per Trace on Fantom - columns: - - name: blockchain - description: "Blockchain name" - - name: block_time - description: "Timestamp for block event time in UTC" - - name: block_date - description: "UTC Date of transaction in UTC" - - name: block_number - description: "Block number" - - name: tx_hash - description: "Primary key of the transaction" - - name: trace_from - description: "Address address that initiated the trace" - - name: trace_to - description: "Address address that received the trace" - - name: tx_from - description: "Address address that initiated the transaction" - - name: tx_to - description: "Address address that received the transaction" - - name: trace - description: "Trace" - - name: trace_method - description: "Trace method" - - name: tx_method - description: "Function method" - - name: trace_input - - name: gas_used_original - description: "Gas used in trace and its subtraces" - - name: gas_used_trace - description: "Gas used in trace (excluding gas spent in subtraces)" - - name: tx_gas_used - description: "Total gas used in the transaction" - - name: gas_used_original_percentage - description: "Percentage of trace (and subtraces) gas used out of the total gas used in the transaction" - - name: gas_used_trace_percentage - description: "Percentage of trace gas used out of the total gas used in the transaction" - - name: tx_gas_price - description: "Transaction gas price" - - name: trace_type - description: "Trace type" - - name: trace_value - description: "Trace value" - - name: trace_success - description: "Was the trace successful?" - - name: tx_success - description: "Was the transaction successful?" - - name: gas_fee_spent_trace - description: "Amount of MATIC spent in gas fees" - - name: gas_fee_spent_trace_usd - description: "USD value of the amount of MATIC spent in gas fees" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql deleted file mode 100644 index 4a56318c3ab..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql +++ /dev/null @@ -1,56 +0,0 @@ -{{ config( - schema = 'gas', - alias = 'fees', - post_hook='{{ expose_spells(\'["ethereum","bnb","avalanche_c","optimism","arbitrum","zksync","zora","base","scroll","mantle"]\', - "sector", - "gas", - \'["soispoke", "ilemi", "0xRob", "jeff-dude"]\') }}' - ) -}} - -{% set gas_fees_models = [ - 'gas_ethereum_fees', - 'gas_bnb_fees', - 'gas_avalanche_c_fees', - 'gas_optimism_fees', - 'gas_arbitrum_fees', - 'gas_zksync_fees', - 'gas_zora_fees', - 'gas_base_fees', - 'gas_scroll_fees' -] %} - ---remove mantle for now: - --'gas_mantle_fees' - -SELECT * -FROM ( - {% for gas_model in gas_fees_models %} - SELECT - blockchain, - block_number, - block_time, - block_date, - tx_hash, - tx_sender, - tx_receiver, - native_token_symbol, - tx_amount_native, - tx_amount_usd, - tx_fee_native, - tx_fee_usd, - burned_native, - burned_usd, - validator, - gas_price_gwei, - gas_price_usd, - gas_used, - gas_limit, - gas_usage_percent, - transaction_type - FROM {{ ref(gas_model) }} - {% if not loop.last %} - UNION ALL - {% endif %} - {% endfor %} -) diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_fees_traces.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_fees_traces.sql deleted file mode 100644 index 22c7c504dbf..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_fees_traces.sql +++ /dev/null @@ -1,115 +0,0 @@ -{{ config( -tags=['prod_exclude'], - schema = 'gas_gnosis', - alias = 'fees_traces', - partition_by = ['block_date'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'trace'], - ) -}} - -/* - note: this spell has not been migrated to dunesql, therefore is only a view on spark - please migrate to dunesql to ensure up-to-date logic & data -*/ - -WITH traces AS ( - SELECT traces.block_time - , traces.block_number - , traces.tx_hash - , MAX(traces.from) AS trace_from - , MAX(traces.to) AS trace_to - , traces.trace - , MAX(traces.input) AS trace_input - , substring(MAX(traces.input),1,10) AS trace_method - , SUM(traces.gas_used_original) AS gas_used_original - , SUM(traces.gas_used_trace) AS gas_used_trace - , MAX(traces.trace_type) AS trace_type - , MAX(traces.trace_value) AS trace_value - , MAX(traces.trace_success) AS trace_success - , MAX(traces.tx_success) AS tx_success - FROM ( - SELECT from - , to - , tx_hash - , trace_address AS trace - , gas_used AS gas_used_original - , gas_used AS gas_used_trace - , block_time - , block_number - , input - , type AS trace_type - , value AS trace_value - , success AS trace_success - , tx_success - FROM {{ source('gnosis','traces') }} - {% if is_incremental() %} - WHERE {{ incremental_predicate('block_time') }} - {% endif %} - - UNION ALL - - SELECT CAST(NULL AS varchar(1)) AS from - , CAST(NULL AS varchar(1)) AS to - , tx_hash - , slice(trace_address, 1, cardinality(trace_address) - 1) AS trace - , CAST(NULL AS double) AS gas_used_original - , -gas_used AS gas_used_trace - , block_time - , block_number - , CAST(NULL AS varchar(1)) AS input - , CAST(NULL AS varchar(1)) AS trace_type - , CAST(NULL AS varchar(1)) AS trace_value - , CAST(NULL AS boolean) AS trace_success - , CAST(NULL AS boolean) AS tx_success - FROM {{ source('gnosis','traces') }} - WHERE cardinality(trace_address) > 0 - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} - ) traces - GROUP BY traces.tx_hash, traces.trace, traces.block_time, traces.block_number - ) - -SELECT 'gnosis' AS blockchain -, traces.block_time -, date_trunc('day', traces.block_time) AS block_date -, traces.block_number -, traces.tx_hash -, traces.trace_from -, traces.trace_to -, txs.from AS tx_from -, txs.to AS tx_to -, traces.trace -, traces.trace_method -, substring(txs.data,1,10) AS tx_method -, traces.trace_input -, traces.gas_used_original -, traces.gas_used_trace -, txs.gas_used AS tx_gas_used -, traces.gas_used_original/txs.gas_used AS gas_used_original_percentage -, traces.gas_used_trace/txs.gas_used AS gas_used_trace_percentage -, txs.gas_price AS tx_gas_price -, traces.trace_type -, traces.trace_value -, traces.trace_success -, traces.tx_success -, (traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original -, (pu.price*traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original_usd -, (traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace -, (pu.price*traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace_usd -FROM traces -INNER JOIN {{ source('gnosis','transactions') }} txs ON txs.block_time=traces.block_time - AND txs.hash=traces.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('txs.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.minute=date_trunc('minute', traces.block_time) - AND pu.blockchain='gnosis' - AND pu.contract_address='0xe91d153e0b41518a2ce8dd3d7944fa863463a97d' - {% if is_incremental() %} - AND {{ incremental_predicate('pu.minute') }} - {% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_schema.yml deleted file mode 100644 index aeea521400b..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_schema.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: 2 - -models: - - name: gas_gnosis_fees_traces - meta: - blockchain: gnosis - sector: gas - contributors: hildobby - config: - tags: ['gnosis', 'gas', 'fees', 'traces'] - description: > - Gas Fees per Trace on Gnosis - columns: - - name: blockchain - description: "Blockchain name" - - name: block_time - description: "Timestamp for block event time in UTC" - - name: block_date - description: "UTC Date of transaction in UTC" - - name: block_number - description: "Block number" - - name: tx_hash - description: "Primary key of the transaction" - - name: trace_from - description: "Address address that initiated the trace" - - name: trace_to - description: "Address address that received the trace" - - name: tx_from - description: "Address address that initiated the transaction" - - name: tx_to - description: "Address address that received the transaction" - - name: trace - description: "Trace" - - name: trace_method - description: "Trace method" - - name: tx_method - description: "Function method" - - name: trace_input - - name: gas_used_original - description: "Gas used in trace and its subtraces" - - name: gas_used_trace - description: "Gas used in trace (excluding gas spent in subtraces)" - - name: tx_gas_used - description: "Total gas used in the transaction" - - name: gas_used_original_percentage - description: "Percentage of trace (and subtraces) gas used out of the total gas used in the transaction" - - name: gas_used_trace_percentage - description: "Percentage of trace gas used out of the total gas used in the transaction" - - name: tx_gas_price - description: "Transaction gas price" - - name: trace_type - description: "Trace type" - - name: trace_value - description: "Trace value" - - name: trace_success - description: "Was the trace successful?" - - name: tx_success - description: "Was the transaction successful?" - - name: gas_fee_spent_trace - description: "Amount of MATIC spent in gas fees" - - name: gas_fee_spent_trace_usd - description: "USD value of the amount of MATIC spent in gas fees" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/_schema.yml deleted file mode 100644 index df57aff9b91..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/_schema.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2 - -models: - - name: gas_mantle_fees - meta: - blockchain: mantle - sector: gas - contributors: soispoke, ilemi - config: - tags: ['mantle', 'gas', 'fees'] - description: > - Gas Fees on mantle rollup Layer 2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_number - - tx_hash - columns: - - &blockchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of L2 gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction on zksync L2" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit on zksync L2" - - &type - name: type - description: "Legacy (Pre Typed-Transactions), AccessList (EIP-2930), DynamicFee (EIP-1559), EIP-712, or Priority (L1 -> L2 Transactions)" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql deleted file mode 100644 index 2406235eff9..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql +++ /dev/null @@ -1,55 +0,0 @@ -{{ config( - tags = ['prod_exclude'], - schema = 'gas_mantle', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash','block_number'] - ) -}} - -SELECT - 'mantle' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) as tx_fee_native, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) * p.price AS tx_fee_usd, - cast(NULL as double) AS burned_native, -- Not applicable for L2s - cast(NULL as double) AS burned_usd, -- Not applicable for L2s - cast(NULL as VARBINARY) as validator, -- Not applicable for L2s - txns.gas_price/1e9 as gas_price_gwei, - txns.gas_price/1e18 * p.price as gas_price_usd, - txns.gas_used as gas_used, - txns.gas_limit as gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - type as transaction_type -FROM {{ source('mantle','transactions') }} txns -INNER JOIN {{ source('mantle','blocks') }} blocks - ON blocks.number = txns.block_number - {% if is_incremental() %} - AND {{ incremental_predicate('blocks.time') }} - {% endif %} -LEFT JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', txns.block_time) - AND p.blockchain = 'mantle' - AND p.symbol = 'WETH' - {% if is_incremental() %} - AND {{ incremental_predicate('p.minute') }} - {% endif %} -{% if is_incremental() %} -WHERE {{ incremental_predicate('txns.block_time') }} -{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees.sql deleted file mode 100644 index 31e136572cd..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees.sql +++ /dev/null @@ -1,78 +0,0 @@ -{{ config( - schema = 'gas_optimism', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash','block_number'] - ) -}} - -SELECT - 'optimism' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) as tx_fee_native, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) * p.price AS tx_fee_usd, - cast(NULL as double) AS burned_native, -- Not applicable for L2s - cast(NULL as double) AS burned_usd, -- Not applicable for L2s - cast(NULL as VARBINARY) as validator, -- Not applicable for L2s - txns.gas_price/1e9 as gas_price_gwei, - txns.gas_price/1e18 * p.price as gas_price_usd, - txns.gas_used as gas_used, - txns.gas_limit as gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - l1_gas_price/1e9 as l1_gas_price_gwei, - l1_gas_price/1e18 * p.price as l1_gas_price_usd, - l1_gas_used, - l1_fee_scalar, - (l1_gas_price/1e18 )* txns.gas_used as tx_fee_equivalent_on_l1_native, - (l1_gas_price/1e18 )* txns.gas_used * p.price as tx_fee_equivalent_on_l1_usd, - (length(from_utf8(data)) - length(replace(from_utf8(data), chr(0), ''))) as num_zero_bytes, - bytearray_length(data) - (length(from_utf8(data)) - length(replace(from_utf8(data), chr(0), ''))) as num_nonzero_bytes, - -- source: https://www.starburst.io/community/forum/t/count-zero-bytes-and-nonzero-bytes-in-a-bytestring-varbinary/261/2 - 16 * (length(from_utf8(data)) - length(replace(from_utf8(data), chr(0), ''))) --16 * nonzero bytes - + 4 * ( bytearray_length(data) - (length(from_utf8(data)) - length(replace(from_utf8(data), chr(0), ''))) ) --4 * zero bytes - as calldata_gas, - type as transaction_type, - l1_fee/1e18 AS l1_data_fee_native, - p.price * l1_fee/1e18 AS l1_data_fee_usd, - --use gas price pre-Bedrock (no base fee) - (COALESCE(CAST(blocks.base_fee_per_gas AS UINT256),txns.gas_price)/1e18)*txns.gas_used AS l2_base_fee_native, - p.price * (COALESCE(CAST(blocks.base_fee_per_gas AS UINT256),txns.gas_price)/1e18)*txns.gas_used AS l2_base_fee_usd, - --base_fee_per_gas was null pre-bedrock when there was no base fee - case when (txns.gas_price = UINT256 '0') or (blocks.base_fee_per_gas IS NULL)then 0 else - cast( (txns.gas_price-blocks.base_fee_per_gas/ 1e18)*txns.gas_used as double) - end AS l2_priority_fee_native, - case when (txns.gas_price = UINT256 '0') or (blocks.base_fee_per_gas IS NULL)then 0 else - p.price * cast( (txns.gas_price-blocks.base_fee_per_gas/ 1e18)*txns.gas_used as double) - end AS l2_priority_fee_usd - -FROM {{ source('optimism','transactions') }} txns -JOIN {{ source('optimism','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices','usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.blockchain = 'optimism' -AND p.symbol = 'WETH' -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees_traces.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees_traces.sql deleted file mode 100644 index 8bee017d0b8..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees_traces.sql +++ /dev/null @@ -1,110 +0,0 @@ -{{ config( - - schema = 'gas_optimism', - alias = 'fees_traces', - materialized = 'view', - ) -}} - -/* - note: this spell has not been migrated to dunesql, therefore is only a view on spark - please migrate to dunesql to ensure up-to-date logic & data -*/ - -WITH traces AS ( - SELECT traces.block_time - , traces.block_number - , traces.tx_hash - , MAX(traces."from") AS trace_from - , MAX(traces.to) AS trace_to - , traces.trace - , MAX(traces.input) AS trace_input - , bytearray_substring(MAX(traces.input),1,4) AS trace_method - , SUM(traces.gas_used_original) AS gas_used_original - , SUM(traces.gas_used_trace) AS gas_used_trace - , MAX(traces.trace_type) AS trace_type - , MAX(traces.trace_value) AS trace_value - , MAX(traces.trace_success) AS trace_success - , MAX(traces.tx_success) AS tx_success - FROM ( - SELECT "from" - , "to" - , tx_hash - , trace_address AS trace - , gas_used AS gas_used_original - , gas_used AS gas_used_trace - , block_time - , block_number - , input - , type AS trace_type - , value AS trace_value - , success AS trace_success - , tx_success - FROM {{ source('optimism','traces') }} - {% if is_incremental() %} - WHERE {{ incremental_predicate('block_time') }} - {% endif %} - - UNION ALL - - SELECT CAST(NULL AS varbinary) AS "from" - , CAST(NULL AS varbinary) AS "to" - , tx_hash - , slice(trace_address, 1, cardinality(trace_address) - 1) AS trace - , CAST(NULL AS bigint) AS gas_used_original - , -(gas_used) AS gas_used_trace - , block_time - , block_number - , CAST(NULL AS varbinary) AS input - , CAST(NULL AS varchar(1)) AS trace_type - , CAST(NULL AS UINT256) AS trace_value - , CAST(NULL AS boolean) AS trace_success - , CAST(NULL AS boolean) AS tx_success - FROM {{ source('optimism','traces') }} - WHERE cardinality(trace_address) > 0 - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} - ) traces - GROUP BY traces.tx_hash, traces.trace, traces.block_time, traces.block_number - ) - -SELECT 'optimism' AS blockchain -, traces.block_time -, date_trunc('day', traces.block_time) AS block_date -, traces.block_number -, traces.tx_hash -, traces.trace_from -, traces.trace_to -, txs."from" AS tx_from -, txs.to AS tx_to -, traces.trace -, traces.trace_method -, bytearray_substring(txs.data,1,4) AS tx_method -, traces.trace_input -, traces.gas_used_original -, traces.gas_used_trace -, txs.gas_used AS tx_gas_used -, traces.gas_used_original/txs.gas_used AS gas_used_original_percentage -, traces.gas_used_trace/txs.gas_used AS gas_used_trace_percentage -, txs.gas_price AS tx_gas_price -, traces.trace_type -, traces.trace_value -, traces.trace_success -, traces.tx_success -, (traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original -, (pu.price*traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original_usd -, (traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace -, (pu.price*traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace_usd -FROM traces -INNER JOIN {{ source('optimism','transactions') }} txs ON txs.block_time=traces.block_time - AND txs.hash=traces.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('txs.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.minute=date_trunc('minute', traces.block_time) - AND pu.blockchain='optimism' - AND pu.contract_address=0x4200000000000000000000000000000000000006 - {% if is_incremental() %} - AND {{ incremental_predicate('pu.minute') }} - {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_schema.yml deleted file mode 100644 index a47a41b986e..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/optimism/gas_optimism_schema.yml +++ /dev/null @@ -1,183 +0,0 @@ -version: 2 - -models: - - name: gas_optimism_fees - meta: - blockchain: optimism - sector: gas - contributors: soispoke, msilb7 - config: - tags: ['optimism', 'gas', 'fees'] - description: > - Gas Fees on Optimism rollup Layer 2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_number - - tx_hash - columns: - - &blokchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactionsonly indirectly burn gas on L1" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactionsonly indirectly burn gas on L1" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of L2 gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction on Optimism L2" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit on Optimism L2" - - &l1_gas_price_gwei - name: l1_gas_price_gwei - description: "Ethereum L1 gas price (per gas unit) denoted in gwei" - - &l1_gas_price_usd - name: l1_gas_price_usd - description: "Ethereum L1 gas price (per gas unit) denoted in $USD" - - &l1_gas_used - name: l1_gas_used - description: "Amount of L1 gas units consumed by the transaction" - - &l1_fee_scalar - name: l1_fee_scalar - description: "Dynamic Overhead implemented by Optimism to serve as a buffer in case L1 prices rapidly increase." - - &tx_fee_equivalent_on_l1_native - name: tx_fee_equivalent_on_l1_native - description: "Total amount of ETH that would have been paid in gas fees on Ethereum L1" - - &tx_fee_equivalent_on_l1_usd - name: tx_fee_equivalent_on_l1_usd - description: "Total amount of USD that would have been paid in gas fees on Ethereum L1" - - &num_zero_bytes - name: num_zero_bytes - description: "Count of zero bytes for this transaction, can be used to understand calldata costs" - - &num_nonzero_bytes - name: num_nonzero_bytes - description: "Count of non-zero bytes for this transaction, can be used to understand calldata costs" - - &calldata_gas - name: calldata_gas - description: "Call data gas computed using costs for zero and non zero bytes included in the transaction" - - &type - name: type - description: "Transaction type: Legacy (Pre EIP 1559) or DynamicFee (Post EIP-1559)" - - &l1_data_fee_native - name: l1_data_fee_native - description: "Gas Used for L1 Data Gas (data availability fee) in ETH" - - &l1_data_fee_usd - name: l1_data_fee_usd - description: "Gas Used for L1 Data Gas (data availability fee) in USD" - - &l2_base_fee_native - name: l2_base_fee_native - description: "Gas Used for L2 Execution Gas from the base fee gas price in ETH" - - &l2_base_fee_usd - name: l2_base_fee_usd - description: "Gas Used for L2 Execution Gas from the base fee gas price in USD" - - &l2_priority_fee_native - name: l2_priority_fee_native - description: "Gas Used for L2 Execution Gas from the priority fee paid in ETH" - - &l2_priority_fee_usd - name: l2_priority_fee_usd - description: "Gas Used for L2 Execution Gas from the priority fee paid in USD" - - - name: gas_optimism_fees_traces - meta: - blockchain: optimism - sector: gas - contributors: hildobby - config: - tags: ['optimism', 'gas', 'fees', 'traces'] - description: > - Gas Fees per Trace on Optimism - columns: - - name: blockchain - description: "Blockchain name" - - name: block_time - description: "Timestamp for block event time in UTC" - - name: block_date - description: "UTC Date of transaction in UTC" - - name: block_number - description: "Block number" - - name: tx_hash - description: "Primary key of the transaction" - - name: trace_from - description: "Address address that initiated the trace" - - name: trace_to - description: "Address address that received the trace" - - name: tx_from - description: "Address address that initiated the transaction" - - name: tx_to - description: "Address address that received the transaction" - - name: trace - description: "Trace" - - name: trace_method - description: "Trace method" - - name: tx_method - description: "Function method" - - name: trace_input - - name: gas_used_original - description: "Gas used in trace and its subtraces" - - name: gas_used_trace - description: "Gas used in trace (excluding gas spent in subtraces)" - - name: tx_gas_used - description: "Total gas used in the transaction" - - name: gas_used_original_percentage - description: "Percentage of trace (and subtraces) gas used out of the total gas used in the transaction" - - name: gas_used_trace_percentage - description: "Percentage of trace gas used out of the total gas used in the transaction" - - name: tx_gas_price - description: "Transaction gas price" - - name: trace_type - description: "Trace type" - - name: trace_value - description: "Trace value" - - name: trace_success - description: "Was the trace successful?" - - name: tx_success - description: "Was the transaction successful?" - - name: gas_fee_spent_trace - description: "Amount of ETH spent in gas fees" - - name: gas_fee_spent_trace_usd - description: "USD value of the amount of ETH spent in gas fees" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/polygon/gas_polygon_fees_traces.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/polygon/gas_polygon_fees_traces.sql deleted file mode 100644 index ebe8d28227d..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/polygon/gas_polygon_fees_traces.sql +++ /dev/null @@ -1,115 +0,0 @@ -{{ config( -tags=['prod_exclude'], - schema = 'gas_polygon', - alias = 'fees_traces', - partition_by = ['block_date'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'trace'], - ) -}} - -/* - note: this spell has not been migrated to dunesql, therefore is only a view on spark - please migrate to dunesql to ensure up-to-date logic & data -*/ - -WITH traces AS ( - SELECT traces.block_time - , traces.block_number - , traces.tx_hash - , MAX(traces.from) AS trace_from - , MAX(traces.to) AS trace_to - , traces.trace - , MAX(traces.input) AS trace_input - , substring(MAX(traces.input),1,10) AS trace_method - , SUM(traces.gas_used_original) AS gas_used_original - , SUM(traces.gas_used_trace) AS gas_used_trace - , MAX(traces.trace_type) AS trace_type - , MAX(traces.trace_value) AS trace_value - , MAX(traces.trace_success) AS trace_success - , MAX(traces.tx_success) AS tx_success - FROM ( - SELECT from - , to - , tx_hash - , trace_address AS trace - , gas_used AS gas_used_original - , gas_used AS gas_used_trace - , block_time - , block_number - , input - , type AS trace_type - , value AS trace_value - , success AS trace_success - , tx_success - FROM {{ source('polygon','traces') }} - {% if is_incremental() %} - WHERE {{ incremental_predicate('block_time') }} - {% endif %} - - UNION ALL - - SELECT CAST(NULL AS varchar(1)) AS from - , CAST(NULL AS varchar(1)) AS to - , tx_hash - , slice(trace_address, 1, cardinality(trace_address) - 1) AS trace - , CAST(NULL AS double) AS gas_used_original - , -gas_used AS gas_used_trace - , block_time - , block_number - , CAST(NULL AS varchar(1)) AS input - , CAST(NULL AS varchar(1)) AS trace_type - , CAST(NULL AS varchar(1)) AS trace_value - , CAST(NULL AS boolean) AS trace_success - , CAST(NULL AS boolean) AS tx_success - FROM {{ source('polygon','traces') }} - WHERE cardinality(trace_address) > 0 - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} - ) traces - GROUP BY traces.tx_hash, traces.trace, traces.block_time, traces.block_number - ) - -SELECT 'polygon' AS blockchain -, traces.block_time -, date_trunc('day', traces.block_time) AS block_date -, traces.block_number -, traces.tx_hash -, traces.trace_from -, traces.trace_to -, txs.from AS tx_from -, txs.to AS tx_to -, traces.trace -, traces.trace_method -, substring(txs.data,1,10) AS tx_method -, traces.trace_input -, traces.gas_used_original -, traces.gas_used_trace -, txs.gas_used AS tx_gas_used -, traces.gas_used_original/txs.gas_used AS gas_used_original_percentage -, traces.gas_used_trace/txs.gas_used AS gas_used_trace_percentage -, txs.gas_price AS tx_gas_price -, traces.trace_type -, traces.trace_value -, traces.trace_success -, traces.tx_success -, (traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original -, (pu.price*traces.gas_used_original*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_original_usd -, (traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace -, (pu.price*traces.gas_used_trace*txs.gas_price)/POWER(10, 18) AS gas_fee_spent_trace_usd -FROM traces -INNER JOIN {{ source('polygon','transactions') }} txs ON txs.block_time=traces.block_time - AND txs.hash=traces.tx_hash - {% if is_incremental() %} - AND {{ incremental_predicate('txs.block_time') }} - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} pu ON pu.minute=date_trunc('minute', traces.block_time) - AND pu.blockchain='polygon' - AND pu.contract_address='0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270' - {% if is_incremental() %} - AND {{ incremental_predicate('pu.minute') }} - {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/polygon/gas_polygon_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/polygon/gas_polygon_schema.yml deleted file mode 100644 index 4b457684959..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/polygon/gas_polygon_schema.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: 2 - -models: - - name: gas_polygon_fees_traces - meta: - blockchain: polygon - sector: gas - contributors: hildobby - config: - tags: ['polygon', 'gas', 'fees', 'traces'] - description: > - Gas Fees per Trace on Polygon - columns: - - name: blockchain - description: "Blockchain name" - - name: block_time - description: "Timestamp for block event time in UTC" - - name: block_date - description: "UTC Date of transaction in UTC" - - name: block_number - description: "Block number" - - name: tx_hash - description: "Primary key of the transaction" - - name: trace_from - description: "Address address that initiated the trace" - - name: trace_to - description: "Address address that received the trace" - - name: tx_from - description: "Address address that initiated the transaction" - - name: tx_to - description: "Address address that received the transaction" - - name: trace - description: "Trace" - - name: trace_method - description: "Trace method" - - name: tx_method - description: "Function method" - - name: trace_input - - name: gas_used_original - description: "Gas used in trace and its subtraces" - - name: gas_used_trace - description: "Gas used in trace (excluding gas spent in subtraces)" - - name: tx_gas_used - description: "Total gas used in the transaction" - - name: gas_used_original_percentage - description: "Percentage of trace (and subtraces) gas used out of the total gas used in the transaction" - - name: gas_used_trace_percentage - description: "Percentage of trace gas used out of the total gas used in the transaction" - - name: tx_gas_price - description: "Transaction gas price" - - name: trace_type - description: "Trace type" - - name: trace_value - description: "Trace value" - - name: trace_success - description: "Was the trace successful?" - - name: tx_success - description: "Was the transaction successful?" - - name: gas_fee_spent_trace - description: "Amount of MATIC spent in gas fees" - - name: gas_fee_spent_trace_usd - description: "USD value of the amount of MATIC spent in gas fees" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/scroll/gas_scroll_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/scroll/gas_scroll_fees.sql deleted file mode 100644 index ceb7e381438..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/scroll/gas_scroll_fees.sql +++ /dev/null @@ -1,53 +0,0 @@ -{{ config( - schema = 'gas_scroll', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash','block_number'] - ) -}} - -SELECT - 'scroll' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - (gas_price/1e18 * txns.gas_used) + txns.l1_fee/1e18 as tx_fee_native, - ((gas_price/1e18 * txns.gas_used) + txns.l1_fee/1e18) * p.price AS tx_fee_usd, - cast(NULL as double) AS burned_native, -- Not applicable for L2s - cast(NULL as double) AS burned_usd, -- Not applicable for L2s - cast(NULL as varbinary) as validator, -- Not applicable for L2s - txns.gas_price/1e9 as gas_price_gwei, - txns.gas_price/1e18 * p.price as gas_price_usd, - txns.gas_used as gas_used, - txns.gas_limit as gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - type as transaction_type -FROM {{ source('scroll','transactions') }} txns -JOIN {{ source('scroll','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('txns.block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices','usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.blockchain = 'scroll' -AND p.symbol = 'WETH' -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('txns.block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/scroll/gas_scroll_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/scroll/gas_scroll_schema.yml deleted file mode 100644 index 28a8caf4d38..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/scroll/gas_scroll_schema.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2 - -models: - - name: gas_scroll_fees - meta: - blockchain: scroll - sector: gas - contributors: soispoke, lgingerich - config: - tags: ['scroll', 'gas', 'fees'] - description: > - Gas Fees on Scroll rollup Layer 2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_number - - tx_hash - columns: - - &blockchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of L2 gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction on zksync L2" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit on zksync L2" - - &type - name: type - description: "Legacy (Pre Typed-Transactions), AccessList (EIP-2930), DynamicFee (EIP-1559), EIP-712, or Priority (L1 -> L2 Transactions)" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zksync/gas_zksync_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zksync/gas_zksync_fees.sql deleted file mode 100644 index 47cdcee3b7d..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zksync/gas_zksync_fees.sql +++ /dev/null @@ -1,53 +0,0 @@ -{{ config( - schema = 'gas_zksync', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash','block_number'] - ) -}} - -SELECT - 'zksync' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - (gas_price / 1e18) * txns.gas_used as tx_fee_native, - (gas_price / 1e18) * txns.gas_used * p.price AS tx_fee_usd, - cast(NULL as double) AS burned_native, -- Not applicable for L2s - cast(NULL as double) AS burned_usd, -- Not applicable for L2s - cast(NULL as varbinary) as validator, -- Not applicable for L2s - txns.gas_price/1e9 as gas_price_gwei, - txns.gas_price/1e18 * p.price as gas_price_usd, - txns.gas_used as gas_used, - txns.gas_limit as gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - type as transaction_type -FROM {{ source('zksync','transactions') }} txns -JOIN {{ source('zksync','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices','usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.blockchain = 'zksync' -AND p.symbol = 'WETH' -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zksync/gas_zksync_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zksync/gas_zksync_schema.yml deleted file mode 100644 index 08418fe4aad..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zksync/gas_zksync_schema.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2 - -models: - - name: gas_zksync_fees - meta: - blockchain: zksync - sector: gas - contributors: soispoke, lgingerich - config: - tags: ['zksync', 'gas', 'fees'] - description: > - Gas Fees on zksync rollup Layer 2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_number - - tx_hash - columns: - - &blockchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of L2 gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction on zksync L2" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit on zksync L2" - - &type - name: type - description: "Legacy (Pre Typed-Transactions), AccessList (EIP-2930), DynamicFee (EIP-1559), EIP-712, or Priority (L1 -> L2 Transactions)" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zora/gas_zora_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zora/gas_zora_fees.sql deleted file mode 100644 index 3c5c3ad3061..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zora/gas_zora_fees.sql +++ /dev/null @@ -1,53 +0,0 @@ -{{ config( - schema = 'gas_zora', - alias = 'fees', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy='merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash','block_number'] - ) -}} - -SELECT - 'zora' as blockchain, - date_trunc('day', block_time) AS block_date, - CAST(date_trunc('month', block_time) AS DATE) AS block_month, - block_number, - block_time, - txns.hash AS tx_hash, - txns."from" AS tx_sender, - txns.to AS tx_receiver, - 'ETH' as native_token_symbol, - value/1e18 AS tx_amount_native, - value/1e18 * p.price AS tx_amount_usd, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) as tx_fee_native, - (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) * p.price AS tx_fee_usd, - cast(NULL as double) AS burned_native, -- Not applicable for L2s - cast(NULL as double) AS burned_usd, -- Not applicable for L2s - cast(NULL as VARBINARY) as validator, -- Not applicable for L2s - txns.gas_price/1e9 as gas_price_gwei, - txns.gas_price/1e18 * p.price as gas_price_usd, - txns.gas_used as gas_used, - txns.gas_limit as gas_limit, - CASE - WHEN txns.gas_limit = 0 THEN NULL - WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 - END AS gas_usage_percent, - type as transaction_type -FROM {{ source('zora','transactions') }} txns -JOIN {{ source('zora','blocks') }} blocks ON blocks.number = txns.block_number -{% if is_incremental() %} -AND {{ incremental_predicate('txns.block_time') }} -AND {{ incremental_predicate('blocks.time') }} -{% endif %} -LEFT JOIN {{ source('prices','usd') }} p ON p.minute = date_trunc('minute', block_time) -AND p.blockchain = 'zora' -AND p.symbol = 'WETH' -{% if is_incremental() %} -AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('txns.block_time') }} -AND {{ incremental_predicate('blocks.time') }} -AND {{ incremental_predicate('p.minute') }} -{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zora/gas_zora_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zora/gas_zora_schema.yml deleted file mode 100644 index 6a4c5211f76..00000000000 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/zora/gas_zora_schema.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2 - -models: - - name: gas_zora_fees - meta: - blockchain: zora - sector: gas - contributors: soispoke, lgingerich - config: - tags: ['zora', 'gas', 'fees'] - description: > - Gas Fees on Zora rollup Layer 2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_number - - tx_hash - columns: - - &blockchain - name: blockchain - description: "Blockchain name" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - description: "Block number" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - &tx_sender - name: tx_sender - description: "Initiated the transaction" - - &tx_receiver - name: tx_receiver - description: "Received the transaction" - - &native_token_symbol - name: native_token_symbol - description: "Symbol of native token (ETH) for the Ethereum Blockchain" - - &tx_amount_native - name: tx_amount_native - description: "Amount of native tokens (ETH) transferred from sender to recipient" - - &tx_amount_usd - name: tx_amount_usd - description: "Amount of $USD transferred from sender to recipient" - - &tx_fee_native - name: tx_fee_native - description: "Total amount of native tokens (ETH) paid in gas fees" - - &tx_fee_usd - name: tx_fee_usd - description: "Total amount of $USD paid in gas fees" - - &burned_native - name: burned_native - description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &burned_usd - name: burned_usd - description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" - - &validator - name: validator - description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" - - &gas_price_gwei - name: gas_price_gwei - description: "Gas price (per gas unit) denoted in gwei" - - &gas_price_usd - name: gas_price_usd - description: "Gas price (per gas unit) denoted in $USD" - - &gas_used - name: gas_used - description: "Amount of L2 gas units consumed by the transaction" - - &gas_limit - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction on zksync L2" - - &gas_usage_percent - name: gas_usage_percent - description: "Percentage of Gas Used relative to the gas limit on zksync L2" - - &type - name: type - description: "Legacy (Pre Typed-Transactions), AccessList (EIP-2930), DynamicFee (EIP-1559), EIP-712, or Priority (L1 -> L2 Transactions)" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/labels/_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/labels/_schema.yml index 5b60c326078..b53f15f4d0f 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/labels/_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/_sector/labels/_schema.yml @@ -4,7 +4,10 @@ models: - name: labels_transfer_summary config: tags: ['labels', 'transfer', 'summary'] + description: "a summary of transfers in/out of labeled addresses" + meta: + docs_slug: /curated/labels/owners/value-flows/transfer-summary tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -17,6 +20,8 @@ models: config: tags: [ 'labels', 'transfer', 'summary', 'daily'] description: "a daily summary of transfers in/out of labeled addresses" + meta: + docs_slug: /curated/labels/owners/value-flows/transfer-summary-daily tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -30,6 +35,8 @@ models: config: tags: [ 'labels', 'counterparty', 'activity', 'daily'] description: "a daily activity of the counterparties of labeled addresses" + meta: + docs_slug: /curated/labels/owners/value-flows/counterparty-activity-daily tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: diff --git a/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts.sql b/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts.sql index e0a7971744a..8da43b411c7 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts.sql @@ -1,7 +1,7 @@ {{config( alias = 'contracts', - post_hook='{{ expose_spells(\'["ethereum", "arbitrum", "gnosis", "optimism", "bnb", "avalanche_c", "fantom", "polygon"]\', + post_hook='{{ expose_spells(\'["ethereum", "arbitrum", "gnosis", "optimism", "bnb", "avalanche_c", "fantom", "polygon","base","linea","scroll","mantle","blast"]\', "sector", "labels", \'["soispoke"]\') }}') @@ -101,4 +101,64 @@ SELECT 'polygon' as blockchain, now() as updated_at, 'contracts' as model_name, 'identifier' as label_type -FROM {{ source('polygon','contracts') }} \ No newline at end of file +FROM {{ source('polygon','contracts') }} +UNION +SELECT 'base' as blockchain, + address, + CONCAT(UPPER(SUBSTR(namespace,1,1)),SUBSTR(namespace,2)) || ': ' || name as name, + 'contracts' as category, + 'rantum' as contributor, + 'query' AS source, + date('2024-08-30') as created_at, + now() as updated_at, + 'contracts' as model_name, + 'identifier' as label_type +FROM {{ source('base','contracts') }} +UNION +SELECT 'linea' as blockchain, + address, + CONCAT(UPPER(SUBSTR(namespace,1,1)),SUBSTR(namespace,2)) || ': ' || name as name, + 'contracts' as category, + 'rantum' as contributor, + 'query' AS source, + date('2024-08-30') as created_at, + now() as updated_at, + 'contracts' as model_name, + 'identifier' as label_type +FROM {{ source('linea','contracts') }} +UNION +SELECT 'mantle' as blockchain, + address, + CONCAT(UPPER(SUBSTR(namespace,1,1)),SUBSTR(namespace,2)) || ': ' || name as name, + 'contracts' as category, + 'rantum' as contributor, + 'query' AS source, + date('2024-08-30') as created_at, + now() as updated_at, + 'contracts' as model_name, + 'identifier' as label_type +FROM {{ source('mantle','contracts') }} +UNION +SELECT 'blast' as blockchain, + address, + CONCAT(UPPER(SUBSTR(namespace,1,1)),SUBSTR(namespace,2)) || ': ' || name as name, + 'contracts' as category, + 'rantum' as contributor, + 'query' AS source, + date('2024-08-30') as created_at, + now() as updated_at, + 'contracts' as model_name, + 'identifier' as label_type +FROM {{ source('blast','contracts') }} +UNION +SELECT 'scroll' as blockchain, + address, + CONCAT(UPPER(SUBSTR(namespace,1,1)),SUBSTR(namespace,2)) || ': ' || name as name, + 'contracts' as category, + 'rantum' as contributor, + 'query' AS source, + date('2024-08-30') as created_at, + now() as updated_at, + 'contracts' as model_name, + 'identifier' as label_type +FROM {{ source('scroll','contracts') }} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts_schema.yml index 9acd13b4ed8..dda3fe6741b 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/_sector/labels/addresses/__single_category_labels__/contracts/labels_contracts_schema.yml @@ -14,7 +14,7 @@ models: blockchain: ethereum, arbitrum, gnosis, optimism, bnb, avalanche_c, fantom, polygon sector: labels category: contracts - contributors: soispoke + contributors: soispoke, rantum config: tags: ['query', 'labels', 'ethereum', 'contracts'] description: "Dune contracts query labels across chains" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_balances.sql b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_balances.sql new file mode 100644 index 00000000000..a6007b30d60 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_balances.sql @@ -0,0 +1,37 @@ +{{ + config( + schema = 'rwa_arbitrum', + alias = 'balances', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['day', 'address', 'token_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.day')] + ) +}} + +with +rwa_tokens as ( + select + project, + token_address + from {{ref('rwa_arbitrum_tokens')}} + where type = 'RWA' +) + +,balances as ( + {{ + balances_incremental_subset_daily( + blockchain = 'arbitrum', + token_list = 'rwa_tokens', + start_date = '2023-11-17' + ) + }} +) + +select + t.project + ,b.* +from balances b +left join rwa_tokens t + on b.token_address = t.token_address diff --git a/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_dex_balances.sql b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_dex_balances.sql new file mode 100644 index 00000000000..22c2d58b7d5 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_dex_balances.sql @@ -0,0 +1,41 @@ +{{ + config( + schema = 'rwa_arbitrum', + alias = 'dex_balances', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['day', 'address', 'token_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.day')] + ) +}} + +with dex_pools as ( + select + project, + version, + pool as address, + token_address + from {{ref('rwa_arbitrum_dex_pools')}} +) + +,balances as ( + {{ + balances_incremental_subset_daily( + blockchain = 'arbitrum', + address_token_list = 'dex_pools', + start_date = '2023-11-17', + ) + }} +) + +select + p.project + ,p.version + ,b.* +from balances b +left join dex_pools p + on b.address = p.address + and b.token_address = p.token_address + + diff --git a/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_dex_pools.sql b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_dex_pools.sql new file mode 100644 index 00000000000..1e871ed5ca5 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_dex_pools.sql @@ -0,0 +1,39 @@ + +{{ + config( + schema = 'rwa_arbitrum' + ,alias = 'dex_pools' + ,materialized = 'table' + ,post_hook='{{ expose_spells(\'["arbitrum"]\', + "sector", + "rwa", + \'["maybeYonas", "pyor_xyz"]\') }}' + ) +}} + +select + project, + version, + pool, + token_address, + token_is_rwa, + symbol, + protocol, + type +from (values + ('curve', 'stableswap-ng', 0x4bD135524897333bec344e50ddD85126554E58B4, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831, 0, 'USDC', 'Mountain Protocol', 'RWA'), + ('curve', 'stableswap-ng', 0x4bD135524897333bec344e50ddD85126554E58B4, 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C, 0, 'USDM', 'Mountain Protocol', 'RWA'), + ('uniswap', '3', 0xfEAA137F43f88b7F767F5A67978FfF8EC11Cc6Ef, 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1, 0, 'WETH', 'Frax Finance', 'Governance'), + ('uniswap', '3', 0xfEAA137F43f88b7F767F5A67978FfF8EC11Cc6Ef, 0x9d2F299715D94d8A7E6F5eaa8E654E8c74a988A7, 0, 'FXS', 'Frax Finance', 'Governance'), + ('ramses', '3', 0xa45Cbd521ED745F6C856C89F8dBB583bD1591fC2, 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1, 0, 'WETH', 'Frax Finance', 'Governance'), + ('ramses', '3', 0xa45Cbd521ED745F6C856C89F8dBB583bD1591fC2, 0x9d2F299715D94d8A7E6F5eaa8E654E8c74a988A7, 0, 'FXS', 'Frax Finance', 'Governance') +) as t( + project, + version, + pool, + token_address, + token_is_rwa, + symbol, + protocol, + type +) diff --git a/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_schema.yml new file mode 100644 index 00000000000..af52cd083ba --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_schema.yml @@ -0,0 +1,145 @@ +version: 2 + +models: + - name: rwa_arbitrum_tokens + + meta: + blockchain: arbitrum + sector: rwa + project: rwa + contributors: maybeYonas, pyor_xyz + + config: + tags: ['rwa', 'tokens'] + description: "RWA tokens" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - token_address + + columns: + - &token_address + name: token_address + description: "Address for the token" + - &symbol + name: symbol + description: "Symbol for the token" + - &project + name: project + description: "Project for the token" + - &type + name: type + description: "Type of Asset" + + - name: rwa_arbitrum_dex_pools + + meta: + blockchain: arbitrum + sector: rwa + project: rwa + contributors: maybeYonas, pyor_xyz + + config: + tags: ['rwa', 'tokens'] + description: "RWA tokens DEX Pools" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - token_address, pool + + columns: + - *project + - &version + name: version + description: "Version for the token" + - &token_is_rwa + name: token_is_rwa + description: "Is the token the RWA ?" + - *token_address + - *symbol + - *project + - *type + + - name: rwa_arbitrum_balances + + meta: + blockchain: arbitrum + sector: rwa + project: rwa + contributors: maybeYonas, pyor_xyz + + config: + tags: ['rwa', 'balances'] + description: "Balances of RWA token holders" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - address + - token_address + columns: + - &blockchain + name: blockchain + description: "Blockchain for the token" + - *project + - *version + - &day + name: day + description: "Date on which the token balance is logged" + - &address + name: address + description: "Address for the token holder" + - &token_symbol + name: token_symbol + description: "Symbol for the token" + - *token_address + - &token_standard + name: token_standard + description: "Standard for the token" + - &token_id + name: token_id + description: "ID for the token" + - &balance + name: balance + description: "Balance for the user" + - &balance_usd + name: balance_usd + description: "USD value of balance for the user" + - &last_updated + name: last_updated + description: "UTC timestamp when data was last updated" + - &next_update + name: next_update + description: "UTC timestamp when data is next updated" + + - name: rwa_arbitrum_dex_balances + + meta: + blockchain: arbitrum + sector: rwa + project: rwa + contributors: maybeYonas, pyor_xyz + + config: + tags: ['rwa', 'balances'] + description: "Balances of RWA token DEXes" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - address + - token_address + columns: + - *blockchain + - *project + - *version + - *day + - *address + - *token_symbol + - *token_address + - *token_standard + - *token_id + - *balance + - *balance_usd + - *last_updated + - *next_update diff --git a/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_tokens.sql b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_tokens.sql new file mode 100644 index 00000000000..3e38fcc57aa --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/rwa/arbitrum/rwa_arbitrum_tokens.sql @@ -0,0 +1,28 @@ + +{{ + config( + schema = 'rwa_arbitrum' + ,alias = 'tokens' + ,materialized = 'table' + ,post_hook='{{ expose_spells(\'["arbitrum"]\', + "sector", + "rwa", + \'["maybeYonas", "pyor_xyz"]\') }}' + ) +}} + +select + token_address, + symbol, + project, + type +from (values + (0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C, 'USDM' , 'Mountain Protocol' , 'RWA' ), + (0xfc90518D5136585ba45e34ED5E1D108BD3950CFa, 'USD+' , 'Dinari' , 'RWA' ), + (0x9d2f299715d94d8a7e6f5eaa8e654e8c74a988a7, 'FXS' , 'Frax Finance' , 'Governance' ) +) as t( + token_address, + symbol, + project, + type +) diff --git a/dbt_subprojects/daily_spellbook/models/aave/aave_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/aave_flashloans.sql index 74c779d0337..f809b325d50 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/aave_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/aave_flashloans.sql @@ -1,52 +1,30 @@ -{{ config( - partition_by = ['block_month'] - , schema = 'aave' - , alias = 'flashloans' - , materialized = 'incremental' - , file_format = 'delta' - , incremental_strategy = 'merge' - , unique_key = ['blockchain', 'tx_hash', 'evt_index'] - , post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "optimism", "ethereum", "polygon", "fantom", "base"]\', - "project", - "aave", - \'["hildobby", "tomfutago"]\') }}' +{{ + config( + schema = 'aave', + alias = 'flashloans', + materialized = 'view', + post_hook = '{{ expose_spells(\'["optimism"]\', + "project", + "aave", + \'["tomfutago","hildobby"]\') }}' ) }} -{% set aave_models = [ -ref('aave_arbitrum_flashloans') -, ref('aave_avalanche_c_flashloans') -, ref('aave_optimism_flashloans') -, ref('aave_ethereum_flashloans') -, ref('aave_polygon_flashloans') -, ref('aave_fantom_flashloans') -, ref('aave_base_flashloans') -] %} - -SELECT * -FROM ( - {% for aave_model in aave_models %} - SELECT blockchain - , project - , version - , block_time - , block_month - , block_number - , amount - , amount_usd - , tx_hash - , evt_index - , fee - , currency_contract - , currency_symbol - , recipient - , contract_address - FROM {{ aave_model }} - {% if is_incremental() %} - WHERE block_time >= date_trunc('day', now() - interval '7' Day) - {% endif %} - {% if not loop.last %} - UNION ALL - {% endif %} - {% endfor %} -) \ No newline at end of file +select + blockchain, + project, + version, + recipient, + amount, + amount_usd, + fee, + symbol as currency_symbol, + token_address as currency_contract, + project_contract_address as contract_address, + block_month, + block_time, + block_number, + tx_hash, + evt_index +from {{ source('lending','flashloans') }} +where project = 'aave' diff --git a/dbt_subprojects/daily_spellbook/models/aave/arbitrum/aave_arbitrum_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/arbitrum/aave_arbitrum_flashloans.sql index 2853e756ced..cda28f82ff8 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/arbitrum/aave_arbitrum_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/arbitrum/aave_arbitrum_flashloans.sql @@ -2,11 +2,7 @@ config( schema = 'aave_arbitrum', alias = 'flashloans', - materialized = 'view', - post_hook = '{{ expose_spells(\'["arbitrum"]\', - "project", - "aave", - \'["hildobby", "tomfutago"]\') }}' + materialized = 'view' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql index 09db672e4a9..9f0c129249a 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql @@ -2,11 +2,7 @@ config( schema = 'aave_avalanche_c', alias = 'flashloans', - materialized = 'view', - post_hook = '{{ expose_spells(\'["avalanche_c"]\', - "project", - "aave", - \'["hildobby", "tomfutago"]\') }}' + materialized = 'view' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_flashloans.sql index 3cc7953ba4a..7b0872b5997 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_flashloans.sql @@ -2,11 +2,7 @@ config( schema = 'aave_base', alias = 'flashloans', - materialized = 'view', - post_hook = '{{ expose_spells(\'["base"]\', - "project", - "aave", - \'["hildobby", "tomfutago"]\') }}' + materialized = 'view' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/aave/ethereum/aave_ethereum_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/ethereum/aave_ethereum_flashloans.sql index dbffd26fb1c..b950ace054e 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/ethereum/aave_ethereum_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/ethereum/aave_ethereum_flashloans.sql @@ -2,11 +2,7 @@ config( schema = 'aave_ethereum', alias = 'flashloans', - materialized = 'view', - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "aave", - \'["hildobby", "tomfutago"]\') }}' + materialized = 'view' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/aave/fantom/aave_fantom_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/fantom/aave_fantom_flashloans.sql index 152b506b2fd..9b4cc2eafbd 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/fantom/aave_fantom_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/fantom/aave_fantom_flashloans.sql @@ -2,11 +2,7 @@ config( schema = 'aave_fantom', alias = 'flashloans', - materialized = 'view', - post_hook = '{{ expose_spells(\'["fantom"]\', - "project", - "aave", - \'["hildobby", "tomfutago"]\') }}' + materialized = 'view' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/aave/optimism/aave_optimism_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/optimism/aave_optimism_flashloans.sql index 41eb2bc9b37..54e05b8c9d2 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/optimism/aave_optimism_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/optimism/aave_optimism_flashloans.sql @@ -2,11 +2,7 @@ config( schema = 'aave_optimism', alias = 'flashloans', - materialized = 'view', - post_hook = '{{ expose_spells(\'["optimism"]\', - "project", - "aave", - \'["tomfutago"]\') }}' + materialized = 'view' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/aave/polygon/aave_polygon_flashloans.sql b/dbt_subprojects/daily_spellbook/models/aave/polygon/aave_polygon_flashloans.sql index 7e3bbc4c9d6..92601c643ca 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/polygon/aave_polygon_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/aave/polygon/aave_polygon_flashloans.sql @@ -2,11 +2,7 @@ config( schema = 'aave_polygon', alias = 'flashloans', - materialized = 'view', - post_hook = '{{ expose_spells(\'["polygon"]\', - "project", - "aave", - \'["hildobby", "tomfutago"]\') }}' + materialized = 'view' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_mev.sql b/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_mev.sql index 25b085ec622..a4b2cf3b60e 100644 --- a/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_mev.sql +++ b/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_mev.sql @@ -407,4 +407,181 @@ FROM (VALUES , (0xbf901f52aef5bb098f6f7918e1fa0c639720f409) -- Etherscan , (0xe4000004000bd8006e00720000d27d1fa000d43e) -- Etherscan , (0x0ddc6f9ce13b985dfd730b8048014b342d1b54f7) -- Etherscan + , (0x5ddf30555ee9545c8982626b7e3b6f70e5c2635f) -- Etherscan + , (0x01bd2da640345f1c29831b7cef9a434298408172) -- Etherscan + , (0x42183725df3be80bcefb3d12528417698c0c8a8c) -- Etherscan + , (0xDa7d7A4640Dfd472D243dceaDF40d0E1DB891Afb) -- Etherscan + , (0xC8d8141643FCfee443f6a7493C76c913Df772333) -- Etherscan + , (0xA42935DC1f5bCa7FF523Dd92c16b2Da268566D70) -- Etherscan + , (0x1f2F10D1C40777AE1Da742455c65828FF36Df387) -- Etherscan + , (0xFB745fa1824bb085362a7f0933017AB41d24e05C) -- Etherscan + , (0x90D61b727f7fB21B93A55CeDF9DF9d2F4fE7D6F4) -- Etherscan + , (0x5e51328C0583094b76f28Cfd532AbC3d454fCfEA) -- Etherscan + , (0x7b4aa82a26f6d864489b1DD905cb591ED4F9C715) -- Etherscan + , (0xF45F62bbb1a3e3eF7376790CD09e190DF6808bB5) -- Etherscan + , (0xBf3033C6dd79d8C773d1E58051E12D5B9B4f9418) -- Etherscan + , (0x7694C1475bE4B0f7E559d17284f03111991cf878) -- Etherscan + , (0x6f1cdbbb4d53d226cf4b917bf768b94acbab6168) -- Etherscan + , (0x2bea56Da3Fd9387A0556d158451538C05E08654a) -- Etherscan + , (0x5F80997936bf86F7F10648897dc40d3b8b04c821) -- Etherscan + , (0x262D2Fa34C66B462604Eda521E5EDE976D5C779C) -- Etherscan + , (0x76b5A83C8c8097E7723Eda897537B6345789B229) -- Etherscan + , (0x50347Cae376b0e3fe90b97858E2fdbeA6FEDFF40) -- Etherscan + , (0xB1ce3eA155A6Eda0B34d958081489F54BdF3Da5F) -- Etherscan + , (0x30Ea35bf5dbe2B80FC2438418848a53A0b194E3B) -- Etherscan + , (0x16B5332DC3439574b2f580f6692B24fEf649DB42) -- Etherscan + , (0xCA980F000771f70B15647069E9E541ef73F71f2f) -- Etherscan + , (0xaaCef30F703A86B259c807812E4feD295Ccb07AE) -- Etherscan + , (0x0bc8332840eEc6f16F1fA846214E628B03558cAf) -- Etherscan + , (0x7A6d324756605B200b7ADAa2795Ae0F930F77dcD) -- Etherscan + , (0x0000000000304a767881fDcCB30FCEB51f6221e2) -- Etherscan + , (0x5aD7c57A50cFB4620aDa929C53f08341Bf11Eb7c) -- Etherscan + , (0xe72889F88f279043206698c50B752FC6eb47b63f) -- Etherscan + , (0x0aeC284D53A2B29747e88d1F29c10fEda7dbfC48) -- Etherscan + , (0x37eb12c7592Fd3A8C1A2F9474D75B5cFC47a6980) -- Etherscan + , (0x29C67dd723F459300363F5C5FbA5FcE8FCe323BD) -- Etherscan + , (0x31A240648e2baf4f9F17225987f6f53fceB1699A) -- Etherscan + , (0xd129D8C12f0e7aA51157D9e6cc3F7Ece2dc84ecD) -- Etherscan + , (0x952E24a9F49a15caC92cF1F6d01B9536959948f4) -- Etherscan + , (0x23b530268c4a1f0BB11fBb0AA2F3ddf0d41cAf22) -- Etherscan + , (0xdcD4c1343b22DBBa8E763417456713A7b6946B93) -- Etherscan + , (0xDD3A6ab30c06ff3d7E5D89EF5f6AE2AeeCeF1A31) -- Etherscan + , (0xDC00E700B1709a9B7a0032f3c84373C2DE00e620) -- Etherscan + , (0xE20Cd9377C204A27952F8B41075F0b8bD1ceEC3d) -- Etherscan + , (0xEF17998601dd5785b909AdD7B2F376299d308ed4) -- Etherscan + , (0x4eb7Fc78CFa4887587E84783e2498c917cAb9fc9) -- Etherscan + , (0xca122E50566cC5a5F0B744c6aF7831C5174f40Fa) -- Etherscan + , (0x5079FC00f00F30000E0c8C083801cFdE000008b6) -- Etherscan + , (0xF1A0b1Dcda71826f507Fb22a5419A9D97EF9E238) -- Etherscan + , (0x32801aB1957Aaad1c65289B51603373802B4e8BB) -- Etherscan + , (0x1B72d900eE50CA200097003100001F30aE00495b) -- Etherscan + , (0x6aF422F2f375F3A43182A1b743E72E608fe0b1d4) -- Etherscan + , (0x400900032E970DE2Dcf81F7E430569099d36ADAd) -- Etherscan + , (0x9f51040aEc194a89cb6a7e852E79Ea07Cc0bF648) -- Etherscan + , (0xCdBAB0eB5325aC82bb684a185bA84dbdc8d5e4D3) -- Etherscan + , (0x7a6955333D76D702E17e0B5593D6B553D9eE813c) -- Etherscan + , (0x2F17d3ceB71Ad380441A90f8Cb1882D91819E0F1) -- Etherscan + , (0x34E6Fd53C6C10141774a28de9520e21af6274d4B) -- Etherscan + , (0xcAC964bF34F0643F8BbBa2e6a0e2750f8b436f65) -- Etherscan + , (0x3f242a8F14A5A4C7346658f501fa94DBEec1e5FF) -- Etherscan + , (0x9878644ad744a970D3598594f1cdbb1389c17826) -- Etherscan + , (0x2C2C82e7CAf5F14e4995c366D9DB8CdFdf7677E3) -- Etherscan + , (0x6BbE6b6F726C08a8E447CbBc7573c880339C4e2A) -- Etherscan + , (0xA4a343f900B1f0aFc140AF985F307B53629B1bCa) -- Etherscan + , (0xCF8b0F9422084695ef702bFce33976982FF3304b) -- Etherscan + , (0x605e35E88b2EBA3fF084045D8EB8ae881c7E9dcB) -- Etherscan + , (0xAf8887864653A612c928256943f073221E9FC1BF) -- Etherscan + , (0x380Bf264BD8eE2e52d58d23834Ad36C30f1A1778) -- Etherscan + , (0xe76014c179F19dA26Bb30A0f085FF0A466B92829) -- Etherscan + , (0x00000000009E50a7dDb7a7B0e2ee6604fd120E49) -- Etherscan + , (0x73a8a6F5d9762EA5f1de193eC19CdF476C7e86b1) -- Etherscan + , (0x77d5f03822f94B39ad6117F6a46761EC5879031b) -- Etherscan + , (0x4736B02DB015DCD1A57a69c889D073b100000000) -- Etherscan + , (0x18AbedEbf76e1E6FdEb3aE0A5Dd06DAa28112aBF) -- Etherscan + , (0x64545160d28Fd0E309277C02D6d73b3923Cc4bFA) -- Etherscan + , (0xF03f1A572792339f625e44A1c304eC826659c259) -- Etherscan + , (0xb13c95E00312e301085d29ebB84c21fCA663dAae) -- Etherscan + , (0x826A4f4DA02588737d3c27325B14F39b5151CA3C) -- Etherscan + , (0x2b8Bc3f432f5a95Aadd0593D39e8bf8A0174B7a4) -- Etherscan + , (0x2C10f2e3c2Eaa722b78dbD9f7661Ee22520554e6) -- Etherscan + , (0x97C1A26482099363cb055f0F3Ca1D6057Fe55447) -- Etherscan + , (0x74b667caba0583695817F05c4cD684fB561B3f1D) -- Etherscan + , (0xaAFb85ad4a412dd8adC49611496a7695A22f4aeb) -- Etherscan + , (0x8Ce45e650aB17B6CA0dD6071f7c2B5c69B5b42b2) -- Etherscan + , (0x6a5eF39f58C80e42642b9210Bf74f20666A2E6b6) -- Etherscan + , (0xA8E1aeD437f83898784fDc5c0256412F10bE33AE) -- Etherscan + , (0xD4674001A9a66b31F3c09E3b1Fec465404c83d35) -- Etherscan + , (0xea907797Dd7243DE1ae030d97279eDde936AE779) -- Etherscan + , (0x83eF3D446Bd1220C8261251f83AC5cc51311d600) -- Etherscan + , (0x187e8e5c70457C756A5779AEB2227eF098bCA776) -- Etherscan + , (0xbaDC0de76438f9524D42C219b390636196bfbdFc) -- Etherscan + , (0x67981A396852EA0Cba2A687b427FA71F7739d1cF) -- Etherscan + , (0xd58Db780bC6A23aC39da7A7b85e7B4B64610bf20) -- Etherscan + , (0x04c613CE5Be6A8fda3A441163975a62909b337d7) -- Etherscan + , (0x2EcD8f51Fa432415fe8F385b8b369f13EFF16FcB) -- Etherscan + , (0x0d531E9bFcc88C42A4A707162b853d233eb586Fc) -- Etherscan + , (0x4Ab12E7CE31857Ee022f273e8580F73335a73c0B) -- Etherscan + , (0x2Cf73796Be4613151a05A90bD4625225C8198c9C) -- Etherscan + , (0xB93D5724e4dd2895f38e27D5D84208018818bEA1) -- Etherscan + , (0x00000000000Ba9Cd9F5175108141A82B6c24d727) -- Etherscan + , (0x738e79fBC9010521763944ddF13aAD7f61502221) -- Etherscan + , (0x1810A6F790f2A007D66548D78B52b7123054F325) -- Etherscan + , (0x525145f821D8D2ABb494c454E9445E14c817F7cb) -- Etherscan + , (0xBdB241F7fd4eD7f0F40fC6C26B7C1F8Dd21b6C49) -- Etherscan + , (0x8D7f71C25FB581b7ba2EFbB10345d262d1852Ff5) -- Etherscan + , (0x1Ae235406e5dF15E7c8E55dF6C16e643Eea44d17) -- Etherscan + , (0x5e638aC1700e5aD5F937df30Cb5BBC51A5A4C1EC) -- Etherscan + , (0xd7a00569aFc56eAF88485845c5e3fE8507912eCa) -- Etherscan + , (0xcB83cA9633Ad057Bd88A48a5B6e8108D97Ad4472) -- Etherscan + , (0xe5bba2Bde7D4192D4b986E9e87A39f0C0dadEB38) -- Etherscan + , (0x5f9Ecf757137d5Ef4330aB72d18163c2f221befD) -- Etherscan + , (0x70E86223507724BF2C51Fe3AC2CC78C67BFAD366) -- Etherscan + , (0xbEb5fD030ffB0FBc95d68113c1C796Eff65526d7) -- Etherscan + , (0xD198fBE60C49D4789525fC54567447518C7D2a11) -- Etherscan + , (0xBC54CB8F702f6F404Aa83D986Ee793dB5C4e5359) -- Etherscan + , (0x53FacEe52e897740B140F5304E9Cd9DC6238d735) -- Etherscan + , (0x8d27C03FA77f30AF3Dce552ddE5bAbF65d14861f) -- Etherscan + , (0xdEA6fdEA0471ce1545331B7b93Fdbd43786fa4c2) -- Etherscan + , (0x0000000000450702bC4f750fD1E7Ecad7054c4f1) -- Etherscan + , (0x7D23E5c85C9525b777ba9B317f4aA271d33B69A5) -- Etherscan + , (0x430A350E685fA0D49eb2FBd83aBDE6d2b796aDB0) -- Etherscan + , (0xa52A64501E816016030511aea0445F1A97EE6694) -- Etherscan + , (0x73b2416e1CBAFBf6112aBfdCF10991Bd0705F715) -- Etherscan + , (0xA515d8b58233fd37B00C087028121DeB1A4F3bB0) -- Etherscan + , (0xECB03B9a0E7F7B5E261d3Ef752865af6621a54Fe) -- Etherscan + , (0x073197fa2656bdAf1ca018b7b333379683B1D8aD) -- Etherscan + , (0x7701Aaa4dFDB9107815DD3e36e0Bf134417c02b0) -- Etherscan + , (0xF1b0475ab021F37b971013B4222E510A8679BEdF) -- Etherscan + , (0x760762B30991A01F492E9ff067583a0C85d5768F) -- Etherscan + , (0xD460F9384f5328cf93dF6970cDBFe392BE03D006) -- Etherscan + , (0xf411fcA55E1a892C9Ba6D04AbE5Ca26eC1764D2B) -- Etherscan + , (0x5B1315BBEa9216ebB840816040E2C19AfCCE59A8) -- Etherscan + , (0x9ba88D864B204845eB95f202C6649B126bE8892A) -- Etherscan + , (0xF67d5Fe8b3B6DDD964448C0F6dA09bdEA6d58BC4) -- Etherscan + , (0x8793C6aA63CC96c955DA4906f628DC09cd595dC8) -- Etherscan + , (0x874DaCa3729fE54d930D810A71Cbaa1A47Af08e5) -- Etherscan + , (0xba13ca85129bA6bC80934A828fce04331268E953) -- Etherscan + , (0x059324620f5324c87ddeb4204Aa1Fbc59AC2779a) -- Etherscan + , (0x7B9AB5cdc4B1ff7d541F4de11E210f6e57f8c6Fc) -- Etherscan + , (0x25e849E019000018D8E400bf0007000888e66000) -- Etherscan + , (0x000000000000feA5F4B241F9E77B4D43B76798a9) -- Etherscan + , (0x5ED5dD65aB0dC1bCCC44eedAa40680C231FAaa9F) -- Etherscan + , (0xfbEedCFe378866DaB6abbaFd8B2986F5C1768737) -- Etherscan + , (0x63756A3C3BF677BAAB9D9e06457402ED05BE8570) -- Etherscan + , (0x4E69A51f24F5A46919113cc78Ab262Da74A4611D) -- Etherscan + , (0xc6feCDF760Af24095cDEd954dE7d81aB49f8Bae1) -- Etherscan + , (0x000000E1fDDF4fE15DB5f23aE3eE83C6A11E8Dd1) -- Etherscan + , (0x797A05dd6a8bfC1E1eaAa62E744D3Aff197C46b1) -- Etherscan + , (0x136F79961B7AB2A91104eC892c288E225E100214) -- Etherscan + , (0xe6AE75bE7c9317AF842B8F2c2Cd6DC7F49F17184) -- Etherscan + , (0xcC2687c14915Fd68226cCF388842515739A739BD) -- Etherscan + , (0x4B8c0A0df725750aeb948816B4dffeCD32ee9008) -- Etherscan + , (0x356cfd6e6D0000400000003900b415f80669009e) -- Etherscan + , (0x030f11Dcba56b8038c3c94F056ea68dC7668630E) -- Etherscan + , (0x64E6D37c95C066C4F2401e28C2E3bdEec06e2ED8) -- Etherscan + , (0x6980a47beE930a4584B09Ee79eBe46484FbDBDD0) -- Etherscan + , (0x8db64ee50717a0418adf9Ad99D8685318d4D4579) -- Etherscan + , (0x000000000055217587F821917562867172942189) -- Etherscan + , (0x7d32C90762E22379235FC311fDB16fAB399Ed40A) -- Etherscan + , (0xAc682Edd8729d679d6c044cf44e975d5B8FCF90f) -- Etherscan + , (0xB78DfC0C14016Ebb4678D7949Ad6e4b8ba14e634) -- Etherscan + , (0x00000000000006b2AB6deCBC6FC7Ec6bD2Fbc720) -- Etherscan + , (0x2deaE6ce94D65aC1DE19a1FC4Bb160C4E02C92EF) -- Etherscan + , (0x3C005bA2000F0000ba000d69000AC8Ec003800BC) -- Etherscan + , (0x615c8c3675E6f683E201553939508E6ADE823634) -- Etherscan + , (0x4b06DCA23845adC723bD059a7D73333195894bF6) -- Etherscan + , (0x4f7A67464B5976d7547c860109e4432d50AfB38e) -- Etherscan + , (0x00000000000086dEcebE6f366c172Cb10d69eB3A) -- Etherscan + , (0x34B689c61aF149C3Bb904B8407abc0bfB6A622F6) -- Etherscan + , (0xB59A226a2b8A2F2b0512bAA35CC348b6b213b671) -- Etherscan + , (0xCE966eC69B1416359C1f88b1683Ab239BA8620ed) -- Etherscan + , (0xc608c92cC34781F5bA300A7e69e4917FAA7cA87e) -- Etherscan + , (0x6EA7fb8e16c1f03fba90f891567b520Bf4CA6F6a) -- Etherscan + , (0x8011D6C888214b3aEA276A6D9d893578D8B25B03) -- Etherscan + , (0x0000009072063E8accCD96346df848dE0D2E57f4) -- Etherscan + , (0xa3274568F95C628D2A2383Fac9De1FAC220fAd48) -- Etherscan + , (0x24587E3C20AE309943589782Dfa25478Fa6e0e11) -- Etherscan + , (0x8c959215f998eA8D02400fD299832576E6720ecb) -- Etherscan + , (0xF9C977B4dCc279360390fC3BB11D0a935709Fa88) -- Etherscan + ) AS x (address) diff --git a/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_schema.yml b/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_schema.yml index 40c8f0da5ee..8b61bbabacc 100644 --- a/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/addresses/ethereum/addresses_ethereum_schema.yml @@ -46,7 +46,7 @@ models: blockchain: ethereum sector: mev project: addresses - contributors: hildobby + contributors: hildobby, rantum config: tags: ['table', 'MEV', 'addresses', 'ethereum'] description: "Known MEV addresses" diff --git a/dbt_subprojects/daily_spellbook/models/addresses_events/addresses_events_first_funded_by.sql b/dbt_subprojects/daily_spellbook/models/addresses_events/addresses_events_first_funded_by.sql index 672169523e3..9961a4d1a2e 100644 --- a/dbt_subprojects/daily_spellbook/models/addresses_events/addresses_events_first_funded_by.sql +++ b/dbt_subprojects/daily_spellbook/models/addresses_events/addresses_events_first_funded_by.sql @@ -2,7 +2,7 @@ ( alias = 'first_funded_by', schema = 'addresses_events', - post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "bnb", "ethereum", "fantom", "gnosis", "optimism", "polygon", "celo", "zksync", "zora", "base", "scroll"]\', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "bnb", "ethereum", "fantom", "gnosis", "optimism", "polygon", "celo", "zksync", "zora", "base", "scroll", "mantle", "blast"]\', "sector", "addresses_events", \'["hildobby", "Henrystats"]\') }}' @@ -25,6 +25,8 @@ ref('addresses_events_arbitrum_first_funded_by') , ref('addresses_events_scroll_first_funded_by') , ref('addresses_events_zkevm_first_funded_by') , ref('addresses_events_linea_first_funded_by') +, ref('addresses_events_mantle_first_funded_by') +, ref('addresses_events_blast_first_funded_by') ] %} SELECT * diff --git a/dbt_subprojects/daily_spellbook/models/beethoven_x/fantom/beethoven_x_fantom_pools_metrics_daily.sql b/dbt_subprojects/daily_spellbook/models/beethoven_x/fantom/beethoven_x_fantom_pools_metrics_daily.sql new file mode 100644 index 00000000000..95c7325df71 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/beethoven_x/fantom/beethoven_x_fantom_pools_metrics_daily.sql @@ -0,0 +1,82 @@ +{{ config( + schema = 'beethoven_x_fantom', + alias = 'pools_metrics_daily', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_date', 'blockchain', 'project', 'version', 'project_contract_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_date')], + post_hook='{{ expose_spells(blockchains = \'["arbitrum", "avalanche_c", "base", "ethereum", "gnosis", "optimism", "polygon", "zkevm"]\', + spell_type = "project", + spell_name = "beethoven_x_fantom", + contributors = \'["viniabussafi", "metacrypto"]\') }}' + ) +}} + + +WITH +trades AS( + SELECT + block_date, + version, + blockchain, + project_contract_address, + sum(amount_usd) AS swap_amount_usd + FROM {{ source('beethoven_x', 'trades') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_date')}} + {% endif %} + GROUP BY 1, 2, 3, 4 +), + +liquidity AS( + SELECT + day AS block_date, + blockchain, + version, + pool_address AS project_contract_address, + pool_type, + pool_symbol, + sum(pool_liquidity_usd) AS tvl_usd, + sum(pool_liquidity_eth) AS tvl_eth + FROM {{ ref('beethoven_x_fantom_liquidity') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('day')}} + {% endif %} + GROUP BY 1, 2, 3, 4, 5, 6 +), + +fees AS( + SELECT + day, + version, + blockchain, + pool_address, + sum(protocol_fee_collected_usd) AS fee_amount_usd + FROM {{ ref('beethoven_x_fantom_protocol_fee') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('day')}} + {% endif %} + GROUP BY 1, 2, 3, 4 +) + +SELECT + l.blockchain, + 'beethoven_x_fantom' AS project, + l.version, + l.block_date, + l.project_contract_address, + l.pool_symbol, + l.pool_type, + t.swap_amount_usd, + l.tvl_usd, + l.tvl_eth, + f.fee_amount_usd +FROM liquidity l +LEFT JOIN trades t ON l.block_date = t.block_date +AND l.project_contract_address = t.project_contract_address +AND l.blockchain = t.blockchain +LEFT JOIN fees f ON l.block_date = f.day +AND l.project_contract_address = f.pool_address +AND l.blockchain = f.blockchain +ORDER BY 1 DESC, 7 DESC diff --git a/dbt_subprojects/daily_spellbook/models/beethoven_x/fantom/beethoven_x_fantom_schema.yml b/dbt_subprojects/daily_spellbook/models/beethoven_x/fantom/beethoven_x_fantom_schema.yml index 73a6025c8b7..8145db2d2e1 100644 --- a/dbt_subprojects/daily_spellbook/models/beethoven_x/fantom/beethoven_x_fantom_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/beethoven_x/fantom/beethoven_x_fantom_schema.yml @@ -328,3 +328,42 @@ models: - name: token_address - name: daily_delta description: "Daily total impact on BPT supply" + + - name: beethoven_x_fantom_pools_metrics_daily + meta: + blockchain: fantom + contributors: viniabussafi, metacrypto + config: + tags: ['fantom', 'jelly_swap', 'pool', 'stats', 'volume', 'tvl', 'fee'] + description: > + This spell aggregates data from the trades, liquidity and protocol fees spells, by day and pool, while also displaying some basic information about the pool + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - blockchain + - project + - version + - project_contract_address + columns: + - *blockchain + - name: project + - name: version + - name: block_date + - &project_contract_address + name: project_contract_address + description: "Pool address" + - *pool_symbol + - name: pool_type + - &swap_amount_usd + name: swap_amount_usd + description: "Daily swap volume on a pool, in USD" + - &tvl_usd + name: tvl_usd + description: "Total Value Locked on a pool, in USD" + - &tvl_eth + name: tvl_eth + description: "Total Value Locked on a pool, in eth" + - &fee_amount_usd + name: fee_amount_usd + description: "Daily fees collected on a pool, in USD" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql b/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql index a71105bfe42..83a864dd8dd 100644 --- a/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql +++ b/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql @@ -132,7 +132,7 @@ FROM ( values ,('Factory 127 Mainnet' ,'FETH' ,'FETH' ,'127' ,'127' ,'https://www.factory127.com' ,'') ,('Huobi ECO Chain Mainnet' ,'Heco' ,'HT' ,'128' ,'128' ,'https://www.hecochain.com' ,'https://hecoinfo.com') ,('Alyx Chain Testnet' ,'Alyx Chain Testnet' ,'ALYX' ,'135' ,'135' ,'https://www.alyxchain.com' ,'https://testnet.alyxscan.com') -,('Polygon Mainnet' ,'Polygon' ,'MATIC' ,'137' ,'137' ,'https://polygon.technology/' ,'https://polygonscan.com') +,('Polygon Mainnet' ,'Polygon' ,'POL' ,'137' ,'137' ,'https://polygon.technology/' ,'https://polygonscan.com') ,('Openpiece Testnet' ,'OPENPIECE' ,'BELLY' ,'141' ,'141' ,'https://cryptopiece.online' ,'https://testnet.bellyscan.com') ,('DAX CHAIN' ,'DAX' ,'DAX' ,'142' ,'142' ,'https://prodax.io/' ,'') ,('PHI Network v2' ,'PHI' ,'Φ' ,'144' ,'144' ,'https://phi.network' ,'https://phiscan.com') @@ -498,7 +498,7 @@ FROM ( values ,('Mixin Virtual Machine' ,'MVM' ,'ETH' ,'73927' ,'73927' ,'https://mvm.dev' ,'https://scan.mvm.dev') ,('ResinCoin Mainnet' ,'RESIN' ,'RESIN' ,'75000' ,'75000' ,'https://resincoin.dev' ,'https://explorer.resincoin.dev') ,('Firenze test network' ,'ETH' ,'FIN' ,'78110' ,'78110' ,'https://primusmoney.com' ,'') -,('Mumbai' ,'Polygon' ,'MATIC' ,'80001' ,'80001' ,'https://polygon.technology/' ,'https://mumbai.polygonscan.com') +,('Mumbai' ,'Polygon' ,'POL' ,'80001' ,'80001' ,'https://polygon.technology/' ,'https://mumbai.polygonscan.com') ,('IVAR Chain Mainnet' ,'IVAR' ,'IVAR' ,'88888' ,'88888' ,'https://ivarex.com' ,'https://ivarscan.com') ,('Beverly Hills' ,'ETH' ,'BVE' ,'90210' ,'90210' ,'https://beverlyhills.ethdevops.io' ,'https://explorer.beverlyhills.ethdevops.io') ,('Lambda Testnet' ,'Lambda' ,'LAMB' ,'92001' ,'92001' ,'https://lambda.im' ,'https://explorer.lambda.top') diff --git a/dbt_subprojects/daily_spellbook/models/chainlink/ethereum/chainlink_ethereum_price_feeds_oracle_addresses.sql b/dbt_subprojects/daily_spellbook/models/chainlink/ethereum/chainlink_ethereum_price_feeds_oracle_addresses.sql index 8e8db7536f0..16f69225c79 100644 --- a/dbt_subprojects/daily_spellbook/models/chainlink/ethereum/chainlink_ethereum_price_feeds_oracle_addresses.sql +++ b/dbt_subprojects/daily_spellbook/models/chainlink/ethereum/chainlink_ethereum_price_feeds_oracle_addresses.sql @@ -1,11 +1,11 @@ {{ config( - + schema = 'chainlink_ethereum', alias='price_feeds_oracle_addresses', post_hook='{{ expose_spells(\'["ethereum"]\', "project", "chainlink", - \'["linkpool_ryan","linkpool_jon"]\') }}' + \'["linkpool_ryan","linkpool_jon","tomfutago"]\') }}' ) }} @@ -317,6 +317,7 @@ FROM (values ('{{msft_usd}}', 8, 0x021Fb44bfeafA0999C7b07C4791cf4B859C3b431, 0x99a9422bdBf888fAd917b3a714103E896D3e2011), ('{{metis_healthcheck}}', 8, 0x3425455fe737cdaE8564640df27bbF2eCD56E584, 0x31c8b5A8F0d286a4Bfcf669E18393b18E22B140D), ('{{moonbirds_floor_price}}', 18, 0x9cd36E0E8D3C27d630D00406ACFC3463154951Af, 0x8d0003e5c1C8EB67e04023a21291cf01CFd2E4a1), + ('{{nexus_weth_reserves}}', 18, 0xCc72039A141c6e34a779eF93AEF5eB4C82A893c7, 0xEA530C83AFa51A66f80935c78aB9BB574d7DdfCb), ('{{nexus_weth_reserves}}', 18, 0xCc72039A141c6e34a779eF93AEF5eB4C82A893c7, 0xCA71bBe491079E138927f3f0AB448Ae8782d1DCa), ('{{ohm_eth}}', 18, 0x90c2098473852E2F07678Fe1B6d595b1bd9b16Ed, 0x87831da9319260B0B38dD39A73EBD4c2C10C588c), ('{{ohm_eth}}', 18, 0x90c2098473852E2F07678Fe1B6d595b1bd9b16Ed, 0x7009033C0d6702fd2dfAD3478d2AE4e3b6aCB966), @@ -365,6 +366,7 @@ FROM (values ('{{ust_usd}}', 8, 0x8b6d9085f310396C6E4f0012783E9f850eaa8a82, 0x01b87e7fF78022A70394d3C6Dd127D0c709e3beA), ('{{ust_usd}}', 8, 0x8b6d9085f310396C6E4f0012783E9f850eaa8a82, 0x5EDd5F803b831b47715aD3e11a90dD244F0cD0a9), ('{{veefriends_floor_price}}', 18, 0x35bf6767577091E7f04707c0290b3f889e968307, 0xe0552DC960366F67Da00CB3d9DF441F24B5C2AC1), + ('{{weeth_eth}}', 18, 0x5c9C449BbC9a6075A2c061dF312a35fd1E05fF22, 0x0F316F6b0c2e2eBE3C3a8b23F6c61009238D51fD), ('{{weeth_eth}}', 18, 0x5c9C449BbC9a6075A2c061dF312a35fd1E05fF22, 0x4dF36F726d8059d881294166dB52c1D13e976FE7), ('{{wbtc_btc}}', 8, 0xfdFD9C85aD200c506Cf9e21F1FD8dd01932FBB23, 0xD7623f1d24b35c392862fB67C9716564A117C9DE), ('{{wbtc_por}}', 8, 0xa81FE04086865e63E12dD3776978E49DEEa2ea4e, 0xB622b7D6d9131cF6A1230EBa91E5da58dbea6F59), diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/arbitrum/chain_swap_arbitrum_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/arbitrum/chain_swap_arbitrum_trades.sql new file mode 100644 index 00000000000..c83e6121cf0 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/arbitrum/chain_swap_arbitrum_trades.sql @@ -0,0 +1,149 @@ +{{ + config( + alias='trades', + schema='chain_swap_arbitrum', + partition_by=['block_month'], + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + incremental_predicates=[ + incremental_predicate('DBT_INTERNAL_DEST.block_time') + ], + unique_key=['blockchain', 'tx_hash', 'evt_index'], + ) +}} + +{% set project_start_date = '2024-03-19' %} +{% set blockchain = 'arbitrum' %} +{% set deployer_1 = '0x9eC1ACAe39d07E1e8D8B3cEbe7022790D87D744A' %} +{% set deployer_2 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set deployer_3 = '0xc1cc1a300Dcfe5359eBe37f2007A77d1F91533ba' %} +{% set deployer_4 = '0x3A510C5a32bCb381c53704AED9c02b0c70041F7A' %} +{% set deployer_5 = '0xb7b953e81612c57256ff0aebd62b6a2f0546f7da' %} +{% set deployer_6 = '0xb252f0ab7bdf1be4d5bbf607eb5c220b2d902a2c' %} +{% set deployer_7 = '0xa24e8cE77D4A7Ce869DA3730e6560BfB66553F94' %} +{% set weth_contract_address = '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' %} +{% set usdc_contract_address = '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' %} +{% set fee_recipient_1 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set fee_recipient_2 = '0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad' %} + +with + bot_contracts as ( + select address + from {{ source('arbitrum', 'creation_traces') }} + where + ( + "from" = {{ deployer_1 }} + or "from" = {{ deployer_2 }} + or "from" = {{ deployer_3 }} + or "from" = {{ deployer_4 }} + or "from" = {{ deployer_5 }} + or "from" = {{ deployer_6 }} + or "from" = {{ deployer_7 }} + ) + and block_time >= timestamp '{{project_start_date}}' + ), + bot_trades as ( + select + trades.block_time, + amount_usd, + if(token_sold_address = {{ weth_contract_address }}, 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + project, + version, + token_pair, + project_contract_address, + tx_from as user, + tx_to as bot, + trades.tx_hash, + evt_index + from {{ source('dex', 'trades') }} as trades + join bot_contracts on trades.tx_to = bot_contracts.address + where + trades.blockchain = '{{blockchain}}' + and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }}) + {% if is_incremental() %} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ), + highest_event_index_for_each_trade as ( + select tx_hash, max(evt_index) as highest_event_index + from bot_trades + group by tx_hash + ), + fee_deposits as ( + select + evt_tx_hash, + value as fee_token_amount, + contract_address as fee_token_address + from {{ source('erc20_arbitrum', 'evt_transfer') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and evt_block_time >= timestamp '{{project_start_date}}' + and value > 0 + and ( + contract_address = {{ weth_contract_address }} + or contract_address = {{ usdc_contract_address }} + ) + union all + select + tx_hash, + value as fee_token_amount, + {{ weth_contract_address }} as fee_token_address + from {{ source('arbitrum', 'traces') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and block_time >= timestamp '{{project_start_date}}' + and value > 0 + + ) +select distinct + block_time, + date_trunc('day', block_time) as block_date, + date_trunc('month', block_time) as block_month, + '{{blockchain}}' as blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + cast(token_bought_address as varchar) as token_bought_address, + token_sold_amount, + token_sold_symbol, + cast(token_sold_address as varchar) as token_sold_address, + -- Fees + fee_token_amount / power(10, decimals) * price as fee_usd, + fee_token_amount / power(10, decimals) as fee_token_amount, + symbol as fee_token_symbol, + cast(fee_token_address as varchar) as fee_token_address, + -- Dex + project, + version, + token_pair, + cast(project_contract_address as varchar) as project_contract_address, + -- User + cast(user as varchar) as user, + cast(bot_trades.tx_hash as varchar) as tx_hash, + evt_index, + if(evt_index = highest_event_index, true, false) as is_last_trade_in_transaction +from bot_trades +join + highest_event_index_for_each_trade + on bot_trades.tx_hash = highest_event_index_for_each_trade.tx_hash +/* Left Outer Join to support 0 fee trades */ +left join fee_deposits on bot_trades.tx_hash = fee_deposits.evt_tx_hash +left join + {{ source('prices', 'usd') }} + on ( + blockchain = '{{blockchain}}' + and contract_address = fee_token_address + and minute = date_trunc('minute', block_time) + ) +order by block_time desc, evt_index desc diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/avalanche_c/chain_swap_avalanche_c_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/avalanche_c/chain_swap_avalanche_c_trades.sql new file mode 100644 index 00000000000..d66064471be --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/avalanche_c/chain_swap_avalanche_c_trades.sql @@ -0,0 +1,150 @@ +{{ + config( + alias='trades', + schema='chain_swap_avalanche_c', + partition_by=['block_month'], + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + incremental_predicates=[ + incremental_predicate('DBT_INTERNAL_DEST.block_time') + ], + unique_key=['blockchain', 'tx_hash', 'evt_index'], + ) +}} + +{% set project_start_date = '2024-03-28' %} +{% set blockchain = 'avalanche_c' %} +{% set deployer_1 = '0x9eC1ACAe39d07E1e8D8B3cEbe7022790D87D744A' %} +{% set deployer_2 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set deployer_3 = '0xc1cc1a300Dcfe5359eBe37f2007A77d1F91533ba' %} +{% set deployer_4 = '0xa24e8cE77D4A7Ce869DA3730e6560BfB66553F94' %} +{% set wavax_contract_address = '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7' %} +{% set usdc_contract_address = '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E' %} +{% set fee_recipient_1 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set fee_recipient_2 = '0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad' %} + +with + bot_contracts as ( + select address + from {{ source('avalanche_c', 'creation_traces') }} + where + ( + "from" = {{ deployer_1 }} + or "from" = {{ deployer_2 }} + or "from" = {{ deployer_3 }} + or "from" = {{ deployer_4 }} + ) + and block_time >= timestamp '{{project_start_date}}' + ), + bot_trades as ( + select + trades.block_time, + amount_usd, + if(token_sold_address = {{ wavax_contract_address }}, 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + project, + version, + token_pair, + project_contract_address, + tx_from as user, + tx_to as bot, + trades.tx_hash, + evt_index + from {{ source('dex', 'trades') }} as trades + join bot_contracts on trades.tx_to = bot_contracts.address + where + trades.blockchain = '{{blockchain}}' + and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }}) + {% if is_incremental() %} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ), + highest_event_index_for_each_trade as ( + select tx_hash, max(evt_index) as highest_event_index + from bot_trades + group by tx_hash + ), + fee_deposits as ( + select + evt_tx_hash, + value as fee_token_amount, + contract_address as fee_token_address + from {{ source('erc20_avalanche_c', 'evt_transfer') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + and ( + contract_address = {{ wavax_contract_address }} + or contract_address = {{ usdc_contract_address }} + ) + {% if is_incremental() %} + and {{ incremental_predicate('evt_block_time') }} + {% else %} + and evt_block_time >= timestamp '{{project_start_date}}' + {% endif %} + union all + select + tx_hash, + value as fee_token_amount, + {{ wavax_contract_address }} as fee_token_address + from {{ source('avalanche_c', 'traces') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time >= timestamp '{{project_start_date}}' + {% endif %} + ) +select distinct + block_time, + date_trunc('day', block_time) as block_date, + date_trunc('month', block_time) as block_month, + '{{blockchain}}' as blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + cast(token_bought_address as varchar) as token_bought_address, + token_sold_amount, + token_sold_symbol, + cast(token_sold_address as varchar) as token_sold_address, + -- Fees + fee_token_amount / power(10, decimals) * price as fee_usd, + fee_token_amount / power(10, decimals) as fee_token_amount, + symbol as fee_token_symbol, + cast(fee_token_address as varchar) as fee_token_address, + -- Dex + project, + version, + token_pair, + cast(project_contract_address as varchar) as project_contract_address, + -- User + cast(user as varchar) as user, + cast(bot_trades.tx_hash as varchar) as tx_hash, + evt_index, + if(evt_index = highest_event_index, true, false) as is_last_trade_in_transaction +from bot_trades +join + highest_event_index_for_each_trade + on bot_trades.tx_hash = highest_event_index_for_each_trade.tx_hash +/* Left Outer Join to support 0 fee trades */ +left join fee_deposits on bot_trades.tx_hash = fee_deposits.evt_tx_hash +left join + {{ source('prices', 'usd') }} + on ( + blockchain = '{{blockchain}}' + and contract_address = fee_token_address + and minute = date_trunc('minute', block_time) + ) +order by block_time desc, evt_index desc diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/base/chain_swap_base_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/base/chain_swap_base_trades.sql new file mode 100644 index 00000000000..32ba14c0fb4 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/base/chain_swap_base_trades.sql @@ -0,0 +1,154 @@ +{{ + config( + alias='trades', + schema='chain_swap_base', + partition_by=['block_month'], + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + incremental_predicates=[ + incremental_predicate('DBT_INTERNAL_DEST.block_time') + ], + unique_key=['blockchain', 'tx_hash', 'evt_index'], + ) +}} + +{% set project_start_date = '2024-03-21' %} +{% set blockchain = 'base' %} +{% set deployer_1 = '0x9eC1ACAe39d07E1e8D8B3cEbe7022790D87D744A' %} +{% set deployer_2 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set deployer_3 = '0xc1cc1a300Dcfe5359eBe37f2007A77d1F91533ba' %} +{% set deployer_4 = '0x3A510C5a32bCb381c53704AED9c02b0c70041F7A' %} +{% set deployer_5 = '0xb252f0ab7bdf1be4d5bbf607eb5c220b2d902a2c' %} +{% set deployer_6 = '0xa24e8cE77D4A7Ce869DA3730e6560BfB66553F94' %} +{% set weth_contract_address = '0x4200000000000000000000000000000000000006' %} +{% set usdc_contract_address = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' %} +{% set fee_recipient_1 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set fee_recipient_2 = '0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad' %} + +with + bot_contracts as ( + select address + from {{ source('base', 'creation_traces') }} + where + ( + "from" = {{ deployer_1 }} + or "from" = {{ deployer_2 }} + or "from" = {{ deployer_3 }} + or "from" = {{ deployer_4 }} + or "from" = {{ deployer_5 }} + or "from" = {{ deployer_6 }} + ) + and block_time >= timestamp '{{project_start_date}}' + ), + bot_trades as ( + select + trades.block_time, + amount_usd, + if(token_sold_address = {{ weth_contract_address }}, 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + project, + version, + token_pair, + project_contract_address, + tx_from as user, + tx_to as bot, + trades.tx_hash, + evt_index + from {{ source('dex', 'trades') }} as trades + join bot_contracts on trades.tx_to = bot_contracts.address + where + trades.blockchain = '{{blockchain}}' + and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }}) + {% if is_incremental() %} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ), + highest_event_index_for_each_trade as ( + select tx_hash, max(evt_index) as highest_event_index + from bot_trades + group by tx_hash + ), + fee_deposits as ( + select + evt_tx_hash, + value as fee_token_amount, + contract_address as fee_token_address + from {{ source('erc20_base', 'evt_transfer') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + and ( + contract_address = {{ weth_contract_address }} + or contract_address = {{ usdc_contract_address }} + ) + {% if is_incremental() %} + and {{ incremental_predicate('evt_block_time') }} + {% else %} + and evt_block_time >= timestamp '{{project_start_date}}' + {% endif %} + union all + select + tx_hash, + value as fee_token_amount, + {{ weth_contract_address }} as fee_token_address + from {{ source('base', 'traces') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time >= timestamp '{{project_start_date}}' + {% endif %} + ) +select distinct + block_time, + date_trunc('day', block_time) as block_date, + date_trunc('month', block_time) as block_month, + '{{blockchain}}' as blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + cast(token_bought_address as varchar) as token_bought_address, + token_sold_amount, + token_sold_symbol, + cast(token_sold_address as varchar) as token_sold_address, + -- Fees + fee_token_amount / power(10, decimals) * price as fee_usd, + fee_token_amount / power(10, decimals) as fee_token_amount, + symbol as fee_token_symbol, + cast(fee_token_address as varchar) as fee_token_address, + -- Dex + project, + version, + token_pair, + cast(project_contract_address as varchar) as project_contract_address, + -- User + cast(user as varchar) as user, + cast(bot_trades.tx_hash as varchar) as tx_hash, + evt_index, + if(evt_index = highest_event_index, true, false) as is_last_trade_in_transaction +from bot_trades +join + highest_event_index_for_each_trade + on bot_trades.tx_hash = highest_event_index_for_each_trade.tx_hash +/* Left Outer Join to support 0 fee trades */ +left join fee_deposits on bot_trades.tx_hash = fee_deposits.evt_tx_hash +left join + {{ source('prices', 'usd') }} + on ( + blockchain = '{{blockchain}}' + and contract_address = fee_token_address + and minute = date_trunc('minute', block_time) + ) +order by block_time desc, evt_index desc diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/bnb/chain_swap_bnb_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/bnb/chain_swap_bnb_trades.sql new file mode 100644 index 00000000000..ab069893eaf --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/bnb/chain_swap_bnb_trades.sql @@ -0,0 +1,149 @@ +{{ + config( + alias='trades', + schema='chain_swap_bnb', + partition_by=['block_month'], + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + incremental_predicates=[ + incremental_predicate('DBT_INTERNAL_DEST.block_time') + ], + unique_key=['blockchain', 'tx_hash', 'evt_index'], + ) +}} + +{% set project_start_date = '2024-06-17' %} +{% set blockchain = 'bnb' %} +{% set deployer_1 = '0x1d32cFeFd97de9D740714A31b2E8C7bc34825442' %} +{% set deployer_2 = '0x3A510C5a32bCb381c53704AED9c02b0c70041F7A' %} +{% set deployer_3 = '0xa24e8cE77D4A7Ce869DA3730e6560BfB66553F94' %} +{% set wbnb_contract_address = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c' %} +{% set usdc_contract_address = '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d' %} +{% set fee_recipient_1 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set fee_recipient_2 = '0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad' %} + +with + bot_contracts as ( + select address + from {{ source('bnb', 'creation_traces') }} + where + ( + "from" = {{ deployer_1 }} + or "from" = {{ deployer_2 }} + or "from" = {{ deployer_3 }} + + ) + and block_time >= timestamp '{{project_start_date}}' + ), + bot_trades as ( + select + trades.block_time, + amount_usd, + if(token_sold_address = {{ wbnb_contract_address }}, 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + project, + version, + token_pair, + project_contract_address, + tx_from as user, + tx_to as bot, + trades.tx_hash, + evt_index + from {{ source('dex', 'trades') }} as trades + join bot_contracts on trades.tx_to = bot_contracts.address + where + trades.blockchain = '{{blockchain}}' + and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }}) + {% if is_incremental() %} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ), + highest_event_index_for_each_trade as ( + select tx_hash, max(evt_index) as highest_event_index + from bot_trades + group by tx_hash + ), + fee_deposits as ( + select + evt_tx_hash, + value as fee_token_amount, + contract_address as fee_token_address + from {{ source('erc20_bnb', 'evt_transfer') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + and ( + contract_address = {{ wbnb_contract_address }} + or contract_address = {{ usdc_contract_address }} + ) + {% if is_incremental() %} + and {{ incremental_predicate('evt_block_time') }} + {% else %} + and evt_block_time >= timestamp '{{project_start_date}}' + {% endif %} + union all + select + tx_hash, + value as fee_token_amount, + {{ wbnb_contract_address }} as fee_token_address + from {{ source('bnb', 'traces') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time >= timestamp '{{project_start_date}}' + {% endif %} + ) +select distinct + block_time, + date_trunc('day', block_time) as block_date, + date_trunc('month', block_time) as block_month, + '{{blockchain}}' as blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + cast(token_bought_address as varchar) as token_bought_address, + token_sold_amount, + token_sold_symbol, + cast(token_sold_address as varchar) as token_sold_address, + -- Fees + fee_token_amount / power(10, decimals) * price as fee_usd, + fee_token_amount / power(10, decimals) as fee_token_amount, + symbol as fee_token_symbol, + cast(fee_token_address as varchar) as fee_token_address, + -- Dex + project, + version, + token_pair, + cast(project_contract_address as varchar) as project_contract_address, + -- User + cast(user as varchar) as user, + cast(bot_trades.tx_hash as varchar) as tx_hash, + evt_index, + if(evt_index = highest_event_index, true, false) as is_last_trade_in_transaction +from bot_trades +join + highest_event_index_for_each_trade + on bot_trades.tx_hash = highest_event_index_for_each_trade.tx_hash +/* Left Outer Join to support 0 fee trades */ +left join fee_deposits on bot_trades.tx_hash = fee_deposits.evt_tx_hash +left join + {{ source('prices', 'usd') }} + on ( + blockchain = '{{blockchain}}' + and contract_address = fee_token_address + and minute = date_trunc('minute', block_time) + ) +order by block_time desc, evt_index desc diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/chain_swap_schema.yml b/dbt_subprojects/daily_spellbook/models/chainswap/chain_swap_schema.yml new file mode 100644 index 00000000000..caeec0006ce --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/chain_swap_schema.yml @@ -0,0 +1,380 @@ +version: 2 + +models: + - name: chain_swap_trades + meta: + blockchain: ethereum + sector: project + contributors: ["whale_hunter", "clizzard"] + config: + tags: ["ethereum", "dex", "bot", "trades"] + description: > + Trades by trading bots on Ethereum + columns: + - &blockchain + name: blockchain + description: "Blockchain which the DEX is deployed" + - &block_time + name: block_time + description: "UTC event block time of each DEX trade" + - &block_date + name: block_date + description: "UTC event block date of each DEX trade" + - &block_month + name: block_month + description: "UTC event block month of each DEX trade" + - &amount_usd + name: amount_usd + description: "USD value of the trade at time of execution" + - &type + name: type + description: "Wether the trade is a buy or sell" + - &token_bought_amount + name: token_bought_amount + description: "Value of the token bought at time of execution in the original currency" + - &token_bought_symbol + name: token_bought_symbol + description: "Token symbol for token bought in the trade" + - &token_bought_address + name: token_bought_address + description: "Contract address of the token bought" + - &token_sold_amount + name: token_sold_amount + description: "Value of the token sold at time of execution in the original currency" + - &token_sold_symbol + name: token_sold_symbol + description: "Token symbol for token sold in the trade" + - &token_sold_address + name: token_sold_address + description: "Contract address of the token sold" + - &fee_usd + name: fee_usd + description: "USD value of the fee at time of execution" + - &fee_token_amount + name: fee_token_amount + description: "Value of the fee paid at time of execution in the original currency" + - &fee_token_symbol + name: fee_token_symbol + description: "Token symbol for fee token" + - &fee_token_address + name: fee_token_address + description: "Contract address of the fee token" + - &project + name: project + description: "Project name of the DEX" + - &version + name: version + description: "Version of the contract built and deployed by the DEX project" + - &token_pair + name: token_pair + description: "Token symbol pair for each token involved in the trade" + - &project_contract_address + name: project_contract_address + description: "Project contract address which executed the trade on the blockchain" + - &user + name: user + description: "Address which initiated the trade" + - &tx_hash + name: tx_hash + description: "Unique transaction hash value tied to each transaction on the DEX" + - &evt_index + name: evt_index + description: "Index of the corresponding trade event" + - &is_last_trade_in_transaction + name: is_last_trade_in_transaction + description: "Wether the trade is the last hop of the trade transaction, in case of a multi-hop trade" + + - name: chain_swap_ethereum_trades + meta: + blockchain: ethereum + sector: project + project: chain_swap + contributors: whale_hunter + config: + tags: ["ethereum", "dex", "chain_swap", "trades"] + description: > + ChainSwap trades on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - evt_index + columns: + - *blockchain + - *block_time + - *block_date + - *block_month + - *amount_usd + - *type + - *token_bought_amount + - *token_bought_symbol + - *token_bought_address + - *token_sold_amount + - *token_sold_symbol + - *token_sold_address + - *fee_usd + - *fee_token_amount + - *fee_token_symbol + - *fee_token_address + - *project + - *version + - *token_pair + - *project_contract_address + - *user + - *tx_hash + - *evt_index + - *is_last_trade_in_transaction + + - name: chain_swap_arbitrum_trades + meta: + blockchain: arbitrum + sector: project + project: chain_swap + contributors: whale_hunter + config: + tags: ["arbitrum", "dex", "chain_swap", "trades"] + description: > + ChainSwap trades on Arbitrum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - evt_index + columns: + - *blockchain + - *block_time + - *block_date + - *block_month + - *amount_usd + - *type + - *token_bought_amount + - *token_bought_symbol + - *token_bought_address + - *token_sold_amount + - *token_sold_symbol + - *token_sold_address + - *fee_usd + - *fee_token_amount + - *fee_token_symbol + - *fee_token_address + - *project + - *version + - *token_pair + - *project_contract_address + - *user + - *tx_hash + - *evt_index + - *is_last_trade_in_transaction + + - name: chain_swap_base_trades + meta: + blockchain: base + sector: project + project: chain_swap + contributors: whale_hunter + config: + tags: ["base", "dex", "chain_swap", "trades"] + description: > + ChainSwap trades on Base + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - evt_index + columns: + - *blockchain + - *block_time + - *block_date + - *block_month + - *amount_usd + - *type + - *token_bought_amount + - *token_bought_symbol + - *token_bought_address + - *token_sold_amount + - *token_sold_symbol + - *token_sold_address + - *fee_usd + - *fee_token_amount + - *fee_token_symbol + - *fee_token_address + - *project + - *version + - *token_pair + - *project_contract_address + - *user + - *tx_hash + - *evt_index + - *is_last_trade_in_transaction + + - name: chain_swap_optimism_trades + meta: + blockchain: optimism + sector: project + project: chain_swap + contributors: whale_hunter + config: + tags: ["optimism", "dex", "chain_swap", "trades"] + description: > + ChainSwap trades on Optimism + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - evt_index + columns: + - *blockchain + - *block_time + - *block_date + - *block_month + - *amount_usd + - *type + - *token_bought_amount + - *token_bought_symbol + - *token_bought_address + - *token_sold_amount + - *token_sold_symbol + - *token_sold_address + - *fee_usd + - *fee_token_amount + - *fee_token_symbol + - *fee_token_address + - *project + - *version + - *token_pair + - *project_contract_address + - *user + - *tx_hash + - *evt_index + - *is_last_trade_in_transaction + + - name: chain_swap_bnb_trades + meta: + blockchain: bnb + sector: project + project: chain_swap + contributors: whale_hunter + config: + tags: ["bnb", "dex", "chain_swap", "trades"] + description: > + ChainSwap trades on Bnb + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - evt_index + columns: + - *blockchain + - *block_time + - *block_date + - *block_month + - *amount_usd + - *type + - *token_bought_amount + - *token_bought_symbol + - *token_bought_address + - *token_sold_amount + - *token_sold_symbol + - *token_sold_address + - *fee_usd + - *fee_token_amount + - *fee_token_symbol + - *fee_token_address + - *project + - *version + - *token_pair + - *project_contract_address + - *user + - *tx_hash + - *evt_index + - *is_last_trade_in_transaction + + - name: chain_swap_polygon_trades + meta: + blockchain: polygon + sector: project + project: chain_swap + contributors: whale_hunter + config: + tags: ["polygon", "dex", "chain_swap", "trades"] + description: > + ChainSwap trades on Polygon + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - evt_index + columns: + - *blockchain + - *block_time + - *block_date + - *block_month + - *amount_usd + - *type + - *token_bought_amount + - *token_bought_symbol + - *token_bought_address + - *token_sold_amount + - *token_sold_symbol + - *token_sold_address + - *fee_usd + - *fee_token_amount + - *fee_token_symbol + - *fee_token_address + - *project + - *version + - *token_pair + - *project_contract_address + - *user + - *tx_hash + - *evt_index + - *is_last_trade_in_transaction + + - name: chain_swap_avalanche_c_trades + meta: + blockchain: avalanche_c + sector: project + project: chain_swap + contributors: whale_hunter + config: + tags: ["avalanche_c", "dex", "chain_swap", "trades"] + description: > + ChainSwap trades on Avalanche_c + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - evt_index + + columns: + - *blockchain + - *block_time + - *block_date + - *block_month + - *amount_usd + - *type + - *token_bought_amount + - *token_bought_symbol + - *token_bought_address + - *token_sold_amount + - *token_sold_symbol + - *token_sold_address + - *fee_usd + - *fee_token_amount + - *fee_token_symbol + - *fee_token_address + - *project + - *version + - *token_pair + - *project_contract_address + - *user + - *tx_hash + - *evt_index + - *is_last_trade_in_transaction \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/chain_swap_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/chain_swap_trades.sql new file mode 100644 index 00000000000..302e5d869be --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/chain_swap_trades.sql @@ -0,0 +1,59 @@ +{{ + config( + schema = 'trades', + alias = 'chain_swap', + materialized = 'view', + post_hook = '{{ expose_spells( + blockchains = \'["ethereum", "base", "avalanche_c", "optimism","polygon", "bnb", "arbitrum"]\', + spell_type = "project", + spell_name = "chain_swap", + contributors = \'["whale_hunter","clizzard"]\') }}' + ) +}} + + + +{% set blockchains = [ + ref('chain_swap_ethereum_trades') + , ref('chain_swap_base_trades') + , ref('chain_swap_arbitrum_trades') + , ref('chain_swap_optimism_trades') + , ref('chain_swap_polygon_trades') + , ref('chain_swap_bnb_trades') + , ref('chain_swap_avalanche_c_trades') +] %} + +{% for blockchain in blockchains %} +SELECT block_time, + block_date, + block_month, + blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + -- Fees + fee_usd, + fee_token_amount, + fee_token_symbol, + fee_token_address, + -- Dex + project, + version, + token_pair, + project_contract_address, + -- User + user, + tx_hash, + evt_index, + is_last_trade_in_transaction +FROM {{ blockchain }} +{% if not loop.last %} +UNION ALL +{% endif %} +{% endfor %} \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/ethereum/chain_swap_ethereum_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/ethereum/chain_swap_ethereum_trades.sql new file mode 100644 index 00000000000..073195a8c12 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/ethereum/chain_swap_ethereum_trades.sql @@ -0,0 +1,152 @@ +{{ + config( + alias="trades", + schema="chain_swap_ethereum", + partition_by=["block_month"], + materialized="incremental", + file_format="delta", + incremental_strategy="merge", + incremental_predicates=[ + incremental_predicate("DBT_INTERNAL_DEST.block_time") + ], + unique_key=["blockchain", "tx_hash", "evt_index"], + ) +}} + +{% set project_start_date = "2024-03-28" %} +{% set blockchain = "ethereum" %} +{% set deployer_1 = "0x9eC1ACAe39d07E1e8D8B3cEbe7022790D87D744A" %} +{% set deployer_2 = "0x415EEc63c95e944D544b3088bc682B759edB8548" %} +{% set deployer_3 = "0xc1cc1a300Dcfe5359eBe37f2007A77d1F91533ba" %} +{% set deployer_4 = "0x3A510C5a32bCb381c53704AED9c02b0c70041F7A" %} +{% set deployer_5 = "0xa24e8cE77D4A7Ce869DA3730e6560BfB66553F94" %} +{% set weth_contract_address = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" %} +{% set usdc_contract_address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" %} +{% set fee_recipient_1 = "0x415EEc63c95e944D544b3088bc682B759edB8548" %} +{% set fee_recipient_2 = "0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad" %} + +with + bot_contracts as ( + select address + from {{ source("ethereum", "creation_traces") }} + where + ( + "from" = {{ deployer_1 }} + or "from" = {{ deployer_2 }} + or "from" = {{ deployer_3 }} + or "from" = {{ deployer_4 }} + or "from" = {{ deployer_5 }} + ) + and block_time >= timestamp '{{project_start_date}}' + ), + bot_trades as ( + select + trades.block_time, + amount_usd, + if(token_sold_address = {{ weth_contract_address }}, 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + project, + version, + token_pair, + project_contract_address, + tx_from as user, + tx_to as bot, + trades.tx_hash, + evt_index + from {{ source("dex", "trades") }} as trades + join bot_contracts on trades.tx_to = bot_contracts.address + where + trades.blockchain = '{{blockchain}}' + and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }}) + {% if is_incremental() %} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ), + highest_event_index_for_each_trade as ( + select tx_hash, max(evt_index) as highest_event_index + from bot_trades + group by tx_hash + ), + fee_deposits as ( + select + evt_tx_hash, + value as fee_token_amount, + contract_address as fee_token_address + from {{ source("erc20_ethereum", "evt_transfer") }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + and ( + contract_address = {{ weth_contract_address }} + or contract_address = {{ usdc_contract_address }} + ) + {% if is_incremental() %} + and {{ incremental_predicate('evt_block_time') }} + {% else %} + and evt_block_time >= timestamp '{{project_start_date}}' + {% endif %} + union all + select + tx_hash, + value as fee_token_amount, + {{ weth_contract_address }} as fee_token_address + from {{ source("ethereum", "traces") }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time >= timestamp '{{project_start_date}}' + {% endif %} + ) +select distinct + block_time, + date_trunc('day', block_time) as block_date, + date_trunc('month', block_time) as block_month, + '{{blockchain}}' as blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + cast(token_bought_address as varchar) as token_bought_address, + token_sold_amount, + token_sold_symbol, + cast(token_sold_address as varchar) as token_sold_address, + -- Fees + fee_token_amount / power(10, decimals) * price as fee_usd, + fee_token_amount / power(10, decimals) as fee_token_amount, + symbol as fee_token_symbol, + cast(fee_token_address as varchar) as fee_token_address, + -- Dex + project, + version, + token_pair, + cast(project_contract_address as varchar) as project_contract_address, + -- User + cast(user as varchar) as user, + cast(bot_trades.tx_hash as varchar) as tx_hash, + evt_index, + if(evt_index = highest_event_index, true, false) as is_last_trade_in_transaction +from bot_trades +join + highest_event_index_for_each_trade + on bot_trades.tx_hash = highest_event_index_for_each_trade.tx_hash +/* Left Outer Join to support 0 fee trades */ +left join fee_deposits on bot_trades.tx_hash = fee_deposits.evt_tx_hash +left join + {{ source("prices", "usd") }} + on ( + blockchain = '{{blockchain}}' + and contract_address = fee_token_address + and minute = date_trunc('minute', block_time) + ) +order by block_time desc, evt_index desc diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/optimism/chain_swap_optimism_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/optimism/chain_swap_optimism_trades.sql new file mode 100644 index 00000000000..db7bb3f0001 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/optimism/chain_swap_optimism_trades.sql @@ -0,0 +1,156 @@ +{{ + config( + alias='trades', + schema='chain_swap_optimism', + partition_by=['block_month'], + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + incremental_predicates=[ + incremental_predicate('DBT_INTERNAL_DEST.block_time') + ], + unique_key=['blockchain', 'tx_hash', 'evt_index'], + ) +}} + +{% set project_start_date = '2024-03-21' %} +{% set blockchain = 'optimism' %} +{% set deployer_1 = '0xB7B953e81612c57256fF0aebD62B6a2F0546F7dA' %} +{% set deployer_2 = '0xb252f0Ab7BDF1bE4d5BBf607EB5c220B2D902a2C' %} +{% set deployer_3 = '0xc1cc1a300Dcfe5359eBe37f2007A77d1F91533ba' %} +{% set deployer_4 = '0x3A510C5a32bCb381c53704AED9c02b0c70041F7A' %} +{% set deployer_5 = '0x9eC1ACAe39d07E1e8D8B3cEbe7022790D87D744A' %} +{% set deployer_6 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set deployer_7 = '0xa24e8cE77D4A7Ce869DA3730e6560BfB66553F94' %} +{% set weth_contract_address = '0x4200000000000000000000000000000000000006' %} +{% set usdc_contract_address = '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85' %} +{% set fee_recipient_1 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set fee_recipient_2 = '0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad' %} + +with + bot_contracts as ( + select address + from {{ source('optimism', 'creation_traces') }} + where + ( + "from" = {{ deployer_1 }} + or "from" = {{ deployer_2 }} + or "from" = {{ deployer_3 }} + or "from" = {{ deployer_4 }} + or "from" = {{ deployer_5 }} + or "from" = {{ deployer_6 }} + or "from" = {{ deployer_7 }} + ) + and block_time >= timestamp '{{project_start_date}}' + ), + bot_trades as ( + select + trades.block_time, + amount_usd, + if(token_sold_address = {{ weth_contract_address }}, 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + project, + version, + token_pair, + project_contract_address, + tx_from as user, + tx_to as bot, + trades.tx_hash, + evt_index + from {{ source('dex', 'trades') }} as trades + join bot_contracts on trades.tx_to = bot_contracts.address + where + trades.blockchain = '{{blockchain}}' + and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }}) + {% if is_incremental() %} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ), + highest_event_index_for_each_trade as ( + select tx_hash, max(evt_index) as highest_event_index + from bot_trades + group by tx_hash + ), + fee_deposits as ( + select + evt_tx_hash, + value as fee_token_amount, + contract_address as fee_token_address + from {{ source('erc20_optimism', 'evt_transfer') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + and ( + contract_address = {{ weth_contract_address }} + or contract_address = {{ usdc_contract_address }} + ) + {% if is_incremental() %} + and {{ incremental_predicate('evt_block_time') }} + {% else %} + and evt_block_time >= timestamp '{{project_start_date}}' + {% endif %} + union all + select + tx_hash, + value as fee_token_amount, + {{ weth_contract_address }} as fee_token_address + from {{ source('optimism', 'traces') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time >= timestamp '{{project_start_date}}' + {% endif %} + ) +select distinct + block_time, + date_trunc('day', block_time) as block_date, + date_trunc('month', block_time) as block_month, + '{{blockchain}}' as blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + cast(token_bought_address as varchar) as token_bought_address, + token_sold_amount, + token_sold_symbol, + cast(token_sold_address as varchar) as token_sold_address, + -- Fees + fee_token_amount / power(10, decimals) * price as fee_usd, + fee_token_amount / power(10, decimals) as fee_token_amount, + symbol as fee_token_symbol, + cast(fee_token_address as varchar) as fee_token_address, + -- Dex + project, + version, + token_pair, + cast(project_contract_address as varchar) as project_contract_address, + -- User + cast(user as varchar) as user, + cast(bot_trades.tx_hash as varchar) as tx_hash, + evt_index, + if(evt_index = highest_event_index, true, false) as is_last_trade_in_transaction +from bot_trades +join + highest_event_index_for_each_trade + on bot_trades.tx_hash = highest_event_index_for_each_trade.tx_hash +/* Left Outer Join to support 0 fee trades */ +left join fee_deposits on bot_trades.tx_hash = fee_deposits.evt_tx_hash +left join + {{ source('prices', 'usd') }} + on ( + blockchain = '{{blockchain}}' + and contract_address = fee_token_address + and minute = date_trunc('minute', block_time) + ) +order by block_time desc, evt_index desc diff --git a/dbt_subprojects/daily_spellbook/models/chainswap/polygon/chain_swap_polygon_trades.sql b/dbt_subprojects/daily_spellbook/models/chainswap/polygon/chain_swap_polygon_trades.sql new file mode 100644 index 00000000000..01556b7a6bf --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/chainswap/polygon/chain_swap_polygon_trades.sql @@ -0,0 +1,156 @@ +{{ + config( + alias='trades', + schema='chain_swap_polygon', + partition_by=['block_month'], + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + incremental_predicates=[ + incremental_predicate('DBT_INTERNAL_DEST.block_time') + ], + unique_key=['blockchain', 'tx_hash', 'evt_index'], + ) +}} + +{% set project_start_date = '2024-03-21' %} +{% set blockchain = 'polygon' %} +{% set deployer_1 = '0x9eC1ACAe39d07E1e8D8B3cEbe7022790D87D744A' %} +{% set deployer_2 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set deployer_3 = '0xc1cc1a300Dcfe5359eBe37f2007A77d1F91533ba' %} +{% set deployer_4 = '0x3A510C5a32bCb381c53704AED9c02b0c70041F7A' %} +{% set deployer_5 = '0xB7B953e81612c57256fF0aebD62B6a2F0546F7dA' %} +{% set deployer_6 = '0xa24e8cE77D4A7Ce869DA3730e6560BfB66553F94' %} +{% set wmatic_contract_address = '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270' %} +{% set usdc_contract_address = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359' %} +{% set fee_recipient_1 = '0x415EEc63c95e944D544b3088bc682B759edB8548' %} +{% set fee_recipient_2 = '0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad' %} + +with + bot_contracts as ( + select address + from {{ source('polygon', 'creation_traces') }} + where + ( + "from" = {{ deployer_1 }} + or "from" = {{ deployer_2 }} + or "from" = {{ deployer_3 }} + or "from" = {{ deployer_4 }} + or "from" = {{ deployer_5 }} + or "from" = {{ deployer_6 }} + ) + and block_time >= timestamp '{{project_start_date}}' + ), + bot_trades as ( + select + trades.block_time, + amount_usd, + if(token_sold_address = {{ wmatic_contract_address }}, 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + project, + version, + token_pair, + project_contract_address, + tx_from as user, + tx_to as bot, + trades.tx_hash, + evt_index + from {{ source('dex', 'trades') }} as trades + join bot_contracts on trades.tx_to = bot_contracts.address + where + trades.blockchain = '{{blockchain}}' + and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }}) + {% if is_incremental() %} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ), + highest_event_index_for_each_trade as ( + select tx_hash, max(evt_index) as highest_event_index + from bot_trades + group by tx_hash + ), + fee_deposits as ( + select + evt_tx_hash, + value as fee_token_amount, + contract_address as fee_token_address + from {{ source('erc20_polygon', 'evt_transfer') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + and ( + contract_address = {{ wmatic_contract_address }} + or contract_address = {{ usdc_contract_address }} + ) + {% if is_incremental() %} + and {{ incremental_predicate('evt_block_time') }} + {% else %} + and evt_block_time >= timestamp '{{project_start_date}}' + {% endif %} + union all + select + tx_hash, + value as fee_token_amount, + {{ wmatic_contract_address }} as fee_token_address + from {{ source('polygon', 'traces') }} + where + (to = {{ fee_recipient_1 }} or to = {{ fee_recipient_2 }}) + and value > 0 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time >= timestamp '{{project_start_date}}' + {% endif %} + ) + + +select distinct + block_time, + date_trunc('day', block_time) as block_date, + date_trunc('month', block_time) as block_month, + '{{blockchain}}' as blockchain, + -- Trade + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + cast(token_bought_address as varchar) as token_bought_address, + token_sold_amount, + token_sold_symbol, + cast(token_sold_address as varchar) as token_sold_address, + -- Fees + fee_token_amount / power(10, decimals) * price as fee_usd, + fee_token_amount / power(10, decimals) as fee_token_amount, + symbol as fee_token_symbol, + cast(fee_token_address as varchar) as fee_token_address, + -- Dex + project, + version, + token_pair, + cast(project_contract_address as varchar) as project_contract_address, + -- User + cast(user as varchar) as user, + cast(bot_trades.tx_hash as varchar) as tx_hash, + evt_index, + if(evt_index = highest_event_index, true, false) as is_last_trade_in_transaction +from bot_trades +join + highest_event_index_for_each_trade + on bot_trades.tx_hash = highest_event_index_for_each_trade.tx_hash +/* Left Outer Join to support 0 fee trades */ +left join fee_deposits on bot_trades.tx_hash = fee_deposits.evt_tx_hash +left join + {{ source('prices', 'usd') }} + on ( + blockchain = '{{blockchain}}' + and contract_address = fee_token_address + and minute = date_trunc('minute', block_time) + ) +order by block_time desc, evt_index desc diff --git a/dbt_subprojects/daily_spellbook/models/dex/dex_flashloans.sql b/dbt_subprojects/daily_spellbook/models/dex/dex_flashloans.sql index 3323b357e12..9d6cf4d2305 100644 --- a/dbt_subprojects/daily_spellbook/models/dex/dex_flashloans.sql +++ b/dbt_subprojects/daily_spellbook/models/dex/dex_flashloans.sql @@ -2,10 +2,7 @@ schema = 'dex', alias = 'flashloans', partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - unique_key = ['blockchain', 'tx_hash', 'evt_index'], + materialized = 'view', post_hook='{{ expose_spells(\'["ethereum", "bnb", "avalanche_c", "optimism", "arbitrum", "fantom", "polygon"]\', "sector", "dex", diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transfersbatch.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transfersbatch.sql index 369d0c3e0a6..6a7e7d540d2 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transfersbatch.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transfersbatch.sql @@ -16,7 +16,7 @@ , ('avalanche_c', source('erc1155_avalanche_c', 'evt_transferbatch')) , ('gnosis', source('erc1155_gnosis', 'evt_transferbatch')) , ('fantom', source('erc1155_fantom', 'evt_transferbatch')) - , ('optimism', source('erc1155_optimism', 'evt_transferbatch')) + , ('optimism', source('erc1155_optimism', 'evt_TransferBatch')) , ('arbitrum', source('erc1155_arbitrum', 'evt_transferbatch')) , ('celo', source('erc1155_celo', 'evt_transferbatch')) , ('base', source('erc1155_base', 'evt_transferbatch')) diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transferssingle.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transferssingle.sql index 399ac930c5b..6220f852155 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transferssingle.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_erc1155_transferssingle.sql @@ -16,7 +16,7 @@ , ('avalanche_c', source('erc1155_avalanche_c', 'evt_transfersingle')) , ('gnosis', source('erc1155_gnosis', 'evt_transfersingle')) , ('fantom', source('erc1155_fantom', 'evt_transfersingle')) - , ('optimism', source('erc1155_optimism', 'evt_transfersingle')) + , ('optimism', source('erc1155_optimism', 'evt_TransferSingle')) , ('arbitrum', source('erc1155_arbitrum', 'evt_transfersingle')) , ('celo', source('erc1155_celo', 'evt_transfersingle')) , ('base', source('erc1155_base', 'evt_transfersingle')) diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_erc721_transfers.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_erc721_transfers.sql index c7c7e0f68cf..10684283625 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_erc721_transfers.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_erc721_transfers.sql @@ -16,7 +16,7 @@ , ('avalanche_c', source('erc721_avalanche_c', 'evt_transfer')) , ('gnosis', source('erc721_gnosis', 'evt_transfer')) , ('fantom', source('erc721_fantom', 'evt_transfer')) - , ('optimism', source('erc721_optimism', 'evt_transfer')) + , ('optimism', source('erc721_optimism', 'evt_Transfer')) , ('arbitrum', source('erc721_arbitrum', 'evt_transfer')) , ('celo', source('erc721_celo', 'evt_transfer')) , ('base', source('erc721_base', 'evt_transfer')) diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql index e7e953767fe..bc41e273624 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql @@ -27,7 +27,7 @@ FROM ( , (42161, 'arbitrum', 'Arbitrum One', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 'https://arbiscan.io/', timestamp '2021-05-29 00:35', 'Arbitrum', 'Ethereum Blobs', 'Ethereum') , (10, 'optimism', 'OP Mainnet', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x4200000000000000000000000000000000000006, 'https://explorer.optimism.io/', timestamp '2021-11-11 21:16', 'OP Stack', 'Ethereum Blobs', 'Ethereum') , (100, 'gnosis', 'Gnosis', 'Layer 1', NULL, 'xDAI', 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d, 'https://gnosisscan.io/', timestamp '2018-10-08 18:43', NULL, NULL, NULL) - , (137, 'polygon', 'Polygon PoS', 'Layer 1', NULL, 'MATIC', 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270, 'https://polygonscan.com/', timestamp '2020-05-30 16:30', NULL, NULL, NULL) + , (137, 'polygon', 'Polygon PoS', 'Layer 1', NULL, 'POL', 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270, 'https://polygonscan.com/', timestamp '2020-05-30 16:30', NULL, NULL, NULL) , (250, 'fantom', 'Fantom', 'Layer 1', NULL, 'FTM', 0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83, 'https://ftmscan.com/', timestamp '2019-12-27 03:56', NULL, NULL, NULL) , (56, 'bnb', 'BNB', 'Layer 1', NULL, 'BNB', 0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c, 'https://bscscan.com/', timestamp '2020-08-29 03:24', NULL, NULL, NULL) , (5, 'goerli', 'Goerli', 'Testnet', NULL, 'tETH', 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6, 'https://goerli.etherscan.io/', timestamp '2015-07-30 03:26', NULL, NULL, NULL) diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_transactions.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_transactions.sql index bde8861a96c..34f11fe2ce6 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_transactions.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_transactions.sql @@ -61,7 +61,7 @@ FROM ( , "type" , CAST(value AS double) AS value --Logic for L2s - {% if transactions_model[0] in all_op_chains() or transactions_model[0] == 'scroll' %} + {% if transactions_model[0] in all_op_chains() + ('scroll','mantle','blast') %} , l1_tx_origin , l1_fee_scalar , l1_block_number diff --git a/dbt_subprojects/daily_spellbook/models/galxe/optimism/galxe_optimism_nft_mints.sql b/dbt_subprojects/daily_spellbook/models/galxe/optimism/galxe_optimism_nft_mints.sql index 50dba77f327..2b28bfd1ebe 100644 --- a/dbt_subprojects/daily_spellbook/models/galxe/optimism/galxe_optimism_nft_mints.sql +++ b/dbt_subprojects/daily_spellbook/models/galxe/optimism/galxe_optimism_nft_mints.sql @@ -31,7 +31,7 @@ SELECT FROM {{source('optimism','transactions')}} t -INNER JOIN {{source('erc721_optimism','evt_transfer')}} tfer +INNER JOIN {{source('erc721_optimism','evt_Transfer')}} tfer ON t.hash = tfer.evt_tx_hash AND t.block_number = tfer.evt_block_number AND tfer."from" = 0x0000000000000000000000000000000000000000 --mint diff --git a/dbt_subprojects/daily_spellbook/models/gyroscope/gyroscope_gyro_tokens.sql b/dbt_subprojects/daily_spellbook/models/gyroscope/gyroscope_gyro_tokens.sql index 6bdfb9b7498..cc7cf42684d 100644 --- a/dbt_subprojects/daily_spellbook/models/gyroscope/gyroscope_gyro_tokens.sql +++ b/dbt_subprojects/daily_spellbook/models/gyroscope/gyroscope_gyro_tokens.sql @@ -9,6 +9,8 @@ WITH gyro_tokens as ( SELECT * FROM (values (0x7CFaDFD5645B50bE87d546f42699d863648251ad, 'stataArbUSDCn', 6, 'arbitrum'), (0xb165a74407fE1e519d6bCbDeC1Ed3202B35a4140, 'stataArbUSDT', 6, 'arbitrum'), + (0xD9FBA68D89178e3538e708939332c79efC540179, 'stataArbGHO', 18, 'arbitrum'), + (0x89AEc2023f89E26Dbb7eaa7a98fe3996f9d112A8, 'stataArbFRAX', 18, 'arbitrum'), (0x4EA71A20e655794051D1eE8b6e4A3269B13ccaCc, 'stataBasUSDC', 6, 'base'), (0x270ba1f35d8b87510d24f693fccc0da02e6e4eeb, 'stataGnoUSDC', 6, 'base'), (0x862c57d48becB45583AEbA3f489696D22466Ca1b, 'stataEthUSDT', 6, 'ethereum'), diff --git a/dbt_subprojects/daily_spellbook/models/jelly_swap/sei/jelly_swap_sei_pools_metrics_daily.sql b/dbt_subprojects/daily_spellbook/models/jelly_swap/sei/jelly_swap_sei_pools_metrics_daily.sql new file mode 100644 index 00000000000..ee53d7c5fd6 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/jelly_swap/sei/jelly_swap_sei_pools_metrics_daily.sql @@ -0,0 +1,82 @@ +{{ config( + schema = 'jelly_swap_sei', + alias = 'pools_metrics_daily', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_date', 'blockchain', 'project', 'version', 'project_contract_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_date')], + post_hook='{{ expose_spells(blockchains = \'["arbitrum", "avalanche_c", "base", "ethereum", "gnosis", "optimism", "polygon", "zkevm"]\', + spell_type = "project", + spell_name = "jelly_swap_sei", + contributors = \'["viniabussafi", "metacrypto"]\') }}' + ) +}} + + +WITH +trades AS( + SELECT + block_date, + version, + blockchain, + project_contract_address, + sum(amount_usd) AS swap_amount_usd + FROM {{ source('jelly_swap', 'trades') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_date')}} + {% endif %} + GROUP BY 1, 2, 3, 4 +), + +liquidity AS( + SELECT + day AS block_date, + blockchain, + version, + pool_address AS project_contract_address, + pool_type, + pool_symbol, + sum(pool_liquidity_usd) AS tvl_usd, + sum(pool_liquidity_eth) AS tvl_eth + FROM {{ ref('jelly_swap_sei_liquidity') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('day')}} + {% endif %} + GROUP BY 1, 2, 3, 4, 5, 6 +), + +fees AS( + SELECT + day, + version, + blockchain, + pool_address, + sum(protocol_fee_collected_usd) AS fee_amount_usd + FROM {{ ref('jelly_swap_sei_protocol_fee') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('day')}} + {% endif %} + GROUP BY 1, 2, 3, 4 +) + +SELECT + l.blockchain, + 'jelly_swap_sei' AS project, + l.version, + l.block_date, + l.project_contract_address, + l.pool_symbol, + l.pool_type, + t.swap_amount_usd, + l.tvl_usd, + l.tvl_eth, + f.fee_amount_usd +FROM liquidity l +LEFT JOIN trades t ON l.block_date = t.block_date +AND l.project_contract_address = t.project_contract_address +AND l.blockchain = t.blockchain +LEFT JOIN fees f ON l.block_date = f.day +AND l.project_contract_address = f.pool_address +AND l.blockchain = f.blockchain +ORDER BY 1 DESC, 7 DESC diff --git a/dbt_subprojects/daily_spellbook/models/jelly_swap/sei/jelly_swap_sei_schema.yml b/dbt_subprojects/daily_spellbook/models/jelly_swap/sei/jelly_swap_sei_schema.yml index 4fdbce28476..fecc0c2a715 100644 --- a/dbt_subprojects/daily_spellbook/models/jelly_swap/sei/jelly_swap_sei_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/jelly_swap/sei/jelly_swap_sei_schema.yml @@ -327,4 +327,43 @@ models: - name: version - name: token_address - name: daily_delta - description: "Daily total impact on BPT supply" \ No newline at end of file + description: "Daily total impact on BPT supply" + + - name: jelly_swap_sei_pools_metrics_daily + meta: + blockchain: sei + contributors: viniabussafi, metacrypto + config: + tags: ['sei', 'jelly_swap', 'pool', 'stats', 'volume', 'tvl', 'fee'] + description: > + This spell aggregates data from the trades, liquidity and protocol fees spells, by day and pool, while also displaying some basic information about the pool + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - blockchain + - project + - version + - project_contract_address + columns: + - *blockchain + - name: project + - name: version + - name: block_date + - &project_contract_address + name: project_contract_address + description: "Pool address" + - *pool_symbol + - name: pool_type + - &swap_amount_usd + name: swap_amount_usd + description: "Daily swap volume on a pool, in USD" + - &tvl_usd + name: tvl_usd + description: "Total Value Locked on a pool, in USD" + - &tvl_eth + name: tvl_eth + description: "Total Value Locked on a pool, in eth" + - &fee_amount_usd + name: fee_amount_usd + description: "Daily fees collected on a pool, in USD" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_totals.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_totals.sql index e5feb54ff1a..b4b68945a7e 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_totals.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_totals.sql @@ -380,4 +380,5 @@ select from daily_running_totals_enriched {% if is_incremental() %} where {{ incremental_predicate('block_date') }} + and 1=1 -- dummy change to trigger re-run {% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql index edbe7811be1..d9fafd5ad24 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql @@ -121,3 +121,4 @@ from transfer_nxmty_in union all select block_time, block_number, block_date, transfer_type, symbol, amount, contract_address, unique_key, tx_hash from transfer_nxmty_out +where 1=1 -- dummy change to trigger re-run diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/_schema.yml b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/_schema.yml index bb68caa26ff..4d63d68d2b5 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/_schema.yml @@ -210,9 +210,12 @@ models: - *cover_end_time - *cover_start_date - *cover_end_date + - &staking_pool_id + name: staking_pool_id + description: "staking pool id" - &staking_pool name: staking_pool - description: "staking pool id" + description: "staking pool" - *product_id - *product_type - *product_name @@ -227,16 +230,23 @@ models: - &premium_incl_commission name: premium_incl_commission description: "premium incl commission" + - &premium_period_ratio + name: premium_period_ratio + description: "premium period ratio" - *cover_owner - &commission name: commission description: "commission" + - &commission_ratio + name: commission_ratio + description: "commission ratio" - &commission_destination name: commission_destination description: "commission destination (recipient wallet)" - &is_migrated name: is_migrated description: "is migrated flag" + - name: trace_address - *tx_hash - name: nexusmutual_ethereum_active_covers @@ -259,9 +269,8 @@ models: - *cover_start_date - *cover_end_date - *cover_owner - - &staking_pool_id - name: staking_pool_id - description: "staking pool id" + - *staking_pool_id + - *product_id - *product_type - *product_name - *cover_asset diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_active_covers.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_active_covers.sql index 7dc0e61bf08..d9c3f591c74 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_active_covers.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_active_covers.sql @@ -3,10 +3,10 @@ schema = 'nexusmutual_ethereum', alias = 'active_covers', materialized = 'view', - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} @@ -20,7 +20,8 @@ covers as ( cover_start_date, cover_end_date, cover_owner, - cast(staking_pool as int) as staking_pool_id, + staking_pool_id, + product_id, product_type, product_name, cover_asset, @@ -40,6 +41,7 @@ covers_ext as ( cover_end_date, cover_owner, staking_pool_id, + product_id, product_type, product_name, cover_asset, @@ -90,6 +92,7 @@ select c.cover_end_date, c.cover_owner, c.staking_pool_id, + c.product_id, c.product_type, c.product_name, c.cover_asset, diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_cover_owners_agg.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_cover_owners_agg.sql index d785986ed34..410aab2e14a 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_cover_owners_agg.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_cover_owners_agg.sql @@ -3,10 +3,10 @@ schema = 'nexusmutual_ethereum', alias = 'cover_owners_agg', materialized = 'view', - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_daily_agg.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_daily_agg.sql index c6151d74966..044a51a193b 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_daily_agg.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_daily_agg.sql @@ -4,10 +4,10 @@ alias = 'covers_daily_agg', materialized = 'view', unique_key = ['block_date'], - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v1.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v1.sql index 6461ddde02a..fa189aaff21 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v1.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v1.sql @@ -7,10 +7,10 @@ incremental_strategy = 'merge', unique_key = ['cover_id'], incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v2.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v2.sql index 929eb98afce..8d966c79d5e 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v2.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_covers_v2.sql @@ -2,15 +2,12 @@ config( schema = 'nexusmutual_ethereum', alias = 'covers_v2', - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', + materialized = 'view', unique_key = ['cover_id', 'staking_pool'], - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} @@ -35,14 +32,11 @@ cover_sales as ( from_hex(json_query(c.params, 'lax $.commissionDestination' omit quotes)) as commission_destination, cast(json_query(t.pool_allocation, 'lax $.coverAmountInAsset') as uint256) as cover_amount_in_asset, cast(json_query(t.pool_allocation, 'lax $.skip') as boolean) as pool_allocation_skip, - c.call_trace_address, + c.call_trace_address as trace_address, c.call_tx_hash as tx_hash from {{ source('nexusmutual_ethereum', 'Cover_call_buyCover') }} c cross join unnest(c.poolAllocationRequests) as t(pool_allocation) where c.call_success - {% if is_incremental() %} - and {{ incremental_predicate('c.call_block_time') }} - {% endif %} ), staking_product_premiums as ( @@ -70,9 +64,6 @@ staking_product_premiums as ( from {{ source('nexusmutual_ethereum', 'StakingProducts_call_getPremium') }} where call_success and contract_address = 0xcafea573fbd815b5f59e8049e71e554bde3477e4 - {% if is_incremental() %} - and {{ incremental_predicate('call_block_time') }} - {% endif %} ), cover_premiums as ( @@ -86,6 +77,7 @@ cover_premiums as ( c.product_id, p.cover_amount / 100.0 as partial_cover_amount, -- partial_cover_amount_in_nxm p.premium / 1e18 as premium, + p.premium_period_ratio, c.commission_ratio / 10000.0 as commission_ratio, (c.commission_ratio / 10000.0) * p.premium / 1e18 as commission, (1.0 + (c.commission_ratio / 10000.0)) * p.premium / 1e18 as premium_incl_commission, @@ -105,6 +97,7 @@ cover_premiums as ( end as premium_asset, c.cover_owner, c.commission_destination, + c.trace_address, c.tx_hash from cover_sales c inner join staking_product_premiums p on c.tx_hash = p.tx_hash and c.block_number = p.block_number @@ -133,15 +126,17 @@ covers_v2 as ( p.product_type, p.product_name, cp.partial_cover_amount, - cp.commission_ratio, cp.cover_asset, cp.sum_assured, cp.premium_asset, + cp.premium_period_ratio, cp.premium, cp.premium_incl_commission, cp.cover_owner, cp.commission, + cp.commission_ratio, cp.commission_destination, + cp.trace_address, cp.tx_hash from cover_premiums cp left join products p on cp.product_id = p.product_id @@ -162,16 +157,15 @@ covers_v1_migrated as ( cv1.product_type, cv1.cover_asset, cv1.premium_asset, + cast(null as double) as premium_period_ratio, cm.newOwner as cover_owner, cast(null as double) as commission, + cast(null as double) as commission_ratio, cast(null as varbinary) as commission_destination, cm.evt_index, cm.evt_tx_hash as tx_hash from {{ source('nexusmutual_ethereum', 'CoverMigrator_evt_CoverMigrated') }} cm inner join {{ ref('nexusmutual_ethereum_covers_v1') }} cv1 on cm.coverIdV1 = cv1.cover_id - {% if is_incremental() %} - where {{ incremental_predicate('cm.evt_block_time') }} - {% endif %} ), covers as ( @@ -181,6 +175,7 @@ covers as ( cover_id, cover_start_time, cover_end_time, + pool_id as staking_pool_id, cast(pool_id as varchar) as staking_pool, cast(product_id as int) as product_id, product_type, @@ -190,12 +185,15 @@ covers as ( premium, premium as premium_nxm, premium_incl_commission, + premium_period_ratio, sum_assured, partial_cover_amount, -- in NXM cover_owner, commission, + commission_ratio, commission_destination, false as is_migrated, + trace_address, tx_hash from covers_v2 union all @@ -205,6 +203,7 @@ covers as ( cover_id, cover_start_time, cover_end_time, + cast(null as uint256) as staking_pool_id, syndicate as staking_pool, cast(null as int) as product_id, product_type, @@ -214,12 +213,15 @@ covers as ( premium, premium_nxm, premium_nxm as premium_incl_commission, + premium_period_ratio, sum_assured, sum_assured as partial_cover_amount, -- No partial covers in v1 migrated covers cover_owner, commission, + commission_ratio, commission_destination, true as is_migrated, + null as trace_address, tx_hash from covers_v1_migrated ) @@ -233,6 +235,7 @@ select cover_end_time, date_trunc('day', cover_start_time) as cover_start_date, date_trunc('day', cover_end_time) as cover_end_date, + staking_pool_id, staking_pool, product_id, product_type, @@ -244,9 +247,12 @@ select premium, premium_nxm, premium_incl_commission, + premium_period_ratio, cover_owner, commission, + commission_ratio, commission_destination, is_migrated, + trace_address, tx_hash from covers diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_product_types_v2.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_product_types_v2.sql index 2a5436d22d1..9091641b531 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_product_types_v2.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_product_types_v2.sql @@ -3,10 +3,11 @@ schema = 'nexusmutual_ethereum', alias = 'product_types_v2', materialized = 'view', - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + unique_key = ['product_type_id'], + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} @@ -22,6 +23,16 @@ product_type_events as ( evt_tx_hash as tx_hash, row_number() over (partition by evt_block_time, evt_tx_hash order by evt_index) as evt_rn from {{ source('nexusmutual_ethereum', 'Cover_evt_ProductTypeSet') }} + union all + select + evt_block_time as block_time, + evt_block_number as block_number, + id as product_type_id, + cast(null as varchar) as evt_product_type_ipfs_metadata, + evt_index, + evt_tx_hash as tx_hash, + row_number() over (partition by evt_block_time, evt_tx_hash order by evt_index) as evt_rn + from {{ source('nexusmutual_ethereum', 'CoverProducts_evt_ProductTypeSet') }} ), product_type_calls as ( @@ -33,6 +44,15 @@ product_type_calls as ( row_number() over (partition by call_block_time, call_tx_hash order by call_trace_address desc) as tx_call_rn from {{ source('nexusmutual_ethereum', 'Cover_call_setProductTypes') }} where call_success + union all + select + call_block_time as block_time, + call_block_number as block_number, + productTypeParams, + call_tx_hash as tx_hash, + row_number() over (partition by call_block_time, call_tx_hash order by call_trace_address desc) as tx_call_rn + from {{ source('nexusmutual_ethereum', 'CoverProducts_call_setProductTypes') }} + where call_success ), product_type_data_raw as ( diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v1.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v1.sql index d04918290b7..c8f1073016d 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v1.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v1.sql @@ -5,10 +5,10 @@ materialized = 'table', tags = ['static'], unique_key = ['product_contract_address'], - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["guyhowlett","tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["guyhowlett","tomfutago"]\') }}' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v2.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v2.sql index 7f65e2cbfa9..8d85aee6bb6 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v2.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/covers/nexusmutual_ethereum_products_v2.sql @@ -3,10 +3,11 @@ schema = 'nexusmutual_ethereum', alias = 'products_v2', materialized = 'view', - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + unique_key = ['product_id'], + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} @@ -21,6 +22,15 @@ product_events as ( evt_index, evt_tx_hash as tx_hash from {{ source('nexusmutual_ethereum', 'Cover_evt_ProductSet') }} + union all + select + evt_block_time as block_time, + evt_block_number as block_number, + id as product_id, + cast(null as varchar) as evt_product_ipfs_metadata, + evt_index, + evt_tx_hash as tx_hash + from {{ source('nexusmutual_ethereum', 'CoverProducts_evt_ProductSet') }} ), product_calls as ( @@ -33,6 +43,15 @@ product_calls as ( from {{ source('nexusmutual_ethereum', 'Cover_call_setProducts') }} where call_success and contract_address = 0xcafeac0ff5da0a2777d915531bfa6b29d282ee62 + union all + select + call_block_time as block_time, + call_block_number as block_number, + productParams, + call_tx_hash as tx_hash, + row_number() over (partition by call_block_time, call_tx_hash order by call_trace_address desc) as tx_call_rn + from {{ source('nexusmutual_ethereum', 'CoverProducts_call_setProducts') }} + where call_success ), product_data_raw as ( diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/_schema.yml b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/_schema.yml index 6ebcd18ef41..e36496a3bee 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/_schema.yml @@ -1,29 +1,36 @@ version: 2 models: - - name: nexusmutual_ethereum_staking_pools + - name: nexusmutual_ethereum_base_staking_pools meta: blockchain: ethereum project: nexusmutual contributors: tomfutago config: tags: ["ethereum", "nexusmutual", "staking"] - description: "Staking pools base data for Nexus Mutual on Ethereum" + description: "Staking pools base data (helper view)" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - pool_id - product_id columns: + - &block_time_created + name: block_time_created + - &block_time_product_updated + name: block_time_product_updated + - &block_time_manager_updated + name: block_time_manager_updated + - &block_time_fee_updated + name: block_time_fee_updated + - &block_time_updated + name: block_time_updated - &pool_id name: pool_id description: "pool id" - &pool_address name: pool_address description: "pool contract deployment address" - - &pool_name - name: pool_name - description: "pool name" - &manager_address name: manager_address description: "manager address" @@ -39,8 +46,8 @@ models: - &initial_pool_fee name: initial_pool_fee description: "initial pool management fee" - - ¤t_pool_fee - name: current_pool_fee + - ¤t_management_fee + name: current_management_fee description: "current pool management fee" - &max_management_fee name: max_management_fee @@ -48,6 +55,10 @@ models: - &product_id name: product_id description: "product id" + - &product_name + name: product_name + - &product_type + name: product_type - &initial_price name: initial_price description: "product initial price" @@ -66,6 +77,53 @@ models: - &product_added_time name: product_added_time description: "product added datetime in UTC" + - &tx_hash_created + name: tx_hash_created + - &tx_hash_product_updated + name: tx_hash_product_updated + - &tx_hash_manager_updated + name: tx_hash_manager_updated + - &tx_hash_fee_updated + name: tx_hash_fee_updated + - &tx_hash_updated + name: tx_hash_updated + + - name: nexusmutual_ethereum_staking_pools + meta: + blockchain: ethereum + project: nexusmutual + contributors: tomfutago + config: + tags: ["ethereum", "nexusmutual", "staking"] + description: "Staking pools base data (materialised)" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - pool_id + - product_id + columns: + - *block_time_created + - *block_time_updated + - *pool_id + - *pool_address + - *manager_address + - *manager_ens + - *manager + - *is_private_pool + - *initial_pool_fee + - *current_management_fee + - *max_management_fee + - *product_id + - *product_name + - *product_type + - *initial_price + - *target_price + - *initial_weight + - *target_weight + - *pool_created_time + - *product_added_time + - *tx_hash_created + - *tx_hash_updated - name: nexusmutual_ethereum_staking_events meta: @@ -140,6 +198,7 @@ models: - init_tranche_id - current_tranche_id columns: + - *block_time - *pool_address - *token_id - *init_tranche_id @@ -148,3 +207,5 @@ models: - name: total_amount description: "total staking amount (initial deposit + all top-up amounts)" - *is_active + - *evt_index + - *tx_hash diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_base_staking_pools.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_base_staking_pools.sql new file mode 100644 index 00000000000..1bd487e9e6b --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_base_staking_pools.sql @@ -0,0 +1,252 @@ +{{ + config( + schema = 'nexusmutual_ethereum', + alias = 'base_staking_pools', + materialized = 'view', + unique_key = ['pool_id', 'product_id'] + ) +}} + +with + +staking_pools_evt as ( + select + evt_block_time as block_time_created, + poolId as pool_id, + stakingPoolAddress as pool_address, + evt_tx_hash as tx_hash_created + from {{ source('nexusmutual_ethereum', 'StakingPoolFactory_evt_StakingPoolCreated') }} +), + +staking_pools_created as ( + select + call_block_time as block_time_created, + output_0 as pool_id, + output_1 as pool_address, + isPrivatePool as is_private_pool, + initialPoolFee as initial_pool_fee, + maxPoolFee as max_management_fee, + productInitParams as params, + call_tx_hash as tx_hash_created + from {{ source('nexusmutual_ethereum', 'Cover_call_createStakingPool') }} + where call_success + and contract_address = 0xcafeac0fF5dA0A2777d915531bfA6B29d282Ee62 + union all + select + call_block_time as block_time_created, + output_0 as pool_id, + output_1 as pool_address, + isPrivatePool as is_private_pool, + initialPoolFee as initial_pool_fee, + maxPoolFee as max_management_fee, + productInitParams as params, + call_tx_hash as tx_hash_created + from {{ source('nexusmutual_ethereum', 'StakingProducts_call_createStakingPool') }} + where call_success +), + +staking_pools_created_ext as ( + select + spe.block_time_created, + spe.pool_id, + spe.pool_address, + spc.is_private_pool, + spc.initial_pool_fee, + spc.max_management_fee, + spc.params, + spe.tx_hash_created + from staking_pools_evt spe + inner join staking_pools_created spc on spe.pool_id = spc.pool_id and spe.block_time_created = spc.block_time_created +), + +staking_pools_and_products as ( + select + sp.block_time_created, + sp.pool_id, + sp.pool_address, + sp.is_private_pool, + sp.initial_pool_fee, + sp.max_management_fee, + cast(json_query(t.json, 'lax $.productId') as int) as product_id, + cast(json_query(t.json, 'lax $.weight') as double) as weight, + cast(json_query(t.json, 'lax $.initialPrice') as double) as initial_price, + cast(json_query(t.json, 'lax $.targetPrice') as double) as target_price, + sp.tx_hash_created + from staking_pools_created_ext as sp + left join unnest(sp.params) as t(json) on true +), + +staking_pool_products_updated as ( + select + *, + row_number() over (partition by pool_id, product_id order by block_time_updated desc) as rn + from ( + select + p.call_block_time as block_time_updated, + p.poolId as pool_id, + cast(json_query(t.json, 'lax $.productId') as int) as product_id, + cast(json_query(t.json, 'lax $.recalculateEffectiveWeight') as boolean) as re_eval_eff_weight, + cast(json_query(t.json, 'lax $.setTargetWeight') as boolean) as set_target_weight, + cast(json_query(t.json, 'lax $.targetWeight') as double) as target_weight, + cast(json_query(t.json, 'lax $.setTargetPrice') as boolean) as set_target_price, + cast(json_query(t.json, 'lax $.targetPrice') as double) as target_price, + p.call_tx_hash as tx_hash_updated + from {{ source('nexusmutual_ethereum', 'StakingProducts_call_setProducts') }} as p + cross join unnest(params) as t(json) + where p.call_success + and p.contract_address = 0xcafea573fBd815B5f59e8049E71E554bde3477E4 + and cast(json_query(t.json, 'lax $.setTargetWeight') as boolean) = true + ) t +), + +staking_pool_products_combined as ( + select + spp.block_time_created, + spu.block_time_updated, + coalesce(spp.pool_id, spu.pool_id) as pool_id, + coalesce(spp.product_id, spu.product_id) as product_id, + spp.initial_price, + spp.target_price, + spu.target_price as updated_target_price, + spp.weight as initial_weight, + spu.target_weight, + if(spp.product_id is null, true, false) as is_product_added, + spp.tx_hash_created, + spu.tx_hash_updated + from staking_pools_and_products spp + full outer join staking_pool_products_updated as spu on spp.pool_id = spu.pool_id and spp.product_id = spu.product_id + where coalesce(spu.rn, 1) = 1 +), + +staking_pool_managers_history as ( + select + call_block_time as block_time, + poolId as pool_id, + manager, + call_trace_address, + call_tx_hash as tx_hash + from {{ source('nexusmutual_ethereum', 'TokenController_call_assignStakingPoolManager') }} + where call_success + union all + select + call_block_time as block_time, + poolId as pool_id, + manager, + call_trace_address, + call_tx_hash as tx_hash + from {{ source('nexusmutual_ethereum', 'TokenController2_call_assignStakingPoolManager') }} + where call_success + union all + select + call_block_time as block_time, + poolId as pool_id, + manager, + call_trace_address, + call_tx_hash as tx_hash + from {{ source('nexusmutual_ethereum', 'TokenController3_call_assignStakingPoolManager') }} + where call_success + union all + select distinct + m.call_block_time as block_time, + sp.poolId as pool_id, + m.output_0 as manager, + m.call_trace_address, + m.call_tx_hash as tx_hash + from {{ source('nexusmutual_ethereum', 'StakingProducts_evt_ProductUpdated') }} pu + inner join {{ source('nexusmutual_ethereum', 'StakingProducts_call_setProducts') }} sp on pu.evt_tx_hash = call_tx_hash and pu.evt_block_number = sp.call_block_number + inner join {{ source('nexusmutual_ethereum', 'StakingPool_call_manager') }} m on sp.call_tx_hash = m.call_tx_hash and sp.call_block_number = m.call_block_number + where sp.call_success + and m.call_success +), + +staking_pool_managers as ( + select + t.block_time as block_time_updated, + t.pool_id, + t.manager as manager_address, + ens.name as manager_ens, + coalesce(ens.name, cast(t.manager as varchar)) as manager, + t.tx_hash as tx_hash_updated + from ( + select + block_time, + pool_id, + manager, + tx_hash, + row_number() over (partition by pool_id order by block_time, call_trace_address desc) as rn + from staking_pool_managers_history + ) t + left join labels.ens on t.manager = ens.address + where t.rn = 1 +), + +staking_pool_fee_updates as ( + select + block_time as block_time_updated, + pool_address, + new_fee, + tx_hash as tx_hash_updated + from ( + select + evt_block_time as block_time, + contract_address as pool_address, + newFee as new_fee, + evt_tx_hash as tx_hash, + row_number() over (partition by contract_address order by evt_block_time desc, evt_index desc) as rn + from {{ source('nexusmutual_ethereum', 'StakingPool_evt_PoolFeeChanged') }} + ) t + where t.rn = 1 +), + +products as ( + select + p.product_id, + p.product_name, + pt.product_type_id, + pt.product_type_name as product_type + from {{ ref('nexusmutual_ethereum_product_types_v2') }} pt + inner join {{ ref('nexusmutual_ethereum_products_v2') }} p on pt.product_type_id = p.product_type_id +) + +select + sp.block_time_created, + spc.block_time_updated as block_time_product_updated, + spm.block_time_updated as block_time_manager_updated, + spf.block_time_updated as block_time_fee_updated, + greatest( + coalesce(spc.block_time_updated, sp.block_time_created), + coalesce(spm.block_time_updated, sp.block_time_created), + coalesce(spf.block_time_updated, sp.block_time_created) + ) as block_time_updated, + sp.pool_id, + sp.pool_address, + spm.manager_address, + spm.manager_ens, + spm.manager, + sp.is_private_pool, + sp.initial_pool_fee / 100.00 as initial_pool_fee, + coalesce(spf.new_fee, sp.initial_pool_fee) / 100.00 as current_management_fee, + sp.max_management_fee / 100.00 as max_management_fee, + spc.product_id, + p.product_name, + p.product_type, + spc.initial_price / 100.00 as initial_price, + coalesce(spc.updated_target_price, spc.target_price) / 100.00 as target_price, + spc.initial_weight / 100.00 as initial_weight, + spc.target_weight / 100.00 as target_weight, + sp.block_time_created as pool_created_time, + if(spc.is_product_added, spc.block_time_updated, sp.block_time_created) as product_added_time, + sp.tx_hash_created, + spc.tx_hash_updated as tx_hash_product_updated, + spm.tx_hash_updated as tx_hash_manager_updated, + spf.tx_hash_updated as tx_hash_fee_updated, + greatest( + coalesce(spc.tx_hash_updated, sp.tx_hash_created), + coalesce(spm.tx_hash_updated, sp.tx_hash_created), + coalesce(spf.tx_hash_updated, sp.tx_hash_created) + ) as tx_hash_updated +from staking_pools_created_ext sp + inner join staking_pool_products_combined spc on sp.pool_id = spc.pool_id + left join products p on spc.product_id = p.product_id + left join staking_pool_managers spm on sp.pool_id = spm.pool_id + left join staking_pool_fee_updates spf on sp.pool_address = spf.pool_address diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_deposit_extensions.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_deposit_extensions.sql index 6ecd9111a81..2836497589b 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_deposit_extensions.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_deposit_extensions.sql @@ -4,21 +4,24 @@ alias = 'staking_deposit_extensions', materialized = 'view', unique_key = ['pool_address', 'token_id', 'init_tranche_id', 'current_tranche_id'], - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} -with recursive deposit_chain (pool_address, token_id, tranche_id, new_tranche_id, total_amount, is_active, chain_level) as ( +with recursive deposit_chain (pool_address, token_id, tranche_id, new_tranche_id, total_amount, block_time, is_active, evt_index, tx_hash, chain_level) as ( select pool_address, token_id, tranche_id as tranche_id, tranche_id as new_tranche_id, sum(amount) as total_amount, + max(block_time) as block_time, max_by(is_active, block_time) as is_active, + max_by(evt_index, block_time) as evt_index, + max_by(tx_hash, block_time) as tx_hash, 1 as chain_level from {{ ref('nexusmutual_ethereum_staking_events') }} where flow_type = 'deposit' @@ -32,7 +35,10 @@ with recursive deposit_chain (pool_address, token_id, tranche_id, new_tranche_id dc.tranche_id, d.new_tranche_id, dc.total_amount + coalesce(d.topup_amount, 0) as total_amount, + d.block_time, d.is_active, + d.evt_index, + d.tx_hash, dc.chain_level + 1 as chain_level from deposit_chain dc inner join {{ ref('nexusmutual_ethereum_staking_events') }} d on dc.pool_address = d.pool_address @@ -42,12 +48,15 @@ with recursive deposit_chain (pool_address, token_id, tranche_id, new_tranche_id ) select + block_time, pool_address, token_id, tranche_id as init_tranche_id, new_tranche_id as current_tranche_id, total_amount, - is_active + is_active, + evt_index, + tx_hash from ( select *, diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_events.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_events.sql index 636071e3496..846f286b13c 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_events.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_events.sql @@ -7,10 +7,10 @@ incremental_strategy = 'merge', unique_key = ['flow_type', 'block_time', 'evt_index', 'tx_hash'], incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} diff --git a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_pools.sql b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_pools.sql index 704c4567e76..ad21b3e3559 100644 --- a/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_pools.sql +++ b/dbt_subprojects/daily_spellbook/models/nexusmutual/ethereum/staking/nexusmutual_ethereum_staking_pools.sql @@ -2,198 +2,42 @@ config( schema = 'nexusmutual_ethereum', alias = 'staking_pools', - materialized = 'view', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', unique_key = ['pool_id', 'product_id'], - post_hook = '{{ expose_spells(\'["ethereum"]\', - "project", - "nexusmutual", - \'["tomfutago"]\') }}' + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time_updated')], + post_hook = '{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "nexusmutual", + contributors = \'["tomfutago"]\') }}' ) }} -with - -staking_pool_names (pool_id, pool_name) as ( - values - (1, 'Nexus Foundation'), - (2, 'Hugh'), - (3, 'Ease AAA Low Risk Pool'), - (4, 'Ease AA Medium Risk Pool'), - (5, 'Unity Cover'), - (6, 'Safe Invest'), - (7, 'ShieldX Staking Pool'), - (8, 'DeFiSafety X OpenCover Blue Chip Protocol Pool'), - (9, 'My Conservative Pool'), - (10, 'SAFU Pool'), - (11, 'Sherlock'), - (12, 'Gm Exit Here (GLP) Pool'), - (13, 'My Nexus Pool'), - (14, 'My Private Pool'), - (15, 'Reflection'), - (16, 'Good KarMa Capital'), - (17, 'High Trust Protocols'), - (18, 'UnoRe WatchDog Pool'), - (19, 'Broad And Diversified'), - (20, 'Lowest Risk'), - (21, 'Crypto Plaza'), - (22, 'BraveNewDeFi''s Pool') -), - -staking_pools_created as ( - select - call_block_time as block_time, - output_0 as pool_id, - output_1 as pool_address, - isPrivatePool as is_private_pool, - initialPoolFee as initial_pool_fee, - maxPoolFee as max_management_fee, - productInitParams as params - from {{ source('nexusmutual_ethereum', 'Cover_call_createStakingPool') }} - where call_success - and contract_address = 0xcafeac0fF5dA0A2777d915531bfA6B29d282Ee62 -), - -staking_pools_and_products as ( - select - sp.block_time, - sp.pool_id, - sp.pool_address, - sp.is_private_pool, - sp.initial_pool_fee, - sp.max_management_fee, - cast(json_query(t.json, 'lax $.productId') as int) as product_id, - cast(json_query(t.json, 'lax $.weight') as double) as weight, - cast(json_query(t.json, 'lax $.initialPrice') as double) as initial_price, - cast(json_query(t.json, 'lax $.targetPrice') as double) as target_price - from staking_pools_created as sp - left join unnest(params) as t(json) on true -), - -staking_pool_products_updated as ( - select - *, - row_number() over (partition by pool_id, product_id order by block_time desc) as rn - from ( - select - call_block_time as block_time, - poolId as pool_id, - cast(json_query(t.json, 'lax $.productId') as int) as product_id, - cast(json_query(t.json, 'lax $.recalculateEffectiveWeight') as boolean) as re_eval_eff_weight, - cast(json_query(t.json, 'lax $.setTargetWeight') as boolean) as set_target_weight, - cast(json_query(t.json, 'lax $.targetWeight') as double) as target_weight, - cast(json_query(t.json, 'lax $.setTargetPrice') as boolean) as set_target_price, - cast(json_query(t.json, 'lax $.targetPrice') as double) as target_price - from {{ source('nexusmutual_ethereum', 'StakingProducts_call_setProducts') }} as p - cross join unnest(params) as t(json) - where call_success - and contract_address = 0xcafea573fBd815B5f59e8049E71E554bde3477E4 - and cast(json_query(t.json, 'lax $.setTargetWeight') as boolean) = true - ) t -), - -staking_pool_products_combined as ( - select - coalesce(spp.pool_id, spu.pool_id) as pool_id, - coalesce(spp.product_id, spu.product_id) as product_id, - spp.initial_price, - spp.target_price, - spu.target_price as updated_target_price, - spp.weight as initial_weight, - spu.target_weight, - spu.block_time as updated_time, - if(spp.product_id is null, true, false) as is_product_added - from staking_pools_and_products spp - full outer join staking_pool_products_updated spu on spp.pool_id = spu.pool_id and spp.product_id = spu.product_id - where coalesce(spu.rn, 1) = 1 -), - -staking_pool_managers_history as ( - select - call_block_time as block_time, - poolId as pool_id, - manager, - call_trace_address, - call_tx_hash as tx_hash - from {{ source('nexusmutual_ethereum', 'TokenController_call_assignStakingPoolManager') }} - where call_success - union all - select - call_block_time as block_time, - poolId as pool_id, - manager, - call_trace_address, - call_tx_hash as tx_hash - from {{ source('nexusmutual_ethereum', 'TokenController2_call_assignStakingPoolManager') }} - where call_success - union all - select distinct - m.call_block_time as block_time, - sp.poolId as pool_id, - m.output_0 as manager, - m.call_trace_address, - m.call_tx_hash as tx_hash - from {{ source('nexusmutual_ethereum', 'StakingProducts_evt_ProductUpdated') }} pu - inner join {{ source('nexusmutual_ethereum', 'StakingProducts_call_setProducts') }} sp on pu.evt_tx_hash = call_tx_hash and pu.evt_block_number = sp.call_block_number - inner join {{ source('nexusmutual_ethereum', 'StakingPool_call_manager') }} m on sp.call_tx_hash = m.call_tx_hash and sp.call_block_number = m.call_block_number - where sp.call_success - and m.call_success -), - -staking_pool_managers as ( - select - t.pool_id, - t.manager as manager_address, - ens.name as manager_ens, - coalesce(ens.name, cast(t.manager as varchar)) as manager - from ( - select - pool_id, - manager, - row_number() over (partition by pool_id order by block_time, call_trace_address desc) as rn - from staking_pool_managers_history - ) t - left join labels.ens on t.manager = ens.address - where t.rn = 1 -), - -staking_pool_fee_updates as ( - select - sp.pool_id, - t.pool_address, - t.new_fee - from ( - select - evt_block_time as block_time, - contract_address as pool_address, - newFee as new_fee, - evt_tx_hash as tx_hash, - row_number() over (partition by contract_address order by evt_block_time desc, evt_index desc) as rn - from {{ source('nexusmutual_ethereum', 'StakingPool_evt_PoolFeeChanged') }} - ) t - inner join staking_pools_created sp on t.pool_address = sp.pool_address - where t.rn = 1 -) - select - sp.pool_id, - sp.pool_address, - spn.pool_name, - spm.manager_address, - spm.manager_ens, - spm.manager, - sp.is_private_pool, - sp.initial_pool_fee, - coalesce(spf.new_fee, sp.initial_pool_fee) as current_pool_fee, - sp.max_management_fee, - spc.product_id, - spc.initial_price, - coalesce(spc.updated_target_price, spc.target_price) as target_price, - spc.initial_weight, - spc.target_weight, - sp.block_time as pool_created_time, - if(spc.is_product_added, spc.updated_time, sp.block_time) as product_added_time -from staking_pools_created sp - inner join staking_pool_products_combined spc on sp.pool_id = spc.pool_id - left join staking_pool_names spn on sp.pool_id = spn.pool_id - left join staking_pool_managers spm on sp.pool_id = spm.pool_id - left join staking_pool_fee_updates spf on sp.pool_id = spf.pool_id + block_time_created, + block_time_updated, + pool_id, + pool_address, + manager_address, + manager_ens, + manager, + is_private_pool, + initial_pool_fee, + current_management_fee, + max_management_fee, + product_id, + product_name, + product_type, + initial_price, + target_price, + initial_weight, + target_weight, + pool_created_time, + product_added_time, + tx_hash_created, + tx_hash_updated +from {{ ref('nexusmutual_ethereum_base_staking_pools') }} +{% if is_incremental() %} +where {{ incremental_predicate('block_time_updated') }} +{% endif %} diff --git a/dbt_subprojects/daily_spellbook/models/rocifi/polygon/rocifi_polygon.schema.yml b/dbt_subprojects/daily_spellbook/models/rocifi/polygon/_schema.yml similarity index 92% rename from dbt_subprojects/daily_spellbook/models/rocifi/polygon/rocifi_polygon.schema.yml rename to dbt_subprojects/daily_spellbook/models/rocifi/polygon/_schema.yml index 345f9357d96..6418516cc1f 100644 --- a/dbt_subprojects/daily_spellbook/models/rocifi/polygon/rocifi_polygon.schema.yml +++ b/dbt_subprojects/daily_spellbook/models/rocifi/polygon/_schema.yml @@ -5,7 +5,7 @@ models: meta: blockchain: polygon project: rocifi - contributors: maybeyonas + contributors: maybeYonas config: tags: ['table', 'addresses', 'polygon', 'rocifi'] description: "Test addresses used to test in Production" diff --git a/dbt_subprojects/daily_spellbook/models/rocifi/polygon/rocifi_polygon_test_addresses.sql b/dbt_subprojects/daily_spellbook/models/rocifi/polygon/rocifi_polygon_test_addresses.sql index 5c026c6ae15..8da7161d7d4 100644 --- a/dbt_subprojects/daily_spellbook/models/rocifi/polygon/rocifi_polygon_test_addresses.sql +++ b/dbt_subprojects/daily_spellbook/models/rocifi/polygon/rocifi_polygon_test_addresses.sql @@ -1,11 +1,7 @@ {{ config ( tags=['static'], - alias = 'test_addresses', - post_hook = '{{ - expose_spells(\'["polygon"]\', - "project", - "rocifi", - \'["maybeyonas"]\') }}' + schema = 'rocifi_polygon', + alias = 'test_addresses' ) }} diff --git a/dbt_subprojects/daily_spellbook/packages.yml b/dbt_subprojects/daily_spellbook/packages.yml index 6152b330974..ff9ca2cf98a 100644 --- a/dbt_subprojects/daily_spellbook/packages.yml +++ b/dbt_subprojects/daily_spellbook/packages.yml @@ -1,3 +1,3 @@ packages: - package: dbt-labs/dbt_utils - version: 1.1.1 \ No newline at end of file + version: 1.3.0 \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/dodo_compatible_trades.sql b/dbt_subprojects/dex/macros/models/_project/dodo_compatible_trades.sql index e353f464547..d135d1097e3 100644 --- a/dbt_subprojects/dex/macros/models/_project/dodo_compatible_trades.sql +++ b/dbt_subprojects/dex/macros/models/_project/dodo_compatible_trades.sql @@ -89,7 +89,7 @@ other_dexs AS ( WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} {% if not loop.last %} - UNION ALL + UNION DISTINCT {% endif %} {% endfor %} ), diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_generic.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_generic.sql index fcd37745c4f..f9b880b6e49 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_generic.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_generic.sql @@ -47,7 +47,7 @@ from ( {% if is_incremental() %} where {{ incremental_predicate('call_block_time') }} {% else %} - where call_block_time >= timestamp '{{ start_date }}' + where call_block_time >= greatest(timestamp '{{ start_date }}', timestamp {{ oneinch_easy_date() }}) {% endif %} ) join traces_cte using(call_block_number, call_tx_hash, call_trace_address) diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_unoswap.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_unoswap.sql index 132744d344c..35c869a0433 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_unoswap.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_handle_unoswap.sql @@ -104,7 +104,7 @@ from ( {% if is_incremental() %} where {{ incremental_predicate('call_block_time') }} {% else %} - where call_block_time >= timestamp '{{ start_date }}' + where call_block_time >= greatest(timestamp '{{ start_date }}', timestamp {{ oneinch_easy_date() }}) {% endif %} ) ) diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_macro.sql index b0e6f2f5f9b..f330c9de4c8 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_macro.sql @@ -47,7 +47,7 @@ pools_list as ( {% if is_incremental() %} {{ incremental_predicate('block_time') }} {% else %} - block_time >= timestamp '{{ contract_data['start'] }}' + block_time >= greatest(timestamp '{{ contract_data['start'] }}', timestamp {{ oneinch_easy_date() }}) {% endif %} ) diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_raw_traces_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_raw_traces_macro.sql index dea86f05bdf..b07438528a7 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_raw_traces_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/AR/oneinch_ar_raw_traces_macro.sql @@ -11,7 +11,7 @@ with decoded_calls as ( {% if is_incremental() %} where {{ incremental_predicate('call_block_time') }} {% else %} - where call_block_time >= greatest(timestamp '{{ contract_data['start'] }}', timestamp '{{date_from}}') + where call_block_time >= greatest(timestamp '{{ contract_data['start'] }}', timestamp '{{date_from}}', timestamp {{ oneinch_easy_date() }}) {% endif %} {% if not outer_loop.last or not loop.last %} union all @@ -44,7 +44,7 @@ with decoded_calls as ( {% if is_incremental() %} {{ incremental_predicate('block_time') }} {% else %} - block_time >= timestamp '{{date_from}}' + block_time >= greatest(timestamp '{{ date_from }}', timestamp {{ oneinch_easy_date() }}) {% endif %} ) diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/CC/oneinch_escrow_dst_creations_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/CC/oneinch_escrow_dst_creations_macro.sql new file mode 100644 index 00000000000..33776bffcf8 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/CC/oneinch_escrow_dst_creations_macro.sql @@ -0,0 +1,87 @@ +{% macro oneinch_escrow_dst_creations_macro(blockchain) %} + +{% set date_from = '2024-08-20' %} + +with + +factories as ( + select factory + from ({{ oneinch_blockchain_macro(blockchain) }}), unnest(escrow_factory_addresses) as f(factory) +) + +, createDstEscrow as ( + select + * + , substr(keccak(concat( + 0xff + , factory + , keccak(concat( + order_hash + , hashlock + , lpad(maker, 32, 0x00) + , lpad(taker, 32, 0x00) + , lpad(token, 32, 0x00) + , cast(amount as varbinary) + , cast(safety_deposit as varbinary) + , to_big_endian_32(cast(to_unixtime(block_time) as int)) + , substr(timelocks, 5) -- replace the first 4 bytes with current block time + )) + , keccak(concat( + 0x3d602d80600a3d3981f3363d3d373d3d3d363d73 + , substr(keccak(concat(0xd6, 0x94, factory, 0x03)), 13) -- dst nonce = 3 + , 0x5af43d82803e903d91602b57fd5bf3) + ) + )), 13) as escrow + from ( + -- will be converted to submitted contracts + select + '{{ blockchain }}' as blockchain + , block_number + , block_time + , tx_hash + , trace_address + , "to" as factory + , substr(input, 4 + 32*0 + 1, 32) as order_hash + , substr(input, 4 + 32*1 + 1, 32) as hashlock + , substr(input, 4 + 32*2 + 12 + 1, 20) as maker + , substr(input, 4 + 32*3 + 12 + 1, 20) as taker + , substr(input, 4 + 32*4 + 12 + 1, 20) as token + , bytearray_to_uint256(substr(input, 4 + 32*5 + 1, 32)) as amount + , bytearray_to_uint256(substr(input, 4 + 32*6 + 1, 32)) as safety_deposit + , substr(input, 4 + 32*7 + 12 + 1, 32) as timelocks + , success as call_success + from {{ source(blockchain, 'traces') }} + where + starts_with(input, 0xdea024e4) -- createDstEscrow + and "to" in (select factory from factories) + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time > greatest(timestamp '{{ date_from }}', timestamp {{ oneinch_easy_date() }}) + {% endif %} + ) +) + +-- output -- + +select + blockchain + , block_number + , block_time + , tx_hash + , trace_address + , factory + , escrow + , order_hash + , hashlock + , maker + , taker + , token + , amount + , safety_deposit + , timelocks + , call_success + , date_trunc('month', block_time) as block_month +from createDstEscrow + +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/CC/oneinch_escrow_results_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/CC/oneinch_escrow_results_macro.sql new file mode 100644 index 00000000000..1cd491f89c7 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/CC/oneinch_escrow_results_macro.sql @@ -0,0 +1,109 @@ +{% macro oneinch_escrow_results_macro(blockchain) %} + +{% set date_from = '2024-08-20' %} +{% set selector = 'substr(input, 1, 4)' %} +{% set withdraw = '0x23305703' %} +{% set cancel = '0x90d3252f' %} +{% set rescueFunds = '0x4649088b' %} + + + +with + +factories as ( + select factory + from ({{ oneinch_blockchain_macro(blockchain) }}), unnest(escrow_factory_addresses) as f(factory) +) + +, creations as ( + select address + from {{ source(blockchain, 'creation_traces') }} + where + "from" in (select factory from factories) + and block_time > greatest(timestamp '{{ date_from }}', timestamp {{ oneinch_easy_date() }}) -- without an incremental predicate, as the results may be delayed +) + +, results as ( + select + '{{ blockchain }}' as blockchain + , block_number + , block_time + , tx_hash + , "to" as escrow + , trace_address + , {{ selector}} as selector + , case {{ selector }} + when {{ cancel }} then 'cancel' + when {{ withdraw }} then 'withdraw' + when {{ rescueFunds }} then 'rescueFunds' + end as method + , case {{ selector }} + when {{ withdraw }} then substr(input, 4 + 32*0 + 1, 32) + else null + end as secret + , substr(input, 4 + 32*case {{ selector }} + when {{ cancel }} then 0 + when {{ withdraw }} then 1 + when {{ rescueFunds }} then 2 + end + 1, 32) as order_hash + , substr(input, 4 + 32*case {{ selector }} + when {{ cancel }} then 1 + when {{ withdraw }} then 2 + when {{ rescueFunds }} then 3 + end + 1, 32) as hashlock + , substr(input, 4 + 32*case {{ selector }} + when {{ cancel }} then 4 + when {{ withdraw }} then 5 + when {{ rescueFunds }} then 6 + end + 12 + 1, 20) as token + , bytearray_to_uint256(substr(input, 4 + 32*case {{ selector }} + when {{ cancel }} then 5 + when {{ withdraw }} then 6 + when {{ rescueFunds }} then 7 + end + 1, 32)) as amount + , case {{ selector }} + when {{ rescueFunds }} then substr(input, 4 + 32*0 + 12 + 1, 20) + else null + end as rescue_token + , case {{ selector }} + when {{ rescueFunds }} then bytearray_to_uint256(substr(input, 4 + 32*1 + 1, 32)) + else null + end as rescue_amount + , success as call_success + , tx_success + from {{ source(blockchain, 'traces') }} + where + {{ selector }} in ({{ withdraw }}, {{ cancel }}, {{ rescueFunds }}) + and "to" in (select address from creations) + and call_type = 'call' + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time > greatest(timestamp '{{ date_from }}', timestamp {{ oneinch_easy_date() }}) + {% endif %} +) + +-- output -- + +select + blockchain + , block_number + , block_time + , tx_hash + , trace_address + , escrow + , hashlock + , selector + , method + , secret + , order_hash + , token + , amount + , rescue_token + , rescue_amount + , call_success + , tx_success + , date_trunc('month', block_time) as block_month +from results + +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_cfg_contracts_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_cfg_contracts_macro.sql index fb8bd2407d6..6e1a08cd5cc 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_cfg_contracts_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_cfg_contracts_macro.sql @@ -20,6 +20,7 @@ "order_hash": "output_2", "order_remains": "varbinary_concat(0x01, substr(cast(cast(order_map['salt'] as uint256) as varbinary), 1, 4))", "maker_traits": "cast(cast(order_map['makerTraits'] as uint256) as varbinary)", + "taker_traits": "cast(takerTraits as varbinary)", "partial_bit": "1", "multiple_bit": "2", } @@ -101,13 +102,13 @@ }, "AggregationRouterV6": { "version": "4", - "blockchains": ["ethereum", "bnb", "polygon", "arbitrum", "avalanche_c", "gnosis", "optimism", "fantom", "base"], + "blockchains": ["ethereum", "bnb", "polygon", "arbitrum", "avalanche_c", "gnosis", "optimism", "fantom", "base", "zksync"], "start": "2024-02-12", "methods": { "fillOrder": samples["v4"], "fillOrderArgs": dict(samples["v4"], args="args"), "fillContractOrder": samples["v4"], - "fillContractOrderArgs": samples["v4"], + "fillContractOrderArgs": dict(samples["v4"], args="args"), }, }, } diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_macro.sql index 526e28a65e3..f4e13b880ed 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_macro.sql @@ -1,8 +1,4 @@ -{% macro - oneinch_lop_macro( - blockchain - ) -%} +{% macro oneinch_lop_macro(blockchain) %} @@ -12,8 +8,7 @@ orders as ( {% for contract, contract_data in oneinch_lop_cfg_contracts_macro().items() if blockchain in contract_data['blockchains'] %} select * from ({% for method, method_data in contract_data.methods.items() %} select - blockchain - , call_block_number as block_number + call_block_number as block_number , call_block_time as block_time , date(date_trunc('day', call_block_time)) as block_date , call_tx_hash as tx_hash @@ -31,8 +26,7 @@ orders as ( , {{ method_data.get("taking_amount", "null") }} as taking_amount , {{ method_data.get("order_hash", "null") }} as order_hash , {{ method_data.get("order_remains", "0x0000000000") }} as order_remains - , fusion_settlement_addresses as _settlements - , reduce(fusion_settlement_addresses, false, (r, x) -> r or coalesce(varbinary_position({{ method_data.get("args", "null")}}, x), 0) > 0, r -> r) as _with_settlement + , {{ method_data.get("args", "cast(null as varbinary)") }} as args , {% if 'partial_bit' in method_data %} try(bitwise_and( -- binary AND to allocate significant bit: necessary byte & mask (i.e. * bit weight) bytearray_to_bigint(substr({{ method_data.maker_traits }}, {{ method_data.partial_bit }} / 8 + 1, 1)) -- current byte: partial_bit / 8 + 1 -- integer division @@ -48,9 +42,10 @@ orders as ( from ( select *, cast(json_parse({{ method_data.get("order", '"order"') }}) as map(varchar, varchar)) as order_map from {{ source('oneinch_' + blockchain, contract + '_call_' + method) }} - join ({{ oneinch_blockchain_macro(blockchain) }}) on true {% if is_incremental() %} where {{ incremental_predicate('call_block_time') }} + {% else %} + where call_block_time >= greatest(timestamp '{{ contract_data['start'] }}', timestamp {{ oneinch_easy_date() }}) {% endif %} ) {% if not loop.last %} union all {% endif %} @@ -63,7 +58,7 @@ orders as ( , "from" as call_from , selector as call_selector , gas_used as call_gas_used - , substr(input, input_length - mod(input_length - 4, 32) + 1) as remains + , substr(input, input_length - mod(input_length - 4, 32) + 1) as _remains , output as call_output , error as call_error , call_type @@ -72,13 +67,127 @@ orders as ( {% if is_incremental() %} {{ incremental_predicate('block_time') }} {% else %} - block_time >= timestamp '{{ contract_data['start'] }}' + block_time >= greatest(timestamp '{{ contract_data['start'] }}', timestamp {{ oneinch_easy_date() }}) {% endif %} ) using(block_number, tx_hash, call_trace_address) {% if not loop.last %} union all {% endif %} {% endfor %} ) +-- will be converted to submitted contracts +, SrcEscrowCreated as ( + with + + factories as ( + select factory + from ({{ oneinch_blockchain_macro(blockchain) }}), unnest(escrow_factory_addresses) as f(factory) + ) + + select + block_number + , tx_hash + , contract_address as factory + , substr(data, 32*0 + 1, 32) as order_hash + , substr(data, 32*1 + 1, 32) as hashlock + , substr(data, 32*2 + 12 + 1, 20) as maker + , substr(data, 32*3 + 12 + 1, 20) as taker + , substr(data, 32*4 + 12 + 1, 20) as token + , bytearray_to_uint256(substr(data, 32*5 + 1, 32)) as amount + , bytearray_to_uint256(substr(data, 32*6 + 1, 32)) as safety_deposit + , substr(data, 32*7 + 1, 32) as timelocks + from {{ source(blockchain, 'logs') }} + where + contract_address in (select factory from factories) + and topic0 = 0x0e534c62f0afd2fa0f0fa71198e8aa2d549f24daf2bb47de0d5486c7ce9288ca + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% else %} + and block_time > timestamp '2024-08-20' + {% endif %} +) + +, calculations as ( + select + blockchain + , orders.* + , map_from_entries(array[ + ('partial', _partial) + , ('multiple', _multiple) + , ('fusion', array_position(fusion_settlement_addresses, call_from) > 0 or reduce(fusion_settlement_addresses, false, (r, x) -> r or coalesce(varbinary_position(args, x), 0) > 0, r -> r)) + , ('factoryInArgs', reduce(escrow_factory_addresses, false, (r, x) -> r or coalesce(varbinary_position(args, x), 0) > 0, r -> r)) + ]) as flags + , concat( + cast(length(_remains) + length(order_remains) as bigint) + , concat( + if(length(_remains) > 0 + , transform(sequence(1, length(_remains), 4), x -> bytearray_to_bigint(reverse(substr(reverse(_remains), x, 4)))) + , array[bigint '0'] + ) + , array[bytearray_to_bigint(order_remains)] + ) + ) as remains + , hashlock + , factory as src_factory + , if(hashlock is not null, substr(keccak(concat( + 0xff + , factory + , keccak(concat( + orders.order_hash + , hashlock + , lpad(SrcEscrowCreated.maker, 32, 0x00) + , lpad(SrcEscrowCreated.taker, 32, 0x00) + , lpad(token, 32, 0x00) + , cast(amount as varbinary) + , cast(safety_deposit as varbinary) + , to_big_endian_32(cast(to_unixtime(block_time) as int)) + , substr(timelocks, 5) -- replace the first 4 bytes with current block time + )) + , keccak(concat( + 0x3d602d80600a3d3981f3363d3d373d3d3d363d73 + , substr(keccak(concat(0xd6, 0x94, factory, 0x02)), 13) -- src nonce = 2 + , 0x5af43d82803e903d91602b57fd5bf3) + ) + )), 13)) as src_escrow + , row_number() over(partition by hashlock order by orders.block_number, orders.tx_hash, call_trace_address) as hashlockNum + from orders + join ({{ oneinch_blockchain_macro(blockchain) }}) on true + left join SrcEscrowCreated on + SrcEscrowCreated.block_number = orders.block_number + and SrcEscrowCreated.tx_hash = orders.tx_hash + and SrcEscrowCreated.order_hash = orders.order_hash + and varbinary_position(orders.args, SrcEscrowCreated.hashlock) > 0 + and SrcEscrowCreated.maker = orders.maker + and SrcEscrowCreated.taker = orders.call_from + and SrcEscrowCreated.token = orders.maker_asset +) + +-- createDstEscrow calls on all blockchains -- +, dst as ( + select + blockchain as dst_blockchain + , block_number as dst_block_number + , block_time as dst_block_time + , tx_hash as dst_tx_hash + , trace_address as dst_trace_address + , factory as dst_factory + , escrow as dst_escrow + , order_hash as dst_order_hash + , hashlock + , maker as dst_maker + , taker as dst_taker + , token as dst_token + , amount as dst_amount + , timelocks + , call_success as dst_creation_call_success + , wrapped_native_token_address as dst_wrapper + , row_number() over(partition by hashlock order by block_number, tx_hash, trace_address) as hashlockNum + from {{ ref('oneinch_escrow_dst_creations') }} + join {{ ref('oneinch_blockchains') }} using(blockchain) + {% if is_incremental() %} + where {{ incremental_predicate('block_time') }} + {% endif %} +) + -- output -- select @@ -108,39 +217,39 @@ select , call_error , call_type , maker - , receiver + , coalesce(dst_maker, receiver) as receiver , maker_asset , making_amount - , taker_asset - , taking_amount + , coalesce(dst_token, taker_asset) as taker_asset + , coalesce(dst_amount, taking_amount) as taking_amount , order_hash - , map_from_entries(array[ - ('partial', _partial) - , ('multiple', _multiple) - , ('fusion', _with_settlement or array_position(_settlements, call_from) > 0) - , ('first', row_number() over(partition by coalesce(order_hash, tx_hash) order by block_number, tx_index, call_trace_address) = 1) - ]) as flags - , concat( - cast(length(remains) + length(order_remains) as bigint) - , concat( - if(length(remains) > 0 - , transform(sequence(1, length(remains), 4), x -> bytearray_to_bigint(reverse(substr(reverse(remains), x, 4)))) - , array[bigint '0'] - ) - , array[bytearray_to_bigint(order_remains)] - ) - ) as remains + , map_concat(flags, map_from_entries(array[ + ('first', row_number() over(partition by coalesce(order_hash, tx_hash) order by block_number, tx_index, call_trace_address) = 1) + ])) as flags + , remains + , src_escrow + , coalesce(hashlock, cast(null as varbinary)) as hashlock + , dst_blockchain + , dst_block_number + , dst_block_time + , dst_tx_hash + , dst_escrow + , dst_maker + , dst_taker + , dst_token + , dst_amount + , dst_wrapper + , dst_creation_call_success + , args , date_trunc('minute', block_time) as minute , date(date_trunc('month', block_time)) as block_month +from ({{ + add_tx_columns( + model_cte = 'calculations' + , blockchain = blockchain + , columns = ['from', 'to', 'success', 'nonce', 'gas_price', 'priority_fee_per_gas', 'gas_used', 'index'] + ) +}}) as orders +left join dst using(hashlock, hashlockNum) -from ( - {{ - add_tx_columns( - model_cte = 'orders' - , blockchain = blockchain - , columns = ['from', 'to', 'success', 'nonce', 'gas_price', 'priority_fee_per_gas', 'gas_used', 'index'] - ) - }} -) - -{% endmacro %} +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_raw_traces_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_raw_traces_macro.sql index 0e5667d171b..7bc65f24feb 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_raw_traces_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/LOP/oneinch_lop_raw_traces_macro.sql @@ -11,7 +11,7 @@ with decoded_calls as ( {% if is_incremental() %} where {{ incremental_predicate('call_block_time') }} {% else %} - where call_block_time >= greatest(timestamp '{{ contract_data['start'] }}', timestamp '{{date_from}}') + where call_block_time >= greatest(timestamp '{{ contract_data['start'] }}', timestamp '{{date_from}}', timestamp {{ oneinch_easy_date() }}) {% endif %} {% if not outer_loop.last or not loop.last %} union all @@ -44,7 +44,7 @@ with decoded_calls as ( {% if is_incremental() %} {{ incremental_predicate('block_time') }} {% else %} - block_time >= timestamp '{{date_from}}' + block_time >= greatest(timestamp '{{ date_from }}', timestamp {{ oneinch_easy_date() }}) {% endif %} ) diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/_meta/oneinch_blockchain_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/_meta/oneinch_blockchain_macro.sql index 238b1e1ee3f..74d9a958b9e 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/_meta/oneinch_blockchain_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/_meta/oneinch_blockchain_macro.sql @@ -2,27 +2,109 @@ {% set config = { - "ethereum": "1, 'ETH', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 'https://etherscan.io', timestamp '2019-06-03 20:11', array[0xa88800cd213da5ae406ce248380802bd53b47647, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "bnb": "56, 'BNB', 0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c, 'https://bscscan.com', timestamp '2021-02-18 14:37', array[0x1d0ae300eec4093cee4367c00b228d10a5c7ac63, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "polygon": "137, 'MATIC', 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270, 'https://polygonscan.com', timestamp '2021-05-05 09:39', array[0x1e8ae092651e7b14e4d0f93611267c5be19b8b9f, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "arbitrum": "42161, 'ETH', 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 'https://arbiscan.io', timestamp '2021-06-22 10:27', array[0x4bc3e539aaa5b18a82f6cd88dc9ab0e113c63377, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "optimism": "10, 'ETH', 0x4200000000000000000000000000000000000006, 'https://explorer.optimism.io', timestamp '2021-11-12 09:07', array[0xd89adc20c400b6c45086a7f6ab2dca19745b89c2, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "avalanche_c": "43114, 'AVAX', 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7, 'https://snowtrace.io', timestamp '2021-12-22 13:18', array[0x7731f8df999a9441ae10519617c24568dc82f697, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "gnosis": "100, 'xDAI', 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d, 'https://gnosisscan.io', timestamp '2021-12-22 13:21', array[0xcbdb7490968d4dbf183c60fc899c2e9fbd445308, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "fantom": "250, 'FTM', 0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83, 'https://ftmscan.com', timestamp '2022-03-16 16:20', array[0xa218543cc21ee9388fa1e509f950fd127ca82155, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "base": "8453, 'ETH', 0x4200000000000000000000000000000000000006, 'https://basescan.org', timestamp '2023-08-08 22:19', array[0x7f069df72b7a39bce9806e3afaf579e54d8cf2b9, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "zksync": "324, 'ETH', 0x5aea5775959fbc2557cc8789bc1bf90a239d9a91, 'https://explorer.zksync.io', timestamp '2023-04-12 10:16', array[0x11de482747d1b39e599f120d526af512dd1a9326]", - "aurora": "1313161554, 'ETH', 0xc9bdeed33cd01541e1eed10f90519d2c06fe3feb, 'https://explorer.aurora.dev', timestamp '2022-05-25 16:14', array[0xd41b24bba51fac0e4827b6f94c0d6ddeb183cd64, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", - "klaytn": "8217, 'ETH', 0x, 'https://klaytnscope.com', timestamp '2022-08-02 09:39', array[0xa218543cc21ee9388fa1e509f950fd127ca82155, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "chain_id": { + "ethereum": "1", + "bnb": "56", + "polygon": "137", + "arbitrum": "42161", + "optimism": "10", + "avalanche_c": "43114", + "gnosis": "100", + "fantom": "250", + "base": "8453", + "zksync": "324", + "aurora": "1313161554", + "klaytn": "8217", + }, + "native_token_symbol": { + "ethereum": "'ETH'", + "bnb": "'BNB'", + "polygon": "'MATIC'", + "arbitrum": "'ETH'", + "optimism": "'ETH'", + "avalanche_c": "'AVAX'", + "gnosis": "'xDAI'", + "fantom": "'FTM'", + "base": "'ETH'", + "zksync": "'ETH'", + "aurora": "'ETH'", + "klaytn": "'ETH'", + }, + "wrapped_native_token_address": { + "ethereum": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "bnb": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", + "polygon": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", + "arbitrum": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", + "optimism": "0x4200000000000000000000000000000000000006", + "avalanche_c": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7", + "gnosis": "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d", + "fantom": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", + "base": "0x4200000000000000000000000000000000000006", + "zksync": "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", + "aurora": "0xc9bdeed33cd01541e1eed10f90519d2c06fe3feb", + "klaytn": "0x", + }, + "explorer_link": { + "ethereum": "'https://etherscan.io'", + "bnb": "'https://bscscan.com'", + "polygon": "'https://polygonscan.com'", + "arbitrum": "'https://arbiscan.io'", + "optimism": "'https://explorer.optimism.io'", + "avalanche_c": "'https://snowtrace.io'", + "gnosis": "'https://gnosisscan.io'", + "fantom": "'https://ftmscan.com'", + "base": "'https://basescan.org'", + "zksync": "'https://explorer.zksync.io'", + "aurora": "'https://explorer.aurora.dev'", + "klaytn": "'https://klaytnscope.com'", + }, + "first_deploy_at": { + "ethereum": "timestamp '2019-06-03 20:11'", + "bnb": "timestamp '2021-02-18 14:37'", + "polygon": "timestamp '2021-05-05 09:39'", + "arbitrum": "timestamp '2021-06-22 10:27'", + "optimism": "timestamp '2021-11-12 09:07'", + "avalanche_c": "timestamp '2021-12-22 13:18'", + "gnosis": "timestamp '2021-12-22 13:21'", + "fantom": "timestamp '2022-03-16 16:20'", + "base": "timestamp '2023-08-08 22:19'", + "zksync": "timestamp '2023-04-12 10:16'", + "aurora": "timestamp '2022-05-25 16:14'", + "klaytn": "timestamp '2022-08-02 09:39'", + }, + "fusion_settlement_addresses": { + "ethereum": "array[0xa88800cd213da5ae406ce248380802bd53b47647, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "bnb": "array[0x1d0ae300eec4093cee4367c00b228d10a5c7ac63, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "polygon": "array[0x1e8ae092651e7b14e4d0f93611267c5be19b8b9f, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "arbitrum": "array[0x4bc3e539aaa5b18a82f6cd88dc9ab0e113c63377, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "optimism": "array[0xd89adc20c400b6c45086a7f6ab2dca19745b89c2, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "avalanche_c": "array[0x7731f8df999a9441ae10519617c24568dc82f697, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "gnosis": "array[0xcbdb7490968d4dbf183c60fc899c2e9fbd445308, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "fantom": "array[0xa218543cc21ee9388fa1e509f950fd127ca82155, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "base": "array[0x7f069df72b7a39bce9806e3afaf579e54d8cf2b9, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "zksync": "array[0x11de482747d1b39e599f120d526af512dd1a9326]", + "aurora": "array[0xd41b24bba51fac0e4827b6f94c0d6ddeb183cd64, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + "klaytn": "array[0xa218543cc21ee9388fa1e509f950fd127ca82155, 0xfb2809a5314473e1165f6b58018e20ed8f07b840]", + }, + "escrow_factory_addresses": { + "ethereum": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a]", + "bnb": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a]", + "polygon": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a]", + "arbitrum": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a, 0xc02e6487fbf69d6849b4b9ad9ec0bf5ff8d0c2a1]", + "optimism": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a]", + "avalanche_c": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a]", + "gnosis": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a]", + "fantom": "array[]", + "base": "array[0xa7bcb4eac8964306f9e3764f67db6a7af6ddf99a]", + "zksync": "array[]", + "aurora": "array[]", + "klaytn": "array[]", + }, } %} -{% set column_names = - "blockchain, chain_id, native_token_symbol, wrapped_native_token_address, explorer_link, first_deploy_at, fusion_settlement_addresses" -%} - select * from (values - ('{{ blockchain }}', {{ config[blockchain] }}) -) as t({{ column_names }}) + ('{{ blockchain }}'{% for data in config.values() %}, {{ data.get(blockchain, "null") }}{% endfor %}) +) as t(blockchain{% for item in config.keys() %}, {{ item }}{% endfor %}) {% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/_meta/oneinch_easy_date.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/_meta/oneinch_easy_date.sql new file mode 100644 index 00000000000..1e3d7e8431a --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/_meta/oneinch_easy_date.sql @@ -0,0 +1,5 @@ +-- for CI purposes to manage from one place + +{% macro oneinch_easy_date() %} + {{ return("'2019-06-01'") }} -- "'2019-06-01'" +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_call_transfers_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_call_transfers_macro.sql index a6c9878889a..0a48c20411c 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_call_transfers_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_call_transfers_macro.sql @@ -4,7 +4,17 @@ ) %} - +-- base columns to not to duplicate in the union +{% set + calls_base_columns = [ + 'blockchain', + 'block_number', + 'block_time', + 'tx_hash', + 'call_trace_address', + 'dst_blockchain', + ] +%} with @@ -15,14 +25,63 @@ meta as ( from ({{ oneinch_blockchain_macro(blockchain) }}) ) +-- calls with escrow results on all blockchains -- +, results as ( + select + blockchain as result_blockchain + , block_number as result_block_number + , block_time as result_block_time + , tx_hash as result_tx_hash + , trace_address as result_trace_address + , hashlock + , escrow as result_escrow + , method as result_method + , amount as result_amount + from {{ ref('oneinch_escrow_results') }} + where + call_success + and tx_success + {% if is_incremental() %}and {{ incremental_predicate('block_time') }}{% endif %} -- with an incremental predicate, as the results always come after the creations +) + , calls as ( - select * from ({{ oneinch_calls_macro(blockchain) }}) + select + {{ calls_base_columns | join(', ') }} + , blockchain as result_blockchain + , block_number as result_block_number + , block_time as result_block_time + , tx_hash as result_tx_hash + , call_trace_address as result_trace_address + , cast(null as varbinary) as hashlock + , cast(null as varbinary) as result_escrow + , null as result_method + , null as result_amount + from ({{ oneinch_calls_macro(blockchain) }}) where tx_success and call_success - {% if is_incremental() %} - and {{ incremental_predicate('block_time') }} - {% endif %} + {% if is_incremental() %}and {{ incremental_predicate('block_time') }}{% endif %} + + union all -- add calls with escrow results + + select + {{ calls_base_columns | join(', ') }} + , result_blockchain + , result_block_number + , result_block_time + , result_tx_hash + , result_trace_address + , hashlock + , result_escrow + , result_method + , result_amount + from ({{ oneinch_calls_macro(blockchain) }}) + join results using(hashlock) -- escrow results only + where + tx_success + and call_success + and result_escrow in (src_escrow, dst_escrow) + {% if is_incremental() %}and {{ incremental_predicate('block_time') }}{% endif %} ) , transfers as ( @@ -31,7 +90,7 @@ meta as ( {% if is_incremental() %} {{ incremental_predicate('block_time') }} {% else %} - block_time >= (select first_deploy_at from meta) + block_time >= greatest((select first_deploy_at from meta), timestamp {{ oneinch_easy_date() }}) {% endif %} ) @@ -41,17 +100,27 @@ meta as ( , calls.block_number , calls.block_time , calls.tx_hash - , call_trace_address - , transfer_trace_address + , calls.call_trace_address + , calls.dst_blockchain + , calls.hashlock + , calls.result_escrow + , calls.result_trace_address + , calls.result_method + , calls.result_amount + , transfers.blockchain as transfer_blockchain + , transfers.block_number as transfer_block_number + , transfers.block_time as transfer_block_time + , transfers.tx_hash as transfer_tx_hash + , transfers.transfer_trace_address , contract_address , amount , transfer_from , transfer_to from calls join transfers on - calls.block_number = transfers.block_number - and calls.tx_hash = transfers.tx_hash - and slice(transfer_trace_address, 1, cardinality(call_trace_address)) = call_trace_address + transfers.block_number = calls.result_block_number + and transfers.tx_hash = calls.result_tx_hash + and slice(transfer_trace_address, 1, cardinality(result_trace_address)) = result_trace_address ) -- output -- @@ -62,6 +131,16 @@ select , block_time , tx_hash , call_trace_address + , dst_blockchain + , hashlock + , result_escrow + , result_trace_address + , result_method + , result_amount + , transfer_blockchain + , transfer_block_number + , transfer_block_time + , transfer_tx_hash , transfer_trace_address , if(contract_address = 0xae, wrapped_native_token_address, contract_address) as contract_address , amount @@ -72,8 +151,8 @@ select coalesce(transfer_from, transfer_to) is not null , count(*) over(partition by blockchain, tx_hash, call_trace_address, array_join(array_sort(array[transfer_from, transfer_to]), '')) ) as transfers_between_players - , date_trunc('minute', block_time) as minute - , date(date_trunc('month', block_time)) as block_month + , date_trunc('minute', transfer_block_time) as minute + , date(date_trunc('month', transfer_block_time)) as block_month from merging, meta {% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_calls_macro.sql b/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_calls_macro.sql index 912f8ee62bf..66422201f46 100644 --- a/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_calls_macro.sql +++ b/dbt_subprojects/dex/macros/models/_project/oneinch/oneinch_calls_macro.sql @@ -44,12 +44,20 @@ calls as ( from ( select {{ columns }} - , null as maker + , cast(null as varbinary) as maker , dst_receiver as receiver , src_token_address , src_token_amount + , cast(null as varbinary) as src_escrow + , cast(null as varbinary) as hashlock , dst_token_address , dst_token_amount + , blockchain as dst_blockchain + , cast(null as bigint) as dst_block_number + , cast(null as timestamp) as dst_block_time + , cast(null as varbinary) as dst_tx_hash + , cast(null as varbinary) as dst_escrow + , cast(null as varbinary) as dst_wrapper , cast(null as varbinary) as order_hash , map_concat(flags, map_from_entries(array[('fusion', false)])) as flags from {{ ref('oneinch_' + blockchain + '_ar') }} @@ -62,8 +70,16 @@ calls as ( , receiver , maker_asset as src_token_address , making_amount as src_token_amount + , src_escrow + , hashlock , taker_asset as dst_token_address , taking_amount as dst_token_amount + , dst_blockchain + , dst_block_number + , dst_block_time + , dst_tx_hash + , dst_escrow + , dst_wrapper , order_hash , flags from {{ ref('oneinch_' + blockchain + '_lop') }} @@ -102,8 +118,16 @@ select , receiver , src_token_address , src_token_amount + , src_escrow + , hashlock , dst_token_address , dst_token_amount + , dst_blockchain + , dst_block_number + , dst_block_time + , dst_tx_hash + , dst_escrow + , dst_wrapper , order_hash , flags from calls diff --git a/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_maker_psm_method.sql b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_maker_psm_method.sql new file mode 100644 index 00000000000..200030dc251 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_maker_psm_method.sql @@ -0,0 +1,48 @@ +{% macro paraswap_v6_maker_psm_method(table_name ) %} + SELECT + call_block_time, + call_block_number, + call_tx_hash, + contract_address as project_contract_address, + call_trace_address, + JSON_EXTRACT_SCALAR(makerPSMData, '$.srcToken') as srcToken, + JSON_EXTRACT_SCALAR(makerPSMData, '$.destToken') as destToken, + try_cast( + JSON_EXTRACT_SCALAR(makerPSMData, '$.fromAmount') as uint256 + ) AS fromAmount, + try_cast( + JSON_EXTRACT_SCALAR(makerPSMData, '$.toAmount') as uint256 + ) AS toAmount, + try_cast( + JSON_EXTRACT_SCALAR(makerPSMData, '$.toAmount') as uint256 + ) AS quotedAmount, + output_receivedAmount, + JSON_EXTRACT_SCALAR(makerPSMData, '$.metadata') AS metadata, + concat( + '0x', + regexp_replace( + try_cast( + try_cast( + bitwise_and( + try_cast( + JSON_EXTRACT_SCALAR(makerPSMData, '$.beneficiaryDirectionApproveFlag') AS UINT256 + ), + varbinary_to_uint256 (0xffffffffffffffffffffffffffffffffffffffff) + ) as VARBINARY + ) as VARCHAR + ), + '^(0x)?(00){12}' -- shrink hex to get address format (bytes20) + ) + ) as beneficiary, + 0 as partnerAndFee, + 0 as output_partnerShare, + 0 as output_paraswapShare, + 'swapExactAmountInOutOnMakerPSM' as method + FROM + {{ table_name }} + WHERE + call_success = TRUE + {% if is_incremental() %} + AND {{ incremental_predicate('call_block_time') }} + {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_rfq_method.sql b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_rfq_method.sql new file mode 100644 index 00000000000..395492c3171 --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_rfq_method.sql @@ -0,0 +1,33 @@ +{% macro paraswap_v6_rfq_method(table_name) %} + SELECT + call_block_time, + call_block_number, + call_tx_hash, + contract_address as project_contract_address, + call_trace_address, + JSON_EXTRACT_SCALAR(JSON_EXTRACT_SCALAR(orders[1], '$.order'), '$.takerAsset') as srcToken, + JSON_EXTRACT_SCALAR(JSON_EXTRACT_SCALAR(orders[1], '$.order'), '$.makerAsset') as destToken, + try_cast( + JSON_EXTRACT_SCALAR(data, '$.fromAmount') as uint256 + ) AS fromAmount, + try_cast( + JSON_EXTRACT_SCALAR(data, '$.toAmount') as uint256 + ) AS toAmount, + try_cast( + JSON_EXTRACT_SCALAR(data, '$.toAmount') as uint256 + ) AS quotedAmount, + output_receivedAmount, + JSON_EXTRACT_SCALAR(data, '$.metadata') AS metadata, + JSON_EXTRACT_SCALAR(data, '$.beneficiary') AS beneficiary, + 0 as partnerAndFee, + 0 as output_partnerShare, + 0 as output_paraswapShare, + 'swapOnAugustusRFQTryBatchFill' as method + FROM + {{ table_name }} + WHERE + call_success = TRUE + {% if is_incremental() %} + AND {{ incremental_predicate('call_block_time') }} + {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_trades_master.sql b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_trades_master.sql index 9f1b6821212..260606a0541 100644 --- a/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_trades_master.sql +++ b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_trades_master.sql @@ -9,6 +9,12 @@ swapExactAmountInOnCurveV1 as ({{ paraswap_v6_uniswaplike_method( source(project + '_' + blockchain, contract_name + '_call_swapExactAmountInOnCurveV1'), 'swapExactAmountInOnCurveV1', 'curveV1Data') }}), swapExactAmountInOnCurveV2 as ({{ paraswap_v6_uniswaplike_method( source(project + '_' + blockchain, contract_name + '_call_swapExactAmountInOnCurveV2'), 'swapExactAmountInOnCurveV2', 'curveV2Data') }}), swapExactAmountInOnBalancerV2 as ({{ paraswap_v6_balancer_v2_method('swapExactAmountInOnBalancerV2_decoded', 'swapExactAmountInOnBalancerV2_raw', source(project + '_' + blockchain, contract_name + '_call_swapExactAmountInOnBalancerV2'), 'in', 'swapExactAmountInOnBalancerV2') }}) + -- TODO: should be possible to improve this conditional code + {% if contract_details['version'] == '6.2' %} + ,swapOnAugustusRFQTryBatchFill as ({{ paraswap_v6_rfq_method( source(project + '_' + blockchain, contract_name + '_call_swapOnAugustusRFQTryBatchFill')) }}) -- RFQ - not distinguishing between buy/sell + ,swapExactAmountInOutOnMakerPSM as ({{ paraswap_v6_maker_psm_method( source(project + '_' + blockchain, contract_name + '_call_swapExactAmountInOutOnMakerPSM')) }}) -- Maker PSM - not distinguishing between buy/sell + {% endif %} + select *, fromAmount as spentAmount, @@ -44,6 +50,11 @@ from * from swapExactAmountInOnBalancerV2 + -- TODO: should be possible to improve this conditional code + {% if contract_details['version'] == '6.2' %} + union select * from swapOnAugustusRFQTryBatchFill + union select * from swapExactAmountInOutOnMakerPSM + {% endif %} ) ), buy_trades as ( @@ -101,9 +112,9 @@ select '{{ contract_details['version'] }}' as version, call_block_time as blockTime, call_block_number as blockNumber, - call_tx_hash as txHash, + call_tx_hash as call_tx_hash, project_contract_address as projectContractAddress, - call_trace_address as callTraceAddress, + call_trace_address as call_trace_address, srcToken, destToken, fromAmount, @@ -148,12 +159,12 @@ select "version": "6.1", }, "AugustusV6_2": { - "version": "6.2", + "version": "6.2", } } %} - {% for contract_name, contract_details in contracts.items() %} - select * from ({{ paraswap_v6_trades_by_contract(blockchain, project, contract_name, contract_details) }}) + {% for contract_name, contract_details in contracts.items() %} + select * from ({{ paraswap_v6_trades_by_contract(blockchain, project, contract_name, contract_details) }}) {% if not loop.last %} union all {% endif %} diff --git a/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_uniswaplike_method.sql b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_uniswaplike_method.sql index 260bf0a3b9a..b7e6cda0f48 100644 --- a/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_uniswaplike_method.sql +++ b/dbt_subprojects/dex/macros/models/_project/paraswap/v6/paraswap_v6_uniswaplike_method.sql @@ -3,7 +3,7 @@ call_block_time, call_block_number, call_tx_hash, - contract_address as project_contract_address, + contract_address as project_contract_address, call_trace_address, JSON_EXTRACT_SCALAR({{ data_field }}, '$.srcToken') AS srcToken, JSON_EXTRACT_SCALAR({{ data_field }}, '$.destToken') AS destToken, diff --git a/dbt_subprojects/dex/macros/models/_project/valantis_compatible_trades.sql b/dbt_subprojects/dex/macros/models/_project/valantis_compatible_trades.sql new file mode 100644 index 00000000000..a447ff4dbaa --- /dev/null +++ b/dbt_subprojects/dex/macros/models/_project/valantis_compatible_trades.sql @@ -0,0 +1,52 @@ +{% macro valantis_compatible_hot_trades( + blockchain = null + , project = null + , version = null + , HOT_evt_Swap = null + , Pair_evt_Swap = null + , Factory_evt_PoolCreated = null + ) +%} +WITH dexs AS +( + SELECT distinct t.evt_block_number AS block_number + , t.evt_block_time AS block_time + , t.amountOut AS token_bought_amount_raw + , t.amountIn AS token_sold_amount_raw + , CASE WHEN t.isZeroToOne THEN f.token1 ELSE f.token0 END AS token_bought_address + , CASE WHEN t.isZeroToOne THEN f.token0 ELSE f.token1 END AS token_sold_address + , t.sender AS taker + , coalesce(h.contract_address, t.contract_address) AS maker -- HOT for HOTSwaps (solver orders), SovereignPool for AMM swaps (permissionless) + , t.contract_address AS project_contract_address + , t.evt_tx_hash AS tx_hash + , t.evt_index AS evt_index + FROM {{ Pair_evt_Swap }} AS t + INNER JOIN {{ Factory_evt_PoolCreated }} AS f + ON t.contract_address = f.pool + LEFT JOIN {{ HOT_evt_Swap }} AS h + ON t.evt_block_number = h.evt_block_number AND t.evt_tx_hash = h.evt_tx_hash AND t.evt_index = h.evt_index + 3 + {% if is_incremental() %} + WHERE + {{ incremental_predicate('t.evt_block_time') }} + {% endif %} +) + +SELECT '{{ blockchain }}' AS blockchain + , '{{ project }}' AS project + , '{{ version }}' AS version + , 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 +FROM + dexs +{% endmacro %} diff --git a/dbt_subprojects/dex/macros/models/enrich_dex_aggregator_trades.sql b/dbt_subprojects/dex/macros/models/enrich_dex_aggregator_trades.sql new file mode 100644 index 00000000000..fe88afc97dc --- /dev/null +++ b/dbt_subprojects/dex/macros/models/enrich_dex_aggregator_trades.sql @@ -0,0 +1,99 @@ +{% macro enrich_dex_aggregator_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.block_month + , base_trades.block_date + , base_trades.block_time +-- , base_trades.block_number -- temporary missing + , 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.trace_address + , 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 + , 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 + , trace_address + , evt_index +FROM + enrichments_with_prices + +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/balancer/labels/polygon/labels_balancer_v2_pools_polygon.sql b/dbt_subprojects/dex/models/_projects/balancer/labels/polygon/labels_balancer_v2_pools_polygon.sql index 11f9af6d31e..3a396d3c880 100644 --- a/dbt_subprojects/dex/models/_projects/balancer/labels/polygon/labels_balancer_v2_pools_polygon.sql +++ b/dbt_subprojects/dex/models/_projects/balancer/labels/polygon/labels_balancer_v2_pools_polygon.sql @@ -246,7 +246,7 @@ WITH pools AS ( 0 AS normalized_weight, cc._name, 'FX' AS pool_type - FROM {{ source('xavefinance_avalanche_c', 'FXPoolFactory_call_newFXPool') }} cc + FROM {{ source('xavefinance_polygon', 'FXPoolFactory_call_newFXPool') }} cc CROSS JOIN UNNEST(_assetsToRegister) AS t (token) WHERE call_success ), diff --git a/dbt_subprojects/dex/models/_projects/balancer/trades/ethereum/balancer_ethereum_trades.sql b/dbt_subprojects/dex/models/_projects/balancer/trades/ethereum/balancer_ethereum_trades.sql index 5061fee6b77..965b86cdf54 100644 --- a/dbt_subprojects/dex/models/_projects/balancer/trades/ethereum/balancer_ethereum_trades.sql +++ b/dbt_subprojects/dex/models/_projects/balancer/trades/ethereum/balancer_ethereum_trades.sql @@ -7,7 +7,8 @@ {% set balancer_models = [ ref('balancer_v1_ethereum_trades'), - ref('balancer_v2_ethereum_trades') + ref('balancer_v2_ethereum_trades'), + ref('balancer_cowswap_amm_ethereum_trades') ] %} SELECT * diff --git a/dbt_subprojects/dex/models/_projects/balancer/trades/gnosis/balancer_gnosis_trades.sql b/dbt_subprojects/dex/models/_projects/balancer/trades/gnosis/balancer_gnosis_trades.sql index 5bcc25d1203..abc1b89aa99 100644 --- a/dbt_subprojects/dex/models/_projects/balancer/trades/gnosis/balancer_gnosis_trades.sql +++ b/dbt_subprojects/dex/models/_projects/balancer/trades/gnosis/balancer_gnosis_trades.sql @@ -6,7 +6,8 @@ {% set balancer_models = [ - ref('balancer_v2_gnosis_trades') + ref('balancer_v2_gnosis_trades'), + ref('balancer_cowswap_amm_gnosis_trades') ] %} SELECT * diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/_schema.yml b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/_schema.yml similarity index 69% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/_schema.yml rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/_schema.yml index 6f704439383..00c2c437fdd 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/_schema.yml @@ -3,7 +3,7 @@ version: 2 models: - name: balancer_cowswap_amm_trades meta: - blockchain: ethereum, gnosis + blockchain: arbitrum, ethereum, gnosis sector: trades project: balancer_cowswap_amm contributors: viniabussafi @@ -87,34 +87,9 @@ models: - name: pool_symbol - name: swap_fee - - name: balancer_cowswap_amm_balances - meta: - blockchain: ethereum, gnosis - project: balancer_cowswap_amm - contributors: viniabussafi - config: - tags: ['ethereum', 'gnosis', 'balancer', 'balances'] - description: > - ERC20 token rolling sum balances on Balancer, an automated portfolio manager and trading platform. - columns: - - &day - name: day - description: "UTC event block time truncated to the day mark" - tests: - - not_null - - &pool_address - name: pool_address - description: "Balancer CoWSwap AMM pool contract address" - - &token_address - name: token_address - description: "Token contract address" - - &token_balance_raw - name: token_balance_raw - description: "Balance of a token" - - name: labels_balancer_cowswap_amm_pools meta: - blockchain: ethereum, gnosis + blockchain: arbitrum, ethereum, gnosis sector: labels project: balancer_cowswap_amm contributors: viniabussafi @@ -149,36 +124,4 @@ models: description: "Name of the label model sourced from" - &label_type name: label_type - description: "Type of label (see labels overall readme)" - - - name: balancer_cowswap_amm_liquidity - meta: - blockchain: ethereum, gnosis - project: balancer_cowswap_amm - contributors: viniabussafi - config: - tags: ['ethereum', 'gnosis', 'balancer', 'pools', 'liquidity'] - description: > - Balancer CoWSwap AMM pools liquidity by token in Ethereum. - columns: - - *day - - name: pool_id - - *pool_address - - name: pool_symbol - - *version - - *blockchain - - name: pool_type - - *token_address - - &token_symbol - name: token_symbol - description: "Token symbol" - - *token_balance_raw - - &token_balance - name: token_balance - description: "Balance of the token in the pool" - - &protocol_liquidity_usd - name: protocol_liquidity_usd - description: "Protocol liquidity in USD" - - &protocol_liquidity_eth - name: protocol_liquidity_eth - description: "Protocol liquidity in ETH" + description: "Type of label (see labels overall readme)" \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/_schema.yml b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/_schema.yml new file mode 100644 index 00000000000..7fb5cb2ef08 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/_schema.yml @@ -0,0 +1,137 @@ +version: 2 + +models: + - name: balancer_cowswap_amm_arbitrum_trades + meta: + blockchain: arbitrum + sector: trades + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['balancer', 'cowswap', 'arbitrum', 'amm', 'trades'] + description: "Trades on Balancer CoWSwap AMM pools" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + columns: + - &blockchain + name: blockchain + description: "Blockchain" + - &project + name: project + description: "Project name (balancer)" + - &version + name: version + description: "Version of the project" + - &block_month + name: block_month + description: "Block month in UTC" + - &block_date + name: block_date + description: "Block date in UTC" + - &block_time + name: block_time + description: 'Block time in UTC' + - &block_number + name: block_number + description: 'Block number' + - &token_bought_symbol + name: token_bought_symbol + description: "Token symbol for token bought in the trade" + - &token_sold_symbol + name: token_sold_symbol + description: "Token symbol for token sold in the trade" + - &token_pair + name: token_pair + description: "Token symbol pair for each token involved in the trade" + - &token_bought_amount + name: token_bought_amount + description: "Value of the token bought at time of execution in the original currency" + - &token_sold_amount + name: token_sold_amount + description: "Value of the token sold at time of execution in the original currency" + - &token_bought_amount_raw + name: token_bought_amount_raw + description: "Raw value of the token bought at time of execution in the original currency" + - &token_sold_amount_raw + name: token_sold_amount_raw + description: "Raw value of the token sold at time of execution in the original currency" + - &amount_usd + name: amount_usd + description: "USD value of the trade at time of execution" + - &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 trader who purchased a token" + - &maker + name: maker + description: "Address of trader who sold a token" + - &project_contract_address + name: project_contract_address + description: "Pool address" + - &tx_hash + name: tx_hash + description: "Tx. Hash" + - &tx_from + name: tx_from + description: "transaction.from" + - &tx_to + name: tx_to + description: "transaction.to" + - &evt_index + name: evt_index + description: 'Event index' + - name: pool_type + - name: pool_symbol + - name: swap_fee + + - name: labels_balancer_cowswap_amm_pools_arbitrum + meta: + blockchain: arbitrum + sector: labels + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['labels', 'arbitrum', 'balancer', 'pools'] + description: "Balancer CoWSwap AMM liquidity pools created on arbitrum." + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - address + columns: + - *blockchain + - &address + name: address + description: "Address of liquidity pool" + - &name + name: name + description: "Label name of pool containing the token symbols and their respective weights (if applicable)" + - name: pool_type + - &category + name: category + description: "Label category" + - &contributor + name: contributor + description: "Wizard(s) contributing to labels" + - &source + name: source + description: "How were labels generated (could be static or query)" + - &created_at + name: created_at + description: "When were labels created" + - &updated_at + name: updated_at + description: "When were labels updated for the last time" + - &model_name + name: model_name + description: "Name of the label model sourced from" + - &label_type + name: label_type + description: "Type of label (see labels overall readme)" \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_trades.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_trades.sql new file mode 100644 index 00000000000..f62a21144a0 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_trades.sql @@ -0,0 +1,74 @@ +{% set blockchain = 'arbitrum' %} + +{{ + config( + schema = 'balancer_cowswap_amm_' + blockchain, + alias = 'trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['tx_hash', 'evt_index'] + ) +}} + + SELECT + '{{blockchain}}' AS blockchain + , 'balancer' AS project + , '1' AS version + , CAST(date_trunc('month', trade.evt_block_time) AS DATE) AS block_month + , CAST(date_trunc('day', trade.evt_block_time) AS DATE) AS block_date + , trade.evt_block_time AS block_time + , trade.evt_block_number block_number + , tb.symbol AS token_bought_symbol + , tb.symbol AS token_sold_symbol + , CONCAT(ts.symbol, '-', tb.symbol) AS token_pair + , (trade.buyAmount / POWER(10, COALESCE(pb.decimals, tb.decimals))) AS token_bought_amount + , ((trade.sellAmount - trade.feeAmount) / POWER(10, COALESCE(ps.decimals, ts.decimals))) AS token_sold_amount + , trade.buyAmount AS token_bought_amount_raw + , trade.sellAmount AS token_sold_amount_raw + , COALESCE(trade.buyAmount / POWER(10, COALESCE(pb.decimals, tb.decimals)) * pb.price, + trade.sellAmount / POWER(10, COALESCE(ps.decimals, ts.decimals)) * ps.price) + AS amount_usd + ,trade.buyToken AS token_bought_address + ,trade.sellToken AS token_sold_address + ,CAST(NULL AS VARBINARY) AS taker + ,CAST(NULL AS VARBINARY) AS maker + , pool.bPool AS project_contract_address + , pool.bPool AS pool_id + , trade.evt_tx_hash AS tx_hash + , settlement.solver AS tx_from + , trade.contract_address AS tx_to + , trade.evt_index AS evt_index + , p.name AS pool_symbol + , p.pool_type + , (trade.feeAmount / POWER (10, ts.decimals)) AS swap_fee + FROM {{ source('gnosis_protocol_v2_arbitrum', 'GPv2Settlement_evt_Trade') }} trade + INNER JOIN {{ source('b_cow_amm_arbitrum', 'BCoWFactory_evt_LOG_NEW_POOL') }} pool + ON trade.owner = pool.bPool + LEFT JOIN {{ source('prices', 'usd') }} AS ps + ON sellToken = ps.contract_address + AND ps.minute = date_trunc('minute', trade.evt_block_time) + AND ps.blockchain = '{{blockchain}}' + {% if is_incremental() %} + AND {{ incremental_predicate('ps.minute') }} + {% endif %} + LEFT JOIN {{ source('prices', 'usd') }} AS pb + ON pb.contract_address = buyToken + AND pb.minute = date_trunc('minute', trade.evt_block_time) + AND pb.blockchain = '{{blockchain}}' + {% if is_incremental() %} + AND {{ incremental_predicate('pb.minute') }} + {% endif %} + LEFT JOIN {{ source('tokens', 'erc20') }} AS ts + ON trade.sellToken = ts.contract_address + AND ts.blockchain = '{{blockchain}}' + LEFT JOIN {{ source('tokens', 'erc20') }} AS tb + ON trade.buyToken = tb.contract_address + AND tb.blockchain = '{{blockchain}}' + LEFT JOIN {{ source('gnosis_protocol_v2_arbitrum', 'GPv2Settlement_evt_Settlement') }} AS settlement + ON trade.evt_tx_hash = settlement.evt_tx_hash + LEFT JOIN {{ ref('labels_balancer_cowswap_amm_pools_arbitrum') }} p ON p.address = trade.owner + {% if is_incremental() %} + WHERE {{ incremental_predicate('trade.evt_block_time') }} + {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/labels_balancer_cowswap_amm_pools_arbitrum.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/labels_balancer_cowswap_amm_pools_arbitrum.sql new file mode 100644 index 00000000000..0fdeb67eecf --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/arbitrum/labels_balancer_cowswap_amm_pools_arbitrum.sql @@ -0,0 +1,71 @@ +{% set blockchain = 'arbitrum' %} + +{{config( + schema = 'labels', + alias = 'balancer_cowswap_amm_pools_' + blockchain, + materialized = 'table', + file_format = 'delta' + ) +}} + +WITH events AS ( + -- binds + SELECT call_block_number AS block_number, + contract_address AS pool, + token, + denorm + FROM {{ source('b_cow_amm_arbitrum', 'BCoWPool_call_bind') }} + WHERE call_success + + UNION all + + -- unbinds + SELECT call_block_number AS block_number, + contract_address AS pool, + token, + uint256 '0' AS denorm + FROM {{ source('b_cow_amm_arbitrum', 'BCoWPool_call_unbind') }} + WHERE call_success +), + +state_with_gaps AS ( + SELECT events.block_number + , events.pool + , events.token + , CAST(events.denorm AS uint256) AS denorm, + LEAD(events.block_number, 1, 99999999) OVER (PARTITION BY events.pool, events.token ORDER BY events.block_number) AS next_block_number + FROM events +), + +settings AS ( + SELECT pool, + coalesce(t.symbol,'?') AS symbol, + denorm, + next_block_number + FROM state_with_gaps s + LEFT JOIN {{ source('tokens', 'erc20') }} t ON s.token = t.contract_address + AND t.blockchain = '{{blockchain}}' + WHERE next_block_number = 99999999 + AND denorm > uint256 '0' +) + + SELECT + '{{blockchain}}' AS blockchain, + pool AS address, + CONCAT('BCowAMM: ', array_join(array_agg(symbol), '/'), ' ', array_join(array_agg(cast(norm_weight AS varchar)), '/')) AS name, + 'Balancer CoWSwap AMM' AS pool_type, + 'balancer_cowswap_amm_pool' AS category, + 'balancerlabs' AS contributor, + 'query' AS source, + timestamp '2024-07-20' AS created_at, + now() AS updated_at, + 'balancer_cowswap_amm_pools_ethereum' AS model_name, + 'identifier' as label_type + FROM ( + SELECT s1.pool, symbol, cast(100*denorm/total_denorm AS integer) AS norm_weight FROM settings s1 + INNER JOIN (SELECT pool, sum(denorm) AS total_denorm FROM settings GROUP BY pool) s2 + ON s1.pool = s2.pool + ORDER BY 1 ASC , 3 DESC, 2 ASC + ) s + GROUP BY 1, 2 + \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_trades.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_trades.sql similarity index 93% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_trades.sql rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_trades.sql index 27f29ce9bd4..4f0799af9a2 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_trades.sql +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_trades.sql @@ -7,6 +7,7 @@ }} {% set b_cow_amm_models = [ + ref('balancer_cowswap_amm_arbitrum_trades'), ref('balancer_cowswap_amm_ethereum_trades'), ref('balancer_cowswap_amm_gnosis_trades') ] %} @@ -35,6 +36,7 @@ FROM ( , taker , maker , project_contract_address + , pool_id , tx_hash , tx_from , tx_to diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/_schema.yml b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/_schema.yml similarity index 68% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/_schema.yml rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/_schema.yml index 499448a01f7..61538ab2b41 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/_schema.yml @@ -92,37 +92,6 @@ models: - name: pool_symbol - name: swap_fee - - name: balancer_cowswap_amm_ethereum_balances - meta: - blockchain: ethereum - project: balancer_cowswap_amm - contributors: viniabussafi - config: - tags: ['ethereum', 'balancer', 'balances'] - description: > - ERC20 token rolling sum balances on Balancer, an automated portfolio manager and trading platform. - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - day - - pool_address - - token_address - columns: - - &day - name: day - description: "UTC event block time truncated to the day mark" - tests: - - not_null - - &pool_address - name: pool_address - description: "Balancer CoWSwap AMM pool contract address" - - &token_address - name: token_address - description: "Token contract address" - - &token_balance_raw - name: token_balance_raw - description: "Balance of a token" - - name: labels_balancer_cowswap_amm_pools_ethereum meta: blockchain: ethereum @@ -165,42 +134,4 @@ models: description: "Name of the label model sourced from" - &label_type name: label_type - description: "Type of label (see labels overall readme)" - - - name: balancer_cowswap_amm_ethereum_liquidity - meta: - blockchain: ethereum - project: balancer_cowswap_amm - contributors: viniabussafi - config: - tags: ['ethereum', 'balancer', 'pools', 'liquidity'] - description: > - Balancer CoWSwap AMM pools liquidity by token in Ethereum. - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - day - - pool_id - - token_address - columns: - - *day - - name: pool_id - - *pool_address - - name: pool_symbol - - *version - - *blockchain - - name: pool_type - - *token_address - - &token_symbol - name: token_symbol - description: "Token symbol" - - *token_balance_raw - - &token_balance - name: token_balance - description: "Balance of the token in the pool" - - &protocol_liquidity_usd - name: protocol_liquidity_usd - description: "Protocol liquidity in USD" - - &protocol_liquidity_eth - name: protocol_liquidity_eth - description: "Protocol liquidity in ETH" + description: "Type of label (see labels overall readme)" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_trades.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_trades.sql similarity index 98% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_trades.sql rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_trades.sql index 1d17d5770fb..7e0536ffc48 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_trades.sql +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_trades.sql @@ -14,7 +14,7 @@ SELECT '{{blockchain}}' AS blockchain - , 'balancer_cowswap_amm' AS project + , 'balancer' AS project , '1' AS version , CAST(date_trunc('month', trade.evt_block_time) AS DATE) AS block_month , CAST(date_trunc('day', trade.evt_block_time) AS DATE) AS block_date @@ -34,6 +34,7 @@ ,trade.sellToken AS token_sold_address ,CAST(NULL AS VARBINARY) AS taker ,CAST(NULL AS VARBINARY) AS maker + , pool.bPool AS pool_id , pool.bPool AS project_contract_address , trade.evt_tx_hash AS tx_hash , settlement.solver AS tx_from diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/labels_balancer_cowswap_amm_pools_ethereum.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/labels_balancer_cowswap_amm_pools_ethereum.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/labels_balancer_cowswap_amm_pools_ethereum.sql rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/ethereum/labels_balancer_cowswap_amm_pools_ethereum.sql diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/_schema.yml b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/_schema.yml similarity index 68% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/_schema.yml rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/_schema.yml index 8ddfdf5598e..6eb13143915 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/_schema.yml @@ -92,37 +92,6 @@ models: - name: pool_symbol - name: swap_fee - - name: balancer_cowswap_amm_gnosis_balances - meta: - blockchain: gnosis - project: balancer_cowswap_amm - contributors: viniabussafi - config: - tags: ['gnosis', 'balancer', 'balances'] - description: > - ERC20 token rolling sum balances on Balancer, an automated portfolio manager and trading platform. - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - day - - pool_address - - token_address - columns: - - &day - name: day - description: "UTC event block time truncated to the day mark" - tests: - - not_null - - &pool_address - name: pool_address - description: "Balancer CoWSwap AMM pool contract address" - - &token_address - name: token_address - description: "Token contract address" - - &token_balance_raw - name: token_balance_raw - description: "Balance of a token" - - name: labels_balancer_cowswap_amm_pools_gnosis meta: blockchain: gnosis @@ -165,42 +134,4 @@ models: description: "Name of the label model sourced from" - &label_type name: label_type - description: "Type of label (see labels overall readme)" - - - name: balancer_cowswap_amm_gnosis_liquidity - meta: - blockchain: gnosis - project: balancer_cowswap_amm - contributors: viniabussafi - config: - tags: ['gnosis', 'balancer', 'pools', 'liquidity'] - description: > - Balancer CoWSwap AMM pools liquidity by token in gnosis. - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - day - - pool_id - - token_address - columns: - - *day - - name: pool_id - - *pool_address - - name: pool_symbol - - *version - - *blockchain - - name: pool_type - - *token_address - - &token_symbol - name: token_symbol - description: "Token symbol" - - *token_balance_raw - - &token_balance - name: token_balance - description: "Balance of the token in the pool" - - &protocol_liquidity_usd - name: protocol_liquidity_usd - description: "Protocol liquidity in USD" - - &protocol_liquidity_eth - name: protocol_liquidity_eth - description: "Protocol liquidity in ETH" + description: "Type of label (see labels overall readme)" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_trades.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_trades.sql similarity index 98% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_trades.sql rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_trades.sql index 53773bf6269..4dee7045fd1 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_trades.sql +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_trades.sql @@ -14,7 +14,7 @@ SELECT '{{blockchain}}' AS blockchain - , 'balancer_cowswap_amm' AS project + , 'balancer' AS project , '1' AS version , CAST(date_trunc('month', trade.evt_block_time) AS DATE) AS block_month , CAST(date_trunc('day', trade.evt_block_time) AS DATE) AS block_date @@ -35,6 +35,7 @@ ,CAST(NULL AS VARBINARY) AS taker ,CAST(NULL AS VARBINARY) AS maker , pool.bPool AS project_contract_address + , pool.bPool AS pool_id , trade.evt_tx_hash AS tx_hash , settlement.solver AS tx_from , trade.contract_address AS tx_to diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/labels_balancer_cowswap_amm_pools_gnosis.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/labels_balancer_cowswap_amm_pools_gnosis.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/labels_balancer_cowswap_amm_pools_gnosis.sql rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/gnosis/labels_balancer_cowswap_amm_pools_gnosis.sql diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/labels_balancer_cowswap_amm_pools.sql b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/labels_balancer_cowswap_amm_pools.sql similarity index 84% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/labels_balancer_cowswap_amm_pools.sql rename to dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/labels_balancer_cowswap_amm_pools.sql index 0b9add42ad8..c4032bb58a7 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/labels_balancer_cowswap_amm_pools.sql +++ b/dbt_subprojects/dex/models/_projects/balancer_cowswap_amm/labels_balancer_cowswap_amm_pools.sql @@ -1,11 +1,12 @@ {{config( schema = 'labels', - alias = 'balancer_cowswap_amm_pool', + alias = 'balancer_cowswap_amm_pools', materialized = 'view' ) }} {% set b_cow_amm_models = [ + ref('labels_balancer_cowswap_amm_pools_arbitrum'), ref('labels_balancer_cowswap_amm_pools_ethereum'), ref('labels_balancer_cowswap_amm_pools_gnosis') ] %} diff --git a/dbt_subprojects/dex/models/_projects/bebop/base/bebop_jam_base_trades.sql b/dbt_subprojects/dex/models/_projects/bebop/base/bebop_jam_base_trades.sql index 09731935584..0044628d99c 100644 --- a/dbt_subprojects/dex/models/_projects/bebop/base/bebop_jam_base_trades.sql +++ b/dbt_subprojects/dex/models/_projects/bebop/base/bebop_jam_base_trades.sql @@ -1,4 +1,5 @@ {{ config( + tags = ['prod_exclude'], schema = 'bebop_jam_base', alias = 'trades', partition_by = ['block_month'], diff --git a/dbt_subprojects/dex/models/_projects/clipper/clipper_trades.sql b/dbt_subprojects/dex/models/_projects/clipper/clipper_trades.sql index b14e4e4a3db..8885fa03f9d 100644 --- a/dbt_subprojects/dex/models/_projects/clipper/clipper_trades.sql +++ b/dbt_subprojects/dex/models/_projects/clipper/clipper_trades.sql @@ -2,10 +2,10 @@ schema = 'clipper', alias = 'trades', materialized = 'view', - post_hook='{{ expose_spells(blockchains = \'["arbitrum", "ethereum", "polygon", "optimism"]\', + post_hook='{{ expose_spells(blockchains = \'["arbitrum", "ethereum", "polygon", "optimism", "zkevm"]\', spell_type = "project", spell_name = "clipper", - contributors = \'["0xRob", "amalashkevich"]\') }}' + contributors = \'["0xRob", "amalashkevich", "0xTemo"]\') }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/curvefi/curvefi_trades.sql b/dbt_subprojects/dex/models/_projects/curvefi/curve_trades.sql similarity index 89% rename from dbt_subprojects/dex/models/_projects/curvefi/curvefi_trades.sql rename to dbt_subprojects/dex/models/_projects/curvefi/curve_trades.sql index 6a67dee3c6a..9df6447f1b1 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/curvefi_trades.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/curve_trades.sql @@ -1,10 +1,10 @@ {{ config( - schema = 'curvefi', + schema = 'curve', alias = 'trades', materialized = 'view', post_hook='{{ expose_spells(blockchains = \'["ethereum","avalanche_c","optimism","fantom","celo"]\', spell_type = "project", - spell_name = "curvefi", + spell_name = "curve", contributors = \'["jeff-dude","yulesa","dsalv","Henrystats","msilb7","ilemi","agaperste","tomfutago"]\') }}' ) }} @@ -35,4 +35,4 @@ SELECT blockchain , tx_to , evt_index FROM {{ ref('dex_trades') }} -WHERE project = 'curvefi' \ No newline at end of file +WHERE project = 'curve' \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml index 3d776f0086e..df369f8b544 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml @@ -1,13 +1,13 @@ version: 2 models: - - name: curvefi_ethereum_pool_details + - name: curve_ethereum_pool_details meta: blockchain: ethereum - project: curvefi + project: curve contributors: [agaperste, yulesa] config: - tags: ["ethereum", "curvefi", "view"] + tags: ["ethereum", "curve", "view"] description: > a dictionary view of pool details for a lot of regular pools on Curve.fi on Ethereum columns: @@ -66,13 +66,13 @@ models: name: undercoin3 description: "Address for third underlying coin, when applicable" - - name: curvefi_ethereum_view_pools + - name: curve_ethereum_view_pools meta: blockchain: ethereum - project: curvefi + project: curve contributors: [agaperste, yulesa, ilemi, viniabussafi] config: - tags: ["ethereum", "curvefi", "view_pools", "view"] + tags: ["ethereum", "curve", "view_pools", "view"] description: > view details of pools for Curve.fi on Ethereum columns: diff --git a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_pool_details.sql b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_pool_details.sql similarity index 99% rename from dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_pool_details.sql rename to dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_pool_details.sql index cebcd240178..bca828d1162 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_pool_details.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_pool_details.sql @@ -1,5 +1,5 @@ {{ config( - schema = 'curvefi_ethereum' + schema = 'curve_ethereum' , alias = 'pool_details' ) }} diff --git a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_view_pools.sql b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_view_pools.sql similarity index 95% rename from dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_view_pools.sql rename to dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_view_pools.sql index fb3a86e0945..332f7e9f5c6 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_view_pools.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_view_pools.sql @@ -1,11 +1,11 @@ {{ config( - schema = 'curvefi_ethereum', + schema = 'curve_ethereum', alias = 'view_pools', materialized='table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', "project", - "curvefi", + "curve", \'["yulesa", "agaperste", "ilemi", "viniabussafi"]\') }}' ) }} @@ -29,7 +29,7 @@ WITH regular_pools AS ( deposit_contract, coin3 FROM - {{ ref('curvefi_ethereum_pool_details') }} + {{ ref('curve_ethereum_pool_details') }} ), regular_pools_deployed AS ( SELECT @@ -97,7 +97,7 @@ meta_calls AS ( SELECT * FROM ( - SELECT + SELECT _name, _symbol, output_0, @@ -105,18 +105,18 @@ meta_calls AS ( _base_pool, _coin, _A, - _fee - FROM + _fee + FROM {{ source( 'curvefi_ethereum', - 'CurveFactory_call_deploy_metapool' + 'CurveFactory_call_deploy_metapool' ) }} --https://etherscan.io/address/0xb9fc157394af804a3578134a6585c0dc9cc990d4 WHERE call_success - UNION ALL + UNION ALL - SELECT + SELECT _name, _symbol, output_0, @@ -124,11 +124,11 @@ meta_calls AS ( _base_pool, _coin, _A, - _fee - FROM + _fee + FROM {{ source( 'curvefi_ethereum', - 'MetaPoolFactory_call_deploy_metapool' + 'MetaPoolFactory_call_deploy_metapool' ) }} --https://etherscan.io/address/0x0959158b6040d32d04c301a72cbfd6b39e21c9ae WHERE call_success @@ -155,7 +155,7 @@ meta_pools_deployed AS ( r.coin1 as undercoin2, r.coin2 as undercoin3 FROM - meta_calls mc + meta_calls mc LEFT JOIN regular_pools r ON r.pool_address = mc._base_pool UNION ALL @@ -182,8 +182,8 @@ meta_pools_deployed AS ( FROM {{ source( 'curvefi_ethereum', - 'crvUSD_StableswapFactory_call_deploy_metapool' - ) }} mc + 'crvUSD_StableswapFactory_call_deploy_metapool' + ) }} mc LEFT JOIN regular_pools r ON r.pool_address = mc._base_pool ), @@ -225,7 +225,7 @@ v1_stableswap_ng as ( dp._name AS name, dp._symbol AS symbol, dp.output_0 AS pool_address, - dp._A AS A, + dp._A AS A, dp._fee AS mid_fee, dp._fee AS out_fee, dp.output_0 AS token_address, @@ -370,6 +370,7 @@ v2_pools_deployed AS ( ) }} ON p.evt_block_time = call_block_time AND p.evt_tx_hash = call_tx_hash + AND p.coins = _coins ), v2_updated_pools_deployed AS ( @@ -403,6 +404,7 @@ v2_updated_pools_deployed AS ( ) }} dp ON p.evt_block_time = dp.call_block_time AND p.evt_tx_hash = dp.call_tx_hash + AND p.coins = _coins ), @@ -412,7 +414,7 @@ twocrypto as ( dp._name AS name, dp._symbol AS symbol, dp.output_0 AS pool_address, - dp.A AS A, + dp.A AS A, dp.mid_fee AS mid_fee, dp.out_fee AS out_fee, dp.output_0 AS token_address, @@ -436,6 +438,7 @@ twocrypto as ( ) }} dp ON dp.call_block_time = p.evt_block_time AND dp.call_tx_hash = p.evt_tx_hash + AND p.coins = _coins ), ---------------------------------------------------------------- unioning all 3 together ---------------------------------------------------------------- pools AS ( @@ -486,7 +489,7 @@ pools AS ( 'curvefi_ethereum', 'CurveTwocryptoFactory_evt_LiquidityGaugeDeployed' ) }} as g3 - ON pd3u.pool_address = g3.pool + ON pd3u.pool_address = g3.pool ), contract_name AS ( @@ -530,4 +533,4 @@ FROM LEFT JOIN contract_name C ON C.address = pool_address ORDER BY - dune_table_name DESC \ No newline at end of file + dune_table_name DESC diff --git a/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml b/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml index 311dc638b22..3eaf8b43999 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml @@ -1,15 +1,15 @@ version: 2 models: - - name: curvefi_optimism_pools + - name: curve_optimism_pools meta: blockchain: optimism - project: curvefi + project: curve contributors: msilb7 config: - tags: ['optimism','curvefi','curve','dex'] + tags: ['optimism','curve','dex'] description: > - A table containing all known pools of curvefi on optimism (i.e. metapool, basicpool). Additional types should be monitored to ensure they're accurately shown. + A table containing all known pools of curve on optimism (i.e. metapool, basicpool). Additional types should be monitored to ensure they're accurately shown. tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: diff --git a/dbt_subprojects/dex/models/_projects/curvefi/optimism/curvefi_optimism_pools.sql b/dbt_subprojects/dex/models/_projects/curvefi/optimism/curve_optimism_pools.sql similarity index 98% rename from dbt_subprojects/dex/models/_projects/curvefi/optimism/curvefi_optimism_pools.sql rename to dbt_subprojects/dex/models/_projects/curvefi/optimism/curve_optimism_pools.sql index 042ab581f63..7e942c70f6f 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/optimism/curvefi_optimism_pools.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/optimism/curve_optimism_pools.sql @@ -1,5 +1,5 @@ {{ config( - schema = 'curvefi_optimism', + schema = 'curve_optimism', alias = 'pools', materialized = 'incremental', file_format = 'delta', @@ -7,7 +7,7 @@ unique_key = ['version', 'tokenid', 'token', 'pool'], post_hook='{{ expose_spells(\'["optimism"]\', "project", - "curvefi", + "curve", \'["msilb7"]\') }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml b/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml index 8b969c29d8d..855bc5c3f54 100644 --- a/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml +++ b/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml @@ -12,7 +12,7 @@ models: - name: camelot_trades - name: carbon_defi_trades - name: clipper_trades - - name: curvefi_trades + - name: curve_trades - name: defiswap_trades - name: dfx_trades - name: dodo_trades diff --git a/dbt_subprojects/dex/models/_projects/lifi/_schema.yml b/dbt_subprojects/dex/models/_projects/lifi/_schema.yml index c4c22570073..60d070724c5 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/lifi/_schema.yml @@ -83,4 +83,34 @@ models: description: "the position of this event log within this transaction" - &block_month name: block_month - description: "UTC event block month of each DEX trade" \ No newline at end of file + description: "UTC event block month of each DEX trade" + + - name: lifi_base_trades + meta: + blockchain: fantom, optimism + sector: dex + project: lifi + contributors: Henrystats, hosuke + config: + tags: [ 'fantom', 'optimism', 'lifi','trades', 'dex', 'aggregator', 'Henrystats','cross-chain' ] + description: > + lifi aggregator base trades on all chains across all contracts and versions. This table will load dex_aggregator trades downstream. + columns: + - *blockchain + - *project + - *version + - *block_date + - *block_time + - *token_bought_amount_raw + - *token_sold_amount_raw + - *token_bought_address + - *token_sold_address + - *taker + - *maker + - *project_contract_address + - *tx_hash + - *tx_from + - *tx_to + - *trace_address + - *evt_index + - *block_month diff --git a/dbt_subprojects/dex/models/_projects/lifi/fantom/_schema.yml b/dbt_subprojects/dex/models/_projects/lifi/fantom/_schema.yml index 474dbc07b1f..dca0d119c25 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/fantom/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/lifi/fantom/_schema.yml @@ -41,30 +41,12 @@ models: - &block_time name: block_time description: "UTC event block time of each DEX trade" - - &token_bought_symbol - name: token_bought_symbol - description: "Token symbol for token bought in the transaction" - - &token_sold_symbol - name: token_sold_symbol - description: "Token symbol for token sold in the transaction" - - &token_pair - name: token_pair - description: "Token symbol pair for each token involved in the transaction" - - &token_bought_amount - name: token_bought_amount - description: "Value of the token bought at time of execution in the original currency" - - &token_sold_amount - name: token_sold_amount - description: "Value of the token sold at time of execution in the original currency" - &token_bought_amount_raw name: token_bought_amount_raw description: "Raw value of the token bought at time of execution in the original currency" - &token_sold_amount_raw name: token_sold_amount_raw description: "Raw value of the token sold at time of execution in the original currency" - - &amount_usd - name: amount_usd - description: "USD value of the trade at time of execution" - &token_bought_address name: token_bought_address description: "Contract address of the token bought" @@ -99,7 +81,7 @@ models: name: block_month description: "UTC event block month of each DEX trade" - - name: lifi_fantom_trades + - name: lifi_fantom_base_trades meta: blockchain: fantom sector: dex @@ -115,14 +97,8 @@ models: - *version - *block_date - *block_time - - *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 diff --git a/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_fantom_trades.sql b/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_fantom_base_trades.sql similarity index 80% rename from dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_fantom_trades.sql rename to dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_fantom_base_trades.sql index 83ab544ad74..b860a1a1403 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_fantom_trades.sql +++ b/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_fantom_base_trades.sql @@ -1,7 +1,7 @@ {{ config( schema = 'lifi_fantom', - alias = 'trades' + alias = 'base_trades' ) }} @@ -20,14 +20,8 @@ FROM ( block_date, block_month, block_time, - 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, diff --git a/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_v2_fantom_trades.sql b/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_v2_fantom_trades.sql index 2b555de05d5..33940dd5079 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_v2_fantom_trades.sql +++ b/dbt_subprojects/dex/models/_projects/lifi/fantom/lifi_v2_fantom_trades.sql @@ -61,21 +61,8 @@ SELECT cast(date_trunc('DAY', dexs.block_time) as date) as block_date, cast(date_trunc('MONTH', dexs.block_time) as date) as block_month, dexs.block_time, - erc20a.symbol as token_bought_symbol, - erc20b.symbol as token_sold_symbol, - case - when lower(erc20a.symbol) > lower(erc20b.symbol) then concat(erc20b.symbol, '-', erc20a.symbol) - else concat(erc20a.symbol, '-', erc20b.symbol) - end as token_pair, - dexs.token_bought_amount_raw / power(10, erc20a.decimals) AS token_bought_amount, - dexs.token_sold_amount_raw / power(10, erc20b.decimals) AS token_sold_amount, dexs.token_bought_amount_raw, dexs.token_sold_amount_raw, - coalesce( - dexs.amount_usd - ,(dexs.token_bought_amount_raw / power(10, p_bought.decimals)) * p_bought.price - ,(dexs.token_sold_amount_raw / power(10, p_sold.decimals)) * p_sold.price - ) AS amount_usd, dexs.token_bought_address, dexs.token_sold_address, tx."from" AS taker, -- no taker in swap event @@ -95,29 +82,3 @@ inner join {{ source('fantom', 'transactions') }} tx {% if is_incremental() %} and tx.block_time >= date_trunc('day', now() - interval '7' Day) {% endif %} -left join {{ source('tokens', 'erc20') }} erc20a - on erc20a.contract_address = dexs.token_bought_address - and erc20a.blockchain = 'fantom' -left join {{ source('tokens', 'erc20') }} erc20b - on erc20b.contract_address = dexs.token_sold_address - and erc20b.blockchain = 'fantom' -left join {{ source('prices', 'usd') }} p_bought - on p_bought.minute = date_trunc('minute', dexs.block_time) - and p_bought.contract_address = dexs.token_bought_address - and p_bought.blockchain = 'fantom' - {% if not is_incremental() %} - and p_bought.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} - {% if is_incremental() %} - and p_bought.minute >= date_trunc('day', now() - interval '7' Day) - {% endif %} -left join {{ source('prices', 'usd') }} p_sold - on p_sold.minute = date_trunc('minute', dexs.block_time) - and p_sold.contract_address = dexs.token_sold_address - and p_sold.blockchain = 'fantom' - {% if not is_incremental() %} - and p_sold.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} - {% if is_incremental() %} - and p_sold.minute >= date_trunc('day', now() - interval '7' Day) - {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/lifi/lifi_base_trades.sql b/dbt_subprojects/dex/models/_projects/lifi/lifi_base_trades.sql new file mode 100644 index 00000000000..493843fab6d --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/lifi/lifi_base_trades.sql @@ -0,0 +1,40 @@ +{{ config( + schema = 'lifi', + alias = 'base_trades' + ) +}} + +{% set lifi_models = [ +ref('lifi_fantom_base_trades') +, ref('lifi_optimism_base_trades') +] %} + + +SELECT * +FROM ( + {% for dex_model in lifi_models %} + SELECT + blockchain, + project, + version, + block_month, + block_date, + block_time, + token_bought_amount_raw, + token_sold_amount_raw, + token_bought_address, + token_sold_address, + taker, + maker, + project_contract_address, + tx_hash, + tx_from, + tx_to, + trace_address, --ensure field is explicitly cast as array in base models + evt_index + FROM {{ dex_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/lifi/lifi_trades.sql b/dbt_subprojects/dex/models/_projects/lifi/lifi_trades.sql index d91055d86c9..55538339cea 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/lifi_trades.sql +++ b/dbt_subprojects/dex/models/_projects/lifi/lifi_trades.sql @@ -1,50 +1,13 @@ {{ config( schema = 'lifi', alias = 'trades', - post_hook='{{ expose_spells(\'["fantom", "optimism"]\', - "project", - "lifi", - \'["Henrystats"]\') }}' + post_hook='{{ expose_spells(blockchains = \'["fantom", "optimism"]\', + spell_type = "project", + spell_name = "lifi", + contributors = \'["Henrystats", "hosuke"]\') }}' ) }} -{% set lifi_models = [ -ref('lifi_fantom_trades') -,ref('lifi_optimism_trades') -] %} - - SELECT * -FROM ( - {% for dex_model in lifi_models %} - SELECT - blockchain, - project, - version, - block_month, - block_date, - block_time, - 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, - trace_address, --ensure field is explicitly cast as array in base models - evt_index - FROM {{ dex_model }} - {% if not loop.last %} - UNION ALL - {% endif %} - {% endfor %} -) \ No newline at end of file +FROM {{ ref('dex_aggregator_trades') }} +WHERE project = 'lifi' \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/lifi/optimism/_schema.yml b/dbt_subprojects/dex/models/_projects/lifi/optimism/_schema.yml index 0fb8ef06ae3..7fd22619823 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/optimism/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/lifi/optimism/_schema.yml @@ -41,30 +41,12 @@ models: - &block_time name: block_time description: "UTC event block time of each DEX trade" - - &token_bought_symbol - name: token_bought_symbol - description: "Token symbol for token bought in the transaction" - - &token_sold_symbol - name: token_sold_symbol - description: "Token symbol for token sold in the transaction" - - &token_pair - name: token_pair - description: "Token symbol pair for each token involved in the transaction" - - &token_bought_amount - name: token_bought_amount - description: "Value of the token bought at time of execution in the original currency" - - &token_sold_amount - name: token_sold_amount - description: "Value of the token sold at time of execution in the original currency" - &token_bought_amount_raw name: token_bought_amount_raw description: "Raw value of the token bought at time of execution in the original currency" - &token_sold_amount_raw name: token_sold_amount_raw description: "Raw value of the token sold at time of execution in the original currency" - - &amount_usd - name: amount_usd - description: "USD value of the trade at time of execution" - &token_bought_address name: token_bought_address description: "Contract address of the token bought" @@ -99,7 +81,7 @@ models: name: block_month description: "UTC event block month of each DEX trade" - - name: lifi_optimism_trades + - name: lifi_optimism_base_trades meta: blockchain: optimism sector: dex @@ -115,14 +97,8 @@ models: - *version - *block_date - *block_time - - *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 diff --git a/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_optimism_trades.sql b/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_optimism_base_trades.sql similarity index 80% rename from dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_optimism_trades.sql rename to dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_optimism_base_trades.sql index d373f3f66a2..4423e749258 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_optimism_trades.sql +++ b/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_optimism_base_trades.sql @@ -1,7 +1,7 @@ {{ config( schema = 'lifi_optimism', - alias = 'trades' + alias = 'base_trades' ) }} @@ -20,14 +20,8 @@ FROM ( block_date, block_month, block_time, - 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, diff --git a/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_v2_optimism_trades.sql b/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_v2_optimism_trades.sql index e05c6eb96fc..b6d26eda580 100644 --- a/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_v2_optimism_trades.sql +++ b/dbt_subprojects/dex/models/_projects/lifi/optimism/lifi_v2_optimism_trades.sql @@ -61,21 +61,8 @@ SELECT cast(date_trunc('DAY', dexs.block_time) as date) as block_date, cast(date_trunc('MONTH', dexs.block_time) as date) as block_month, dexs.block_time, - erc20a.symbol as token_bought_symbol, - erc20b.symbol as token_sold_symbol, - case - when lower(erc20a.symbol) > lower(erc20b.symbol) then concat(erc20b.symbol, '-', erc20a.symbol) - else concat(erc20a.symbol, '-', erc20b.symbol) - end as token_pair, - dexs.token_bought_amount_raw / power(10, erc20a.decimals) AS token_bought_amount, - dexs.token_sold_amount_raw / power(10, erc20b.decimals) AS token_sold_amount, dexs.token_bought_amount_raw, dexs.token_sold_amount_raw, - coalesce( - dexs.amount_usd - ,(dexs.token_bought_amount_raw / power(10, p_bought.decimals)) * p_bought.price - ,(dexs.token_sold_amount_raw / power(10, p_sold.decimals)) * p_sold.price - ) AS amount_usd, dexs.token_bought_address, dexs.token_sold_address, tx."from" AS taker, -- no taker in swap event @@ -95,29 +82,3 @@ inner join {{ source('optimism', 'transactions') }} tx {% if is_incremental() %} and tx.block_time >= date_trunc('day', now() - interval '7' Day) {% endif %} -left join {{ source('tokens', 'erc20') }} erc20a - on erc20a.contract_address = dexs.token_bought_address - and erc20a.blockchain = 'optimism' -left join {{ source('tokens', 'erc20') }} erc20b - on erc20b.contract_address = dexs.token_sold_address - and erc20b.blockchain = 'optimism' -left join {{ source('prices', 'usd') }} p_bought - on p_bought.minute = date_trunc('minute', dexs.block_time) - and p_bought.contract_address = dexs.token_bought_address - and p_bought.blockchain = 'optimism' - {% if not is_incremental() %} - and p_bought.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} - {% if is_incremental() %} - and p_bought.minute >= date_trunc('day', now() - interval '7' Day) - {% endif %} -left join {{ source('prices', 'usd') }} p_sold - on p_sold.minute = date_trunc('minute', dexs.block_time) - and p_sold.contract_address = dexs.token_sold_address - and p_sold.blockchain = 'optimism' - {% if not is_incremental() %} - and p_sold.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} - {% if is_incremental() %} - and p_sold.minute >= date_trunc('day', now() - interval '7' Day) - {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/odos/_schema.yml b/dbt_subprojects/dex/models/_projects/odos/_schema.yml index 9f38bc596bc..f22da573184 100644 --- a/dbt_subprojects/dex/models/_projects/odos/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/odos/_schema.yml @@ -3,12 +3,12 @@ version: 2 models: - name: odos_trades meta: - blockchain: optimism, ethereum + blockchain: optimism, ethereum, base, arbitrum sector: dex project: odos contributors: Henrystats config: - tags: ['avalanche_c', 'odos','trades', 'dex', 'aggregator'] + tags: ['odos','trades', 'dex', 'aggregator'] description: > odos trades on all chains across all contracts and versions. This table will load odos aggregator trades downstream. columns: diff --git a/dbt_subprojects/dex/models/_projects/odos/arbitrum/_schema.yml b/dbt_subprojects/dex/models/_projects/odos/arbitrum/_schema.yml new file mode 100644 index 00000000000..2f32263178e --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/odos/arbitrum/_schema.yml @@ -0,0 +1,186 @@ +version: 2 + +models: + - name: odos_v1_arbitrum_trades + meta: + blockchain: arbitrum + sector: dex + project: odos + contributors: lequangphu + config: + tags: ['arbitrum','trades', 'odos','dex'] + description: > + A table containing all trades of odos v1 on arbitrum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - blockchain + - project + - version + - tx_hash + - evt_index + - trace_address + - check_dex_aggregator_seed: + blockchain: arbitrum + project: odos + version: 1 + columns: + - &blockchain + name: blockchain + description: "Blockchain which the DEX is deployed" + - &project + name: project + description: "Project name of the DEX" + - &version + name: version + description: "Version of the contract built and deployed by the DEX project" + - &block_month + name: block_month + description: "UTC event block month of each DEX trade" + - &block_date + name: block_date + description: "UTC event block date of each DEX trade" + - &block_time + name: block_time + description: "UTC event block time of each DEX trade" + - &token_bought_symbol + name: token_bought_symbol + description: "Token symbol for token bought in the transaction" + - &token_sold_symbol + name: token_sold_symbol + description: "Token symbol for token sold in the transaction" + - &token_pair + name: token_pair + description: "Token symbol pair for each token involved in the transaction" + - &token_bought_amount + name: token_bought_amount + description: "Value of the token bought at time of execution in the original currency" + - &token_sold_amount + name: token_sold_amount + description: "Value of the token sold at time of execution in the original currency" + - &token_bought_amount_raw + name: token_bought_amount_raw + description: "Raw value of the token bought at time of execution in the original currency" + - &token_sold_amount_raw + name: token_sold_amount_raw + description: "Raw value of the token sold at time of execution in the original currency" + - &amount_usd + name: amount_usd + description: "USD value of the trade at time of execution" + - &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 trader who purchased a token" + - &maker + name: maker + description: "Address of trader who sold a token" + - &project_contract_address + name: project_contract_address + description: "Project contract address which executed the trade on the blockchain" + - &tx_hash + name: tx_hash + description: "Unique transaction hash value tied to each transaction on the DEX" + - &tx_from + name: tx_from + description: "Address which initiated the transaction" + - &tx_to + name: tx_to + description: "Address which received the transaction" + - &evt_index + name: evt_index + description: "" + - &trace_address + name: trace_address + description: "" + + - name: odos_v2_arbitrum_trades + meta: + blockchain: arbitrum + sector: dex + project: odos + contributors: lequangphu + config: + tags: ['arbitrum','trades', 'odos','dex'] + description: > + A table containing all trades of odos v2 on arbitrum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - blockchain + - project + - version + - tx_hash + - evt_index + - trace_address + - check_dex_aggregator_seed: + blockchain: arbitrum + project: odos + version: 2 + columns: + - *blockchain + - *project + - *version + - *block_month + - *block_date + - *block_time + - *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 + - *trace_address + + - name: odos_arbitrum_trades + meta: + blockchain: arbitrum + sector: dex + project: odos + contributors: lequangphu + config: + tags: ['arbitrum','trades', 'odos','dex'] + description: > + A table containing all trades of odos on arbitrum. + columns: + - *blockchain + - *project + - *version + - *block_month + - *block_date + - *block_time + - *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 + - *trace_address \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_arbitrum_trades.sql b/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_arbitrum_trades.sql new file mode 100644 index 00000000000..b4d4648a076 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_arbitrum_trades.sql @@ -0,0 +1,46 @@ +{{ config( + schema = 'odos_arbitrum' + , alias = 'trades' + ) +}} + +{% set odos_models = [ +ref('odos_v1_arbitrum_trades') +, ref('odos_v2_arbitrum_trades') +] %} + + +SELECT * +FROM ( + {% for dex_model in odos_models %} + SELECT + blockchain, + project, + version, + block_month, + block_date, + block_time, + 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, + trace_address + FROM {{ dex_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_v1_arbitrum_trades.sql b/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_v1_arbitrum_trades.sql new file mode 100644 index 00000000000..af704cc405e --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_v1_arbitrum_trades.sql @@ -0,0 +1,103 @@ +{{ config( + schema = 'odos_v1_arbitrum' + ,alias = 'trades' + ,materialized = 'incremental' + ,file_format = 'delta' + ,incremental_strategy = 'merge' + ,unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index', 'trace_address'] + ,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{% set project_start_date = '2022-04-11' %} + +WITH +dexs as ( + SELECT + evt_block_time as block_time, + evt_block_number as block_number, + json_extract_scalar(outputs[1], '$.receiver') AS taker, + CAST(NULL as VARBINARY) as maker, + amountsIn[1] as token_sold_amount_raw, + amountsOut[1] as token_bought_amount_raw, + CAST(NULL as double) as amount_usd, + tokensIn[1] as token_sold_address, + json_extract_scalar(outputs[1], '$.tokenAddress') AS token_bought_address, + contract_address as project_contract_address, + evt_tx_hash as tx_hash, + evt_index, + CAST(ARRAY[-1] as array) as trace_address + FROM + {{ source('odos_v1_arbitrum', 'OdosRouter_evt_Swapped') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('evt_block_time')}} + {% else %} + WHERE evt_block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} +) + +SELECT + 'arbitrum' AS blockchain, + 'odos' AS project, + '1' AS version, + TRY_CAST(date_trunc('DAY', dexs.block_time) AS date) AS block_date, + TRY_CAST(date_trunc('MONTH', dexs.block_time) AS date) AS block_month, + dexs.block_time, + erc20a.symbol AS token_bought_symbol, + erc20b.symbol AS token_sold_symbol, + CASE + WHEN lower(erc20a.symbol) > lower(erc20b.symbol) + THEN concat(erc20b.symbol, '-', erc20a.symbol) + ELSE concat(erc20a.symbol, '-', erc20b.symbol) + END AS token_pair, + dexs.token_bought_amount_raw / power(10, erc20a.decimals) AS token_bought_amount, + dexs.token_sold_amount_raw / power(10, erc20b.decimals) AS token_sold_amount, + dexs.token_bought_amount_raw AS token_bought_amount_raw, + dexs.token_sold_amount_raw AS token_sold_amount_raw, + COALESCE( + dexs.amount_usd, + (dexs.token_bought_amount_raw / power(10, erc20a.decimals)) * p_bought.price, + (dexs.token_sold_amount_raw / power(10, erc20b.decimals)) * p_sold.price + ) AS amount_usd, + CAST(dexs.token_bought_address AS varbinary) AS token_bought_address, + dexs.token_sold_address, + CAST(dexs.taker AS varbinary) AS taker, + dexs.maker, + dexs.project_contract_address, + dexs.tx_hash, + tx."from" AS tx_from, + tx.to AS tx_to, + dexs.evt_index, + dexs.trace_address +FROM dexs +INNER JOIN {{ source('arbitrum', 'transactions') }} tx + ON dexs.tx_hash = tx.hash + {% if not is_incremental() %} + AND tx.block_time >= DATE '{{project_start_date}}' + {% else %} + AND {{ incremental_predicate('tx.block_time') }} + {% endif %} +LEFT JOIN {{ source('tokens', 'erc20') }} erc20a + ON CAST(erc20a.contract_address AS varchar) = dexs.token_bought_address + AND erc20a.blockchain = 'arbitrum' +LEFT JOIN {{ source('tokens', 'erc20') }} erc20b + ON erc20b.contract_address = dexs.token_sold_address + AND erc20b.blockchain = 'arbitrum' +LEFT JOIN {{ source('prices', 'usd') }} p_bought + ON p_bought.minute = date_trunc('minute', dexs.block_time) + AND CAST(p_bought.contract_address AS varchar) = dexs.token_bought_address + AND p_bought.blockchain = 'arbitrum' + {% if not is_incremental() %} + AND p_bought.minute >= DATE '{{project_start_date}}' + {% else %} + AND {{ incremental_predicate('p_bought.minute') }} + {% endif %} +LEFT JOIN {{ source('prices', 'usd') }} p_sold + ON p_sold.minute = date_trunc('minute', dexs.block_time) + AND p_sold.contract_address = dexs.token_sold_address + AND p_sold.blockchain = 'arbitrum' + {% if not is_incremental() %} + AND p_sold.minute >= DATE '{{project_start_date}}' + {% else %} + AND {{ incremental_predicate('p_sold.minute') }} + {% endif %} diff --git a/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_v2_arbitrum_trades.sql b/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_v2_arbitrum_trades.sql new file mode 100644 index 00000000000..0c43c2f7dcd --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/odos/arbitrum/odos_v2_arbitrum_trades.sql @@ -0,0 +1,110 @@ +{{ config( + alias = 'trades' + ,schema = 'odos_v2_arbitrum' + ,materialized = 'incremental' + ,file_format = 'delta' + ,incremental_strategy = 'merge' + ,unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index', 'trace_address'] + ,incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{% set project_start_date = '2023-07-15' %} + +with event_data AS ( + SELECT + evt_block_time AS block_time, + evt_block_number AS block_number, + sender AS taker, + contract_address AS maker, + inputAmount AS token_sold_amount_raw, + amountOut AS token_bought_amount_raw, + CAST(NULL as double) as amount_usd, + CASE + WHEN inputToken = 0x0000000000000000000000000000000000000000 + THEN 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 -- WETH + ELSE inputToken + END AS token_sold_address, + CASE + WHEN outputToken = 0x0000000000000000000000000000000000000000 + THEN 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 -- WETH + ELSE outputToken + END AS token_bought_address, + contract_address AS project_contract_address, + evt_tx_hash AS tx_hash, + evt_index, + CAST(ARRAY[-1] as array) as trace_address + FROM + {{ source('odos_v2_arbitrum', 'OdosRouterV2_evt_Swap') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('evt_block_time')}} + {% else %} + WHERE evt_block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} +) + +SELECT + 'arbitrum' AS blockchain, + 'odos' AS project, + '2' AS version, + TRY_CAST(date_trunc('DAY', e.block_time) AS date) AS block_date, + TRY_CAST(date_trunc('MONTH', e.block_time) AS date) AS block_month, + e.block_time, + erc20a.symbol AS token_bought_symbol, + erc20b.symbol AS token_sold_symbol, + CASE + WHEN lower(erc20a.symbol) > lower(erc20b.symbol) + THEN concat(erc20b.symbol, '-', erc20a.symbol) + ELSE concat(erc20a.symbol, '-', erc20b.symbol) + END AS token_pair, + e.token_bought_amount_raw / power(10, erc20a.decimals) AS token_bought_amount, + e.token_sold_amount_raw / power(10, erc20b.decimals) AS token_sold_amount, + e.token_bought_amount_raw AS token_bought_amount_raw, + e.token_sold_amount_raw AS token_sold_amount_raw, + COALESCE( + e.amount_usd, + (e.token_bought_amount_raw / power(10, erc20a.decimals)) * p_bought.price, + (e.token_sold_amount_raw / power(10, erc20b.decimals)) * p_sold.price + ) AS amount_usd, + CAST(e.token_bought_address AS varbinary) AS token_bought_address, + e.token_sold_address, + CAST(e.taker AS varbinary) AS taker, + e.maker, + e.project_contract_address, + e.tx_hash, + tx."from" AS tx_from, + tx.to AS tx_to, + e.evt_index, + e.trace_address +FROM event_data e +INNER JOIN {{ source('arbitrum', 'transactions') }} tx + ON e.tx_hash = tx.hash + {% if not is_incremental() %} + AND tx.block_time >= DATE '{{project_start_date}}' + {% else %} + AND {{ incremental_predicate('tx.block_time') }} + {% endif %} +LEFT JOIN {{ source('tokens', 'erc20') }} erc20a + ON erc20a.contract_address = e.token_bought_address + AND erc20a.blockchain = 'arbitrum' +LEFT JOIN {{ source('tokens', 'erc20') }} erc20b + ON erc20b.contract_address = e.token_sold_address + AND erc20b.blockchain = 'arbitrum' +LEFT JOIN {{ source('prices', 'usd') }} p_bought + ON p_bought.minute = date_trunc('minute', e.block_time) + AND p_bought.contract_address = e.token_bought_address + AND p_bought.blockchain = 'arbitrum' + {% if not is_incremental() %} + AND p_bought.minute >= DATE '{{project_start_date}}' + {% else %} + AND {{ incremental_predicate('p_bought.minute') }} + {% endif %} +LEFT JOIN {{ source('prices', 'usd') }} p_sold + ON p_sold.minute = date_trunc('minute', e.block_time) + AND p_sold.contract_address = e.token_sold_address + AND p_sold.blockchain = 'arbitrum' + {% if not is_incremental() %} + AND p_sold.minute >= DATE '{{project_start_date}}' + {% else %} + AND {{ incremental_predicate('p_sold.minute') }} + {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/odos/odos_trades.sql b/dbt_subprojects/dex/models/_projects/odos/odos_trades.sql index 43e2ac5e5c8..bfe8bd6ceeb 100644 --- a/dbt_subprojects/dex/models/_projects/odos/odos_trades.sql +++ b/dbt_subprojects/dex/models/_projects/odos/odos_trades.sql @@ -1,16 +1,17 @@ {{ config( schema = 'odos', alias = 'trades', - post_hook='{{ expose_spells(\'["optimism", "ethereum"]\', + post_hook='{{ expose_spells(\'["optimism", "ethereum", "base", "arbitrum"]\', "project", "odos", - \'["Henrystats", "amalashkevich"]\') }}' + \'["Henrystats", "amalashkevich","lequangphu"]\') }}' ) }} {% set odos_models = [ ref('odos_ethereum_trades'), ref('odos_optimism_trades'), + ref('odos_arbitrum_trades'), ref('odos_base_trades') ] %} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/_schema.yml index f4af98a9ea3..8f961c8908c 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/_schema.yml @@ -55,6 +55,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -119,11 +133,11 @@ models: - name: oneinch_blockchains meta: - blockchain: ['ethereum','bnb','polygon','arbitrum','avalanche_c','gnosis','optimism','fantom','base'] + blockchain: ['ethereum', 'bnb', 'polygon', 'arbitrum', 'avalanche_c', 'gnosis', 'optimism', 'fantom', 'base'] sector: oneinch contributors: ['max-morrow', 'grkhr'] config: - tags: ['oneinch', 'calls', 'transfers'] + tags: ['oneinch', 'blockchain'] description: > 1inch blockchains meta columns: @@ -137,6 +151,7 @@ models: - name: explorer_link - name: first_deploy_at - name: fusion_settlement_addresses + - name: escrow_factory_addresses - name: oneinch_calls meta: @@ -188,8 +203,16 @@ models: - name: receiver - name: src_token_address - name: src_token_amount + - name: src_escrow + - name: hashlock - name: dst_token_address - name: dst_token_amount + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_wrapper - name: order_hash - name: flags @@ -229,6 +252,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -243,10 +268,28 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address + tests: + - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players @@ -302,6 +345,12 @@ models: - name: src_token_symbol - name: src_token_decimals - name: src_token_amount + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash - name: dst_token_address - name: dst_token_symbol - name: dst_token_decimals @@ -312,6 +361,7 @@ models: - name: user_amount_usd - name: tokens - name: transfers + - name: escrow_results - name: minute - name: block_month - name: swap_id @@ -519,4 +569,84 @@ models: - not_null - name: resolver_name - name: resolver_address - + + - name: oneinch_escrow_results + meta: + blockchain: ['ethereum', 'bnb', 'polygon', 'arbitrum', 'avalanche_c', 'gnosis', 'optimism', 'fantom', 'base'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month + + - name: oneinch_escrow_dst_creations + meta: + blockchain: ['ethereum', 'bnb', 'polygon', 'arbitrum', 'avalanche_c', 'gnosis', 'optimism', 'fantom', 'base'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'internal'] + description: > + escrow dst creations + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: factory + - name: escrow + - name: order_hash + - name: hashlock + - name: maker + - name: taker + - name: token + - name: amount + - name: safety_deposit + - name: timelocks + - name: call_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_call_transfers.sql index 1848eef74ce..3e2fac78cd0 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_escrow_results.sql new file mode 100644 index 00000000000..4fd015c6ce6 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'arbitrum' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_lop.sql index 9ffc2bc2f9c..52d55b716bf 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_schema.yml index 8c1988661ac..5e13d2f0685 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/arbitrum/oneinch_arbitrum_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_arbitrum_escrow_results + meta: + blockchain: ['arbitrum'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_call_transfers.sql index 6e9ad024ac6..4ba9b0e133e 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_escrow_results.sql new file mode 100644 index 00000000000..bf8d57cda75 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'avalanche_c' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_lop.sql index c39d7e471b0..d38c328d015 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_schema.yml index 5dfb9e5bc11..16e6ae67c90 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/avalanche_c/oneinch_avalanche_c_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_avalanche_c_escrow_results + meta: + blockchain: ['avalanche_c'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_call_transfers.sql index 3e2c498ad6d..7e6a6b2dc89 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_escrow_results.sql new file mode 100644 index 00000000000..959449b6830 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'base' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_lop.sql index c5ebf0af5a2..4327346f504 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_schema.yml index 7ac3bf03107..e6d652ba4ea 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/base/oneinch_base_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_base_escrow_results + meta: + blockchain: ['base'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_call_transfers.sql index 129e8ea3083..70be1e5821f 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_escrow_results.sql new file mode 100644 index 00000000000..c94c7927ca6 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'bnb' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_lop.sql index db960f5cfab..7e537ba932e 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_schema.yml index 407be489f50..b99571977f0 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/bnb/oneinch_bnb_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_bnb_escrow_results + meta: + blockchain: ['bnb'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_call_transfers.sql index 2685b4b9524..253054e2d6c 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_escrow_results.sql new file mode 100644 index 00000000000..6ade981163f --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'ethereum' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_lop.sql index 0021275602e..6459e44b1a7 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_schema.yml index 25c31b0bfae..1ffa85656f3 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/ethereum/oneinch_ethereum_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - - name: block_month \ No newline at end of file + - name: block_month + + - name: oneinch_ethereum_escrow_results + meta: + blockchain: ['ethereum'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_call_transfers.sql index 583bf576047..edcf2b8c183 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_escrow_results.sql new file mode 100644 index 00000000000..54e9d0695d9 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'fantom' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_lop.sql index c1cd5b5013c..58398f025b4 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_schema.yml index 6986e01e7cc..3e5883f5e22 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/fantom/oneinch_fantom_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_fantom_escrow_results + meta: + blockchain: ['fantom'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_call_transfers.sql index 82435e33455..a901aa578a1 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_escrow_results.sql new file mode 100644 index 00000000000..1026d4c773f --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'gnosis' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_lop.sql index 2597a740491..2a90d5c8e60 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_schema.yml index 0e605b1b88b..5b5950040df 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/gnosis/oneinch_gnosis_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_gnosis_escrow_results + meta: + blockchain: ['gnosis'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_call_transfers.sql index 325d0271479..f758a8143b0 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_call_transfers.sql @@ -3,7 +3,7 @@ schema = 'oneinch', alias = 'call_transfers', materialized = 'view', - unique_key = ['blockchain', 'tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'], + unique_key = ['blockchain', 'tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_escrow_dst_creations.sql b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_escrow_dst_creations.sql new file mode 100644 index 00000000000..fbb2f6a2efd --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_escrow_dst_creations.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'oneinch', + alias = 'escrow_dst_creations', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{% for blockchain in oneinch_exposed_blockchains_list() %} + select * from ({{ oneinch_escrow_dst_creations_macro(blockchain) }}) + {% if not loop.last %} union all {% endif %} +{% endfor %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_escrow_results.sql new file mode 100644 index 00000000000..ab37fe49768 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_escrow_results.sql @@ -0,0 +1,15 @@ +{{ + config( + schema = 'oneinch', + alias = 'escrow_results', + materialized = 'view', + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{% for blockchain in oneinch_exposed_blockchains_list() %} + select * from {{ ref('oneinch_' + blockchain + '_escrow_results') }} + {% if not loop.last %} union all {% endif %} +{% endfor %} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_lop_own_trades.sql b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_lop_own_trades.sql index 0596b298e61..19d7446ac36 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_lop_own_trades.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_lop_own_trades.sql @@ -11,7 +11,7 @@ select blockchain - , '1inch LOP' as project + , '1inch-LOP' as project , protocol_version as version , date(block_time) as block_date , block_month @@ -41,4 +41,5 @@ from {{ ref('oneinch_swaps') }} where protocol = 'LOP' and not flags['fusion'] - and not flags['second_side'] \ No newline at end of file + and not flags['second_side'] + and not flags['cross_chain'] \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_swaps.sql b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_swaps.sql index 2d7320e7075..85144000ed4 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/oneinch_swaps.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/oneinch_swaps.sql @@ -48,6 +48,13 @@ 'remains', 'native_token_symbol', '_call_trace_address', + 'src_escrow', + 'hashlock', + 'dst_blockchain', + 'dst_block_number', + 'dst_block_time', + 'dst_tx_hash', + 'dst_escrow', ] %} @@ -57,7 +64,7 @@ with tokens as ( select - blockchain + blockchain as transfer_blockchain , contract_address , symbol as token_symbol , decimals as token_decimals @@ -66,7 +73,7 @@ tokens as ( , prices as ( select - blockchain + blockchain as transfer_blockchain , contract_address , minute , price @@ -83,7 +90,7 @@ tokens as ( * , if(src_token_address in {{native_addresses}}, wrapped_native_token_address, src_token_address) as _src_token_address , if(src_token_address in {{native_addresses}}, true, false) as _src_token_native - , if(dst_token_address in {{native_addresses}}, wrapped_native_token_address, dst_token_address) as _dst_token_address + , if(dst_token_address in {{native_addresses}}, coalesce(dst_wrapper, wrapped_native_token_address), dst_token_address) as _dst_token_address , if(dst_token_address in {{native_addresses}}, true, false) as _dst_token_native , array_join(call_trace_address, '') as _call_trace_address from {{ ref('oneinch_calls') }} @@ -175,6 +182,20 @@ tokens as ( -- dst $ amount to receiver , sum(amount * if(receiver = transfer_to, price, -price) / pow(10, decimals)) filter(where {{ dst_condition }} and receiver in (transfer_from, transfer_to)) as _amount_usd_to_receiver + -- escrow results + , sum(amount) filter(where result_escrow = src_escrow and result_method = 'withdraw') as src_withdraw_amount + , sum(amount) filter(where result_escrow = src_escrow and result_method = 'cancel') as src_cancel_amount + , sum(amount) filter(where result_escrow = src_escrow and result_method = 'rescueFunds') as src_rescue_amount + , sum(amount * price / pow(10, decimals)) filter(where result_escrow = src_escrow and result_method = 'withdraw') as src_withdraw_amount_usd + , sum(amount * price / pow(10, decimals)) filter(where result_escrow = src_escrow and result_method = 'cancel') as src_cancel_amount_usd + , sum(amount * price / pow(10, decimals)) filter(where result_escrow = src_escrow and result_method = 'rescueFunds') as src_rescue_amount_usd + , sum(amount) filter(where result_escrow = dst_escrow and result_method = 'withdraw') as dst_withdraw_amount + , sum(amount) filter(where result_escrow = dst_escrow and result_method = 'cancel') as dst_cancel_amount + , sum(amount) filter(where result_escrow = dst_escrow and result_method = 'rescueFunds') as dst_rescue_amount + , sum(amount * price / pow(10, decimals)) filter(where result_escrow = dst_escrow and result_method = 'withdraw') as dst_withdraw_amount_usd + , sum(amount * price / pow(10, decimals)) filter(where result_escrow = dst_escrow and result_method = 'cancel') as dst_cancel_amount_usd + , sum(amount * price / pow(10, decimals)) filter(where result_escrow = dst_escrow and result_method = 'rescueFunds') as dst_rescue_amount_usd + , count(distinct (contract_address, transfer_native)) as tokens -- count distinct tokens in transfers , count(*) as transfers -- count transfers from swaps @@ -184,8 +205,8 @@ tokens as ( where {{ incremental_predicate('block_time') }} {% endif %} ) using(blockchain, block_number, tx_hash, call_trace_address) -- block_number is needed for performance - left join prices using(blockchain, contract_address, minute) - left join tokens using(blockchain, contract_address) + left join prices using(transfer_blockchain, contract_address, minute) + left join tokens using(transfer_blockchain, contract_address) group by 1, 2, 3, 4, 5 ) @@ -218,12 +239,19 @@ select ('direct', cardinality(call_trace_address) = 0) , ('second_side', second_side) , ('contracts_only', contracts_only) + , ('cross_chain', hashlock is not null) ])) as flags , remains , coalesce(_src_token_address_true, if(_src_token_native, {{ true_native_address }}, _src_token_address)) as src_token_address , coalesce(_src_token_symbol_true, _src_token_symbol) as src_token_symbol , src_token_decimals , coalesce(_src_token_amount_true, src_token_amount) as src_token_amount + , src_escrow + , hashlock + , dst_blockchain + , dst_block_number + , dst_block_time + , dst_tx_hash , coalesce(_dst_token_address_to_user, _dst_token_address_to_receiver, if(_dst_token_native, {{ true_native_address }}, _dst_token_address)) as dst_token_address , coalesce(_dst_token_symbol_to_user, _dst_token_symbol_to_receiver, _dst_token_symbol) as dst_token_symbol , dst_token_decimals @@ -234,6 +262,11 @@ select , greatest(coalesce(_amount_usd_from_user, 0), coalesce(_amount_usd_to_user, _amount_usd_to_receiver, 0)) as user_amount_usd -- actual user $ amount , tokens , transfers + , map_from_entries(array[ + ('withdraw', cast(row(src_withdraw_amount, src_withdraw_amount_usd, dst_withdraw_amount, dst_withdraw_amount_usd) as row(src_amount uint256, src_amount_usd double, dst_amount uint256, dst_amount_usd double))) + , ('cancel', cast(row(src_cancel_amount, src_cancel_amount_usd, dst_cancel_amount, dst_cancel_amount_usd) as row(src_amount uint256, src_amount_usd double, dst_amount uint256, dst_amount_usd double))) + , ('rescue', cast(row(src_rescue_amount, src_rescue_amount_usd, dst_rescue_amount, dst_rescue_amount_usd) as row(src_amount uint256, src_amount_usd double, dst_amount uint256, dst_amount_usd double))) + ]) as escrow_results , date_trunc('minute', block_time) as minute , date(date_trunc('month', block_time)) as block_month , coalesce(order_hash, tx_hash || from_hex(if(mod(length(_call_trace_address), 2) = 1, '0' || _call_trace_address, _call_trace_address) || '0' || cast(cast(second_side as int) as varchar))) as swap_id diff --git a/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_call_transfers.sql index ebb2b2a3363..70ab9ca2e6d 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_escrow_results.sql new file mode 100644 index 00000000000..bd1de5b89f5 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'optimism' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_lop.sql index 1c0cbccd8cf..82d54d7a1fd 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_schema.yml index f91cc100dc4..a5bed3af8c4 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/optimism/oneinch_optimism_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_optimism_escrow_results + meta: + blockchain: ['optimism'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_call_transfers.sql index 4e8b1fbbbfd..3c90f675d95 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_escrow_results.sql new file mode 100644 index 00000000000..85146177b21 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'polygon' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_lop.sql index aa23fdec628..560907c0a49 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_schema.yml index 4e02cbad9fc..fdf215a5e75 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/polygon/oneinch_polygon_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_polygon_escrow_results + meta: + blockchain: ['polygon'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_call_transfers.sql b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_call_transfers.sql index 002f281728c..fbeda2ecc9f 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_call_transfers.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_call_transfers.sql @@ -11,7 +11,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_hash', 'call_trace_address', 'transfer_trace_address', 'transfer_native'] + unique_key = ['tx_hash', 'call_trace_address', 'transfer_blockchain', 'transfer_tx_hash', 'transfer_trace_address', 'transfer_native'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_escrow_results.sql b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_escrow_results.sql new file mode 100644 index 00000000000..4b7919e25f3 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_escrow_results.sql @@ -0,0 +1,20 @@ +{% set blockchain = 'zksync' %} + + + +{{ + config( + schema = 'oneinch_' + blockchain, + alias = 'escrow_results', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_hash', 'trace_address'] + ) +}} + + + +{{ oneinch_escrow_results_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_lop.sql b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_lop.sql index 5fac726a6e7..30234bbd9ea 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_lop.sql +++ b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_lop.sql @@ -17,8 +17,4 @@ -{{ - oneinch_lop_macro( - blockchain = blockchain - ) -}} \ No newline at end of file +{{ oneinch_lop_macro(blockchain) }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_schema.yml b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_schema.yml index 6df4f57a3a1..feda1a145f3 100644 --- a/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_schema.yml +++ b/dbt_subprojects/dex/models/_projects/oneinch/zksync/oneinch_zksync_schema.yml @@ -56,6 +56,20 @@ models: - name: order_hash - name: flags - name: remains + - name: src_escrow + - name: hashlock + - name: dst_blockchain + - name: dst_block_number + - name: dst_block_time + - name: dst_tx_hash + - name: dst_escrow + - name: dst_maker + - name: dst_taker + - name: dst_token + - name: dst_amount + - name: dst_wrapper + - name: dst_creation_call_success + - name: args - name: minute - name: block_month @@ -134,6 +148,8 @@ models: - blockchain - tx_hash - call_trace_address + - transfer_blockchain + - transfer_tx_hash - transfer_trace_address - transfer_native columns: @@ -148,14 +164,71 @@ models: - name: call_trace_address tests: - not_null + - name: dst_blockchain + - name: hashlock + - name: result_escrow + - name: result_trace_address + - name: result_method + - name: result_amount + - name: transfer_blockchain + tests: + - not_null + - name: transfer_block_number + - name: transfer_block_time + - name: transfer_tx_hash + tests: + - not_null - name: transfer_trace_address tests: - not_null - name: contract_address - name: amount - name: transfer_native + tests: + - not_null - name: transfer_from - name: transfer_to - name: transfers_between_players - name: minute - name: block_month + + - name: oneinch_zksync_escrow_results + meta: + blockchain: ['zksync'] + sector: oneinch + contributors: ['max-morrow', 'grkhr'] + config: + tags: ['oneinch', 'cross-chain'] + description: > + escrow results + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_hash + - trace_address + columns: + - name: blockchain + tests: + - not_null + - name: block_number + - name: block_time + - name: tx_hash + tests: + - not_null + - name: trace_address + tests: + - not_null + - name: escrow + - name: hashlock + - name: selector + - name: method + - name: secret + - name: order_hash + - name: token + - name: amount + - name: rescue_token + - name: rescue_amount + - name: call_success + - name: tx_success + - name: block_month diff --git a/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/_schema.yml index dc8ed4ecbc6..18f71f9ec1e 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/_schema.yml @@ -190,24 +190,28 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime description: "Block time" - name: blockNumber description: "Block number" - - name: txHash + - &call_tx_hash + name: call_tx_hash description: "Transaction hash" - name: projectContractAddress description: "Project contract address" - - name: callTraceAddress + - &call_trace_address + name: call_trace_address description: "Call trace address" - name: srcToken description: "Source token" @@ -226,9 +230,7 @@ models: - name: metadata description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side description: "Side" - name: feeCode diff --git a/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades.sql index bfd1a30fdda..a7ccb18154e 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades.sql @@ -38,8 +38,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_arbitrum_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades_decoded.sql index 58dfde98db8..502fc389f43 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/arbitrum/paraswap_v6_arbitrum_trades_decoded.sql @@ -6,7 +6,7 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) }} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/_schema.yml index 2b6a8ccbabb..586cda62507 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/_schema.yml @@ -188,24 +188,28 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime description: "Block time" - name: blockNumber description: "Block number" - - name: txHash + - &call_tx_hash + name: call_tx_hash description: "Transaction hash" - name: projectContractAddress description: "Project contract address" - - name: callTraceAddress + - &call_trace_address + name: call_trace_address description: "Call trace address" - name: srcToken description: "Source token" @@ -224,9 +228,7 @@ models: - name: metadata description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side description: "Side" - name: feeCode diff --git a/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades.sql index dee67adc0da..b8dc4e9a1d2 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades.sql @@ -37,8 +37,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_avalanche_c_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades_decoded.sql index 6f85f1482d3..8115c77340e 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/avalanche_c/paraswap_v6_avalanche_c_trades_decoded.sql @@ -6,8 +6,8 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) -}} +}} {{ paraswap_v6_trades_master('avalanche_c', 'paraswap') }} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/paraswap/base/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/base/_schema.yml index dd4834a5a30..d764e310694 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/base/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/base/_schema.yml @@ -188,47 +188,49 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime - description: "Block time" + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime + description: "Block time" - name: blockNumber - description: "Block number" - - name: txHash - description: "Transaction hash" + description: "Block number" + - &call_tx_hash + name: call_tx_hash + description: "Transaction hash" - name: projectContractAddress - description: "Project contract address" - - name: callTraceAddress - description: "Call trace address" + description: "Project contract address" + - &call_trace_address + name: call_trace_address + description: "Call trace address" - name: srcToken - description: "Source token" + description: "Source token" - name: destToken - description: "Destination token" + description: "Destination token" - name: fromAmount - description: "From amount" + description: "From amount" - name: spentAmount - description: "Spent amount" + description: "Spent amount" - name: toAmount - description: "To amount" + description: "To amount" - name: quotedAmount - description: "Quoted amount" + description: "Quoted amount" - name: receivedAmount - description: "Received amount" + description: "Received amount" - name: metadata - description: "Metadata" + description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side - description: "Side" + description: "Side" - name: feeCode description: "Fee code" - name: partnerShare diff --git a/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades.sql index 632af0177e7..fb2d1e7737d 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades.sql @@ -38,8 +38,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_base_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades_decoded.sql index f4fb95eb4de..f8d2ea8f24b 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/base/paraswap_v6_base_trades_decoded.sql @@ -6,7 +6,7 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) }} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/bnb/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/bnb/_schema.yml index 8976c5176c8..ccac9987e48 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/bnb/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/bnb/_schema.yml @@ -237,24 +237,28 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime description: "Block time" - name: blockNumber description: "Block number" - - name: txHash + - &call_tx_hash + name: call_tx_hash description: "Transaction hash" - name: projectContractAddress description: "Project contract address" - - name: callTraceAddress + - &call_trace_address + name: call_trace_address description: "Call trace address" - name: srcToken description: "Source token" @@ -273,9 +277,7 @@ models: - name: metadata description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side description: "Side" - name: feeCode diff --git a/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades.sql index 92d21b1b6ca..b7e28be89a6 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades.sql @@ -38,8 +38,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_bnb_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades_decoded.sql index 04ae429a54c..594d41c2743 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/bnb/paraswap_v6_bnb_trades_decoded.sql @@ -6,7 +6,7 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) }} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/ethereum/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/ethereum/_schema.yml index 312e8c69a76..64bf575ed79 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/ethereum/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/ethereum/_schema.yml @@ -239,24 +239,28 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime description: "Block time" - name: blockNumber description: "Block number" - - name: txHash + - &call_tx_hash + name: call_tx_hash description: "Transaction hash" - name: projectContractAddress description: "Project contract address" - - name: callTraceAddress + - &call_trace_address + name: call_trace_address description: "Call trace address" - name: srcToken description: "Source token" @@ -275,9 +279,7 @@ models: - name: metadata description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side description: "Side" - name: feeCode @@ -295,3 +297,4 @@ models: - name: isTakeSurplus description: "Is take surplus" + \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades.sql index b95d4a64c02..59c98c9969b 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades.sql @@ -38,8 +38,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_ethereum_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades_decoded.sql index fc42cf01ee9..eb2a0849ccc 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/ethereum/paraswap_v6_ethereum_trades_decoded.sql @@ -6,7 +6,7 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) }} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/fantom/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/fantom/_schema.yml index 2f59e23cb7d..41bbe0b3bf0 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/fantom/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/fantom/_schema.yml @@ -187,24 +187,28 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime description: "Block time" - name: blockNumber description: "Block number" - - name: txHash + - &call_tx_hash + name: call_tx_hash description: "Transaction hash" - name: projectContractAddress description: "Project contract address" - - name: callTraceAddress + - &call_trace_address + name: call_trace_address description: "Call trace address" - name: srcToken description: "Source token" @@ -223,9 +227,7 @@ models: - name: metadata description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side description: "Side" - name: feeCode diff --git a/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades.sql index 3a66431f73b..3cb32be1118 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades.sql @@ -38,8 +38,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_fantom_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades_decoded.sql index 8ffa125b0c8..ef3047c2ff0 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/fantom/paraswap_v6_fantom_trades_decoded.sql @@ -6,7 +6,7 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) }} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/optimism/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/optimism/_schema.yml index 1e183cc4a0b..0ba43c39039 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/optimism/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/optimism/_schema.yml @@ -187,24 +187,28 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime description: "Block time" - name: blockNumber description: "Block number" - - name: txHash + - &call_tx_hash + name: call_tx_hash description: "Transaction hash" - name: projectContractAddress description: "Project contract address" - - name: callTraceAddress + - &call_trace_address + name: call_trace_address description: "Call trace address" - name: srcToken description: "Source token" @@ -223,9 +227,7 @@ models: - name: metadata description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side description: "Side" - name: feeCode diff --git a/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades.sql index 4b3b47806b2..9d96d316f7b 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades.sql @@ -38,8 +38,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_optimism_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades_decoded.sql index 37e7cf62b96..f9fec8cccdb 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/optimism/paraswap_v6_optimism_trades_decoded.sql @@ -6,7 +6,7 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) }} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/polygon/_schema.yml b/dbt_subprojects/dex/models/_projects/paraswap/polygon/_schema.yml index c85ea613fbd..5f78e7ae1ba 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/polygon/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/paraswap/polygon/_schema.yml @@ -236,24 +236,28 @@ models: description: "Paraswap V6 trades decoded" tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - blockchain - - project - - version - - txHash + combination_of_columns: + - call_tx_hash - method - - callTraceAddress + - call_trace_address columns: - - name: blockTime + - *blockchain + - *project + - *version + - *block_date + - *method + - &blockTime + name: blockTime description: "Block time" - name: blockNumber description: "Block number" - - name: txHash + - &call_tx_hash + name: call_tx_hash description: "Transaction hash" - name: projectContractAddress description: "Project contract address" - - name: callTraceAddress + - &call_trace_address + name: call_trace_address description: "Call trace address" - name: srcToken description: "Source token" @@ -272,9 +276,7 @@ models: - name: metadata description: "Metadata" - name: beneficiary - description: "Beneficiary" - - name: method - description: "Method" + description: "Beneficiary" - name: side description: "Side" - name: feeCode diff --git a/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades.sql b/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades.sql index fb83b6705ca..b5b6641b8c5 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades.sql @@ -37,8 +37,8 @@ with dexs AS ( ELSE from_hex(srcToken) END AS token_sold_address, projectContractAddress as project_contract_address, - txHash AS tx_hash, - callTraceAddress AS trace_address, + call_tx_hash as tx_hash, + call_trace_address AS trace_address, CAST(-1 as integer) AS evt_index FROM {{ ref('paraswap_v6_polygon_trades_decoded') }} {% if is_incremental() %} diff --git a/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades_decoded.sql b/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades_decoded.sql index 1078feabb9f..ee56d154a6b 100644 --- a/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades_decoded.sql +++ b/dbt_subprojects/dex/models/_projects/paraswap/polygon/paraswap_v6_polygon_trades_decoded.sql @@ -6,7 +6,7 @@ file_format = 'delta', incremental_strategy = 'merge', incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.blockTime')], - unique_key = ['block_date', 'blockchain', 'project', 'version', 'txHash', 'method', 'callTraceAddress'] + unique_key = ['call_tx_hash', 'method', 'call_trace_address'] ) }} diff --git a/dbt_subprojects/dex/models/_projects/xchange/xchange_trades.sql b/dbt_subprojects/dex/models/_projects/xchange/xchange_trades.sql index 15ba9da82fb..302379959a1 100644 --- a/dbt_subprojects/dex/models/_projects/xchange/xchange_trades.sql +++ b/dbt_subprojects/dex/models/_projects/xchange/xchange_trades.sql @@ -2,7 +2,7 @@ schema = 'xchange', alias = 'trades', materialized = 'view', - post_hook='{{ expose_spells(blockchains = \'["ethereum","arbitrum", "polygon", "bnb"]\', + post_hook='{{ expose_spells(blockchains = \'["ethereum", "arbitrum", "polygon", "bnb", "base"]\', spell_type = "project", spell_name = "xchange", contributors = \'["mike-x7f"]\') }}' diff --git a/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql index 9f43b83dcc9..66ed038fc80 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql @@ -24,9 +24,7 @@ WITH tbl_addresses AS ( WHERE contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae AND blockchain = 'arbitrum' - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} + and block_time > TIMESTAMP '2024-05-23' ), tbl_end_times AS ( @@ -54,7 +52,8 @@ settler_txs AS ( block_number, method_id, contract_address, - MAX(varbinary_substring(tracker,1,12)) AS zid, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, CASE WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) @@ -66,7 +65,8 @@ settler_txs AS ( block_time, "to" AS contract_address, varbinary_substring(input,1,4) AS method_id, - varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address FROM {{ source('arbitrum', 'traces') }} AS tr JOIN @@ -81,88 +81,84 @@ settler_txs AS ( {% endif %} ) GROUP BY - 1,2,3,4,5 + 1,2,3,4,5,6 ), +tbl_trades as ( -tbl_all_logs AS ( +with tbl_all_logs AS ( SELECT logs.tx_hash, logs.block_time, logs.block_number, - ROW_NUMBER() OVER (PARTITION BY logs.tx_hash ORDER BY index) rn_first, - index, - CASE - WHEN varbinary_substring(logs.topic2, 13, 20) = logs.tx_from THEN 1 - WHEN varbinary_substring(logs.topic1, 13, 20) = st.contract_address THEN 0 - WHEN FIRST_VALUE(logs.contract_address) OVER (PARTITION BY logs.tx_hash ORDER BY index) = logs.contract_address THEN 0 - ELSE 1 - END maker_tkn, - bytearray_to_int256(bytearray_substring(DATA, 23,10)) value, - logs.contract_address AS token, - zid, - st.contract_address, + index, + case when ( (varbinary_substring(logs.topic2, 13, 20) = logs.tx_from) OR + (varbinary_substring(logs.topic2, 13, 20) = first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) or + topic0 = 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65) + then 1 end as valid, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, method_id, - tag + tag, + st.settler_address, + zid, + st.settler_address as contract_address FROM {{ source('arbitrum', 'logs') }} AS logs JOIN - settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + settler_txs st ON st.tx_hash = logs.tx_hash + AND logs.block_time = st.block_time + AND st.block_number = logs.block_number + AND ( (st.settler_address = bytearray_substring(logs.topic1,13,20)) + or (st.settler_address= bytearray_substring(logs.topic2,13,20)) + or logs.tx_from = bytearray_substring(logs.topic1,13,20) + or logs.tx_from = bytearray_substring(logs.topic2,13,20) + ) WHERE - topic0 IN (0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, - 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, - 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c) - and tag != 0x000000 and zid != 0xa00000000000000000000000 + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 {% if is_incremental() %} AND {{ incremental_predicate('logs.block_time') }} {% else %} AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by index desc) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 ), -tbl_maker_token AS ( - SELECT - ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY index DESC) rn_last, - token AS maker_token, - tx_hash, - block_time, - block_number, - index - FROM - tbl_all_logs - WHERE - maker_tkn = 1 -), - -tbl_trades AS ( - SELECT - ta.tx_hash, - ta.block_time, - ta.block_number, - zid, - method_id, - tag, - contract_address, - SUM(value) FILTER (WHERE rn_first = 1) AS taker_amount, - MAX(token) FILTER (WHERE rn_first = 1) AS taker_token, - SUM(value) FILTER (WHERE rn_last = 1) AS maker_amount, - MAX(maker_token) FILTER (WHERE rn_last = 1) AS maker_token - FROM - tbl_all_logs ta - LEFT JOIN - tbl_maker_token mkr ON ta.tx_hash = mkr.tx_hash AND ta.block_time = mkr.block_time AND ta.block_number = mkr.block_number AND ta.index = mkr.index AND mkr.rn_last = 1 - GROUP BY - 1,2,3,4,5,6,7 -), tokens AS ( - SELECT DISTINCT - te.* - FROM - {{ source('tokens', 'erc20') }} AS te - JOIN - tbl_trades ON te.contract_address = taker_token OR te.contract_address = maker_token - WHERE - te.blockchain = 'arbitrum' + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'arbitrum' ), prices AS ( @@ -181,6 +177,33 @@ prices AS ( {% endif %} ), +fills as ( + with signatures as ( + select distinct signature + from {{ source('arbitrum', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SellarbitrumToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('arbitrum', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + results AS ( SELECT trades.block_time, @@ -191,23 +214,8 @@ results AS ( trades.tx_hash, "from" AS tx_from, "to" AS tx_to, - index AS tx_index, - CASE - WHEN varbinary_substring(data,17,10) != 0x00000000000000000000 AND varbinary_substring(data,17,1) != 0x THEN varbinary_substring(data,17,20) - WHEN varbinary_substring(data,177,10) != 0x00000000000000000000 THEN varbinary_substring(data,177,20) - WHEN varbinary_substring(data,277,10) != 0x00000000000000000000 THEN varbinary_substring(data,277,20) - WHEN varbinary_substring(data,629,10) != 0x00000000000000000000 THEN varbinary_substring(data,629,20) - WHEN varbinary_substring(data,693,10) != 0x00000000000000000000 THEN varbinary_substring(data,693,20) - WHEN varbinary_substring(data,917,10) != 0x00000000000000000000 THEN varbinary_substring(data,917,20) - WHEN varbinary_substring(data,949,10) != 0x00000000000000000000 THEN varbinary_substring(data,949,20) - WHEN varbinary_substring(data,981,10) != 0x00000000000000000000 THEN varbinary_substring(data,981,20) - WHEN varbinary_substring(data,1013,10) != 0x00000000000000000000 THEN varbinary_substring(data,1013,20) - WHEN varbinary_substring(data,1141,10) != 0x00000000000000000000 THEN varbinary_substring(data,1141,20) - WHEN varbinary_substring(data,1273,10) != 0x00000000000000000000 THEN varbinary_substring(data,1273,20) - WHEN varbinary_substring(data,1749,4) != 0x00000000 THEN varbinary_substring(data,1749,20) - WHEN varbinary_substring(data,1049,4) != 0x00000000 THEN varbinary_substring(data,1049,20) - WHEN varbinary_substring(data,17,4) != 0x00000000 THEN varbinary_substring(data,17,20) - END AS taker , + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, CAST(NULL AS varbinary) AS maker, taker_token, pt.price, @@ -221,16 +229,13 @@ results AS ( maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, tag, - data, - varbinary_substring(data, varbinary_length(data) - CASE - WHEN varbinary_position (data,0xc4103b48be) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xc4103b48be)) - WHEN varbinary_position (data,0xe48d68a156) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe48d68a156)) - WHEN varbinary_position (data,0xe422ce6ede) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe422ce6ede)) - END -3, 37) taker_indicator_string + fills_within FROM tbl_trades trades JOIN {{ source('arbitrum', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number LEFT JOIN tokens tt ON tt.blockchain = 'arbitrum' AND tt.contract_address = taker_token LEFT JOIN @@ -251,7 +256,7 @@ results AS ( results_usd AS ( SELECT 'arbitrum' AS blockchain, - '0x API' AS project, + '0x-API' AS project, 'settler' AS version, DATE_TRUNC('day', block_time) block_date, DATE_TRUNC('month', block_time) AS block_month, @@ -263,13 +268,13 @@ results_usd AS ( maker_token_amount, taker_token_amount_raw, maker_token_amount_raw, - CASE WHEN maker_token IN (0x82af49447d8a07e3bd95bd0d56f35241523fbab1, + CASE WHEN maker_token IN (0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 0xaf88d065e77c8cc2239327c5edb3a432268e5831, 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8, 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9, 0x912ce59144191c1204e64559fe8253a0e49e6548) AND maker_amount IS NOT NULL THEN maker_amount - WHEN taker_token IN (0x82af49447d8a07e3bd95bd0d56f35241523fbab1, + WHEN taker_token IN (0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 0xaf88d065e77c8cc2239327c5edb3a432268e5831, 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8, 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9, @@ -279,13 +284,7 @@ results_usd AS ( END AS volume_usd, taker_token, maker_token, - CASE WHEN (varbinary_substring(taker,1,4) = 0x00000000) - OR taker IS NULL - OR taker = taker_token - OR taker = contract_address - OR taker = 0xdef1c0ded9bec7f1a1670819833240f027b25eff - OR varbinary_substring(taker_indicator_string, 18,20) != contract_address - THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, + taker, maker, tag, zid, @@ -296,7 +295,7 @@ results_usd AS ( (ARRAY[-1]) AS trace_address, 'settler' AS type, TRUE AS swap_flag, - -1 AS fills_within, + fills_within, contract_address FROM results diff --git a/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql index 79e945f2723..0628eff4a36 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql @@ -24,9 +24,7 @@ WITH tbl_addresses AS ( WHERE contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae AND blockchain = 'avalanche_c' - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} + and block_time > TIMESTAMP '2024-05-23' ), tbl_end_times AS ( @@ -54,7 +52,8 @@ settler_txs AS ( block_number, method_id, contract_address, - MAX(varbinary_substring(tracker,1,12)) AS zid, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, CASE WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) @@ -66,7 +65,8 @@ settler_txs AS ( block_time, "to" AS contract_address, varbinary_substring(input,1,4) AS method_id, - varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address FROM {{ source('avalanche_c', 'traces') }} AS tr JOIN @@ -81,88 +81,84 @@ settler_txs AS ( {% endif %} ) GROUP BY - 1,2,3,4,5 + 1,2,3,4,5,6 ), +tbl_trades as ( -tbl_all_logs AS ( +with tbl_all_logs AS ( SELECT logs.tx_hash, logs.block_time, logs.block_number, - ROW_NUMBER() OVER (PARTITION BY logs.tx_hash ORDER BY index) rn_first, - index, - CASE - WHEN varbinary_substring(logs.topic2, 13, 20) = logs.tx_from THEN 1 - WHEN varbinary_substring(logs.topic1, 13, 20) = st.contract_address THEN 0 - WHEN FIRST_VALUE(logs.contract_address) OVER (PARTITION BY logs.tx_hash ORDER BY index) = logs.contract_address THEN 0 - ELSE 1 - END maker_tkn, - bytearray_to_int256(bytearray_substring(DATA, 23,10)) value, - logs.contract_address AS token, - zid, - st.contract_address, + index, + case when ( (varbinary_substring(logs.topic2, 13, 20) = logs.tx_from) OR + (varbinary_substring(logs.topic2, 13, 20) = first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) or + topic0 = 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65) + then 1 end as valid, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, method_id, - tag + tag, + st.settler_address, + zid, + st.settler_address as contract_address FROM {{ source('avalanche_c', 'logs') }} AS logs JOIN - settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + settler_txs st ON st.tx_hash = logs.tx_hash + AND logs.block_time = st.block_time + AND st.block_number = logs.block_number + AND ( (st.settler_address = bytearray_substring(logs.topic1,13,20)) + or (st.settler_address= bytearray_substring(logs.topic2,13,20)) + or logs.tx_from = bytearray_substring(logs.topic1,13,20) + or logs.tx_from = bytearray_substring(logs.topic2,13,20) + ) WHERE - topic0 IN (0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, - 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, - 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c) - and tag != 0x000000 and zid != 0xa00000000000000000000000 + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 {% if is_incremental() %} AND {{ incremental_predicate('logs.block_time') }} {% else %} AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by valid, index desc) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 ), -tbl_maker_token AS ( - SELECT - ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY index DESC) rn_last, - token AS maker_token, - tx_hash, - block_time, - block_number, - index - FROM - tbl_all_logs - WHERE - maker_tkn = 1 -), - -tbl_trades AS ( - SELECT - ta.tx_hash, - ta.block_time, - ta.block_number, - zid, - method_id, - tag, - contract_address, - SUM(value) FILTER (WHERE rn_first = 1) AS taker_amount, - MAX(token) FILTER (WHERE rn_first = 1) AS taker_token, - SUM(value) FILTER (WHERE rn_last = 1) AS maker_amount, - MAX(maker_token) FILTER (WHERE rn_last = 1) AS maker_token - FROM - tbl_all_logs ta - LEFT JOIN - tbl_maker_token mkr ON ta.tx_hash = mkr.tx_hash AND ta.block_time = mkr.block_time AND ta.block_number = mkr.block_number AND ta.index = mkr.index AND mkr.rn_last = 1 - GROUP BY - 1,2,3,4,5,6,7 -), tokens AS ( - SELECT DISTINCT - te.* - FROM - {{ source('tokens', 'erc20') }} AS te - JOIN - tbl_trades ON te.contract_address = taker_token OR te.contract_address = maker_token - WHERE - te.blockchain = 'avalanche_c' + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'avalanche_c' ), prices AS ( @@ -181,6 +177,33 @@ prices AS ( {% endif %} ), +fills as ( + with signatures as ( + select distinct signature + from {{ source('avalanche_c', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'Sellavalanche_cToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('avalanche_c', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + results AS ( SELECT trades.block_time, @@ -191,23 +214,8 @@ results AS ( trades.tx_hash, "from" AS tx_from, "to" AS tx_to, - index AS tx_index, - CASE - WHEN varbinary_substring(data,17,10) != 0x00000000000000000000 AND varbinary_substring(data,17,1) != 0x THEN varbinary_substring(data,17,20) - WHEN varbinary_substring(data,177,10) != 0x00000000000000000000 THEN varbinary_substring(data,177,20) - WHEN varbinary_substring(data,277,10) != 0x00000000000000000000 THEN varbinary_substring(data,277,20) - WHEN varbinary_substring(data,629,10) != 0x00000000000000000000 THEN varbinary_substring(data,629,20) - WHEN varbinary_substring(data,693,10) != 0x00000000000000000000 THEN varbinary_substring(data,693,20) - WHEN varbinary_substring(data,917,10) != 0x00000000000000000000 THEN varbinary_substring(data,917,20) - WHEN varbinary_substring(data,949,10) != 0x00000000000000000000 THEN varbinary_substring(data,949,20) - WHEN varbinary_substring(data,981,10) != 0x00000000000000000000 THEN varbinary_substring(data,981,20) - WHEN varbinary_substring(data,1013,10) != 0x00000000000000000000 THEN varbinary_substring(data,1013,20) - WHEN varbinary_substring(data,1141,10) != 0x00000000000000000000 THEN varbinary_substring(data,1141,20) - WHEN varbinary_substring(data,1273,10) != 0x00000000000000000000 THEN varbinary_substring(data,1273,20) - WHEN varbinary_substring(data,1749,4) != 0x00000000 THEN varbinary_substring(data,1749,20) - WHEN varbinary_substring(data,1049,4) != 0x00000000 THEN varbinary_substring(data,1049,20) - WHEN varbinary_substring(data,17,4) != 0x00000000 THEN varbinary_substring(data,17,20) - END AS taker , + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, CAST(NULL AS varbinary) AS maker, taker_token, pt.price, @@ -221,16 +229,13 @@ results AS ( maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, tag, - data, - varbinary_substring(data, varbinary_length(data) - CASE - WHEN varbinary_position (data,0xc4103b48be) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xc4103b48be)) - WHEN varbinary_position (data,0xe48d68a156) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe48d68a156)) - WHEN varbinary_position (data,0xe422ce6ede) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe422ce6ede)) - END -3, 37) taker_indicator_string + fills_within FROM tbl_trades trades JOIN {{ source('avalanche_c', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number LEFT JOIN tokens tt ON tt.blockchain = 'avalanche_c' AND tt.contract_address = taker_token LEFT JOIN @@ -251,7 +256,7 @@ results AS ( results_usd AS ( SELECT 'avalanche_c' AS blockchain, - '0x API' AS project, + '0x-API' AS project, 'settler' AS version, DATE_TRUNC('day', block_time) block_date, DATE_TRUNC('month', block_time) AS block_month, @@ -263,29 +268,23 @@ results_usd AS ( maker_token_amount, taker_token_amount_raw, maker_token_amount_raw, - CASE WHEN maker_token IN (0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7, + CASE WHEN maker_token IN (0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7, 0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e, 0x152b9d0fdc40c096757f570a51e494bd4b943e50, 0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab, - 0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7) AND maker_amount IS NOT NULL + 0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7) AND maker_amount IS NOT NULL THEN maker_amount - WHEN taker_token IN (0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7, + WHEN taker_token IN (0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7, 0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e, 0x152b9d0fdc40c096757f570a51e494bd4b943e50, 0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab, - 0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7) AND taker_amount IS NOT NULL + 0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7) AND taker_amount IS NOT NULL THEN taker_amount ELSE COALESCE(maker_amount, taker_amount) END AS volume_usd, taker_token, maker_token, - CASE WHEN (varbinary_substring(taker,1,4) = 0x00000000) - OR taker IS NULL - OR taker = taker_token - OR taker = contract_address - OR taker = 0xdef1c0ded9bec7f1a1670819833240f027b25eff - OR varbinary_substring(taker_indicator_string, 18,20) != contract_address - THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, + taker, maker, tag, zid, @@ -296,7 +295,7 @@ results_usd AS ( (ARRAY[-1]) AS trace_address, 'settler' AS type, TRUE AS swap_flag, - -1 AS fills_within, + fills_within, contract_address FROM results diff --git a/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql index 1e8432bbd0b..bcf834f6bbd 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql @@ -24,9 +24,7 @@ WITH tbl_addresses AS ( WHERE contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae AND blockchain = 'base' - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} + and block_time > TIMESTAMP '2024-05-23' ), tbl_end_times AS ( @@ -54,7 +52,8 @@ settler_txs AS ( block_number, method_id, contract_address, - MAX(varbinary_substring(tracker,1,12)) AS zid, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, CASE WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) @@ -66,7 +65,8 @@ settler_txs AS ( block_time, "to" AS contract_address, varbinary_substring(input,1,4) AS method_id, - varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address FROM {{ source('base', 'traces') }} AS tr JOIN @@ -81,88 +81,83 @@ settler_txs AS ( {% endif %} ) GROUP BY - 1,2,3,4,5 + 1,2,3,4,5,6 ), +tbl_trades as ( -tbl_all_logs AS ( +with tbl_all_logs AS ( SELECT logs.tx_hash, logs.block_time, logs.block_number, - ROW_NUMBER() OVER (PARTITION BY logs.tx_hash ORDER BY index) rn_first, - index, - CASE - WHEN varbinary_substring(logs.topic2, 13, 20) = logs.tx_from THEN 1 - WHEN varbinary_substring(logs.topic1, 13, 20) = st.contract_address THEN 0 - WHEN FIRST_VALUE(logs.contract_address) OVER (PARTITION BY logs.tx_hash ORDER BY index) = logs.contract_address THEN 0 - ELSE 1 - END maker_tkn, - bytearray_to_int256(bytearray_substring(DATA, 23,10)) value, - logs.contract_address AS token, - zid, - st.contract_address, + index, + case when ( (varbinary_substring(logs.topic2, 13, 20) = logs.tx_from) OR + (varbinary_substring(logs.topic2, 13, 20) = first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) or + topic0 = 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65) + then 1 end as valid, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, method_id, - tag + tag, + st.settler_address, + zid, + st.settler_address as contract_address FROM {{ source('base', 'logs') }} AS logs JOIN - settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + settler_txs st ON st.tx_hash = logs.tx_hash + AND logs.block_time = st.block_time + AND st.block_number = logs.block_number + AND ( (st.settler_address = bytearray_substring(logs.topic1,13,20)) + or (st.settler_address= bytearray_substring(logs.topic2,13,20)) + or logs.tx_from = bytearray_substring(logs.topic1,13,20) + or logs.tx_from = bytearray_substring(logs.topic2,13,20) + ) WHERE - topic0 IN (0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, - 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, - 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c) - and tag != 0x000000 and zid != 0xa00000000000000000000000 + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 {% if is_incremental() %} AND {{ incremental_predicate('logs.block_time') }} {% else %} AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' {% endif %} -), - -tbl_maker_token AS ( - SELECT - ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY index DESC) rn_last, - token AS maker_token, - tx_hash, - block_time, - block_number, - index - FROM - tbl_all_logs - WHERE - maker_tkn = 1 -), - -tbl_trades AS ( - SELECT - ta.tx_hash, - ta.block_time, - ta.block_number, - zid, - method_id, - tag, - contract_address, - SUM(value) FILTER (WHERE rn_first = 1) AS taker_amount, - MAX(token) FILTER (WHERE rn_first = 1) AS taker_token, - SUM(value) FILTER (WHERE rn_last = 1) AS maker_amount, - MAX(maker_token) FILTER (WHERE rn_last = 1) AS maker_token - FROM - tbl_all_logs ta - LEFT JOIN - tbl_maker_token mkr ON ta.tx_hash = mkr.tx_hash AND ta.block_time = mkr.block_time AND ta.block_number = mkr.block_number AND ta.index = mkr.index AND mkr.rn_last = 1 - GROUP BY - 1,2,3,4,5,6,7 + ), + tbl_valid_logs as ( + select *, + row_number() over (partition by tx_hash order by valid, index) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 ), tokens AS ( - SELECT DISTINCT - te.* - FROM - {{ source('tokens', 'erc20') }} AS te - JOIN - tbl_trades ON te.contract_address = taker_token OR te.contract_address = maker_token - WHERE - te.blockchain = 'base' + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'base' ), prices AS ( @@ -181,6 +176,33 @@ prices AS ( {% endif %} ), +fills as ( + with signatures as ( + select distinct signature + from {{ source('base', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SellbaseToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('base', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + results AS ( SELECT trades.block_time, @@ -191,23 +213,8 @@ results AS ( trades.tx_hash, "from" AS tx_from, "to" AS tx_to, - index AS tx_index, - CASE - WHEN varbinary_substring(data,17,10) != 0x00000000000000000000 AND varbinary_substring(data,17,1) != 0x THEN varbinary_substring(data,17,20) - WHEN varbinary_substring(data,177,10) != 0x00000000000000000000 THEN varbinary_substring(data,177,20) - WHEN varbinary_substring(data,277,10) != 0x00000000000000000000 THEN varbinary_substring(data,277,20) - WHEN varbinary_substring(data,629,10) != 0x00000000000000000000 THEN varbinary_substring(data,629,20) - WHEN varbinary_substring(data,693,10) != 0x00000000000000000000 THEN varbinary_substring(data,693,20) - WHEN varbinary_substring(data,917,10) != 0x00000000000000000000 THEN varbinary_substring(data,917,20) - WHEN varbinary_substring(data,949,10) != 0x00000000000000000000 THEN varbinary_substring(data,949,20) - WHEN varbinary_substring(data,981,10) != 0x00000000000000000000 THEN varbinary_substring(data,981,20) - WHEN varbinary_substring(data,1013,10) != 0x00000000000000000000 THEN varbinary_substring(data,1013,20) - WHEN varbinary_substring(data,1141,10) != 0x00000000000000000000 THEN varbinary_substring(data,1141,20) - WHEN varbinary_substring(data,1273,10) != 0x00000000000000000000 THEN varbinary_substring(data,1273,20) - WHEN varbinary_substring(data,1749,4) != 0x00000000 THEN varbinary_substring(data,1749,20) - WHEN varbinary_substring(data,1049,4) != 0x00000000 THEN varbinary_substring(data,1049,20) - WHEN varbinary_substring(data,17,4) != 0x00000000 THEN varbinary_substring(data,17,20) - END AS taker , + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, CAST(NULL AS varbinary) AS maker, taker_token, pt.price, @@ -221,16 +228,13 @@ results AS ( maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, tag, - data, - varbinary_substring(data, varbinary_length(data) - CASE - WHEN varbinary_position (data,0xc4103b48be) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xc4103b48be)) - WHEN varbinary_position (data,0xe48d68a156) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe48d68a156)) - WHEN varbinary_position (data,0xe422ce6ede) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe422ce6ede)) - END -3, 37) taker_indicator_string + -1 as fills_within FROM tbl_trades trades JOIN {{ source('base', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number LEFT JOIN tokens tt ON tt.blockchain = 'base' AND tt.contract_address = taker_token LEFT JOIN @@ -263,13 +267,13 @@ results_usd AS ( maker_token_amount, taker_token_amount_raw, maker_token_amount_raw, - CASE WHEN maker_token IN (0x4200000000000000000000000000000000000006, + CASE WHEN maker_token IN (0x4200000000000000000000000000000000000006, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca, 0x5d0af35b4f6f4715961b56168de93bf0062b173d, 0x50c5725949a6f0c72e6c4a641f24049a917db0cb) AND maker_amount IS NOT NULL THEN maker_amount - WHEN taker_token IN (0x4200000000000000000000000000000000000006, + WHEN taker_token IN (0x4200000000000000000000000000000000000006, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca, 0x5d0af35b4f6f4715961b56168de93bf0062b173d, @@ -279,13 +283,7 @@ results_usd AS ( END AS volume_usd, taker_token, maker_token, - CASE WHEN (varbinary_substring(taker,1,4) = 0x00000000) - OR taker IS NULL - OR taker = taker_token - OR taker = contract_address - OR taker = 0xdef1c0ded9bec7f1a1670819833240f027b25eff - OR varbinary_substring(taker_indicator_string, 18,20) != contract_address - THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, + taker, maker, tag, zid, @@ -296,15 +294,15 @@ results_usd AS ( (ARRAY[-1]) AS trace_address, 'settler' AS type, TRUE AS swap_flag, - -1 AS fills_within, + fills_within, contract_address FROM results ) -SELECT DISTINCT +SELECT * FROM results_usd ORDER BY - block_time DESC \ No newline at end of file + block_time DESC diff --git a/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql index d55b5d7bc9f..7d53b722cf4 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql @@ -24,9 +24,7 @@ WITH tbl_addresses AS ( WHERE contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae AND blockchain = 'bnb' - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} + and block_time > TIMESTAMP '2024-05-23' ), tbl_end_times AS ( @@ -54,7 +52,8 @@ settler_txs AS ( block_number, method_id, contract_address, - MAX(varbinary_substring(tracker,1,12)) AS zid, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, CASE WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) @@ -66,7 +65,8 @@ settler_txs AS ( block_time, "to" AS contract_address, varbinary_substring(input,1,4) AS method_id, - varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address FROM {{ source('bnb', 'traces') }} AS tr JOIN @@ -81,88 +81,84 @@ settler_txs AS ( {% endif %} ) GROUP BY - 1,2,3,4,5 + 1,2,3,4,5,6 ), +tbl_trades as ( -tbl_all_logs AS ( +with tbl_all_logs AS ( SELECT logs.tx_hash, logs.block_time, logs.block_number, - ROW_NUMBER() OVER (PARTITION BY logs.tx_hash ORDER BY index) rn_first, - index, - CASE - WHEN varbinary_substring(logs.topic2, 13, 20) = logs.tx_from THEN 1 - WHEN varbinary_substring(logs.topic1, 13, 20) = st.contract_address THEN 0 - WHEN FIRST_VALUE(logs.contract_address) OVER (PARTITION BY logs.tx_hash ORDER BY index) = logs.contract_address THEN 0 - ELSE 1 - END maker_tkn, - bytearray_to_int256(bytearray_substring(DATA, 23,10)) value, - logs.contract_address AS token, - zid, - st.contract_address, + index, + case when ( (varbinary_substring(logs.topic2, 13, 20) = logs.tx_from) OR + (varbinary_substring(logs.topic2, 13, 20) = first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) or + topic0 = 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65) + then 1 end as valid, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, method_id, - tag + tag, + st.settler_address, + zid, + st.settler_address as contract_address FROM {{ source('bnb', 'logs') }} AS logs JOIN - settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + settler_txs st ON st.tx_hash = logs.tx_hash + AND logs.block_time = st.block_time + AND st.block_number = logs.block_number + AND ( (st.settler_address = bytearray_substring(logs.topic1,13,20)) + or (st.settler_address= bytearray_substring(logs.topic2,13,20)) + or logs.tx_from = bytearray_substring(logs.topic1,13,20) + or logs.tx_from = bytearray_substring(logs.topic2,13,20) + ) WHERE - topic0 IN (0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, - 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, - 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c) - and tag != 0x000000 and zid != 0xa00000000000000000000000 + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 {% if is_incremental() %} AND {{ incremental_predicate('logs.block_time') }} {% else %} AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by valid, index desc) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 ), -tbl_maker_token AS ( - SELECT - ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY index DESC) rn_last, - token AS maker_token, - tx_hash, - block_time, - block_number, - index - FROM - tbl_all_logs - WHERE - maker_tkn = 1 -), - -tbl_trades AS ( - SELECT - ta.tx_hash, - ta.block_time, - ta.block_number, - zid, - method_id, - tag, - contract_address, - SUM(value) FILTER (WHERE rn_first = 1) AS taker_amount, - MAX(token) FILTER (WHERE rn_first = 1) AS taker_token, - SUM(value) FILTER (WHERE rn_last = 1) AS maker_amount, - MAX(maker_token) FILTER (WHERE rn_last = 1) AS maker_token - FROM - tbl_all_logs ta - LEFT JOIN - tbl_maker_token mkr ON ta.tx_hash = mkr.tx_hash AND ta.block_time = mkr.block_time AND ta.block_number = mkr.block_number AND ta.index = mkr.index AND mkr.rn_last = 1 - GROUP BY - 1,2,3,4,5,6,7 -), tokens AS ( - SELECT DISTINCT - te.* - FROM - {{ source('tokens', 'erc20') }} AS te - JOIN - tbl_trades ON te.contract_address = taker_token OR te.contract_address = maker_token - WHERE - te.blockchain = 'bnb' + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'bnb' ), prices AS ( @@ -181,6 +177,33 @@ prices AS ( {% endif %} ), +fills as ( + with signatures as ( + select distinct signature + from {{ source('bnb', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SellbnbToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('bnb', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + results AS ( SELECT trades.block_time, @@ -191,23 +214,8 @@ results AS ( trades.tx_hash, "from" AS tx_from, "to" AS tx_to, - index AS tx_index, - CASE - WHEN varbinary_substring(data,17,10) != 0x00000000000000000000 AND varbinary_substring(data,17,1) != 0x THEN varbinary_substring(data,17,20) - WHEN varbinary_substring(data,177,10) != 0x00000000000000000000 THEN varbinary_substring(data,177,20) - WHEN varbinary_substring(data,277,10) != 0x00000000000000000000 THEN varbinary_substring(data,277,20) - WHEN varbinary_substring(data,629,10) != 0x00000000000000000000 THEN varbinary_substring(data,629,20) - WHEN varbinary_substring(data,693,10) != 0x00000000000000000000 THEN varbinary_substring(data,693,20) - WHEN varbinary_substring(data,917,10) != 0x00000000000000000000 THEN varbinary_substring(data,917,20) - WHEN varbinary_substring(data,949,10) != 0x00000000000000000000 THEN varbinary_substring(data,949,20) - WHEN varbinary_substring(data,981,10) != 0x00000000000000000000 THEN varbinary_substring(data,981,20) - WHEN varbinary_substring(data,1013,10) != 0x00000000000000000000 THEN varbinary_substring(data,1013,20) - WHEN varbinary_substring(data,1141,10) != 0x00000000000000000000 THEN varbinary_substring(data,1141,20) - WHEN varbinary_substring(data,1273,10) != 0x00000000000000000000 THEN varbinary_substring(data,1273,20) - WHEN varbinary_substring(data,1749,4) != 0x00000000 THEN varbinary_substring(data,1749,20) - WHEN varbinary_substring(data,1049,4) != 0x00000000 THEN varbinary_substring(data,1049,20) - WHEN varbinary_substring(data,17,4) != 0x00000000 THEN varbinary_substring(data,17,20) - END AS taker , + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, CAST(NULL AS varbinary) AS maker, taker_token, pt.price, @@ -221,16 +229,13 @@ results AS ( maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, tag, - data, - varbinary_substring(data, varbinary_length(data) - CASE - WHEN varbinary_position (data,0xc4103b48be) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xc4103b48be)) - WHEN varbinary_position (data,0xe48d68a156) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe48d68a156)) - WHEN varbinary_position (data,0xe422ce6ede) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe422ce6ede)) - END -3, 37) taker_indicator_string + fills_within FROM tbl_trades trades JOIN {{ source('bnb', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number LEFT JOIN tokens tt ON tt.blockchain = 'bnb' AND tt.contract_address = taker_token LEFT JOIN @@ -251,7 +256,7 @@ results AS ( results_usd AS ( SELECT 'bnb' AS blockchain, - '0x API' AS project, + '0x-API' AS project, 'settler' AS version, DATE_TRUNC('day', block_time) block_date, DATE_TRUNC('month', block_time) AS block_month, @@ -263,31 +268,25 @@ results_usd AS ( maker_token_amount, taker_token_amount_raw, maker_token_amount_raw, - CASE WHEN maker_token IN (0x55d398326f99059ff775485246999027b3197955, + CASE WHEN maker_token IN (0x55d398326f99059ff775485246999027b3197955, 0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c, 0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d, 0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c, 0x2170ed0880ac9a755fd29b2688956bd959f933f8, - 0xe9e7cea3dedca5984780bafc599bd69add087d56) AND maker_amount IS NOT NULL + 0xe9e7cea3dedca5984780bafc599bd69add087d56) AND maker_amount IS NOT NULL THEN maker_amount - WHEN taker_token IN (0x55d398326f99059ff775485246999027b3197955, + WHEN taker_token IN (0x55d398326f99059ff775485246999027b3197955, 0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c, 0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d, 0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c, 0x2170ed0880ac9a755fd29b2688956bd959f933f8, - 0xe9e7cea3dedca5984780bafc599bd69add087d56) AND taker_amount IS NOT NULL + 0xe9e7cea3dedca5984780bafc599bd69add087d56) AND taker_amount IS NOT NULL THEN taker_amount ELSE COALESCE(maker_amount, taker_amount) END AS volume_usd, taker_token, maker_token, - CASE WHEN (varbinary_substring(taker,1,4) = 0x00000000) - OR taker IS NULL - OR taker = taker_token - OR taker = contract_address - OR taker = 0xdef1c0ded9bec7f1a1670819833240f027b25eff - OR varbinary_substring(taker_indicator_string, 18,20) != contract_address - THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, + taker, maker, tag, zid, @@ -298,7 +297,7 @@ results_usd AS ( (ARRAY[-1]) AS trace_address, 'settler' AS type, TRUE AS swap_flag, - -1 AS fills_within, + fills_within, contract_address FROM results diff --git a/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql index 9d47858f093..d94154c7a98 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql @@ -24,9 +24,7 @@ WITH tbl_addresses AS ( WHERE contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae AND blockchain = 'ethereum' - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} + and block_time > TIMESTAMP '2024-05-23' ), tbl_end_times AS ( @@ -54,7 +52,8 @@ settler_txs AS ( block_number, method_id, contract_address, - MAX(varbinary_substring(tracker,1,12)) AS zid, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, CASE WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) @@ -66,7 +65,8 @@ settler_txs AS ( block_time, "to" AS contract_address, varbinary_substring(input,1,4) AS method_id, - varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address FROM {{ source('ethereum', 'traces') }} AS tr JOIN @@ -81,88 +81,84 @@ settler_txs AS ( {% endif %} ) GROUP BY - 1,2,3,4,5 + 1,2,3,4,5,6 ), +tbl_trades as ( -tbl_all_logs AS ( +with tbl_all_logs AS ( SELECT logs.tx_hash, logs.block_time, logs.block_number, - ROW_NUMBER() OVER (PARTITION BY logs.tx_hash ORDER BY index) rn_first, - index, - CASE - WHEN varbinary_substring(logs.topic2, 13, 20) = logs.tx_from THEN 1 - WHEN varbinary_substring(logs.topic1, 13, 20) = st.contract_address THEN 0 - WHEN FIRST_VALUE(logs.contract_address) OVER (PARTITION BY logs.tx_hash ORDER BY index) = logs.contract_address THEN 0 - ELSE 1 - END maker_tkn, - bytearray_to_int256(bytearray_substring(DATA, 23,10)) value, - logs.contract_address AS token, - zid, - st.contract_address, + index, + case when ( (varbinary_substring(logs.topic2, 13, 20) = logs.tx_from) OR + (varbinary_substring(logs.topic2, 13, 20) = first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) or + topic0 = 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65) + then 1 end as valid, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, method_id, - tag + tag, + st.settler_address, + zid, + st.settler_address as contract_address FROM {{ source('ethereum', 'logs') }} AS logs JOIN - settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + settler_txs st ON st.tx_hash = logs.tx_hash + AND logs.block_time = st.block_time + AND st.block_number = logs.block_number + AND ( (st.settler_address = bytearray_substring(logs.topic1,13,20)) + or (st.settler_address= bytearray_substring(logs.topic2,13,20)) + or logs.tx_from = bytearray_substring(logs.topic1,13,20) + or logs.tx_from = bytearray_substring(logs.topic2,13,20) + ) WHERE - topic0 IN (0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, - 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, - 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c) + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 {% if is_incremental() %} - and tag != 0x000000 and zid != 0xa00000000000000000000000 AND {{ incremental_predicate('logs.block_time') }} {% else %} AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by valid, index desc) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 ), -tbl_maker_token AS ( - SELECT - ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY index DESC) rn_last, - token AS maker_token, - tx_hash, - block_time, - block_number, - index - FROM - tbl_all_logs - WHERE - maker_tkn = 1 -), - -tbl_trades AS ( - SELECT - ta.tx_hash, - ta.block_time, - ta.block_number, - zid, - method_id, - tag, - contract_address, - SUM(value) FILTER (WHERE rn_first = 1) AS taker_amount, - MAX(token) FILTER (WHERE rn_first = 1) AS taker_token, - SUM(value) FILTER (WHERE rn_last = 1) AS maker_amount, - MAX(maker_token) FILTER (WHERE rn_last = 1) AS maker_token - FROM - tbl_all_logs ta - LEFT JOIN - tbl_maker_token mkr ON ta.tx_hash = mkr.tx_hash AND ta.block_time = mkr.block_time AND ta.block_number = mkr.block_number AND ta.index = mkr.index AND mkr.rn_last = 1 - GROUP BY - 1,2,3,4,5,6,7 -), tokens AS ( - SELECT DISTINCT - te.* - FROM - {{ source('tokens', 'erc20') }} AS te - JOIN - tbl_trades ON te.contract_address = taker_token OR te.contract_address = maker_token - WHERE - te.blockchain = 'ethereum' + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'ethereum' ), prices AS ( @@ -181,6 +177,33 @@ prices AS ( {% endif %} ), +fills as ( + with signatures as ( + select distinct signature + from {{ source('ethereum', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SellethereumToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('ethereum', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + results AS ( SELECT trades.block_time, @@ -191,23 +214,8 @@ results AS ( trades.tx_hash, "from" AS tx_from, "to" AS tx_to, - index AS tx_index, - CASE - WHEN varbinary_substring(data,17,10) != 0x00000000000000000000 AND varbinary_substring(data,17,1) != 0x THEN varbinary_substring(data,17,20) - WHEN varbinary_substring(data,177,10) != 0x00000000000000000000 THEN varbinary_substring(data,177,20) - WHEN varbinary_substring(data,277,10) != 0x00000000000000000000 THEN varbinary_substring(data,277,20) - WHEN varbinary_substring(data,629,10) != 0x00000000000000000000 THEN varbinary_substring(data,629,20) - WHEN varbinary_substring(data,693,10) != 0x00000000000000000000 THEN varbinary_substring(data,693,20) - WHEN varbinary_substring(data,917,10) != 0x00000000000000000000 THEN varbinary_substring(data,917,20) - WHEN varbinary_substring(data,949,10) != 0x00000000000000000000 THEN varbinary_substring(data,949,20) - WHEN varbinary_substring(data,981,10) != 0x00000000000000000000 THEN varbinary_substring(data,981,20) - WHEN varbinary_substring(data,1013,10) != 0x00000000000000000000 THEN varbinary_substring(data,1013,20) - WHEN varbinary_substring(data,1141,10) != 0x00000000000000000000 THEN varbinary_substring(data,1141,20) - WHEN varbinary_substring(data,1273,10) != 0x00000000000000000000 THEN varbinary_substring(data,1273,20) - WHEN varbinary_substring(data,1749,4) != 0x00000000 THEN varbinary_substring(data,1749,20) - WHEN varbinary_substring(data,1049,4) != 0x00000000 THEN varbinary_substring(data,1049,20) - WHEN varbinary_substring(data,17,4) != 0x00000000 THEN varbinary_substring(data,17,20) - END AS taker , + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, CAST(NULL AS varbinary) AS maker, taker_token, pt.price, @@ -221,16 +229,13 @@ results AS ( maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, tag, - data, - varbinary_substring(data, varbinary_length(data) - CASE - WHEN varbinary_position (data,0xc4103b48be) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xc4103b48be)) - WHEN varbinary_position (data,0xe48d68a156) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe48d68a156)) - WHEN varbinary_position (data,0xe422ce6ede) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe422ce6ede)) - END -3, 37) taker_indicator_string + fills_within FROM tbl_trades trades JOIN {{ source('ethereum', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number LEFT JOIN tokens tt ON tt.blockchain = 'ethereum' AND tt.contract_address = taker_token LEFT JOIN @@ -251,7 +256,7 @@ results AS ( results_usd AS ( SELECT 'ethereum' AS blockchain, - '0x API' AS project, + '0x-API' AS project, 'settler' AS version, DATE_TRUNC('day', block_time) block_date, DATE_TRUNC('month', block_time) AS block_month, @@ -263,31 +268,25 @@ results_usd AS ( maker_token_amount, taker_token_amount_raw, maker_token_amount_raw, - CASE WHEN maker_token IN (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, + CASE WHEN maker_token IN (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 0xdac17f958d2ee523a2206206994597c13d831ec7, 0x4fabb145d64652a948d72533023f6e7a623c7c53, 0x6b175474e89094c44da98b954eedeac495271d0f, 0xae7ab96520de3a18e5e111b5eaab095312d7fe84) AND maker_amount IS NOT NULL THEN maker_amount - WHEN taker_token IN (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, + WHEN taker_token IN (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 0xdac17f958d2ee523a2206206994597c13d831ec7, 0x4fabb145d64652a948d72533023f6e7a623c7c53, 0x6b175474e89094c44da98b954eedeac495271d0f, - 0xae7ab96520de3a18e5e111b5eaab095312d7fe84) AND maker_amount IS NOT NULL AND taker_amount IS NOT NULL + 0xae7ab96520de3a18e5e111b5eaab095312d7fe84) AND taker_amount IS NOT NULL THEN taker_amount ELSE COALESCE(maker_amount, taker_amount) END AS volume_usd, taker_token, maker_token, - CASE WHEN (varbinary_substring(taker,1,4) = 0x00000000) - OR taker IS NULL - OR taker = taker_token - OR taker = contract_address - OR taker = 0xdef1c0ded9bec7f1a1670819833240f027b25eff - OR varbinary_substring(taker_indicator_string, 18,20) != contract_address - THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, + taker, maker, tag, zid, @@ -298,7 +297,7 @@ results_usd AS ( (ARRAY[-1]) AS trace_address, 'settler' AS type, TRUE AS swap_flag, - -1 AS fills_within, + fills_within, contract_address FROM results diff --git a/dbt_subprojects/dex/models/_projects/zeroex/linea/zeroex_linea_schema.yml b/dbt_subprojects/dex/models/_projects/zeroex/linea/zeroex_linea_schema.yml new file mode 100644 index 00000000000..5a04d65f2c3 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/zeroex/linea/zeroex_linea_schema.yml @@ -0,0 +1,111 @@ +version: 2 + +models: + - name: zeroex_linea_settler_trades + meta: + blockchain: linea + project: zeroex + contributors: rantum + config: + tags: ['linea','0x','dex_aggregator','dex','aggregator'] + description: > + 0x API erc20 trades through 0x Settler contracts. No fills, only deduped transactions. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_month + - block_date + - tx_hash + - evt_index + - check_seed: + seed_file: ref('zeroex_linea_settler_trades_sample') + match_columns: + - tx_hash + check_columns: + - taker + - maker_token + - taker_token + columns: + - &blockchain + name: blockchain + description: "Blockchain which the aggregator project is deployed" + - &block_date + name: block_date + description: "UTC event block date of each trade" + - &block_month + name: block_month + description: "UTC event block month of each trade" + - &block_time + name: block_time + description: "UTC event block time of each trade" + - &taker_symbol + name: taker_symbol + description: "Symbol of the token taker sells" + - &maker_symbol + name: maker_symbol + description: "Symbol of the token taker buys" + - &token_pair + name: token_pair + description: "Token pair traded" + - &taker_token_amount + name: taker_token_amount + description: "The after-decimal amount of the token taker sells" + - &taker_token_amount_raw + name: taker_token_amount_raw + description: "The raw amount of the token taker sells" + - &maker_token_amount + name: maker_token_amount + description: "The after-decimal amount of the token taker buys" + - &maker_token_amount_raw + name: maker_token_amount_raw + description: "The raw amount of the token taker buys" + - &volume_usd + name: volume_usd + description: "Trading volume measured in USD value" + - &taker_token + name: taker_token + description: "Contract address of the token taker sells" + - &maker_token + name: maker_token + description: "Contract address of the token taker buys" + - &maker + name: maker + description: "buyer of the trade" + - &taker + name: taker + description: "seller of the trade" + - &affiliate_address + name: affiliate_address + description: "The recipient address of the affiliate, or the applications that is using 0x API, for receiving affiliate fee" + - &tx_hash + name: tx_hash + description: "Transaction hash of the fill" + - &tx_from + name: tx_from + description: "Address which initiated the trade" + - &tx_to + name: tx_to + description: "Address which received the trade" + - &evt_index + name: evt_index + description: "Index of the corresponding order filled event" + - &type + name: type + description: "The liquidity route the order went thru" + - &swap_flag + name: swap_flag + description: "If the swap was filled/consumed thru 0x API" + - &contract_address + name: contract_address + desctiption: "The address of the contract which fired the fill/swap event" + - &fills_within + name: fills_within + description: "fills in then multihop, if present" + + + + + + + + \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/zeroex/linea/zeroex_linea_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/linea/zeroex_linea_settler_trades.sql new file mode 100644 index 00000000000..641ec0626b5 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/zeroex/linea/zeroex_linea_settler_trades.sql @@ -0,0 +1,298 @@ +{{ config( + schema = 'zeroex_linea', + alias = 'settler_trades', + materialized='incremental', + partition_by = ['block_month'], + unique_key = ['block_month', 'block_date', 'tx_hash', 'evt_index'], + on_schema_change='sync_all_columns', + file_format ='delta', + incremental_strategy='merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +{% set zeroex_settler_start_date = '2024-07-15' %} + +WITH tbl_addresses AS ( + SELECT + blockchain, + token_id, + to AS settler_address, + block_time AS begin_block_time, + block_number AS begin_block_number + FROM + {{ source('nft', 'transfers') }} + WHERE + contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae + AND blockchain = 'linea' + and block_time > TIMESTAMP '2024-05-23' +), + +tbl_end_times AS ( + SELECT + *, + LEAD(begin_block_time) OVER (PARTITION BY blockchain, token_id ORDER BY begin_block_time) AS end_block_time, + LEAD(begin_block_number) OVER (PARTITION BY blockchain, token_id ORDER BY begin_block_number) AS end_block_number + FROM + tbl_addresses +), + +result_0x_settler_addresses AS ( + SELECT + * + FROM + tbl_end_times + WHERE + settler_address != 0x0000000000000000000000000000000000000000 +), + +settler_txs AS ( + SELECT + tx_hash, + block_time, + block_number, + method_id, + contract_address, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, + CASE + WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) + WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) + END AS tag + FROM ( + SELECT + tr.tx_hash, + block_number, + block_time, + "to" AS contract_address, + varbinary_substring(input,1,4) AS method_id, + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address + FROM + {{ source('linea', 'traces') }} AS tr + JOIN + result_0x_settler_addresses a ON a.settler_address = tr.to AND a.blockchain = 'linea' AND tr.block_time > a.begin_block_time + WHERE + (a.settler_address IS NOT NULL OR tr.to = 0xca11bde05977b3631167028862be2a173976ca11) + AND varbinary_substring(input,1,4) IN (0x1fff991f, 0xfd3ad6d4) + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% else %} + AND block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + GROUP BY + 1,2,3,4,5,6 +), +tbl_trades as ( + +with tbl_all_logs AS ( + SELECT + logs.tx_hash, + logs.block_time, + logs.block_number, + index, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, + method_id, + tag, + st.settler_address, + zid, + st.settler_address as contract_address + FROM + {{ source('linea', 'logs') }} AS logs + JOIN + settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + + WHERE + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 + {% if is_incremental() %} + AND {{ incremental_predicate('logs.block_time') }} + {% else %} + AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by index desc) rn + from tbl_all_logs + where maker_token != taker_token + ) + select * from tbl_valid_logs + where rn = 1 +), + + +tokens AS ( + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'linea' +), + +prices AS ( + SELECT DISTINCT + pu.* + FROM + {{ source('prices', 'usd') }} AS pu + JOIN + tbl_trades ON (pu.contract_address = taker_token OR pu.contract_address = maker_token) AND date_trunc('minute',block_time) = minute + WHERE + pu.blockchain = 'linea' + {% if is_incremental() %} + AND {{ incremental_predicate('minute') }} + {% else %} + AND minute >= DATE '{{zeroex_settler_start_date}}' + {% endif %} +), + +fills as ( + with signatures as ( + select distinct signature + from {{ source('linea', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SelllineaToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('linea', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + +results AS ( + SELECT + trades.block_time, + trades.block_number, + zid, + trades.contract_address, + method_id, + trades.tx_hash, + "from" AS tx_from, + "to" AS tx_to, + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, + CAST(NULL AS varbinary) AS maker, + taker_token, + pt.price, + COALESCE(tt.symbol, pt.symbol) AS taker_symbol, + taker_amount AS taker_token_amount_raw, + taker_amount / POW(10,COALESCE(tt.decimals,pt.decimals)) AS taker_token_amount, + taker_amount / POW(10,COALESCE(tt.decimals,pt.decimals)) * pt.price AS taker_amount, + maker_token, + COALESCE(tm.symbol, pm.symbol) AS maker_symbol, + maker_amount AS maker_token_amount_raw, + maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, + maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, + tag, + fills_within + FROM + tbl_trades trades + JOIN + {{ source('linea', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number + LEFT JOIN + tokens tt ON tt.blockchain = 'linea' AND tt.contract_address = taker_token + LEFT JOIN + tokens tm ON tm.blockchain = 'linea' AND tm.contract_address = maker_token + LEFT JOIN + prices pt ON pt.blockchain = 'linea' AND pt.contract_address = taker_token AND pt.minute = DATE_TRUNC('minute', trades.block_time) + LEFT JOIN + prices pm ON pm.blockchain = 'linea' AND pm.contract_address = maker_token AND pm.minute = DATE_TRUNC('minute', trades.block_time) + WHERE + 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('tr.block_time') }} + {% else %} + AND tr.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} +), + +results_usd AS ( + SELECT + 'linea' AS blockchain, + '0x-API' AS project, + 'settler' AS version, + DATE_TRUNC('day', block_time) block_date, + DATE_TRUNC('month', block_time) AS block_month, + block_time, + taker_symbol, + maker_symbol, + CASE WHEN LOWER(taker_symbol) > LOWER(maker_symbol) THEN CONCAT(maker_symbol, '-', taker_symbol) ELSE CONCAT(taker_symbol, '-', maker_symbol) END AS token_pair, + taker_token_amount, + maker_token_amount, + taker_token_amount_raw, + maker_token_amount_raw, + CASE WHEN maker_token IN (0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f, + 0x176211869ca2b568f2a7d4ee941e073a821ee1ff, + 0xa219439258ca9da29e9cc4ce5596924745e12b93, + 0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4 ) AND maker_amount IS NOT NULL + THEN maker_amount + WHEN taker_token IN (0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f, + 0x176211869ca2b568f2a7d4ee941e073a821ee1ff, + 0xa219439258ca9da29e9cc4ce5596924745e12b93, + 0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4 ) AND taker_amount IS NOT NULL + THEN taker_amount + ELSE COALESCE(maker_amount, taker_amount) + END AS volume_usd, + taker_token, + maker_token, + taker, + maker, + tag, + zid, + tx_hash, + tx_from, + tx_to, + tx_index AS evt_index, + (ARRAY[-1]) AS trace_address, + 'settler' AS type, + TRUE AS swap_flag, + fills_within, + contract_address + FROM + results +) + +SELECT DISTINCT + * +FROM + results_usd +ORDER BY + block_time DESC \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql index cc375f77354..38875310058 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql @@ -24,9 +24,7 @@ WITH tbl_addresses AS ( WHERE contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae AND blockchain = 'optimism' - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} + and block_time > TIMESTAMP '2024-05-23' ), tbl_end_times AS ( @@ -54,7 +52,8 @@ settler_txs AS ( block_number, method_id, contract_address, - MAX(varbinary_substring(tracker,1,12)) AS zid, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, CASE WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) @@ -66,7 +65,8 @@ settler_txs AS ( block_time, "to" AS contract_address, varbinary_substring(input,1,4) AS method_id, - varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address FROM {{ source('optimism', 'traces') }} AS tr JOIN @@ -81,88 +81,84 @@ settler_txs AS ( {% endif %} ) GROUP BY - 1,2,3,4,5 + 1,2,3,4,5,6 ), +tbl_trades as ( -tbl_all_logs AS ( +with tbl_all_logs AS ( SELECT logs.tx_hash, logs.block_time, logs.block_number, - ROW_NUMBER() OVER (PARTITION BY logs.tx_hash ORDER BY index) rn_first, - index, - CASE - WHEN varbinary_substring(logs.topic2, 13, 20) = logs.tx_from THEN 1 - WHEN varbinary_substring(logs.topic1, 13, 20) = st.contract_address THEN 0 - WHEN FIRST_VALUE(logs.contract_address) OVER (PARTITION BY logs.tx_hash ORDER BY index) = logs.contract_address THEN 0 - ELSE 1 - END maker_tkn, - bytearray_to_int256(bytearray_substring(DATA, 23,10)) value, - logs.contract_address AS token, - zid, - st.contract_address, + index, + case when ( (varbinary_substring(logs.topic2, 13, 20) = logs.tx_from) OR + (varbinary_substring(logs.topic2, 13, 20) = first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) or + topic0 = 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65) + then 1 end as valid, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, method_id, - tag + tag, + st.settler_address, + zid, + st.settler_address as contract_address FROM {{ source('optimism', 'logs') }} AS logs JOIN - settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + settler_txs st ON st.tx_hash = logs.tx_hash + AND logs.block_time = st.block_time + AND st.block_number = logs.block_number + AND ( (st.settler_address = bytearray_substring(logs.topic1,13,20)) + or (st.settler_address= bytearray_substring(logs.topic2,13,20)) + or logs.tx_from = bytearray_substring(logs.topic1,13,20) + or logs.tx_from = bytearray_substring(logs.topic2,13,20) + ) WHERE - topic0 IN (0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, - 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, - 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c) - and tag != 0x000000 and zid != 0xa00000000000000000000000 + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 {% if is_incremental() %} AND {{ incremental_predicate('logs.block_time') }} {% else %} AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by valid, index desc) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 ), -tbl_maker_token AS ( - SELECT - ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY index DESC) rn_last, - token AS maker_token, - tx_hash, - block_time, - block_number, - index - FROM - tbl_all_logs - WHERE - maker_tkn = 1 -), - -tbl_trades AS ( - SELECT - ta.tx_hash, - ta.block_time, - ta.block_number, - zid, - method_id, - tag, - contract_address, - SUM(value) FILTER (WHERE rn_first = 1) AS taker_amount, - MAX(token) FILTER (WHERE rn_first = 1) AS taker_token, - SUM(value) FILTER (WHERE rn_last = 1) AS maker_amount, - MAX(maker_token) FILTER (WHERE rn_last = 1) AS maker_token - FROM - tbl_all_logs ta - LEFT JOIN - tbl_maker_token mkr ON ta.tx_hash = mkr.tx_hash AND ta.block_time = mkr.block_time AND ta.block_number = mkr.block_number AND ta.index = mkr.index AND mkr.rn_last = 1 - GROUP BY - 1,2,3,4,5,6,7 -), tokens AS ( - SELECT DISTINCT - te.* - FROM - {{ source('tokens', 'erc20') }} AS te - JOIN - tbl_trades ON te.contract_address = taker_token OR te.contract_address = maker_token - WHERE - te.blockchain = 'optimism' + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'optimism' ), prices AS ( @@ -181,6 +177,33 @@ prices AS ( {% endif %} ), +fills as ( + with signatures as ( + select distinct signature + from {{ source('optimism', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SelloptimismToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('optimism', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + results AS ( SELECT trades.block_time, @@ -191,23 +214,8 @@ results AS ( trades.tx_hash, "from" AS tx_from, "to" AS tx_to, - index AS tx_index, - CASE - WHEN varbinary_substring(data,17,10) != 0x00000000000000000000 AND varbinary_substring(data,17,1) != 0x THEN varbinary_substring(data,17,20) - WHEN varbinary_substring(data,177,10) != 0x00000000000000000000 THEN varbinary_substring(data,177,20) - WHEN varbinary_substring(data,277,10) != 0x00000000000000000000 THEN varbinary_substring(data,277,20) - WHEN varbinary_substring(data,629,10) != 0x00000000000000000000 THEN varbinary_substring(data,629,20) - WHEN varbinary_substring(data,693,10) != 0x00000000000000000000 THEN varbinary_substring(data,693,20) - WHEN varbinary_substring(data,917,10) != 0x00000000000000000000 THEN varbinary_substring(data,917,20) - WHEN varbinary_substring(data,949,10) != 0x00000000000000000000 THEN varbinary_substring(data,949,20) - WHEN varbinary_substring(data,981,10) != 0x00000000000000000000 THEN varbinary_substring(data,981,20) - WHEN varbinary_substring(data,1013,10) != 0x00000000000000000000 THEN varbinary_substring(data,1013,20) - WHEN varbinary_substring(data,1141,10) != 0x00000000000000000000 THEN varbinary_substring(data,1141,20) - WHEN varbinary_substring(data,1273,10) != 0x00000000000000000000 THEN varbinary_substring(data,1273,20) - WHEN varbinary_substring(data,1749,4) != 0x00000000 THEN varbinary_substring(data,1749,20) - WHEN varbinary_substring(data,1049,4) != 0x00000000 THEN varbinary_substring(data,1049,20) - WHEN varbinary_substring(data,17,4) != 0x00000000 THEN varbinary_substring(data,17,20) - END AS taker , + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, CAST(NULL AS varbinary) AS maker, taker_token, pt.price, @@ -221,16 +229,13 @@ results AS ( maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, tag, - data, - varbinary_substring(data, varbinary_length(data) - CASE - WHEN varbinary_position (data,0xc4103b48be) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xc4103b48be)) - WHEN varbinary_position (data,0xe48d68a156) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe48d68a156)) - WHEN varbinary_position (data,0xe422ce6ede) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe422ce6ede)) - END -3, 37) taker_indicator_string + fills_within FROM tbl_trades trades JOIN {{ source('optimism', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number LEFT JOIN tokens tt ON tt.blockchain = 'optimism' AND tt.contract_address = taker_token LEFT JOIN @@ -251,7 +256,7 @@ results AS ( results_usd AS ( SELECT 'optimism' AS blockchain, - '0x API' AS project, + '0x-API' AS project, 'settler' AS version, DATE_TRUNC('day', block_time) block_date, DATE_TRUNC('month', block_time) AS block_month, @@ -263,31 +268,25 @@ results_usd AS ( maker_token_amount, taker_token_amount_raw, maker_token_amount_raw, - CASE WHEN maker_token IN (0x4200000000000000000000000000000000000006, + CASE WHEN maker_token IN (0x4200000000000000000000000000000000000006, 0x7f5c764cbc14f9669b88837ca1490cca17c31607, 0x4200000000000000000000000000000000000042, 0x0b2c639c533813f4aa9d7837caf62653d097ff85, 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58, - 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1) AND maker_amount IS NOT NULL + 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1) AND maker_amount IS NOT NULL THEN maker_amount - WHEN taker_token IN (0x4200000000000000000000000000000000000006, + WHEN taker_token IN (0x4200000000000000000000000000000000000006, 0x7f5c764cbc14f9669b88837ca1490cca17c31607, 0x4200000000000000000000000000000000000042, 0x0b2c639c533813f4aa9d7837caf62653d097ff85, 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58, - 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1) AND taker_amount IS NOT NULL + 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1) AND taker_amount IS NOT NULL THEN taker_amount ELSE COALESCE(maker_amount, taker_amount) END AS volume_usd, taker_token, maker_token, - CASE WHEN (varbinary_substring(taker,1,4) = 0x00000000) - OR taker IS NULL - OR taker = taker_token - OR taker = contract_address - OR taker = 0xdef1c0ded9bec7f1a1670819833240f027b25eff - OR varbinary_substring(taker_indicator_string, 18,20) != contract_address - THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, + taker, maker, tag, zid, @@ -298,7 +297,7 @@ results_usd AS ( (ARRAY[-1]) AS trace_address, 'settler' AS type, TRUE AS swap_flag, - -1 AS fills_within, + fills_within, contract_address FROM results diff --git a/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql index efd880e20d3..12f42985150 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql @@ -24,9 +24,7 @@ WITH tbl_addresses AS ( WHERE contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae AND blockchain = 'polygon' - {% if is_incremental() %} - AND {{ incremental_predicate('block_time') }} - {% endif %} + and block_time > TIMESTAMP '2024-05-23' ), tbl_end_times AS ( @@ -54,7 +52,8 @@ settler_txs AS ( block_number, method_id, contract_address, - MAX(varbinary_substring(tracker,1,12)) AS zid, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, CASE WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) @@ -66,7 +65,8 @@ settler_txs AS ( block_time, "to" AS contract_address, varbinary_substring(input,1,4) AS method_id, - varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address FROM {{ source('polygon', 'traces') }} AS tr JOIN @@ -81,88 +81,84 @@ settler_txs AS ( {% endif %} ) GROUP BY - 1,2,3,4,5 + 1,2,3,4,5,6 ), +tbl_trades as ( -tbl_all_logs AS ( +with tbl_all_logs AS ( SELECT logs.tx_hash, logs.block_time, logs.block_number, - ROW_NUMBER() OVER (PARTITION BY logs.tx_hash ORDER BY index) rn_first, - index, - CASE - WHEN varbinary_substring(logs.topic2, 13, 20) = logs.tx_from THEN 1 - WHEN varbinary_substring(logs.topic1, 13, 20) = st.contract_address THEN 0 - WHEN FIRST_VALUE(logs.contract_address) OVER (PARTITION BY logs.tx_hash ORDER BY index) = logs.contract_address THEN 0 - ELSE 1 - END maker_tkn, - bytearray_to_int256(bytearray_substring(DATA, 23,10)) value, - logs.contract_address AS token, - zid, - st.contract_address, + index, + case when ( (varbinary_substring(logs.topic2, 13, 20) = logs.tx_from) OR + (varbinary_substring(logs.topic2, 13, 20) = first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) or + topic0 = 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65) + then 1 end as valid, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, method_id, - tag + tag, + st.settler_address, + zid, + st.settler_address as contract_address FROM {{ source('polygon', 'logs') }} AS logs JOIN - settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + settler_txs st ON st.tx_hash = logs.tx_hash + AND logs.block_time = st.block_time + AND st.block_number = logs.block_number + AND ( (st.settler_address = bytearray_substring(logs.topic1,13,20)) + or (st.settler_address= bytearray_substring(logs.topic2,13,20)) + or logs.tx_from = bytearray_substring(logs.topic1,13,20) + or logs.tx_from = bytearray_substring(logs.topic2,13,20) + ) WHERE - topic0 IN (0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, - 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, - 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c) - and tag != 0x000000 and zid != 0xa00000000000000000000000 + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 {% if is_incremental() %} AND {{ incremental_predicate('logs.block_time') }} {% else %} AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by valid, index desc) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 ), -tbl_maker_token AS ( - SELECT - ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY index DESC) rn_last, - token AS maker_token, - tx_hash, - block_time, - block_number, - index - FROM - tbl_all_logs - WHERE - maker_tkn = 1 -), - -tbl_trades AS ( - SELECT - ta.tx_hash, - ta.block_time, - ta.block_number, - zid, - method_id, - tag, - contract_address, - SUM(value) FILTER (WHERE rn_first = 1) AS taker_amount, - MAX(token) FILTER (WHERE rn_first = 1) AS taker_token, - SUM(value) FILTER (WHERE rn_last = 1) AS maker_amount, - MAX(maker_token) FILTER (WHERE rn_last = 1) AS maker_token - FROM - tbl_all_logs ta - LEFT JOIN - tbl_maker_token mkr ON ta.tx_hash = mkr.tx_hash AND ta.block_time = mkr.block_time AND ta.block_number = mkr.block_number AND ta.index = mkr.index AND mkr.rn_last = 1 - GROUP BY - 1,2,3,4,5,6,7 -), tokens AS ( - SELECT DISTINCT - te.* - FROM - {{ source('tokens', 'erc20') }} AS te - JOIN - tbl_trades ON te.contract_address = taker_token OR te.contract_address = maker_token - WHERE - te.blockchain = 'polygon' + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'polygon' ), prices AS ( @@ -181,6 +177,33 @@ prices AS ( {% endif %} ), +fills as ( + with signatures as ( + select distinct signature + from {{ source('polygon', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SellpolygonToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('polygon', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + results AS ( SELECT trades.block_time, @@ -191,23 +214,8 @@ results AS ( trades.tx_hash, "from" AS tx_from, "to" AS tx_to, - index AS tx_index, - CASE - WHEN varbinary_substring(data,17,10) != 0x00000000000000000000 AND varbinary_substring(data,17,1) != 0x THEN varbinary_substring(data,17,20) - WHEN varbinary_substring(data,177,10) != 0x00000000000000000000 THEN varbinary_substring(data,177,20) - WHEN varbinary_substring(data,277,10) != 0x00000000000000000000 THEN varbinary_substring(data,277,20) - WHEN varbinary_substring(data,629,10) != 0x00000000000000000000 THEN varbinary_substring(data,629,20) - WHEN varbinary_substring(data,693,10) != 0x00000000000000000000 THEN varbinary_substring(data,693,20) - WHEN varbinary_substring(data,917,10) != 0x00000000000000000000 THEN varbinary_substring(data,917,20) - WHEN varbinary_substring(data,949,10) != 0x00000000000000000000 THEN varbinary_substring(data,949,20) - WHEN varbinary_substring(data,981,10) != 0x00000000000000000000 THEN varbinary_substring(data,981,20) - WHEN varbinary_substring(data,1013,10) != 0x00000000000000000000 THEN varbinary_substring(data,1013,20) - WHEN varbinary_substring(data,1141,10) != 0x00000000000000000000 THEN varbinary_substring(data,1141,20) - WHEN varbinary_substring(data,1273,10) != 0x00000000000000000000 THEN varbinary_substring(data,1273,20) - WHEN varbinary_substring(data,1749,4) != 0x00000000 THEN varbinary_substring(data,1749,20) - WHEN varbinary_substring(data,1049,4) != 0x00000000 THEN varbinary_substring(data,1049,20) - WHEN varbinary_substring(data,17,4) != 0x00000000 THEN varbinary_substring(data,17,20) - END AS taker , + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, CAST(NULL AS varbinary) AS maker, taker_token, pt.price, @@ -221,16 +229,13 @@ results AS ( maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, tag, - data, - varbinary_substring(data, varbinary_length(data) - CASE - WHEN varbinary_position (data,0xc4103b48be) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xc4103b48be)) - WHEN varbinary_position (data,0xe48d68a156) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe48d68a156)) - WHEN varbinary_position (data,0xe422ce6ede) <> 0 THEN varbinary_position(REVERSE(data), REVERSE(0xe422ce6ede)) - END -3, 37) taker_indicator_string + fills_within FROM tbl_trades trades JOIN {{ source('polygon', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number LEFT JOIN tokens tt ON tt.blockchain = 'polygon' AND tt.contract_address = taker_token LEFT JOIN @@ -251,7 +256,7 @@ results AS ( results_usd AS ( SELECT 'polygon' AS blockchain, - '0x API' AS project, + '0x-API' AS project, 'settler' AS version, DATE_TRUNC('day', block_time) block_date, DATE_TRUNC('month', block_time) AS block_month, @@ -263,31 +268,25 @@ results_usd AS ( maker_token_amount, taker_token_amount_raw, maker_token_amount_raw, - CASE WHEN maker_token IN (0x2791bca1f2de4661ed88a30c99a7a9449aa84174, + CASE WHEN maker_token IN (0x2791bca1f2de4661ed88a30c99a7a9449aa84174, 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619, 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270, 0xc2132d05d31c914a87c6611c10748aeb04b58e8f, 0x3c499c542cef5e3811e1192ce70d8cc03d5c3359, - 0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6) AND maker_amount IS NOT NULL + 0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6) AND maker_amount IS NOT NULL THEN maker_amount - WHEN taker_token IN (0x2791bca1f2de4661ed88a30c99a7a9449aa84174, + WHEN taker_token IN (0x2791bca1f2de4661ed88a30c99a7a9449aa84174, 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619, 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270, 0xc2132d05d31c914a87c6611c10748aeb04b58e8f, 0x3c499c542cef5e3811e1192ce70d8cc03d5c3359, - 0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6) AND taker_amount IS NOT NULL + 0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6) AND taker_amount IS NOT NULL THEN taker_amount ELSE COALESCE(maker_amount, taker_amount) END AS volume_usd, taker_token, maker_token, - CASE WHEN (varbinary_substring(taker,1,4) = 0x00000000) - OR taker IS NULL - OR taker = taker_token - OR taker = contract_address - OR taker = 0xdef1c0ded9bec7f1a1670819833240f027b25eff - OR varbinary_substring(taker_indicator_string, 18,20) != contract_address - THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, + taker, maker, tag, zid, @@ -298,7 +297,7 @@ results_usd AS ( (ARRAY[-1]) AS trace_address, 'settler' AS type, TRUE AS swap_flag, - -1 AS fills_within, + fills_within, contract_address FROM results diff --git a/dbt_subprojects/dex/models/_projects/zeroex/scroll/zeroex_scroll_schema.yml b/dbt_subprojects/dex/models/_projects/zeroex/scroll/zeroex_scroll_schema.yml new file mode 100644 index 00000000000..c5cec51e487 --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/zeroex/scroll/zeroex_scroll_schema.yml @@ -0,0 +1,111 @@ +version: 2 + +models: + - name: zeroex_scroll_settler_trades + meta: + blockchain: scroll + project: zeroex + contributors: rantum + config: + tags: ['scroll','0x','dex_aggregator','dex','aggregator'] + description: > + 0x API erc20 trades through 0x Settler contracts. No fills, only deduped transactions. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_month + - block_date + - tx_hash + - evt_index + - check_seed: + seed_file: ref('zeroex_scroll_settler_trades_sample') + match_columns: + - tx_hash + check_columns: + - taker + - maker_token + - taker_token + columns: + - &blockchain + name: blockchain + description: "Blockchain which the aggregator project is deployed" + - &block_date + name: block_date + description: "UTC event block date of each trade" + - &block_month + name: block_month + description: "UTC event block month of each trade" + - &block_time + name: block_time + description: "UTC event block time of each trade" + - &taker_symbol + name: taker_symbol + description: "Symbol of the token taker sells" + - &maker_symbol + name: maker_symbol + description: "Symbol of the token taker buys" + - &token_pair + name: token_pair + description: "Token pair traded" + - &taker_token_amount + name: taker_token_amount + description: "The after-decimal amount of the token taker sells" + - &taker_token_amount_raw + name: taker_token_amount_raw + description: "The raw amount of the token taker sells" + - &maker_token_amount + name: maker_token_amount + description: "The after-decimal amount of the token taker buys" + - &maker_token_amount_raw + name: maker_token_amount_raw + description: "The raw amount of the token taker buys" + - &volume_usd + name: volume_usd + description: "Trading volume measured in USD value" + - &taker_token + name: taker_token + description: "Contract address of the token taker sells" + - &maker_token + name: maker_token + description: "Contract address of the token taker buys" + - &maker + name: maker + description: "buyer of the trade" + - &taker + name: taker + description: "seller of the trade" + - &affiliate_address + name: affiliate_address + description: "The recipient address of the affiliate, or the applications that is using 0x API, for receiving affiliate fee" + - &tx_hash + name: tx_hash + description: "Transaction hash of the fill" + - &tx_from + name: tx_from + description: "Address which initiated the trade" + - &tx_to + name: tx_to + description: "Address which received the trade" + - &evt_index + name: evt_index + description: "Index of the corresponding order filled event" + - &type + name: type + description: "The liquidity route the order went thru" + - &swap_flag + name: swap_flag + description: "If the swap was filled/consumed thru 0x API" + - &contract_address + name: contract_address + desctiption: "The address of the contract which fired the fill/swap event" + - &fills_within + name: fills_within + description: "fills in then multihop, if present" + + + + + + + + \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/zeroex/scroll/zeroex_scroll_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/scroll/zeroex_scroll_settler_trades.sql new file mode 100644 index 00000000000..c2086b6c73b --- /dev/null +++ b/dbt_subprojects/dex/models/_projects/zeroex/scroll/zeroex_scroll_settler_trades.sql @@ -0,0 +1,297 @@ +{{ config( + schema = 'zeroex_scroll', + alias = 'settler_trades', + materialized='incremental', + partition_by = ['block_month'], + unique_key = ['block_month', 'block_date', 'tx_hash', 'evt_index'], + on_schema_change='sync_all_columns', + file_format ='delta', + incremental_strategy='merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +{% set zeroex_settler_start_date = '2024-07-15' %} + +WITH tbl_addresses AS ( + SELECT + blockchain, + token_id, + to AS settler_address, + block_time AS begin_block_time, + block_number AS begin_block_number + FROM + {{ source('nft', 'transfers') }} + WHERE + contract_address = 0x00000000000004533fe15556b1e086bb1a72ceae + AND blockchain = 'scroll' + and block_time > TIMESTAMP '2024-05-23' +), + +tbl_end_times AS ( + SELECT + *, + LEAD(begin_block_time) OVER (PARTITION BY blockchain, token_id ORDER BY begin_block_time) AS end_block_time, + LEAD(begin_block_number) OVER (PARTITION BY blockchain, token_id ORDER BY begin_block_number) AS end_block_number + FROM + tbl_addresses +), + +result_0x_settler_addresses AS ( + SELECT + * + FROM + tbl_end_times + WHERE + settler_address != 0x0000000000000000000000000000000000000000 +), + +settler_txs AS ( + SELECT + tx_hash, + block_time, + block_number, + method_id, + contract_address, + settler_address, + MAX(varbinary_substring(tracker,2,12)) AS zid, + CASE + WHEN method_id = 0x1fff991f THEN MAX(varbinary_substring(tracker,14,3)) + WHEN method_id = 0xfd3ad6d4 THEN MAX(varbinary_substring(tracker,13,3)) + END AS tag + FROM ( + SELECT + tr.tx_hash, + block_number, + block_time, + "to" AS contract_address, + varbinary_substring(input,1,4) AS method_id, + varbinary_substring(input,varbinary_position(input,0xfd3ad6d4)+132,32) tracker, + a.settler_address + FROM + {{ source('scroll', 'traces') }} AS tr + JOIN + result_0x_settler_addresses a ON a.settler_address = tr.to AND a.blockchain = 'scroll' AND tr.block_time > a.begin_block_time + WHERE + (a.settler_address IS NOT NULL OR tr.to = 0xca11bde05977b3631167028862be2a173976ca11) + AND varbinary_substring(input,1,4) IN (0x1fff991f, 0xfd3ad6d4) + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% else %} + AND block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + GROUP BY + 1,2,3,4,5,6 +), +tbl_trades as ( + +with tbl_all_logs AS ( + SELECT + logs.tx_hash, + logs.block_time, + logs.block_number, + index, + coalesce(bytearray_substring(logs.topic2,13,20), first_value(bytearray_substring(logs.topic1,13,20)) over (partition by logs.tx_hash order by index) ) as taker, + logs.contract_address as maker_token, + first_value(logs.contract_address) over (partition by logs.tx_hash order by index) as taker_token, + first_value(try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) ) over (partition by logs.tx_hash order by index) as taker_amount, + try_cast(bytearray_to_uint256(bytearray_substring(DATA, 22,11)) as int256) as maker_amount, + method_id, + tag, + st.settler_address, + zid, + st.settler_address as contract_address + FROM + {{ source('scroll', 'logs') }} AS logs + JOIN + settler_txs st ON st.tx_hash = logs.tx_hash AND logs.block_time = st.block_time AND st.block_number = logs.block_number + + WHERE + topic0 IN ( 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, + 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c ) + and topic1 != 0x0000000000000000000000000000000000000000000000000000000000000000 + and zid != 0xa00000000000000000000000 + {% if is_incremental() %} + AND {{ incremental_predicate('logs.block_time') }} + {% else %} + AND logs.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ), + tbl_valid_logs as ( + select * + , row_number() over (partition by tx_hash order by index desc) rn + from tbl_all_logs + where taker_token != maker_token + ) + select * from tbl_valid_logs where rn = 1 +), + + +tokens AS ( + with token_list as ( + select + distinct maker_token as token + from + tbl_trades + + union distinct + + select + distinct taker_token as token + from tbl_trades + ) + + select * + from + token_list tl + join + {{ source('tokens', 'erc20') }} AS te ON te.contract_address = tl.token + WHERE + te.blockchain = 'scroll' +), + +prices AS ( + SELECT DISTINCT + pu.* + FROM + {{ source('prices', 'usd') }} AS pu + JOIN + tbl_trades ON (pu.contract_address = taker_token OR pu.contract_address = maker_token) AND date_trunc('minute',block_time) = minute + WHERE + pu.blockchain = 'scroll' + {% if is_incremental() %} + AND {{ incremental_predicate('minute') }} + {% else %} + AND minute >= DATE '{{zeroex_settler_start_date}}' + {% endif %} +), + +fills as ( + with signatures as ( + select distinct signature + from {{ source('scroll', 'logs_decoded') }} l + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + and event_name in ('TokenExchange', 'OtcOrderFilled', 'SellscrollToken', 'Swap', 'BuyGem', 'DODOSwap', 'SellGem', 'Submitted') + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + ) + + select tt.tx_hash, tt.block_number, tt.block_time, count(*) fills_within + from {{ source('scroll', 'logs') }} l + join signatures on signature = topic0 + join tbl_trades tt on tt.tx_hash = l.tx_hash and l.block_time = tt.block_time and l.block_number = tt.block_number + WHERE 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('l.block_time') }} + {% else %} + AND l.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} + group by 1,2,3 + ), + +results AS ( + SELECT + trades.block_time, + trades.block_number, + zid, + trades.contract_address, + method_id, + trades.tx_hash, + "from" AS tx_from, + "to" AS tx_to, + trades.index AS tx_index, + case when varbinary_substring(tr.data,1,4) = 0x500c22bc then "from" else taker end as taker, + CAST(NULL AS varbinary) AS maker, + taker_token, + pt.price, + COALESCE(tt.symbol, pt.symbol) AS taker_symbol, + taker_amount AS taker_token_amount_raw, + taker_amount / POW(10,COALESCE(tt.decimals,pt.decimals)) AS taker_token_amount, + taker_amount / POW(10,COALESCE(tt.decimals,pt.decimals)) * pt.price AS taker_amount, + maker_token, + COALESCE(tm.symbol, pm.symbol) AS maker_symbol, + maker_amount AS maker_token_amount_raw, + maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) AS maker_token_amount, + maker_amount / POW(10,COALESCE(tm.decimals,pm.decimals)) * pm.price AS maker_amount, + tag, + fills_within + FROM + tbl_trades trades + JOIN + {{ source('scroll', 'transactions') }} tr ON tr.hash = trades.tx_hash AND tr.block_time = trades.block_time AND tr.block_number = trades.block_number + LEFT JOIN + fills f ON f.tx_hash = trades.tx_hash AND f.block_time = trades.block_time AND f.block_number = trades.block_number + LEFT JOIN + tokens tt ON tt.blockchain = 'scroll' AND tt.contract_address = taker_token + LEFT JOIN + tokens tm ON tm.blockchain = 'scroll' AND tm.contract_address = maker_token + LEFT JOIN + prices pt ON pt.blockchain = 'scroll' AND pt.contract_address = taker_token AND pt.minute = DATE_TRUNC('minute', trades.block_time) + LEFT JOIN + prices pm ON pm.blockchain = 'scroll' AND pm.contract_address = maker_token AND pm.minute = DATE_TRUNC('minute', trades.block_time) + WHERE + 1=1 + {% if is_incremental() %} + AND {{ incremental_predicate('tr.block_time') }} + {% else %} + AND tr.block_time >= DATE '{{zeroex_settler_start_date}}' + {% endif %} +), + +results_usd AS ( + SELECT + 'scroll' AS blockchain, + '0x-API' AS project, + 'settler' AS version, + DATE_TRUNC('day', block_time) block_date, + DATE_TRUNC('month', block_time) AS block_month, + block_time, + taker_symbol, + maker_symbol, + CASE WHEN LOWER(taker_symbol) > LOWER(maker_symbol) THEN CONCAT(maker_symbol, '-', taker_symbol) ELSE CONCAT(taker_symbol, '-', maker_symbol) END AS token_pair, + taker_token_amount, + maker_token_amount, + taker_token_amount_raw, + maker_token_amount_raw, + CASE WHEN maker_token IN (0x5300000000000000000000000000000000000004, + 0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4, + 0xf55bec9cafdbe8730f096aa55dad6d22d44099df, + 0xca77eb3fefe3725dc33bccb54edefc3d9f764f97) AND maker_amount IS NOT NULL + THEN maker_amount + WHEN taker_token IN (0x5300000000000000000000000000000000000004, + 0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4, + 0xf55bec9cafdbe8730f096aa55dad6d22d44099df, + 0xca77eb3fefe3725dc33bccb54edefc3d9f764f97) AND taker_amount IS NOT NULL + THEN taker_amount + ELSE COALESCE(maker_amount, taker_amount) + END AS volume_usd, + taker_token, + maker_token, + taker, + maker, + tag, + zid, + tx_hash, + tx_from, + tx_to, + tx_index AS evt_index, + (ARRAY[-1]) AS trace_address, + 'settler' AS type, + TRUE AS swap_flag, + fills_within, + contract_address + FROM + results +) + +SELECT DISTINCT + * +FROM + results_usd +ORDER BY + block_time DESC \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql index 581f0c8f66e..8bfdd619be5 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql @@ -1,7 +1,7 @@ {{ config( schema = 'zeroex' , alias = 'api_fills_deduped' - , post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "base", "bnb", "celo", "ethereum", "fantom", "optimism", "polygon"]\', + , post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "base", "bnb", "celo", "ethereum", "fantom", "optimism", "polygon","scroll", "linea"]\', "project", "zeroex", \'["rantum","bakabhai993"]\') }}' @@ -29,6 +29,8 @@ ,ref('zeroex_bnb_settler_trades') ,ref('zeroex_avalanche_c_settler_trades') ,ref('zeroex_arbitrum_settler_trades') + ,ref('zeroex_scroll_settler_trades') + ,ref('zeroex_linea_settler_trades') ] %} @@ -61,6 +63,7 @@ FROM ( ,evt_index ,affiliate_address ,null as zid + ,type FROM {{ model }} {% if not loop.last %} UNION ALL @@ -99,6 +102,7 @@ FROM ( ,evt_index ,tag as affiliate_address ,zid + ,type FROM {{ model }} {% if not loop.last %} UNION ALL diff --git a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_native_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_native_trades.sql index 3a2195e6c62..1d7e64b38c2 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_native_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_native_trades.sql @@ -21,7 +21,7 @@ FROM ( {% for model in zeroex_models %} SELECT blockchain as blockchain, - '0x API' as project, + '0x-API' as project, version, block_month as block_month, block_date as block_date, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_schema.yml b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_schema.yml index 13fde7bc2fe..e93f4f91ef8 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_schema.yml +++ b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_schema.yml @@ -3,7 +3,7 @@ version: 2 models: - name: zeroex_api_fills meta: - blockchain: ethereum, optimism, polygon, arbitrum, fantom, avalanche, bnb + blockchain: ethereum, optimism, polygon, arbitrum, fantom, avalanche, bnb, scroll project: zeroex contributors: rantum, danning.sui, bakabhai993 config: @@ -105,7 +105,7 @@ models: - name: zeroex_api_fills_deduped meta: - blockchain: ethereum, optimism, polygon, arbitrum, fantom, avalanche, bnb + blockchain: ethereum, optimism, polygon, arbitrum, fantom, avalanche, bnb, base, scroll, linea sector: dex project: zeroex contributors: rantum, bakabhai993 @@ -158,7 +158,7 @@ models: - name: zeroex_trades meta: - blockchain: ethereum, optimism, polygon, arbitrum, fantom, avalanche, bnb + blockchain: ethereum, optimism, polygon, arbitrum, fantom, avalanche, bnb, base, linea, scroll project: zeroex contributors: rantum, danning.sui, bakabhai993 config: diff --git a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_trades.sql index dc147629864..25602b791ac 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_trades.sql @@ -1,7 +1,7 @@ {{ config( schema = 'zeroex' ,alias = 'trades' - ,post_hook='{{ expose_spells(\'["ethereum","arbitrum", "optimism", "polygon","fantom","avalanche_c","bnb"]\', + ,post_hook='{{ expose_spells(\'["ethereum","arbitrum", "optimism", "polygon","fantom","avalanche_c","bnb","base","scroll","linea"]\', "project", "zeroex", \'["rantum","bakabhai993"]\') }}' diff --git a/dbt_subprojects/dex/models/aggregator_trades/_schema.yml b/dbt_subprojects/dex/models/aggregator_trades/_schema.yml index a645c9a4b7e..51067685c68 100644 --- a/dbt_subprojects/dex/models/aggregator_trades/_schema.yml +++ b/dbt_subprojects/dex/models/aggregator_trades/_schema.yml @@ -3,13 +3,14 @@ version: 2 models: - name: dex_aggregator_trades meta: - blockchain: ethereum, gnosis, avalanche_c, fantom, optimism, arbitrum, bnb + blockchain: ethereum, gnosis, avalanche_c, fantom, optimism, arbitrum, bnb, base, scroll, linea, polygon sector: dex_aggregator contributors: bh2smith, Henrystats, jeff-dude, rantum + docs_slug: /curated/trading/DEX/dex-aggregator-trades config: tags: ['ethereum', 'gnosis', 'avalanche_c', 'fantom', 'aggregator', 'dex', 'trades', 'cross-chain'] description: > - Aggregator trades on all chains across all contracts and versions + The dex_aggregator.trades table captures data on actions taken on aggregators - recording all events across various aggregators and blockchains. tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -91,4 +92,47 @@ models: name: trace_address - &evt_index name: evt_index - description: "Index of the corresponding trade event" \ No newline at end of file + description: "Index of the corresponding trade event" + + - name: dex_aggregator_base_trades + meta: + blockchain: ethereum, gnosis, avalanche_c, fantom, optimism, arbitrum, bnb + sector: dex_aggregator + contributors: hosuke + config: + tags: ['ethereum', 'gnosis', 'avalanche_c', 'fantom', 'aggregator', 'dex', 'trades', 'cross-chain'] + description: > + Base trades data without amount_usd column + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - blockchain + - project + - version + - tx_hash + - evt_index + - trace_address + columns: + - *blockchain + - *project + - *version + - *block_date + - *block_time + - *token_bought_symbol + - *token_sold_symbol + - *token_pair + - *token_bought_amount + - *token_sold_amount + - *token_bought_amount_raw + - *token_sold_amount_raw + - *token_bought_address + - *token_sold_address + - *taker + - *maker + - *project_contract_address + - *tx_hash + - *tx_from + - *tx_to + - *trace_address + - *evt_index \ No newline at end of file diff --git a/dbt_subprojects/dex/models/aggregator_trades/dex_aggregator_base_trades.sql b/dbt_subprojects/dex/models/aggregator_trades/dex_aggregator_base_trades.sql new file mode 100644 index 00000000000..9b7ee783f7e --- /dev/null +++ b/dbt_subprojects/dex/models/aggregator_trades/dex_aggregator_base_trades.sql @@ -0,0 +1,58 @@ +{{ config( + schema ='dex_aggregator' + , alias = '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', 'trace_address'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{% set base_trade_models = [ + ref('lifi_base_trades') +] %} + +with base_union as ( + SELECT * + FROM + ( + {% for model in base_trade_models %} + SELECT + blockchain + , project + , version + , block_date + , block_month + , block_time + -- , block_number -- missing yet + , 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 + , tx_from + , tx_to + , trace_address + , evt_index + 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 %} + ) +) +select + * +from + base_union diff --git a/dbt_subprojects/dex/models/aggregator_trades/dex_aggregator_trades.sql b/dbt_subprojects/dex/models/aggregator_trades/dex_aggregator_trades.sql index e67cb143484..ff4aefc4cb0 100644 --- a/dbt_subprojects/dex/models/aggregator_trades/dex_aggregator_trades.sql +++ b/dbt_subprojects/dex/models/aggregator_trades/dex_aggregator_trades.sql @@ -1,4 +1,3 @@ - {{ config( schema ='dex_aggregator', alias = 'trades', @@ -7,17 +6,16 @@ incremental_strategy = 'merge', unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index', 'trace_address'], incremental_predicates = ['DBT_INTERNAL_DEST.block_date >= date_trunc(\'day\', now() - interval \'7\' day)'], - post_hook='{{ expose_spells(\'["ethereum", "gnosis", "avalanche_c", "fantom", "bnb", "optimism", "arbitrum"]\', + post_hook='{{ expose_spells(\'["ethereum", "gnosis", "avalanche_c", "fantom", "bnb", "optimism", "arbitrum", "base", "linea", "scroll", "polygon"]\', "sector", "dex_aggregator", - \'["bh2smith", "Henrystats", "jeff-dude", "rantum" ]\') }}' + \'["bh2smith", "Henrystats", "jeff-dude", "rantum", "hosuke"]\') }}' ) }} -{% set dex_aggregator_models = [ +{% set as_is_models = [ ref('cow_protocol_trades') ,ref('paraswap_trades') - ,ref('lifi_trades') ,ref('yield_yak_trades') ,ref('bebop_trades') ,ref('dodo_aggregator_trades') @@ -30,37 +28,88 @@ ,ref('odos_trades') ] %} -{% for aggregator_model in dex_aggregator_models %} -SELECT - blockchain - , project - , version - , block_date - , block_month - , block_time - , token_bought_symbol - , token_sold_symbol - , token_pair - , token_bought_amount - , token_sold_amount - , try_cast(token_bought_amount_raw as uint256) as token_bought_amount_raw - , try_cast(token_sold_amount_raw as uint256) as token_sold_amount_raw - , amount_usd - , token_bought_address - , token_sold_address - , taker - , maker - , project_contract_address - , tx_hash - , tx_from - , tx_to - , trace_address - , evt_index -FROM {{ aggregator_model }} -{% if is_incremental() %} -WHERE block_date >= date_trunc('day', now() - interval '7' day) -{% endif %} -{% if not loop.last %} -UNION ALL -{% endif %} +WITH enriched_aggregator_base_trades AS ( + {{ + enrich_dex_aggregator_trades( + base_trades = ref('dex_aggregator_base_trades') + , filter = "1 = 1" + , tokens_erc20_model = source('tokens', 'erc20') + ) + }} +) + +, as_is_dexs AS ( + {% for model in as_is_models %} + SELECT + blockchain + , project + , version + , block_date + , block_month + , block_time + , token_bought_symbol + , token_sold_symbol + , token_pair + , token_bought_amount + , token_sold_amount + , cast(token_bought_amount_raw as uint256) as token_bought_amount_raw + , cast(token_sold_amount_raw as uint256) as token_sold_amount_raw + , amount_usd + , token_bought_address + , token_sold_address + , taker + , maker + , project_contract_address + , tx_hash + , tx_from + , tx_to + , trace_address + , evt_index + FROM + {{ model }} + {% if is_incremental() %} + WHERE {{ incremental_predicate('block_time') }} + {% endif %} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) +{% set cte_to_union = [ + 'enriched_aggregator_base_trades' + , 'as_is_dexs' + ] +%} + +{% for cte in cte_to_union %} + SELECT + blockchain + , project + , version + , block_date + , block_month + , block_time + , 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 + , trace_address + , evt_index + FROM + {{ cte }} + {% if not loop.last %} + UNION ALL + {% endif %} {% endfor %} diff --git a/dbt_subprojects/dex/models/dex_info.sql b/dbt_subprojects/dex/models/dex_info.sql index 8c81de75b9a..a1285e50814 100644 --- a/dbt_subprojects/dex/models/dex_info.sql +++ b/dbt_subprojects/dex/models/dex_info.sql @@ -68,10 +68,10 @@ FROM (VALUES , ('camelot', 'Camelot', 'Direct', 'CamelotDEX') , ('saddle', 'Saddle', 'Direct', 'saddlefinance') , ('oneinch', '1inch', 'Aggregator', '1inch') - , ('1inch', '1inch', 'Aggregator', '1inch') -- To Fix, should be just oneinch - , ('1inch LOP', '1inch Limit Order Protocol', 'Aggregator', '1inch') -- To Fix, should be just oneinch or maybe oneinch_limit_order_protocol + , ('1inch', '1inch', 'Aggregator', '1inch') + , ('1inch-LOP', '1inch Limit Order Protocol', 'Aggregator', '1inch') , ('zeroex', '0x', 'Aggregator', '0xProject') - , ('0x API', '0x API', 'Aggregator', '0xProject') -- To Fix, should be just zeroex + , ('0x-API', '0x API', 'Aggregator', '0xProject') , ('paraswap', 'ParaSwap', 'Aggregator', 'paraswap') , ('cow_protocol', 'CoW Swap', 'Aggregator', 'CoWSwap') , ('openocean', 'OpenOcean', 'Aggregator', 'OpenOceanGlobal') @@ -134,7 +134,7 @@ FROM (VALUES , ('scrollswap', 'ScrollSwap', 'Direct', 'scrollswap') , ('auragi', 'Auragi', 'Direct', 'AuragiFinance') , ('soswap','Soswap','Direct','RaiFinance') - , ('elk_finance', 'Elk Finance', 'Direct', 'Elk Finance') + , ('elk_finance', 'Elk Finance', 'Direct', 'Elk Finance') , ('leetswap', 'Leetswap', 'Direct', 'LeetSwap') , ('rocketswap', 'RocketSwap', 'Direct', 'RocketSwap_Labs') , ('alienbase', 'AlienBase', 'Direct', 'alienbasedex') @@ -168,4 +168,8 @@ FROM (VALUES , ('oku', 'oku', 'Direct', 'okutrade') , ('dragon_swap', 'DragonSwap', 'Direct', 'dragonswap_dex') , ('xei_finance', 'Xei Finance', 'Direct', 'XeiFinance') + , ('fusionx', 'FusionX Finance', 'Direct', 'FusionX_Finance') + , ('agni', 'AGNI Finance', 'Direct', 'Agnidex') + , ('rcpswap', 'RCPswap', 'Direct', 'RCPswap') + , ('valantis', 'Valantis', 'Direct', 'ValantisLabs') ) AS temp_table (project, name, marketplace_type, x_username) diff --git a/dbt_subprojects/dex/models/prices/_schema.yml b/dbt_subprojects/dex/models/prices/_schema.yml index 57110aa8aca..c023a6b015d 100644 --- a/dbt_subprojects/dex/models/prices/_schema.yml +++ b/dbt_subprojects/dex/models/prices/_schema.yml @@ -1,6 +1,10 @@ version: 2 models: + - name: dex_prices_beta + description: > + obtain pricing info from dex.trades to feed into prices pipeline + - name: dex_prices meta: blockchain: ethereum, bnb, avalanche_c, gnosis, optimism, arbitrum, fantom diff --git a/dbt_subprojects/dex/models/prices/dex_prices_beta.sql b/dbt_subprojects/dex/models/prices/dex_prices_beta.sql new file mode 100644 index 00000000000..477e7b3b862 --- /dev/null +++ b/dbt_subprojects/dex/models/prices/dex_prices_beta.sql @@ -0,0 +1,121 @@ +{{ config( + schema = 'dex' + , alias = 'prices_beta' + , partition_by = ['block_month'] + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'append' +) +}} + +with dex_trades as ( + select distinct + blockchain + , block_time + , token_bought_address + , token_bought_amount_raw + , token_bought_amount + , token_sold_address + , token_sold_amount_raw + , token_sold_amount + , amount_usd + from + {{ ref('dex_trades') }} + where + 1 = 1 + and amount_usd > 0 + {% if is_incremental() %} + and block_time > (select max(block_time) from {{ this }}) + {% endif %} +), +dex_bought as ( + select + d.blockchain + , d.token_bought_address as contract_address + , t.symbol as symbol + , t.decimals as decimals + , d.block_time as block_time + , d.token_bought_amount as amount + , d.amount_usd + , coalesce(d.amount_usd/d.token_bought_amount, d.amount_usd/(d.token_bought_amount_raw/POW(10, t.decimals))) as price + from + dex_trades as d + inner join {{ source('tokens', 'erc20') }} as t + on d.blockchain = t.blockchain + and d.token_bought_address = t.contract_address + left join {{ source('prices', 'trusted_tokens') }} as ptt + on d.blockchain = ptt.blockchain + and d.token_bought_address = ptt.contract_address + where + 1 = 1 + and d.token_bought_amount > 0 + and d.token_bought_amount_raw > UINT256 '0' + and t.symbol is not null + -- filter out tokens that are already in the trusted_tokens table + and ptt.contract_address is null +), +dex_sold as ( + select + d.blockchain + , d.token_sold_address as contract_address + , t.symbol as symbol + , t.decimals as decimals + , d.block_time as block_time + , d.token_sold_amount as amount + , d.amount_usd + , coalesce(d.amount_usd/d.token_sold_amount, d.amount_usd/(d.token_sold_amount_raw/POW(10, t.decimals))) as price + from + dex_trades as d + inner join {{ source('tokens', 'erc20') }} as t + on d.blockchain = t.blockchain + and d.token_sold_address = t.contract_address + left join {{ source('prices', 'trusted_tokens') }} as ptt + on d.blockchain = ptt.blockchain + and d.token_sold_address = ptt.contract_address + where + 1 = 1 + and d.token_sold_amount > 0 + and d.token_sold_amount_raw > UINT256 '0' + and t.symbol is not null + -- filter out tokens that are already in the trusted_tokens table + and ptt.contract_address is null +), +dex_prices as ( + select + * + from + dex_bought + union all + select + * + from + dex_sold +), +volume_filter as ( + --filter out tokens which have less than $10k in volume + select + blockchain + , contract_address + from + dex_prices + group by + blockchain + , contract_address + having + sum(amount_usd) >= 10000 +) +select + dp.blockchain + , dp.contract_address + , dp.symbol + , dp.decimals + , cast(date_trunc('month', dp.block_time) as date) as block_month -- for partitioning + , dp.block_time + , dp.amount + , dp.amount_usd + , dp.price +from + dex_prices as dp +inner join volume_filter as vf + on dp.blockchain = vf.blockchain + and dp.contract_address = vf.contract_address \ No newline at end of file diff --git a/dbt_subprojects/dex/models/sandwiches/_schema.yml b/dbt_subprojects/dex/models/sandwiches/_schema.yml index 15bf5b060ae..96a2fecf919 100644 --- a/dbt_subprojects/dex/models/sandwiches/_schema.yml +++ b/dbt_subprojects/dex/models/sandwiches/_schema.yml @@ -2,14 +2,15 @@ version: 2 models: - name: dex_sandwiches - meta: + meta: blockchain: ethereum, bnb, avalanche_c, gnosis, optimism, fantom, arbitrum, celo, zksync, scroll, zora sector: dex contributors: hildobby + docs_slug: /curated/trading/DEX/dex-sandwiches config: - tags: ['dex', 'mev', 'sandwiches'] + tags: ["dex", "mev", "sandwiches"] description: > - DEX MEV Sandwich Trades across chains + The dex.sandwiches table captures detailed data on the outer trades of sandwich attacks in decentralized exchanges (DEXs), recording front-running and back-running trades across various EVM networks. tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -17,25 +18,25 @@ models: - tx_hash - project_contract_address - evt_index - columns: + columns: - &blockchain name: blockchain - description: "Blockchain" + description: "Blockchain on which this trade occurred" - &project name: project - description: "Project name of the DEX" + description: "Name of the dex on which the trade occurred" - &version name: version - description: "Version of the contract built and deployed by the DEX project" + description: "Version of the DEX protocol/contract" - &block_time name: block_time - description: "UTC event block time of each DEX trade" + description: "UTC event block time" - &block_month name: block_month - description: "UTC event block month of each DEX trade" + description: "UTC event block month" - &block_number name: block_number - description: "the block number of the block that the offer was created in" + description: "Block number of the block in which the trade occurred" - &token_sold_address name: token_sold_address description: "Contract address of the token sold" @@ -44,69 +45,70 @@ models: description: "Contract address of the token bought" - &token_sold_symbol name: token_sold_symbol - description: "Token symbol for token sold in the trade" + description: "Symbol of the token sold in the trade" - &token_bought_symbol name: token_bought_symbol - description: "Token symbol for token bought in the trade" + description: "Symbol of the token bought in the trade" - &maker name: maker - description: "Address of trader who sold a token" + description: "Address of account which sold tokens. Can be contracts or EOA addresses." - &taker name: taker - description: "Address of trader who purchased a token" + description: "Address of account which purchased tokens. Can be contracts or EOA addresses." - &tx_hash name: tx_hash - description: "Unique transaction hash value tied to each transaction on the DEX" + description: "The hash of the transaction that this trade was included in" - &tx_from name: tx_from - description: "Address which initiated the trade" + 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 which received the trade" + description: "Address that got called in the first call of this transaction" - &project_contract_address name: project_contract_address - description: "Project contract address which executed the trade on the blockchain" + 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." - &token_pair name: token_pair - description: "Token symbol pair for each token involved in the trade" + description: "symbol pair for the tokens involved in the trade. e.g. 'ETH/USDC'. Always alphabetical order, not trade order." - &tx_index name: tx_index description: "Index of the transaction in block" - &token_sold_amount_raw name: token_sold_amount_raw - description: "Raw value of the token sold at time of execution in the original currency" + description: "Amount of the token sold in the base unit" - &token_bought_amount_raw name: token_bought_amount_raw - description: "Raw value of the token bought at time of execution in the original currency" + description: "Amount of the token bought in the base unit" - &token_sold_amount name: token_sold_amount - description: "Value of the token sold at time of execution in the original currency" + description: "Amount of the token sold in the display unit" - &token_bought_amount name: token_bought_amount - description: "Value of the token bought at time of execution in the original currency" + description: "Amount of the token bought in the display unit" - &amount_usd name: amount_usd - description: "USD Value" + description: "USD value of the trade at time of execution. Can be null if we don't have enough data to calculate the value." - &evt_index name: evt_index - description: "Event 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_sandwiched - meta: + meta: blockchain: ethereum, bnb, avalanche_c, gnosis, optimism, fantom, arbitrum, celo, zksync, scroll, zora sector: dex contributors: hildobby + docs_slug: /curated/trading/DEX/dex-sandwiched config: - tags: ['dex', 'mev', 'sandwiched'] + tags: ["dex", "mev", "sandwiched"] description: > - DEX MEV Sandwiched Trades across chains + The dex.sandwiched table captures detailed data on the victim trades of sandwich attacks in decentralized exchanges (DEXs), recording transactions that have been sandwiched across various EVM networks. tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -133,12 +135,12 @@ models: - *evt_index - name: dex_ethereum_sandwiches - meta: + meta: blockchain: ethereum sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'ethereum'] + tags: ["dex", "mev", "sandwiches", "ethereum"] description: > DEX MEV Sandwich Trades on Ethereum tests: @@ -147,7 +149,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -174,12 +176,12 @@ models: - *evt_index - name: dex_arbitrum_sandwiches - meta: + meta: blockchain: arbitrum sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'arbitrum'] + tags: ["dex", "mev", "sandwiches", "arbitrum"] description: > DEX MEV Sandwich Trades on Arbitrum tests: @@ -188,7 +190,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -215,12 +217,12 @@ models: - *evt_index - name: dex_avalanche_c_sandwiches - meta: + meta: blockchain: avalanche_c sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'avalanche_c'] + tags: ["dex", "mev", "sandwiches", "avalanche_c"] description: > DEX MEV Sandwich Trades on Avalanche tests: @@ -229,7 +231,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -256,12 +258,12 @@ models: - *evt_index - name: dex_bnb_sandwiches - meta: + meta: blockchain: bnb sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'bnb'] + tags: ["dex", "mev", "sandwiches", "bnb"] description: > DEX MEV Sandwich Trades on BNB tests: @@ -270,7 +272,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -297,12 +299,12 @@ models: - *evt_index - name: dex_fantom_sandwiches - meta: + meta: blockchain: fantom sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'fantom'] + tags: ["dex", "mev", "sandwiches", "fantom"] description: > DEX MEV Sandwich Trades on Fantom tests: @@ -311,7 +313,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -338,12 +340,12 @@ models: - *evt_index - name: dex_gnosis_sandwiches - meta: + meta: blockchain: gnosis sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'gnosis'] + tags: ["dex", "mev", "sandwiches", "gnosis"] description: > DEX MEV Sandwich Trades on Gnosis tests: @@ -352,7 +354,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -379,12 +381,12 @@ models: - *evt_index - name: dex_optimism_sandwiches - meta: + meta: blockchain: optimism sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'optimism'] + tags: ["dex", "mev", "sandwiches", "optimism"] description: > DEX MEV Sandwich Trades on Optimism tests: @@ -393,7 +395,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -420,12 +422,12 @@ models: - *evt_index - name: dex_polygon_sandwiches - meta: + meta: blockchain: polygon sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'polygon'] + tags: ["dex", "mev", "sandwiches", "polygon"] description: > DEX MEV Sandwich Trades on Polygon tests: @@ -434,7 +436,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -461,12 +463,12 @@ models: - *evt_index - name: dex_base_sandwiches - meta: + meta: blockchain: base sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'base'] + tags: ["dex", "mev", "sandwiches", "base"] description: > DEX MEV Sandwich Trades on Base tests: @@ -475,7 +477,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -502,12 +504,12 @@ models: - *evt_index - name: dex_zksync_sandwiches - meta: + meta: blockchain: zksync sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'zksync'] + tags: ["dex", "mev", "sandwiches", "zksync"] description: > DEX MEV Sandwich Trades on zkSync tests: @@ -516,7 +518,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -543,12 +545,12 @@ models: - *evt_index - name: dex_celo_sandwiches - meta: + meta: blockchain: celo sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'celo'] + tags: ["dex", "mev", "sandwiches", "celo"] description: > DEX MEV Sandwich Trades on Celo tests: @@ -557,7 +559,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -584,12 +586,12 @@ models: - *evt_index - name: dex_scroll_sandwiches - meta: + meta: blockchain: scroll sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'scroll'] + tags: ["dex", "mev", "sandwiches", "scroll"] description: > DEX MEV Sandwich Trades on Scroll tests: @@ -598,7 +600,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -625,12 +627,12 @@ models: - *evt_index - name: dex_zora_sandwiches - meta: + meta: blockchain: zora sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiches', 'zora'] + tags: ["dex", "mev", "sandwiches", "zora"] description: > DEX MEV Sandwich Trades on Zora Network tests: @@ -639,7 +641,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -664,14 +666,14 @@ models: - *token_bought_amount - *amount_usd - *evt_index - + - name: dex_ethereum_sandwiched - meta: + meta: blockchain: ethereum sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'ethereum'] + tags: ["dex", "mev", "sandwiched", "ethereum"] description: > DEX MEV Sandwiched Trades on Ethereum tests: @@ -680,7 +682,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -707,12 +709,12 @@ models: - *evt_index - name: dex_arbitrum_sandwiched - meta: + meta: blockchain: arbitrum sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'arbitrum'] + tags: ["dex", "mev", "sandwiched", "arbitrum"] description: > DEX MEV Sandwiched Trades on Arbitrum tests: @@ -721,7 +723,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -748,12 +750,12 @@ models: - *evt_index - name: dex_avalanche_c_sandwiched - meta: + meta: blockchain: avalanche_c sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'avalanche_c'] + tags: ["dex", "mev", "sandwiched", "avalanche_c"] description: > DEX MEV Sandwiched Trades on Avalanche tests: @@ -762,7 +764,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -789,12 +791,12 @@ models: - *evt_index - name: dex_bnb_sandwiched - meta: + meta: blockchain: bnb sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'bnb'] + tags: ["dex", "mev", "sandwiched", "bnb"] description: > DEX MEV Sandwiched Trades on BNB tests: @@ -803,7 +805,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -830,12 +832,12 @@ models: - *evt_index - name: dex_fantom_sandwiched - meta: + meta: blockchain: fantom sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'fantom'] + tags: ["dex", "mev", "sandwiched", "fantom"] description: > DEX MEV Sandwiched Trades on Fantom tests: @@ -844,7 +846,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -871,12 +873,12 @@ models: - *evt_index - name: dex_gnosis_sandwiched - meta: + meta: blockchain: gnosis sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'gnosis'] + tags: ["dex", "mev", "sandwiched", "gnosis"] description: > DEX MEV Sandwiched Trades on Gnosis tests: @@ -885,7 +887,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -912,12 +914,12 @@ models: - *evt_index - name: dex_optimism_sandwiched - meta: + meta: blockchain: optimism sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'optimism'] + tags: ["dex", "mev", "sandwiched", "optimism"] description: > DEX MEV Sandwiched Trades on Optimism tests: @@ -926,7 +928,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -953,12 +955,12 @@ models: - *evt_index - name: dex_polygon_sandwiched - meta: + meta: blockchain: polygon sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'polygon'] + tags: ["dex", "mev", "sandwiched", "polygon"] description: > DEX MEV Sandwiched Trades on Polygon tests: @@ -967,7 +969,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -994,12 +996,12 @@ models: - *evt_index - name: dex_base_sandwiched - meta: + meta: blockchain: base sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'base'] + tags: ["dex", "mev", "sandwiched", "base"] description: > DEX MEV Sandwiched Trades on Base tests: @@ -1008,7 +1010,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -1035,12 +1037,12 @@ models: - *evt_index - name: dex_celo_sandwiched - meta: + meta: blockchain: celo sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'celo'] + tags: ["dex", "mev", "sandwiched", "celo"] description: > DEX MEV Sandwiched Trades on Celo tests: @@ -1049,7 +1051,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -1076,12 +1078,12 @@ models: - *evt_index - name: dex_zksync_sandwiched - meta: + meta: blockchain: zksync sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'zksync'] + tags: ["dex", "mev", "sandwiched", "zksync"] description: > DEX MEV Sandwiched Trades on zkSync tests: @@ -1090,7 +1092,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -1117,12 +1119,12 @@ models: - *evt_index - name: dex_scroll_sandwiched - meta: + meta: blockchain: scroll sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'scroll'] + tags: ["dex", "mev", "sandwiched", "scroll"] description: > DEX MEV Sandwiched Trades on Scroll tests: @@ -1131,7 +1133,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -1158,12 +1160,12 @@ models: - *evt_index - name: dex_zora_sandwiched - meta: + meta: blockchain: zora sector: dex contributors: hildobby config: - tags: ['dex', 'mev', 'sandwiched', 'zora'] + tags: ["dex", "mev", "sandwiched", "zora"] description: > DEX MEV Sandwiched Trades on Zora Network tests: @@ -1172,7 +1174,7 @@ models: - blockchain - tx_hash - evt_index - columns: + columns: - *blockchain - *project - *version @@ -1196,4 +1198,4 @@ models: - *token_sold_amount - *token_bought_amount - *amount_usd - - *evt_index \ No newline at end of file + - *evt_index diff --git a/dbt_subprojects/dex/models/trades/_schema.yml b/dbt_subprojects/dex/models/trades/_schema.yml index 8b0b6fd43a0..b5a2e8192cf 100644 --- a/dbt_subprojects/dex/models/trades/_schema.yml +++ b/dbt_subprojects/dex/models/trades/_schema.yml @@ -3,11 +3,14 @@ version: 2 models: - name: dex_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: 0xRob, hosuke, jeff-dude, tomfutago config: - tags: [ 'dex', 'trades', 'beta' ] + tags: [ 'dex', 'trades'] + description: '{{ doc("dex_trades_doc") }}' tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -19,53 +22,53 @@ models: columns: - &blockchain name: blockchain - description: "Blockchain which the DEX is deployed" + description: "Blockchain on which this trade occurred" - &project name: project - description: "Project name of the DEX" + description: "Name of the dex on which the trade occurred" tests: - relationships: to: ref('dex_info') field: project - &version name: version - description: "Version of the contract built and deployed by the DEX project" + description: "Version of the DEX protocol/contract" - &block_month name: block_month - description: "UTC event block month of each DEX trade" + description: "UTC event block month" - &block_date name: block_date - description: "UTC event block date of each DEX trade" + description: "UTC event block date" - &block_time name: block_time - description: "UTC event block time of each DEX trade" + description: "UTC event block time" - &block_number name: block_number - description: "Block number of each DEX trade" + description: "Block number of the block in which the trade occurred" - &token_bought_symbol name: token_bought_symbol - description: "Token symbol for token bought in the trade" + description: "Symbol of the token bought in the trade" - &token_sold_symbol name: token_sold_symbol - description: "Token symbol for token sold in the trade" + description: "Symbol of the token sold in the trade" - &token_pair name: token_pair - description: "Token symbol pair for each token involved in the trade" + 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: "Value of the token bought at time of execution in the original currency" + description: "Amount of the token bought in the display unit" - &token_sold_amount name: token_sold_amount - description: "Value of the token sold at time of execution in the original currency" + description: "Amount of the token sold in the display unit" - &token_bought_amount_raw name: token_bought_amount_raw - description: "Raw value of the token bought at time of execution in the original currency" + description: "Amount of the token bought in the base unit" - &token_sold_amount_raw name: token_sold_amount_raw - description: "Raw value of the token sold at time of execution in the original currency" + 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" + description: "USD value of the trade at time of execution. Can be null if we don't have enough data to calculate the value." tests: - dbt_utils.accepted_range: max_value: 1000000000 # $1b is an arbitrary number, intended to flag outlier amounts early @@ -77,25 +80,25 @@ models: description: "Contract address of the token sold" - &taker name: taker - description: "Address of trader who purchased a token" + description: "Address of account which purchased tokens. Can be contracts or EOA addresses. " - &maker name: maker - description: "Address of trader who sold a token" + description: "Address of account which sold tokens. Can be contracts or EOA addresses." - &project_contract_address name: project_contract_address - description: "Project contract address which executed the trade on the blockchain" + 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: "Unique transaction hash value tied to each transaction on the DEX" + description: "The hash of the transaction that this trade was included in" - &tx_from name: tx_from - description: "Address which initiated the trade" + 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 which received the trade" + description: "Address that got called in the first call of this transaction" - &evt_index name: evt_index - description: "Index of the corresponding trade event" + description: "Index of the event in the transaction. Can be used to uniquely identify the order of trades within in a transaction" - name: dex_base_trades meta: diff --git a/dbt_subprojects/dex/models/trades/arbitrum/_schema.yml b/dbt_subprojects/dex/models/trades/arbitrum/_schema.yml index 4f216649ba9..f9512d958fa 100644 --- a/dbt_subprojects/dex/models/trades/arbitrum/_schema.yml +++ b/dbt_subprojects/dex/models/trades/arbitrum/_schema.yml @@ -12,7 +12,7 @@ models: project: uniswap contributors: jeff-dude, masquot, soispoke, mtitus6 config: - tags: [ 'arbitrum', 'dex', 'trades', 'uniswap', 'v3' ] + tags: ["arbitrum", "dex", "trades", "uniswap", "v3"] description: "uniswap arbitrum v3 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -31,7 +31,7 @@ models: project: uniswap contributors: Henrystats config: - tags: [ 'arbitrum', 'dex', 'trades', 'uniswap', 'v2' ] + tags: ["arbitrum", "dex", "trades", "uniswap", "v2"] description: "uniswap arbitrum v2 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -50,7 +50,7 @@ models: project: sushiswap contributors: Henrystats, tomfutago config: - tags: ['arbitrum', 'dex', 'trades', 'sushiswap', 'v1'] + tags: ["arbitrum", "dex", "trades", "sushiswap", "v1"] description: "Sushiswap arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -62,7 +62,6 @@ models: filter: version: 1 - - name: sushiswap_v2_arbitrum_base_trades meta: blockchain: arbitrum @@ -70,7 +69,7 @@ models: project: sushiswap contributors: tomfutago config: - tags: ['arbitrum', 'dex', 'trades', 'sushiswap', 'v2'] + tags: ["arbitrum", "dex", "trades", "sushiswap", "v2"] description: "Sushiswap arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -82,7 +81,6 @@ models: filter: version: 2 - - name: airswap_arbitrum_base_trades meta: blockchain: arbitrum @@ -90,7 +88,7 @@ models: project: airswap contributors: tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'airswap' ] + tags: ["arbitrum", "dex", "trades", "airswap"] description: "Airswap arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -100,7 +98,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('airswap_arbitrum_base_trades_seed') - - name: camelot_v2_arbitrum_base_trades meta: blockchain: arbitrum @@ -108,7 +105,7 @@ models: project: camelot contributors: ytoast, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'camelot', 'uniswap', 'v2' ] + tags: ["arbitrum", "dex", "trades", "camelot", "uniswap", "v2"] description: "Camelot Arbitrum v2 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -120,7 +117,6 @@ models: filter: version: 2 - - name: camelot_v3_arbitrum_base_trades meta: blockchain: arbitrum @@ -128,7 +124,7 @@ models: project: camelot contributors: whale_hunter, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'camelot', 'uniswap', 'v3' ] + tags: ["arbitrum", "dex", "trades", "camelot", "uniswap", "v3"] description: "Camelot Arbitrum v2 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -140,7 +136,6 @@ models: filter: version: 3 - - name: arbswap_arbitrum_base_trades meta: blockchain: arbitrum @@ -148,7 +143,7 @@ models: project: arbswap contributors: chrispearcx, hosuke, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'arbswap' ] + tags: ["arbitrum", "dex", "trades", "arbswap"] description: "Arbswap arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -158,7 +153,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('arbswap_arbitrum_base_trades_seed') - - name: trader_joe_v2_arbitrum_base_trades meta: blockchain: arbitrum @@ -166,7 +160,7 @@ models: project: trader_joe contributors: hsrvc, pecio222, hosuke config: - tags: [ 'arbitrum', 'dex', 'trades', 'trader_joe', 'v2' ] + tags: ["arbitrum", "dex", "trades", "trader_joe", "v2"] description: "Trader Joe arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -178,7 +172,6 @@ models: filter: version: 2 - - name: trader_joe_v2_1_arbitrum_base_trades meta: blockchain: arbitrum @@ -186,7 +179,7 @@ models: project: trader_joe contributors: chef_seaweed config: - tags: [ 'arbitrum', 'dex', 'trades', 'trader_joe', 'v2.1' ] + tags: ["arbitrum", "dex", "trades", "trader_joe", "v2.1"] description: "Trader Joe arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -198,6 +191,24 @@ models: filter: version: 2.1 + - name: trader_joe_v2_2_arbitrum_base_trades + meta: + blockchain: arbitrum + sector: dex + project: trader_joe + contributors: chef_seaweed + config: + tags: ["arbitrum", "dex", "trades", "trader_joe", "v2.2"] + description: "Trader Joe arbitrum base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('trader_joe_arbitrum_base_trades_seed') + filter: + version: 2.2 - name: pancakeswap_v2_arbitrum_base_trades meta: @@ -206,7 +217,7 @@ models: project: pancakeswap contributors: chef_seaweed, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'pancakeswap', 'uniswap', 'v2' ] + tags: ["arbitrum", "dex", "trades", "pancakeswap", "uniswap", "v2"] description: "Pancakeswap Arbitrum v2 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -220,7 +231,6 @@ models: - 2 - stableswap - - name: balancer_v2_arbitrum_base_trades meta: blockchain: arbitrum @@ -228,7 +238,7 @@ models: project: balancer contributors: bizzyvinci, thetroyharris, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'balancer' ] + tags: ["arbitrum", "dex", "trades", "balancer"] description: "Balancer v2 arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -240,7 +250,6 @@ models: filter: version: 2 - - name: pancakeswap_v3_arbitrum_base_trades meta: blockchain: arbitrum @@ -248,7 +257,7 @@ models: project: pancakeswap contributors: chef_seaweed, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'pancakeswap', 'uniswap', 'v3' ] + tags: ["arbitrum", "dex", "trades", "pancakeswap", "uniswap", "v3"] description: "Pancakeswap Arbitrum v3 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -260,7 +269,6 @@ models: filter: version: 3 - - name: dodo_arbitrum_base_trades meta: blockchain: arbitrum @@ -268,7 +276,7 @@ models: project: dodo contributors: owen05, scoffie, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'dodo' ] + tags: ["arbitrum", "dex", "trades", "dodo"] description: "Dodo Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -284,7 +292,6 @@ models: - 2_dpp - 2_dsp - - name: gmx_arbitrum_base_trades meta: blockchain: arbitrum @@ -292,7 +299,7 @@ models: project: gmx contributors: chef_seaweed, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'gmx' ] + tags: ["arbitrum", "dex", "trades", "gmx"] description: "GMX Arbitrum v3 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -302,7 +309,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('gmx_arbitrum_base_trades_seed') - - name: integral_arbitrum_base_trades meta: blockchain: arbitrum @@ -310,7 +316,7 @@ models: project: integral contributors: integralhq, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'integral', 'uniswap', 'v2' ] + tags: ["arbitrum", "dex", "trades", "integral", "uniswap", "v2"] description: "Integral Arbitrum v3 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -320,7 +326,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('integral_arbitrum_base_trades_seed') - - name: clipper_arbitrum_base_trades meta: blockchain: arbitrum @@ -328,7 +333,7 @@ models: project: clipper contributors: 0xRob, amalashkevich, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'clipper' ] + tags: ["arbitrum", "dex", "trades", "clipper"] description: "clipper Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -344,7 +349,6 @@ models: - 1 - 2 - - name: kyberswap_arbitrum_base_trades meta: blockchain: arbitrum @@ -352,7 +356,7 @@ models: project: kyberswap contributors: ppclunghe, gregshestakovlido, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'kyberswap', 'uniswap', 'v2' ] + tags: ["arbitrum", "dex", "trades", "kyberswap", "uniswap", "v2"] description: "kyberswap Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -367,7 +371,6 @@ models: - elastic - elastic_2 - - name: xchange_arbitrum_base_trades meta: blockchain: arbitrum @@ -375,7 +378,7 @@ models: project: xchange contributors: mike-x7f, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'xchange', 'uniswap', 'v2' ] + tags: ["arbitrum", "dex", "trades", "xchange", "uniswap", "v2"] description: "xchange Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -385,7 +388,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('xchange_arbitrum_base_trades_seed') - - name: ramses_arbitrum_base_trades meta: blockchain: arbitrum @@ -393,7 +395,7 @@ models: project: ramses contributors: echovl, discochuck config: - tags: [ 'arbitrum', 'dex', 'trades', 'ramses', 'uniswap', 'v2' ] + tags: ["arbitrum", "dex", "trades", "ramses", "uniswap", "v2"] description: "Ramses Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -414,7 +416,7 @@ models: project: fraxswap contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'fraxswap' ] + tags: ["arbitrum", "dex", "trades", "fraxswap"] description: "Fraxswap arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -431,7 +433,7 @@ models: project: chronos contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'chronos'] + tags: ["arbitrum", "dex", "trades", "chronos"] description: "Chronos arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -448,7 +450,7 @@ models: project: zyberswap contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'zyberswap'] + tags: ["arbitrum", "dex", "trades", "zyberswap"] description: "Zyberswap arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -465,7 +467,7 @@ models: project: solidlizard contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'solidlizard'] + tags: ["arbitrum", "dex", "trades", "solidlizard"] description: "Solidlizard arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -475,7 +477,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('solidlizard_arbitrum_base_trades_seed') - - name: rubicon_arbitrum_base_trades meta: blockchain: arbitrum @@ -483,7 +484,7 @@ models: project: rubicon contributors: denver, tomfutago config: - tags: [ 'arbitrum', 'dex', 'trades', 'rubicon' ] + tags: ["arbitrum", "dex", "trades", "rubicon"] description: "rubicon Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -500,7 +501,7 @@ models: project: woofi contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'woofi'] + tags: ["arbitrum", "dex", "trades", "woofi"] description: "woofi Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -517,7 +518,7 @@ models: project: smardex contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'smardex'] + tags: ["arbitrum", "dex", "trades", "smardex"] description: "smardex Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -534,7 +535,7 @@ models: project: oasisswap contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'oasisswap'] + tags: ["arbitrum", "dex", "trades", "oasisswap"] description: "oasisswap Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -551,7 +552,7 @@ models: project: swaap contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'swaap', 'v2'] + tags: ["arbitrum", "dex", "trades", "swaap", "v2"] description: "swaap v2 arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -570,7 +571,7 @@ models: project: apeswap contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'apeswap'] + tags: ["arbitrum", "dex", "trades", "apeswap"] description: "apeswap Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -587,9 +588,9 @@ models: pproject: zigzag contributors: jeff-dude, masquot, soispoke, mtitus6, hosuke config: - tags: [ 'arbitrum','trades', 'zigzag','dex' ] + tags: ["arbitrum", "trades", "zigzag", "dex"] description: > - Zigzag V1 contract trades on Arbitrum + Zigzag V1 contract trades on Arbitrum tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -605,7 +606,7 @@ models: project: gridex contributors: LLDAO config: - tags: [ 'arbitrum', 'dex', 'trades', 'gridex'] + tags: ["arbitrum", "dex", "trades", "gridex"] description: "gridex Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -622,7 +623,7 @@ models: project: sterling_finance contributors: ARDev097 config: - tags: [ 'arbitrum', 'dex', 'trades', 'sterling_finance'] + tags: ["arbitrum", "dex", "trades", "sterling_finance"] description: "sterling_finance Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -639,7 +640,7 @@ models: project: sharkyswap contributors: ARDev097 config: - tags: [ 'arbitrum', 'dex', 'trades', 'sharkyswap'] + tags: ["arbitrum", "dex", "trades", "sharkyswap"] description: "sharkyswap Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -656,7 +657,7 @@ models: project: auragi contributors: archie config: - tags: [ 'arbitrum', 'dex', 'trades', 'auragi'] + tags: ["arbitrum", "dex", "trades", "auragi"] description: "auragi Arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -673,7 +674,7 @@ models: project: wombatexchange contributors: config: - tags: [ 'arbitrum', 'dex', 'trades', 'wombat_exchange' ] + tags: ["arbitrum", "dex", "trades", "wombat_exchange"] description: "wombatexchange arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -690,7 +691,7 @@ models: project: solidly contributors: SolidlyLabs config: - tags: [ 'arbitrum', 'dex', 'trades', 'solidly' ] + tags: ["arbitrum", "dex", "trades", "solidly"] description: "solidly v3 arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -707,7 +708,7 @@ models: project: dackieswap contributors: blanchemaria6 config: - tags: [ 'arbitrum', 'dex', 'trades', 'dackieswap' ] + tags: ["arbitrum", "dex", "trades", "dackieswap"] description: "dackieswap v3 arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -726,7 +727,7 @@ models: project: dackieswap contributors: blanchemaria6 config: - tags: [ 'arbitrum', 'dex', 'trades', 'dackieswap' ] + tags: ["arbitrum", "dex", "trades", "dackieswap"] description: "dackieswap v2 arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -745,7 +746,7 @@ models: project: maverick contributors: get620v config: - tags: [ 'arbitrum', 'dex', 'trades', 'maverick' ] + tags: ["arbitrum", "dex", "trades", "maverick"] description: "Maverick arbitrum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -756,3 +757,18 @@ models: seed_file: ref('maverick_arbitrum_base_trades_seed') filter: version: 2 + + - name: valantis_hot_arbitrum_base_trades + meta: + blockchain: arbitrum + sector: dex + project: valantis + contributors: 0xrusowsky + config: + tags: ["arbitrum", "dex", "trades", "valantis", "arrakis", "hot"] + description: "hot-amm arbitrum base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index diff --git a/dbt_subprojects/dex/models/trades/arbitrum/dex_arbitrum_base_trades.sql b/dbt_subprojects/dex/models/trades/arbitrum/dex_arbitrum_base_trades.sql index 62965d79e4e..2c37cfcd91f 100644 --- a/dbt_subprojects/dex/models/trades/arbitrum/dex_arbitrum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/arbitrum/dex_arbitrum_base_trades.sql @@ -15,6 +15,7 @@ , ref('arbswap_arbitrum_base_trades') , ref('trader_joe_v2_arbitrum_base_trades') , ref('trader_joe_v2_1_arbitrum_base_trades') + , ref('trader_joe_v2_2_arbitrum_base_trades') , ref('pancakeswap_v2_arbitrum_base_trades') , ref('pancakeswap_v3_arbitrum_base_trades') , ref('balancer_v2_arbitrum_base_trades') @@ -46,6 +47,7 @@ , ref('dackieswap_v3_arbitrum_base_trades') , ref('dackieswap_v2_arbitrum_base_trades') , ref('maverick_v2_arbitrum_base_trades') + , ref('valantis_hot_arbitrum_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/arbitrum/platforms/dodo_arbitrum_base_trades.sql b/dbt_subprojects/dex/models/trades/arbitrum/platforms/dodo_arbitrum_base_trades.sql index 73277ba1479..b948f55053a 100644 --- a/dbt_subprojects/dex/models/trades/arbitrum/platforms/dodo_arbitrum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/arbitrum/platforms/dodo_arbitrum_base_trades.sql @@ -11,7 +11,7 @@ }} {% set config_markets %} - WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS + WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS ( VALUES (0xFE176A2b1e1F67250d2903B8d25f56C0DaBcd6b2, 'WETH', 'USDC', 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1, 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8), @@ -23,9 +23,9 @@ {% set config_other_sources = [ - {'version': '2_dvm', 'source': 'DVM_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPPOracle_evt_DODOSwap'}, - {'version': '2_dsp', 'source': 'DSP_evt_DODOSwap'}, + {'version': '2', 'source': 'DVM_evt_DODOSwap'}, + {'version': '2', 'source': 'DPPOracle_evt_DODOSwap'}, + {'version': '2', 'source': 'DSP_evt_DODOSwap'}, ] %} diff --git a/dbt_subprojects/dex/models/trades/arbitrum/platforms/sushiswap_v2_arbitrum_base_trades.sql b/dbt_subprojects/dex/models/trades/arbitrum/platforms/sushiswap_v2_arbitrum_base_trades.sql index 9c98c1e3d95..98808748296 100644 --- a/dbt_subprojects/dex/models/trades/arbitrum/platforms/sushiswap_v2_arbitrum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/arbitrum/platforms/sushiswap_v2_arbitrum_base_trades.sql @@ -15,7 +15,7 @@ blockchain = 'arbitrum', project = 'sushiswap', version = '2', - Pair_evt_Swap = source('sushi_v2_arbitrum', 'Pool_evt_Swap'), + Pair_evt_Swap = source('sushiswap_v3_pool_arbitrum', 'UniswapV3Pool_evt_Swap'), Factory_evt_PoolCreated = source('sushi_v2_arbitrum', 'Factory_evt_PoolCreated') ) }} diff --git a/dbt_subprojects/dex/models/trades/arbitrum/platforms/trader_joe_v2_2_arbitrum_base_trades.sql b/dbt_subprojects/dex/models/trades/arbitrum/platforms/trader_joe_v2_2_arbitrum_base_trades.sql new file mode 100644 index 00000000000..afd3d1eb4bc --- /dev/null +++ b/dbt_subprojects/dex/models/trades/arbitrum/platforms/trader_joe_v2_2_arbitrum_base_trades.sql @@ -0,0 +1,20 @@ +{{ config( + schema = 'trader_joe_v2_2_arbitrum' + , alias = 'base_trades' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['tx_hash', 'evt_index'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + trader_joe_compatible_v2_1_trades( + blockchain = 'arbitrum' + , project = 'trader_joe' + , version = '2.2' + , Pair_evt_Swap = source('trader_joe_v2_2_arbitrum', 'LBPair_evt_Swap') + , Factory_evt_PoolCreated = source('trader_joe_v2_2_arbitrum', 'LBFactory_evt_LBPairCreated') + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/arbitrum/platforms/valantis_hot_arbitrum_base_trades.sql b/dbt_subprojects/dex/models/trades/arbitrum/platforms/valantis_hot_arbitrum_base_trades.sql new file mode 100644 index 00000000000..975dad4172c --- /dev/null +++ b/dbt_subprojects/dex/models/trades/arbitrum/platforms/valantis_hot_arbitrum_base_trades.sql @@ -0,0 +1,21 @@ +{{ config( + schema = 'valantis_hot_arbitrum' + , alias = 'base_trades' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['tx_hash', 'evt_index'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + valantis_compatible_hot_trades( + blockchain = 'arbitrum', + project = 'valantis', + version = 'hot', + HOT_evt_Swap = source('valantis_arbitrum', 'HOT_evt_HotSwap'), + Pair_evt_Swap = source('valantis_arbitrum', 'SovereignPool_evt_Swap'), + Factory_evt_PoolCreated = source('valantis_arbitrum', 'ProtocolFactory_evt_SovereignPoolDeployed') + ) +}} diff --git a/dbt_subprojects/dex/models/trades/avalanche_c/_schema.yml b/dbt_subprojects/dex/models/trades/avalanche_c/_schema.yml index 8a212b5918c..28ff6cea89f 100644 --- a/dbt_subprojects/dex/models/trades/avalanche_c/_schema.yml +++ b/dbt_subprojects/dex/models/trades/avalanche_c/_schema.yml @@ -142,6 +142,25 @@ models: filter: version: 2.1 + - name: trader_joe_v2_2_avalanche_c_base_trades + meta: + blockchain: avalanche_c + sector: dex + project: trader_joe + contributors: chef_seaweed + config: + tags: [ 'avalanche_c', 'dex', 'trades', 'trader_joe', 'v2.2' ] + description: "Trader Joe avalanche_c base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('trader_joe_avalanche_c_base_trades_seed') + filter: + version: 2.2 + - name: balancer_v2_avalanche_c_base_trades meta: blockchain: avalanche_c diff --git a/dbt_subprojects/dex/models/trades/avalanche_c/dex_avalanche_c_base_trades.sql b/dbt_subprojects/dex/models/trades/avalanche_c/dex_avalanche_c_base_trades.sql index c1892175cb5..f9cac620cec 100644 --- a/dbt_subprojects/dex/models/trades/avalanche_c/dex_avalanche_c_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/avalanche_c/dex_avalanche_c_base_trades.sql @@ -14,6 +14,7 @@ , ref('trader_joe_v1_avalanche_c_base_trades') , ref('trader_joe_v2_avalanche_c_base_trades') , ref('trader_joe_v2_1_avalanche_c_base_trades') + , ref('trader_joe_v2_2_avalanche_c_base_trades') , ref('balancer_v2_avalanche_c_base_trades') , ref('glacier_v2_avalanche_c_base_trades') , ref('glacier_v3_avalanche_c_base_trades') diff --git a/dbt_subprojects/dex/models/trades/avalanche_c/platforms/trader_joe_v2_2_avalanche_c_base_trades.sql b/dbt_subprojects/dex/models/trades/avalanche_c/platforms/trader_joe_v2_2_avalanche_c_base_trades.sql new file mode 100644 index 00000000000..39ea78b46a5 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/avalanche_c/platforms/trader_joe_v2_2_avalanche_c_base_trades.sql @@ -0,0 +1,20 @@ +{{ config( + schema = 'trader_joe_v2_2_avalanche_c' + , alias = 'base_trades' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['tx_hash', 'evt_index'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + trader_joe_compatible_v2_1_trades( + blockchain = 'avalanche_c' + , project = 'trader_joe' + , version = '2.2' + , Pair_evt_Swap = source('trader_joe_v2_2_avalanche_c', 'LBPair_evt_Swap') + , Factory_evt_PoolCreated = source('trader_joe_v2_2_avalanche_c', 'LBFactory_evt_LBPairCreated') + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/base/_schema.yml b/dbt_subprojects/dex/models/trades/base/_schema.yml index 2214bb4a8a6..8fe36d37fc9 100644 --- a/dbt_subprojects/dex/models/trades/base/_schema.yml +++ b/dbt_subprojects/dex/models/trades/base/_schema.yml @@ -229,7 +229,27 @@ models: - evt_index - check_dex_base_trades_seed: seed_file: ref('baseswap_base_base_trades_seed') + filter: + version: 2 + - name: baseswap_v3_base_base_trades + meta: + blockchain: base + sector: dex + project: baseswap + contributors: chef_seaweed + config: + tags: [ 'base', 'dex', 'trades', 'baseswap' ] + description: "baseswap base trades on base" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('baseswap_base_base_trades_seed') + filter: + version: 3 - name: dackieswap_base_base_trades meta: @@ -959,3 +979,20 @@ models: seed_file: ref('swaap_base_base_trades_seed') filter: version: 2 + + - name: xchange_base_base_trades + meta: + blockchain: base + sector: dex + project: xchange + contributors: mike-x7f + config: + tags: [ 'base', 'dex', 'trades', 'xchange' ] + description: "xchange base base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('xchange_base_base_trades_seed') diff --git a/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql index ef69335562c..742449afaea 100644 --- a/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql @@ -20,6 +20,7 @@ , ref('dackieswap_base_base_trades') , ref('rubicon_base_base_trades') , ref('baseswap_base_base_trades') + , ref('baseswap_v3_base_base_trades') , ref('scale_base_base_trades') , ref('kyberswap_base_base_trades') , ref('woofi_base_base_trades') @@ -48,6 +49,7 @@ , ref('clipper_base_base_trades') , ref('solidly_v3_base_base_trades') , ref('swaap_v2_base_base_trades') + , ref('xchange_base_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/base/platforms/baseswap_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/platforms/baseswap_base_base_trades.sql index fca696b95c5..96b6ee13c38 100644 --- a/dbt_subprojects/dex/models/trades/base/platforms/baseswap_base_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/base/platforms/baseswap_base_base_trades.sql @@ -14,7 +14,7 @@ uniswap_compatible_v2_trades( blockchain = 'base', project = 'baseswap', - version = '1', + version = '2', Pair_evt_Swap = source('baseswap_base', 'PancakePair_evt_Swap'), Factory_evt_PairCreated = source('baseswap_base', 'PancakeFactory_evt_PairCreated') ) diff --git a/dbt_subprojects/dex/models/trades/base/platforms/baseswap_v3_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/platforms/baseswap_v3_base_base_trades.sql new file mode 100644 index 00000000000..229d2185bb5 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/base/platforms/baseswap_v3_base_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'baseswap_v3_base', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_compatible_v3_trades( + blockchain = 'base', + project = 'baseswap', + version = '3', + Pair_evt_Swap = source('baseswap_v3_base', 'UniswapV3Pool_evt_Swap'), + Factory_evt_PoolCreated = source('baseswap_v3_base', 'UniswapV3Factory_evt_PoolCreated') + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/base/platforms/dodo_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/platforms/dodo_base_base_trades.sql index e27bf13b255..d024d80cc96 100644 --- a/dbt_subprojects/dex/models/trades/base/platforms/dodo_base_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/base/platforms/dodo_base_base_trades.sql @@ -12,7 +12,7 @@ {% set config_other_sources = [ - {'version': '2_dpp', 'source': 'DPPOracle_evt_DODOSwap'}, + {'version': '2', 'source': 'DPPOracle_evt_DODOSwap'}, ] %} diff --git a/dbt_subprojects/dex/models/trades/base/platforms/xchange_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/platforms/xchange_base_base_trades.sql new file mode 100644 index 00000000000..78c8605fdb4 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/base/platforms/xchange_base_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'xchange_base', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_compatible_v2_trades( + blockchain = 'base', + project = 'xchange', + version = '1', + Pair_evt_Swap = source('xchange_base', 'XchangePair_evt_Swap'), + Factory_evt_PairCreated = source('xchange_base', 'XchangeFactory_evt_PairCreated') + ) +}} diff --git a/dbt_subprojects/dex/models/trades/bnb/_schema.yml b/dbt_subprojects/dex/models/trades/bnb/_schema.yml index 45272fec94d..80f72ff78c8 100644 --- a/dbt_subprojects/dex/models/trades/bnb/_schema.yml +++ b/dbt_subprojects/dex/models/trades/bnb/_schema.yml @@ -541,3 +541,22 @@ models: seed_file: ref('uniswap_bnb_base_trades_seed') filter: version: 2 + + - name: swaap_v2_bnb_base_trades + meta: + blockchain: bnb + sector: dex + project: swaap + contributors: borelien + config: + tags: [ 'bnb', 'dex', 'trades', 'swaap', 'v2'] + description: "swaap v2 bnb base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('swaap_bnb_base_trades_seed') + filter: + version: 2 \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/bnb/dex_bnb_base_trades.sql b/dbt_subprojects/dex/models/trades/bnb/dex_bnb_base_trades.sql index b4862c82c4a..d868136e4fe 100644 --- a/dbt_subprojects/dex/models/trades/bnb/dex_bnb_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/bnb/dex_bnb_base_trades.sql @@ -36,6 +36,7 @@ , ref('woofi_bnb_base_trades') , ref('hashflow_bnb_base_trades') , ref('uniswap_v2_bnb_base_trades') + , ref('swaap_v2_bnb_base_trades') ] %} diff --git a/dbt_subprojects/dex/models/trades/bnb/platforms/dodo_bnb_base_trades.sql b/dbt_subprojects/dex/models/trades/bnb/platforms/dodo_bnb_base_trades.sql index bf83d702eb2..0f42ba6928d 100644 --- a/dbt_subprojects/dex/models/trades/bnb/platforms/dodo_bnb_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/bnb/platforms/dodo_bnb_base_trades.sql @@ -10,8 +10,9 @@ ) }} + {% set config_markets %} - WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS + WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS ( VALUES (0x327134dE48fcDD75320f4c32498D1980470249ae, 'WBNB', 'BUSD', 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c, 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56), @@ -29,11 +30,11 @@ {% set config_other_sources = [ - {'version': '2_dvm', 'source': 'DVM_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPP_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPPAdvanced_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPPOracle_evt_DODOSwap'}, - {'version': '2_dsp', 'source': 'DSP_evt_DODOSwap'}, + {'version': '2', 'source': 'DVM_evt_DODOSwap'}, + {'version': '2', 'source': 'DPP_evt_DODOSwap'}, + {'version': '2', 'source': 'DPPAdvanced_evt_DODOSwap'}, + {'version': '2', 'source': 'DPPOracle_evt_DODOSwap'}, + {'version': '2', 'source': 'DSP_evt_DODOSwap'}, ] %} diff --git a/dbt_subprojects/dex/models/trades/bnb/platforms/swaap_v2_bnb_base_trades.sql b/dbt_subprojects/dex/models/trades/bnb/platforms/swaap_v2_bnb_base_trades.sql new file mode 100644 index 00000000000..317e2fe5399 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/bnb/platforms/swaap_v2_bnb_base_trades.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'swaap_v2_bnb', + alias ='base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + swaap_v2_compatible_trades( + blockchain = 'bnb', + project = 'swaap', + version = '2' + ) +}} diff --git a/dbt_subprojects/dex/models/trades/dex_base_trades.sql b/dbt_subprojects/dex/models/trades/dex_base_trades.sql index 0a8bc7e9f7e..73e06a66dc2 100644 --- a/dbt_subprojects/dex/models/trades/dex_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/dex_base_trades.sql @@ -14,21 +14,22 @@ ref('dex_arbitrum_base_trades') , ref('dex_avalanche_c_base_trades') , ref('dex_base_base_trades') + , ref('dex_blast_base_trades') , ref('dex_bnb_base_trades') , ref('dex_celo_base_trades') , ref('dex_ethereum_base_trades') , ref('dex_fantom_base_trades') , ref('dex_gnosis_base_trades') + , ref('dex_linea_base_trades') + , ref('dex_mantle_base_trades') + , ref('dex_nova_base_trades') , ref('dex_optimism_base_trades') , ref('dex_polygon_base_trades') - , ref('dex_zksync_base_trades') , ref('dex_scroll_base_trades') - , ref('dex_zora_base_trades') + , ref('dex_sei_base_trades') , ref('dex_zkevm_base_trades') - , ref('dex_linea_base_trades') - , ref('dex_mantle_base_trades') - , ref('dex_blast_base_trades') - , ref('dex_sei_base_trades') + , ref('dex_zksync_base_trades') + , ref('dex_zora_base_trades') ] %} with base_union as ( @@ -44,8 +45,8 @@ with base_union as ( , block_date , block_time , block_number - , token_bought_amount_raw - , token_sold_amount_raw + , 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 @@ -58,9 +59,10 @@ with base_union as ( , row_number() over (partition by tx_hash, evt_index order by tx_hash) as duplicates_rank FROM {{ model }} - {% if is_incremental() %} WHERE - {{ incremental_predicate('block_time') }} + 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 diff --git a/dbt_subprojects/dex/models/trades/dex_docs_block.md b/dbt_subprojects/dex/models/trades/dex_docs_block.md new file mode 100644 index 00000000000..e23a3b4cde0 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/dex_docs_block.md @@ -0,0 +1,22 @@ +{% docs 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/dbt_subprojects/dex/models/trades/dex_trades.sql b/dbt_subprojects/dex/models/trades/dex_trades.sql index bc0306a45e1..1e5ae87c0a6 100644 --- a/dbt_subprojects/dex/models/trades/dex_trades.sql +++ b/dbt_subprojects/dex/models/trades/dex_trades.sql @@ -7,7 +7,27 @@ , 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", "optimism", "polygon", "scroll", "zkevm", "zksync", "zora"]\', + , 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"]\') }}') @@ -25,8 +45,8 @@ WITH curve AS ( enrich_curve_dex_trades( base_trades = ref('dex_base_trades') , filter = "project = 'curve'" - , curve_ethereum = ref('curvefi_ethereum_base_trades') - , curve_optimism = ref('curvefi_optimism_base_trades') + , curve_ethereum = ref('curve_ethereum_base_trades') + , curve_optimism = ref('curve_optimism_base_trades') , tokens_erc20_model = source('tokens', 'erc20') ) }} diff --git a/dbt_subprojects/dex/models/trades/ethereum/_schema.yml b/dbt_subprojects/dex/models/trades/ethereum/_schema.yml index 144e2b8f8e2..3acacaca364 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/_schema.yml +++ b/dbt_subprojects/dex/models/trades/ethereum/_schema.yml @@ -12,7 +12,7 @@ models: project: uniswap contributors: jeff-dude, masquot, soispoke, hosuke config: - tags: [ 'ethereum', 'dex', 'trades', 'uniswap', 'v1'] + tags: ["ethereum", "dex", "trades", "uniswap", "v1"] description: "uniswap ethereum v1 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -31,7 +31,7 @@ models: project: uniswap contributors: jeff-dude, masquot, soispoke, hosuke config: - tags: [ 'ethereum', 'dex', 'trades', 'uniswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "uniswap", "v2"] description: "uniswap ethereum v2 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -50,7 +50,7 @@ models: project: uniswap contributors: jeff-dude, masquot, soispoke, hosuke config: - tags: [ 'ethereum', 'dex', 'trades', 'uniswap', 'v3' ] + tags: ["ethereum", "dex", "trades", "uniswap", "v3"] description: "uniswap ethereum v3 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -62,7 +62,6 @@ models: filter: version: 3 - - name: defiswap_ethereum_base_trades meta: blockchain: ethereum @@ -70,7 +69,7 @@ models: project: defiswap contributors: pandajackson42, 0xRob, hosuke config: - tags: [ 'ethereum', 'dex', 'trades', 'defiswap' ] + tags: ["ethereum", "dex", "trades", "defiswap"] description: "Defiswap ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -80,7 +79,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('defiswap_ethereum_base_trades_seed') - - name: airswap_ethereum_base_trades meta: blockchain: ethereum @@ -88,7 +86,7 @@ models: project: airswap contributors: hosuke, jeff-dude, ivigamberdiev, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'airswap' ] + tags: ["ethereum", "dex", "trades", "airswap"] description: "Defiswap ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -98,7 +96,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('airswap_ethereum_base_trades_seed') - - name: sushiswap_v1_ethereum_base_trades meta: blockchain: ethereum @@ -106,7 +103,7 @@ models: project: sushiswap contributors: pandajackson42, 0xRob, hosuke, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'sushiswap', 'v1' ] + tags: ["ethereum", "dex", "trades", "sushiswap", "v1"] description: "sushiswap ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -118,7 +115,6 @@ models: filter: version: 1 - - name: sushiswap_v2_ethereum_base_trades meta: blockchain: ethereum @@ -126,7 +122,7 @@ models: project: sushiswap contributors: pandajackson42, 0xRob, hosuke, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'sushiswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "sushiswap", "v2"] description: "sushiswap ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -138,7 +134,6 @@ models: filter: version: 2 - - name: carbon_defi_ethereum_base_trades meta: blockchain: ethereum @@ -146,7 +141,7 @@ models: project: carbon_defi contributors: tiagofilipenunes, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'carbon_defi' ] + tags: ["ethereum", "dex", "trades", "carbon_defi"] description: "Carbon_defi ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -156,7 +151,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('carbon_defi_ethereum_base_trades_seed') - - name: apeswap_ethereum_base_trades meta: blockchain: ethereum @@ -164,7 +158,7 @@ models: project: apeswap contributors: hosuke config: - tags: [ 'ethereum', 'dex', 'trades', 'apeswap' ] + tags: ["ethereum", "dex", "trades", "apeswap"] description: apeswap base trades tests: - dbt_utils.unique_combination_of_columns: @@ -181,7 +175,7 @@ models: project: pancakeswap contributors: chef_seaweed, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'pancakeswap', 'uniswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "pancakeswap", "uniswap", "v2"] description: "Pancakeswap Ethereum v2 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -202,7 +196,7 @@ models: project: shibaswap contributors: 0xRob, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'shibaswap', 'uniswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "shibaswap", "uniswap", "v2"] description: "sushiswap ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -221,7 +215,7 @@ models: project: pancakeswap contributors: chef_seaweed, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'pancakeswap', 'uniswap', 'v3' ] + tags: ["ethereum", "dex", "trades", "pancakeswap", "uniswap", "v3"] description: "Pancakeswap Ethereum v3 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -240,7 +234,7 @@ models: project: balancer contributors: bizzyvinci, thetroyharris, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'balancer' ] + tags: ["ethereum", "dex", "trades", "balancer"] description: "Balancer v1 ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -259,7 +253,7 @@ models: project: balancer contributors: bizzyvinci, thetroyharris, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'balancer' ] + tags: ["ethereum", "dex", "trades", "balancer"] description: "Balancer v2 ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -278,7 +272,7 @@ models: project: fraxswap contributors: kndlexi, tomfutago config: - tags: ['ethereum', 'dex', 'trades', 'fraxswap', 'uniswap', 'v2'] + tags: ["ethereum", "dex", "trades", "fraxswap", "uniswap", "v2"] description: "Fraxswap ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -297,7 +291,7 @@ models: project: bancor contributors: tian7, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'bancor' ] + tags: ["ethereum", "dex", "trades", "bancor"] description: "Bancor ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -314,7 +308,7 @@ models: project: verse_dex contributors: Henrystats, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'verse_dex' ] + tags: ["ethereum", "dex", "trades", "verse_dex"] description: "Verse ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -331,7 +325,7 @@ models: project: swapr contributors: cryptoleishen, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'swapr', 'uniswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "swapr", "uniswap", "v2"] description: "Verse ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -348,7 +342,7 @@ models: project: mauve contributors: jeff-dude, masquot, soispoke, raphaelr, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'mauve' ] + tags: ["ethereum", "dex", "trades", "mauve"] description: "Mauve ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -365,7 +359,7 @@ models: project: dfx contributors: Henrystats, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'dfx' ] + tags: ["ethereum", "dex", "trades", "dfx"] description: "DFX ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -382,7 +376,7 @@ models: project: dodo contributors: owen05, scoffie, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'dodo' ] + tags: ["ethereum", "dex", "trades", "dodo"] description: "Dodo ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -398,7 +392,6 @@ models: - 2_dpp - 2_dsp - - name: integral_ethereum_base_trades meta: blockchain: ethereum @@ -406,7 +399,7 @@ models: project: integral contributors: integralhq, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'integral', 'uniswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "integral", "uniswap", "v2"] description: "Integral ethereum v3 base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -416,7 +409,6 @@ models: - check_dex_base_trades_seed: seed_file: ref('integral_ethereum_base_trades_seed') - - name: maverick_ethereum_base_trades meta: blockchain: ethereum @@ -424,7 +416,7 @@ models: project: maverick contributors: get620v, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'maverick' ] + tags: ["ethereum", "dex", "trades", "maverick"] description: "Maverick ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -443,7 +435,7 @@ models: project: maverick contributors: get620v config: - tags: [ 'ethereum', 'dex', 'trades', 'maverick' ] + tags: ["ethereum", "dex", "trades", "maverick"] description: "Maverick ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -462,7 +454,7 @@ models: project: clipper contributors: 0xRob, amalashkevich, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'clipper' ] + tags: ["ethereum", "dex", "trades", "clipper"] description: "clipper ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -478,7 +470,6 @@ models: - 3 - 4 - - name: mstable_ethereum_base_trades meta: blockchain: ethereum @@ -486,7 +477,7 @@ models: project: mstable contributors: ripple3, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'mstable' ] + tags: ["ethereum", "dex", "trades", "mstable"] description: "mstable ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -507,7 +498,7 @@ models: project: kyberswap contributors: ppclunghe, gregshestakovlido, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'kyberswap', 'uniswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "kyberswap", "uniswap", "v2"] description: "kyberswap ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -529,7 +520,7 @@ models: project: xchange contributors: mike-x7f, tomfutago config: - tags: [ 'ethereum', 'dex', 'trades', 'xchange', 'uniswap', 'v2' ] + tags: ["ethereum", "dex", "trades", "xchange", "uniswap", "v2"] description: "xchange ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -539,15 +530,15 @@ models: - check_dex_base_trades_seed: seed_file: ref('xchange_ethereum_base_trades_seed') - - name: curvefi_ethereum_base_trades + - name: curve_ethereum_base_trades meta: blockchain: ethereum sector: dex - project: curvefi + project: curve contributors: dsalv, yulesa, ilemi, jeff-dude, tomfutago config: - tags: ['ethereum', 'dex', 'trades', 'curvefi'] - description: "Curvefi ethereum base trades" + tags: ["ethereum", "dex", "trades", "curve"] + description: "Curve ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -571,7 +562,7 @@ models: project: solidly contributors: SolidlyLabs config: - tags: [ 'ethereum', 'dex', 'trades', 'solidly' ] + tags: ["ethereum", "dex", "trades", "solidly"] description: "solidly v3 ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -588,7 +579,7 @@ models: project: swaap contributors: borelien config: - tags: [ 'ethereum', 'dex', 'trades', 'swaap', 'v2'] + tags: ["ethereum", "dex", "trades", "swaap", "v2"] description: "swaap v2 ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: @@ -599,3 +590,18 @@ models: seed_file: ref('swaap_ethereum_base_trades_seed') filter: version: 2 + + - name: valantis_hot_ethereum_base_trades + meta: + blockchain: ethereum + sector: dex + project: valantis + contributors: 0xrusowsky + config: + tags: ["ethereum", "dex", "trades", "valantis", "arrakis", "hot"] + description: "hot-amm ethereum base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index diff --git a/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql b/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql index 45260e99033..ef761a7d922 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql @@ -34,9 +34,10 @@ , ref('clipper_ethereum_base_trades') , ref('mstable_ethereum_base_trades') , ref('xchange_ethereum_base_trades') - , ref('curvefi_ethereum_base_trades') + , ref('curve_ethereum_base_trades') , ref('solidly_v3_ethereum_base_trades') , ref('swaap_v2_ethereum_base_trades') + , ref('valantis_hot_ethereum_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/ethereum/platforms/curvefi_ethereum_base_trades.sql b/dbt_subprojects/dex/models/trades/ethereum/platforms/curve_ethereum_base_trades.sql similarity index 97% rename from dbt_subprojects/dex/models/trades/ethereum/platforms/curvefi_ethereum_base_trades.sql rename to dbt_subprojects/dex/models/trades/ethereum/platforms/curve_ethereum_base_trades.sql index e39c3c48265..74d36ba14bf 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/platforms/curvefi_ethereum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/ethereum/platforms/curve_ethereum_base_trades.sql @@ -1,6 +1,6 @@ {{ config( - schema = 'curvefi_ethereum', + schema = 'curve_ethereum', alias = 'base_trades', materialized = 'incremental', file_format = 'delta', @@ -51,7 +51,7 @@ WITH dexs AS , l.tx_hash , l.index as evt_index FROM {{ source('ethereum', 'logs') }} l - JOIN {{ ref('curvefi_ethereum_view_pools') }} p + JOIN {{ ref('curve_ethereum_view_pools') }} p ON l.contract_address = p.pool_address AND p.version IN ('Factory V1 Meta', 'Factory V1 Plain', 'Regular', 'Factory V1 Stableswap Plain', 'Factory V1 Stableswap Meta', 'Factory V1 Stableswap Plain NG') --note Plain only has TokenExchange. WHERE l.topic0 IN @@ -82,7 +82,7 @@ WITH dexs AS , l.tx_hash , l.index as evt_index FROM {{ source('ethereum', 'logs') }} l - JOIN {{ ref('curvefi_ethereum_view_pools') }} p + JOIN {{ ref('curve_ethereum_view_pools') }} p ON l.contract_address = p.pool_address AND (p.version = 'Factory V2' or p.version = 'Factory V2 updated' or p.version = 'Regular' or p.version = 'Factory Twocrypto') --some Regular pools are new and use the below topic instead WHERE (l.topic0 = 0xb2e76ae99761dc136e598d4a629bb347eccb9532a5f8bbd72e18467c3c34cc98 --TokenExchange diff --git a/dbt_subprojects/dex/models/trades/ethereum/platforms/dodo_ethereum_base_trades.sql b/dbt_subprojects/dex/models/trades/ethereum/platforms/dodo_ethereum_base_trades.sql index 12ad69bdead..6797ecffdd9 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/platforms/dodo_ethereum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/ethereum/platforms/dodo_ethereum_base_trades.sql @@ -11,7 +11,7 @@ }} {% set config_markets %} - WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS + WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS ( VALUES (0x75c23271661d9d143dcb617222bc4bec783eff34, 'WETH', 'USDC', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48), @@ -36,9 +36,9 @@ {% set config_other_sources = [ - {'version': '2_dvm', 'source': 'DVM_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPP_evt_DODOSwap'}, - {'version': '2_dsp', 'source': 'DSP_evt_DODOSwap'}, + {'version': '2', 'source': 'DVM_evt_DODOSwap'}, + {'version': '2', 'source': 'DPP_evt_DODOSwap'}, + {'version': '2', 'source': 'DSP_evt_DODOSwap'}, ] %} diff --git a/dbt_subprojects/dex/models/trades/ethereum/platforms/pancakeswap_v2_ethereum_base_trades.sql b/dbt_subprojects/dex/models/trades/ethereum/platforms/pancakeswap_v2_ethereum_base_trades.sql index dbd16edafe3..7ab786f47ad 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/platforms/pancakeswap_v2_ethereum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/ethereum/platforms/pancakeswap_v2_ethereum_base_trades.sql @@ -25,7 +25,7 @@ dexs_macro AS ( }} ), -dexs AS ( +dexs_mm AS ( -- PancakeSwap v2 MMPool SELECT 'mmpool' AS version, @@ -46,8 +46,33 @@ dexs AS ( {% if is_incremental() %} WHERE {{ incremental_predicate('t.evt_block_time') }} {% endif %} +), + +dexs_ss AS ( + -- PancakeSwap v2 stableswap + SELECT + 'stableswap' AS version, + t.evt_block_number AS block_number, + t.evt_block_time AS block_time, + t.buyer AS taker, + CAST(NULL AS VARBINARY) AS maker, + tokens_bought AS token_bought_amount_raw, + tokens_sold AS token_sold_amount_raw, + CASE WHEN bought_id = UINT256 '0' THEN f.tokenA ELSE f.tokenB END AS token_bought_address, + CASE WHEN bought_id = UINT256 '0' THEN f.tokenB ELSE f.tokenA END AS token_sold_address, + t.contract_address AS project_contract_address, + t.evt_tx_hash AS tx_hash, + t.evt_index + FROM {{ source('pancakeswap_v2_ethereum', 'PancakeStableSwapTwoPool_evt_TokenExchange') }} t + INNER JOIN {{ source('pancakeswap_v2_ethereum', 'PancakeStableSwapFactory_evt_NewStableSwapPair') }} f + ON t.contract_address = f.swapContract + {% if is_incremental() %} + WHERE {{ incremental_predicate('t.evt_block_time') }} + {% endif %} ) + + SELECT dexs_macro.blockchain, dexs_macro.project, @@ -70,18 +95,37 @@ UNION ALL SELECT 'ethereum' AS blockchain, 'pancakeswap' AS project, - dexs.version, - 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 -FROM dexs + dexs_mm.version, + CAST(date_trunc('month', dexs_mm.block_time) AS date) AS block_month, + CAST(date_trunc('day', dexs_mm.block_time) AS date) AS block_date, + dexs_mm.block_time, + dexs_mm.block_number, + dexs_mm.token_bought_amount_raw, + dexs_mm.token_sold_amount_raw, + dexs_mm.token_bought_address, + dexs_mm.token_sold_address, + dexs_mm.taker, + dexs_mm.maker, + dexs_mm.project_contract_address, + dexs_mm.tx_hash, + dexs_mm.evt_index +FROM dexs_mm +UNION ALL +SELECT + 'ethereum' AS blockchain, + 'pancakeswap' AS project, + dexs_ss.version, + CAST(date_trunc('month', dexs_ss.block_time) AS date) AS block_month, + CAST(date_trunc('day', dexs_ss.block_time) AS date) AS block_date, + dexs_ss.block_time, + dexs_ss.block_number, + dexs_ss.token_bought_amount_raw, + dexs_ss.token_sold_amount_raw, + dexs_ss.token_bought_address, + dexs_ss.token_sold_address, + dexs_ss.taker, + dexs_ss.maker, + dexs_ss.project_contract_address, + dexs_ss.tx_hash, + dexs_ss.evt_index +FROM dexs_ss diff --git a/dbt_subprojects/dex/models/trades/ethereum/platforms/valantis_hot_ethereum_base_trades.sql b/dbt_subprojects/dex/models/trades/ethereum/platforms/valantis_hot_ethereum_base_trades.sql new file mode 100644 index 00000000000..ce491f4d00f --- /dev/null +++ b/dbt_subprojects/dex/models/trades/ethereum/platforms/valantis_hot_ethereum_base_trades.sql @@ -0,0 +1,21 @@ +{{ config( + schema = 'valantis_hot_ethereum' + , alias = 'base_trades' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['tx_hash', 'evt_index'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + valantis_compatible_hot_trades( + blockchain = 'ethereum', + project = 'valantis', + version = 'hot', + HOT_evt_Swap = source('valantis_ethereum', 'HOT_evt_HotSwap'), + Pair_evt_Swap = source('valantis_ethereum', 'SovereignPool_evt_Swap'), + Factory_evt_PoolCreated = source('valantis_ethereum', 'ProtocolFactory_evt_SovereignPoolDeployed') + ) +}} diff --git a/dbt_subprojects/dex/models/trades/linea/_schema.yml b/dbt_subprojects/dex/models/trades/linea/_schema.yml index 8b48bffa0ef..ca6d1a539d8 100644 --- a/dbt_subprojects/dex/models/trades/linea/_schema.yml +++ b/dbt_subprojects/dex/models/trades/linea/_schema.yml @@ -185,3 +185,22 @@ models: seed_file: ref('lynex_linea_base_trades_seed') filter: version: fusion + + - name: swaap_v2_linea_base_trades + meta: + blockchain: linea + sector: dex + project: swaap + contributors: borelien + config: + tags: [ 'linea', 'dex', 'trades', 'swaap', 'v2'] + description: "swaap v2 linea base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('swaap_linea_base_trades_seed') + filter: + version: 2 \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/linea/dex_linea_base_trades.sql b/dbt_subprojects/dex/models/trades/linea/dex_linea_base_trades.sql index 400e9652255..91a1319c8fb 100644 --- a/dbt_subprojects/dex/models/trades/linea/dex_linea_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/linea/dex_linea_base_trades.sql @@ -15,6 +15,7 @@ , ref('horizondex_linea_base_trades') , ref('uniswap_v3_linea_base_trades') , ref('lynex_fusion_linea_base_trades') + , ref('swaap_v2_linea_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/linea/platforms/swaap_v2_linea_base_trades.sql b/dbt_subprojects/dex/models/trades/linea/platforms/swaap_v2_linea_base_trades.sql new file mode 100644 index 00000000000..f75320a1266 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/linea/platforms/swaap_v2_linea_base_trades.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'swaap_v2_linea', + alias ='base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + swaap_v2_compatible_trades( + blockchain = 'linea', + project = 'swaap', + version = '2' + ) +}} diff --git a/dbt_subprojects/dex/models/trades/mantle/_schema.yml b/dbt_subprojects/dex/models/trades/mantle/_schema.yml index 0c2924742dc..86c6536f517 100644 --- a/dbt_subprojects/dex/models/trades/mantle/_schema.yml +++ b/dbt_subprojects/dex/models/trades/mantle/_schema.yml @@ -21,3 +21,56 @@ models: - evt_index - check_dex_base_trades_seed: seed_file: ref('merchant_moe_mantle_base_trades_seed') + + - name: fusionx_mantle_base_trades + meta: + blockchain: mantle + sector: dex + project: fusionx + contributors: hosuke + config: + tags: [ 'mantle', 'dex', 'trades', 'fusionx' ] + description: "FusionX Finance mantle base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('fusionx_mantle_base_trades_seed') + + - name: agni_mantle_base_trades + meta: + blockchain: mantle + sector: dex + project: agni + contributors: hosuke + config: + tags: [ 'mantle', 'dex', 'trades', 'agni' ] + description: "AGNI Finance mantle base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('agni_mantle_base_trades_seed') + + - name: swaap_v2_mantle_base_trades + meta: + blockchain: mantle + sector: dex + project: swaap + contributors: borelien + config: + tags: [ 'mantle', 'dex', 'trades', 'swaap', 'v2'] + description: "swaap v2 mantle base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('swaap_mantle_base_trades_seed') + filter: + version: 2 \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/mantle/dex_mantle_base_trades.sql b/dbt_subprojects/dex/models/trades/mantle/dex_mantle_base_trades.sql index 972bbb817ce..eeb0771d423 100644 --- a/dbt_subprojects/dex/models/trades/mantle/dex_mantle_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/mantle/dex_mantle_base_trades.sql @@ -7,6 +7,9 @@ {% set base_models = [ ref('merchant_moe_mantle_base_trades') + , ref('fusionx_mantle_base_trades') + , ref('agni_mantle_base_trades') + , ref('swaap_v2_mantle_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/mantle/platforms/agni_mantle_base_trades.sql b/dbt_subprojects/dex/models/trades/mantle/platforms/agni_mantle_base_trades.sql new file mode 100644 index 00000000000..834392d0f71 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/mantle/platforms/agni_mantle_base_trades.sql @@ -0,0 +1,35 @@ +{{ + config( + schema = 'agni_mantle', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +WITH pools AS ( + SELECT DISTINCT + f.output_pool AS pool + , token0 + , token1 + FROM {{ source('agni_mantle', 'AgniPoolDeployer_call_deploy') }} f +) + +, dexs AS ( + {{ + uniswap_compatible_v3_trades( + blockchain = 'mantle' + , project = 'agni' + , version = '3' + , Pair_evt_Swap = source('agni_mantle', 'AgniPool_evt_Swap') + , Factory_evt_PoolCreated = 'pools' + , optional_columns = null + ) + }} +) + +SELECT * +FROM dexs \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/mantle/platforms/fusionx_mantle_base_trades.sql b/dbt_subprojects/dex/models/trades/mantle/platforms/fusionx_mantle_base_trades.sql new file mode 100644 index 00000000000..a4c5009c262 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/mantle/platforms/fusionx_mantle_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'fusionx_mantle', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_compatible_v3_trades( + blockchain = 'mantle' + , project = 'fusionx' + , version = '3' + , Pair_evt_Swap = source('fusionx_mantle', 'FusionXV3Pool_evt_Swap') + , Factory_evt_PoolCreated = source('fusionx_mantle', 'FusionXV3Factory_evt_PoolCreated') + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/mantle/platforms/swaap_v2_mantle_base_trades.sql b/dbt_subprojects/dex/models/trades/mantle/platforms/swaap_v2_mantle_base_trades.sql new file mode 100644 index 00000000000..c177e1ded78 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/mantle/platforms/swaap_v2_mantle_base_trades.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'swaap_v2_mantle', + alias ='base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + swaap_v2_compatible_trades( + blockchain = 'mantle', + project = 'swaap', + version = '2' + ) +}} diff --git a/dbt_subprojects/dex/models/trades/nova/_schema.yml b/dbt_subprojects/dex/models/trades/nova/_schema.yml new file mode 100644 index 00000000000..f29daef5f02 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/nova/_schema.yml @@ -0,0 +1,40 @@ +version: 2 + +models: + - name: dex_nova_base_trades + tests: + - check_dex_info_relationship + + - name: sushiswap_nova_base_trades + meta: + blockchain: nova + sector: dex + project: sushiswap + contributors: hosuke + config: + tags: [ 'nova', 'dex', 'trades', 'sushiswap' ] + description: "sushiswap nova base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('sushiswap_nova_base_trades_seed') + + - name: rcpswap_nova_base_trades + meta: + blockchain: nova + sector: dex + project: rcpswap + contributors: hosuke + config: + tags: [ 'nova', 'dex', 'trades', 'rcpswap' ] + description: "rcpswap nova base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('rcpswap_nova_base_trades_seed') \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/nova/dex_nova_base_trades.sql b/dbt_subprojects/dex/models/trades/nova/dex_nova_base_trades.sql new file mode 100644 index 00000000000..e0915dcd13a --- /dev/null +++ b/dbt_subprojects/dex/models/trades/nova/dex_nova_base_trades.sql @@ -0,0 +1,49 @@ +{{ config( + schema = 'dex_nova' + , alias = 'base_trades' + , materialized = 'view' + ) +}} + +{% set base_models = [ + ref('sushiswap_nova_base_trades') + , ref('rcpswap_nova_base_trades') +] %} + +WITH base_union AS ( + SELECT * + FROM ( + {% for base_model in base_models %} + SELECT + 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 + FROM + {{ base_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} + ) +) + +{{ + add_tx_columns( + model_cte = 'base_union' + , blockchain = 'nova' + , columns = ['from', 'to', 'index'] + ) +}} diff --git a/dbt_subprojects/dex/models/trades/nova/platforms/rcpswap_nova_base_trades.sql b/dbt_subprojects/dex/models/trades/nova/platforms/rcpswap_nova_base_trades.sql new file mode 100644 index 00000000000..bd0db865438 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/nova/platforms/rcpswap_nova_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'rcpswap_nova', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_compatible_v2_trades( + blockchain = 'nova', + project = 'rcpswap', + version = '2', + Pair_evt_Swap = source('rcpswap_nova', 'swappair_evt_swap'), + Factory_evt_PairCreated = source('rcpswap_nova', 'swapfactory_evt_paircreated') + ) +}} diff --git a/dbt_subprojects/dex/models/trades/nova/platforms/sushiswap_nova_base_trades.sql b/dbt_subprojects/dex/models/trades/nova/platforms/sushiswap_nova_base_trades.sql new file mode 100644 index 00000000000..b656eb5a75b --- /dev/null +++ b/dbt_subprojects/dex/models/trades/nova/platforms/sushiswap_nova_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'sushiswap_nova', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + uniswap_compatible_v2_trades( + blockchain = 'nova', + project = 'sushiswap', + version = '1', + Pair_evt_Swap = source('sushi_nova', 'uniswapv2pair_evt_swap'), + Factory_evt_PairCreated = source('sushi_nova', 'uniswapv2factory_evt_paircreated') + ) +}} diff --git a/dbt_subprojects/dex/models/trades/optimism/_schema.yml b/dbt_subprojects/dex/models/trades/optimism/_schema.yml index 79c68fd08c4..9963700f4bc 100644 --- a/dbt_subprojects/dex/models/trades/optimism/_schema.yml +++ b/dbt_subprojects/dex/models/trades/optimism/_schema.yml @@ -382,15 +382,15 @@ models: seed_file: ref('rubicon_optimism_base_trades_seed') - - name: curvefi_optimism_base_trades + - name: curve_optimism_base_trades meta: blockchain: optimism sector: dex - project: curvefi + project: curve contributors: msilb7, tomfutago config: - tags: ['optimism', 'dex', 'trades', 'curvefi'] - description: "Curvefi optimism base trades" + tags: ['optimism', 'dex', 'trades', 'curve'] + description: "Curve optimism base trades" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: diff --git a/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql index c14490e2149..f81d356fac8 100644 --- a/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql @@ -24,7 +24,7 @@ , ref('openxswap_optimism_base_trades') , ref('openocean_optimism_base_trades') , ref('chainhop_optimism_base_trades') - , ref('curvefi_optimism_base_trades') + , ref('curve_optimism_base_trades') , ref('rubicon_optimism_base_trades') , ref('gridex_optimism_base_trades') , ref('solidly_v3_optimism_base_trades') diff --git a/dbt_subprojects/dex/models/trades/optimism/platforms/curvefi_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/platforms/curve_optimism_base_trades.sql similarity index 96% rename from dbt_subprojects/dex/models/trades/optimism/platforms/curvefi_optimism_base_trades.sql rename to dbt_subprojects/dex/models/trades/optimism/platforms/curve_optimism_base_trades.sql index 8979457ec41..bae80bd53a3 100644 --- a/dbt_subprojects/dex/models/trades/optimism/platforms/curvefi_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/platforms/curve_optimism_base_trades.sql @@ -1,6 +1,6 @@ {{ config( - schema = 'curvefi_optimism', + schema = 'curve_optimism', alias = 'base_trades', materialized = 'incremental', file_format = 'delta', @@ -10,7 +10,7 @@ ) }} --- This should depend on 'curvefi_optimism_pools' running first +-- This should depend on 'curve_optimism_pools' running first -- Original Ref - Dune v1 Abstraction: https://github.com/duneanalytics/spellbook/blob/main/deprecated-dune-v1-abstractions/optimism2/dex/insert_curve.sql -- Start Time -- SELECT MIN(evt_block_time) FROM curvefi_optimism.StableSwap_evt_TokenExchange @@ -152,10 +152,10 @@ SELECT AND {{ incremental_predicate('t.evt_block_time') }} {% endif %} ) cp - INNER JOIN {{ ref('curvefi_optimism_pools') }} ta + INNER JOIN {{ ref('curve_optimism_pools') }} ta ON cp.project_contract_address = ta.pool AND cp.bought_id = ta.tokenid - INNER JOIN {{ ref('curvefi_optimism_pools') }} tb + INNER JOIN {{ ref('curve_optimism_pools') }} tb ON cp.project_contract_address = tb.pool AND cp.sold_id = tb.tokenid ) diff --git a/dbt_subprojects/dex/models/trades/optimism/platforms/dodo_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/platforms/dodo_optimism_base_trades.sql index 963fe864eb3..50edd7dcc3c 100644 --- a/dbt_subprojects/dex/models/trades/optimism/platforms/dodo_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/platforms/dodo_optimism_base_trades.sql @@ -12,9 +12,9 @@ {% set config_other_sources = [ - {'version': '2_dvm', 'source': 'DVM_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPP_evt_DODOSwap'}, - {'version': '2_dsp', 'source': 'DSP_evt_DODOSwap'}, + {'version': '2', 'source': 'DVM_evt_DODOSwap'}, + {'version': '2', 'source': 'DPP_evt_DODOSwap'}, + {'version': '2', 'source': 'DSP_evt_DODOSwap'}, ] %} diff --git a/dbt_subprojects/dex/models/trades/polygon/platforms/dodo_polygon_base_trades.sql b/dbt_subprojects/dex/models/trades/polygon/platforms/dodo_polygon_base_trades.sql index 19dd0fbd455..1fc67b7952b 100644 --- a/dbt_subprojects/dex/models/trades/polygon/platforms/dodo_polygon_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/polygon/platforms/dodo_polygon_base_trades.sql @@ -11,7 +11,7 @@ }} {% set config_markets %} - WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS + WITH dodo_view_markets (market_contract_address, base_token_symbol, quote_token_symbol, base_token_address, quote_token_address) AS ( VALUES (0x813fddeccd0401c4fa73b092b074802440544e52, 'USDC', 'USDT', 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174, 0xc2132D05D31c914a87C6611C10748AEb04B58e8F) @@ -21,11 +21,11 @@ {% set config_other_sources = [ - {'version': '2_dvm', 'source': 'DVM_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPP_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPPAdvanced_evt_DODOSwap'}, - {'version': '2_dpp', 'source': 'DPPOracle_evt_DODOSwap'}, - {'version': '2_dsp', 'source': 'DSP_evt_DODOSwap'}, + {'version': '2', 'source': 'DVM_evt_DODOSwap'}, + {'version': '2', 'source': 'DPP_evt_DODOSwap'}, + {'version': '2', 'source': 'DPPAdvanced_evt_DODOSwap'}, + {'version': '2', 'source': 'DPPOracle_evt_DODOSwap'}, + {'version': '2', 'source': 'DSP_evt_DODOSwap'}, ] %} diff --git a/dbt_subprojects/dex/models/trades/readme.md b/dbt_subprojects/dex/models/trades/readme.md index 28aca882ad7..2dd50accca9 100644 --- a/dbt_subprojects/dex/models/trades/readme.md +++ b/dbt_subprojects/dex/models/trades/readme.md @@ -1,6 +1,6 @@ # README for `dex.trades` -Welcome to the `models/_sector/dex/` directory of our project. This README provides essential information on contributing to the `dex` sector models, insights into our design choices, and outlines the next steps in the `dex.trades` redesign workstream. +Welcome to the `dbt_subprojects/dex` directory of our project. This README provides essential information on contributing to the `dex` sector models, insights into our design choices, and outlines the next steps in the `dex.trades` redesign workstream. ## Table of Contents @@ -58,8 +58,8 @@ Adoption of the `base_` prefix for table aliases and `uniswap_` for macro names. ### Directory Structure -- Macros/Models: `macros/models/_sector/dex/` -- Platforms: `models/_sector/dex/trades//platforms/` +- Macros/Models: `dbt_subprojects/dex/macros/` +- Platforms: `dbt_subprojects/dex/models/trades//platforms/` ### Materialization Strategy @@ -109,7 +109,7 @@ When incorporating new data sources into the `dex` sector, it's essential to pro For each model in the DEX sector, we must define its schema. This schema outlines the structure of the model and the definitions of its columns. Here’s how to add a schema for a model: -1. **Locate the Schema YML File**: Go to `models/_sector/dex/trades/[blockchain]` in the project directory. +1. **Locate the Schema YML File**: Go to `dbt_subprojects/dex/models/trades/[blockchain]` in the project directory. 2. **Edit the `_schema.yml` File**: Add the schema definition for your model. This includes specifying column names, types, descriptions, and any tests that should be applied to the columns. For example: @@ -162,7 +162,7 @@ Example config block: ## Dependency on dex.info -It's crucial to add a corresponding entry in [`dex.info`](/models/dex/dex_info.sql) when adding a new `dex`. +It's crucial to add a corresponding entry in [`dex.info`](/dbt_subprojects/dex/models/dex_info.sql) when adding a new `dex`. Sample new entry: @@ -176,7 +176,7 @@ Seed tests are vital for ensuring that the output of our models aligns with the ### Define the Seed Schema -Start by defining the schema of your seed in the [seeds/\_sector/dex/\_schema.yml](/seeds/_sector/dex/_schema.yml) file. +Start by defining the schema of your seed in the [dbt_subprojects/dex/seeds/trades/\_schema.yml](/dbt_subprojects/dex/seeds/trades/_schema.yml) file. eg. ```yaml @@ -198,7 +198,7 @@ eg. ### Add the Corresponding Seed File -Create and add the seed file in the [seeds/\_sector/dex/](/seeds/_sector/dex) directory. This file should contain the trades that verified on the blockchain explorers. +Create and add the seed file in the [dbt_subprojects/dex/seeds/trades/](/dbt_subprojects/dex/seeds/trades) directory. This file should contain the trades that verified on the blockchain explorers. ### Add Tests to Model Schema diff --git a/dbt_subprojects/dex/models/trades/scroll/_schema.yml b/dbt_subprojects/dex/models/trades/scroll/_schema.yml index 60322861f98..b24931e4198 100644 --- a/dbt_subprojects/dex/models/trades/scroll/_schema.yml +++ b/dbt_subprojects/dex/models/trades/scroll/_schema.yml @@ -157,5 +157,24 @@ models: - evt_index - check_dex_base_trades_seed: seed_file: ref('maverick_scroll_base_trades_seed') + filter: + version: 2 + + - name: swaap_v2_scroll_base_trades + meta: + blockchain: scroll + sector: dex + project: swaap + contributors: borelien + config: + tags: [ 'scroll', 'dex', 'trades', 'swaap', 'v2'] + description: "swaap v2 scroll base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('swaap_scroll_base_trades_seed') filter: version: 2 \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/scroll/dex_scroll_base_trades.sql b/dbt_subprojects/dex/models/trades/scroll/dex_scroll_base_trades.sql index 96e9b9c788d..b06767ea83a 100644 --- a/dbt_subprojects/dex/models/trades/scroll/dex_scroll_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/scroll/dex_scroll_base_trades.sql @@ -15,6 +15,7 @@ , ref('iziswap_scroll_base_trades') , ref('icecreamswap_v2_scroll_base_trades') , ref('maverick_v2_scroll_base_trades') + , ref('swaap_v2_scroll_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/scroll/platforms/swaap_v2_scroll_base_trades.sql b/dbt_subprojects/dex/models/trades/scroll/platforms/swaap_v2_scroll_base_trades.sql new file mode 100644 index 00000000000..d443c11fe0b --- /dev/null +++ b/dbt_subprojects/dex/models/trades/scroll/platforms/swaap_v2_scroll_base_trades.sql @@ -0,0 +1,19 @@ +{{ + config( + schema = 'swaap_v2_scroll', + alias ='base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + swaap_v2_compatible_trades( + blockchain = 'scroll', + project = 'swaap', + version = '2' + ) +}} diff --git a/dbt_subprojects/dex/models/trades/zkevm/_schema.yml b/dbt_subprojects/dex/models/trades/zkevm/_schema.yml index 32841e2bf2a..559d51bdb6d 100644 --- a/dbt_subprojects/dex/models/trades/zkevm/_schema.yml +++ b/dbt_subprojects/dex/models/trades/zkevm/_schema.yml @@ -56,4 +56,23 @@ models: - check_dex_base_trades_seed: seed_file: ref('pancakeswap_zkevm_base_trades_seed') filter: - version: 3 \ No newline at end of file + version: 3 + + - name: clipper_zkevm_base_trades + meta: + blockchain: zkevm + sector: dex + project: clipper + contributors: amalashkevich, 0xTemo + config: + tags: [ 'zkevm', 'dex', 'trades', 'clipper' ] + description: "Clipper zkevm base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('clipper_zkevm_base_trades_seed') + filter: + version: 1 \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/zkevm/dex_zkevm_base_trades.sql b/dbt_subprojects/dex/models/trades/zkevm/dex_zkevm_base_trades.sql index 8162690b9dd..7f97408c887 100644 --- a/dbt_subprojects/dex/models/trades/zkevm/dex_zkevm_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/zkevm/dex_zkevm_base_trades.sql @@ -9,6 +9,7 @@ ref('balancer_v2_zkevm_base_trades') , ref('pancakeswap_v2_zkevm_base_trades') , ref('pancakeswap_v3_zkevm_base_trades') + , ref('clipper_zkevm_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/zkevm/platforms/clipper_zkevm_base_trades.sql b/dbt_subprojects/dex/models/trades/zkevm/platforms/clipper_zkevm_base_trades.sql new file mode 100644 index 00000000000..7bf996dff33 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/zkevm/platforms/clipper_zkevm_base_trades.sql @@ -0,0 +1,25 @@ +{{ + config( + schema = 'clipper_zkevm', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{% + set config_sources = [ + {'version': '1', 'source': 'ClipperPackedOracleVerifiedExchange_evt_Swapped'}, + ] +%} + +{{ + clipper_compatible_trades( + blockchain = 'zkevm', + project = 'clipper', + sources = config_sources + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/package-lock.yml b/dbt_subprojects/dex/package-lock.yml index 709885d7a0b..52ef96dcd2e 100644 --- a/dbt_subprojects/dex/package-lock.yml +++ b/dbt_subprojects/dex/package-lock.yml @@ -1,4 +1,4 @@ packages: - package: dbt-labs/dbt_utils - version: 1.2.0 -sha1_hash: eb1031c07e7c89332527e572f2e44613ce5b62bf + version: 1.3.0 +sha1_hash: 226ae69cdfbc9367e2aa2c472b01f99dbce11de0 diff --git a/dbt_subprojects/dex/packages.yml b/dbt_subprojects/dex/packages.yml index d4f9f38e076..ff9ca2cf98a 100644 --- a/dbt_subprojects/dex/packages.yml +++ b/dbt_subprojects/dex/packages.yml @@ -1,3 +1,3 @@ packages: - package: dbt-labs/dbt_utils - version: 1.2.0 \ No newline at end of file + version: 1.3.0 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/_project/zeroex/linea/_schema.yml b/dbt_subprojects/dex/seeds/_project/zeroex/linea/_schema.yml new file mode 100644 index 00000000000..5d65da08e6b --- /dev/null +++ b/dbt_subprojects/dex/seeds/_project/zeroex/linea/_schema.yml @@ -0,0 +1,11 @@ +version: 2 + +seeds: + - name: zeroex_linea_settler_trades_sample + config: + column_types: + tx_hash: varbinary + taker: varbinary + taker_token: varbinary + maker_token: varbinary + taker_token_amount: double \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/_project/zeroex/linea/zeroex_linea_settler_trades_sample.csv b/dbt_subprojects/dex/seeds/_project/zeroex/linea/zeroex_linea_settler_trades_sample.csv new file mode 100644 index 00000000000..6760f03e395 --- /dev/null +++ b/dbt_subprojects/dex/seeds/_project/zeroex/linea/zeroex_linea_settler_trades_sample.csv @@ -0,0 +1,2 @@ +tx_hash,taker,taker_token,maker_token,taker_token_amount +0xfd32094a40aea663ed1662833709c1c3590989607abf99e70a18f5740c8fd043,0x4ea754349ace5303c82f0d1d491041e042f2ad22,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,0xa219439258ca9da29e9cc4ce5596924745e12b93,0.000745504333903425 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/_project/zeroex/scroll/_schema.yml b/dbt_subprojects/dex/seeds/_project/zeroex/scroll/_schema.yml new file mode 100644 index 00000000000..db87da2f1c3 --- /dev/null +++ b/dbt_subprojects/dex/seeds/_project/zeroex/scroll/_schema.yml @@ -0,0 +1,11 @@ +version: 2 + +seeds: + - name: zeroex_scroll_settler_trades_sample + config: + column_types: + tx_hash: varbinary + taker: varbinary + taker_token: varbinary + maker_token: varbinary + taker_token_amount: double \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/_project/zeroex/scroll/zeroex_scroll_settler_trades_sample.csv b/dbt_subprojects/dex/seeds/_project/zeroex/scroll/zeroex_scroll_settler_trades_sample.csv new file mode 100644 index 00000000000..f802430aa67 --- /dev/null +++ b/dbt_subprojects/dex/seeds/_project/zeroex/scroll/zeroex_scroll_settler_trades_sample.csv @@ -0,0 +1,2 @@ +tx_hash,taker,taker_token,maker_token,taker_token_amount +0xa12012ea857c8ae2ce43ee0da243389f6621d72ef1442443f7656ca2ec70aa0d,0x4ea754349ace5303c82f0d1d491041e042f2ad22,0x5300000000000000000000000000000000000004,0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4,0.000826625353833232 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/_project/zeroex/zeroex_api_fills_sample.csv b/dbt_subprojects/dex/seeds/_project/zeroex/zeroex_api_fills_sample.csv index 50fe18c25dc..4cf5ee3f8b7 100644 --- a/dbt_subprojects/dex/seeds/_project/zeroex/zeroex_api_fills_sample.csv +++ b/dbt_subprojects/dex/seeds/_project/zeroex/zeroex_api_fills_sample.csv @@ -1,11 +1,11 @@ volume_usd,block_date,block_time,blockchain,evt_index,maker,taker,maker_symbol,token_pair,taker_token,taker_token_amount,taker_symbol,trace_address,tx_from,tx_hash,tx_to,maker_token,maker_token_amount,version,maker_token_amount_raw 10446.658948584456,2023-04-04,2023-04-04 20:36:35.000 UTC,ethereum,18,0x00000012556e6973776170563300000000000000,0xc6c7565644ea1893ad29182f7b6961aab7edfed0,DAI,DAI-WETH,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,,WETH,[],0xc6c7565644ea1893ad29182f7b6961aab7edfed0,0x222a3c1bfeb298fe4d70f56d635f8b750fa58395c86b699b08ef871dc8513e76,0xa88800cd213da5ae406ce248380802bd53b47647,0x307836623137353437346538393039346334346461393862393534656564656163343935323731643066,10445.844172738982,,10445844172738981554467 779.9870676321608,2023-04-04,2023-04-04 20:19:47.000 UTC,ethereum,68,0xbaec0e18c770993ffb1175fef493b5113cc6e32d,0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,WETH,ILV-WETH,0x307837363766653965646339653064663938653037343534383437393039623565393539643763613065,13.264759162139244,ILV,[],0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,0xa60ff895b5aaafa93ac7d2af68d0fec2651750a001db6f1d06a98302c9047003,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.41726604234366216,,4.1726604234366214E17 -779.9870676321608,2023-04-04,2023-04-04 20:19:47.000 UTC,ethereum,71,0xe3baa96ad46457d9e6cdd4e32abc11e2c124ec49,0xe66b31678d6c16e9ebf358268a790b763c133750,MATIC,MATIC-WETH,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.41726604234366216,WETH,[],0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,0xa60ff895b5aaafa93ac7d2af68d0fec2651750a001db6f1d06a98302c9047003,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307837643161666137623731386662383933646233306133616263306366633630386161636665626230,,,6.83415110457315E20 -69.29769365372037,2023-04-04,2023-04-04 20:18:59.000 UTC,ethereum,47,0xc0d776e2223c9a2ad13433dab7ec08cb9c5e76ae,0xe66b31678d6c16e9ebf358268a790b763c133750,XEN,WETH-XEN,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.03707186384796305,WETH,[],0x52f64a96f9b9cfdd642148754fa2d37d3a902574,0x9b12676bc92f104a029c42f660e98501e621f4d1df5370ab0ae8847cfbd1ee87,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307830363435306465653766643266623865333930363134333462616263666330353539396136666238,2.028292203781448e+07,,2.028292203781448E25 +779.9870676321608,2023-04-04,2023-04-04 20:19:47.000 UTC,ethereum,71,0xe3baa96ad46457d9e6cdd4e32abc11e2c124ec49,0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,MATIC,MATIC-WETH,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.41726604234366216,WETH,[],0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,0xa60ff895b5aaafa93ac7d2af68d0fec2651750a001db6f1d06a98302c9047003,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307837643161666137623731386662383933646233306133616263306366633630386161636665626230,,,6.83415110457315E20 +69.29769365372037,2023-04-04,2023-04-04 20:18:59.000 UTC,ethereum,47,0xc0d776e2223c9a2ad13433dab7ec08cb9c5e76ae,0x52f64a96f9b9cfdd642148754fa2d37d3a902574,XEN,WETH-XEN,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.03707186384796305,WETH,[],0x52f64a96f9b9cfdd642148754fa2d37d3a902574,0x9b12676bc92f104a029c42f660e98501e621f4d1df5370ab0ae8847cfbd1ee87,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307830363435306465653766643266623865333930363134333462616263666330353539396136666238,2.028292203781448e+07,,2.028292203781448E25 29.62565417333819,2023-04-04,2023-04-04 20:18:46.000 UTC,polygon,319,0x000000024d657368537761700000000000000000,0x21f96887b77f0ef00a33b148965269fcd14f3f62,WMATIC,USDT-WMATIC,0xc2132d05d31c914a87c6611c10748aeb04b58e8f,,USDT,[],0x21f96887b77f0ef00a33b148965269fcd14f3f62,0x6cee7ce88c9d9f441bda4d751832b2e6cf5fbad1cd5e23a56430762b0383fff4,0x1a1ec25dc08e98e5e93f1104b5e5cdd298707d31,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,26.054563579943917,,2.6054563579943916E19 504.32666693752896,2023-04-04,2023-04-04 20:18:35.000 UTC,ethereum,70,0x1b425529c9d7472603e2dcf125fd195f71dfb412,0x980a76779950f2c7cc06478f3933754839eb0577,WETH,RINIA-WETH,0x307838663832386130363434663132666133353238383865363435613930333333643330663666643764,,RINIA,[],0x980a76779950f2c7cc06478f3933754839eb0577,0x9e77263bc7c05219af3393e3fed53e4affbdcadb168fb0272f1f66a404c2a7f5,0xdef1c0ded9bec7f1a1670819833240f027b25eff,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.2697972839475782,,2.697972839475782E17 -1187.960462635206,2023-04-04,2023-04-04 20:18:23.000 UTC,ethereum,67,0xe3baa96ad46457d9e6cdd4e32abc11e2c124ec49,0xe66b31678d6c16e9ebf358268a790b763c133750,MATIC,MATIC-WETH,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.6355176659650807,WETH,[],0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,0xdc8f6fc4096ed10ef8de4dd8fd8d417f3d0e813803106a2f404191a59f2a3af6,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307837643161666137623731386662383933646233306133616263306366633630386161636665626230,,,1.0412282002731007E21 -49.49835260980026,2023-04-04,2023-04-04 20:17:59.000 UTC,ethereum,48,0x945bcf562085de2d5875b9e2012ed5fd5cfab927,0xe66b31678d6c16e9ebf358268a790b763c133750,MATIC,MATIC-WETH,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.02647990274854503,WETH,[],0x59d68b8c82079568c9907903f554d2e7e25ebf55,0xd73d99416671b47e2f821bdf332a4283a31d002c8ff02918c5c2fcfbe2625d58,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307837643161666137623731386662383933646233306133616263306366633630386161636665626230,,,43273671441228360000 +1187.960462635206,2023-04-04,2023-04-04 20:18:23.000 UTC,ethereum,67,0xe3baa96ad46457d9e6cdd4e32abc11e2c124ec49,0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,MATIC,MATIC-WETH,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.6355176659650807,WETH,[],0xc2c5075f7ab3c7ec9137818321d141591fd64bbe,0xdc8f6fc4096ed10ef8de4dd8fd8d417f3d0e813803106a2f404191a59f2a3af6,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307837643161666137623731386662383933646233306133616263306366633630386161636665626230,,,1.0412282002731007E21 +49.49835260980026,2023-04-04,2023-04-04 20:17:59.000 UTC,ethereum,48,0x945bcf562085de2d5875b9e2012ed5fd5cfab927,0x59d68b8c82079568c9907903f554d2e7e25ebf55,MATIC,MATIC-WETH,0x307863303261616133396232323366653864306130653563346632376561643930383363373536636332,0.02647990274854503,WETH,[],0x59d68b8c82079568c9907903f554d2e7e25ebf55,0xd73d99416671b47e2f821bdf332a4283a31d002c8ff02918c5c2fcfbe2625d58,0xe66b31678d6c16e9ebf358268a790b763c133750,0x307837643161666137623731386662383933646233306133616263306366633630386161636665626230,,,43273671441228360000 1051.1007943624827,2023-04-04,2023-04-04 20:17:51.000 UTC,optimism,30,0x0000001d56656c6f64726f6d6500000000000000,0x6cf233cb7a0a1878ef2d315f77e6c8b925f12cec,WETH,USDC-WETH,0x7f5c764cbc14f9669b88837ca1490cca17c31607,,USDC,[],0x6cf233cb7a0a1878ef2d315f77e6c8b925f12cec,0xd95e7f7008d83757d379ae63f102fe1b4e3a8cd90f561b608b909eab75e38ed6,0xdef1abe32c034e558cdd535791643c58a13acc10,0x4200000000000000000000000000000000000006,0.56230248778272,,5.6230248778271994E17 1051.061195219627,2023-04-04,2023-04-04 20:17:51.000 UTC,optimism,14,0x00000012556e6973776170563300000000000000,0x6cf233cb7a0a1878ef2d315f77e6c8b925f12cec,WETH,USDC-WETH,0x7f5c764cbc14f9669b88837ca1490cca17c31607,,USDC,[],0x6cf233cb7a0a1878ef2d315f77e6c8b925f12cec,0xd95e7f7008d83757d379ae63f102fe1b4e3a8cd90f561b608b909eab75e38ed6,0xdef1abe32c034e558cdd535791643c58a13acc10,0x4200000000000000000000000000000000000006,0.5622813036140263,,5.622813036140263E17 diff --git a/dbt_subprojects/dex/seeds/aggregator_trades/dex_aggregator_seed.csv b/dbt_subprojects/dex/seeds/aggregator_trades/dex_aggregator_seed.csv index 43e23ce9007..0af36d9f1c4 100644 --- a/dbt_subprojects/dex/seeds/aggregator_trades/dex_aggregator_seed.csv +++ b/dbt_subprojects/dex/seeds/aggregator_trades/dex_aggregator_seed.csv @@ -150,4 +150,14 @@ zksync,bebop,jam,2024-05-27,0x3f1d7f99e108b3f5380d1d7344f4ced18b31b14ab1015b48e7 ethereum,bebop,blend,2024-05-21,0x21677f9f3c67d01ab04e0099e96504eaba4e096048904d395e5cb7d2406fd00f,120,"0,0,0",0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0.42318489471676,0xae7ab96520de3a18e5e111b5eaab095312d7fe84,0.43046091487172494 polygon,bebop,blend,2024-05-31,0x680a55160e096aeee0e01390d5dbeab32263bfca3f842f58c44cdcca5349ad10,102,"0,0,0",0x2791bca1f2de4661ed88a30c99a7a9449aa84174,21.723107,0xc2132d05d31c914a87c6611c10748aeb04b58e8f,21.737614 arbitrum,bebop,blend,2024-05-26,0x04045cbce9de0469c40c2ad17fca876cda06ce6946c7d7a84b80bf6d8c662d6e,7,"0,0,0",0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0.045019157349776975,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,172.591646 -base,bebop,blend,2024-05-21,0x2e3d46d6e847ad3a88f515aca7e556a14c93dc1eba5899da0b0edd6936ec8054,163,"0,0,0",0x833589fcd6edb6e08f4c7c32d4f71b54bda02913,40.623838,0x4200000000000000000000000000000000000006,0.0109 \ No newline at end of file +base,bebop,blend,2024-05-21,0x2e3d46d6e847ad3a88f515aca7e556a14c93dc1eba5899da0b0edd6936ec8054,163,"0,0,0",0x833589fcd6edb6e08f4c7c32d4f71b54bda02913,40.623838,0x4200000000000000000000000000000000000006,0.0109 +arbitrum,odos,2,2024-09-09,0x9866ce94df47c2432e68561eb2eae9e68d0e374db8aa5d2ee3b3fef2a29797ea,17,-1,0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34,289.51583210511194,0x912ce59144191c1204e64559fe8253a0e49e6548,567.903481962462 +arbitrum,odos,2,2024-09-09,0xe674461ffaa39e2a2a7051b1cb65bcba58aeedbbd0f5673d1f02b7459bdf7a32,14,-1,0x2416092f143378750bb29b79ed961ab195cceea5,0.47177957854222957,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0.48 +arbitrum,odos,2,2024-09-09,0xf8c2e5cb30c07a0f266bf7afcd310baa45682ec180f55aaf89ea50d0e4d11c83,13,-1,0xf97f4df75117a78c1a5a0dbb814af92458539fb4,40.15785490883377,0xaf88d065e77c8cc2239327c5edb3a432268e5831,414.16 +arbitrum,odos,2,2024-09-09,0xa6d37f5f4fa1948c155e254434e0b09ada41238e83467ea35e3dc30ed2262526,18,-1,0xaf88d065e77c8cc2239327c5edb3a432268e5831,14834.628903,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,14834.798178 +arbitrum,odos,2,2024-09-09,0x9b4c22328e69f905121b5c15419dc9fa3f2085976d4954cb61e32150c67af962,16,-1,0xf97f4df75117a78c1a5a0dbb814af92458539fb4,1.8460308909438838,0xaf88d065e77c8cc2239327c5edb3a432268e5831,19.05712 +arbitrum,odos,1,2023-09-13,0xaef151abff4317b09660c749e1faca1b6400d9ab50ae751bc5fe6b5988e03965,18,-1,0x307838326166343934343764386130376533626439356264306435366633353234313532336662616231,0.006570233329582102,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,49.9 +arbitrum,odos,1,2023-09-13,0x20fb5e16c99be306fb4058f207566332c96ed26a7f7575f0f136fda8d1c2285d,24,-1,0x307838326166343934343764386130376533626439356264306435366633353234313532336662616231,5.6455948955647e-05,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,0.1 +arbitrum,odos,1,2023-09-13,0xeb9a5a3675dc2595390ef13b5392e924ad927e2fed616a8f8eacf355cb94643c,18,-1,0x307838326166343934343764386130376533626439356264306435366633353234313532336662616231,0.006570233329582102,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,49.9 +arbitrum,odos,1,2023-09-13,0x5644436fcc4f702f8171473ecff69c39d3f13ef27fad26d8d01e4ba7680c397a,21,-1,0x307838326166343934343764386130376533626439356264306435366633353234313532336662616231,0.006570233329582102,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,50 +arbitrum,odos,1,2023-09-13,0x22c79845d2b5d155c71b53b7ed61165972a69a195406fae644f60f063cf007b0,23,-1,0x307838326166343934343764386130376533626439356264306435366633353234313532336662616231,5.17754278158e-05,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,0.1 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/_schema.yml b/dbt_subprojects/dex/seeds/trades/_schema.yml index 8b84472dd5b..c7a896af534 100644 --- a/dbt_subprojects/dex/seeds/trades/_schema.yml +++ b/dbt_subprojects/dex/seeds/trades/_schema.yml @@ -600,6 +600,21 @@ seeds: token_sold_amount_raw: uint256 block_date: timestamp + - name: clipper_zkevm_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + - name: curvefi_avalanche_c_base_trades_seed config: column_types: @@ -2234,6 +2249,21 @@ seeds: token_bought_amount_raw: uint256 token_sold_amount_raw: uint256 block_date: timestamp + + - name: xchange_base_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp - name: zigzag_arbitrum_base_trades_seed config: @@ -3929,4 +3959,124 @@ seeds: token_sold_address: varbinary token_bought_amount_raw: uint256 token_sold_amount_raw: uint256 - block_date: timestamp \ No newline at end of file + block_date: timestamp + + - name: fusionx_mantle_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + + - name: agni_mantle_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + + - name: sushiswap_nova_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + + - name: rcpswap_nova_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + + - name: swaap_bnb_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + + - name: swaap_linea_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + + - name: swaap_mantle_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp + + - name: swaap_scroll_base_trades_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + tx_hash: varbinary + evt_index: uint256 + block_number: uint256 + token_bought_address: varbinary + token_sold_address: varbinary + token_bought_amount_raw: uint256 + token_sold_amount_raw: uint256 + block_date: timestamp diff --git a/dbt_subprojects/dex/seeds/trades/agni_mantle_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/agni_mantle_base_trades_seed.csv new file mode 100644 index 00000000000..b9bb0800e2f --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/agni_mantle_base_trades_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +mantle,agni,3,2024-02-17,0x6005ef2688579b491c156235270ed4e9fd41899467680af2c36ebd00b426d94f,7,0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111,0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9,55911025,405103433674357,1108188 +mantle,agni,3,2024-07-03,0x36442052ba17a3dd7327877549464b8f5e002cec07ce514ac8143990cc481e59,37,0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111,0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9,65948728,188049390333551,620257 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/baseswap_base_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/baseswap_base_base_trades_seed.csv index 86b86dbeab3..8ba81b4bc83 100644 --- a/dbt_subprojects/dex/seeds/trades/baseswap_base_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/baseswap_base_base_trades_seed.csv @@ -1,4 +1,5 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -base,baseswap,1,2024-01-06,0xff0088b2deabcc4ececc13d6dd6589e44021601ced71634cd9fb754d9f946589,19,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x4200000000000000000000000000000000000006,8867491,18774285,8464000000000000 -base,baseswap,1,2024-01-06,0xb0babaaf681bdca1bcf5e08307de2b82486228897a375d03e1c3886c6101999a,45,0x4200000000000000000000000000000000000006,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,8868251,9696537680089501,21662741 -base,baseswap,1,2024-01-06,0x135ba2a4be83902af06e67e89a68e793c1f013726959b283ee1b0c85761e4e2f,7,0x4200000000000000000000000000000000000006,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,8868225,10809913753356525,24109421 \ No newline at end of file +base,baseswap,2,2024-01-06,0xff0088b2deabcc4ececc13d6dd6589e44021601ced71634cd9fb754d9f946589,19,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x4200000000000000000000000000000000000006,8867491,18774285,8464000000000000 +base,baseswap,2,2024-01-06,0xb0babaaf681bdca1bcf5e08307de2b82486228897a375d03e1c3886c6101999a,45,0x4200000000000000000000000000000000000006,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,8868251,9696537680089501,21662741 +base,baseswap,2,2024-01-06,0x135ba2a4be83902af06e67e89a68e793c1f013726959b283ee1b0c85761e4e2f,7,0x4200000000000000000000000000000000000006,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,8868225,10809913753356525,24109421 +base,baseswap,3,2024-08-28,0x905820fe901945f182f6b7087f8aa12d1c36533e28d9cb458bd35bf70381a810,30,0x4200000000000000000000000000000000000006,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913,19009635,142990745375333919,347559975 diff --git a/dbt_subprojects/dex/seeds/trades/clipper_zkevm_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/clipper_zkevm_base_trades_seed.csv new file mode 100644 index 00000000000..36b5b60327e --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/clipper_zkevm_base_trades_seed.csv @@ -0,0 +1,4 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +zkevm,clipper,1,2024-08-22,0x28ddfd9e602526db8ec30c3302e5bfd0a4fe10a8af7504975097d7897781b537,3,0x37eAA0eF3549a5Bb7D431be78a3D99BD360d19e5,0xa2036f0538221a77A3937F1379699f44945018d0,15321850,2580223,5000000000000000000 +zkevm,clipper,1,2024-08-22,0x09481e2ba63dc108b9fd2fb70b800da53fc6cd75cc5bb7e655577fdf684bbe93,2,0xa2036f0538221a77A3937F1379699f44945018d0,0x37eAA0eF3549a5Bb7D431be78a3D99BD360d19e5,15321917,5724426126280840192,3000000 +zkevm,clipper,1,2024-08-22,0xf7f32d01c5415ff61ca6756fac549bc57606fcc8172b7398f7bafcbd6e29de75,3,0x37eAA0eF3549a5Bb7D431be78a3D99BD360d19e5,0xa2036f0538221a77A3937F1379699f44945018d0,15347225,53157,100000000000000000 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/fusionx_mantle_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/fusionx_mantle_base_trades_seed.csv new file mode 100644 index 00000000000..b648fbe5376 --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/fusionx_mantle_base_trades_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +mantle,fusionx,3,2024-02-06,0x063a8ef1d0e996b0a6b7734127b84c721a2c4b55d51a7ef1caf6834a348c76dc,3,0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9,0x201eba5cc46d216ce6dc03f6a759e8e766e956ae,53102496,289576,290000 +mantle,fusionx,3,2024-03-02,0x063d3a55cd99baac0da47e0f4f668c9ddb69f1c7ac429798432fe9e136d785c9,3,0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9,0x201eba5cc46d216ce6dc03f6a759e8e766e956ae,58960534,262746,262500 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_arbitrum_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_arbitrum_base_trades_seed.csv index 5e89bf6a43e..02c998eeb15 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_arbitrum_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_arbitrum_base_trades_seed.csv @@ -1,5 +1,5 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -arbitrum,1inch LOP,1,2021-09-24,0xfaebdcb7948f7141d05709373681b0e04c0672051b072db49268066c5ed146b6,1,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,1540189,100000000000000,308879 -arbitrum,1inch LOP,2,2021-12-10,0x1c7b1db733029cdfefa5d33372061dcf392e6ddd668774306f7e80c6057d9631,1,0x0e15258734300290a651fdbae8deb039a8e7a2fa,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,3725195,1000000000000000000,630230 -arbitrum,1inch LOP,3,2022-11-25,0x5c8b58d7b37384216431a6fd41f424f1a750b4cb28c0a891d313454590cb1046,1,0xbfa641051ba0a0ad1b0acf549a89536a0d76472e,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,41071170,1000000000000000000,1000000 -arbitrum,1inch LOP,3 RFQ,2023-04-26,0x51b8f0aeaa4944927bf2c1c4c8c379fcfb7e7a3cdcd5389a424d8cecdb1a9b4e,1,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,84533042,5639386973373932,10995641 +arbitrum,1inch-LOP,1,2021-09-24,0xfaebdcb7948f7141d05709373681b0e04c0672051b072db49268066c5ed146b6,1,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,1540189,100000000000000,308879 +arbitrum,1inch-LOP,2,2021-12-10,0x1c7b1db733029cdfefa5d33372061dcf392e6ddd668774306f7e80c6057d9631,1,0x0e15258734300290a651fdbae8deb039a8e7a2fa,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,3725195,1000000000000000000,630230 +arbitrum,1inch-LOP,3,2022-11-25,0x5c8b58d7b37384216431a6fd41f424f1a750b4cb28c0a891d313454590cb1046,1,0xbfa641051ba0a0ad1b0acf549a89536a0d76472e,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,41071170,1000000000000000000,1000000 +arbitrum,1inch-LOP,3 RFQ,2023-04-26,0x51b8f0aeaa4944927bf2c1c4c8c379fcfb7e7a3cdcd5389a424d8cecdb1a9b4e,1,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,84533042,5639386973373932,10995641 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_avalanche_c_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_avalanche_c_base_trades_seed.csv index 3449fea7a44..7177a6d8192 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_avalanche_c_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_avalanche_c_base_trades_seed.csv @@ -1,4 +1,4 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -avalanche_c,1inch LOP,2,2022-01-18,0x17648dc902706d6d6e169087fdd0d5d9ed9c0a13a568ec8a48051f0b1ba5c908,1,0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664,0xc7198437980c041c805a1edcba50c1ce5db95118,9734779,5000000,4992058 -avalanche_c,1inch LOP,2 RFQ,2022-01-24,0xb2b5c36e970b5b7bcdc90cfe4f62200c2f3f30cbdbfc05dbaea5d1539ad6280c,1,0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab,0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664,10007361,20000000000000000,47776000 -avalanche_c,1inch LOP,3,2022-11-30,0x7f208a0a570fb7276214dc4db47080a2aa90447fc7e5113ee3bda6cf694f7b0f,1,0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7,0xc7198437980c041c805a1edcba50c1ce5db95118,23030230,77240000000000,1000 +avalanche_c,1inch-LOP,2,2022-01-18,0x17648dc902706d6d6e169087fdd0d5d9ed9c0a13a568ec8a48051f0b1ba5c908,1,0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664,0xc7198437980c041c805a1edcba50c1ce5db95118,9734779,5000000,4992058 +avalanche_c,1inch-LOP,2 RFQ,2022-01-24,0xb2b5c36e970b5b7bcdc90cfe4f62200c2f3f30cbdbfc05dbaea5d1539ad6280c,1,0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab,0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664,10007361,20000000000000000,47776000 +avalanche_c,1inch-LOP,3,2022-11-30,0x7f208a0a570fb7276214dc4db47080a2aa90447fc7e5113ee3bda6cf694f7b0f,1,0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7,0xc7198437980c041c805a1edcba50c1ce5db95118,23030230,77240000000000,1000 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_base_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_base_base_trades_seed.csv index 64260254b43..abf16e06d96 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_base_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_base_base_trades_seed.csv @@ -1,2 +1,2 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -base,1inch LOP,3,2023-08-16,0x30231210e1afdc76c1cddd2576a52aa1ea98457297e62c902a7a5aa5bd7e9791,1,0x4200000000000000000000000000000000000006,0xeb466342c4d449bc9f53a865d5cb90586f405215,2698189,1000000000000000,1823264 +base,1inch-LOP,3,2023-08-16,0x30231210e1afdc76c1cddd2576a52aa1ea98457297e62c902a7a5aa5bd7e9791,1,0x4200000000000000000000000000000000000006,0xeb466342c4d449bc9f53a865d5cb90586f405215,2698189,1000000000000000,1823264 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_bnb_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_bnb_base_trades_seed.csv index e30c4e22ed2..4633ac4972d 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_bnb_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_bnb_base_trades_seed.csv @@ -1,7 +1,7 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -bnb,1inch LOP,1,2021-06-03,0x660036450cb8728a2ac5f2deb22bff8758af26aa099d4d0dbbae609093f47795,1,0x111111111117dc0aa78b770fa6a738034120c302,0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c,7976418,10000000000000000,82408297379630 -bnb,1inch LOP,1 RFQ,2021-06-07,0x0205753c08d2642e2a12525ac0949d078a99e02ee87e559456245be24dc6803a,1,0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3,0x111111111117dc0aa78b770fa6a738034120c302,8093622,3800000000000000000,1000000000000000000 -bnb,1inch LOP,2,2021-12-06,0x9d7783360204258b9f2307f4ce4970f8de2a6d67db9b0b6215b9a0dcc39d0eff,1,0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3,0x111111111117dc0aa78b770fa6a738034120c302,13243750,2100000000000000000,500000000000000000 -bnb,1inch LOP,2 RFQ,2021-11-10,0x582066cd36fe1535334a05de5203025a0abadb6d2fb07542dba06d79b9fcb121,1,0x55d398326f99059ff775485246999027b3197955,0xe9e7cea3dedca5984780bafc599bd69add087d56,12518223,20000,10000 -bnb,1inch LOP,3,2022-11-21,0x76952e9657a210fa51de9d0caf38cb66a4e594b8963790e9e282321b0608d560,1,0xe9e7cea3dedca5984780bafc599bd69add087d56,0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d,23247742,1000000000000000000,1000000000000000000 -bnb,1inch LOP,3 RFQ,2023-04-26,0x25086a72ce6a3cf12f836808a97c05432dae39fe74947fa2b9d0129bb47cceea,1,0xe9e7cea3dedca5984780bafc599bd69add087d56,0x2170ed0880ac9a755fd29b2688956bd959f933f8,27689475,188912638650814791680,96693200510555424 +bnb,1inch-LOP,1,2021-06-03,0x660036450cb8728a2ac5f2deb22bff8758af26aa099d4d0dbbae609093f47795,1,0x111111111117dc0aa78b770fa6a738034120c302,0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c,7976418,10000000000000000,82408297379630 +bnb,1inch-LOP,1 RFQ,2021-06-07,0x0205753c08d2642e2a12525ac0949d078a99e02ee87e559456245be24dc6803a,1,0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3,0x111111111117dc0aa78b770fa6a738034120c302,8093622,3800000000000000000,1000000000000000000 +bnb,1inch-LOP,2,2021-12-06,0x9d7783360204258b9f2307f4ce4970f8de2a6d67db9b0b6215b9a0dcc39d0eff,1,0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3,0x111111111117dc0aa78b770fa6a738034120c302,13243750,2100000000000000000,500000000000000000 +bnb,1inch-LOP,2 RFQ,2021-11-10,0x582066cd36fe1535334a05de5203025a0abadb6d2fb07542dba06d79b9fcb121,1,0x55d398326f99059ff775485246999027b3197955,0xe9e7cea3dedca5984780bafc599bd69add087d56,12518223,20000,10000 +bnb,1inch-LOP,3,2022-11-21,0x76952e9657a210fa51de9d0caf38cb66a4e594b8963790e9e282321b0608d560,1,0xe9e7cea3dedca5984780bafc599bd69add087d56,0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d,23247742,1000000000000000000,1000000000000000000 +bnb,1inch-LOP,3 RFQ,2023-04-26,0x25086a72ce6a3cf12f836808a97c05432dae39fe74947fa2b9d0129bb47cceea,1,0xe9e7cea3dedca5984780bafc599bd69add087d56,0x2170ed0880ac9a755fd29b2688956bd959f933f8,27689475,188912638650814791680,96693200510555424 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_ethereum_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_ethereum_base_trades_seed.csv index d3a97a38f8b..3d7ecfa17f2 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_ethereum_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_ethereum_base_trades_seed.csv @@ -1,7 +1,7 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -ethereum,1inch LOP,1,2021-06-08,0x7430839c7a467a4946b2723bdb8d54d4bfeb72a54fbee988a184fc6ccee0c8fe,1,0xdac17f958d2ee523a2206206994597c13d831ec7,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,12596618,15000000,5705137173652603 -ethereum,1inch LOP,1 RFQ,2021-06-24,0x17eedf52cd16e9a2a6cf7dcd0ea60f07b25d9b972564542b702cd86301270bc4,1,0x6b175474e89094c44da98b954eedeac495271d0f,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,12696723,123,123 -ethereum,1inch LOP,2,2021-12-09,0x72e2bd374bad0f3ba7844edb0ddabcd3bf2b0b04c082e9eafc2e1e705d6d111a,1,0x111111111117dc0aa78b770fa6a738034120c302,0x888888435fde8e7d4c54cab67f206e4199454c60,13770760,1000000000000000000,1855074251006687451 -ethereum,1inch LOP,2 RFQ,2021-11-12,0x3069e869f54a593d282f6d72e78c16638555bbb460ce09376f3b969a49740eb9,1,0xdac17f958d2ee523a2206206994597c13d831ec7,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,13601820,100000000,21712226154547600 -ethereum,1inch LOP,3,2022-11-15,0xd6f31e37e9a2bdf79f9e08a3a1aff7aa27b6f33fad8e34506930058f944944eb,1,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x6b175474e89094c44da98b954eedeac495271d0f,15974678,794199483325101,1000000000000000000 -ethereum,1inch LOP,3 RFQ,2022-11-28,0x6daff653b30efeda718d49eb9b6e30b42298603dba0722bbb035f797ef8420bc,1,0x4d224452801aced8b2f0aebe155379bb5d594381,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,16069990,919154283836533103102,3799290434 +ethereum,1inch-LOP,1,2021-06-08,0x7430839c7a467a4946b2723bdb8d54d4bfeb72a54fbee988a184fc6ccee0c8fe,1,0xdac17f958d2ee523a2206206994597c13d831ec7,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,12596618,15000000,5705137173652603 +ethereum,1inch-LOP,1 RFQ,2021-06-24,0x17eedf52cd16e9a2a6cf7dcd0ea60f07b25d9b972564542b702cd86301270bc4,1,0x6b175474e89094c44da98b954eedeac495271d0f,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,12696723,123,123 +ethereum,1inch-LOP,2,2021-12-09,0x72e2bd374bad0f3ba7844edb0ddabcd3bf2b0b04c082e9eafc2e1e705d6d111a,1,0x111111111117dc0aa78b770fa6a738034120c302,0x888888435fde8e7d4c54cab67f206e4199454c60,13770760,1000000000000000000,1855074251006687451 +ethereum,1inch-LOP,2 RFQ,2021-11-12,0x3069e869f54a593d282f6d72e78c16638555bbb460ce09376f3b969a49740eb9,1,0xdac17f958d2ee523a2206206994597c13d831ec7,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,13601820,100000000,21712226154547600 +ethereum,1inch-LOP,3,2022-11-15,0xd6f31e37e9a2bdf79f9e08a3a1aff7aa27b6f33fad8e34506930058f944944eb,1,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x6b175474e89094c44da98b954eedeac495271d0f,15974678,794199483325101,1000000000000000000 +ethereum,1inch-LOP,3 RFQ,2022-11-28,0x6daff653b30efeda718d49eb9b6e30b42298603dba0722bbb035f797ef8420bc,1,0x4d224452801aced8b2f0aebe155379bb5d594381,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,16069990,919154283836533103102,3799290434 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_fantom_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_fantom_base_trades_seed.csv index 5ea3c91d907..31a39ae7079 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_fantom_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_fantom_base_trades_seed.csv @@ -1,3 +1,3 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -fantom,1inch LOP,2 RFQ,2022-04-12,0x23a0a583070aedd2ab9a8dd8984b431751469932d6423cedada0a550b25a266f,1,0x049d68029688eabf473097a2fc38ef61633a3c7a,0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83,35874180,20000000,16899724428868531759 -fantom,1inch LOP,3,2022-11-20,0x60219b7e2fea63be636203aa8feaeaae96edd76514aebe8042cd23204ac522e7,1,0x04068da6c83afcfa0e13ba15a6696662335d5b75,0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e,51203066,999842,1000000000000000000 +fantom,1inch-LOP,2 RFQ,2022-04-12,0x23a0a583070aedd2ab9a8dd8984b431751469932d6423cedada0a550b25a266f,1,0x049d68029688eabf473097a2fc38ef61633a3c7a,0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83,35874180,20000000,16899724428868531759 +fantom,1inch-LOP,3,2022-11-20,0x60219b7e2fea63be636203aa8feaeaae96edd76514aebe8042cd23204ac522e7,1,0x04068da6c83afcfa0e13ba15a6696662335d5b75,0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e,51203066,999842,1000000000000000000 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_gnosis_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_gnosis_base_trades_seed.csv index d1a78373eb0..9b79be7cb68 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_gnosis_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_gnosis_base_trades_seed.csv @@ -1,3 +1,3 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -gnosis,1inch LOP,2,2022-01-17,0xb0bfe04bdc2a2492173d561b19bbba1ccb0fda47050e6c3b25244e133e1e6977,1,0x4ecaba5870353805a9f068101a40e0f32ed605c6,0xe91d153e0b41518a2ce8dd3d7944fa863463a97d,20154733,2000000,1989653057978614462 -gnosis,1inch LOP,3,2022-11-25,0xd94d1559f1c5bf2647da93659003d2dfab158ead080b79837c5a28e9d9160c7b,1,0xe91d153e0b41518a2ce8dd3d7944fa863463a97d,0x4ecaba5870353805a9f068101a40e0f32ed605c6,25150125,2000000000000000000,2000000 +gnosis,1inch-LOP,2,2022-01-17,0xb0bfe04bdc2a2492173d561b19bbba1ccb0fda47050e6c3b25244e133e1e6977,1,0x4ecaba5870353805a9f068101a40e0f32ed605c6,0xe91d153e0b41518a2ce8dd3d7944fa863463a97d,20154733,2000000,1989653057978614462 +gnosis,1inch-LOP,3,2022-11-25,0xd94d1559f1c5bf2647da93659003d2dfab158ead080b79837c5a28e9d9160c7b,1,0xe91d153e0b41518a2ce8dd3d7944fa863463a97d,0x4ecaba5870353805a9f068101a40e0f32ed605c6,25150125,2000000000000000000,2000000 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_optimism_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_optimism_base_trades_seed.csv index f40a700e942..02c53ad4275 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_optimism_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_optimism_base_trades_seed.csv @@ -1,3 +1,3 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -optimism,1inch LOP,2,2022-08-09,0xdb2a1b694452ef009cf8899ad6e8bae2b18c84fc75e293a9508a5633bda26f79,1,0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9,0xfe8b128ba8c78aabc59d4c64cee7ff28e9379921,18398109,1000000000000000000,1343028820855567920 -optimism,1inch LOP,3,2022-11-25,0x7a40bb7f50e59c5e673afe94e8733494243acd0877d227a809aa9ba1c16ba33d,1,0x94b008aa00579c1307b0ef2c499ad98a8ce58e58,0xc5102fe9359fd9a28f877a67e36b0f050d81a3cc,42102561,1000000,12000000000000000000 +optimism,1inch-LOP,2,2022-08-09,0xdb2a1b694452ef009cf8899ad6e8bae2b18c84fc75e293a9508a5633bda26f79,1,0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9,0xfe8b128ba8c78aabc59d4c64cee7ff28e9379921,18398109,1000000000000000000,1343028820855567920 +optimism,1inch-LOP,3,2022-11-25,0x7a40bb7f50e59c5e673afe94e8733494243acd0877d227a809aa9ba1c16ba33d,1,0x94b008aa00579c1307b0ef2c499ad98a8ce58e58,0xc5102fe9359fd9a28f877a67e36b0f050d81a3cc,42102561,1000000,12000000000000000000 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_polygon_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_polygon_base_trades_seed.csv index 68a6dc99328..e717548178d 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_polygon_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_polygon_base_trades_seed.csv @@ -1,7 +1,7 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -polygon,1inch LOP,1,2021-06-10,0x4ec29b58b188d26022191edd51af35f155b9edec5e79303fd78b3aef0400e8bb,1,0x8f3cf7ad23cd3cadbd9735aff958023239c6a063,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,15535024,8000000000000000000,2666666666666666666 -polygon,1inch LOP,1 RFQ,2021-06-21,0x30e49b6e23145b5904bc1cd776a65ad2309e61e95c00c0b452cbf578e957b2aa,1,0xc2132d05d31c914a87c6611c10748aeb04b58e8f,0x7ceb23fd6bc0add59e62ac25578270cff1b9f619,15986349,20000000,10257304255126252 -polygon,1inch LOP,2,2021-12-16,0x9f883ed622c357df0756ea6552c525b1fef3ccdd785772a0a27acb3e83b147a9,1,0x8f3cf7ad23cd3cadbd9735aff958023239c6a063,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,22596059,612715402673482003,613420 -polygon,1inch LOP,2 RFQ,2022-04-08,0x7f4d4290f3b5fd42d8c148457aa0c5b0ae5ad6a52f538eb7d1f611a6551224a1,1,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,26901432,15000000000000000000,22024800 -polygon,1inch LOP,3,2022-11-16,0x4367e740ccdaf64bb9300d64ce071c691ecc305c2f1ac5aff3f7ba3fe19f82c8,1,0x7ceb23fd6bc0add59e62ac25578270cff1b9f619,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,35676160,74784778083080804,100000000000000000000 -polygon,1inch LOP,3 RFQ,2022-11-24,0x5fc98b8f538e6258f554039c182aa9094b2d3f83293812ad86a8ec8ffe122092,1,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0xc2132d05d31c914a87c6611c10748aeb04b58e8f,35994237,20000,10000 +polygon,1inch-LOP,1,2021-06-10,0x4ec29b58b188d26022191edd51af35f155b9edec5e79303fd78b3aef0400e8bb,1,0x8f3cf7ad23cd3cadbd9735aff958023239c6a063,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,15535024,8000000000000000000,2666666666666666666 +polygon,1inch-LOP,1 RFQ,2021-06-21,0x30e49b6e23145b5904bc1cd776a65ad2309e61e95c00c0b452cbf578e957b2aa,1,0xc2132d05d31c914a87c6611c10748aeb04b58e8f,0x7ceb23fd6bc0add59e62ac25578270cff1b9f619,15986349,20000000,10257304255126252 +polygon,1inch-LOP,2,2021-12-16,0x9f883ed622c357df0756ea6552c525b1fef3ccdd785772a0a27acb3e83b147a9,1,0x8f3cf7ad23cd3cadbd9735aff958023239c6a063,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,22596059,612715402673482003,613420 +polygon,1inch-LOP,2 RFQ,2022-04-08,0x7f4d4290f3b5fd42d8c148457aa0c5b0ae5ad6a52f538eb7d1f611a6551224a1,1,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,26901432,15000000000000000000,22024800 +polygon,1inch-LOP,3,2022-11-16,0x4367e740ccdaf64bb9300d64ce071c691ecc305c2f1ac5aff3f7ba3fe19f82c8,1,0x7ceb23fd6bc0add59e62ac25578270cff1b9f619,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,35676160,74784778083080804,100000000000000000000 +polygon,1inch-LOP,3 RFQ,2022-11-24,0x5fc98b8f538e6258f554039c182aa9094b2d3f83293812ad86a8ec8ffe122092,1,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0xc2132d05d31c914a87c6611c10748aeb04b58e8f,35994237,20000,10000 diff --git a/dbt_subprojects/dex/seeds/trades/oneinch_zksync_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/oneinch_zksync_base_trades_seed.csv index 331a4ea1818..a2120cda087 100644 --- a/dbt_subprojects/dex/seeds/trades/oneinch_zksync_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/oneinch_zksync_base_trades_seed.csv @@ -1,3 +1,3 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw -zksync,1inch LOP,3,2023-04-25,0xce890512f93dd7d2f1576214025a384a7e4d77d0696f7586b08aa7f2abbb3666,1,0x85d84c774cf8e9ff85342684b0e795df72a24908,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,2221692,, -zksync,1inch LOP,3 RFQ,2023-05-02,0x96a6f0a3b6dca895ae56ad55b14366f9ec0993409754caad26c0921598beebf8,1,0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,2649529,, +zksync,1inch-LOP,3,2023-04-25,0xce890512f93dd7d2f1576214025a384a7e4d77d0696f7586b08aa7f2abbb3666,1,0x85d84c774cf8e9ff85342684b0e795df72a24908,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,2221692,, +zksync,1inch-LOP,3 RFQ,2023-05-02,0x96a6f0a3b6dca895ae56ad55b14366f9ec0993409754caad26c0921598beebf8,1,0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,2649529,, diff --git a/dbt_subprojects/dex/seeds/trades/pancakeswap_ethereum_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/pancakeswap_ethereum_base_trades_seed.csv index f46618aa238..ecdeabecc12 100644 --- a/dbt_subprojects/dex/seeds/trades/pancakeswap_ethereum_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/pancakeswap_ethereum_base_trades_seed.csv @@ -11,3 +11,6 @@ ethereum,pancakeswap,mmpool,2023-03-09,0xe8fceccb966aa76d8b847f0b067f987b2333136 ethereum,pancakeswap,mmpool,2023-03-09,0x06e1b3740c4a4d8fa60f7ddf6defb706f1ec64c563b697f0695647921b2b8c89,288,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,16787094,1535457365,1000000000000000000 ethereum,pancakeswap,3,2023-04-02,0x3a0097fcc23266394c9ec6e5cf1dd667e60717b1f92fbc76a5e5e2aa50a430ba,84,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xdac17f958d2ee523a2206206994597c13d831ec7,16959182,1637811712507004,3000000 ethereum,pancakeswap,3,2023-04-01,0x942d7e8064aa1925e484ad9e38b25b0eea8620aa2b85a42a47b957bcdc5df18b,175,0xdac17f958d2ee523a2206206994597c13d831ec7,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,16955398,980006,1000000 +ethereum,pancakeswap,stableswap,2024-09-03 00:00:00.000 UTC,0x76706147bb031c1dff5386142d866ec083578420885fb24160124a66800ef418,299,0x2260fac5e5542a773aa44fbcfedf7c193bc2c599,0xbdf245957992bfbc62b07e344128a1eec7b7ee3f,20668595,9967437,10000000 +ethereum,pancakeswap,stableswap,2024-09-04 00:00:00.000 UTC,0x6639947fd9c9d5e07425f2500f3f50b13bb7b4bd92316d5392866e759aa7e97c,74,0xbdf245957992bfbc62b07e344128a1eec7b7ee3f,0x2260fac5e5542a773aa44fbcfedf7c193bc2c599,20680551,1251896,1177998 +ethereum,pancakeswap,stableswap,2024-09-08 00:00:00.000 UTC,0x7e07e90e2230148bd1a5c49ccaa94a36408dc3df2f39c923c6c49b154d6c7ba4,72,0x2260fac5e5542a773aa44fbcfedf7c193bc2c599,0xbdf245957992bfbc62b07e344128a1eec7b7ee3f,20704016,13399197,13511099 diff --git a/dbt_subprojects/dex/seeds/trades/rcpswap_nova_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/rcpswap_nova_base_trades_seed.csv new file mode 100644 index 00000000000..4e23d957d08 --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/rcpswap_nova_base_trades_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +nova,rcpswap,2,2024-07-31,0x0cb59d2a9111f6db69888376c9efee08384d5131e785aa343b599b011d8415a6,4,0xf823c3cd3cebe0a1fa952ba88dc9eef8e0bf46ad,0x722e8bdd2ce80a4422e880164f2079488e115365,74749372,490694593885341778,100000000000000 +nova,rcpswap,2,2024-08-08,0x2e2dd15fc0c901ab0eb28cecf5b1956f0488d58d5b49ea718ef5e9c969ea4c7e,4,0x722e8bdd2ce80a4422e880164f2079488e115365,0x750ba8b76187092b0d1e87e28daaf484d1b5273b,74992500,50000000000000000,123395002 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/sushiswap_nova_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/sushiswap_nova_base_trades_seed.csv new file mode 100644 index 00000000000..f7afe15ee6a --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/sushiswap_nova_base_trades_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +nova,sushiswap,1,2024-07-31,0x63aa960edb1e1b4617ed175efd2c36a63dbffc4c52d6de583df03ccb4ed9832c,4,0xf823c3cd3cebe0a1fa952ba88dc9eef8e0bf46ad,0x722e8bdd2ce80a4422e880164f2079488e115365,74749195,487733361848339604,100000000000000 +nova,sushiswap,1,2024-08-08,0xf2c5a79780f42d37b456f476438b895b00417ff9f2a209ad0cd8b9467ec1ce33,4,0x722e8bdd2ce80a4422e880164f2079488e115365,0x1d05e4e72cd994cdf976181cfb0707345763564d,74991460,299956180031076,1381 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/swaap_bnb_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/swaap_bnb_base_trades_seed.csv new file mode 100644 index 00000000000..9622751a15c --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/swaap_bnb_base_trades_seed.csv @@ -0,0 +1,2 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +bnb,swaap,2,2024-08-30,0x8e8069dc679330517bb2e1199c4b7ccd47b71e4b2e314c85421983bcf58f2a67,95,0x2170Ed0880ac9A755fd29B2688956BD959F933F8,0x55d398326f99059fF775485246999027B3197955,41822967,630622688144315165,1600000000000000000000 diff --git a/dbt_subprojects/dex/seeds/trades/swaap_linea_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/swaap_linea_base_trades_seed.csv new file mode 100644 index 00000000000..7dbe57bfec8 --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/swaap_linea_base_trades_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +linea,swaap,2,2024-08-30,0x93529de7edd69ede21d613e1dfd9537fede98e5a9d619bf9049056bc9d527d39,21,0x176211869cA2b568f2A7D4EE941E073a821EE1ff,0xA219439258ca9da29E9Cc4cE5596924745e12B93,8806415,491609875,491621866 + diff --git a/dbt_subprojects/dex/seeds/trades/swaap_mantle_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/swaap_mantle_base_trades_seed.csv new file mode 100644 index 00000000000..7e24d7e180c --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/swaap_mantle_base_trades_seed.csv @@ -0,0 +1,2 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +mantle,swaap,2,2024-08-30,0x484b7927255c917eb15873d6a7c7fe55cb1e1c730e56236c00bdbc9842c6c3d2,78,0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8,0x201eba5cc46d216ce6dc03f6a759e8e766e956ae,68449936,46733828065880185342,27178208 diff --git a/dbt_subprojects/dex/seeds/trades/swaap_scroll_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/swaap_scroll_base_trades_seed.csv new file mode 100644 index 00000000000..87676194f7e --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/swaap_scroll_base_trades_seed.csv @@ -0,0 +1,2 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +scroll,swaap,2,2024-08-30,0x4aa3f560795142cdd1aba0ac181661e79953463e141a2ea492aa8f4687476ea6,55,0x01f0a31698C4d065659b9bdC21B3610292a1c506,0x5300000000000000000000000000000000000004,8844121,19588246030912202,20502321000000000 diff --git a/dbt_subprojects/dex/seeds/trades/trader_joe_arbitrum_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/trader_joe_arbitrum_base_trades_seed.csv index 66febdba1b0..1eb651c8c7d 100644 --- a/dbt_subprojects/dex/seeds/trades/trader_joe_arbitrum_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/trader_joe_arbitrum_base_trades_seed.csv @@ -1,3 +1,4 @@ blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw arbitrum,trader_joe,2.1,2023-09-27,0xa0c3a8baeb889f57962e1f90f02878c52bc2703923ea44d6c32b54ac85a182fa,4,0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9,0xaf88d065e77c8cc2239327c5edb3a432268e5831,135083726,1000850315,999997500 arbitrum,trader_joe,2,2023-02-25,0x0089a8b75a142474502974fa9a69d69bf007d7fcd760df9e78e1e38cdc63a8bd,1,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0x371c7ec6d8039ff7933a2aa28eb827ffe1f52f07,64399897,119172119245068251,748500000000000004917 +arbitrum,trader_joe,2.2,2024-07-29,0x2c7cca8024fde90862302b63c99af6b6d536816bc22d1043ee536924dd69a88f,3,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0x912ce59144191c1204e64559fe8253a0e49e6548,237288259,12889499604413206,59668501685837954263 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/trader_joe_avalanche_c_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/trader_joe_avalanche_c_base_trades_seed.csv index de3a1f95993..3e71f8343e2 100644 --- a/dbt_subprojects/dex/seeds/trades/trader_joe_avalanche_c_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/trader_joe_avalanche_c_base_trades_seed.csv @@ -4,4 +4,5 @@ avalanche_c,trader_joe,1,2022-11-09,0x82cd2992be090d073b82406e3f3882c43eeb4ac7e7 avalanche_c,trader_joe,2,2023-02-17,0x51c5b4dabbcedf31ab4379eeb163dd8a72db4ed827655e6c4019a84d59e45c0b,55,0x152b9d0fdc40c096757f570a51e494bd4b943e50,0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab,26392546,18848680,2719848912526247991 avalanche_c,trader_joe,2,2023-02-17,0x582496cdacfa83cbb32bdc9e6a7a0baecb31e43ca798728500e783b95c2b6673,14,0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab,0x152b9d0fdc40c096757f570a51e494bd4b943e50,26392419,2719848912526247990,18848680 avalanche_c,trader_joe,2.1,2023-05-18,0x2dd8b4f7f504a643093cf610673cd64987e13d524464765bf8b276d4c35ad42c,17,0x152b9d0fdc40c096757f570a51e494bd4b943e50,0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e,30196829,4102051,1103889131 +avalanche_c,trader_joe,2.2,2024-08-14,0x7bec887399e3c09aada5e34c33b4bd749fdc019c1773272cdcf6074c199fc8f5,6,0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7,0xa25eaf2906fa1a3a13edac9b9657108af7b703e3,49227260,21308720431153977235,19999900000000000000 diff --git a/dbt_subprojects/dex/seeds/trades/xchange_base_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/xchange_base_base_trades_seed.csv new file mode 100644 index 00000000000..97452a53867 --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/xchange_base_base_trades_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw +base,xchange,1,2024-08-15,0x2a3e91e59a74f74cfdca447437ebc8749a697dbd56956a3a3936d6efa2f3cb37,325,0xf6e932ca12afa26665dc4dde7e27be02a7c02e50,0x4200000000000000000000000000000000000006,18480405,122587776469893054305789,500000000000000 +base,xchange,1,2024-08-15,0xae8b1651af59df2527c31a13a99430a003da224c2dc17c144de56ab2de3d489f,77,0x4200000000000000000000000000000000000006,0xf6e932ca12afa26665dc4dde7e27be02a7c02e50,18480492,332883871677823,81578878681084805870785 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/macros/blockchain_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/macros/blockchain_transaction_address_metrics.sql new file mode 100644 index 00000000000..cc3b9f666c9 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/macros/blockchain_transaction_address_metrics.sql @@ -0,0 +1,100 @@ +{% macro blockchain_transaction_address_metrics(blockchain) %} + +with contracts as ( + select + distinct address + from + {{ source(blockchain, 'creation_traces') }} +) +, from_new_address as ( + select + "from" as address + , min(date_trunc('hour', block_time)) as min_block_hour + from + {{ source(blockchain, 'transactions') }} + where + 1 = 1 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% endif %} + group by + 1 +) +, to_new_address as ( + select + to as address + , min(date_trunc('hour', block_time)) as min_block_hour + from + {{ source(blockchain, 'transactions') }} + where + 1 = 1 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% endif %} + group by + 1 +) +, tx as ( + select + '{{ blockchain }}' as blockchain + , date_trunc('hour', block_time) as block_hour + , "from" as from_address + , to as to_address + , count(hash) as tx_count + , count_if(success) as tx_success_count + from + {{ source(blockchain, 'transactions') }} + where + 1 = 1 + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% endif %} + group by + 1 + , 2 + , 3 + , 4 +) +select + tx.blockchain + , ei.chain_id + , tx.block_hour + , tx.from_address + , tx.to_address + , tx.tx_count + , cast(tx.tx_success_count as double)/cast(tx.tx_count as double) as tx_success_rate + , case + when tx.block_hour = from_new_address.min_block_hour then True + else False + end as from_is_new_address + , case + when from_contract.address is not null then True + else False + end as from_is_contract + , case + when tx.block_hour = to_new_address.min_block_hour then True + else False + end as to_is_new_address + , case + when to_contract.address is not null then True + else False + end as to_is_contract +from + tx +inner join + {{ source('evms', 'info') }} as ei + on '{{ blockchain }}' = ei.blockchain +inner join + from_new_address + on tx.from_address = from_new_address.address +inner join + to_new_address + on tx.to_address = to_new_address.address +left join + contracts as from_contract + on tx.from_address = from_contract.address +left join + contracts as to_contract + on tx.to_address = to_contract.address + +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/macros/blockchain_metrics.sql b/dbt_subprojects/hourly_spellbook/macros/blockchain_transaction_metrics.sql similarity index 97% rename from dbt_subprojects/hourly_spellbook/macros/blockchain_metrics.sql rename to dbt_subprojects/hourly_spellbook/macros/blockchain_transaction_metrics.sql index fea2fb95ff6..3d31f1f0190 100644 --- a/dbt_subprojects/hourly_spellbook/macros/blockchain_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/macros/blockchain_transaction_metrics.sql @@ -1,4 +1,4 @@ -{% macro blockchain_metrics(blockchain) %} +{% macro blockchain_transaction_metrics(blockchain) %} WITH blocks as ( select diff --git a/dbt_subprojects/hourly_spellbook/macros/project/safe/safe_transactions.sql b/dbt_subprojects/hourly_spellbook/macros/project/safe/safe_transactions.sql new file mode 100644 index 00000000000..3ca599f1f5f --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/macros/project/safe/safe_transactions.sql @@ -0,0 +1,54 @@ +{% macro safe_transactions(blockchain, project_start_date) %} + +select + '{{ blockchain }}' as blockchain, + try_cast(date_trunc('day', tr.block_time) as date) as block_date, + CAST(date_trunc('month', tr.block_time) as DATE) as block_month, + tr.block_time, + tr.block_number, + tr.tx_hash, + s.address, + tr.to, + tr.value, + tr.gas, + tr.gas_used as execution_gas_used, + et.gas_used as total_gas_used, + tr.tx_index, + tr.sub_traces, + tr.trace_address, + tr.success, + tr.error, + tr.code, + tr.input, + tr.output, + case + when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' + when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' + when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' + else 'unknown' + end as method +from {{ source(blockchain, 'traces') }} tr +join {{ ref('safe_' ~ blockchain ~ '_safes') }} s + on s.address = tr."from" +join {{ ref('safe_' ~ blockchain ~ '_singletons') }} ss + on tr.to = ss.address +join {{ source(blockchain, 'transactions') }} et + on tr.block_date = et.block_date + and tr.tx_hash = et.hash + and tr.block_number = et.block_number + {% if is_incremental() %} + and {{ incremental_predicate('et.block_time') }} + {% endif %} +where bytearray_substring(tr.input, 1, 4) in ( + 0x6a761202, -- execTransaction + 0x468721a7, -- execTransactionFromModule + 0x5229073f -- execTransactionFromModuleReturnData + ) + and tr.call_type = 'delegatecall' + {% if not is_incremental() %} + and tr.block_time > TIMESTAMP '{{ project_start_date }}' -- for initial query optimisation + {% else %} + and {{ incremental_predicate('tr.block_time') }} + {% endif %} + +{% endmacro %} diff --git a/dbt_subprojects/hourly_spellbook/macros/project/safe_native_transfers.sql b/dbt_subprojects/hourly_spellbook/macros/project/safe_native_transfers.sql new file mode 100644 index 00000000000..ffaaa5ddfb9 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/macros/project/safe_native_transfers.sql @@ -0,0 +1,70 @@ +{% macro safe_native_transfers(blockchain, native_token_symbol, project_start_date) %} + +select + t.* + , p.price * t.amount_raw / 1e18 AS amount_usd +from +( + select + '{{ blockchain }}' as blockchain, + '{{ native_token_symbol }}' as symbol, + s.address, + CAST(date_trunc('day', et.block_time) as date) as block_date, + CAST(date_trunc('month', et.block_time) as DATE) as block_month, + et.block_time, + -CAST(et.value AS INT256) as amount_raw, + et.tx_hash, + array_join(et.trace_address, ',') as trace_address + from + {{ source(blockchain, 'traces') }} et + join + {{ ref('safe_' ~ blockchain ~ '_safes') }} s + on et."from" = s.address + where + et."from" != et.to -- exclude calls to self to guarantee unique key property + and et.success = true + and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) + and et.value > UINT256 '0' -- et.value is uint256 type + {% if not is_incremental() %} + and et.block_time >= TIMESTAMP '{{ project_start_date }}' + {% else %} + and et.block_time > date_trunc('day', now() - interval '10' day) -- to prevent potential counterfactual safe deployment issues we take a bigger interval + {% endif %} + + union all + + select + '{{ blockchain }}' as blockchain, + '{{ native_token_symbol }}' as symbol, + s.address, + CAST(date_trunc('day', et.block_time) as date) as block_date, + CAST(date_trunc('month', et.block_time) as DATE) as block_month, + et.block_time, + CAST(et.value AS INT256) as amount_raw, + et.tx_hash, + array_join(et.trace_address, ',') as trace_address + from + {{ source(blockchain, 'traces') }} et + join + {{ ref('safe_' ~ blockchain ~ '_safes') }} s + on et.to = s.address + where + et."from" != et.to -- exclude calls to self to guarantee unique key property + and et.success = true + and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) + and et.value > UINT256 '0' -- et.value is uint256 type + {% if not is_incremental() %} + and et.block_time >= TIMESTAMP '{{ project_start_date }}' + {% else %} + and et.block_time > date_trunc('day', now() - interval '10' day) -- to prevent potential counterfactual safe deployment issues we take a bigger interval + {% endif %} +) t +left join {{ source('prices', 'usd') }} p on p.blockchain is null + and p.symbol = t.symbol + and p.minute = date_trunc('minute', t.block_time) + {% if not is_incremental() %} + and p.minute >= TIMESTAMP '{{ project_start_date }}' + {% else %} + and p.minute > date_trunc('day', now() - interval '10' day) -- to prevent potential counterfactual safe deployment issues we take a bigger interval + {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/macros/sector/gas/fees/gas_fees.sql b/dbt_subprojects/hourly_spellbook/macros/sector/gas/fees/gas_fees.sql new file mode 100644 index 00000000000..76269bca9d8 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/macros/sector/gas/fees/gas_fees.sql @@ -0,0 +1,161 @@ +-- any modifications needed for getting the correct gas price +{% macro gas_price(blockchain) %} + {%- if blockchain in ['arbitrum']-%} + effective_gas_price + {%- else -%} + gas_price + {%- endif -%} +{% endmacro %} + +-- include chain specific logic here +{% macro tx_fee_raw(blockchain) %} + {%- if blockchain in all_op_chains() + ('scroll','blast','mantle') -%} + cast(coalesce(l1_fee,0) as uint256) + + {%- endif -%} + {%- if blockchain in ('ethereum',) -%} + cast(coalesce(blob.blob_base_fee,0) as uint256) * cast(coalesce(blob.blob_gas_used,0) as uint256) + + {%- endif -%} + cast({{ gas_price(blockchain) }} as uint256) * cast(txns.gas_used as uint256) +{% endmacro %} + +-- include chain specific logic here +-- arbitrum is a bit special as they have eip1559 but ignore tips (priority fees) +-- https://docs.arbitrum.io/how-arbitrum-works/gas-fees#tips-in-l2 +-- zksync doesn't provide an easy way to track which part of the fee is L1 fee and which is the L2 base fee +{% macro tx_fee_breakdown_raw(blockchain) %} + map_concat( + map() + {%- if blockchain in ('arbitrum',) %} + ,map(array['l1_fee','base_fee'] + , array[cast(coalesce(gas_used_for_l1,0) * {{gas_price(blockchain)}} as uint256) + ,cast((txns.gas_used - coalesce(gas_used_for_l1,0)) * {{gas_price(blockchain)}} as uint256)]) + {%- elif blockchain in ('zksync',) %} + ,map(array['base_fee'], array[(cast({{gas_price(blockchain)}} as uint256) * cast(txns.gas_used as uint256))]) + {%- else -%} + {%- if blockchain in all_op_chains() + ('scroll','blast','mantle') %} + ,map(array['l1_fee'], array[cast(coalesce(l1_fee,0) as uint256)]) + {%- endif -%} + {%- if blockchain in ('ethereum',) %} + ,map(array['blob_fee'],array[cast(coalesce(blob.blob_base_fee,0) as uint256) * cast(coalesce(blob.blob_gas_used,0) as uint256)]) + {%- endif %} + ,case when txns.priority_fee_per_gas is null or txns.priority_fee_per_gas < 0 + then map(array['base_fee'], array[(cast({{gas_price(blockchain)}} as uint256) * cast(txns.gas_used as uint256))]) + else map(array['base_fee','priority_fee'], + array[(cast(base_fee_per_gas as uint256) * cast(txns.gas_used as uint256)) + ,(cast(priority_fee_per_gas as uint256) * cast(txns.gas_used as uint256))] + ) + end + {%- endif -%} + ) +{% endmacro %} + +-- include chain specific columns here +{% macro select_extra_columns(blockchain, include_ref = true) %} + {%- if blockchain in ('scroll') %} + ,l1_fee + {%- endif %} + {%- if blockchain in all_op_chains() + ('blast','mantle') %} + ,l1_fee + ,l1_gas_used + ,l1_gas_price + ,l1_fee_scalar + {%- endif %} + {%- if blockchain in ('arbitrum',) %} + ,effective_gas_price + ,gas_used_for_l1 + {%- endif %} + {%- if blockchain in ('ethereum',) %} + ,{%- if include_ref %}blob.{%- endif %}blob_base_fee + ,{%- if include_ref %}blob.{%- endif %}blob_gas_used + ,{%- if include_ref %}blob.{%- endif %}max_fee_per_blob_gas + {%- endif %} +{% endmacro %} + +-- applicable on Celo +{% macro fee_currency(blockchain) %} + {%- if blockchain in ('celo',) -%} + coalesce(fee_currency, {{var('ETH_ERC20_ADDRESS')}}) + {%- else -%} + {{var('ETH_ERC20_ADDRESS')}} + {%- endif %} +{% endmacro %} + +{% macro gas_fees(blockchain) %} +WITH base_model as ( + SELECT + txns.block_time + ,txns.block_number + ,txns.hash AS tx_hash + ,txns."from" AS tx_from + ,txns.to AS tx_to + ,cast({{ gas_price(blockchain) }} as uint256) as gas_price + ,txns.gas_used as gas_used + ,{{tx_fee_raw(blockchain) }} as tx_fee_raw + ,{{tx_fee_breakdown_raw(blockchain)}} as tx_fee_breakdown_raw + ,{{fee_currency(blockchain)}} as tx_fee_currency + ,blocks.miner AS block_proposer + ,txns.max_fee_per_gas + ,txns.priority_fee_per_gas + ,txns.max_priority_fee_per_gas + ,blocks.base_fee_per_gas + ,txns.gas_limit + ,CASE --safe divide-by-zero + WHEN txns.gas_limit = 0 THEN NULL + WHEN txns.gas_limit != 0 THEN cast(txns.gas_used as double) / cast(txns.gas_limit as double) + END AS gas_limit_usage + {{ select_extra_columns(blockchain) }} + FROM {{ source( blockchain, 'transactions') }} txns + INNER JOIN {{ source( blockchain, 'blocks') }} blocks + ON txns.block_number = blocks.number + {% if is_incremental() %} + AND {{ incremental_predicate('blocks.time') }} + {% endif %} + {%- if blockchain in ('ethereum',)-%} + LEFT JOIN {{ source( blockchain, 'blobs_submissions') }} blob + ON txns.hash = blob.tx_hash + AND txns.block_number = blob.block_number + {% if is_incremental() %} + AND {{ incremental_predicate('blob.block_time') }} + {% endif %} + {%- endif -%} + {% if is_incremental() %} + WHERE {{ incremental_predicate('txns.block_time') }} + {% endif %} + ) + +SELECT + '{{blockchain}}' as blockchain + ,CAST(date_trunc('month', block_time) AS DATE) AS block_month + ,CAST(date_trunc('day', block_time) AS DATE) AS block_date + ,block_time + ,block_number + ,tx_hash + ,tx_from + ,tx_to + ,gas_price + ,gas_used + ,p.symbol as currency_symbol + ,coalesce(tx_fee_raw, 0) as tx_fee_raw + ,coalesce(tx_fee_raw, 0) / pow(10,p.decimals) as tx_fee + ,coalesce(tx_fee_raw, 0) / pow(10,p.decimals) * p.price as tx_fee_usd + ,transform_values(tx_fee_breakdown_raw, + (k,v) -> coalesce(v,0)) as tx_fee_breakdown_raw + ,transform_values(tx_fee_breakdown_raw, + (k,v) -> coalesce(v, 0) / pow(10,p.decimals) ) as tx_fee_breakdown + ,transform_values(tx_fee_breakdown_raw, + (k,v) -> coalesce(v, 0) / pow(10,p.decimals) * p.price) as tx_fee_breakdown_usd + ,tx_fee_currency + ,block_proposer + ,max_fee_per_gas + ,priority_fee_per_gas + ,max_priority_fee_per_gas + ,base_fee_per_gas + ,gas_limit + ,gas_limit_usage + {{ select_extra_columns(blockchain=blockchain, include_ref=false) }} +FROM base_model +LEFT JOIN {{ref('prices_usd_with_native')}} p + ON p.blockchain = '{{blockchain}}' + AND p.contract_address = tx_fee_currency + AND p.minute = date_trunc('minute', block_time) +{% endmacro %} diff --git a/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_supply.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_supply.sql index 3909cfeb2a3..5320cf668bc 100644 --- a/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_supply.sql +++ b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_supply.sql @@ -247,6 +247,15 @@ src_LendingPool_evt_Withdraw as ( {% endif %} ), +src_LendingPool_evt_Repay as ( + select * + from {{ source(project_decoded_as ~ '_' ~ blockchain, decoded_contract_name ~ '_evt_Repay') }} + where useATokens -- ref: https://github.com/duneanalytics/spellbook/issues/6417 + {% if is_incremental() %} + and {{ incremental_predicate('evt_block_time') }} + {% endif %} +), + src_LendingPool_evt_LiquidationCall as ( select * from {{ source(project_decoded_as ~ '_' ~ blockchain, decoded_contract_name ~ '_evt_LiquidationCall') }} @@ -286,6 +295,21 @@ base_supply as ( evt_block_number from src_LendingPool_evt_Withdraw union all + select + 'repay_with_atokens' as transaction_type, + reserve as token_address, + user as depositor, + cast(null as varbinary) as on_behalf_of, + repayer as withdrawn_to, + cast(null as varbinary) as liquidator, + -1 * cast(amount as double) as amount, + contract_address, + evt_tx_hash, + evt_index, + evt_block_time, + evt_block_number + from src_LendingPool_evt_Repay + union all select 'deposit_liquidation' as transaction_type, collateralAsset as token_address, diff --git a/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_borrow.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_borrow.sql index 995bd2c2ead..18a9af95987 100644 --- a/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_borrow.sql +++ b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_borrow.sql @@ -169,17 +169,12 @@ from base_borrow with -src_Borrow as ( +src_LiquidationCall as ( {% for src in sources %} - select contract_address, src, amount, evt_tx_hash, evt_index, evt_block_time, evt_block_number - from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Withdraw' )}} - where evt_tx_hash not in ( - select evt_tx_hash - from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Transfer' )}} - where "to" = 0x0000000000000000000000000000000000000000 - ) + select contract_address, borrower, absorber, basePaidOut, evt_tx_hash, evt_index, evt_block_time, evt_block_number + from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_AbsorbDebt' )}} {% if is_incremental() %} - and {{ incremental_predicate('evt_block_time') }} + where {{ incremental_predicate('evt_block_time') }} {% endif %} {% if not loop.last %} union all @@ -187,17 +182,37 @@ src_Borrow as ( {% endfor %} ), -src_Repay as ( +ctokens as ( + select * from {{ ref( decoded_project ~ '_' ~ blockchain ~ '_ctokens' ) }} +), +base_withdraw_actions as ( {% for src in sources %} - select contract_address, "from", dst, amount, evt_tx_hash, evt_index, evt_block_time, evt_block_number - from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Supply' )}} - where evt_tx_hash not in ( - select evt_tx_hash - from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Transfer' )}} - where "from" = 0x0000000000000000000000000000000000000000 - ) + select + w.contract_address, w.evt_tx_hash, w.evt_index, w.evt_block_time, w.evt_block_number, + + w.src as withdraw_from, + w.to as withdraw_dst, + w.amount as withdraw_amt, + + t."from" as transfer_from, + t.to as transfer_to, + t.amount as transfer_amt, + + coalesce(least(t.amount,w.amount),0) as amount_withdrawn, + w.amount - coalesce(least(t.amount,w.amount),0) as amount_borrowed, + case + when t.amount is null then 'borrow' + when w.amount = t.amount then 'withdraw' + when w.amount < t.amount+10 then 'withdraw' -- accuracy fix + else 'borrow + withdraw' + end as action + from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Withdraw' )}} w + left join {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Transfer' )}} t + on w.evt_tx_hash = t.evt_tx_hash + and w.contract_address = t.contract_address + and w.evt_index+1 = t.evt_index {% if is_incremental() %} - and {{ incremental_predicate('evt_block_time') }} + where {{ incremental_predicate('w.evt_block_time') }} {% endif %} {% if not loop.last %} union all @@ -205,12 +220,34 @@ src_Repay as ( {% endfor %} ), -src_LiquidationCall as ( +base_supply_actions as ( {% for src in sources %} - select contract_address, borrower, absorber, basePaidOut, evt_tx_hash, evt_index, evt_block_time, evt_block_number - from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_AbsorbDebt' )}} + select + s.contract_address, s.evt_tx_hash, s.evt_index, s.evt_block_time, s.evt_block_number, + + s."from" as supply_from, + s.dst as supply_dst, + s.amount as supply_amt, + + t."from" as transfer_from, + t.to as transfer_to, + t.amount as transfer_amt, + + coalesce(t.amount,0) as amount_supplied, + s.amount - coalesce(t.amount,0) as amount_repaid, + case + when t.amount is null then 'repay' + when s.amount = t.amount then 'supply' + when s.amount < t.amount+10 then 'supply' -- accuracy fix + else 'repay + supply' + end as action + from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Supply' )}} s + left join {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Transfer' )}} t + on s.evt_tx_hash = t.evt_tx_hash + and s.contract_address = t.contract_address + and s.evt_index+1 = t.evt_index {% if is_incremental() %} - where {{ incremental_predicate('evt_block_time') }} + where {{ incremental_predicate('s.evt_block_time') }} {% endif %} {% if not loop.last %} union all @@ -218,38 +255,38 @@ src_LiquidationCall as ( {% endfor %} ), -ctokens as ( - select * from {{ ref( decoded_project ~ '_' ~ blockchain ~ '_ctokens' ) }} -), - base_borrow as ( select 'borrow' as transaction_type, contract_address as comet_contract_address, - src as borrower, + withdraw_from as borrower, cast(null as varbinary) as on_behalf_of, cast(null as varbinary) as repayer, cast(null as varbinary) as liquidator, - cast(amount as double) as amount, + cast(amount_borrowed as double) as amount, evt_tx_hash, evt_index, evt_block_time, evt_block_number - from src_Borrow + from base_withdraw_actions + where amount_borrowed is not null + and amount_borrowed> 0 union all select 'repay' as transaction_type, contract_address as comet_contract_address, - "from" as borrower, + supply_from as borrower, cast(null as varbinary) as on_behalf_of, - dst as repayer, + supply_dst as repayer, cast(null as varbinary) as liquidator, - -1 * cast(amount as double) as amount, + -1 * cast(amount_repaid as double) as amount, evt_tx_hash, evt_index, evt_block_time, evt_block_number - from src_Repay + from base_supply_actions + where amount_repaid is not null + and amount_repaid> 0 union all select 'borrow_liquidation' as transaction_type, diff --git a/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_supply.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_supply.sql index 23f5a9f98eb..4cfa04b7330 100644 --- a/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_supply.sql +++ b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_supply.sql @@ -166,6 +166,80 @@ src_AbsorbCollateral as ( {% endfor %} ), +ctokens as ( + select * from {{ ref( decoded_project ~ '_' ~ blockchain ~ '_ctokens' ) }} +), + +base_withdraw_actions as ( + {% for src in sources %} + select + w.contract_address, w.evt_tx_hash, w.evt_index, w.evt_block_time, w.evt_block_number, + + w.src as withdraw_from, + w.to as withdraw_dst, + w.amount as withdraw_amt, + + t."from" as transfer_from, + t.to as transfer_to, + t.amount as transfer_amt, + + coalesce(least(t.amount,w.amount),0) as amount_withdrawn, + w.amount - coalesce(least(t.amount,w.amount),0) as amount_borrowed, + case + when t.amount is null then 'borrow' + when w.amount = t.amount then 'withdraw' + when w.amount < t.amount+10 then 'withdraw' -- accuracy fix + else 'borrow + withdraw' + end as action + from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Withdraw' )}} w + left join {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Transfer' )}} t + on w.evt_tx_hash = t.evt_tx_hash + and w.contract_address = t.contract_address + and w.evt_index+1 = t.evt_index + {% if is_incremental() %} + where {{ incremental_predicate('w.evt_block_time') }} + {% endif %} + {% if not loop.last %} + union all + {% endif %} + {% endfor %} +), + +base_supply_actions as ( + {% for src in sources %} + select + s.contract_address, s.evt_tx_hash, s.evt_index, s.evt_block_time, s.evt_block_number, + + s."from" as supply_from, + s.dst as supply_dst, + s.amount as supply_amt, + + t."from" as transfer_from, + t.to as transfer_to, + t.amount as transfer_amt, + + coalesce(t.amount,0) as amount_supplied, + s.amount - coalesce(t.amount,0) as amount_repaid, + case + when t.amount is null then 'repay' + when s.amount = t.amount then 'supply' + when s.amount < t.amount+10 then 'supply' -- accuracy fix + else 'repay + supply' + end as action + from {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Supply' )}} s + left join {{ source( decoded_project ~ '_' ~ blockchain, src["contract"] ~ '_evt_Transfer' )}} t + on s.evt_tx_hash = t.evt_tx_hash + and s.contract_address = t.contract_address + and s.evt_index+1 = t.evt_index + {% if is_incremental() %} + where {{ incremental_predicate('s.evt_block_time') }} + {% endif %} + {% if not loop.last %} + union all + {% endif %} + {% endfor %} +), + base_supply as ( select 'supply' as transaction_type, @@ -183,7 +257,7 @@ base_supply as ( from src_SupplyCollateral union all select - 'repay' as transaction_type, + 'withdraw' as transaction_type, asset as token_address, src as depositor, cast(null as varbinary) as on_behalf_of, @@ -211,6 +285,48 @@ base_supply as ( evt_block_time, evt_block_number from src_AbsorbCollateral + + union all + select + 'supply' as transaction_type, + ctokens.asset_address as token_address, + supply_from as depositor, + supply_dst as on_behalf_of, + cast(null as varbinary) as withdrawn_to, + cast(null as varbinary) as liquidator, + cast(amount_supplied as double) as amount, + contract_address, + evt_tx_hash, + evt_index, + evt_block_time, + evt_block_number + from base_supply_actions + join ( + select distinct comet_contract_address, asset_address from ctokens + ) ctokens on base_supply_actions.contract_address = ctokens.comet_contract_address + where amount_supplied is not null + and amount_supplied > 0 + + union all + select + 'withdraw' as transaction_type, + ctokens.asset_address as token_address, + withdraw_from as depositor, + cast(null as varbinary) as on_behalf_of, + withdraw_dst as withdrawn_to, + cast(null as varbinary) as liquidator, + -1 * cast(amount_withdrawn as double) as amount, + contract_address, + evt_tx_hash, + evt_index, + evt_block_time, + evt_block_number + from base_withdraw_actions + join ( + select distinct comet_contract_address, asset_address from ctokens + ) ctokens on base_withdraw_actions.contract_address = ctokens.comet_contract_address + where amount_withdrawn is not null + and amount_withdrawn > 0 ) select diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/balancer_liquidity.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/balancer_liquidity.sql index 57fb1122ef5..a278ac524f6 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/balancer_liquidity.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/balancer_liquidity.sql @@ -19,6 +19,7 @@ ref('balancer_v1_ethereum_liquidity') , ref('balancer_v2_avalanche_c_liquidity') , ref('balancer_v2_base_liquidity') , ref('balancer_v2_zkevm_liquidity') +, ref('balancer_cowswap_amm_liquidity') ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql index 1c331972d84..f1ffa3f19e2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql @@ -28,10 +28,10 @@ WITH pool_labels AS ( eth_prices AS( SELECT date_trunc('day', minute) AS day, - AVG(price) AS eth_price + APPROX_PERCENTILE(price, 0.5) AS eth_price FROM {{ source('prices', 'usd') }} WHERE blockchain = 'ethereum' - AND symbol = 'ETH' + AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 GROUP BY 1 ), diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/_schema.yml new file mode 100644 index 00000000000..6903436e6ba --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/_schema.yml @@ -0,0 +1,68 @@ +version: 2 + +models: + - name: balancer_cowswap_amm_balances + meta: + blockchain: arbitrum, ethereum, gnosis + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['ethereum', 'gnosis', 'balancer', 'balances'] + description: > + ERC20 token rolling sum balances on Balancer, an automated portfolio manager and trading platform. + columns: + - &day + name: day + description: "UTC event block time truncated to the day mark" + tests: + - not_null + - &blockchain + name: blockchain + description: "" + - &pool_address + name: pool_address + description: "Balancer CoWSwap AMM pool contract address" + - &token_address + name: token_address + description: "Token contract address" + - &token_balance_raw + name: token_balance_raw + description: "Balance of a token" + + - name: balancer_cowswap_amm_liquidity + meta: + blockchain: arbitrum, ethereum, gnosis + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['ethereum', 'gnosis', 'balancer', 'pools', 'liquidity'] + description: > + Balancer CoWSwap AMM pools liquidity by token in Ethereum. + columns: + - *day + - name: pool_id + - *pool_address + - name: pool_symbol + - name: version + - *blockchain + - name: pool_type + - *token_address + - &token_symbol + name: token_symbol + description: "Token symbol" + - *token_balance_raw + - &token_balance + name: token_balance + description: "Balance of the token in the pool" + - &protocol_liquidity_usd + name: protocol_liquidity_usd + description: "Protocol liquidity in USD" + - &protocol_liquidity_eth + name: protocol_liquidity_eth + description: "Protocol liquidity in ETH" + - &pool_liquidity_usd + name: pool_liquidity_usd + description: "Pool liquidity in USD" + - &pool_liquidity_eth + name: pool_liquidity_eth + description: "Pool liquidity in ETH" \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/_schema.yml new file mode 100644 index 00000000000..5681ee49933 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/_schema.yml @@ -0,0 +1,80 @@ +version: 2 + +models: + - name: balancer_cowswap_amm_arbitrum_balances + meta: + blockchain: arbitrum + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['arbitrum', 'balancer', 'balances'] + description: > + ERC20 token rolling sum balances on Balancer, an automated portfolio manager and trading platform. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - pool_address + - token_address + columns: + - &day + name: day + description: "UTC event block time truncated to the day mark" + tests: + - not_null + - &blockchain + name: blockchain + description: "" + - &pool_address + name: pool_address + description: "Balancer CoWSwap AMM pool contract address" + - &token_address + name: token_address + description: "Token contract address" + - &token_balance_raw + name: token_balance_raw + description: "Balance of a token" + + - name: balancer_cowswap_amm_arbitrum_liquidity + meta: + blockchain: arbitrum + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['arbitrum', 'balancer', 'pools', 'liquidity'] + description: > + Balancer CoWSwap AMM pools liquidity by token in arbitrum. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - pool_id + - token_address + columns: + - *day + - name: pool_id + - *pool_address + - name: pool_symbol + - name: version + - *blockchain + - name: pool_type + - *token_address + - &token_symbol + name: token_symbol + description: "Token symbol" + - *token_balance_raw + - &token_balance + name: token_balance + description: "Balance of the token in the pool" + - &protocol_liquidity_usd + name: protocol_liquidity_usd + description: "Protocol liquidity in USD" + - &protocol_liquidity_eth + name: protocol_liquidity_eth + description: "Protocol liquidity in ETH" + - &pool_liquidity_usd + name: pool_liquidity_usd + description: "Pool liquidity in USD" + - &pool_liquidity_eth + name: pool_liquidity_eth + description: "Pool liquidity in ETH" \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_balances.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_balances.sql new file mode 100644 index 00000000000..45940457942 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_balances.sql @@ -0,0 +1,77 @@ +{{ + config( + schema = 'balancer_cowswap_amm_arbitrum', + alias = 'balances', + materialized = 'table', + file_format = 'delta' + ) +}} + +WITH pools AS ( + SELECT + bPool AS pools + FROM {{ source('b_cow_amm_arbitrum', 'BCoWFactory_evt_LOG_NEW_POOL') }} +), + +joins AS ( + SELECT + p.pools AS pool, + DATE_TRUNC('day', e.evt_block_time) AS day, + e.contract_address AS token, + SUM(CAST(value AS int256)) AS amount + FROM {{ source('erc20_arbitrum', 'evt_transfer') }} e + INNER JOIN pools p ON e."to" = p.pools + GROUP BY 1, 2, 3 +), + +exits AS ( + SELECT + p.pools AS pool, + DATE_TRUNC('day', e.evt_block_time) AS day, + e.contract_address AS token, + - SUM(CAST(value AS int256)) AS amount + FROM {{ source('erc20_arbitrum', 'evt_transfer') }} e + INNER JOIN pools p ON e."from" = p.pools + GROUP BY 1, 2, 3 +), + +daily_delta_balance_by_token AS ( + SELECT + pool, + day, + token, + SUM(COALESCE(amount, CAST(0 AS int256))) AS amount + FROM + (SELECT * + FROM joins j + UNION ALL + SELECT * + FROM exits e) foo + GROUP BY 1, 2, 3 +), + +cumulative_balance_by_token AS ( + SELECT + pool, + token, + day, + LEAD(day, 1, now()) OVER (PARTITION BY pool, token ORDER BY day) AS day_of_next_change, + SUM(amount) OVER (PARTITION BY pool, token ORDER BY day ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_amount + FROM daily_delta_balance_by_token +), + +calendar AS ( + SELECT + date_sequence AS day + FROM unnest(sequence(date('2024-07-01'), date(now()), interval '1' day)) AS t(date_sequence) +) + +SELECT + c.day, + 'arbitrum' AS blockchain, + b.pool AS pool_address, + b.token AS token_address, + b.cumulative_amount AS token_balance_raw +FROM calendar c +LEFT JOIN cumulative_balance_by_token b ON b.day <= c.day AND c.day < b.day_of_next_change +WHERE b.pool IS NOT NULL diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_liquidity.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_liquidity.sql new file mode 100644 index 00000000000..8e24f929a3b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/arbitrum/balancer_cowswap_amm_arbitrum_liquidity.sql @@ -0,0 +1,85 @@ +{% set blockchain = 'arbitrum' %} + +{{ + config( + schema='balancer_cowswap_amm_' + blockchain, + alias = 'liquidity', + materialized = 'table', + file_format = 'delta' + ) +}} + +WITH pool_labels AS ( + SELECT + address, + name + FROM {{ source('labels', 'balancer_cowswap_amm_pools') }} + WHERE blockchain = '{{blockchain}}' + ), + + prices AS ( + SELECT + date_trunc('day', minute) AS day, + contract_address AS token, + decimals, + AVG(price) AS price + FROM {{ source('prices', 'usd') }} + WHERE blockchain = '{{blockchain}}' + GROUP BY 1, 2, 3 + ), + + eth_prices AS( + SELECT + date_trunc('day', minute) AS day, + AVG(price) AS eth_price + FROM {{ source('prices', 'usd') }} + WHERE blockchain = 'ethereum' + AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 + GROUP BY 1 + ), + + cumulative_balance AS ( + SELECT + day, + pool_address, + token_address, + token_balance_raw + FROM {{ ref('balancer_cowswap_amm_arbitrum_balances') }} b + ), + + cumulative_usd_balance AS ( + SELECT + b.day, + b.pool_address, + b.token_address, + t.symbol, + token_balance_raw, + token_balance_raw / POWER(10, COALESCE(t.decimals, p1.decimals)) AS token_balance, + token_balance_raw / POWER(10, COALESCE(t.decimals, p1.decimals)) * COALESCE(p1.price, 0) AS protocol_liquidity_usd + FROM cumulative_balance b + LEFT JOIN {{ source('tokens', 'erc20') }} t ON t.contract_address = b.token_address + AND t.blockchain = '{{blockchain}}' + LEFT JOIN prices p1 ON p1.day = b.day + AND p1.token = b.token_address + ) + +SELECT + c.day, + c.pool_address AS pool_id, + c.pool_address, + p.name AS pool_symbol, + '1' AS version, + '{{blockchain}}' AS blockchain, + 'balancer_cowswap_amm' AS pool_type, + c.token_address, + c.symbol AS token_symbol, + c.token_balance_raw, + c.token_balance, + c.protocol_liquidity_usd, + (c.protocol_liquidity_usd) / e.eth_price AS protocol_liquidity_eth, + c.protocol_liquidity_usd AS pool_liquidity_usd, + (c.protocol_liquidity_usd) / e.eth_price AS pool_liquidity_eth +FROM cumulative_usd_balance c +LEFT JOIN pool_labels p ON p.address = c.pool_address +LEFT JOIN eth_prices e ON e.day = c.day +WHERE c.pool_address IS NOT NULL \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_balances.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/balancer_cowswap_amm_balances.sql similarity index 87% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_balances.sql rename to dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/balancer_cowswap_amm_balances.sql index 4493a3fd99e..8fe94461c54 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_balances.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/balancer_cowswap_amm_balances.sql @@ -8,6 +8,7 @@ {% set b_cow_amm_models = [ + ref('balancer_cowswap_amm_arbitrum_balances'), ref('balancer_cowswap_amm_ethereum_balances'), ref('balancer_cowswap_amm_gnosis_balances') ] %} @@ -17,6 +18,7 @@ FROM ( {% for model in b_cow_amm_models %} SELECT day, + blockchain, pool_address, token_address, token_balance_raw diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_liquidity.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/balancer_cowswap_amm_liquidity.sql similarity index 82% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_liquidity.sql rename to dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/balancer_cowswap_amm_liquidity.sql index b59111baacd..e0c2bf825c8 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/balancer_cowswap_amm_liquidity.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/balancer_cowswap_amm_liquidity.sql @@ -7,6 +7,7 @@ }} {% set b_cow_amm_models = [ + ref('balancer_cowswap_amm_arbitrum_liquidity'), ref('balancer_cowswap_amm_ethereum_liquidity'), ref('balancer_cowswap_amm_gnosis_liquidity') ] %} @@ -27,7 +28,9 @@ FROM ( token_balance_raw, token_balance, protocol_liquidity_usd, - protocol_liquidity_eth + protocol_liquidity_eth, + pool_liquidity_usd, + pool_liquidity_eth FROM {{ model }} {% if not loop.last %} UNION ALL diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/_schema.yml new file mode 100644 index 00000000000..449024c64fa --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/_schema.yml @@ -0,0 +1,80 @@ +version: 2 + +models: + - name: balancer_cowswap_amm_ethereum_balances + meta: + blockchain: ethereum + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['ethereum', 'balancer', 'balances'] + description: > + ERC20 token rolling sum balances on Balancer, an automated portfolio manager and trading platform. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - pool_address + - token_address + columns: + - &day + name: day + description: "UTC event block time truncated to the day mark" + tests: + - not_null + - &blockchain + name: blockchain + description: "" + - &pool_address + name: pool_address + description: "Balancer CoWSwap AMM pool contract address" + - &token_address + name: token_address + description: "Token contract address" + - &token_balance_raw + name: token_balance_raw + description: "Balance of a token" + + - name: balancer_cowswap_amm_ethereum_liquidity + meta: + blockchain: ethereum + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['ethereum', 'balancer', 'pools', 'liquidity'] + description: > + Balancer CoWSwap AMM pools liquidity by token in ethereum. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - pool_id + - token_address + columns: + - *day + - name: pool_id + - *pool_address + - name: pool_symbol + - name: version + - *blockchain + - name: pool_type + - *token_address + - &token_symbol + name: token_symbol + description: "Token symbol" + - *token_balance_raw + - &token_balance + name: token_balance + description: "Balance of the token in the pool" + - &protocol_liquidity_usd + name: protocol_liquidity_usd + description: "Protocol liquidity in USD" + - &protocol_liquidity_eth + name: protocol_liquidity_eth + description: "Protocol liquidity in ETH" + - &pool_liquidity_usd + name: pool_liquidity_usd + description: "Pool liquidity in USD" + - &pool_liquidity_eth + name: pool_liquidity_eth + description: "Pool liquidity in ETH" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_balances.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_balances.sql similarity index 98% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_balances.sql rename to dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_balances.sql index f28343b5f38..dd8d6c4221f 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_balances.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_balances.sql @@ -68,6 +68,7 @@ calendar AS ( SELECT c.day, + 'ethereum' AS blockchain, b.pool AS pool_address, b.token AS token_address, b.cumulative_amount AS token_balance_raw diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_liquidity.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_liquidity.sql similarity index 85% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_liquidity.sql rename to dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_liquidity.sql index ab7b91a7660..3d5e484dab2 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_liquidity.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/ethereum/balancer_cowswap_amm_ethereum_liquidity.sql @@ -13,7 +13,8 @@ WITH pool_labels AS ( SELECT address, name - FROM {{ ref('labels_balancer_cowswap_amm_pools_ethereum') }} + FROM {{ source('labels', 'balancer_cowswap_amm_pools') }} + WHERE blockchain = '{{blockchain}}' ), prices AS ( @@ -30,10 +31,10 @@ WITH pool_labels AS ( eth_prices AS( SELECT date_trunc('day', minute) AS day, - AVG(price) AS eth_price + APPROX_PERCENTILE(price, 0.5) AS eth_price FROM {{ source('prices', 'usd') }} WHERE blockchain = '{{blockchain}}' - AND symbol = 'ETH' + AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 GROUP BY 1 ), @@ -75,7 +76,9 @@ SELECT c.token_balance_raw, c.token_balance, c.protocol_liquidity_usd, - (c.protocol_liquidity_usd) / e.eth_price AS protocol_liquidity_eth + (c.protocol_liquidity_usd) / e.eth_price AS protocol_liquidity_eth, + c.protocol_liquidity_usd AS pool_liquidity_usd, + (c.protocol_liquidity_usd) / e.eth_price AS pool_liquidity_eth FROM cumulative_usd_balance c LEFT JOIN pool_labels p ON p.address = c.pool_address LEFT JOIN eth_prices e ON e.day = c.day diff --git a/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/_schema.yml new file mode 100644 index 00000000000..75930fd3395 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/_schema.yml @@ -0,0 +1,80 @@ +version: 2 + +models: + - name: balancer_cowswap_amm_gnosis_balances + meta: + blockchain: gnosis + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['gnosis', 'balancer', 'balances'] + description: > + ERC20 token rolling sum balances on Balancer, an automated portfolio manager and trading platform. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - pool_address + - token_address + columns: + - &day + name: day + description: "UTC event block time truncated to the day mark" + tests: + - not_null + - &blockchain + name: blockchain + description: "" + - &pool_address + name: pool_address + description: "Balancer CoWSwap AMM pool contract address" + - &token_address + name: token_address + description: "Token contract address" + - &token_balance_raw + name: token_balance_raw + description: "Balance of a token" + + - name: balancer_cowswap_amm_gnosis_liquidity + meta: + blockchain: gnosis + project: balancer_cowswap_amm + contributors: viniabussafi + config: + tags: ['gnosis', 'balancer', 'pools', 'liquidity'] + description: > + Balancer CoWSwap AMM pools liquidity by token in gnosis. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - pool_id + - token_address + columns: + - *day + - name: pool_id + - *pool_address + - name: pool_symbol + - name: version + - *blockchain + - name: pool_type + - *token_address + - &token_symbol + name: token_symbol + description: "Token symbol" + - *token_balance_raw + - &token_balance + name: token_balance + description: "Balance of the token in the pool" + - &protocol_liquidity_usd + name: protocol_liquidity_usd + description: "Protocol liquidity in USD" + - &protocol_liquidity_eth + name: protocol_liquidity_eth + description: "Protocol liquidity in ETH" + - &pool_liquidity_usd + name: pool_liquidity_usd + description: "Pool liquidity in USD" + - &pool_liquidity_eth + name: pool_liquidity_eth + description: "Pool liquidity in ETH" \ No newline at end of file diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_balances.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_balances.sql similarity index 97% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_balances.sql rename to dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_balances.sql index 371f9f657e4..8f198bc4158 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_balances.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_balances.sql @@ -67,7 +67,8 @@ calendar AS ( ) SELECT - c.day, + c.day, + 'gnosis' AS blockchain, b.pool AS pool_address, b.token AS token_address, b.cumulative_amount AS token_balance_raw diff --git a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_liquidity.sql b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_liquidity.sql similarity index 84% rename from dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_liquidity.sql rename to dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_liquidity.sql index 64721715912..c4f070e73d7 100644 --- a/dbt_subprojects/daily_spellbook/models/_projects/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_liquidity.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/balancer_cowswap_amm/gnosis/balancer_cowswap_amm_gnosis_liquidity.sql @@ -13,7 +13,8 @@ WITH pool_labels AS ( SELECT address, name - FROM {{ ref('labels_balancer_cowswap_amm_pools_gnosis') }} + FROM {{ source('labels', 'balancer_cowswap_amm_pools') }} + WHERE blockchain = '{{blockchain}}' ), prices AS ( @@ -30,10 +31,10 @@ WITH pool_labels AS ( eth_prices AS( SELECT date_trunc('day', minute) AS day, - AVG(price) AS eth_price + APPROX_PERCENTILE(price, 0.5) AS eth_price FROM {{ source('prices', 'usd') }} - WHERE blockchain = '{{blockchain}}' - AND symbol = 'ETH' + WHERE blockchain = 'ethereum' + AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 GROUP BY 1 ), @@ -75,7 +76,9 @@ SELECT c.token_balance_raw, c.token_balance, c.protocol_liquidity_usd, - (c.protocol_liquidity_usd) / e.eth_price AS protocol_liquidity_eth + (c.protocol_liquidity_usd) / e.eth_price AS protocol_liquidity_eth, + c.protocol_liquidity_usd AS pool_liquidity_usd, + (c.protocol_liquidity_usd) / e.eth_price AS pool_liquidity_eth FROM cumulative_usd_balance c LEFT JOIN pool_labels p ON p.address = c.pool_address LEFT JOIN eth_prices e ON e.day = c.day diff --git a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql index 38434d245c9..87c37b1943e 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql @@ -44,7 +44,7 @@ with referrer, partner_fee.bps as partner_fee_bps, partner_fee.recipient as partner_recipient, - cast(quote.slippageBips as integer) as slippage_bips, + cast(quote.slippageBips as double) as slippage_bips, utm, utm.utmSource as utm_source, utm.utmMedium as utm_medium, diff --git a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql index cc4962d9ebe..8219af3a851 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql @@ -111,6 +111,8 @@ known_solver_metadata (address, environment, name) as ( (0xA883710b6DBf008a1CC25722C54583E35884a209, 'prod', 'Horadrim'), (0xc10D4DfDA62227d9EC23Ab0010E2942e48338A60, 'prod', 'Apollo'), (0x008300082C3000009e63680088f8c7f4D3ff2E87, 'prod', 'Copium_Capital'), + (0xC7899Ff6A3aC2FF59261bD960A8C880DF06E1041, 'prod', 'Barter'), + (0xA6A871b612bCE899b1CbBad6E545e5e47Da98b87, 'barn', 'Barter'), (0xa08B00576aeE8d8dd960E08298FAc9fD7C756e36, 'barn', 'Apollo'), (0x2c3A1c33d96C9DcA1c34EB234B1e65F79dEaE60e, 'barn', 'Horadrim'), (0xa5559C2E1302c5Ce82582A6b1E4Aec562C2FbCf4, 'barn', 'Project_Blanc'), diff --git a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql index 7b011c06316..ca24dd452be 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql @@ -86,6 +86,7 @@ known_solver_metadata (address, environment, name) as ( (0x5D665472e2026C405aAc65cC652470a1B8FCff08, 'prod', 'Baseline'), (0xe71D3324E17E99B56c294067370D45111bc968D6, 'prod', 'Quasimodo'), (0xa7c4C18106e92Cea479627D02FAb583D987f17d9, 'prod', 'Gnosis_1inch'), + (0xfaBBDf8a77005C00edBe0000bDC000644c024322, 'prod', 'CopiumCapital'), (0x68dEE65bB88d919463495E5CeA9870a81f1e9413, 'service', 'Withdraw'), (0xa03be496e67ec29bc62f01a428683d7f9c204930, 'service', 'Withdraw'), (0x7524942F9283FBFa8F17b05CC0a9cBde397d25b3, 'test', 'Test 1') diff --git a/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql b/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql index 88a08db5ca6..0a2f233dc5d 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql @@ -99,7 +99,7 @@ dai_referral_payments_addr AS ( steth_referral_payments_addr AS ( SELECT _recipient AS address FROM {{source('lido_ethereum','AllowedRecipientsRegistry_RevShare_evt_RecipientAdded')}} ), - +/* stonks as ( select * from (values ('STETH→DAI', 0x3e2D251275A92a8169A3B17A2C49016e2de492a7), @@ -131,7 +131,7 @@ stonks_orders_txns as ( ) and to in (select address from cow_settlement) ), - +*/ other_expenses_txns AS ( SELECT evt_block_time, @@ -161,7 +161,7 @@ other_expenses_txns AS ( UNION ALL SELECT address FROM diversifications_addresses ) - AND evt_tx_hash NOT IN (select evt_tx_hash from stonks_orders_txns) + -- AND evt_tx_hash NOT IN (select evt_tx_hash from stonks_orders_txns) UNION ALL --ETH outflow SELECT diff --git a/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql b/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql index 9eef9a8bb36..4ab559548b4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql @@ -107,7 +107,7 @@ dai_referral_payments_addr AS ( steth_referral_payments_addr AS ( SELECT _recipient AS address FROM {{source('lido_ethereum','AllowedRecipientsRegistry_RevShare_evt_RecipientAdded')}} ), - +/* stonks as ( select * from (values ('STETH→DAI', 0x3e2D251275A92a8169A3B17A2C49016e2de492a7), @@ -139,7 +139,7 @@ stonks_orders_txns as ( ) and to in (select address from cow_settlement) ), - +*/ other_income_txns AS ( SELECT evt_block_time, @@ -167,7 +167,7 @@ other_income_txns AS ( UNION ALL SELECT address FROM diversifications_addresses ) - AND evt_tx_hash NOT IN (select evt_tx_hash from stonks_orders_txns) + -- AND evt_tx_hash NOT IN (select evt_tx_hash from stonks_orders_txns) UNION ALL --ETH staked by DAO diff --git a/dbt_subprojects/hourly_spellbook/models/_project/lido/lido_accounting.sql b/dbt_subprojects/hourly_spellbook/models/_project/lido/lido_accounting.sql index e84cfef4321..292ed9c29ab 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/lido/lido_accounting.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/lido/lido_accounting.sql @@ -445,6 +445,55 @@ FROM ( FROM {{ref('lido_accounting_ethereum_dai_referral_payment')}} + UNION ALL + + SELECT period, + evt_tx_hash, + '3. Surplus' AS primary_label, + '3.2. Operating Performance' AS secondary_label, + '3.2.3. Sales & Marketing Incentives' AS account, + '3.2.3.2. Deposit Referrals' AS category, + -COALESCE(CAST(amount_token AS DOUBLE), 0), + token + FROM {{ref('lido_accounting_ethereum_steth_referral_payment')}} + + UNION ALL + + SELECT period, + evt_tx_hash, + '1. Assets' as primary_label, + '1.3. Protocol Assets' as secondary_label, + '1.3.1. Protocol Assets' as account, + '1.3.1.1. stETH' AS category, + -COALESCE(CAST(amount_token AS DOUBLE), 0), + token + FROM {{ref('lido_accounting_ethereum_steth_referral_payment')}} + + UNION ALL + + SELECT period, + evt_tx_hash, + '3. Surplus' AS primary_label, + '3.2. Operating Performance' AS secondary_label, + '3.2.3. Sales & Marketing Incentives' AS account, + '3.2.3.2. Deposit Referrals' AS category, + -COALESCE(CAST(amount_token AS DOUBLE), 0), + token + FROM {{ref('lido_accounting_ethereum_steth_referral_payment')}} + + UNION ALL + + SELECT period, + evt_tx_hash, + '1. Assets' as primary_label, + '1.3. Protocol Assets' as secondary_label, + '1.3.1. Protocol Assets' as account, + '1.3.1.1. stETH' AS category, + -COALESCE(CAST(amount_token AS DOUBLE), 0), + token + FROM {{ref('lido_accounting_ethereum_steth_referral_payment')}} + + UNION ALL -- ========================================================= LDO denominated Liquidity Incentives diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_eth_transfers.sql index cb7d7998882..044eff299b4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_eth_transfers.sql @@ -1,78 +1,24 @@ {{ config( - materialized='incremental', - + schema = 'safe_arbitrum', alias = 'eth_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["arbitrum"]\', - "project", - "safe", - \'["tschubotz", "hosuke"]\') }}' + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["arbitrum"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke"]\') }}' ) }} -{% set project_start_date = '2021-06-20' %} - -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'arbitrum' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('arbitrum', 'traces') }} et - inner join {{ ref('safe_arbitrum_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'arbitrum' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('arbitrum', 'traces') }} et - inner join {{ ref('safe_arbitrum_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) +{{ + safe_native_transfers( + blockchain = 'arbitrum' + , native_token_symbol = 'ETH' + , project_start_date = '2021-06-20' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_transactions.sql index 542d26b7a95..bfdc5570742 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_arbitrum', alias = 'transactions', partition_by = ['block_month'], unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["arbitrum"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' + post_hook='{{ expose_spells(blockchains = \'["arbitrum"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' ) }} -select - 'arbitrum' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('arbitrum', 'traces') }} tr -join {{ ref('safe_arbitrum_safes') }} s - on s.address = tr."from" -join {{ ref('safe_arbitrum_singletons') }} ss - on tr.to = ss.address -join {{ source('arbitrum', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2021-06-20' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('arbitrum', '2021-06-20') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql index 11413b70af3..1b43e9f808e 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql @@ -1,78 +1,24 @@ {{ config( - materialized='incremental', - + schema = 'safe_avalanche_c', alias = 'avax_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["avalanche_c"]\', - "project", - "safe", - \'["tschubotz", "hosuke"]\') }}' + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["avalanche_c"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke"]\') }}' ) }} -{% set project_start_date = '2021-10-05' %} - -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'avalanche_c' as blockchain, - 'AVAX' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('avalanche_c', 'traces') }} et - join {{ ref('safe_avalanche_c_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'avalanche_c' as blockchain, - 'AVAX' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('avalanche_c', 'traces') }} et - join {{ ref('safe_avalanche_c_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'avalanche_c' + , native_token_symbol = 'AVAX' + , project_start_date = '2021-10-05' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_transactions.sql index feb336bf32e..cf4429b10b6 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_avalanche_c', alias = 'transactions', partition_by = ['block_month'], unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["avalanche_c"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' + post_hook='{{ expose_spells(blockchains = \'["avalanche_c"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' ) }} -select - 'avalanche_c' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('avalanche_c', 'traces') }} tr -join {{ ref('safe_avalanche_c_safes') }} s - on s.address = tr."from" -join {{ ref('safe_avalanche_c_singletons') }} ss - on tr.to = ss.address -join {{ source('avalanche_c', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2021-10-05' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('avalanche_c', '2021-10-05') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_eth_transfers.sql index c5a631ae1b8..8f7f20d9773 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_eth_transfers.sql @@ -1,77 +1,24 @@ {{ config( - materialized='incremental', - - alias= 'eth_transfers', + schema = 'safe_base', + alias = 'eth_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address', 'amount_raw'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["base"]\', - "project", - "safe", - \'["danielpartida", "hosuke"]\') }}' + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["base"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida", "hosuke"]\') }}' ) }} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - - select - 'base' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('base', 'traces') }} et - join {{ ref('safe_base_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '2023-07-01' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'base' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('base', 'traces') }} et - join {{ ref('safe_base_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '2023-07-01' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'base' + , native_token_symbol = 'ETH' + , project_start_date = '2023-07-01' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_transactions.sql index b9f842df6a2..68218091539 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/base/safe_base_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_base', alias= 'transactions', partition_by = ['block_month'], unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["base"]\', - "project", - "safe", - \'["danielpartida"]\') }}' + post_hook='{{ expose_spells(blockchains = \'["base"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida"]\') }}' ) }} -select - 'base' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('base', 'traces') }} tr -join {{ ref('safe_base_safes') }} s - on s.address = tr."from" -join {{ ref('safe_base_singletons') }} ss - on tr.to = ss.address -join {{ source('base', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2023-07-01' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('base', '2023-07-01') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_eth_transfers.sql index eb806f0c02a..f2aeffe2b88 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_eth_transfers.sql @@ -1,83 +1,24 @@ {{ config( - materialized='incremental', schema = 'safe_blast', - alias= 'eth_transfers', + alias = 'eth_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook = '{{ expose_spells( - blockchains = \'["blast"]\', - spell_type = "project", - spell_name = "safe", - contributors = \'["danielpartida"]\') }}' + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["blast"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida", "hosuke"]\') }}' ) }} -{% set project_start_date = '2024-02-24' %} - -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - - select - 'blast' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('blast', 'traces') }} et - join {{ ref('safe_blast_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '{{project_start_date}}' -- for initial query optimisation - {% else %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'blast' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('blast', 'traces') }} et - join {{ ref('safe_blast_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - and p.minute > date_trunc('day', now() - interval '10' day) - {% endif %} \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'blast' + , native_token_symbol = 'ETH' + , project_start_date = '2024-02-24' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_transactions.sql index 0e9d92fe9e3..8f5304ef94f 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/blast/safe_blast_transactions.sql @@ -17,52 +17,4 @@ {% set project_start_date = '2024-02-24' %} -select - 'blast' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('blast', 'traces') }} tr -join {{ ref('safe_blast_safes') }} s - on s.address = tr."from" -join {{ ref('safe_blast_singletons') }} ss - on tr.to = ss.address -join {{ source('blast', 'transactions') }} et - on tr.tx_hash = et.hash - {% if is_incremental() %} - and {{ incremental_predicate('et.block_time') }} - {% endif %} - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% else %} - and {{ incremental_predicate('tr.block_time') }} - {% endif %} +{{ safe_transactions('blast', project_start_date) }} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_bnb_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_bnb_transfers.sql index 55963e4c7f3..2974ddbaa3e 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_bnb_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_bnb_transfers.sql @@ -1,78 +1,24 @@ {{ config( - materialized='incremental', - + schema = 'safe_bnb', alias = 'bnb_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["bnb"]\', - "project", - "safe", - \'["tschubotz", "hosuke"]\') }}' - ) + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["bnb"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke"]\') }}' + ) }} -{% set project_start_date = '2021-01-26' %} - -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'bnb' as blockchain, - 'BNB' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('bnb', 'traces') }} et - join {{ ref('safe_bnb_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'bnb' as blockchain, - 'BNB' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('bnb', 'traces') }} et - join {{ ref('safe_bnb_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'bnb' + , native_token_symbol = 'BNB' + , project_start_date = '2021-01-26' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_transactions.sql index 32fbcc99a86..9349d479deb 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/bnb/safe_bnb_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_bnb', alias = 'transactions', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address'], + unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["bnb"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' - ) + post_hook='{{ expose_spells(blockchains = \'["bnb"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' + ) }} -select - 'bnb' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('bnb', 'traces') }} tr -join {{ ref('safe_bnb_safes') }} s - on s.address = tr."from" -join {{ ref('safe_bnb_singletons') }} ss - on tr.to = ss.address -join {{ source('bnb', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2021-01-26' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('bnb', '2021-01-26') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_celo_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_celo_transfers.sql index 699dda8430e..3296e7e0eab 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_celo_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_celo_transfers.sql @@ -1,79 +1,24 @@ {{ config( - materialized='incremental', - - schema='safe_celo', + schema = 'safe_celo', alias = 'celo_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["celo"]\', - "project", - "safe", - \'["danielpartida", "hosuke"]\') }}' + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["celo"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida", "hosuke"]\') }}' ) }} -{% set project_start_date = '2021-06-20' %} - -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'celo' as blockchain, - 'CELO' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('celo', 'traces') }} et - inner join {{ ref('safe_celo_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'celo' as blockchain, - 'CELO' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('celo', 'traces') }} et - inner join {{ ref('safe_celo_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) +{{ + safe_native_transfers( + blockchain = 'celo' + , native_token_symbol = 'CELO' + , project_start_date = '2021-06-20' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_transactions.sql index 3ac43cfaa55..6c61e358b25 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/celo/safe_celo_transactions.sql @@ -1,64 +1,17 @@ {{ config( materialized='incremental', - schema='safe_celo', alias = 'transactions', partition_by = ['block_month'], unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["celo"]\', - "project", - "safe", - \'["danielpartida", "hosuke"]\') }}' + post_hook='{{ expose_spells(blockchains = \'["celo"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida", "hosuke"]\') }}' ) }} -select - 'celo' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('celo', 'traces') }} tr -join {{ ref('safe_celo_safes') }} s - on s.address = tr."from" -join {{ ref('safe_celo_singletons') }} ss - on tr.to = ss.address -join {{ source('celo', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2021-06-20' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('celo', '2021-06-20') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_balances.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_balances.sql index 4f9e0388fd8..9c8ddd66c5b 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_balances.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_balances.sql @@ -14,29 +14,30 @@ ) }} -with changed_balances as ( +with safes as ( + select + address, + blockchain + from {{ ref('safe_ethereum_safes') }} + where blockchain = 'ethereum' +), +token_balances as ( select a.blockchain, - day, + a.day, a.address, - token_symbol, - token_address, - token_standard, - token_id, - balance, - lead(cast(day as date)) over (partition by token_address, a.address, token_id order by day asc) as next_update_day + a.token_symbol, + a.token_address, + a.token_standard, + a.token_id, + a.balance, + lead(cast(day as timestamp)) over (partition by token_address, a.address, token_id order by day asc) as next_update_day from {{ source('tokens_ethereum', 'balances_daily_agg') }} a - join ( - select - address - , blockchain - from {{ ref('safe_ethereum_safes') }} s - where blockchain = 'ethereum' - ) q on q.address = a.address - where day >= date('2021-07-01') - and token_standard in ('native', 'erc20') + join safes s on a.address = s.address + where a.day >= date('2021-07-01') + and a.token_standard in ('native', 'erc20') {% if is_incremental() %} - and {{ incremental_predicate('day') }} + and {{ incremental_predicate('a.day') }} {% endif %} ), days as ( @@ -47,18 +48,20 @@ days as ( ), forward_fill as ( select - blockchain, + s.blockchain, cast(d.day as date) as day, - address, - token_symbol, - token_address, - token_standard, - token_id, - balance + s.address, + coalesce(b.token_symbol, lag(b.token_symbol) over (partition by s.address, b.token_address order by d.day)) as token_symbol, + coalesce(b.token_address, lag(b.token_address) over (partition by s.address, b.token_address order by d.day)) as token_address, + coalesce(b.token_standard, lag(b.token_standard) over (partition by s.address, b.token_address order by d.day)) as token_standard, + coalesce(b.token_id, lag(b.token_id) over (partition by s.address, b.token_address order by d.day)) as token_id, + coalesce(b.balance, lag(b.balance) over (partition by s.address, b.token_address order by d.day)) as balance from days d - left join changed_balances b - on d.day >= b.day - and (b.next_update_day is null OR d.day < b.next_update_day) + cross join safes s + left join token_balances b + on s.address = b.address + and d.day >= b.day + and (b.next_update_day is null OR d.day < b.next_update_day) where d.day >= cast('2021-07-01' as date) {% if is_incremental() %} and {{ incremental_predicate('d.day') }} @@ -80,13 +83,13 @@ from ( ) b left join {{ ref('prices_usd_daily') }} p on ( - token_standard = 'erc20' + b.token_standard = 'erc20' and b.blockchain = p.blockchain and b.token_address = p.contract_address and b.day = p.day ) or ( - token_standard = 'native' + b.token_standard = 'native' and p.blockchain is null and p.contract_address is null and p.symbol = 'ETH' diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_eth_transfers.sql index 3f69cc22db4..3409f14e036 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_eth_transfers.sql @@ -1,76 +1,24 @@ {{ config( - materialized='incremental', - + schema = 'safe_ethereum', alias = 'eth_transfers', partition_by = ['block_month'], - unique_key = ['address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["ethereum"]\', - "project", - "safe", - \'["sche", "tschubotz", "hosuke"]\') }}' - ) + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["sche", "tschubotz", "hosuke"]\') }}' + ) }} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'ethereum' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('ethereum', 'traces') }} et - join {{ ref('safe_ethereum_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '2018-11-24' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} - - union all - - select - 'ethereum' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('ethereum', 'traces') }} et - join {{ ref('safe_ethereum_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '2018-11-24' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'ethereum', + native_token_symbol = 'ETH', + project_start_date = '2018-11-24' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_transactions.sql index b3ed5440647..6cdb08cec41 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_ethereum', alias = 'transactions', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address'], + unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["ethereum"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' - ) + post_hook='{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' + ) }} -select - 'ethereum' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('ethereum', 'traces') }} tr -join {{ ref('safe_ethereum_safes') }} s - on s.address = tr."from" -join {{ ref('safe_ethereum_singletons') }} ss - on tr.to = ss.address -join {{ source('ethereum', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2018-11-24' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('ethereum', '2018-11-24') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/fantom/safe_fantom_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/fantom/safe_fantom_transactions.sql index f3b3978cf7f..400751c4750 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/fantom/safe_fantom_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/fantom/safe_fantom_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_fantom', alias = 'transactions', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address'], + unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["fantom"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' - ) + post_hook='{{ expose_spells(blockchains = \'["fantom"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' + ) }} -select - 'fantom' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('fantom', 'traces') }} tr -join {{ ref('safe_fantom_safes') }} s - on s.address = tr."from" -join {{ ref('safe_fantom_singletons') }} ss - on tr.to = ss.address -join {{ source('fantom', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2021-11-25' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('fantom', '2021-11-25') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_xdai_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_xdai_transfers.sql index 6b1a1385420..b70dd5b2c32 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_xdai_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_xdai_transfers.sql @@ -1,101 +1,53 @@ {{ config( - materialized='incremental', - + schema = 'safe_gnosis', alias = 'xdai_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["gnosis"]\', - "project", - "safe", - \'["tschubotz", "hosuke"]\') }}' - ) + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["gnosis"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke"]\') }}' + ) }} {% set project_start_date = '2020-05-21' %} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'gnosis' as blockchain, - 'XDAI' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('gnosis', 'traces') }} et - join {{ ref('safe_gnosis_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'gnosis' as blockchain, - 'XDAI' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('gnosis', 'traces') }} et - join {{ ref('safe_gnosis_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all +{{ + safe_native_transfers( + blockchain = 'gnosis', + native_token_symbol = 'XDAI', + project_start_date = project_start_date + ) +}} - select - 'gnosis' as blockchain, - 'XDAI' as symbol, - s.address, - try_cast(date_trunc('day', a.evt_block_time) as date) as block_date, - CAST(date_trunc('month', a.evt_block_time) as DATE) as block_month, - a.evt_block_time as block_time, - CAST(a.amount AS INT256) as amount_raw, - a.evt_tx_hash as tx_hash, - cast(a.evt_index as varchar) as trace_address - from {{ source('xdai_gnosis', 'BlockRewardAuRa_evt_AddedReceiver') }} a - join {{ ref('safe_gnosis_safes') }} s - on a.receiver = s.address - {% if not is_incremental() %} - where a.evt_block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where a.evt_block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t +union all +select + 'gnosis' as blockchain, + 'XDAI' as symbol, + s.address, + try_cast(date_trunc('day', a.evt_block_time) as date) as block_date, + CAST(date_trunc('month', a.evt_block_time) as DATE) as block_month, + a.evt_block_time as block_time, + CAST(a.amount AS INT256) as amount_raw, + a.evt_tx_hash as tx_hash, + cast(a.evt_index as varchar) as trace_address, + p.price * CAST(a.amount AS DOUBLE) / 1e18 AS amount_usd +from {{ source('xdai_gnosis', 'BlockRewardAuRa_evt_AddedReceiver') }} a +join {{ ref('safe_gnosis_safes') }} s + on a.receiver = s.address left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file + and p.symbol = 'XDAI' + and p.minute = date_trunc('minute', a.evt_block_time) +{% if not is_incremental() %} +where a.evt_block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation +{% endif %} +{% if is_incremental() %} +-- to prevent potential counterfactual safe deployment issues we take a bigger interval +where a.evt_block_time > date_trunc('day', now() - interval '10' day) +{% endif %} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_eth_transfers.sql index f62b5187e66..e978e40b97d 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_eth_transfers.sql @@ -1,78 +1,24 @@ {{ config( - materialized='incremental', - + schema = 'safe_goerli', alias = 'eth_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["goerli"]\', - "project", - "safe", - \'["tschubotz", "hosuke"]\') }}' - ) + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["goerli"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke"]\') }}' + ) }} -{% set project_start_date = '2019-09-03' %} - -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'goerli' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('goerli', 'traces') }} et - join {{ ref('safe_goerli_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'goerli' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('goerli', 'traces') }} et - join {{ ref('safe_goerli_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) +{{ + safe_native_transfers( + blockchain = 'goerli', + native_token_symbol = 'ETH', + project_start_date = '2019-09-03' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_transactions.sql index 9e0fc49da46..332c84d32d2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/goerli/safe_goerli_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_goerli', alias = 'transactions', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address'], + unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["goerli"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' - ) + post_hook='{{ expose_spells(blockchains = \'["goerli"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' + ) }} -select - 'goerli' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('goerli', 'traces') }} tr -join {{ ref('safe_goerli_safes') }} s - on s.address = tr."from" -join {{ ref('safe_goerli_singletons') }} ss - on tr.to = ss.address -join {{ source('goerli', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2019-09-03' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('goerli', '2019-09-03') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_eth_transfers.sql index 198d83b0a05..9dfa5910b73 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_eth_transfers.sql @@ -1,13 +1,13 @@ {{ config( - materialized='incremental', schema = 'safe_linea', alias= 'eth_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], post_hook = '{{ expose_spells( blockchains = \'["linea"]\', spell_type = "project", @@ -18,66 +18,10 @@ {% set project_start_date = '2023-07-11' %} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - - select - 'linea' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('linea', 'traces') }} et - join {{ ref('safe_linea_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '{{project_start_date}}' -- for initial query optimisation - {% else %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'linea' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('linea', 'traces') }} et - join {{ ref('safe_linea_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - and p.minute > date_trunc('day', now() - interval '10' day) - {% endif %} \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'linea', + native_token_symbol = 'ETH', + project_start_date = project_start_date + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_transactions.sql index 4426629ee39..3c23779a445 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/linea/safe_linea_transactions.sql @@ -1,7 +1,7 @@ {{ config( materialized='incremental', -schema = 'safe_linea', + schema = 'safe_linea', alias= 'transactions', partition_by = ['block_month'], unique_key = ['block_date', 'tx_hash', 'trace_address'], @@ -15,54 +15,4 @@ schema = 'safe_linea', ) }} -{% set project_start_date = '2023-07-11' %} - -select - 'linea' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('linea', 'traces') }} tr -join {{ ref('safe_linea_safes') }} s - on s.address = tr."from" -join {{ ref('safe_linea_singletons') }} ss - on tr.to = ss.address -join {{ source('linea', 'transactions') }} et - on tr.tx_hash = et.hash - {% if is_incremental() %} - and {{ incremental_predicate('et.block_time') }} - {% endif %} - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% else %} - and {{ incremental_predicate('tr.block_time') }} - {% endif %} +{{ safe_transactions('linea', '2023-07-11') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_balances.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_balances.sql new file mode 100644 index 00000000000..47a58b613c4 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_balances.sql @@ -0,0 +1,103 @@ +{{ + config( + schema = 'safe_optimism', + alias = 'balances', + partition_by = ['day'], + materialized = 'incremental', + incremental_strategy = 'merge', + file_format = 'delta', + unique_key = ['day', 'blockchain', 'address', 'token_address'], + post_hook = '{{ expose_spells(\'["optimism"]\', + "project", + "safe", + \'["safeintern"]\') }}' + ) +}} + +with safes as ( + -- Capture all safes from a reference table + select + address, + blockchain + from {{ ref('safe_optimism_safes') }} + where blockchain = 'optimism' +), +token_balances as ( + -- Extract token balances with balance changes for safes from the daily aggregation + select + a.blockchain, + a.day, + a.address, + a.token_symbol, + a.token_address, + a.token_standard, + a.token_id, + a.balance, + lead(cast(day as timestamp)) over (partition by token_address, a.address, token_id order by day asc) as next_update_day + from {{ source('tokens_optimism', 'balances_daily_agg') }} a + join safes s on a.address = s.address + where a.day >= date('2021-07-01') + and a.token_standard in ('native', 'erc20') + {% if is_incremental() %} + and {{ incremental_predicate('a.day') }} + {% endif %} +), +days as ( + -- Generate a sequence of days to ensure forward-filling + select * + from unnest( + sequence(cast('2021-07-01' as date), date(date_trunc('day', now())), interval '1' day) + ) as foo(day) +), +forward_fill as ( + -- Forward-fill balances across all safes, even if there's no balance change + select + s.blockchain, + cast(d.day as date) as day, + s.address, + coalesce(b.token_symbol, lag(b.token_symbol) over (partition by s.address, b.token_address order by d.day)) as token_symbol, + coalesce(b.token_address, lag(b.token_address) over (partition by s.address, b.token_address order by d.day)) as token_address, + coalesce(b.token_standard, lag(b.token_standard) over (partition by s.address, b.token_address order by d.day)) as token_standard, + coalesce(b.token_id, lag(b.token_id) over (partition by s.address, b.token_address order by d.day)) as token_id, + coalesce(b.balance, lag(b.balance) over (partition by s.address, b.token_address order by d.day)) as balance + from days d + cross join safes s + left join token_balances b + on s.address = b.address + and d.day >= b.day + and (b.next_update_day is null OR d.day < b.next_update_day) + where d.day >= cast('2021-07-01' as date) + {% if is_incremental() %} + and {{ incremental_predicate('d.day') }} + {% endif %} +) +select + b.day, + b.blockchain, + b.address, + b.token_address, + b.token_standard, + b.token_id, + b.token_symbol, + sum(b.balance) as token_balance, + sum(b.balance * p.price) as balance_usd +from ( + -- Ensure that we only include records with positive balances for final output + select * from forward_fill + where balance > 0 +) b +left join {{ ref('prices_usd_daily') }} p + on ( + b.token_standard = 'erc20' + and b.blockchain = p.blockchain + and b.token_address = p.contract_address + and b.day = p.day + ) + or ( + b.token_standard = 'native' + and p.blockchain is null + and p.contract_address is null + and p.symbol = 'ETH' + and b.day = p.day + ) +group by 1, 2, 3, 4, 5, 6, 7 diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_eth_transfers.sql index 7c912f47a1c..fcbb59fcca4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_eth_transfers.sql @@ -1,131 +1,84 @@ {{ config( - materialized='incremental', - + schema = 'safe_optimism', alias = 'eth_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["optimism"]\', - "project", - "safe", - \'["tschubotz", "hosuke"]\') }}' + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["optimism"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke"]\') }}' ) }} {% set project_start_date = '2021-11-17' %} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd +{{ + safe_native_transfers( + blockchain = 'optimism', + native_token_symbol = 'ETH', + project_start_date = project_start_date + ) +}} + +union all -from ( - select - 'optimism' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('optimism', 'traces') }} et - inner join {{ ref('safe_optimism_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type +select + 'optimism' as blockchain, + 'ETH' as symbol, + s.address, + try_cast(date_trunc('day', r.evt_block_time) as date) as block_date, + CAST(date_trunc('month', r.evt_block_time) as DATE) as block_month, + r.evt_block_time as block_time, + CAST(r.value AS INT256) as amount_raw, + r.evt_tx_hash as tx_hash, + cast(r.evt_index as varchar) as trace_address, + p.price * CAST(r.value AS DOUBLE) / 1e18 AS amount_usd +from {{ source('erc20_optimism', 'evt_Transfer') }} r +join {{ ref('safe_optimism_safes') }} s + on r.to = s.address +left join {{ source('prices', 'usd') }} p on p.blockchain is null + and p.symbol = 'ETH' + and p.minute = date_trunc('minute', r.evt_block_time) +where + r.contract_address = 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000 + and r.value > UINT256 '0' {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation + and r.evt_block_time > TIMESTAMP '{{project_start_date}}' {% endif %} {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) + and r.evt_block_time >= date_trunc('day', now() - interval '10' day) {% endif %} - - union all - - select - 'optimism' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('optimism', 'traces') }} et - inner join {{ ref('safe_optimism_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type + +union all + +select + 'optimism' as blockchain, + 'ETH' as symbol, + s.address, + try_cast(date_trunc('day', r.evt_block_time) as date) as block_date, + CAST(date_trunc('month', r.evt_block_time) as DATE) as block_month, + r.evt_block_time as block_time, + -CAST(r.value AS INT256) as amount_raw, + r.evt_tx_hash as tx_hash, + cast(r.evt_index as varchar) as trace_address, + -p.price * CAST(r.value AS DOUBLE) / 1e18 AS amount_usd +from {{ source('erc20_optimism', 'evt_Transfer') }} r +join {{ ref('safe_optimism_safes') }} s + on r."from" = s.address +left join {{ source('prices', 'usd') }} p on p.blockchain is null + and p.symbol = 'ETH' + and p.minute = date_trunc('minute', r.evt_block_time) +where + r.contract_address = 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000 + and r.value > UINT256 '0' {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation + and r.evt_block_time > TIMESTAMP '{{project_start_date}}' {% endif %} {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) + and r.evt_block_time >= date_trunc('day', now() - interval '10' day) {% endif %} - - union all - --ETH Transfers from deposits and withdrawals are ERC20 transfers of the 'deadeadead' ETH token. These do not appear in traces. - - select - 'optimism' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', r.evt_block_time) as date) as block_date, - CAST(date_trunc('month', r.evt_block_time) as DATE) as block_month, - r.evt_block_time as block_time, - CAST(r.value AS INT256) as amount_raw, - r.evt_tx_hash as tx_hash, - cast(r.evt_index as varchar) as trace_address - from {{ source('erc20_optimism', 'evt_Transfer') }} r - inner join {{ ref('safe_optimism_safes') }} s - on r.to = s.address - where - r.contract_address = 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000 - and r.value > UINT256 '0' - {% if not is_incremental() %} - and r.evt_block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - and r.evt_block_time >= date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'optimism' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', r.evt_block_time) as date) as block_date, - CAST(date_trunc('month', r.evt_block_time) as DATE) as block_month, - r.evt_block_time as block_time, - -CAST(r.value AS INT256) as amount_raw, - r.evt_tx_hash as tx_hash, - cast(r.evt_index as varchar) as trace_address - from {{ source('erc20_optimism', 'evt_Transfer') }} r - inner join {{ ref('safe_optimism_safes') }} s - on r."from" = s.address - where - r.contract_address = 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000 - and r.value > UINT256 '0' - {% if not is_incremental() %} - and r.evt_block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - and r.evt_block_time >= date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_schema.yml index acd175cf7e1..574fa48fabf 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_schema.yml @@ -150,3 +150,29 @@ models: name: amount_usd description: "USD amount of transferred ETH" + - name: safe_optimism_balances + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - blockchain + - address + - token_address + meta: + blockchain: optimism + project: safe + contributors: safeintern + config: + tags: ['safe', 'optimism'] + description: “Safe addresses balances” + columns: + - name: day + - name: blockchain + - name: address + - name: token_address + - name: token_standard + - name: token_id + - name: token_symbol + - name: token_balance + - name: balance_usd + diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_transactions.sql index 0ed8cc2c8ef..f253f4be33e 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/optimism/safe_optimism_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_optimism', alias = 'transactions', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address'], + unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["optimism"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' - ) + post_hook='{{ expose_spells(blockchains = \'["optimism"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' + ) }} -select - 'optimism' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('optimism', 'traces') }} tr -join {{ ref('safe_optimism_safes') }} s - on s.address = tr."from" -join {{ ref('safe_optimism_singletons') }} ss - on tr.to = ss.address -join {{ source('optimism', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2021-11-17' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('optimism', '2021-11-17') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_balances.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_balances.sql new file mode 100644 index 00000000000..e826bb9fdb2 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_balances.sql @@ -0,0 +1,104 @@ +{{ + config( + schema = 'safe_polygon', + alias = 'balances', + partition_by = ['day'], + materialized = 'incremental', + incremental_strategy = 'merge', + file_format = 'delta', + unique_key = ['day', 'blockchain', 'address', 'token_address'], + post_hook = '{{ expose_spells(blockchains = \'["polygon"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["safeintern"]\') }}' + ) +}} + +{% set project_start_date = '2021-07-01' %} + +with safes as ( + select + address, + blockchain + from {{ ref('safe_polygon_safes') }} + where blockchain = 'polygon' +), +token_balances as ( + + select + a.blockchain, + a.day, + a.address, + a.token_symbol, + a.token_address, + a.token_standard, + a.token_id, + a.balance, + lead(cast(day as timestamp)) over (partition by token_address, a.address, token_id order by day asc) as next_update_day + from {{ source('tokens_polygon', 'balances_daily_agg') }} a + join safes s on a.address = s.address + where a.day >= date('2021-07-01') + and a.token_standard in ('native', 'erc20') + {% if is_incremental() %} + and {{ incremental_predicate('a.day') }} + {% endif %} +), +days as ( + -- Generate a sequence of days to ensure forward-filling + select * + from unnest( + sequence(cast('2021-07-01' as date), date(date_trunc('day', now())), interval '1' day) + ) as foo(day) +), +forward_fill as ( + -- Forward-fill balances across all safes, even if there's no balance change + select + s.blockchain, + cast(d.day as date) as day, + s.address, + coalesce(b.token_symbol, lag(b.token_symbol) over (partition by s.address, b.token_address order by d.day)) as token_symbol, + coalesce(b.token_address, lag(b.token_address) over (partition by s.address, b.token_address order by d.day)) as token_address, + coalesce(b.token_standard, lag(b.token_standard) over (partition by s.address, b.token_address order by d.day)) as token_standard, + coalesce(b.token_id, lag(b.token_id) over (partition by s.address, b.token_address order by d.day)) as token_id, + coalesce(b.balance, lag(b.balance) over (partition by s.address, b.token_address order by d.day)) as balance + from days d + cross join safes s + left join token_balances b + on s.address = b.address + and d.day >= b.day + and (b.next_update_day is null OR d.day < b.next_update_day) + where d.day >= cast('2021-07-01' as date) + {% if is_incremental() %} + and {{ incremental_predicate('d.day') }} + {% endif %} +) +select + b.day, + b.blockchain, + b.address, + b.token_address, + b.token_standard, + b.token_id, + b.token_symbol, + sum(b.balance) as token_balance, + sum(b.balance * p.price) as balance_usd +from ( + -- Ensure that we only include records with positive balances for final output + select * from forward_fill + where balance > 0 +) b +left join {{ ref('prices_usd_daily') }} p + on ( + b.token_standard = 'erc20' + and b.blockchain = p.blockchain + and b.token_address = p.contract_address + and b.day = p.day + ) + or ( + b.token_standard = 'native' + and p.blockchain is null + and p.contract_address is null + and p.symbol = 'POL' + and b.day = p.day + ) +group by 1, 2, 3, 4, 5, 6, 7 diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_matic_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_matic_transfers.sql index c61c1192e2a..d45c868b1fd 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_matic_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_matic_transfers.sql @@ -1,78 +1,26 @@ -{{ +{{ config( - materialized='incremental', - - alias = 'matic_transfers', + schema = 'safe_polygon', + alias= 'matic_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["polygon"]\', - "project", - "safe", - \'["tschubotz", "hosuke"]\') }}' - ) + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook='{{ expose_spells(blockchains = \'["polygon"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke"]\') }}' + ) }} {% set project_start_date = '2021-03-07' %} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'polygon' as blockchain, - 'MATIC' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('polygon', 'traces') }} et - join {{ ref('safe_polygon_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'polygon' as blockchain, - 'MATIC' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('polygon', 'traces') }} et - join {{ ref('safe_polygon_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'polygon', + native_token_symbol = 'MATIC', + project_start_date = project_start_date + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_schema.yml index 90001c7e587..14a9a291611 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_schema.yml @@ -151,3 +151,29 @@ models: - &output name: output description: "Output data" + + - name: safe_polygon_balances + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - day + - blockchain + - address + - token_address + meta: + blockchain: polygon + project: safe + contributors: safeintern + config: + tags: ['safe', 'polygon'] + description: “Safe addresses balances” + columns: + - name: day + - name: blockchain + - name: address + - name: token_address + - name: token_standard + - name: token_id + - name: token_symbol + - name: token_balance + - name: balance_usd diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_transactions.sql index e111e121f29..ad4a733ab0a 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/polygon/safe_polygon_transactions.sql @@ -1,63 +1,17 @@ {{ config( materialized='incremental', - + schema='safe_polygon', alias = 'transactions', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address'], + unique_key = ['block_date', 'tx_hash', 'trace_address'], file_format ='delta', incremental_strategy='merge', - post_hook='{{ expose_spells(\'["polygon"]\', - "project", - "safe", - \'["tschubotz", "hosuke", "danielpartida"]\') }}' - ) + post_hook='{{ expose_spells(blockchains = \'["polygon"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["tschubotz", "hosuke", "danielpartida"]\') }}' + ) }} -select - 'polygon' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('polygon', 'traces') }} tr -join {{ ref('safe_polygon_safes') }} s - on s.address = tr."from" -join {{ ref('safe_polygon_singletons') }} ss - on tr.to = ss.address -join {{ source('polygon', 'transactions') }} et - on tr.tx_hash = et.hash - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - AND tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '2021-03-07' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and tr.block_time > date_trunc('day', now() - interval '7' day) - {% endif %} +{{ safe_transactions('polygon', '2021-03-07') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_native_transfers_all.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_native_transfers_all.sql index 1cf0869ec7d..f5e01729566 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_native_transfers_all.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_native_transfers_all.sql @@ -1,7 +1,7 @@ {{ config( schema = 'safe', alias = 'native_transfers_all', - post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","blast","bnb","celo","ethereum","gnosis","goerli","linea","optimism","polygon","zkevm","zksync"]\', + post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","blast","bnb","celo","ethereum","gnosis","goerli","linea","optimism","polygon","scroll","zkevm","zksync"]\', "project", "safe", \'["kryptaki", "danielpartida"]\') }}' @@ -21,6 +21,7 @@ ,ref('safe_linea_eth_transfers') ,ref('safe_optimism_eth_transfers') ,ref('safe_polygon_matic_transfers') +,ref('safe_scroll_eth_transfers') ,ref('safe_zkevm_matic_transfers') ,ref('safe_zksync_eth_transfers') ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_safes_all.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_safes_all.sql index c157de84bb3..422871b6bc2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_safes_all.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_safes_all.sql @@ -1,7 +1,7 @@ {{ config( schema = 'safe', alias = 'safes_all', - post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","blast","bnb","celo","ethereum","fantom","gnosis","goerli","linea","optimism","polygon","zkevm","zksync"]\', + post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","blast","bnb","celo","ethereum","fantom","gnosis","goerli","linea","optimism","polygon","scroll","zkevm","zksync"]\', "project", "safe", \'["tschubotz", "danielpartida", "kryptaki"]\') }}' @@ -22,6 +22,7 @@ ,ref('safe_linea_safes') ,ref('safe_optimism_safes') ,ref('safe_polygon_safes') +,ref('safe_scroll_safes') ,ref('safe_zkevm_safes') ,ref('safe_zksync_safes') ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_schema.yml index cd79b675c0e..f944311f8b7 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_schema.yml @@ -3,11 +3,11 @@ version: 2 models: - name: safe_safes_all meta: - blockchain: arbitrum, avalanche_c, base, blast, bnb, celo, ethereum, fantom, gnosis, goerli, optimism, polygon, zkevm, zksync + blockchain: arbitrum, avalanche_c, base, blast, bnb, celo, ethereum, fantom, gnosis, goerli, linea, optimism, polygon, scroll, zkevm, zksync project: safe contributors: tschubotz, danielpartida, kryptaki config: - tags: ['arbitrum', 'avalanche_c', 'base', 'blast', 'bnb', 'celo','ethereum', 'fantom', 'gnosis', 'goerli', 'optimism', 'polygon', 'safe', 'zkevm', 'zksync'] + tags: ['arbitrum', 'avalanche_c', 'base', 'blast', 'bnb', 'celo','ethereum', 'fantom', 'gnosis', 'goerli', 'linea', 'optimism', 'polygon', 'safe', 'scroll', 'zkevm', 'zksync'] description: > Lists all Safes across chains. columns: @@ -32,14 +32,14 @@ models: - name: safe_transactions_all meta: - blockchain: arbitrum, avalanche_c, base, blast, bnb, celo, ethereum, fantom, gnosis, goerli, optimism, polygon, zkevm, zksync + blockchain: arbitrum, avalanche_c, base, blast, bnb, celo, ethereum, fantom, gnosis, goerli, linea, optimism, polygon, scroll, zkevm, zksync project: safe contributors: kryptaki, danielpartida freshness: warn_after: { count: 12, period: hour } error_after: { count: 24, period: hour } config: - tags: ['arbitrum', 'avalanche_c', 'base', 'blast', 'bnb', 'celo','ethereum', 'fantom', 'gnosis', 'goerli', 'optimism', 'polygon', 'safe', 'zkevm', 'zksync'] + tags: ['arbitrum', 'avalanche_c', 'base', 'blast', 'bnb', 'celo','ethereum', 'fantom', 'gnosis', 'goerli', 'linea', 'optimism', 'polygon', 'safe', 'scroll', 'zkevm', 'zksync'] description: "Safe transactions" columns: - *blockchain @@ -94,14 +94,14 @@ models: - name: safe_native_transfers_all meta: - blockchain: arbitrum, avalanche_c, base, blast, bnb, celo, ethereum, gnosis, goerli, optimism, polygon, zkevm, zksync + blockchain: arbitrum, avalanche_c, base, blast, bnb, celo, ethereum, gnosis, goerli, linea, optimism, polygon, scroll, zkevm, zksync project: safe contributors: kryptaki, tschubotz, danielpartida freshness: warn_after: { count: 12, period: hour } error_after: { count: 24, period: hour } config: - tags: ['arbitrum', 'avalanche_c', 'base', 'blast', 'bnb', 'celo','ethereum', 'gnosis', 'goerli', 'optimism', 'polygon', 'safe', 'zkevm', 'zksync'] + tags: ['arbitrum', 'avalanche_c', 'base', 'blast', 'bnb', 'celo','ethereum', 'gnosis', 'goerli', 'linea', 'optimism', 'polygon', 'safe', 'scroll', 'zkevm', 'zksync'] description: "Native gas token transfers into or out of Safes" tests: - dbt_utils.unique_combination_of_columns: diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_transactions_all.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_transactions_all.sql index 5aadc7de9a5..e2b069e5cfa 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_transactions_all.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/safe_transactions_all.sql @@ -1,7 +1,7 @@ {{ config( schema = 'safe', alias = 'transactions_all', - post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","blast","bnb","celo","ethereum","fantom","gnosis","goerli","linea","optimism","polygon","zkevm","zksync"]\', + post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","blast","bnb","celo","ethereum","fantom","gnosis","goerli","linea","optimism","polygon","scroll","zkevm","zksync"]\', "project", "safe", \'["kryptaki", "danielpartida"]\') }}' @@ -22,6 +22,7 @@ ,ref('safe_linea_transactions') ,ref('safe_optimism_transactions') ,ref('safe_polygon_transactions') +,ref('safe_scroll_transactions') ,ref('safe_zkevm_transactions') ,ref('safe_zksync_transactions') ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_eth_transfers.sql new file mode 100644 index 00000000000..07574457e32 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_eth_transfers.sql @@ -0,0 +1,26 @@ +{{ + config( + schema = 'safe_scroll', + alias= 'eth_transfers', + partition_by = ['block_month'], + on_schema_change='fail', + materialized='incremental', + file_format ='delta', + incremental_strategy='merge', + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], + post_hook = '{{ expose_spells(blockchains = \'["scroll"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida"]\') }}' + ) +}} + +{% set project_start_date = '2023-10-15' %} + +{{ + safe_native_transfers( + blockchain = 'scroll', + native_token_symbol = 'ETH', + project_start_date = project_start_date + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_safes.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_safes.sql new file mode 100644 index 00000000000..8d3518feeb5 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_safes.sql @@ -0,0 +1,48 @@ +{{ + config( + materialized='incremental', + schema = 'safe_scroll', + alias= 'safes', + partition_by = ['block_month'], + unique_key = ['block_date', 'address'], + on_schema_change='fail', + file_format ='delta', + incremental_strategy='merge', + post_hook = '{{ expose_spells( + blockchains = \'["scroll"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida"]\') }}' + ) +}} + +{% set project_start_date = '2023-10-15' %} + +select + 'scroll' as blockchain, + et."from" as address, + case + when et.to = 0xd9db270c1b5e3bd161e8c8503c55ceabee709552 then '1.3.0' + when et.to = 0x3e5c63644e683549055b9be8653de26e0b4cd36e then '1.3.0L2' + when et.to = 0x41675C099F32341bf84BFc5382aF534df5C7461a then '1.4.1' + when et.to = 0x29fcB43b46531BcA003ddC8FCB67FFE91900C762 then '1.4.1L2' + else 'unknown' + end as creation_version, + try_cast(date_trunc('day', et.block_time) as date) as block_date, + CAST(date_trunc('month', et.block_time) as DATE) as block_month, + et.block_time as creation_time, + et.tx_hash +from {{ source('scroll', 'traces') }} et +join {{ ref('safe_scroll_singletons') }} s + on et.to = s.address +where et.success = true + and et.call_type = 'delegatecall' -- delegatecall to singleton is Safe (proxy) address + and bytearray_substring(et.input, 1, 4) in ( + 0xb63e800d -- setup method v1.3.0, v1.3.0L2, v1.4.1, v.1.4.1L2 + ) + and et.gas_used > 10000 -- to ensure the setup call was successful. excludes e.g. setup calls with missing params that fallback + {% if not is_incremental() %} + and et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation + {% else %} + and {{ incremental_predicate('et.block_time') }} + {% endif %} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_schema.yml b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_schema.yml new file mode 100644 index 00000000000..a78d7b1b677 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_schema.yml @@ -0,0 +1,161 @@ +version: 2 + +models: + - name: safe_scroll_safes + meta: + blockchain: scroll + project: safe + contributors: danielpartida + freshness: + warn_after: { count: 12, period: hour } + error_after: { count: 24, period: hour } + config: + tags: ['safe', 'scroll'] + description: "Safe addresses" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - address + columns: + - &blockchain + name: blockchain + description: "The blockchain on which the Safe is deployed" + - &address + name: address + description: "Safe contract address" + - &creation_version + name: creation_version + description: "Version of initially created safe" + - &block_date + name: block_date + - &block_month + name: block_month + - &creation_time + name: creation_time + description: "Date/time of safe creation" + - &tx_hash + name: tx_hash + + - name: safe_scroll_eth_transfers + meta: + blockchain: scroll + project: safe + contributors: danielpartida + freshness: + warn_after: { count: 12, period: hour } + error_after: { count: 24, period: hour } + config: + tags: ['safe', 'transfers', 'scroll'] + description: "ETH transfers for safes" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - address + - tx_hash + - trace_address + columns: + - *blockchain + - &symbol + name: symbol + description: "Symbol of native gas token: ETH" + - *address + - *block_date + - *block_month + - &block_time + name: block_time + description: "Date of ETH transfer" + - &amount_raw + name: amount_raw + description: "Raw amount of transferred ETH" + - *tx_hash + - &trace_address + name: trace_address + - &amount_usd + name: amount_usd + description: "USD amount of transferred ETH" + + - name: safe_scroll_singletons + meta: + blockchain: scroll + project: safe + contributors: danielpartida + freshness: + warn_after: { count: 12, period: hour } + error_after: { count: 24, period: hour } + config: + tags: ['safe', 'singletons', 'scroll'] + description: "Singletons addresses used with Safes" + columns: + - name: address + description: "Safe contract address" + + - name: safe_scroll_transactions + meta: + blockchain: scroll + project: safe + contributors: danielpartida + freshness: + warn_after: { count: 12, period: hour } + error_after: { count: 24, period: hour } + config: + tags: ['safe', 'scroll'] + description: "Safe transactions" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - tx_hash + - trace_address + columns: + - *blockchain + - *block_date + - *block_month + - *block_time + - &block_number + name: block_number + description: "Number of block" + - *tx_hash + - name: address + description: "Safe contract address" + - &to + name: to + description: "Destination address" + - &value + name: value + description: "Value of transaction" + - &gas + name: gas + description: "Gas limit set for transaction" + - &execution_gas_used + name: execution_gas_used + description: "Execution gas used during transaction, for more details see https://dune.com/docs/data-tables/raw/evm/traces/?h=traces#gas-used-in-traces" + - &total_gas_used + name: total_gas_used + description: "Total gas used during transaction" + - &tx_index + name: tx_index + description: "Transaction index" + - &sub_traces + name: sub_traces + description: "Number of sub traces" + - *trace_address + - &success + name: success + description: "Success state of transaction" + - &error + name: error + description: "Error of transaction if any" + - &code + name: code + description: "Code" + - &input + name: input + description: "Input data" + - &output + name: output + description: "Output data" + - &method + name: method + description: "Function method" \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_singletons.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_singletons.sql new file mode 100644 index 00000000000..ebbf4af6b2e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_singletons.sql @@ -0,0 +1,21 @@ +{{ + config( + materialized='table', + schema = 'safe_scroll', + alias= 'singletons', + post_hook = '{{ expose_spells( + blockchains = \'["scroll"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida"]\') }}' + ) +}} + + +-- Fetch all known singleton/mastercopy addresses used via factories. +select distinct singleton as address +from {{ source('gnosis_safe_scroll', 'GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation') }} + +union +select distinct singleton as address +from {{ source('gnosis_safe_scroll', 'SafeProxyFactory_v1_4_1_evt_ProxyCreation') }} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_transactions.sql new file mode 100644 index 00000000000..d6fcef9acd9 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/scroll/safe_scroll_transactions.sql @@ -0,0 +1,20 @@ +{{ + config( + materialized='incremental', + schema = 'safe_scroll', + alias= 'transactions', + partition_by = ['block_month'], + unique_key = ['block_date', 'tx_hash', 'trace_address'], + file_format ='delta', + incremental_strategy='merge', + post_hook = '{{ expose_spells( + blockchains = \'["scroll"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["danielpartida"]\') }}' + ) +}} + +{% set project_start_date = '2023-10-15' %} + +{{ safe_transactions('scroll', project_start_date) }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_matic_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_matic_transfers.sql index 596f53ee156..8d7406e0778 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_matic_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_matic_transfers.sql @@ -1,13 +1,13 @@ {{ config( - materialized='incremental', schema = 'safe_zkevm', alias = 'matic_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', + unique_key = ['block_date', 'address', 'tx_hash', 'trace_address'], post_hook = '{{ expose_spells( blockchains = \'["zkevm"]\', spell_type = "project", @@ -18,65 +18,10 @@ {% set project_start_date = '2023-09-01' %} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select - 'zkevm' as blockchain, - 'MATIC' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('zkevm', 'traces') }} et - join {{ ref('safe_zkevm_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} - - union all - - select - 'zkevm' as blockchain, - 'MATIC' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash, - array_join(et.trace_address, ',') as trace_address - from {{ source('zkevm', 'traces') }} et - join {{ ref('safe_zkevm_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - {% if is_incremental() %} - and {{ incremental_predicate('p.minute') }} - {% endif %} - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file +{{ + safe_native_transfers( + blockchain = 'zkevm', + native_token_symbol = 'MATIC', + project_start_date = project_start_date + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_transactions.sql index f69fd5de293..57d75b77d38 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_transactions.sql @@ -15,55 +15,4 @@ ) }} -{% set project_start_date = '2023-09-01' %} - -select - 'zkevm' as blockchain, - try_cast(date_trunc('day', tr.block_time) as date) as block_date, - CAST(date_trunc('month', tr.block_time) as DATE) as block_month, - tr.block_time, - tr.block_number, - tr.tx_hash, - s.address, - tr.to, - tr.value, - tr.gas, - tr.gas_used as execution_gas_used, - et.gas_used as total_gas_used, - tr.tx_index, - tr.sub_traces, - tr.trace_address, - tr.success, - tr.error, - tr.code, - tr.input, - tr.output, - case - when bytearray_substring(tr.input, 1, 4) = 0x6a761202 then 'execTransaction' - when bytearray_substring(tr.input, 1, 4) = 0x468721a7 then 'execTransactionFromModule' - when bytearray_substring(tr.input, 1, 4) = 0x5229073f then 'execTransactionFromModuleReturnData' - else 'unknown' - end as method -from {{ source('zkevm', 'traces') }} tr -join {{ ref('safe_zkevm_safes') }} s - on s.address = tr."from" -join {{ ref('safe_zkevm_singletons') }} ss - on tr.to = ss.address -join {{ source('zkevm', 'transactions') }} et - on tr.tx_hash = et.hash - {% if is_incremental() %} - and {{ incremental_predicate('et.block_time') }} - {% endif %} - and tr.block_number = et.block_number -where bytearray_substring(tr.input, 1, 4) in ( - 0x6a761202, -- execTransaction - 0x468721a7, -- execTransactionFromModule - 0x5229073f -- execTransactionFromModuleReturnData - ) - and tr.call_type = 'delegatecall' - {% if not is_incremental() %} - and tr.block_time > TIMESTAMP '{{project_start_date}}' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - and {{ incremental_predicate('tr.block_time') }} - {% endif %} +{{ safe_transactions('zkevm', '2023-09-01') }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_eth_transfers.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_eth_transfers.sql index b163eb401c9..e6123278278 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_eth_transfers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_eth_transfers.sql @@ -1,14 +1,14 @@ {{ config( tags = ['prod_exclude'], - materialized='incremental', schema = 'safe_zksync', alias = 'eth_transfers', partition_by = ['block_month'], - unique_key = ['block_date', 'tx_hash', 'trace_address', 'amount_raw'], on_schema_change='fail', + materialized='incremental', file_format ='delta', incremental_strategy='merge', + unique_key = ['block_date', 'tx_hash', 'trace_address', 'amount_raw'], post_hook='{{ expose_spells(\'["zksync"]\', "project", "safe", @@ -16,63 +16,10 @@ ) }} +{% set project_start_date = '2023-09-01' %} -select - t.*, - p.price * t.amount_raw / 1e18 AS amount_usd - -from ( - select distinct --distinct to deduplicate traces that appear to be duplicates, with same trace address (just one has an extra 0 at the end) - 'zksync' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - -CAST(et.value AS INT256) as amount_raw, - et.tx_hash as tx_hash, --different to the tx hash in block explorer and zksync.transactions - case when element_at(trace_address, -1) = 0 then array_join(trim_array(trace_address, 1), ',') else array_join(et.trace_address, ',') end as trace_address - from {{ source('zksync', 'traces') }} et - join {{ ref('safe_zksync_safes') }} s on et."from" = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '2023-09-01' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where {{ incremental_predicate('et.block_time') }} - {% endif %} - - union all - - select distinct --distinct to deduplicate traces that appear to be duplicates, with same trace address (just one has an extra 0 at the end) - 'zksync' as blockchain, - 'ETH' as symbol, - s.address, - try_cast(date_trunc('day', et.block_time) as date) as block_date, - CAST(date_trunc('month', et.block_time) as DATE) as block_month, - et.block_time, - CAST(et.value AS INT256) as amount_raw, - et.tx_hash as tx_hash, --different to the tx hash in block explorer and zksync.transactions - case when element_at(trace_address, -1) = 0 then array_join(trim_array(trace_address, 1), ',') else array_join(et.trace_address, ',') end as trace_address - from {{ source('zksync', 'traces') }} et - join {{ ref('safe_zksync_safes') }} s on et.to = s.address - and et."from" != et.to -- exclude calls to self to guarantee unique key property - and et.success = true - and (lower(et.call_type) not in ('delegatecall', 'callcode', 'staticcall') or et.call_type is null) - and et.value > UINT256 '0' -- et.value is uint256 type - {% if not is_incremental() %} - where et.block_time > timestamp '2023-09-01' -- for initial query optimisation - {% endif %} - {% if is_incremental() %} - -- to prevent potential counterfactual safe deployment issues we take a bigger interval - where et.block_time > date_trunc('day', now() - interval '10' day) - {% endif %} -) t - -left join {{ source('prices', 'usd') }} p on p.blockchain is null - and p.symbol = t.symbol - and p.minute = date_trunc('minute', t.block_time) \ No newline at end of file +{{ safe_native_transfers( + blockchain = 'zksync', + native_token_symbol = 'ETH', + project_start_date = project_start_date +) }} diff --git a/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_transactions.sql b/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_transactions.sql index c09c1105f4f..b688a73b5f4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_transactions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/safe/zksync/safe_zksync_transactions.sql @@ -7,10 +7,10 @@ file_format ='delta', incremental_strategy='merge', unique_key = ['unique_key'], - post_hook='{{ expose_spells(\'["zksync"]\', - "project", - "safe", - \'["kryptaki"]\') }}' + post_hook='{{ expose_spells(blockchains = \'["zksync"]\', + spell_type = "project", + spell_name = "safe", + contributors = \'["kryptaki"]\') }}' ) }} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/abi/abi_signatures.sql b/dbt_subprojects/hourly_spellbook/models/_sector/abi/abi_signatures.sql index 54e412897a1..e8c542829eb 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/abi/abi_signatures.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/abi/abi_signatures.sql @@ -27,6 +27,12 @@ ,source('base', 'signatures') ,source('zksync', 'signatures') ,source('scroll', 'signatures') + ,source('nova', 'signatures') + ,source('blast', 'signatures') + ,source('linea', 'signatures') + ,source('mantle', 'signatures') + ,source('zkevm', 'signatures') + ,source('sei', 'signatures') ] %} WITH diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/_schema.yml index 585a3694f5d..c948df3a2c4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/_schema.yml @@ -85,9 +85,7 @@ models: description: "hash of the L1 transaction" - *beacon_slot_number - *beacon_epoch - - name: tx_from - description: "address of the sender" - - name: tx_to + - name: blob_receiver description: "address of the receiver" - name: blob_versioned_hashes description: "array of blob hashes in the transaction" @@ -121,6 +119,8 @@ models: description: "Blob submitting address" - name: entity description: "Entity name the address has been tagged as" + - name: x_username + description: "X Username of the tagged entity" - name: blobs_based_submitters meta: diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/blobs_submitters.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/blobs_submitters.sql index 6ffc57da912..b9dea9a8c9b 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/blobs_submitters.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/blobs_submitters.sql @@ -8,44 +8,59 @@ -- @hildobby https://dune.com/queries/3521610 SELECT address , entity + , x_username FROM ( values - (0x0d3250c3d5facb74ac15834096397a3ef790ec99, 'zkSync Era') - , (0x2c169dfe5fbba12957bdd0ba47d9cedbfe260ca7, 'StarkNet') - , (0x6887246668a3b87f54deb3b94ba47a6f63f32985, 'OP Mainnet') - , (0x5050f69a9786f081509234f1a7f4684b5e5b76c9, 'Base') - , (0xc1b634853cb333d3ad8663715b08f41a3aec47cc, 'Arbitrum') - , (0x625726c858dbf78c0125436c943bf4b4be9d9033, 'Zora') - , (0x889e21d7ba3d6dd62e75d4980a4ad1349c61599d, 'Aevo') - , (0x41b8cd6791de4d8f9e0eaf7861ac506822adce12, 'Kroma') - , (0x14e4e97bdc195d399ad8e7fc14451c279fe04c8e, 'Lyra') - , (0x99199a22125034c808ff20f377d91187e8050f2e, 'Mode') - , (0x415c8893d514f9bc5211d36eeda4183226b84aa7, 'Blast') - , (0x6017f75108f251a488b045a7ce2a7c15b179d1f2, 'Fraxtal') - , (0x99526b0e49a95833e734eb556a6abaffab0ee167, 'PGN') - , (0xc70ae19b5feaa5c19f576e621d2bad9771864fe2, 'Paradex') - , (0xa9268341831eFa4937537bc3e9EB36DbecE83C7e, 'Linea') - , (0xc94c243f8fb37223f3eb2f7961f7072602a51b8b, 'Metal') - , (0xe1b64045351b0b6e9821f19b39f81bc4711d2230, 'Boba Network') - , (0x08f9f14ff43e112b18c96f0986f28cb1878f1d11, 'Camp Network') - , (0x5ead389b57d533a94a0eacd570dc1cc59c25f2d4, 'Parallel') - , (0xcf2898225ed05be911d3709d9417e86e0b4cfc8f, 'Scroll') - , (0xa6ea2f3299b63c53143c993d2d5e60a69cd6fe24, 'Lisk') - , (0x3d0bf26e60a689a7da5ea3ddad7371f27f7671a5, 'Optopia') - , (0x5c53f2ff1030c7fbc0616fd5b8fc6be97aa27e00, 'Lumio') - , (0x1fd6a75cc72f39147756a663f3ef1fc95ef89495, 'opBNB') - , (0xa76e31d8471d569efdd3d95d1b11ce6710f4533f, 'Manta') - , (0x84bdfb21ed7c8b332a42bfd595744a84f3101e4e, 'Karak') - , (0x994c288de8418c8d3c5a4d21a69f35bf9641781c, 'Hypr') - , (0x6079e9c37b87fe06d0bde2431a0fa309826c9b67, 'Ancient8') - , (0x2f6afe2e3fea041b892a6e240fd1a0e5b51e8376, 'Mantle') - , (0xcdf02971871b7736874e20b8487c019d28090019, 'Metis') - , (0xf8db8aba597ff36ccd16fecfbb1b816b3236e9b8, 'Orderly') - , (0xdec273bf31ad79ad00d619c52662f724176a12fb, 'Lambda') - , (0x68bdfece01535090c8f3c27ec3b1ae97e83fa4aa, 'Mint') - , (0x000000633b68f5d8d3a86593ebb815b4663bcbe0, 'Taiko') - , (0x52ee324F2bCD0c5363d713eb9f62D1eE47266ac1, 'Rari') - , (0x7ab7da0c3117d7dfe0abfaa8d8d33883f8477c74, 'Debank Chain') - , (0x90680f0f6d63060fb7a16bdc722a85b992dd5047, 'XGA') - , (0xaf1e4f6a47af647f87c0ec814d8032c4a4bff145, 'Zircuit') - ) AS x(address, entity) + (0x0d3250c3d5facb74ac15834096397a3ef790ec99, 'zkSync Era', 'zksync') + , (0x2c169dfe5fbba12957bdd0ba47d9cedbfe260ca7, 'StarkNet', 'Starknet') + , (0x6887246668a3b87f54deb3b94ba47a6f63f32985, 'OP Mainnet', 'Optimism') + , (0x5050f69a9786f081509234f1a7f4684b5e5b76c9, 'Base', 'base') + , (0xc1b634853cb333d3ad8663715b08f41a3aec47cc, 'Arbitrum', 'arbitrum') + , (0x625726c858dbf78c0125436c943bf4b4be9d9033, 'Zora', 'ourZORA') + , (0x889e21d7ba3d6dd62e75d4980a4ad1349c61599d, 'Aevo', 'aevoxyz') + , (0x41b8cd6791de4d8f9e0eaf7861ac506822adce12, 'Kroma', 'kroma_network') + , (0x14e4e97bdc195d399ad8e7fc14451c279fe04c8e, 'Lyra', 'lyrafinance') + , (0x99199a22125034c808ff20f377d91187e8050f2e, 'Mode', 'modenetwork') + , (0x415c8893d514f9bc5211d36eeda4183226b84aa7, 'Blast', 'Blast_L2') + , (0x6017f75108f251a488b045a7ce2a7c15b179d1f2, 'Fraxtal', 'fraxfinance') + , (0x99526b0e49a95833e734eb556a6abaffab0ee167, 'PGN', 'pgn_eth') + , (0xc70ae19b5feaa5c19f576e621d2bad9771864fe2, 'Paradex', 'tradeparadex') + , (0xa9268341831eFa4937537bc3e9EB36DbecE83C7e, 'Linea', 'LineaBuild') + , (0xc94c243f8fb37223f3eb2f7961f7072602a51b8b, 'Metal', 'Metal_L2') + , (0xe1b64045351b0b6e9821f19b39f81bc4711d2230, 'Boba Network', 'bobanetwork') + , (0x08f9f14ff43e112b18c96f0986f28cb1878f1d11, 'Camp Network', 'Camp_L2') + , (0x5ead389b57d533a94a0eacd570dc1cc59c25f2d4, 'Parallel', 'ParallelFi') + , (0x40acdc94a00b33151b40763b3fed7c46ff639df4, 'Parallel', 'ParallelFi') + , (0xcf2898225ed05be911d3709d9417e86e0b4cfc8f, 'Scroll', 'Scroll_ZKP') + , (0xa6ea2f3299b63c53143c993d2d5e60a69cd6fe24, 'Lisk', 'LiskHQ') + , (0x3d0bf26e60a689a7da5ea3ddad7371f27f7671a5, 'Optopia', 'Optopia_AI') + , (0x5c53f2ff1030c7fbc0616fd5b8fc6be97aa27e00, 'Lumio', 'PontemNetwork') + , (0x1fd6a75cc72f39147756a663f3ef1fc95ef89495, 'opBNB', 'BNBCHAIN') + , (0xa76e31d8471d569efdd3d95d1b11ce6710f4533f, 'Manta', 'MantaNetwork') + , (0x84bdfb21ed7c8b332a42bfd595744a84f3101e4e, 'Karak', 'Karak_Network') + , (0x994c288de8418c8d3c5a4d21a69f35bf9641781c, 'Hypr', 'hypr_network') + , (0x6079e9c37b87fe06d0bde2431a0fa309826c9b67, 'Ancient8', 'Ancient8_gg') + , (0x2f6afe2e3fea041b892a6e240fd1a0e5b51e8376, 'Mantle', '0xMantle') + , (0xcdf02971871b7736874e20b8487c019d28090019, 'Metis', 'MetisL2') + , (0xf8db8aba597ff36ccd16fecfbb1b816b3236e9b8, 'Orderly', 'OrderlyNetwork') + , (0xdec273bf31ad79ad00d619c52662f724176a12fb, 'Lambda', 'Lambdaim') + , (0x68bdfece01535090c8f3c27ec3b1ae97e83fa4aa, 'Mint', 'Mint_Blockchain') + , (0x000000633b68f5d8d3a86593ebb815b4663bcbe0, 'Taiko', 'taikoxyz') + , (0x52ee324F2bCD0c5363d713eb9f62D1eE47266ac1, 'Rari', 'rarichain') + , (0x7ab7da0c3117d7dfe0abfaa8d8d33883f8477c74, 'Debank Chain', 'DeBankDeFi') + , (0xe27f3f6db6824def1738b2aace2672ac59046a39, 'Kinto', 'KintoXYZ') + , (0xb1b676357de100c5bd846299cf6c85436803e839, 'Nal', 'nal_network') + , (0x90680f0f6d63060fb7a16bdc722a85b992dd5047, 'XGA', 'foldfinance') + , (0xaf1e4f6a47af647f87c0ec814d8032c4a4bff145, 'Zircuit', 'ZircuitL2') + , (0xdbbe3d8c2d2b22a2611c5a94a9a12c2fcd49eb29, 'World Chain', 'worldcoin') + , (0x8cda8351236199af7532bad53d683ddd9b275d89, 'RACE', 'RACEecosystem') + , (0x7f9d9c1bce1062e1077845ea39a0303429600a06, 'Binary', 'thebinaryhldgs') + , (0x4d875acfd836eb3d8a2f25ba03de16c97ec9fc0f, 'PandaSea', 'pandaseaweb3') + , (0xf7ca543d652e38692fd12f989eb55b5327ec9a20, 'Shape', 'Shape_L2') + , (0xde794bec196832474f2f218135bfd0f7ca7fb038, 'Swan Chain', 'swan_chain') + , (0x67a44ce38627f46f20b1293960559ed85dd194f1, 'Polynomial', 'PolynomialFi') + , (0x060b915ca4904b56ada63565626b9c97f6cad212, 'SNAXchain', 'synthetix_io') + , (0x65115c6d23274e0a29a63b69130efe901aa52e7a, 'Hemi Network', 'hemi_xyz') + , (0x43ca061ea80fbb4a2b5515f4be4e953b191147af, 'Ethernity', 'EthernityChain') + , (0xee12c640b0793cf514e42ea1c428bd5399545d4d, 'MetaMail', 'MetaMailInk') + ) AS x(address, entity, x_username) \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blob_submissions.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blob_submissions.sql index 9d51e09cd21..9e6d408fe3b 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blob_submissions.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blob_submissions.sql @@ -31,6 +31,7 @@ SELECT , t.value as tx_value , t.hash as tx_hash , t."from" as blob_submitter + , t.to as blob_receiver , COALESCE(l.entity, ls.entity) as blob_submitter_label , t.index as tx_index , t.success as tx_success diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blobs.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blobs.sql index b3419d33542..fe150760836 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blobs.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blobs.sql @@ -21,8 +21,7 @@ SELECT , b.index AS blob_index , b.proposer_index AS beacon_proposer_index , b.kzg_commitment AS blob_kzg_commitment - -- belows expression is very slow - ,ceil(cast(length(regexp_replace(cast(blob as varchar), '0*$', '')) - 2 as double) /2 ) AS used_blob_byte_count -- handle for last byte having a 0 at the end + ,bytearray_length(varbinary_ltrim(varbinary_rtrim(blob))) as used_blob_byte_count ,bytearray_length(blob) AS blob_byte_count ,bytearray_length(blob) AS blob_gas_used -- GPT to the rescue diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/_schema.yml new file mode 100644 index 00000000000..0a4968714aa --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: evms_transaction_metrics + meta: + sector: metrics + contributors: 0xRob + config: + tags: ['metrics', 'evms'] + description: "fundamental blockchain transaction metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + + - name: evms_transaction_address_metrics + meta: + blockchain: evms + sector: metrics + contributors: jeff-dude + config: + tags: [ 'evms','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml index 098a3b7f7fd..452db8f920a 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: arbitrum_metrics + - name: arbitrum_transaction_metrics meta: blockchain: arbitrum sector: metrics contributors: 0xRob config: tags: [ 'arbitrum','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: arbitrum_transaction_address_metrics + meta: + blockchain: arbitrum + sector: metrics + contributors: jeff-dude + config: + tags: [ 'arbitrum','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_transaction_address_metrics.sql new file mode 100644 index 00000000000..5e7dd3ddb93 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'arbitrum', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["arbitrum"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'arbitrum' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_transaction_metrics.sql index dbfc17d98e8..18e50a0bd54 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='arbitrum', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('arbitrum')}} +{{blockchain_transaction_metrics('arbitrum')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml index 2af5e9746c3..e40d217b6eb 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: avalanche_c_metrics + - name: avalanche_c_transaction_metrics meta: blockchain: avalanche_c sector: metrics contributors: 0xRob config: tags: [ 'avalanche_c','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: avalanche_c_transaction_address_metrics + meta: + blockchain: avalanche_c + sector: metrics + contributors: jeff-dude + config: + tags: [ 'avalanche_c','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_transaction_address_metrics.sql new file mode 100644 index 00000000000..3534ad446dd --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'avalanche_c', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["avalanche_c"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'avalanche_c' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_transaction_metrics.sql index 22957e409cb..21db49c8802 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='avalanche_c', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('avalanche_c')}} +{{blockchain_transaction_metrics('avalanche_c')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml index d26abcd4725..92ddb586245 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: base_metrics + - name: base_transaction_metrics meta: blockchain: base sector: metrics contributors: 0xRob config: tags: [ 'base','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: base_transaction_address_metrics + meta: + blockchain: base + sector: metrics + contributors: jeff-dude + config: + tags: [ 'base','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_transaction_address_metrics.sql new file mode 100644 index 00000000000..be36ed0c0d2 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'base', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["base"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'base' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_transaction_metrics.sql index 1d877c0af92..a3003252f7a 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='base', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('base')}} +{{blockchain_transaction_metrics('base')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml index 6c23816adbf..ca13558b868 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: blast_metrics + - name: blast_transaction_metrics meta: blockchain: blast sector: metrics contributors: 0xRob config: tags: [ 'blast','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: blast_transaction_address_metrics + meta: + blockchain: blast + sector: metrics + contributors: jeff-dude + config: + tags: [ 'blast','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_transaction_address_metrics.sql new file mode 100644 index 00000000000..b074394ed2e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'blast', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["blast"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'blast' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_transaction_metrics.sql index 2f22365537c..ac3c780d6eb 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='blast', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('blast')}} +{{blockchain_transaction_metrics('blast')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml index 17e3d61b8cc..80b00d80212 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: bnb_metrics + - name: bnb_transaction_metrics meta: blockchain: bnb sector: metrics contributors: 0xRob config: tags: [ 'bnb','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: bnb_transaction_address_metrics + meta: + blockchain: bnb + sector: metrics + contributors: jeff-dude + config: + tags: [ 'bnb','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_transaction_address_metrics.sql new file mode 100644 index 00000000000..0a662e20da9 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'bnb', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["bnb"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'bnb' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_transaction_metrics.sql index 3422d65a8ca..54a9409ef53 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='bnb', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('bnb')}} +{{blockchain_transaction_metrics('bnb')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml index 51e267d55c6..f77b052a522 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: celo_metrics + - name: celo_transaction_metrics meta: blockchain: celo sector: metrics contributors: 0xRob config: tags: [ 'celo','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: celo_transaction_address_metrics + meta: + blockchain: celo + sector: metrics + contributors: jeff-dude + config: + tags: [ 'celo','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_transaction_address_metrics.sql new file mode 100644 index 00000000000..72a7097ca71 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'celo', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["celo"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'celo' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_transaction_metrics.sql index 972e96afea9..3eacc9d778b 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='celo', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('celo')}} +{{blockchain_transaction_metrics('celo')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml index f02f3d86df4..ebba08bea15 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: ethereum_metrics + - name: ethereum_transaction_metrics meta: blockchain: ethereum sector: metrics contributors: 0xRob config: tags: [ 'ethereum','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: ethereum_transaction_address_metrics + meta: + blockchain: ethereum + sector: metrics + contributors: jeff-dude + config: + tags: [ 'ethereum','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_transaction_address_metrics.sql new file mode 100644 index 00000000000..ee87026954b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'ethereum', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["ethereum"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'ethereum' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_transaction_metrics.sql index c8d7c9b7d16..2755e43a0d2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='ethereum', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('ethereum')}} +{{blockchain_transaction_metrics('ethereum')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/evms_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/evms_transaction_address_metrics.sql new file mode 100644 index 00000000000..68413633c9e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/evms_transaction_address_metrics.sql @@ -0,0 +1,52 @@ +{{ config( + schema='evms', + alias = 'transaction_address_metrics', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "base", "blast", "bnb", "celo", "ethereum", "fantom", "gnosis", "linea", "mantle", "optimism", "polygon", "scroll", "sei", "zkevm", "zksync", "zora"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{% set chains = [ + 'arbitrum', + 'avalanche_c', + 'base', + 'blast', + 'bnb', + 'celo', + 'ethereum', + 'fantom', + 'gnosis', + 'linea', + 'mantle', + 'optimism', + 'polygon', + 'scroll', + 'sei', + 'zkevm', + 'zksync', + 'zora' +] %} + +SELECT * +FROM ( + {% for chain in chains %} + SELECT + blockchain + , chain_id + , block_hour + , from_address + , to_address + , tx_count + , tx_success_rate + , from_is_new_address + , from_is_contract + , to_is_new_address + , to_is_contract + FROM {{ ref(chain ~ '_transaction_address_metrics') }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/evms_transaction_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/evms_transaction_metrics.sql new file mode 100644 index 00000000000..e95a1ba7e0b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/evms_transaction_metrics.sql @@ -0,0 +1,51 @@ +{{ config( + schema='evms', + alias = 'transaction_metrics', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "base", "blast", "bnb", "celo", "ethereum", "fantom", "gnosis", "linea", "mantle", "optimism", "polygon", "scroll", "sei", "zkevm", "zksync", "zora"]\', + "sector", + "metrics", + \'["0xRob"]\') }}' + ) +}} + +{% set chains = [ + 'arbitrum', + 'avalanche_c', + 'base', + 'blast', + 'bnb', + 'celo', + 'ethereum', + 'fantom', + 'gnosis', + 'linea', + 'mantle', + 'optimism', + 'polygon', + 'scroll', + 'sei', + 'zkevm', + 'zksync', + 'zora' +] %} + +SELECT * +FROM ( + {% for chain in chains %} + SELECT + blockchain + ,chain_id + ,block_hour + ,tx_count + ,tx_success_count + ,tx_success_rate + ,avg_block_time_seconds + ,tx_per_second + ,new_addresses + ,new_contracts + FROM {{ ref(chain ~ '_transaction_metrics') }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml index 0227ec503b4..8d3fc44a82e 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: fantom_metrics + - name: fantom_transaction_metrics meta: blockchain: fantom sector: metrics contributors: 0xRob config: tags: [ 'fantom','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: fantom_transaction_address_metrics + meta: + blockchain: fantom + sector: metrics + contributors: jeff-dude + config: + tags: [ 'fantom','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_transaction_address_metrics.sql new file mode 100644 index 00000000000..41a72a726c5 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'fantom', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["fantom"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'fantom' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_transaction_metrics.sql index 85c4b9f415d..e8cb3b50ed5 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='fantom', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('fantom')}} +{{blockchain_transaction_metrics('fantom')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml index f9e9b106dce..0e157c3b9a9 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: gnosis_metrics + - name: gnosis_transaction_metrics meta: blockchain: gnosis sector: metrics contributors: 0xRob config: tags: [ 'gnosis','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: gnosis_transaction_address_metrics + meta: + blockchain: gnosis + sector: metrics + contributors: jeff-dude + config: + tags: [ 'gnosis','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_transaction_address_metrics.sql new file mode 100644 index 00000000000..bc6714ff8ee --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'gnosis', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["gnosis"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'gnosis' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_transaction_metrics.sql index 8475f4b5dfa..5bea300cb21 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='gnosis', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('gnosis')}} +{{blockchain_transaction_metrics('gnosis')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml index b722b5dce11..ac4170d1f42 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: linea_metrics + - name: linea_transaction_metrics meta: blockchain: linea sector: metrics contributors: 0xRob config: tags: [ 'linea','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: linea_transaction_address_metrics + meta: + blockchain: linea + sector: metrics + contributors: jeff-dude + config: + tags: [ 'linea','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_transaction_address_metrics.sql new file mode 100644 index 00000000000..5bd716915b7 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'linea', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["linea"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'linea' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_transaction_metrics.sql index 0816eeebb1c..bca44887931 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='linea', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('linea')}} +{{blockchain_transaction_metrics('linea')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml index e22693044eb..9531e82815d 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: mantle_metrics + - name: mantle_transaction_metrics meta: blockchain: mantle sector: metrics contributors: 0xRob config: tags: [ 'mantle','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: mantle_transaction_address_metrics + meta: + blockchain: mantle + sector: metrics + contributors: jeff-dude + config: + tags: [ 'mantle','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_transaction_address_metrics.sql new file mode 100644 index 00000000000..838140fdfd1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'mantle', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["mantle"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'mantle' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_transaction_metrics.sql index 1ecbadf3a1e..de18ca11ba9 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='mantle', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('mantle')}} +{{blockchain_transaction_metrics('mantle')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml index cde6f864128..bd9b4d623d2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: optimism_metrics + - name: optimism_transaction_metrics meta: blockchain: optimism sector: metrics contributors: 0xRob config: tags: [ 'optimism','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: optimism_transaction_address_metrics + meta: + blockchain: optimism + sector: metrics + contributors: jeff-dude + config: + tags: [ 'optimism','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_transaction_address_metrics.sql new file mode 100644 index 00000000000..9db27558bb3 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'optimism', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["optimism"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'optimism' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_transaction_metrics.sql index 911d6c590ba..565aebb1b29 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='optimism', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('optimism')}} +{{blockchain_transaction_metrics('optimism')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml index 080a3532e75..f88e10547d0 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: polygon_metrics + - name: polygon_transaction_metrics meta: blockchain: polygon sector: metrics contributors: 0xRob config: tags: [ 'polygon','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: polygon_transaction_address_metrics + meta: + blockchain: polygon + sector: metrics + contributors: jeff-dude + config: + tags: [ 'polygon','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_transaction_address_metrics.sql new file mode 100644 index 00000000000..bc853615331 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'polygon', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["polygon"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'polygon' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_transaction_metrics.sql index 0955c4a5405..6b3c6b5aff3 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='polygon', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('polygon')}} +{{blockchain_transaction_metrics('polygon')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml index aed8d5b1fb1..88f6772bd75 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: scroll_metrics + - name: scroll_transaction_metrics meta: blockchain: scroll sector: metrics contributors: 0xRob config: tags: [ 'scroll','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: scroll_transaction_address_metrics + meta: + blockchain: scroll + sector: metrics + contributors: jeff-dude + config: + tags: [ 'scroll','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_transaction_address_metrics.sql new file mode 100644 index 00000000000..4adadd83a16 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'scroll', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["scroll"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'scroll' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_transaction_metrics.sql index 69e27701fea..661430e2238 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='scroll', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('scroll')}} +{{blockchain_transaction_metrics('scroll')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml index 3afae23401a..bd7c5fc59ee 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: sei_metrics + - name: sei_transaction_metrics meta: blockchain: sei sector: metrics contributors: 0xRob config: tags: [ 'sei','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: sei_transaction_address_metrics + meta: + blockchain: sei + sector: metrics + contributors: jeff-dude + config: + tags: [ 'sei','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_transaction_address_metrics.sql new file mode 100644 index 00000000000..bd298fbb998 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'sei', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["sei"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'sei' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_transaction_metrics.sql index 53558869b15..f3a1a72e43f 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='sei', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('sei')}} +{{blockchain_transaction_metrics('sei')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml index 52f54c3b099..fa043967fe7 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: zkevm_metrics + - name: zkevm_transaction_metrics meta: blockchain: zkevm sector: metrics contributors: 0xRob config: tags: [ 'zkevm','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: zkevm_transaction_address_metrics + meta: + blockchain: zkevm + sector: metrics + contributors: jeff-dude + config: + tags: [ 'zkevm','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_transaction_address_metrics.sql new file mode 100644 index 00000000000..c549e350bbe --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'zkevm', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["zkevm"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'zkevm' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_transaction_metrics.sql index e2e6a09b90b..f1ed9b562e4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='zkevm', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('zkevm')}} +{{blockchain_transaction_metrics('zkevm')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml index 2f7b8292b05..19a8d79fe98 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: zksync_metrics + - name: zksync_transaction_metrics meta: blockchain: zksync sector: metrics contributors: 0xRob config: tags: [ 'zksync','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: zksync_transaction_address_metrics + meta: + blockchain: zksync + sector: metrics + contributors: jeff-dude + config: + tags: [ 'zksync','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_transaction_address_metrics.sql new file mode 100644 index 00000000000..5faa755f19b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'zksync', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["zksync"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'zksync' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_transaction_metrics.sql index 39ed8d6d8e1..a43ac3940e4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='zksync', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('zksync')}} +{{blockchain_transaction_metrics('zksync')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml index 1b04f01bea1..f85dfb3fc48 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml @@ -10,16 +10,32 @@ models: - name: min_block_time description: "block_time of the first transaction initiated by the address" - - name: zora_metrics + - name: zora_transaction_metrics meta: blockchain: zora sector: metrics contributors: 0xRob config: tags: [ 'zora','metrics' ] - description: "fundamental blockchain metrics" + description: "fundamental blockchain transaction metrics" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - blockchain - block_hour + + - name: zora_transaction_address_metrics + meta: + blockchain: zora + sector: metrics + contributors: jeff-dude + config: + tags: [ 'zora','metrics', 'address' ] + description: "fundamental blockchain transaction address metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour + - from_address + - to_address \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_transaction_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_transaction_address_metrics.sql new file mode 100644 index 00000000000..a9ebc44867a --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_transaction_address_metrics.sql @@ -0,0 +1,21 @@ +{{ config + ( + schema = 'zora', + alias = 'transaction_address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'block_hour', 'from_address', 'to_address'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook = '{{ expose_spells(\'["zora"]\', + "sector", + "metrics", + \'["jeff-dude"]\') }}' + ) +}} + +{{ + blockchain_transaction_address_metrics( + blockchain = 'zora' + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_transaction_metrics.sql similarity index 83% rename from dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_metrics.sql rename to dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_transaction_metrics.sql index 0e9b1dee07a..087532c67f7 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_metrics.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_transaction_metrics.sql @@ -1,6 +1,6 @@ {{ config( schema='zora', - alias = 'metrics', + alias = 'transaction_metrics', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,4 +12,4 @@ \'["0xRob"]\') }}') }} -{{blockchain_metrics('zora')}} +{{blockchain_transaction_metrics('zora')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/cex_evms_addresses.sql b/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/cex_evms_addresses.sql index 8745308e4ec..80a8d9e7fe4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/cex_evms_addresses.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/cex_evms_addresses.sql @@ -495,6 +495,7 @@ FROM (VALUES , (0x6e5d525fa1b207b0e42fc3ffdfb9bed507708904, 'OKX', 'OKX Deposit Funder 13', 'hildobby', date '2024-05-25') , (0xcc3947059395a2dfd4ee23dfb1bb586f90d44f2e, 'OKX', 'OKX Deposit Funder 14', 'hildobby', date '2024-05-25') , (0x89b59726f9c42c350641182536bb045b9c6a36ca, 'OKX', 'OKX Deposit Funder 15', 'hildobby', date '2024-05-25') + , (0x8744f9a43c22c804553835ba33c5c402af3c79d6, 'OKX', 'OKX Deposit Funder 16', 'hildobby', date '2024-08-13') -- Cobo , (0xa9c7d31bb1879bff8be25ead2f59b310a52b7c5a, 'Cobo', 'Cobo 1', 'hildobby', date '2023-11-16') , (0xbf957e1c121fa769580d29bf320ee8bff138ad12, 'Cobo', 'Cobo 2', 'hildobby', date '2023-11-16') @@ -593,6 +594,7 @@ FROM (VALUES , (0x3c979fb790c86e361738ed17588c1e8b4c4cc49a, 'HTX', 'HTX 81', 'hildobby', date '2024-04-20') , (0xc9610be2843f1618edfedd0860dc43551c727061, 'HTX', 'HTX 82', 'hildobby', date '2024-05-25') , (0xa91183d7dfcfe39d923071f5527552ab52da6d44, 'HTX', 'HTX 83', 'hildobby', date '2024-06-03') + , (0x6663613fbd927ce78abbf7f5ca7e2c3fe0d96d18, 'HTX', 'HTX 84', 'hildobby', date '2024-08-10') , (0x1d1e10e8c66b67692f4c002c0cb334de5d485e41, 'HTX', 'HTX Old Address 1', 'hildobby', date '2022-08-28') , (0x1b93129f05cc2e840135aab154223c75097b69bf, 'HTX', 'HTX Old Address 2', 'hildobby', date '2022-08-28') , (0xeb6d43fe241fb2320b5a3c9be9cdfd4dd8226451, 'HTX', 'HTX Old Address 3', 'hildobby', date '2022-08-28') @@ -644,6 +646,7 @@ FROM (VALUES , (0xb633a44c8464c9c625e25c18cf210529a1e4cc99, 'HTX', 'HTX Deposit Funder 14', 'hildobby', date '2024-05-04') , (0x12fa4951cbfc51102ccfd5580beb135ca3d74c54, 'HTX', 'HTX Deposit Funder 15', 'hildobby', date '2024-05-25') , (0xb5e919c001f752501ac603d0c581e24c77165bb2, 'HTX', 'HTX Deposit Funder 16', 'hildobby', date '2024-05-25') + , (0x60aa247146d47aee2b1c136540c55261a4b8342c, 'HTX', 'HTX Deposit Funder 17', 'hildobby', date '2024-08-13') , (0xbc53b706b165d2b7e98f254095d9d342e845e5ac, 'HTX', 'HTX Bridge 1', 'hildobby', date '2024-05-25') -- LBank , (0x356dc48d74f107cfbfd61790b0808cda6a0d364f, 'LBank', 'LBank 1', 'hildobby', date '2023-09-12') @@ -892,6 +895,7 @@ FROM (VALUES , (0x41e29c02713929f800419abe5770faa8a5b4dadc, 'KuCoin', 'KuCoin 47', 'hildobby', date '2024-04-20') , (0x441454b3d857fe365b7defe8cb3e4f498ec91eac, 'KuCoin', 'KuCoin 48', 'hildobby', date '2024-04-20') , (0x446b86a33e2a438f569b15855189e3da28d027ba, 'KuCoin', 'KuCoin 49', 'hildobby', date '2024-04-20') + , (0xce0b6bfd578a5e90fb827ce6f86aa06355277f8c, 'KuCoin', 'KuCoin 50', 'hildobby', date '2024-08-13') , (0x061f7937b7b2bc7596539959804f86538b6368dc, 'KuCoin', 'KuCoin Deposit Funder 1', 'hildobby', date '2023-08-31') , (0x2602669a92fccf44e5319ff51b0f453aab9db021, 'KuCoin', 'KuCoin Deposit Funder 2', 'hildobby', date '2023-08-31') , (0xce0d2213a0eaff4176d90b39879b7b4f870fa428, 'KuCoin', 'KuCoin Deposit Funder 3', 'hildobby', date '2023-11-23') @@ -902,6 +906,7 @@ FROM (VALUES , (0xc91fbec25f454e1bfc782d215ada56b3007276d0, 'KuCoin', 'KuCoin Deposit Funder 8', 'hildobby', date '2023-11-23') , (0x245654d7db653ff134ea032f671ef2730333f42c, 'KuCoin', 'KuCoin Deposit Funder 9', 'hildobby', date '2023-11-23') , (0xbf7aebe0a571cf621f59ad48333a5c75fbf9d5e4, 'KuCoin', 'KuCoin Deposit Funder 10', 'hildobby', date '2023-11-23') + , (0x7b403c20adb5674e31fbbc040945999739a874c8, 'KuCoin', 'KuCoin Deposit Funder 11', 'hildobby', date '2024-08-13') -- Crypto.com , (0x6262998ced04146fa42253a5c0af90ca02dfd2a3, 'Crypto.com', 'Crypto.com 1', 'hildobby', date '2022-08-28') , (0x46340b20830761efd32832a74d7169b29feb9758, 'Crypto.com', 'Crypto.com 2', 'hildobby', date '2022-08-28') @@ -925,7 +930,8 @@ FROM (VALUES , (0x2c2301fdb0bfa06eaabaa0122cbceb2265337c25, 'Crypto.com', 'Crypto.com 20', 'hildobby', date '2024-05-27') , (0x8a161a996617f130d0f37478483afc8c1914db6d, 'Crypto.com', 'Crypto.com 21', 'hildobby', date '2024-05-27') , (0x546553718b1b255742566f10a34d86fc22f02b1f, 'Crypto.com', 'Crypto.com Deployer', 'hildobby', date '2024-06-03') - , (0xae45a8240147e6179ec7c9f92c5a18f9a97b3fca, 'Crypto.com', 'Crypto.com Deposit Funder', 'hildobby', date '2023-11-15') + , (0xae45a8240147e6179ec7c9f92c5a18f9a97b3fca, 'Crypto.com', 'Crypto.com Deposit Funder 1', 'hildobby', date '2023-11-15') + , (0x18ae7a92f5261208bb5366fa213c966d65988c95, 'Crypto.com', 'Crypto.com Deposit Funder 2', 'hildobby', date '2024-08-13') -- Wirex , (0x2f13d388b85e0ecd32e7c3d7f36d1053354ef104, 'Wirex', 'Wirex 1', 'hildobby', date '2023-11-19') , (0xe3f277382419535245a345e923898c2d43f7cbe5, 'Wirex', 'Wirex 2', 'hildobby', date '2023-11-19') @@ -953,6 +959,7 @@ FROM (VALUES , (0x8d6f396d210d385033b348bcae9e4f9ea4e045bd, 'Gemini', 'Gemini 6', 'hildobby', date '2022-08-28') , (0xd69b0089d9ca950640f5dc9931a41a5965f00303, 'Gemini', 'Gemini 7', 'hildobby', date '2022-08-28') , (0x183b1ffb0aa9213b9335adfad82e47bfb02f8d24, 'Gemini', 'Gemini 8', 'hildobby', date '2023-09-05') + , (0xf51710015536957a01f32558402902a2d9c35d82, 'Gemini', 'Gemini 9', 'hildobby', date '2024-08-12') , (0xdd51f01d9fc0fd084c1a4737bbfa5becb6ced9bc, 'Gemini', 'Gemini Deployer', 'hildobby', date '2023-08-31') , (0x4c2f150fc90fed3d8281114c2349f1906cde5346, 'Gemini', 'Gemini Deployer 2', 'hildobby', date '2023-08-31') , (0x07ee55aa48bb72dcc6e9d78256648910de513eca, 'Gemini', 'Gemini Contract 1', 'hildobby', date '2023-08-31') @@ -1082,6 +1089,7 @@ FROM (VALUES , (0xa29148c2a656e5ddc68acb95626d6b64a1131c06, 'Stake.com', 'Stake.com 10', 'hildobby', date '2023-11-23') , (0x787b8840100d9baadd7463f4a73b5ba73b00c6ca, 'Stake.com', 'Stake.com 11', 'hildobby', date '2024-04-04') , (0xbbc43c282b2f829176f4fc3802436d8fad3413f3, 'Stake.com', 'Stake.com 12', 'hildobby', date '2024-05-26') + , (0x758be77a3ee14e7193730560daa07dd3fcbfd200, 'Stake.com', 'Stake.com 13', 'hildobby', date '2024-08-13') -- Rollbit , (0xcbd6832ebc203e49e2b771897067fce3c58575ac, 'Rollbit', 'Rollbit 1', 'hildobby', date '2023-11-15') , (0xef8801eaf234ff82801821ffe2d78d60a0237f97, 'Rollbit', 'Rollbit 2', 'hildobby', date '2023-11-15') @@ -1113,11 +1121,13 @@ FROM (VALUES , (0xd5b73fc035d4d679234323e0d891cab4a4f5a1ab, 'ChangeNOW', 'ChangeNOW 13', 'hildobby', date '2023-11-23') , (0x8f54972f4ca40bd3ffc8b085f6ece1739c40c65f, 'ChangeNOW', 'ChangeNOW 14', 'hildobby', date '2024-05-04') , (0x3421230289980b8ea81781b170ef7d475673102b, 'ChangeNOW', 'ChangeNOW 15', 'hildobby', date '2024-06-03') + , (0x3525d3a883f743ca146288c146de7ccd59d48bf5, 'ChangeNOW', 'ChangeNOW 16', 'hildobby', date '2024-08-13') , (0xa4e5961b58dbe487639929643dcb1dc3848daf5e, 'ChangeNOW', 'ChangeNOW Deposit Funder 1', 'hildobby', date '2023-11-15') , (0x4657f866a0d9b46f288893fff466e8d87c556b1a, 'ChangeNOW', 'ChangeNOW Deposit Funder 2', 'hildobby', date '2023-11-20') , (0x637c86b5f2c8399716964c702bcaeabc69b900df, 'ChangeNOW', 'ChangeNOW Deposit Funder 3', 'hildobby', date '2023-11-20') , (0x6cb399d73ca29859d795c68a68f0dbf6a74f55d4, 'ChangeNOW', 'ChangeNOW Deposit Funder 4', 'hildobby', date '2024-05-04') , (0xba1955c198fca20834340414f0ea951452bdc7de, 'ChangeNOW', 'ChangeNOW Deposit Funder 5', 'hildobby', date '2024-05-25') + , (0x754993c330e8ae2ce276a9c792b40047ba9f8b1f, 'ChangeNOW', 'ChangeNOW Deposit Funder 6', 'hildobby', date '2024-08-13') , (0x6ba7fe01eec4c6a4308c8e2b35970e0488ce9a86, 'ChangeNOW', 'ChangeNOW HTX Deposit', 'hildobby', date '2023-11-20') -- Bitstamp , (0x00bdb5699745f5b860228c8f939abf1b9ae374ed, 'Bitstamp', 'Bitstamp 1', 'hildobby', date '2022-08-28') @@ -1263,6 +1273,7 @@ FROM (VALUES , (0x515281812fdf5b0d7be5fb25b823a2ab79e0a621, 'WhiteBIT', 'WhiteBIT 5', 'hildobby', date '2023-11-17') , (0xab928e30bede5919d4bd9ec244711495769d2d85, 'WhiteBIT', 'WhiteBIT 6', 'hildobby', date '2024-04-04') , (0x33eac50b7faf4b8842a621d0475335693f5d21fe, 'WhiteBIT', 'WhiteBIT 7', 'hildobby', date '2024-05-25') + , (0x98cea98be2a37a8bb52451bd46259b2fbee1bdc0, 'WhiteBIT', 'WhiteBIT 8', 'hildobby', date '2024-08-13') -- Paxos , (0x286af5cf60ae834199949bbc815485f07cc9c644, 'Paxos', 'Paxos 1', 'hildobby', date '2023-11-15') , (0x0c23fc0ef06716d2f8ba19bc4bed56d045581f2d, 'Paxos', 'Paxos 2', 'hildobby', date '2023-11-15') @@ -1552,6 +1563,7 @@ FROM (VALUES , (0x9d5db4b86afd9fe80720ca0f5637d6b790ce5bcb, 'Bitvavo', 'Bitvavo 12', 'hildobby', date '2023-11-17') , (0xc15dc0b4223b05588a257e48ed129fb59c6eb7e3, 'Bitvavo', 'Bitvavo 13', 'hildobby', date '2023-11-17') , (0x20840b20f1eee3b7b225866dc2e0d669cc2553fb, 'Bitvavo', 'Bitvavo 14', 'hildobby', date '2024-05-04') + , (0xd2674da94285660c9b2353131bef2d8211369a4b, 'Bitvavo', 'Bitvavo 15', 'hildobby', date '2024-08-13') , (0xedc6bacdc1e29d7c5fa6f6eca6fdd447b9c487c9, 'Bitvavo', 'Bitvavo Cold 1', 'hildobby', date '2023-11-17') , (0x079a892628ebf28d0ed8f00151cff225a093dc63, 'Bitvavo', 'Bitvavo Hot 1', 'hildobby', date '2023-11-17') , (0x95b564f3b3bae3f206aa418667ba000afafacc8a, 'Bitvavo', 'Bitvavo Hot 2', 'hildobby', date '2023-11-17') @@ -2738,4 +2750,6 @@ FROM (VALUES , (0xe1e5f8cacc6b9ace0894fe7ba467328587e60be7, 'BitVenus', 'BitVenus 8', 'hildobby', date '2024-04-20') -- YOOBTC , (0x8f3ab2c3b651382b07a76653d2be9eb4b87e1630, 'YOOBTC', 'YOOBTC 1', 'hildobby', date '2024-05-25') + -- Mbcbit + , (0x5e6ad578fe3a2da7bbd0255f04179e1e77317d1a, 'Mbcbit', 'Mbcbit 1', 'hildobby', date '2024-07-05') ) AS x (address, cex_name, distinct_name, added_by, added_date) \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/cex/cex_info.sql b/dbt_subprojects/hourly_spellbook/models/_sector/cex/cex_info.sql index 22765baaae6..b34d06b9db6 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/cex/cex_info.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/cex/cex_info.sql @@ -310,4 +310,5 @@ FROM (VALUES , ('Wealthsimple', 'Wealthsimple', FALSE, TRUE) , ('HashKey Exchange', 'HashKeyExchange', FALSE, TRUE) , ('Gamdom', 'gamdom', FALSE, TRUE) + , ('Mbcbit', 'MbcbitSupport', TRUE, FALSE) ) AS temp_table (cex_name, x_username, cex, payment_infra) diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/_schema.yml similarity index 88% rename from dbt_subprojects/daily_spellbook/models/_sector/gas/fees/_schema.yml rename to dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/_schema.yml index c0b56f1560b..de24da8538f 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/_schema.yml @@ -3,17 +3,20 @@ version: 2 models: - name: gas_fees meta: - blockchain: ethereum, bnb, avalanche_c, optimism, arbitrum, zksync, zora, base, scroll, mantle sector: gas contributors: soispoke, ilemi, 0xRob, jeff-dude - config: - tags: ['ethereum', 'bnb', 'avalanche_c', 'optimism', 'arbitrum','zksync','zora','scroll','mantle','gas','fees'] description: > Gas Fees across chains columns: - &blokchain name: blockchain description: "Blockchain name" + - &block_month + name: block_month + description: "Month for block event time in UTC" + - &block_day + name: block_day + description: "Day for block event time in UTC" - &block_time name: block_time description: "Timestamp for block event time in UTC" @@ -49,10 +52,10 @@ models: description: "Total amount of native tokens burned for this transaction" - &burned_usd name: burned_usd - description: "Total amount of $USD burned for this transaction" + description: "Total amount of $USD burned for this transaction" - &validator name: validator - description: "Address of blockchain validator for this transaction within the block" + description: "Address of blockchain validator for this transaction within the block" - &gas_price_gwei name: gas_price_gwei description: "Gas price (per gas unit) denoted in gwei" @@ -70,4 +73,4 @@ models: description: "Percentage of Gas Used relative to the gas limit" - &type name: type - description: "Transaction type" \ No newline at end of file + description: "Transaction type" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees.sql new file mode 100644 index 00000000000..8fb242c0cb1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'arbitrum' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_schema.yml new file mode 100644 index 00000000000..f343ff6ff00 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/arbitrum/gas_arbitrum_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_arbitrum_fees + meta: + blockchain: arbitrum + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['arbitrum', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: arbitrum + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees.sql new file mode 100644 index 00000000000..035bdc8b19a --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'avalanche_c' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_schema.yml new file mode 100644 index 00000000000..21f6a7a929e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/avalanche_c/gas_avalanche_c_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_avalanche_c_fees + meta: + blockchain: avalanche_c + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['avalanche_c', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: avalanche_c + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/base/gas_base_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/base/gas_base_fees.sql new file mode 100644 index 00000000000..cc90cc99e86 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/base/gas_base_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'base' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/base/gas_base_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/base/gas_base_schema.yml new file mode 100644 index 00000000000..46a421462b0 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/base/gas_base_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_base_fees + meta: + blockchain: base + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['base', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: base + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/blast/gas_blast_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/blast/gas_blast_fees.sql new file mode 100644 index 00000000000..52b2a63bf96 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/blast/gas_blast_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'blast' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/blast/gas_blast_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/blast/gas_blast_schema.yml new file mode 100644 index 00000000000..f203a34bf57 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/blast/gas_blast_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_blast_fees + meta: + blockchain: blast + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['blast', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: blast + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/bnb/gas_bnb_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/bnb/gas_bnb_fees.sql new file mode 100644 index 00000000000..c2db8a943a7 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/bnb/gas_bnb_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'bnb' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/bnb/gas_bnb_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/bnb/gas_bnb_schema.yml new file mode 100644 index 00000000000..7c299bf156e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/bnb/gas_bnb_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_bnb_fees + meta: + blockchain: bnb + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['bnb', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: bnb + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/celo/gas_celo_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/celo/gas_celo_fees.sql new file mode 100644 index 00000000000..2e5ad0b665e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/celo/gas_celo_fees.sql @@ -0,0 +1,18 @@ +{% set blockchain = 'celo' %} + +{{ config( + schema = 'gas_' + blockchain + ,alias = 'fees' + ,tags = ['prod_exclude'] + ,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')] + ) +}} +-- excluded because some raw data is incorrect: example https://dune.com/queries/4008169 +{{ + gas_fees(blockchain = blockchain) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/celo/gas_celo_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/celo/gas_celo_schema.yml new file mode 100644 index 00000000000..ea7a60431cf --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/celo/gas_celo_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_celo_fees + meta: + blockchain: celo + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['celo', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: celo + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql new file mode 100644 index 00000000000..e987e21e866 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'ethereum' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_schema.yml new file mode 100644 index 00000000000..f18fd5add38 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_ethereum_fees + meta: + blockchain: ethereum + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['ethereum', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: ethereum + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/fantom/gas_fantom_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/fantom/gas_fantom_fees.sql new file mode 100644 index 00000000000..02a171098b1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/fantom/gas_fantom_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'fantom' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/fantom/gas_fantom_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/fantom/gas_fantom_schema.yml new file mode 100644 index 00000000000..2687ecbb2d1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/fantom/gas_fantom_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_fantom_fees + meta: + blockchain: fantom + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['fantom', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: fantom + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql new file mode 100644 index 00000000000..7eb86a3352b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql @@ -0,0 +1,55 @@ +{{ config( + schema = 'gas', + alias = 'fees', + post_hook='{{ expose_spells(\'["arbitrum", "avalanche_c", "base", "blast", "bnb", "ethereum", "fantom", "gnosis", "linea", "mantle", "optimism", "polygon", "scroll", "sei", "zkevm", "zksync", "zora"]\', + "sector", + "gas", + \'["soispoke", "ilemi", "0xRob", "jeff-dude"]\') }}' + ) +}} + +{% set chains = [ + "arbitrum", "avalanche_c", "base", "blast", "bnb", "ethereum", + "fantom", "gnosis", "linea", "mantle", "optimism", "polygon", "scroll", + "sei", "zkevm", "zksync", "zora" +] %} + +-- removed for now: +-- celo (wrong raw data) +-- + + +SELECT + * +FROM +( + {% for blockchain in chains %} + SELECT + blockchain + ,block_month + ,block_date + ,block_time + ,block_number + ,tx_hash + ,tx_from + ,tx_to + ,gas_price + ,gas_used + ,currency_symbol + ,tx_fee + ,tx_fee_usd + ,tx_fee_raw + ,tx_fee_breakdown + ,tx_fee_breakdown_usd + ,tx_fee_breakdown_raw + ,tx_fee_currency + ,block_proposer + ,gas_limit + ,gas_limit_usage + FROM + {{ ref('gas_' ~ blockchain ~ '_fees') }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_fees.sql new file mode 100644 index 00000000000..527d9397b03 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'gnosis' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_schema.yml new file mode 100644 index 00000000000..c11197d1cdf --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gnosis/gas_gnosis_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_gnosis_fees + meta: + blockchain: gnosis + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['gnosis', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: gnosis + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/linea/gas_linea_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/linea/gas_linea_fees.sql new file mode 100644 index 00000000000..32168ee9ccd --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/linea/gas_linea_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'linea' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/linea/gas_linea_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/linea/gas_linea_schema.yml new file mode 100644 index 00000000000..9ff71c8650d --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/linea/gas_linea_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_linea_fees + meta: + blockchain: linea + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['linea', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: linea + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql new file mode 100644 index 00000000000..389bbe2ddbe --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'mantle' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/mantle/gas_mantle_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/mantle/gas_mantle_schema.yml new file mode 100644 index 00000000000..865bd485750 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/mantle/gas_mantle_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_mantle_fees + meta: + blockchain: mantle + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['mantle', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: mantle + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees.sql new file mode 100644 index 00000000000..48144ce0e4b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/optimism/gas_optimism_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'optimism' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/optimism/gas_optimism_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/optimism/gas_optimism_schema.yml new file mode 100644 index 00000000000..1f9bee367be --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/optimism/gas_optimism_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_optimism_fees + meta: + blockchain: optimism + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['optimism', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: optimism + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/polygon/gas_polygon_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/polygon/gas_polygon_fees.sql new file mode 100644 index 00000000000..0beeef39c12 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/polygon/gas_polygon_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'polygon' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/polygon/gas_polygon_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/polygon/gas_polygon_schema.yml new file mode 100644 index 00000000000..114b303ba86 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/polygon/gas_polygon_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_polygon_fees + meta: + blockchain: polygon + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['polygon', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: polygon + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/scroll/gas_scroll_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/scroll/gas_scroll_fees.sql new file mode 100644 index 00000000000..0fe5afd6b5c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/scroll/gas_scroll_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'scroll' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/scroll/gas_scroll_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/scroll/gas_scroll_schema.yml new file mode 100644 index 00000000000..a4ca74306ff --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/scroll/gas_scroll_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_scroll_fees + meta: + blockchain: scroll + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['scroll', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: scroll + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/sei/gas_sei_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/sei/gas_sei_fees.sql new file mode 100644 index 00000000000..6df85dc3573 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/sei/gas_sei_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'sei' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/sei/gas_sei_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/sei/gas_sei_schema.yml new file mode 100644 index 00000000000..99f5d0e668e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/sei/gas_sei_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_sei_fees + meta: + blockchain: sei + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['sei', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: sei + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zkevm/gas_zkevm_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zkevm/gas_zkevm_fees.sql new file mode 100644 index 00000000000..fb8a0b7959f --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zkevm/gas_zkevm_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'zkevm' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zkevm/gas_zkevm_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zkevm/gas_zkevm_schema.yml new file mode 100644 index 00000000000..8f071083351 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zkevm/gas_zkevm_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_zkevm_fees + meta: + blockchain: zkevm + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['zkevm', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: zkevm + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zksync/gas_zksync_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zksync/gas_zksync_fees.sql new file mode 100644 index 00000000000..3b187253ec6 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zksync/gas_zksync_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'zksync' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zksync/gas_zksync_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zksync/gas_zksync_schema.yml new file mode 100644 index 00000000000..31b2c3c654e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zksync/gas_zksync_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_zksync_fees + meta: + blockchain: zksync + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['zksync', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: zksync + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zora/gas_zora_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zora/gas_zora_fees.sql new file mode 100644 index 00000000000..ee303df3c31 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zora/gas_zora_fees.sql @@ -0,0 +1,17 @@ +{% set blockchain = 'zora' %} + +{{ 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) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zora/gas_zora_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zora/gas_zora_schema.yml new file mode 100644 index 00000000000..fd01fe4764c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/zora/gas_zora_schema.yml @@ -0,0 +1,31 @@ +version: 2 + +models: + - name: gas_zora_fees + meta: + blockchain: zora + sector: gas + contributors: 0xRob, soispoke + config: + tags: ['zora', 'gas', 'fees'] + description: > + Gas Fees on Ethereum + 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: zora + 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" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/arbitrum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/arbitrum/_schema.yml index 69482343c4d..fb2e13e8c06 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/arbitrum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/arbitrum/_schema.yml @@ -6,7 +6,7 @@ models: blockchain: arbitrum sector: lending project: aave, compound, radiant - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'borrow', 'aave', 'compound', 'arbitrum'] description: "All lending borrow transactions on Arbitrum" @@ -128,7 +128,7 @@ models: blockchain: arbitrum sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'borrow', 'compound', 'arbitrum'] description: "Compound v3 borrow transactions on Ethereum" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/_schema.yml index db7a23213b8..b469e696bb1 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/_schema.yml @@ -6,7 +6,7 @@ models: blockchain: base sector: lending project: aave, compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'borrow', 'aave', 'compound', 'base'] description: "All lending borrow transactions on Base" @@ -128,7 +128,7 @@ models: blockchain: base sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'borrow', 'compound', 'base'] description: "Compound v3 borrow transactions on Base" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql index e86134e0959..5916cda6b5b 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql @@ -14,6 +14,7 @@ set config_sources = [ {'contract': 'cUSDCv3'}, {'contract': 'cUSDbCv3Comet'}, + {'contract': 'cWETHv3'}, ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/_schema.yml index 3b95eb63415..c747736bf26 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/_schema.yml @@ -6,7 +6,7 @@ models: blockchain: ethereum sector: lending project: aave, compound - contributors: tomfutago, hildobby + contributors: tomfutago, hildobby, maybeYonas, pyor_xyz config: tags: ['lending', 'borrow', 'aave', 'compound', 'ethereum'] description: "Aave v1 borrow transactions on Ethereum" @@ -201,6 +201,82 @@ models: - *tx_hash - *evt_index + - name: aave_lido_v3_ethereum_base_borrow + meta: + blockchain: ethereum + sector: lending + project: aave_lido + contributors: tomfutago + config: + tags: ['lending', 'borrow', 'aave', 'lido', 'v3', 'ethereum'] + description: "Aave v3 borrow transactions on Ethereum" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - transaction_type + - token_address + - tx_hash + - evt_index + - check_lending_base_borrow_seed: + seed_file: ref('aave_lido_ethereum_base_borrow_seed') + filter: + version: 3 + columns: + - *blockchain + - *project + - *version + - *transaction_type + - *token_address + - *borrower + - *on_behalf_of + - *repayer + - *liquidator + - *amount + - *block_month + - *block_time + - *block_number + - *project_contract_address + - *tx_hash + - *evt_index + + - name: aave_etherfi_v3_ethereum_base_borrow + meta: + blockchain: ethereum + sector: lending + project: aave_etherfi + contributors: tomfutago + config: + tags: ['lending', 'borrow', 'aave', 'etherfi', 'v3', 'ethereum'] + description: "Aave v3 borrow transactions on Ethereum" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - transaction_type + - token_address + - tx_hash + - evt_index + - check_lending_base_borrow_seed: + seed_file: ref('aave_etherfi_ethereum_base_borrow_seed') + filter: + version: 3 + columns: + - *blockchain + - *project + - *version + - *transaction_type + - *token_address + - *borrower + - *on_behalf_of + - *repayer + - *liquidator + - *amount + - *block_month + - *block_time + - *block_number + - *project_contract_address + - *tx_hash + - *evt_index + - name: compound_v1_ethereum_base_borrow meta: blockchain: ethereum @@ -278,7 +354,7 @@ models: blockchain: ethereum sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'borrow', 'compound', 'v3', 'ethereum'] description: "Compound v3 borrow transactions on Ethereum" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql index b6aec6c790f..c8b1b328b59 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql @@ -11,6 +11,8 @@ ref('aave_v1_ethereum_base_borrow'), ref('aave_v2_ethereum_base_borrow'), ref('aave_v3_ethereum_base_borrow'), + ref('aave_lido_v3_ethereum_base_borrow'), + ref('aave_etherfi_v3_ethereum_base_borrow'), ref('compound_v1_ethereum_base_borrow'), ref('compound_v2_ethereum_base_borrow'), ref('compound_v3_ethereum_base_borrow'), diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_etherfi_v3_ethereum_base_borrow.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_etherfi_v3_ethereum_base_borrow.sql new file mode 100644 index 00000000000..310857d76ad --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_etherfi_v3_ethereum_base_borrow.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'aave_etherfi_v3_ethereum', + alias = 'base_borrow', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['transaction_type', 'token_address', 'tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_borrow( + blockchain = 'ethereum', + project = 'aave_etherfi', + version = '3', + project_decoded_as = 'aave_v3_etherfi', + decoded_contract_name = 'PoolInstance' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_lido_v3_ethereum_base_borrow.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_lido_v3_ethereum_base_borrow.sql new file mode 100644 index 00000000000..d70bc33a8ef --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_lido_v3_ethereum_base_borrow.sql @@ -0,0 +1,20 @@ +{{ + config( + schema = 'aave_lido_v3_ethereum', + alias = 'base_borrow', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['transaction_type', 'token_address', 'tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_borrow( + blockchain = 'ethereum', + project = 'aave_lido', + version = '3', + decoded_contract_name = 'LidoPool' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql index e6702d33279..59393f6fb82 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql @@ -14,6 +14,7 @@ set config_sources = [ {'contract': 'cUSDCv3'}, {'contract': 'cWETHv3'}, + {'contract': 'cUSDTv3'}, ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/polygon/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/polygon/_schema.yml index 918b299ef9a..ccc26877458 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/polygon/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/borrow/polygon/_schema.yml @@ -5,7 +5,7 @@ models: meta: blockchain: polygon sector: lending - project: aave, compound + project: aave, compound, maybeYonas, pyor_xyz contributors: tomfutago config: tags: ['lending', 'borrow', 'aave', 'compound', 'polygon'] @@ -168,7 +168,7 @@ models: blockchain: polygon sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'borrow', 'compound', 'polygon'] description: "Compound v3 borrow transactions on Ethereum" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_arbitrum_ctokens.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_arbitrum_ctokens.sql index 9d89f868f71..5e0f0402524 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_arbitrum_ctokens.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_arbitrum_ctokens.sql @@ -13,8 +13,14 @@ from (values ('USDC.e', 0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA, 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8), --WETH ('USDC.e', 0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA, 0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a, 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8), --GMX ('USDC.e', 0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA, 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f, 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8), --WBTC + ('USDC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0x912ce59144191c1204e64559fe8253a0e49e6548, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831), --ARB ('USDC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831), --WETH ('USDC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831), --GMX - ('USDC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831) --WBTC + ('USDC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831), --WBTC + + ('WETH', 0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486, 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831), --WETH + ('WETH', 0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486, 0xEC70Dcb4A1EFa46b8F2D97C310C9c4790ba5ffA8, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831), --rETH + ('WETH', 0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486, 0x5979D7b546E38E414F7E9822514be443A4800529, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831), --wstETH + ('WETH', 0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486, 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f, 0xaf88d065e77c8cC2239327C5EDb3A432268e5831) --WBTC ) as x (asset_symbol, comet_contract_address, collateral_token_address, asset_address) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_base_ctokens.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_base_ctokens.sql index f54d0847976..412ce3285e2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_base_ctokens.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_base_ctokens.sql @@ -10,6 +10,10 @@ select asset_symbol, comet_contract_address, collateral_token_address, asset_address from (values ('WETH', 0x46e6b214b524310239732D51387075E0e70970bf, 0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22, 0x4200000000000000000000000000000000000006), --cbETH + ('USDbC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22, 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA), --cbETH - ('USDbC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0x4200000000000000000000000000000000000006, 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA) --WETH + ('USDbC', 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf, 0x4200000000000000000000000000000000000006, 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA), --WETH + + ('USDC', 0xb125E6687d4313864e53df431d5425969c15Eb2F, 0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22, 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), --cbETH + ('USDC', 0xb125E6687d4313864e53df431d5425969c15Eb2F, 0x4200000000000000000000000000000000000006, 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) --WETH ) as x (asset_symbol, comet_contract_address, collateral_token_address, asset_address) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_ethereum_ctokens.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_ethereum_ctokens.sql index 455cfd697de..383a4679c97 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_ethereum_ctokens.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_ethereum_ctokens.sql @@ -12,9 +12,17 @@ from (values ('WETH', 0xA17581A9E3356d9A858b789D68B4d866e593aE94, 0xBe9895146f7AF43049ca1c1AE358B0541Ea49704, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), --cbETH ('WETH', 0xA17581A9E3356d9A858b789D68B4d866e593aE94, 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), --wstETH ('WETH', 0xA17581A9E3356d9A858b789D68B4d866e593aE94, 0xae78736Cd615f374D3085123A210448E74Fc6393, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), --rETH - ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0x514910771AF9Ca656af840dff83E8264EcF986CA, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), --LINK - ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0xc00e94Cb662C3520282E6f5717214004A7f26888, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), --COMP - ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), --WETH - ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), --UNI - ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2) --WBTC + + ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0x514910771AF9Ca656af840dff83E8264EcF986CA, 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --LINK + ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0xc00e94Cb662C3520282E6f5717214004A7f26888, 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --COMP + ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --WETH + ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984, 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --UNI + ('USDC', 0xc3d688B66703497DAA19211EEdff47f25384cdc3, 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599, 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --WBTC + + ('USDT', 0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840, 0x514910771AF9Ca656af840dff83E8264EcF986CA, 0xdAC17F958D2ee523a2206206994597C13D831ec7), --LINK + ('USDT', 0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840, 0xc00e94Cb662C3520282E6f5717214004A7f26888, 0xdAC17F958D2ee523a2206206994597C13D831ec7), --COMP + ('USDT', 0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, 0xdAC17F958D2ee523a2206206994597C13D831ec7), --WETH + ('USDT', 0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840, 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984, 0xdAC17F958D2ee523a2206206994597C13D831ec7), --UNI + ('USDT', 0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840, 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599, 0xdAC17F958D2ee523a2206206994597C13D831ec7), --WBTC + ('USDT', 0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840, 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0, 0xdAC17F958D2ee523a2206206994597C13D831ec7) --wstBTC ) as x (asset_symbol, comet_contract_address, collateral_token_address, asset_address) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_polygon_ctokens.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_polygon_ctokens.sql index 726cf4e8eed..efbbd7cd2ae 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_polygon_ctokens.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_polygon_ctokens.sql @@ -13,5 +13,11 @@ from (values ('USDC.e', 0xF25212E676D1F7F89Cd72fFEe66158f541246445, 0xfa68FB4628DFF1028CFEc22b4162FCcd0d45efb6, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --MaticX ('USDC.e', 0xF25212E676D1F7F89Cd72fFEe66158f541246445, 0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --stMATIC ('USDC.e', 0xF25212E676D1F7F89Cd72fFEe66158f541246445, 0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --WBTC - ('USDC.e', 0xF25212E676D1F7F89Cd72fFEe66158f541246445, 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174) --WETH + ('USDC.e', 0xF25212E676D1F7F89Cd72fFEe66158f541246445, 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --WETH + + ('USDT', 0xaeB318360f27748Acb200CE616E389A6C9409a07, 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --WMATIC + ('USDT', 0xaeB318360f27748Acb200CE616E389A6C9409a07, 0xfa68FB4628DFF1028CFEc22b4162FCcd0d45efb6, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --MaticX + ('USDT', 0xaeB318360f27748Acb200CE616E389A6C9409a07, 0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --stMATIC + ('USDT', 0xaeB318360f27748Acb200CE616E389A6C9409a07, 0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), --WBTC + ('USDT', 0xaeB318360f27748Acb200CE616E389A6C9409a07, 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619, 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174) --WETH ) as x (asset_symbol, comet_contract_address, collateral_token_address, asset_address) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/_schema.yml index 67c1924ca0c..03c9fd84722 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/_schema.yml @@ -172,6 +172,72 @@ models: - *tx_hash - *evt_index + - name: aave_lido_v3_ethereum_base_flashloans + meta: + blockchain: ethereum + sector: lending + project: aave_lido + contributors: tomfutago + config: + tags: ['lending', 'flashloans', 'aave', 'lido', 'ethereum'] + description: "Aave v3 flashloans transactions on Ethereum" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_lending_base_flashloans_seed: + seed_file: ref('aave_lido_ethereum_base_flashloans_seed') + filter: + version: 3 + columns: + - *blockchain + - *project + - *version + - *recipient + - *amount + - *fee + - *token_address + - *project_contract_address + - *block_month + - *block_time + - *block_number + - *tx_hash + - *evt_index + + - name: aave_etherfi_v3_ethereum_base_flashloans + meta: + blockchain: ethereum + sector: lending + project: aave_etherfi + contributors: tomfutago + config: + tags: ['lending', 'flashloans', 'aave', 'etherfi', 'ethereum'] + description: "Aave v3 flashloans transactions on Ethereum" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_lending_base_flashloans_seed: + seed_file: ref('aave_etherfi_ethereum_base_flashloans_seed') + filter: + version: 3 + columns: + - *blockchain + - *project + - *version + - *recipient + - *amount + - *fee + - *token_address + - *project_contract_address + - *block_month + - *block_time + - *block_number + - *tx_hash + - *evt_index + - name: radiant_ethereum_base_flashloans meta: blockchain: ethereum diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql index dc79206488b..7f33769ae09 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql @@ -11,6 +11,8 @@ ref('aave_v1_ethereum_base_flashloans'), ref('aave_v2_ethereum_base_flashloans'), ref('aave_v3_ethereum_base_flashloans'), + ref('aave_lido_v3_ethereum_base_flashloans'), + ref('aave_etherfi_v3_ethereum_base_flashloans'), ref('radiant_ethereum_base_flashloans'), ref('uwulend_ethereum_base_flashloans'), ref('spark_ethereum_base_flashloans'), diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_etherfi_v3_ethereum_base_flashloans.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_etherfi_v3_ethereum_base_flashloans.sql new file mode 100644 index 00000000000..6c0ffae8c67 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_etherfi_v3_ethereum_base_flashloans.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'aave_etherfi_v3_ethereum', + alias = 'base_flashloans', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_flashloans( + blockchain = 'ethereum', + project = 'aave_etherfi', + version = '3', + project_decoded_as = 'aave_v3_etherfi', + decoded_contract_name = 'PoolInstance' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_lido_v3_ethereum_base_flashloans.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_lido_v3_ethereum_base_flashloans.sql new file mode 100644 index 00000000000..e101b5a57d2 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_lido_v3_ethereum_base_flashloans.sql @@ -0,0 +1,20 @@ +{{ + config( + schema = 'aave_lido_v3_ethereum', + alias = 'base_flashloans', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_flashloans( + blockchain = 'ethereum', + project = 'aave_lido', + version = '3', + decoded_contract_name = 'LidoPool' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_base_flashloans.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_base_flashloans.sql index db789dcade2..7d63b5e650d 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_base_flashloans.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_base_flashloans.sql @@ -2,7 +2,7 @@ config( schema = 'lending', alias = 'base_flashloans', - partition_by = ['blockchain', 'project', 'block_month'], + partition_by = ['blockchain', 'project'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_flashloans.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_flashloans.sql index f314b932a13..2abb7c6c756 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_flashloans.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/flashloans/lending_flashloans.sql @@ -2,7 +2,7 @@ config( schema = 'lending', alias = 'flashloans', - partition_by = ['blockchain', 'project', 'block_month'], + partition_by = ['blockchain', 'project'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/arbitrum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/arbitrum/_schema.yml index ed8fb686bcf..5d4ab1ebffc 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/arbitrum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/arbitrum/_schema.yml @@ -6,7 +6,7 @@ models: blockchain: arbitrum sector: lending project: aave, compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'aave', 'compound', 'arbitrum'] description: "All lending supply transactions on Arbitrum" @@ -128,7 +128,7 @@ models: blockchain: arbitrum sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'compound', 'arbitrum'] description: "Compound v3 supply transactions on Arbitrum" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql index cf170399768..a7d01af0390 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql @@ -38,3 +38,4 @@ from {{ model }} union all {% endif %} {% endfor %} + diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/_schema.yml index cfc9e0b30ef..d4cc27662eb 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/_schema.yml @@ -6,7 +6,7 @@ models: blockchain: base sector: lending project: aave, compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'aave', 'compound', 'base'] description: "All lending supply transactions on Base" @@ -128,7 +128,7 @@ models: blockchain: base sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'compound', 'base'] description: "Compound v3 supply transactions on Base" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql index 4c06c5f81e6..606900efe87 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql @@ -14,6 +14,7 @@ set config_sources = [ {'contract': 'cUSDCv3'}, {'contract': 'cUSDbCv3Comet'}, + {'contract': 'cWETHv3'}, ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/_schema.yml index 48aa4b7b3bf..933ab8dfeb2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/_schema.yml @@ -6,7 +6,7 @@ models: blockchain: ethereum sector: lending project: aave, compound - contributors: tomfutago, hildobby + contributors: tomfutago, hildobby, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'aave', 'compound', 'ethereum'] description: "All lending supply transactions on Ethereum" @@ -201,6 +201,82 @@ models: - *tx_hash - *evt_index + - name: aave_lido_v3_ethereum_base_supply + meta: + blockchain: ethereum + sector: lending + project: aave_lido + contributors: tomfutago + config: + tags: ['lending', 'supply', 'aave', 'lido', 'ethereum'] + description: "Aave v3 supply transactions on Ethereum" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - transaction_type + - token_address + - tx_hash + - evt_index + - check_lending_base_supply_seed: + seed_file: ref('aave_lido_ethereum_base_supply_seed') + filter: + version: 3 + columns: + - *blockchain + - *project + - *version + - *transaction_type + - *token_address + - *depositor + - *on_behalf_of + - *withdrawn_to + - *liquidator + - *amount + - *block_month + - *block_time + - *block_number + - *project_contract_address + - *tx_hash + - *evt_index + + - name: aave_etherfi_v3_ethereum_base_supply + meta: + blockchain: ethereum + sector: lending + project: aave_etherfi + contributors: tomfutago + config: + tags: ['lending', 'supply', 'aave', 'etherfi', 'ethereum'] + description: "Aave v3 supply transactions on Ethereum" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - transaction_type + - token_address + - tx_hash + - evt_index + - check_lending_base_supply_seed: + seed_file: ref('aave_etherfi_ethereum_base_supply_seed') + filter: + version: 3 + columns: + - *blockchain + - *project + - *version + - *transaction_type + - *token_address + - *depositor + - *on_behalf_of + - *withdrawn_to + - *liquidator + - *amount + - *block_month + - *block_time + - *block_number + - *project_contract_address + - *tx_hash + - *evt_index + - name: compound_v2_ethereum_base_supply meta: blockchain: ethereum @@ -244,7 +320,7 @@ models: blockchain: ethereum sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'compound', 'ethereum'] description: "Compound v3 supply transactions on Ethereum" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql index 068fec75880..6e4dda2fdbe 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql @@ -11,6 +11,8 @@ ref('aave_v1_ethereum_base_supply'), ref('aave_v2_ethereum_base_supply'), ref('aave_v3_ethereum_base_supply'), + ref('aave_lido_v3_ethereum_base_supply'), + ref('aave_etherfi_v3_ethereum_base_supply'), ref('compound_v2_ethereum_base_supply'), ref('compound_v3_ethereum_base_supply'), ref('radiant_ethereum_base_supply'), diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_etherfi_v3_ethereum_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_etherfi_v3_ethereum_base_supply.sql new file mode 100644 index 00000000000..a5d6fddeb74 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_etherfi_v3_ethereum_base_supply.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'aave_etherfi_v3_ethereum', + alias = 'base_supply', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['transaction_type', 'token_address', 'tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_supply( + blockchain = 'ethereum', + project = 'aave_etherfi', + version = '3', + project_decoded_as = 'aave_v3_etherfi', + decoded_contract_name = 'PoolInstance' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_lido_v3_ethereum_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_lido_v3_ethereum_base_supply.sql new file mode 100644 index 00000000000..2d19eebd8c1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_lido_v3_ethereum_base_supply.sql @@ -0,0 +1,20 @@ +{{ + config( + schema = 'aave_lido_v3_ethereum', + alias = 'base_supply', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['transaction_type', 'token_address', 'tx_hash', 'evt_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] + ) +}} + +{{ + lending_aave_v3_compatible_supply( + blockchain = 'ethereum', + project = 'aave_lido', + version = '3', + decoded_contract_name = 'LidoPool' + ) +}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql index 9ec5f603637..bb8c5eff782 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql @@ -14,6 +14,7 @@ set config_sources = [ {'contract': 'cUSDCv3'}, {'contract': 'cWETHv3'}, + {'contract': 'cUSDTv3'}, ] %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_base_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_base_supply.sql index 977469c515f..874e7342e2c 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_base_supply.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_base_supply.sql @@ -54,3 +54,4 @@ where {{ incremental_predicate('block_time') }} union all {% endif %} {% endfor %} + diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_supply.sql b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_supply.sql index 149f49570d7..f5f7fa6706b 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_supply.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/lending_supply.sql @@ -20,3 +20,4 @@ model = ref('lending_base_supply') ) }} + diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/polygon/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/polygon/_schema.yml index 55ef124aa0e..6249d9d3d6c 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/polygon/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/lending/supply/polygon/_schema.yml @@ -6,7 +6,7 @@ models: blockchain: polygon sector: lending project: aave, compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'aave', 'polygon'] description: "All lending supply transactions on Polygon" @@ -168,7 +168,7 @@ models: blockchain: polygon sector: lending project: compound - contributors: tomfutago + contributors: tomfutago, maybeYonas, pyor_xyz config: tags: ['lending', 'supply', 'compound', 'v3', 'polygon'] description: "Compound v3 supply transactions on Polygon" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml b/dbt_subprojects/hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml index 1942819e9fa..817e41c9c9d 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml @@ -3,14 +3,7 @@ version: 2 sources: - name: basemax_finance_base description: Base decoded tables related to basemax_finance protocol - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: PositionVault_evt_IncreasePosition - loaded_at_field: evt_block_time - name: PositionVault_evt_DecreasePosition - loaded_at_field: evt_block_time - - name: LiquidateVault_evt_LiquidatePosition - loaded_at_field: evt_block_time - \ No newline at end of file + - name: LiquidateVault_evt_LiquidatePosition \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_schema.yml index fe91722adaf..eee8b745ae2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_schema.yml +++ b/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_schema.yml @@ -5,9 +5,10 @@ models: meta: sector: prices contributors: hildobby, 0xRob + docs_slug: /curated/asset-tracking/prices/prices_latest config: tags: ['prices', 'usd', 'latest'] - description: "Latest prices table across blockchains" + description: "Latest price data for tokens in USD" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -67,6 +68,7 @@ models: meta: sector: prices contributors: aalan3 + docs_slug: /curated/asset-tracking/prices/prices_daily config: tags: ['prices', 'usd', 'daily'] description: "Daily aggregated prices table across blockchains" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_usd_native.sql b/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_usd_native.sql new file mode 100644 index 00000000000..2ff1490fb48 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_usd_native.sql @@ -0,0 +1,31 @@ +{{ config( + schema='prices', + alias = 'usd_native' + ) +}} +-- this is a TEMPORARY spell that should be incorporated in the general prices models. +-- more discussion here: https://github.com/duneanalytics/spellbook/issues/6577 + +WITH blockchains as +( +select + evm.blockchain + ,evm.native_token_symbol as symbol + ,{{var('ETH_ERC20_ADDRESS')}} as contract_address -- 0x00..00 + ,18 as decimals +from {{source('evms','info')}} evm +inner join {{source('prices_native','tokens')}} p +on native_token_symbol = p.symbol +) + +SELECT + b.blockchain +, b.contract_address +, b.decimals +, b.symbol +, p.minute +, p.price +FROM {{ source('prices', 'usd') }} p +INNER JOIN blockchains b +ON b.symbol = p.symbol +and p.blockchain is null diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_usd_with_native.sql b/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_usd_with_native.sql new file mode 100644 index 00000000000..c703f6000f6 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/prices/prices_usd_with_native.sql @@ -0,0 +1,25 @@ +{{ config( + schema='prices', + alias = 'usd_with_native' + ) +}} +-- this is a TEMPORARY spell that should be incorporated in the general prices models. +-- more discussion here: https://github.com/duneanalytics/spellbook/issues/6577 + +select + minute + ,blockchain + ,contract_address + ,decimals + ,symbol + ,price +from {{source('prices','usd')}} +union all +select + minute + ,blockchain + ,contract_address + ,decimals + ,symbol + ,price +from {{ref('prices_usd_native')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/_schema.yml new file mode 100644 index 00000000000..1059fd663aa --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/_schema.yml @@ -0,0 +1,76 @@ +version: 2 + +models: + - name: rollup_economics_ethereum_l1_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable + config: + tags: ['rollup', 'l2'] + description: Gas fees paid by rollups for posting transaction data or state updates on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - day + columns: + - &name + name: name + description: "Name of the rollup" + - &day + name: day + description: "The day when relevant transactions occurred by each rollup" + - &data_fee_native + name: data_fee_native + description: "Fee spent on calldata gas by the transaction (in ETH)" + - &data_fee_usd + name: data_fee_usd + description: "Fee spent on calldata gas by the transaction (in USD)" + - &calldata_gas_used + name: calldata_gas_used + description: "Calldata gas used by the transaction" + - &verification_fee_native + name: verification_fee_native + description: "Fee spent on calldata gas for proof verification by the transaction (in ETH)" + - &verification_fee_usd + name: verification_fee_usd + description: "Fee spent on calldata gas for proof verification by the transaction (in USD)" + - &blob_fee_native + name: blob_fee_native + description: "Fee spent on blob gas by the transaction (in ETH)" + - &blob_fee_usd + name: blob_fee_usd + description: "Fee spent on blob gas by the transaction (in USD)" + - &l1_fee_native + name: l1_fee_native + description: "Total amount paid in gas fees (in ETH)" + - &l1_fee_usd + name: l1_fee_usd + description: "Total amount paid in gas fees (in USD)" + + - name: rollup_economics_ethereum_l2_revenue + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable + config: + tags: ['rollup', 'l2'] + description: "Gas fees earned by rollup on L2" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - day + columns: + - *day + - *name + - &l2_rev + name: l2_rev + description: "Total amount of revenue earned from gas fees (in ETH)" + - &l2_rev_usd + name: l2_rev_usd + description: "Total amount of revenue earned from gas fees (in USD)" + \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees.sql deleted file mode 100644 index ba88a6036fe..00000000000 --- a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees.sql +++ /dev/null @@ -1,46 +0,0 @@ -{{ config( - schema = 'rollup_economics_ethereum', - alias = 'l1_blob_fees', - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - unique_key = ['name', 'hash'], - post_hook='{{ expose_spells(\'["ethereum"]\', - "project", - "rollup_economics", - \'["niftytable", "maybeYonas"]\') }}' -)}} - -SELECT -lower(blob_submitter_label) as name, -tx_hash as hash, -block_time, -block_number, -blob_gas_used, -blob_base_fee, -(blob_gas_used*blob_base_fee)/1e18 as blob_spend, -p.price * (blob_gas_used*blob_base_fee)/1e18 as blob_spend_usd, -blob_count -FROM {{ ref('ethereum_blob_submissions')}} s -INNER JOIN {{ source('prices','usd') }} p -ON p.minute = date_trunc('minute', s.block_time) -AND p.blockchain is null -AND p.symbol = 'ETH' -AND p.minute >= timestamp '2024-03-13' -AND s.block_time >= timestamp '2024-03-13' -{% if is_incremental() %} -AND s.block_time >= date_trunc('day', now() - interval '7' day) -AND p.minute >= date_trunc('day', now() - interval '7' day) -{% endif %} -AND s.blob_submitter_label IN ('Arbitrum', -'Linea', -'zkSync Era', -'Base', -'Scroll', -'Zora', -'Public Goods Network', -'OP Mainnet', -'Starknet', -'Mode', -'Blast' -) \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees/_schema.yml new file mode 100644 index 00000000000..78d2cefc266 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees/_schema.yml @@ -0,0 +1,54 @@ +version: 2 + +models: + - name: rollup_economics_ethereum_l1_blob_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by rollups for blob gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - &name + name: name + description: "Name of the rollup" + - &block_month + name: block_month + description: "UTC event block month of each transaction" + - &block_date + name: block_date + description: "UTC event block date of each transaction" + - &block_time + name: block_time + description: "UTC event block time of each transaction" + - &block_number + name: block_number + description: "Block number of each transaction" + - &tx_hash + name: tx_hash + description: "Transaction hash" + - &tx_index + name: tx_index + description: "Transaction index" + - &blob_base_fee + name: blob_base_fee + description: "Base fee per blob gas (in wei)" + - &blob_gas_used + name: blob_gas_used + description: "Total blob gas used in the transaction" + - &blob_fee_native + name: blob_fee_native + description: "Fee spent on blob gas by the transaction (in ETH)" + - &blob_fee_usd + name: blob_fee_usd + description: "Fee spent on blob gas by the transaction (in USD)" + - &blob_count + name: blob_count + description: "Number of blobs submitted in the transaction" \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees/rollup_economics_ethereum_l1_blob_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees/rollup_economics_ethereum_l1_blob_fees.sql new file mode 100644 index 00000000000..bfae1659996 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees/rollup_economics_ethereum_l1_blob_fees.sql @@ -0,0 +1,56 @@ +{{ config( + schema = 'rollup_economics_ethereum' + , alias = 'l1_blob_fees' + , materialized = 'view' + , unique_key = ['name', 'tx_hash'] +)}} + +WITH blob_txs AS ( + SELECT + lower(b.blob_submitter_label) AS name + , cast(date_trunc('month', b.block_time) AS date) AS block_month + , cast(date_trunc('day', b.block_time) AS date) AS block_date + , b.block_time + , b.block_number + , b.tx_hash + , b.tx_index + , b.blob_base_fee + , b.blob_gas_used + , (b.blob_base_fee / 1e18) * b.blob_gas_used AS blob_fee_native + , (b.blob_base_fee / 1e18) * b.blob_gas_used * p.price AS blob_fee_usd + , b.blob_count + FROM {{ ref('ethereum_blob_submissions')}} b + INNER JOIN {{ source('prices', 'usd') }} p + ON p.minute = date_trunc('minute', b.block_time) + AND p.blockchain IS NULL + AND p.symbol = 'ETH' + AND p.minute >= TIMESTAMP '2024-03-13' -- EIP-4844 launch date + WHERE b.blob_submitter_label IN ( + 'Arbitrum' + , 'Linea' + , 'zkSync Era' + , 'Base' + , 'Scroll' + , 'Zora' + , 'Public Goods Network' + , 'OP Mainnet' + , 'Starknet' + , 'Mode' + , 'Blast' + ) +) + +SELECT + name + , block_month + , block_date + , block_time + , block_number + , tx_hash + , tx_index + , blob_base_fee + , blob_gas_used + , blob_fee_native + , blob_fee_usd + , blob_count +FROM blob_txs \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees.sql deleted file mode 100644 index 1a2e609ee61..00000000000 --- a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees.sql +++ /dev/null @@ -1,466 +0,0 @@ -{{ config( - schema = 'rollup_economics_ethereum', - alias = 'l1_data_fees', - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - unique_key = ['name', 'hash'], - post_hook='{{ expose_spells(\'["ethereum"]\', - "project", - "rollup_economics", - \'["niftytable"]\') }}' -)}} - -with tx_batch_appends as ( - SELECT - 'arbitrum' as name, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - length(t.data) as data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM - ( - SELECT - evt_tx_hash as tx_hash, - evt_block_time as block_time, - evt_block_number as block_number - FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o - WHERE evt_block_time >= timestamp '2022-01-01' - {% if is_incremental() %} - AND evt_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - call_tx_hash as tx_hash, - call_block_time as block_time, - call_block_number as block_number - FROM {{ source('arbitrum_ethereum','SequencerInbox_call_addSequencerL2BatchFromOrigin') }} o - WHERE call_success = true - AND call_tx_hash NOT IN - ( - SELECT evt_tx_hash FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o - WHERE evt_block_time >= timestamp '2022-01-01' - ) - {% if is_incremental() %} - AND call_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - call_tx_hash as tx_hash, - call_block_time as block_time, - call_block_number as block_number - FROM {{ source('arbitrum_ethereum','SequencerInbox_call_addSequencerL2Batch') }} o - WHERE call_success = true - AND call_tx_hash NOT IN - ( - SELECT evt_tx_hash FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o - WHERE evt_block_time >= timestamp '2022-01-01' - ) - {% if is_incremental() %} - AND call_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - call_tx_hash as tx_hash, - call_block_time as block_time, - call_block_number as block_number - FROM {{ source('arbitrum_ethereum','SequencerInbox_call_addSequencerL2BatchFromOriginWithGasRefunder') }} o - WHERE call_success = true - AND call_tx_hash NOT IN - ( - SELECT evt_tx_hash FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o - WHERE evt_block_time >= timestamp '2022-01-01' - ) - {% if is_incremental() %} - AND call_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - hash as tx_hash, - block_time, - block_number - FROM {{ source('ethereum','transactions') }} - WHERE "from" = 0xC1b634853Cb333D3aD8663715b08f41A3Aec47cc - AND to = 0x1c479675ad559DC151F6Ec7ed3FbF8ceE79582B6 - AND bytearray_substring(data, 1, 4) = 0x3e5aa082 --addSequencerL2BatchFromBlobs - AND block_number >= 19433943 --when arbitrum started submitting blobs - {% if is_incremental() %} - AND block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - ) b - INNER JOIN {{ source('ethereum','transactions') }} t - ON b.tx_hash = t.hash - AND b.block_number = t.block_number - AND t.success = true - AND t.block_time >= timestamp '2022-01-01' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - lower(protocol_name) as name, - block_number, - hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - data_length, - gas_used, - calldata_gas_used - FROM ( - SELECT protocol_name, t.block_time, t.block_number, t.hash, t.gas_used, t.gas_price, length(t.data) as data_length, {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} as t - INNER JOIN {{ source('addresses_ethereum','optimism_batchinbox_combinations') }} as op - ON t."from" = op.l1_batch_inbox_from_address - AND t.to = op.l1_batch_inbox_to_address - WHERE t.block_time >= timestamp '2020-01-01' - UNION ALL - SELECT protocol_name, t.block_time, t.block_number, t.hash, t.gas_used, t.gas_price, length(t.data) as data_length, {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} as t - INNER JOIN {{ source('addresses_ethereum','optimism_outputoracle_combinations') }} as op - ON t."from" = op.l2_output_oracle_from_address - AND t.to = op.l2_output_oracle_to_address - WHERE t.block_time >= timestamp '2020-01-01' - ) b - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', b.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - AND p.minute >= timestamp '2020-01-01' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - {% if is_incremental() %} - WHERE b.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'starknet' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - (length(t.data)) AS data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE ( - t.to = 0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4 -- StateUpdate proxy contract - AND bytearray_substring(t.data, 1, 4) IN (0x77552641, 0xb72d42a1) -- updateState, updateStateKzgDA - ) - AND t.block_time >= timestamp '2022-01-01' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'imx' AS chain, -- imx state updates to L1 through the Data Availability Committee, imx uses offchain DA - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - (length(t.data)) AS data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE ( - (t.to = 0x5FDCCA53617f4d2b9134B29090C87D01058e27e9 OR t.to = 0x16BA0f221664A5189cf2C1a7AF0d3AbFc70aA295) - AND (bytearray_substring(t.data, 1, 4) = 0x538f9406 OR bytearray_substring(t.data, 1, 4) = 0x504f7f6f) -- StateUpdate & Verify Availability Proof - ) - AND t.block_time >= timestamp '2021-03-24' -- mainnet launch date - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'zksync lite' AS name, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - (length(t.data)) AS data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE - ( - t."from" = 0xda7357bbce5e8c616bc7b0c3c86f0c71c5b4eabb -- Old L2 Operator - OR t."from" = 0x18c208921F7a741510a7fc0CfA51E941735DAE54 -- L2 Operator - OR t."from" = 0x01c3a1a6890a146ac187a019f9863b3ab2bff91e -- L2 Operator V1 - ) - AND t.to = 0xabea9132b05a70803a4e85094fd0e1800777fbef -- zksync - AND bytearray_substring(t.data, 1, 4) = 0x45269298 -- Commit Block - AND t.block_time >= timestamp '2022-01-01' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'zksync era' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - (length(t.data)) AS data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE ( - -- L1 transactions settle here pre-Boojum - t.to = 0x3dB52cE065f728011Ac6732222270b3F2360d919 - -- L1 transactions settle here post-Boojum - OR t.to = 0xa0425d71cB1D6fb80E65a5361a04096E0672De03 - -- L1 transactions settle here post-EIP4844 - OR t.to = 0xa8CB082A5a689E0d594d7da1E2d72A3D63aDc1bD - ) - AND ( - -- L1 transactions use these method ID's pre-Boojum - bytearray_substring(t.data, 1, 4) = 0x0c4dd810 -- Commit Block - OR - bytearray_substring(t.data, 1, 4) = 0xce9dcf16 -- Execute Block - OR - -- L1 transactions use these method ID's post-Boojum - bytearray_substring(t.data, 1, 4) = 0x701f58c5 -- Commit Batches - OR - bytearray_substring(t.data, 1, 4) = 0xc3d93e7c -- Execute Batches - ) - AND t.block_time >= timestamp '2023-03-01' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'polygon zkevm' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - (length(t.data)) AS data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE - ( - t.to = 0x5132a183e9f3cb7c848b0aac5ae0c4f0491b7ab2 -- old proxy - OR t.to = 0x519E42c24163192Dca44CD3fBDCEBF6be9130987 -- new proxy (as of block 19218878) - ) - AND bytearray_substring(t.data, 1, 4) IN ( - 0x5e9145c9, -- sequenceBatches - 0xecef3f99, -- sequenceBatches (as of block 19218878) - 0xdef57e54 -- sequenceBatches - ) - AND t.block_time >= timestamp '2023-03-01' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'linea' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - length(t.data) as data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE t.to = 0xd19d4B5d358258f05D7B411E21A1460D11B0876F -- Linea, L1 Message Service - AND bytearray_substring(t.data, 1, 4) IN ( - 0x7a776315, -- submitData (Aplha v2 Release at block. 19222438) - 0x2d3c12e5 -- submitBlobData - ) - AND t.block_time >= timestamp '2023-07-12' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'scroll' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - length(t.data) as data_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE t.to = 0xa13BAF47339d63B743e7Da8741db5456DAc1E556 - AND bytearray_substring(t.data, 1, 4) = 0x1325aca0 -- Commit Batch - AND t.block_time >= timestamp '2023-10-07' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'loopring' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - (length(t.data)) AS input_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE t.to = 0x153CdDD727e407Cb951f728F24bEB9A5FaaA8512 - AND bytearray_substring(t.data, 1, 4) = 0xdcb2aa31 -- submitBlocksWithCallbacks (proof verified immediately) - AND t.block_time >= timestamp '2021-03-23' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'Mantle' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - (length(t.data)) AS input_length, - gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE ( - t.to = 0xD1328C9167e0693B689b5aa5a024379d4e437858 -- Rollup Proxy (last used as of block 19437175) - OR t.to = 0x31d543e7BE1dA6eFDc2206Ef7822879045B9f481 -- L2OutputOracle Proxy (used as of block 19440324) - OR t.to = 0x50Fa427235C7C8cAA4A0C21b5009f5a0d015B23A -- BVM_EigenDataLayrChain Proxy (DA1) (last used as of block 19437271) - OR t.to = 0x5BD63a7ECc13b955C4F57e3F12A64c10263C14c1 -- DataLayrServiceManager Proxy (DA2) (used as of block 19439557) - ) - AND ( - bytearray_substring(t.data, 1, 4) = 0x49cd3004 -- createAssertionWithStateBatch - OR bytearray_substring(t.data, 1, 4) = 0x9aaab648 -- proposeL2Output - OR bytearray_substring(t.data, 1, 4) = 0x5e4a3056 -- storeData (DA1) - OR bytearray_substring(t.data, 1, 4) = 0x4618ed87 -- confirmData (DA1) - OR bytearray_substring(t.data, 1, 4) = 0x58942e73 -- confirmDataStore (DA2) - OR bytearray_substring(t.data, 1, 4) = 0xdcf49ea7 -- initDataStore (DA2) - ) - AND t.block_time >= timestamp '2023-06-27' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} -) - -,block_basefees as ( - SELECT - b.number as block_number - , b.base_fee_per_gas - , b.time - FROM {{ source('ethereum','blocks') }} as b - WHERE b.time >= timestamp '2021-03-23' - {% if is_incremental() %} - AND b.time >= date_trunc('day', now() - interval '7' day) - {% endif %} -) - - -SELECT - txs.name, - txs.hash, - bxs.time as block_time, - txs.block_number, - txs.data_length, - gas_spent, - gas_spent_usd, - gas_used, - calldata_gas_used -FROM tx_batch_appends txs -INNER JOIN block_basefees bxs - ON txs.block_number = bxs.block_number diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/_schema.yml new file mode 100644 index 00000000000..1faa07f9250 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/_schema.yml @@ -0,0 +1,57 @@ +version: 2 + +models: + - name: rollup_economics_ethereum_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by rollups for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - &name + name: name + description: "Name of the rollup" + - &block_month + name: block_month + description: "UTC event block month of each transaction" + - &block_date + name: block_date + description: "UTC event block date of each transaction" + - &block_time + name: block_time + description: "UTC event block time of each transaction" + - &block_number + name: block_number + description: "Block number of each transaction" + - &tx_hash + name: tx_hash + description: "Transaction hash" + - &tx_index + name: tx_index + description: "Transaction index" + - &gas_price + name: gas_price + description: "Gas price (in WEI) of transaction" + - &gas_used + name: gas_used + description: "Amount of gas units consumed by the transaction" + - &data_fee_native + name: data_fee_native + description: "Fee spent on calldata gas by the transaction (in ETH)" + - &data_fee_usd + name: data_fee_usd + description: "Fee spent on calldata gas by the transaction (in USD)" + - &calldata_gas_used + name: calldata_gas_used + description: "Gas units used by calldata (input data) by L1 Transactions" + - &data_length + name: data_length + description: "Byte length of the data posted to l1" \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/_schema.yml new file mode 100644 index 00000000000..af52bcc314e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/_schema.yml @@ -0,0 +1,334 @@ +version: 2 + +models: + - name: rollup_economics_arbitrum_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Arbitrum for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - &name + name: name + description: "Name of the rollup" + - &block_month + name: block_month + description: "UTC event block month of each transaction" + - &block_date + name: block_date + description: "UTC event block date of each transaction" + - &block_time + name: block_time + description: "UTC event block time of each transaction" + - &block_number + name: block_number + description: "Block number of each transaction" + - &tx_hash + name: tx_hash + description: "Transaction hash" + - &tx_index + name: tx_index + description: "Transaction index" + - &gas_price + name: gas_price + description: "Gas price of transaction (in wei)" + - &gas_used + name: gas_used + description: "Amount of gas units consumed by the transaction" + - &data_fee_native + name: data_fee_native + description: "Fee spent on calldata gas by the transaction (in ETH)" + - &calldata_gas_used + name: calldata_gas_used + description: "Gas units used by calldata (input data) by the transaction" + - &data_length + name: data_length + description: "Byte length of the data posted to l1" + + - name: rollup_economics_imx_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by IMX for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_linea_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Linea for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_loopring_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Loopring for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_mantle_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Mantle for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_optimism_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Optimism for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_scroll_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Scroll for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_starknet_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Starknet for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_zkevm_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Polygon zkEVM for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_zksync_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by ZKsync Era for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length + + - name: rollup_economics_zksync_lite_l1_data_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by ZKsync Lite for calldata gas on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *data_fee_native + - *calldata_gas_used + - *data_length \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_arbitrum_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_arbitrum_l1_data_fees.sql new file mode 100644 index 00000000000..13192021b22 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_arbitrum_l1_data_fees.sql @@ -0,0 +1,109 @@ +{{ config( + schema = 'rollup_economics_arbitrum' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'arbitrum' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM + ( + SELECT + evt_tx_hash as tx_hash, + evt_block_time as block_time, + evt_block_number as block_number + FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o + WHERE evt_block_time >= timestamp '2022-01-01' + {% if is_incremental() %} + AND {{incremental_predicate('evt_block_time')}} + {% endif %} + + UNION ALL + + SELECT + call_tx_hash as tx_hash, + call_block_time as block_time, + call_block_number as block_number + FROM {{ source('arbitrum_ethereum','SequencerInbox_call_addSequencerL2BatchFromOrigin') }} o + WHERE call_success = true + AND call_tx_hash NOT IN + ( + SELECT evt_tx_hash FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o + WHERE evt_block_time >= timestamp '2022-01-01' + ) + {% if is_incremental() %} + AND {{incremental_predicate('call_block_time')}} + {% endif %} + + UNION ALL + + SELECT + call_tx_hash as tx_hash, + call_block_time as block_time, + call_block_number as block_number + FROM {{ source('arbitrum_ethereum','SequencerInbox_call_addSequencerL2Batch') }} o + WHERE call_success = true + AND call_tx_hash NOT IN + ( + SELECT evt_tx_hash FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o + WHERE evt_block_time >= timestamp '2022-01-01' + ) + {% if is_incremental() %} + AND {{incremental_predicate('call_block_time')}} + {% endif %} + + UNION ALL + + SELECT + call_tx_hash as tx_hash, + call_block_time as block_time, + call_block_number as block_number + FROM {{ source('arbitrum_ethereum','SequencerInbox_call_addSequencerL2BatchFromOriginWithGasRefunder') }} o + WHERE call_success = true + AND call_tx_hash NOT IN + ( + SELECT evt_tx_hash FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o + WHERE evt_block_time >= timestamp '2022-01-01' + ) + {% if is_incremental() %} + AND {{incremental_predicate('call_block_time')}} + {% endif %} + + UNION ALL + + SELECT + hash as tx_hash, + block_time, + block_number + FROM {{ source('ethereum','transactions') }} + WHERE "from" = 0xC1b634853Cb333D3aD8663715b08f41A3Aec47cc + AND to = 0x1c479675ad559DC151F6Ec7ed3FbF8ceE79582B6 + AND bytearray_substring(data, 1, 4) = 0x3e5aa082 --addSequencerL2BatchFromBlobs + AND block_number >= 19433943 --when arbitrum started submitting blobs + {% if is_incremental() %} + AND {{incremental_predicate('block_time')}} + {% endif %} +) b +INNER JOIN {{ source('ethereum','transactions') }} t + ON b.tx_hash = t.hash + AND b.block_number = t.block_number + AND t.success = true + AND t.block_time >= timestamp '2022-01-01' + {% if is_incremental() %} + AND {{incremental_predicate('t.block_time')}} + {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_imx_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_imx_l1_data_fees.sql new file mode 100644 index 00000000000..73e02aaa809 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_imx_l1_data_fees.sql @@ -0,0 +1,36 @@ +{{ config( + schema = 'rollup_economics_imx' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'imx' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0x5FDCCA53617f4d2b9134B29090C87D01058e27e9 + , 0x16BA0f221664A5189cf2C1a7AF0d3AbFc70aA295 +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x538f9406 -- StateUpdate + , 0x504f7f6f -- Verify Availability Proof +) +AND t.block_time >= TIMESTAMP '2021-03-24' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_linea_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_linea_l1_data_fees.sql new file mode 100644 index 00000000000..76201e6f05c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_linea_l1_data_fees.sql @@ -0,0 +1,36 @@ +{{ config( + schema = 'rollup_economics_linea' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'linea' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0xd19d4B5d358258f05D7B411E21A1460D11B0876F -- Linea, L1 Message Service +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x7a776315 -- submitData (Aplha v2 Release at block. 19222438) + , 0x2d3c12e5 -- submitBlobData + , 0x42fbe842 -- submitBlobs +) +AND t.block_time >= TIMESTAMP '2023-07-12' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_loopring_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_loopring_l1_data_fees.sql new file mode 100644 index 00000000000..2ae2b883292 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_loopring_l1_data_fees.sql @@ -0,0 +1,34 @@ +{{ config( + schema = 'rollup_economics_loopring' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'loopring' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0x153CdDD727e407Cb951f728F24bEB9A5FaaA8512 +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0xdcb2aa31 -- submitBlocksWithCallbacks (proof verified immediately) +) +AND t.block_time >= TIMESTAMP '2021-03-23' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_mantle_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_mantle_l1_data_fees.sql new file mode 100644 index 00000000000..1f2b8e4f447 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_mantle_l1_data_fees.sql @@ -0,0 +1,42 @@ +{{ config( + schema = 'rollup_economics_mantle' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'mantle' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0xD1328C9167e0693B689b5aa5a024379d4e437858 -- Rollup Proxy (last used as of block 19437175) + , 0x31d543e7BE1dA6eFDc2206Ef7822879045B9f481 -- L2OutputOracle Proxy (used as of block 19440324) + , 0x50Fa427235C7C8cAA4A0C21b5009f5a0d015B23A -- BVM_EigenDataLayrChain Proxy (DA1) (last used as of block 19437271) + , 0x5BD63a7ECc13b955C4F57e3F12A64c10263C14c1 -- DataLayrServiceManager Proxy (DA2) (used as of block 19439557) +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x49cd3004 -- createAssertionWithStateBatch + , 0x9aaab648 -- proposeL2Output + , 0x5e4a3056 -- storeData (DA1) + , 0x4618ed87 -- confirmData (DA1) + , 0x58942e73 -- confirmDataStore (DA2) + , 0xdcf49ea7 -- initDataStore (DA2) +) +AND t.block_time >= TIMESTAMP '2023-06-27' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_optimism_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_optimism_l1_data_fees.sql new file mode 100644 index 00000000000..b1969066668 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_optimism_l1_data_fees.sql @@ -0,0 +1,46 @@ +{{ config( + schema = 'rollup_economics_optimism' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + -- 'optimism' AS name + lower(protocol_name) AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM ( + SELECT + protocol_name, t.block_time, t.block_number, t.hash, t.index, t.gas_used, t.gas_price, t.data + FROM {{ source('ethereum','transactions') }} as t + INNER JOIN {{ source('addresses_ethereum','optimism_batchinbox_combinations') }} as op + ON t."from" = op.l1_batch_inbox_from_address + AND t.to = op.l1_batch_inbox_to_address + WHERE t.block_time >= timestamp '2020-01-01' + + UNION ALL + + SELECT + protocol_name, t.block_time, t.block_number, t.hash, t.index, t.gas_used, t.gas_price, t.data + FROM {{ source('ethereum','transactions') }} as t + INNER JOIN {{ source('addresses_ethereum','optimism_outputoracle_combinations') }} as op + ON t."from" = op.l2_output_oracle_from_address + AND t.to = op.l2_output_oracle_to_address + WHERE t.block_time >= timestamp '2020-01-01' +) t +{% if is_incremental() %} +WHERE {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_scroll_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_scroll_l1_data_fees.sql new file mode 100644 index 00000000000..3695cd3f89d --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_scroll_l1_data_fees.sql @@ -0,0 +1,35 @@ +{{ config( + schema = 'rollup_economics_scroll' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'scroll' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0xa13BAF47339d63B743e7Da8741db5456DAc1E556 +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x1325aca0, -- Commit Batch + 0x86b053a9 -- commitBatchWithBlobProof +) +AND t.block_time >= TIMESTAMP '2023-10-07' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_starknet_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_starknet_l1_data_fees.sql new file mode 100644 index 00000000000..be191466e11 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_starknet_l1_data_fees.sql @@ -0,0 +1,35 @@ +{{ config( + schema = 'rollup_economics_starknet' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'starknet' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4 -- StateUpdate proxy contract +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x77552641 -- updateState + , 0xb72d42a1 -- updateStateKzgDA +) +AND t.block_time >= TIMESTAMP '2021-10-23' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zkevm_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zkevm_l1_data_fees.sql new file mode 100644 index 00000000000..04973c80f8a --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zkevm_l1_data_fees.sql @@ -0,0 +1,37 @@ +{{ config( + schema = 'rollup_economics_zkevm' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'zkevm' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0x5132a183e9f3cb7c848b0aac5ae0c4f0491b7ab2 -- old proxy + , 0x519E42c24163192Dca44CD3fBDCEBF6be9130987 -- new proxy (as of block 19218878) +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x5e9145c9 -- sequenceBatches + , 0xecef3f99 -- sequenceBatches (as of block 19218878) + , 0xdef57e54 -- sequenceBatches +) +AND t.block_time >= TIMESTAMP '2023-03-01' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zksync_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zksync_l1_data_fees.sql new file mode 100644 index 00000000000..6c16c23f2ea --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zksync_l1_data_fees.sql @@ -0,0 +1,42 @@ +{{ config( + schema = 'rollup_economics_zksync' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'zksync era' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0x3dB52cE065f728011Ac6732222270b3F2360d919 -- L1 transactions settle here pre-Boojum + , 0xa0425d71cB1D6fb80E65a5361a04096E0672De03 -- L1 transactions settle here post-Boojum + , 0xa8CB082A5a689E0d594d7da1E2d72A3D63aDc1bD -- L1 transactions settle here post-EIP4844 + , 0x5D8ba173Dc6C3c90C8f7C04C9288BeF5FDbAd06E -- L1 transactions settle here post v24 upgrade (shared bridge) +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x0c4dd810 -- Commit Block, pre-Boojum + , 0xce9dcf16 -- Execute Block, pre-Boojum + , 0x701f58c5 -- Commit Batches, post-Boojum + , 0xc3d93e7c -- Execute Batches, post-Boojum + , 0x6edd4f12 -- Commit Batches, post v24 upgrade (shared bridge) + , 0x6f497ac6 -- Execute Batches, post v24 upgrade (shared bridge) +) +AND t.block_time >= TIMESTAMP '2023-02-14' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zksync_lite_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zksync_lite_l1_data_fees.sql new file mode 100644 index 00000000000..d5d535c86ec --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/chains/rollup_economics_zksync_lite_l1_data_fees.sql @@ -0,0 +1,39 @@ +{{ config( + schema = 'rollup_economics_zksync_lite' + , alias = 'l1_data_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'zksync_lite' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS data_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , (length(t.data)) AS data_length +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0xabea9132b05a70803a4e85094fd0e1800777fbef +) +AND t."from" IN ( + 0xda7357bbce5e8c616bc7b0c3c86f0c71c5b4eabb -- Old L2 Operator + , 0x18c208921F7a741510a7fc0CfA51E941735DAE54 -- L2 Operator + , 0x01c3a1a6890a146ac187a019f9863b3ab2bff91e -- L2 Operator V1 +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x45269298 -- Commit Block +) +AND t.block_time >= TIMESTAMP '2021-02-09' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/rollup_economics_ethereum_l1_data_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/rollup_economics_ethereum_l1_data_fees.sql new file mode 100644 index 00000000000..b998dac6bbc --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees/rollup_economics_ethereum_l1_data_fees.sql @@ -0,0 +1,67 @@ +{{ config( + schema = 'rollup_economics_ethereum' + , alias = 'l1_data_fees' + , materialized = 'view' + , unique_key = ['name', 'tx_hash'] +)}} + +{% set base_models = [ + ref('rollup_economics_arbitrum_l1_data_fees') + , ref('rollup_economics_imx_l1_data_fees') + , ref('rollup_economics_linea_l1_data_fees') + , ref('rollup_economics_loopring_l1_data_fees') + , ref('rollup_economics_mantle_l1_data_fees') + , ref('rollup_economics_optimism_l1_data_fees') + , ref('rollup_economics_scroll_l1_data_fees') + , ref('rollup_economics_starknet_l1_data_fees') + , ref('rollup_economics_zkevm_l1_data_fees') + , ref('rollup_economics_zksync_l1_data_fees') + , ref('rollup_economics_zksync_lite_l1_data_fees') +] %} + +WITH base_union AS ( + SELECT * + FROM ( + {% for base_model in base_models %} + SELECT + name + , block_month + , block_date + , block_time + , block_number + , tx_hash + , tx_index + , gas_price + , gas_used + , data_fee_native + , calldata_gas_used + , data_length + FROM + {{ base_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} + ) +) + +SELECT + b.name + , b.block_month + , b.block_date + , b.block_time + , b.block_number + , b.tx_hash + , b.tx_index + , b.gas_price + , b.gas_used + , b.data_fee_native + , b.data_fee_native * p.price AS data_fee_usd + , b.calldata_gas_used + , b.data_length +FROM base_union b +INNER JOIN {{ source('prices', 'usd') }} p + ON p.minute = date_trunc('minute', b.block_time) + AND p.blockchain IS NULL + AND p.symbol = 'ETH' + AND p.minute >= TIMESTAMP '2020-01-01' \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_fees.sql deleted file mode 100644 index 6433b07d2d5..00000000000 --- a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_fees.sql +++ /dev/null @@ -1,71 +0,0 @@ -{{ config( - schema = 'rollup_economics_ethereum', - alias = 'l1_fees', - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - unique_key = ['name', 'day'], - post_hook='{{ expose_spells(\'["ethereum"]\', - "project", - "rollup_economics", - \'["niftytable"]\') }}' -)}} - -WITH l1_data AS ( - SELECT - date_trunc('day',block_time) as day, - name, - SUM(gas_spent) as l1_data_fee, - SUM(gas_spent_usd) as l1_data_fee_usd - FROM {{ ref('l1_data_fees')}} - {% if is_incremental() %} - WHERE block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - GROUP BY 1,2 -), - -l1_verification AS ( - SELECT - date_trunc('day',block_time) as day, - name, - SUM(gas_spent) as l1_verification_fee, - SUM(gas_spent_usd) as l1_verification_fee_usd - FROM {{ ref('l1_verification_fees')}} - {% if is_incremental() %} - WHERE block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - GROUP BY 1,2 -), - -l1_blobs AS ( - SELECT - date_trunc('day',block_time) as day, - name, - SUM(blob_spend) as l1_blob_fee, - SUM(blob_spend_usd) as l1_blob_fee_usd - FROM {{ ref('l1_blob_fees')}} - {% if is_incremental() %} - WHERE block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - GROUP BY 1,2 -) - -SELECT -d.day, -d.name, -l1_data_fee, -l1_data_fee_usd, -l1_verification_fee, -l1_verification_fee_usd, -l1_blob_fee, -l1_blob_fee_usd, -l1_data_fee + l1_verification_fee + l1_blob_fee AS l1_fee, -l1_data_fee_usd + l1_verification_fee_usd + l1_blob_fee_usd AS l1_fee_usd -FROM l1_data d -LEFT JOIN l1_verification v - ON v.day = d.day - AND v.name = d.name -LEFT JOIN l1_blobs b - ON b.day = d.day - AND b.name = d.name - diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees.sql deleted file mode 100644 index 03009a621a3..00000000000 --- a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees.sql +++ /dev/null @@ -1,192 +0,0 @@ -{{ config( - schema = 'rollup_economics_ethereum', - alias = 'l1_verification_fees', - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - unique_key = ['name', 'hash'], - post_hook='{{ expose_spells(\'["ethereum"]\', - "project", - "rollup_economics", - \'["niftytable"]\') }}' -)}} - -with verify_txns as ( - SELECT - 'zksync era' AS name, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - 44*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb, - t.gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE ( - -- L1 transactions settle here pre-Boojum - t.to = 0x3dB52cE065f728011Ac6732222270b3F2360d919 - -- L1 transactions settle here post-Boojum - OR t.to = 0xa0425d71cB1D6fb80E65a5361a04096E0672De03 - -- L1 transactions settle here post-EIP4844 - OR t.to = 0xa8CB082A5a689E0d594d7da1E2d72A3D63aDc1bD - ) - AND ( - -- L1 transactions use these method ID's pre-Boojum - bytearray_substring(t.data, 1, 4) = 0x7739cbe7 -- Prove Block - OR - -- L1 transactions use these method ID's post-Boojum - bytearray_substring(t.data, 1, 4) = 0x7f61885c -- Prove Batches - ) - AND t.block_time >= timestamp '2023-03-01' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'polygon zkevm' AS name, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - 24*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb, - t.gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE t.to = 0x5132a183e9f3cb7c848b0aac5ae0c4f0491b7ab2 - AND bytearray_substring(t.data, 1, 4) IN ( - 0x2b0006fa, -- verifyBatchesTrustedAggregator - 0x1489ed10 -- verifyBatchesTrustedAggregator (since block 19218496) - ) - AND t.block_time >= timestamp '2023-03-23' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'starkware' AS name, -- SHARPVerify used collectively by: Starknet, Sorare, ImmutableX, Apex, Myria, rhino.fi and Canvas Connect - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - 456*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb, -- proof size might get longer with more chains - t.gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE t.to = 0x47312450B3Ac8b5b8e247a6bB6d523e7605bDb60 - AND bytearray_substring(t.data, 1, 4) = 0x9b3b76cc -- Verify Availability Proof, imx committee - AND t.block_time >= timestamp '2021-10-23' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'scroll' AS name, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - 110*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb, - t.gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - WHERE t.to = 0xa13BAF47339d63B743e7Da8741db5456DAc1E556 - AND bytearray_substring(t.data, 1, 4) IN ( - 0x31fa742d, -- finalizeBatchWithProof, - 0x00b0f4d7 -- finalizeBatchWithProof4844 - ) - AND t.block_time >= timestamp '2023-10-07' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - - UNION ALL - - SELECT - 'linea' AS chain, - t.block_number, - t.hash, - (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent, - p.price * (cast(gas_used as double) * (cast(gas_price as double) / 1e18)) as gas_spent_usd, - 0.001 AS proof_size_mb, - t.gas_used, - {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used - FROM {{ source('ethereum','transactions') }} AS t - INNER JOIN {{ source('prices','usd') }} p - ON p.minute = date_trunc('minute', t.block_time) - AND p.blockchain is null - AND p.symbol = 'ETH' - {% if is_incremental() %} - AND p.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} - AND t.to = 0xd19d4B5d358258f05D7B411E21A1460D11B0876F -- Linea, L1 Message Service - AND bytearray_substring(t.data, 1, 4) IN - ( - 0x4165d6dd, -- Finalize Blocks (proof verified immediately) - 0xd630280f -- finalizeCompressedBlocksWithProof (Aplha v2 Release at block. 19222438) - ) - AND t.block_time >= timestamp '2023-07-12' - {% if is_incremental() %} - AND t.block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} -) - -,block_basefees as ( - SELECT - b.number as block_number - , b.base_fee_per_gas - , b.time - FROM {{ source('ethereum','blocks') }} as b - WHERE b.time >= timestamp '2021-10-23' - {% if is_incremental() %} - AND b.time >= date_trunc('day', now() - interval '7' day) - {% endif %} -) - - -SELECT - txs.name, - txs.hash, - txs.block_number, - bxs.time as block_time, - txs.proof_size_mb, - gas_spent, - gas_spent_usd, - gas_used, - calldata_gas_used -FROM verify_txns txs -INNER JOIN block_basefees bxs - ON txs.block_number = bxs.block_number diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/_schema.yml new file mode 100644 index 00000000000..0466ea6ae1c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/_schema.yml @@ -0,0 +1,57 @@ +version: 2 + +models: + - name: rollup_economics_ethereum_l1_verification_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by rollups for proof verification on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - &name + name: name + description: "Name of the rollup" + - &block_month + name: block_month + description: "UTC event block month of each transaction" + - &block_date + name: block_date + description: "UTC event block date of each transaction" + - &block_time + name: block_time + description: "UTC event block time of each transaction" + - &block_number + name: block_number + description: "Block number of each transaction" + - &tx_hash + name: tx_hash + description: "Transaction hash" + - &tx_index + name: tx_index + description: "Transaction index" + - &gas_price + name: gas_price + description: "Gas price (in WEI) of transaction" + - &gas_used + name: gas_used + description: "Amount of gas units consumed by the transaction" + - &verification_fee_native + name: verification_fee_native + description: "Fee spent on calldata gas by the transaction (in ETH)" + - &verification_fee_usd + name: verification_fee_usd + description: "Fee spent on calldata gas by the transaction (in USD)" + - &calldata_gas_used + name: calldata_gas_used + description: "Gas units used by calldata (input data) by L1 Transactions" + - &proof_size_mb + name: proof_size_mb + description: "Size of proofs posted to Ethereum (in MBs)" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/_schema.yml new file mode 100644 index 00000000000..523fb763ca2 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/_schema.yml @@ -0,0 +1,166 @@ +version: 2 + +models: + - name: rollup_economics_linea_l1_verification_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Linea for proof verification on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - &name + name: name + description: "Name of the rollup" + - &block_month + name: block_month + description: "UTC event block month of each transaction" + - &block_date + name: block_date + description: "UTC event block date of each transaction" + - &block_time + name: block_time + description: "UTC event block time of each transaction" + - &block_number + name: block_number + description: "Block number of each transaction" + - &tx_hash + name: tx_hash + description: "Transaction hash" + - &tx_index + name: tx_index + description: "Transaction index" + - &gas_price + name: gas_price + description: "Gas price of transaction (in wei)" + - &gas_used + name: gas_used + description: "Amount of gas units consumed by the transaction" + - &verification_fee_native + name: verification_fee_native + description: "Fee spent on proof verification by the transaction (in ETH)" + - &calldata_gas_used + name: calldata_gas_used + description: "Gas units used by calldata (input data) by the transaction" + - &proof_size_mb + name: proof_size_mb + description: "Size of proofs posted to Ethereum (in MBs)" + + - name: rollup_economics_scroll_l1_verification_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Scroll for proof verification on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *verification_fee_native + - *calldata_gas_used + - *proof_size_mb + + - name: rollup_economics_starknet_l1_verification_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Starknet for proof verification on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *verification_fee_native + - *calldata_gas_used + - *proof_size_mb + + - name: rollup_economics_zkevm_l1_verification_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by Polygon zkEVM for proof verification on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *verification_fee_native + - *calldata_gas_used + - *proof_size_mb + + - name: rollup_economics_zksync_l1_verification_fees + meta: + blockchain: ethereum + sector: rollup_economics + project: rollup_economics + contributors: niftytable, lgingerich + config: + tags: ['rollup', 'l2'] + description: Fees spent by ZKsync Era for proof verification on Ethereum + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - name + - tx_hash + columns: + - *name + - *block_month + - *block_date + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *gas_price + - *gas_used + - *verification_fee_native + - *calldata_gas_used + - *proof_size_mb \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_linea_l1_verification_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_linea_l1_verification_fees.sql new file mode 100644 index 00000000000..d98fb88dfa1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_linea_l1_verification_fees.sql @@ -0,0 +1,36 @@ +{{ config( + schema = 'rollup_economics_linea' + , alias = 'l1_verification_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'linea' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS verification_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , 44*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0xd19d4B5d358258f05D7B411E21A1460D11B0876F -- Linea, L1 Message Service +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x4165d6dd -- Finalize Blocks (proof verified immediately) + , 0xd630280f -- finalizeCompressedBlocksWithProof (Aplha v2 Release at block. 19222438) + , 0xabffac32 -- finalizeBlocksWithProof +) +AND t.block_time >= TIMESTAMP '2023-07-12' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_scroll_l1_verification_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_scroll_l1_verification_fees.sql new file mode 100644 index 00000000000..bfb16defef5 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_scroll_l1_verification_fees.sql @@ -0,0 +1,36 @@ +{{ config( + schema = 'rollup_economics_scroll' + , alias = 'l1_verification_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'scroll' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS verification_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , 44*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0xa13BAF47339d63B743e7Da8741db5456DAc1E556 +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x31fa742d -- finalizeBatchWithProof + , 0x00b0f4d7 -- finalizeBatchWithProof4844 + , 0x4f099e3d -- finalizeBundleWithProof +) +AND t.block_time >= TIMESTAMP '2023-10-07' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_starknet_l1_verification_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_starknet_l1_verification_fees.sql new file mode 100644 index 00000000000..8535a1e385f --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_starknet_l1_verification_fees.sql @@ -0,0 +1,34 @@ +{{ config( + schema = 'rollup_economics_starknet' + , alias = 'l1_verification_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'starkware' AS name -- SHARPVerify used collectively by: Starknet, Sorare, ImmutableX, Apex, Myria, rhino.fi and Canvas Connect + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS verification_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , 44*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0x47312450B3Ac8b5b8e247a6bB6d523e7605bDb60 +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x9b3b76cc -- Verify Availability Proof, imx committee +) +AND t.block_time >= TIMESTAMP '2021-10-23' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_zkevm_l1_verification_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_zkevm_l1_verification_fees.sql new file mode 100644 index 00000000000..64e055fc02f --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_zkevm_l1_verification_fees.sql @@ -0,0 +1,35 @@ +{{ config( + schema = 'rollup_economics_zkevm' + , alias = 'l1_verification_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'zkevm' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS verification_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , 44*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb +FROM {{ source('ethereum', 'transactions') }} t +WHERE t.to IN ( + 0x5132a183e9f3cb7c848b0aac5ae0c4f0491b7ab2 +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x2b0006fa -- verifyBatchesTrustedAggregator + , 0x1489ed10 -- verifyBatchesTrustedAggregator (since block 19218496) +) +AND t.block_time >= TIMESTAMP '2023-03-01' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_zksync_l1_verification_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_zksync_l1_verification_fees.sql new file mode 100644 index 00000000000..155d129bedb --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/chains/rollup_economics_zksync_l1_verification_fees.sql @@ -0,0 +1,39 @@ +{{ config( + schema = 'rollup_economics_zksync' + , alias = 'l1_verification_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'tx_hash'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +)}} + +SELECT + 'zksync era' AS name + , cast(date_trunc('month', t.block_time) AS date) AS block_month + , cast(date_trunc('day', t.block_time) AS date) AS block_date + , t.block_time + , t.block_number + , t.hash AS tx_hash + , t.index AS tx_index + , t.gas_price + , t.gas_used + , (t.gas_price / 1e18) * t.gas_used AS verification_fee_native + , {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used + , 44*32 / cast(1024 AS double) / cast(1024 AS double) AS proof_size_mb +FROM {{ source('ethereum', 'transactions') }} AS t +WHERE t.to IN ( + 0x3dB52cE065f728011Ac6732222270b3F2360d919 -- L1 transactions settle here pre-Boojum + , 0xa0425d71cB1D6fb80E65a5361a04096E0672De03 -- L1 transactions settle here post-Boojum + , 0xa8CB082A5a689E0d594d7da1E2d72A3D63aDc1bD -- L1 transactions settle here post-EIP4844 + , 0x5D8ba173Dc6C3c90C8f7C04C9288BeF5FDbAd06E -- L1 transactions settle here post v24 upgrade (shared bridge) +) +AND bytearray_substring(t.data, 1, 4) IN ( + 0x7739cbe7 -- Prove Block, pre-Boojum + , 0x7f61885c -- Prove Batches, post-Boojum + , 0xc37533bb -- Prove Batches, post v24 upgrade (shared bridge) +) +AND t.block_time >= TIMESTAMP '2023-02-14' +{% if is_incremental() %} +AND {{incremental_predicate('t.block_time')}} +{% endif %} \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/rollup_economics_ethereum_l1_verification_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/rollup_economics_ethereum_l1_verification_fees.sql new file mode 100644 index 00000000000..e170a0128d6 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees/rollup_economics_ethereum_l1_verification_fees.sql @@ -0,0 +1,61 @@ +{{ config( + schema = 'rollup_economics_ethereum' + , alias = 'l1_verification_fees' + , materialized = 'view' + , unique_key = ['name', 'tx_hash'] +)}} + +{% set base_models = [ + ref('rollup_economics_linea_l1_verification_fees') + , ref('rollup_economics_scroll_l1_verification_fees') + , ref('rollup_economics_starknet_l1_verification_fees') + , ref('rollup_economics_zkevm_l1_verification_fees') + , ref('rollup_economics_zksync_l1_verification_fees') +] %} + +WITH base_union AS ( + SELECT * + FROM ( + {% for base_model in base_models %} + SELECT + name + , block_month + , block_date + , block_time + , block_number + , tx_hash + , tx_index + , gas_price + , gas_used + , verification_fee_native + , calldata_gas_used + , proof_size_mb + FROM + {{ base_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} + ) +) + +SELECT + b.name + , b.block_month + , b.block_date + , b.block_time + , b.block_number + , b.tx_hash + , b.tx_index + , b.gas_price + , b.gas_used + , b.verification_fee_native + , b.verification_fee_native * p.price AS verification_fee_usd + , b.calldata_gas_used + , b.proof_size_mb +FROM base_union b +INNER JOIN {{ source('prices', 'usd') }} p + ON p.minute = date_trunc('minute', b.block_time) + AND p.blockchain IS NULL + AND p.symbol = 'ETH' + AND p.minute >= TIMESTAMP '2021-05-29' \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l2_revenue.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l2_revenue.sql deleted file mode 100644 index a23d5d17a97..00000000000 --- a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/l2_revenue.sql +++ /dev/null @@ -1,30 +0,0 @@ -{{ config( - schema = 'rollup_economics_ethereum', - alias = 'l2_revenue', - - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - unique_key = ['day', 'name'], - post_hook='{{ expose_spells(\'["ethereum"]\', - "project", - "rollup_economics", - \'["niftytable", "maybeYonas", "lgingerich"]\') }}' -)}} - -SELECT - date_trunc('day', block_time) AS day - , CASE -- (hopefully) temporary renaming to match old logic - WHEN blockchain = 'zksync' THEN 'zksync era' - WHEN blockchain = 'zkevm' THEN 'polygon zkevm' - WHEN blockchain = 'optimism' THEN 'op mainnet' - ELSE blockchain - END AS name - , SUM(tx_fee_native) AS l2_rev - , SUM(tx_fee_usd) AS l2_rev_usd -FROM {{ source('gas', 'fees') }} -WHERE blockchain IN ('arbitrum', 'base', 'blast', 'linea', 'mantle', 'optimism', 'scroll', 'zksync', 'zkevm', 'zora') -{% if is_incremental() %} -AND {{ incremental_predicate('block_time') }} -{% endif %} -GROUP BY 1, 2 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_l1_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_l1_fees.sql new file mode 100644 index 00000000000..a46b83aa41a --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_l1_fees.sql @@ -0,0 +1,72 @@ +{{ config( + schema = 'rollup_economics_ethereum' + , alias = 'l1_fees' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['name', 'day'] + , post_hook='{{ expose_spells(\'["ethereum"]\', + "project", + "rollup_economics", + \'["niftytable"]\') }}' +)}} + +WITH l1_data AS ( + SELECT + date_trunc('day', block_time) as day + , name + , SUM(data_fee_native) as data_fee_native + , SUM(data_fee_usd) as data_fee_usd + , SUM(calldata_gas_used) as calldata_gas_used + FROM {{ ref('rollup_economics_ethereum_l1_data_fees')}} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_time')}} + {% endif %} + GROUP BY 1, 2 +) + +, l1_verification AS ( + SELECT + date_trunc('day', block_time) as day + , name + , SUM(verification_fee_native) as verification_fee_native + , SUM(verification_fee_usd) as verification_fee_usd + FROM {{ ref('rollup_economics_ethereum_l1_verification_fees')}} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_time')}} + {% endif %} + GROUP BY 1, 2 +), + +l1_blobs AS ( + SELECT + date_trunc('day', block_time) as day + , name + , SUM(blob_fee_native) as blob_fee_native + , SUM(blob_fee_usd) as blob_fee_usd + FROM {{ ref('rollup_economics_ethereum_l1_blob_fees')}} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_time')}} + {% endif %} + GROUP BY 1, 2 +) + +SELECT + COALESCE(d.day, v.day, b.day) as day + , COALESCE(d.name, v.name, b.name) as name + , COALESCE(data_fee_native, 0) AS data_fee_native + , COALESCE(data_fee_usd, 0) AS data_fee_usd + , COALESCE(calldata_gas_used, 0) AS calldata_gas_used + , COALESCE(verification_fee_native, 0) AS verification_fee_native + , COALESCE(verification_fee_usd, 0) AS verification_fee_usd + , COALESCE(blob_fee_native, 0) AS blob_fee_native + , COALESCE(blob_fee_usd, 0) AS blob_fee_usd + , COALESCE(data_fee_native, 0) + COALESCE(verification_fee_native, 0) + COALESCE(blob_fee_native, 0) AS l1_fee_native + , COALESCE(data_fee_usd, 0) + COALESCE(verification_fee_usd, 0) + COALESCE(blob_fee_usd, 0) AS l1_fee_usd +FROM l1_data d +FULL OUTER JOIN l1_verification v + ON d.day = v.day + AND d.name = v.name +FULL OUTER JOIN l1_blobs b + ON d.day = b.day + AND d.name = b.name \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_l2_revenue.sql b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_l2_revenue.sql new file mode 100644 index 00000000000..dd68a4b1cff --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_l2_revenue.sql @@ -0,0 +1,29 @@ +{{ config( + schema = 'rollup_economics_ethereum' + , alias = 'l2_revenue' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['day', 'name'] + , post_hook='{{ expose_spells(\'["ethereum"]\', + "project", + "rollup_economics", + \'["niftytable", "maybeYonas", "lgingerich"]\') }}' +)}} + +SELECT + date_trunc('day', block_time) AS day + , CASE + WHEN blockchain = 'zksync' THEN 'zksync era' + WHEN blockchain = 'zkevm' THEN 'polygon zkevm' + WHEN blockchain = 'optimism' THEN 'op mainnet' + ELSE blockchain + END AS name + , SUM(tx_fee) AS l2_rev + , SUM(tx_fee_usd) AS l2_rev_usd +FROM {{ ref('gas_fees') }} +WHERE blockchain IN ('arbitrum', 'base', 'blast', 'linea', 'mantle', 'optimism', 'scroll', 'zksync', 'zkevm', 'zora') +{% if is_incremental() %} +AND {{ incremental_predicate('block_time') }} +{% endif %} +GROUP BY 1, 2 diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_schema.yml deleted file mode 100644 index 52354512388..00000000000 --- a/dbt_subprojects/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_schema.yml +++ /dev/null @@ -1,133 +0,0 @@ -version: 2 - -models: - - name: l1_data_fees - meta: - blockchain: ethereum - sector: rollup_economics - project: rollup_economics - contributors: niftytable - config: - tags: ['rollup', 'l2'] - description: Gas fees paid by rollups for posting transaction data or state updates on Ethereum - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - name - - hash - columns: - - &name - name: name - description: "name of the rollup" - - &hash - name: hash - description: "hash of the l1 transaction" - - &block_time - name: block_time - description: "UTC event block time of the transaction" - - &block_number - name: block_number - description: "Block number of the transaction" - - &data_length - name: data_length - description: "byte length of the data posted to l1" - - &gas_spent - name: gas_spent - description: "ETH spent on posting data to L1" - - &gas_spent_usd - name: gas_spent_usd - description: "fee paid to post data on L1 in usd" - - &gas_used - name: gas_used - description: "Gas units used by L1 Transactions" - - &calldata_gas_used - name: calldata_gas_used - description: "Gas units used by calldata (input data) by L1 Transactions" - - - name: l1_verification_fees - meta: - blockchain: ethereum - sector: rollup_economics - project: rollup_economics - contributors: niftytable - config: - tags: ['rollup', 'l2'] - description: Gas fees paid by rollups for posting proofs on Ethereum - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - name - - hash - columns: - - *name - - *hash - - *block_time - - *block_number - - &proof_size_mb - name: proof_size_mb - description: "size of proofs posted to l1 in MBs" - - *gas_spent - - *gas_spent_usd - - *gas_used - - *calldata_gas_used - - - name: l2_revenue - meta: - blockchain: ethereum - sector: rollup_economics - project: rollup_economics - contributors: niftytable - config: - tags: ['rollup', 'l2'] - description: Gas fees earned by rollup on L2 - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - name - - day - columns: - - &day - name: day - description: "day gas fees were earned" - - *name - - &l2_rev - name: l2_rev - description: "revenue earned in eth" - - &l2_rev_usd - name: l2_rev_usd - description: "revenue earned in usd" - - - name: l1_blob_fees - meta: - blockchain: ethereum - sector: rollup_economics - project: rollup_economics - contributors: niftytable - config: - tags: ['rollup', 'l2'] - description: Blob fees paid by rollups for posting blobs on Ethereum - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - name - - hash - columns: - - *name - - *hash - - *block_time - - *block_number - - &blob_gas_used - name: blob_gas_used - description: "total blob gas used in the transaction" - - &blob_base_fee - name: blob_base_fee - description: "the base fee (wei) per blob gas" - - &blob_spend - name: blob_spend - description: "fee paid to submit blobs in ETH" - - &blob_spend_usd - name: blob_spend - description: "fee paid to submit blobs in USD" - - &blob_count - name: blob_count - description: "amount of blobs submitted in the transaction" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_contracts.sql b/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_contracts.sql index da6fbb31e3d..599094462c9 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_contracts.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_contracts.sql @@ -15,6 +15,7 @@ WITH contracts AS ( (0xdcd51fc5cd918e0461b9b7fb75967fdfd10dae2f, 'Rocket Pool', 'Liquid Staking') , (0x1cc9cf5586522c6f483e84a19c3c2b0b6d027bf0, 'Rocket Pool', 'Liquid Staking') , (0x2fb42ffe2d7df8381853e96304300c6a5e846905, 'Rocket Pool', 'Liquid Staking') + , (0x9304b4ebfbe68932cf9af8de4d21d7e7621f701a, 'Rocket Pool', 'Liquid Staking') --, (0x9b8c989ff27e948f55b53bb19b3cc1947852e394, 'Kiln', 'Staking Pool') -- Kiln doesn't custody or manage any validators, hence the removal --, (0x1e68238ce926dec62b3fbc99ab06eb1d85ce0270, 'Kiln', 'Staking Pool') , (0x2421a0af8badfae12e1c1700e369747d3db47b09, 'SenseiNode', 'Staking Pool') diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql b/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql index dc9f6d245ed..4d57d43f058 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql @@ -31,6 +31,7 @@ FROM , (0x746d8a8fcab7f829fa500504f60d89c5cc1ea973, 'Kiln', 'Kiln 5', 'Staking Pool') , (0x0816df553a89c4bff7ebfd778a9706a989dd3ce3, 'Kiln', 'Kiln 6', 'Staking Pool') , (0xef650d5dbe75f39e2ec18a4381f75c8a4d4e19c8, 'Kiln', 'Kiln 7', 'Staking Pool') + , (0x576834cb068e677db4aff6ca245c7bde16c3867e, 'Kiln', 'Kiln 8', 'Staking Pool') , (0xbf1556a7d625654e3d64d1f0466a60a697fac178, 'imToken', 'imToken Staking[NodeProviderInfStones]', 'Staking Pool') , (0xbca3b7b87dcb15f0efa66136bc0e4684a3e5da4d, 'SharedStake', 'SharedStake', 'Liquid Staking') , (0xeadcba8bf9aca93f627f31fb05470f5a0686ceca, 'StakeWise', 'StakeWise Solos', 'Staking Pool') diff --git a/dbt_subprojects/hourly_spellbook/packages.yml b/dbt_subprojects/hourly_spellbook/packages.yml index 6152b330974..ff9ca2cf98a 100644 --- a/dbt_subprojects/hourly_spellbook/packages.yml +++ b/dbt_subprojects/hourly_spellbook/packages.yml @@ -1,3 +1,3 @@ packages: - package: dbt-labs/dbt_utils - version: 1.1.1 \ No newline at end of file + version: 1.3.0 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/gas/_schema.yml b/dbt_subprojects/hourly_spellbook/seeds/_sector/gas/_schema.yml new file mode 100644 index 00000000000..80ff3106cbb --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/gas/_schema.yml @@ -0,0 +1,9 @@ +version: 2 +seeds: + - name: evm_gas_fees + config: + column_types: + blockchain: varchar + type: varchar + tx_hash: varbinary + tx_fee_raw: uint256 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/gas/evm_gas_fees.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/gas/evm_gas_fees.csv new file mode 100644 index 00000000000..fce13ac3d2e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/gas/evm_gas_fees.csv @@ -0,0 +1,64 @@ +blockchain,type,tx_hash,tx_fee_raw +arbitrum,AccessList,0x1be298e3fa1cec3412a8b4ff806a0171a07f635affe330e6144295c0b13120f2,144914700000000 +arbitrum,Legacy,0x58f0c5843adb6ee2a7bb7e0f788e39dae069ba9ef71bfc27981cbb2a2a8677bf,43673648205860 +arbitrum,DynamicFee,0x1fca164e2a5af0fca03365ec658969b479fcbb8bf41b2bcbb649cf8b4731855c,140453600000000 +avalanche_c,AccessList,0x02a2dd8f9c4659ebc818ff2fa70b066c512c08286828bad405d7188f0b1f0522,1017150000000000 +avalanche_c,DynamicFee,0x9cd681856f8bb5a6c3fabce6d0857165c54dd13f5fb9dd6784a9404a0434b56f,556500000000000 +avalanche_c,Legacy,0x6dab7d444a92e826c52165696b0603428e43ce4f2ef317871a5c9237626e8b0b,45639295044586854 +base,126,0x4c2ab099b4a4f77bba5428ddae8a42c1b4c6ef51ce26d9a4afb11bc433b5dbf8,0 +base,DynamicFee,0x5d46274e5dee80f4ca0cb58adbb14d177c76af2875c78844fa7512b11706af67,29467970660515 +base,Legacy,0x6d3a6c143cf1bf0694c8502ed7f4af254aa948508e992835657809b9840624e4,21404725384344 +base,AccessList,0xd32f91cff5136ce1f018598bdb920be19b0d6e7b502dc89ceafa443bd1d59fed,248702357305951 +blast,AccessList,0xc709c5c47e9321615cfa8f402aae5e60eda75eb85987c52e63f005e442eb1daf,1938309381808772 +blast,126,0x8b5c3ccb8920640313212fc3b179220beed71849a359424f5f5f23689a5508b3,0 +blast,DynamicFee,0x2f478468d173337c579ce62d69c51b8c77ddc09ab3bb25a5cf320efdddb429ef,927100083554 +blast,Legacy,0x9135a6975700fb371c1f5f9930fe0a96792fa5413053e295fed4429d5857cefe,272792885398 +bnb,DynamicFee,0x86442b0bec019914dedc6c8b6587d4a641af9d5c93f5fe43489e886bf8e2111f,1031585000000000 +bnb,AccessList,0x279f9816fc207da331e5db4146b2f8cdbf2711f8afad428eed5342b51bb6ed38,1067151000000000 +bnb,Legacy,0xeef4761a0657ec8b4611107102f9513926d6e1aa7299cfbcc10421d0da1943ff,764130000000000 +celo,DynamicFee,0x3fdc11afad69785f956db03e6645dee645502c6d8576e2d350ffe4f7d0c22370,5024275000000000 +celo,AccessList,0x23dac79f73634e14d706051608215578a249615c8a215560376c44cc357a24e5,537800000000000 +celo,123,0x9c1f2ce2a32b9a111a8203c3573677f9ba63234b7176648ac12d0203fec87d70,805071995938897 +celo,Legacy,0xde1b99d696a36053356cbcc5f51338c99fe9a8f51e4caf00de2527913233e52a,116052600000000 +celo,124,0xbb7f9377890878de3d4b4c1accd6754cbddae060a26c62b96b6db32d072acab3,323998500000000 +celo,DynamicFee,0x0994bae7edf1eebc76551f0e45dc746a0864f87614d05e03588dedc5f43270b2,1019635000000000 +ethereum,AccessList,0xba1151d9b887a2c830d348f105b03c137606ab060e1875b966a8026b84656fce,28050251160968208 +ethereum,3,0xf324dd5f2c35b50c535d79e9d762f9cbadf7fb068d0303b542147a4d3765e5a6,9721270532481626 +ethereum,Legacy,0xa949e6ec5695e8ef02955cd08e17903774e90a3f0d04f4b513a08ac51f4ec0fc,1515250000000000 +ethereum,DynamicFee,0x3b9cb21ee8f7881d03de12fa39b97b2e49e249b28582b20481b8c388ab27bb27,2333844881109000 +fantom,DynamicFee,0x3831c06e2e1c2dc00ca40eccd8d65891c3be3133558c3bdce7f56ba6e4efda6b,334464160507994 +fantom,AccessList,0x53788e566ac62818a7dbcd92e822e83a34eba4793b40c961750f2272e72fc346,257707350406461480 +fantom,Legacy,0xa85a1c62418d592640561ba8802030f54ca38cee6d9373d9e67166f0f1e76e1e,2679694500000000 +gnosis,3,0xf6729acd1da624a82758f5a9905fb80b91dc34dd2b472c63984b0e38eea66924,210241359447000 +gnosis,DynamicFee,0xd5ee04af7373a6357a1a5ca4c91212b3accca182157426fade2c03dc7bb07a71,287896680000000000 +gnosis,AccessList,0x8c2856977e4c4ef65b23f793bf622531eacb8f2da59b97c3c2d30bedc12b05eb,902121000000000 +gnosis,Legacy,0x8a88b742d5ebe246b234e1482040d3c631381790f20a4370a50c3e3e1776d365,46111000000000 +linea,DynamicFee,0x94baa792bf3f2cde20a1dec3bbb3ad67aedcfd4a8693e30b0b16e41d0d28cba4,6300000147000 +linea,AccessList,0x931af5a42b67d7b359ee32d005ff6a2f123ba2177368965dd9d4fc2db15e66af,13726729038942 +linea,Legacy,0x77d7dfbf19e6ee020a615acc797ae475e5817ea7358a3954834bca68380f0fb0,35081856000000 +mantle,126,0xaa0a8f422ae3cf2c5fca2d718f0ac8233b02c69ac93bcee1bdb3b2c74315c467,0 +mantle,DynamicFee,0xbf3d4f2d17ed1767cd683a3acffc63b3f4823d77a1a305e0fb44428c479b3691,357562228215354740 +mantle,Legacy,0x8e6da0d698459f5d2d8186781270105d5a372167fd9a81b76f719d90c8786698,49847841846406904 +mantle,AccessList,0x8b4bff275f5609fdb8f60b2c99bc8d687fb2c1655337c3c2efbc6db4e3bf4698,67260505741207262 +optimism,126,0x14a19025a374dfd2ba45d2b7114331f1c3198b8620c54fc4527cad296fab5028,0 +optimism,AccessList,0x79deda7ac9203c658abdf2ec8843c828548b6d0303421f7e5b0d34afa53005aa,32936048544021 +optimism,DynamicFee,0xb2fa9fb3e99e064f8e3b70081cc1f6ba78fe99c1b9681c587246f34ee6022753,36535947233594 +optimism,Legacy,0xdf454819ee9466264d4a9c960f2638edb39a7d55ab4c15be3e6228bc0e60ce07,172194144370912 +polygon,DynamicFee,0x3aa54859fe2ec542fe125b395687c42cd91aebbeaf36035ee336f15ab5adc5a2,8416150382411520 +polygon,AccessList,0xc208310d5d64ffe4cb748adca07bb7809c03e923cab59482b9bd558fc457da89,5000422700000000 +polygon,Legacy,0xf427d34990dbb16b0050abe597ad40596271485620e4025f938cdf924f1a588b,483640000000000 +scroll,DynamicFee,0x435e941c964cb4fdd63afc08d88b2c7faf83a4c9efe8e14ea2ff409fa8d01889,29744132794905 +scroll,AccessList,0x54bdba638eec0f64f90205484d6c3a9d4dd6c50690f77052363545124b124480,20509769211390 +scroll,Legacy,0xbd59b6b9e5efd82e9cffa0ddd08777c932f75a801f7f29bd0c5b159b5668504b,6923671524162 +scroll,126,0x594ef9e6089cd0f25d907e6fc36a405b4ae480906df96778043b226521027978,0 +zkevm,Legacy,0x6f03b3fee4115d290a6f5b5dc5296dc807ee3361413d6c76be8f926af8cbaca2,15043200000000 +zksync,Unknown,0x7675a784f14336c42b0044e5e4945d15673a09f633ebbb12d2b48d6d09f2a91b,0 +zksync,EIP-712,0xb3219cdd9d32a00a0b6528930f0320aa7446dc8860353e4157c6c82e8ac6af59,145201200000000 +zksync,254,0xe4c0ffb3ab0df41da0a69e00c414cd0ff886c5b1577757bfa009c584dc72bb87,0 +zksync,Priority,0x63ebf539e561a714d1077d202cd5eb4724f1c00080e0b752bfc1312886cef314,266980000000000 +zksync,DynamicFee,0xb9d96a292865adb0cc81fe28c4abb88bc92ae90b6066a3360f40d5cd456c258f,61248780000000 +zksync,Legacy,0xcac88fbb33cdf77bf3a4be83a0086d06f4ffdff5e04a58ceeac80077e50b9dd3,86941000000000 +zora,Legacy,0xfd5f8df99b747f27303ec22f764a847b9211a7e0f9fbcd13f18301026b28aa99,30562852863643 +zora,126,0xa694bccb978690204cc9445f8e9c2695f19f87cf1d7923ce4dd5b7122cd69d47,0 +zora,AccessList,0x8d1029a6cbb3ec0047371c17e888381f95023487743eeb6597ab65d4c8954fbc,175028874886 +zora,DynamicFee,0x92c43dbc36d7234e6cab7b3793b573d9b20a810c4403ae9e5900706a2f9e20a7,47040291290076 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml index 9df69a48fb6..f434216529b 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/_schema.yml @@ -56,6 +56,34 @@ seeds: token_address: varbinary borrower: varbinary amount: double + - name: aave_lido_ethereum_base_borrow_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + transaction_type: varchar + token_address: varbinary + borrower: varbinary + amount: double + - name: aave_etherfi_ethereum_base_borrow_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + transaction_type: varchar + token_address: varbinary + borrower: varbinary + amount: double - name: aave_fantom_base_borrow_seed config: column_types: @@ -197,6 +225,34 @@ seeds: token_address: varbinary depositor: varbinary amount: double + - name: aave_lido_ethereum_base_supply_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + transaction_type: varchar + token_address: varbinary + depositor: varbinary + amount: double + - name: aave_etherfi_ethereum_base_supply_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + transaction_type: varchar + token_address: varbinary + depositor: varbinary + amount: double - name: aave_fantom_base_supply_seed config: column_types: @@ -334,6 +390,32 @@ seeds: token_address: varbinary recipient: varbinary amount: double + - name: aave_lido_ethereum_base_flashloans_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + token_address: varbinary + recipient: varbinary + amount: double + - name: aave_etherfi_ethereum_base_flashloans_seed + config: + column_types: + blockchain: varchar + project: varchar + version: varchar + block_number: bigint + block_time: timestamp + tx_hash: varbinary + evt_index: bigint + token_address: varbinary + recipient: varbinary + amount: double - name: aave_fantom_base_flashloans_seed config: column_types: diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_borrow_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_borrow_seed.csv new file mode 100644 index 00000000000..964b6ac37ec --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_borrow_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,borrower,amount +ethereum,aave_etherfi,3,20752989,2024-09-15 02:20:35.000 UTC,0x7098f5b98b041d290f2b28afb22a0334d5274e229d4465e150be7ce4df10826a,242,borrow,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x9dbc5e35a2f1a6dc214bdb7ed7a8c706d77f0a74,1e+10 +ethereum,aave_etherfi,3,20728281,2024-09-11 15:31:35.000 UTC,0x6180393887262f626d967ba8a32a10ce8bd860a39dd1423ed2fc592d16e63aff,299,repay,0x853d955acef822db058eb8505911ed77f175b99e,0xedf1086b81f979354fc2ea07260eb83f5852eb15,-1.84e+20 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_flashloans_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_flashloans_seed.csv new file mode 100644 index 00000000000..7a805e33930 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_flashloans_seed.csv @@ -0,0 +1 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,token_address,recipient,amount diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_supply_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_supply_seed.csv new file mode 100644 index 00000000000..20e0d45a424 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_etherfi_ethereum_base_supply_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount +ethereum,aave_etherfi,3,20752986,2024-09-15 02:19:59.000 UTC,0x65e3cb2d48b81de680b62714f663e144e9ee04927f9321c810f40602b329238c,202,deposit,0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee,0x9dbc5e35a2f1a6dc214bdb7ed7a8c706d77f0a74,9.54280867878683e+18 +ethereum,aave_etherfi,3,20740462,2024-09-13 08:20:23.000 UTC,0xab48c34bc87037ef9780b365dcb25d9800a6b3a847f1148d9b3dbd4c5f92b475,152,withdraw,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x829bfb482331b9dc2becb5483eca79c0578c3a45,-1.63586567e+08 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_borrow_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_borrow_seed.csv new file mode 100644 index 00000000000..fc67b4ca44b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_borrow_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,borrower,amount +ethereum,aave_lido,3,20454208,2024-08-04 09:11:11.000 UTC,0x0bd845c9d078294327207457e91c6dc625c689c0044452953f7c630764c828d0,365,borrow,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x702b6770a81f75964ca5d479f369efb31dfa7c32,2.8808742499190137e+19 +ethereum,aave_lido,3,20452066,2024-08-04 02:01:47.000 UTC,0x81d24a63c44b347b56947ba36da82862c526390acf4474bd4fcb7702868c4a37,172,repay,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x3ee505ba316879d246a8fd2b3d7ee63b51b44fab,-2.0292e+20 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_flashloans_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_flashloans_seed.csv new file mode 100644 index 00000000000..2b159c58fc6 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_flashloans_seed.csv @@ -0,0 +1,4 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,token_address,recipient,amount +ethereum,aave_lido,3,20446968,2024-08-03 08:58:23.000 UTC,0x35bfa5ce81ad9a9bb6f9240b290d8d5027a8a627a6756acd2c43ebba14d86bfc,86,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xe695175eaed06836f22d363fa4ddd82dc1d944c9,1.4888478115921598e+21 +ethereum,aave_lido,3,20444445,2024-08-03 00:30:11.000 UTC,0x14e516091c35101aa3db12f67100b118223e2c49052950c4ae0ccd8ba5bd63cd,465,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x4afc4d809c7a7f0c2f647da3a89a54573d001703,1.3e+19 +ethereum,aave_lido,3,20443133,2024-08-02 20:05:35.000 UTC,0xf0eda867753757c6576b8a567b49cf7d21862de01c851cdc50765cadef019f3e,180,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xcfd23170c2a4fdff9b03493056d71aa275468fe8,1.8075e+22 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_supply_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_supply_seed.csv new file mode 100644 index 00000000000..520030237ca --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/aave_lido_ethereum_base_supply_seed.csv @@ -0,0 +1,3 @@ +blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount +ethereum,aave_lido,3,20454405,2024-08-04 09:50:35.000 UTC,0x42345feb96d2e4e0230b2d272f31ed186c30e0adde9e1ca1aeed5a70da56d08b,362,deposit,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x702b6770a81f75964ca5d479f369efb31dfa7c32,3.1706e+21 +ethereum,aave_lido,3,20454215,2024-08-04 09:12:35.000 UTC,0xe4924cb7355e0994d2b288acbbe08e4bdaaaad561de9060f64a08924c2493ad4,357,withdraw,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x702b6770a81f75964ca5d479f369efb31dfa7c32,-7e+18 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv index d927c6321b2..68b432d8b55 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv @@ -2,3 +2,5 @@ blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction arbitrum,compound,3,155913880,2023-12-01 17:01:46.000 UTC,0xad60d1d5798652343a17745f5804171fe8daabe543d045fc488944c9bedb99be,1,borrow,0xaf88d065e77c8cc2239327c5edb3a432268e5831,0xc01c02afe3837fa472b18ae94c6b260bbb95fdca,5e+09 arbitrum,compound,3,151564971,2023-11-18 06:47:43.000 UTC,0xa14bbb57875ac5f50acc5a7413f390f1c0c1b600529b3ea2e30436aefb020f1b,1,borrow_liquidation,0xff970a61a04b1ca14834a43f5de4533ebddb5cc8,0x2385ce1a322173a169155af8a6ec85add1b5435c,-542074 arbitrum,compound,3,155915691,2023-12-01 17:09:46.000 UTC,0x438f39f246139a561c9dedb85948845af5fd19ade16e7370a765476bf481e321,1,repay,0xaf88d065e77c8cc2239327c5edb3a432268e5831,0xfd0b5931399dfd8be58c37d74d9ffc35bbc3ffb2,-6.759786216e+09 +arbitrum,compound,3,201664829,2024-04-16 16:03:19.000 UTC,0x3949abf76b7f3c9c7aa31c6cf2ba3c37e6bef14e9df48cd672a83e44b90a9116,230,borrow,0xff970a61a04b1ca14834a43f5de4533ebddb5cc8,0xBe8C669057Ae135ae34927A082bca634E7A6681A,6.58234749e+08 +arbitrum,compound,3,91642437,2023-05-17 14:30:42.000 UTC,0xd7b8ac1ea3d65409c3cf130880501a6b2d0c4d4ba1b25cbefb8ff6b0bacc0617,13,repay,0xff970a61a04b1ca14834a43f5de4533ebddb5cc8,0xa495b086ba3365854836fc1d2e31131e8910f83f,-1.00000053e+08 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv index 3ddac64b223..44b4d87a07c 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv @@ -1,4 +1,6 @@ blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount -arbitrum,compound,3,172709313,2024-01-21 14:29:14.000 UTC,0x9906529ef68996e9d9f0be806456f67add84ecafb6a7e9fdd2ebe5bee660bb64,1,repay,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0x1a043e016094672560f4cc15fe4fa7ae3d115d92,-2.015e+18 +arbitrum,compound,3,172709313,2024-01-21 14:29:14.000 UTC,0x9906529ef68996e9d9f0be806456f67add84ecafb6a7e9fdd2ebe5bee660bb64,1,withdraw,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0x1a043e016094672560f4cc15fe4fa7ae3d115d92,-2.015e+18 arbitrum,compound,3,172708182,2024-01-21 14:24:27.000 UTC,0x1abe1d6e3f52c22ea04797f9a52d4c8fb3c1139d28333344121373b78072c06a,4,supply,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0xbde8f31d2ddda895264e27dd990fab3dc87b372d,2.015e+18 arbitrum,compound,3,168211063,2024-01-08 03:27:51.000 UTC,0x176dc21525cdbf8648798dc106ab5e2676a4095f1d0562464146094d17c1881e,14,supply_liquidation,0x912ce59144191c1204e64559fe8253a0e49e6548,0x43ea0ffc209b0776c12786280322f4b096585c66,-3.089e+21 +arbitrum,compound,3,128430636,2023-09-06 02:04:30.000 UTC,0x2148a3f67e5a79ca423b5c1c46ee937ca4828fe5af9b72704d3fa86c3d858074,2,supply,0xff970a61a04b1ca14834a43f5de4533ebddb5cc8,0xe9f17024b2c387c8907edb9c0af31a982b45836b,5.4798698798e+10 +arbitrum,compound,3,113863848,2023-07-22 05:21:23.000 UTC,0xb6d1f039379701361da2eb7d111f2cd5b10cdd7d28359aea7002aafd1de8a067,1,withdraw,0xff970a61a04b1ca14834a43f5de4533ebddb5cc8,0x5DE64f9503064344dB3202d95cEB73C420DCcD57,-7.0000501247e+10 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_borrow_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_borrow_seed.csv index 0507d8a6a76..b3cf00321cb 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_borrow_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_borrow_seed.csv @@ -2,3 +2,5 @@ blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction base,compound,3,7329718,2023-12-01 16:39:43.000 UTC,0x38529b3e34befc93578b70954430af3086c0be1164093e6398ae7834f6d7face,3,borrow,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0xc62bba8041aa606c42bd4c0d67d91de4c0ed60c5,6.4e+09 base,compound,3,2759682,2023-08-17 21:45:11.000 UTC,0x7eb2d4f9362d3f0a89bd99c1e0951addfed09d08536eea7004a70c95277b2fde,18,borrow_liquidation,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x8198cd094925b5590e61e40f07596f4ef77c0c5f,-4.47339983e+08 base,compound,3,7314826,2023-12-01 08:23:19.000 UTC,0x59fcfc4ef9c43757e8c682fcb22717facd1005ede94a5087854f497ea5567ed9,35,repay,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x92484b47fd89ee8a57e5da7277e22f68263204e2,-3.3146031e+07 +base,compound,3,12690724,2024-04-03 18:59:55.000 UTC,0x0288f33e3b932be370ade1825f44fb1edd5f5b2f972b47547f8c75b3cc6e5ce5,61,borrow,0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913,0x274251550c92b8da161fe2fdebeb872dfa18cc39,5.99999979e+09 +base,compound,3,13321566,2024-04-18 09:27:35.000 UTC,0xba2352c190b57512b53ef0290e3164f146025921aadddcfa89ff591c311990cb,143,repay,0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913,0x9b30e748b2de194fff41d827f1904260e21d2c36,-5.02651e+06 diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_supply_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_supply_seed.csv index 9d5da9d5585..2eb51d86b87 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_supply_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_base_base_supply_seed.csv @@ -1,4 +1,6 @@ blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount -base,compound,3,9528275,2024-01-21 14:04:57.000 UTC,0x57a3cb907c38a22629f18fd822d69fd84759e16a4021966b37c521d1f09690a7,1,repay,0x4200000000000000000000000000000000000006,0x0331795d74dcc54bfc2b28bb4f4b88790a864bcf,-7.699999996548115e+17 +base,compound,3,9528275,2024-01-21 14:04:57.000 UTC,0x57a3cb907c38a22629f18fd822d69fd84759e16a4021966b37c521d1f09690a7,1,withdraw,0x4200000000000000000000000000000000000006,0x0331795d74dcc54bfc2b28bb4f4b88790a864bcf,-7.699999996548115e+17 base,compound,3,9529384,2024-01-21 14:41:55.000 UTC,0x8cddf39bea60a854768f4ec08bd71c4a627e4c47f10a57260a3ca4261c93e18a,15,supply,0x4200000000000000000000000000000000000006,0x78d0677032a35c63d142a48a2037048871212a8c,2e+16 base,compound,3,8747226,2024-01-03 12:09:59.000 UTC,0xd6691d008e5526f49ea518ee6b023bc84e659dba67e5512d4830f19359afd06b,45,supply_liquidation,0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22,0x3eebcaf63b35a6525fd53ae3048e9c9ac4a9988e,-6.270000003609422e+17 +base,compound,3,12564765,2024-03-31 09:01:17.000 UTC,0xc87a7b761c645555a5651db2b0730fcaaf67cab1f02f11bb32aee31d5935bb48,57,supply,0x4200000000000000000000000000000000000006,0x78d0677032a35c63d142a48a2037048871212a8c,9.999999999999999e+15 +base,compound,3,14376459,2024-05-12 07:31:05.000 UTC,0x443452a5eeb4031205155cce62c266fae676bc0ecf0cf5df355ec0d6d34fca0d,87,withdraw,0x4200000000000000000000000000000000000006,0xb7f81ed635e31976e8b7155acdb6f651bff3d7dc,-9.9999999999999999e+17 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv index eb502b6a820..473d3b377e2 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv @@ -3,5 +3,7 @@ ethereum,compound,2,18692840,2023-12-01 16:45:35.000 UTC,0xd4ab80ab27f84c596b427 ethereum,compound,2,18552435,2023-11-12 01:03:11.000 UTC,0x5a265761135bde08ca5409472f390db15bcb26e01ecf5d49ae26599301cdf840,16,borrow_liquidation,0xe41d2489571d322189246dafa5ebde1f4699f498,0x79f74f8b96718657ab317cea3eb76e1e5e95519e,-4.3159386906570297e+21 ethereum,compound,2,18692742,2023-12-01 16:25:59.000 UTC,0xbf4b8db9ca239498d526fe4d87ca58558b4b21b20f9c3240814ffd051f443447,173,repay,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x3ab0818ba16175d5a41a4076de227c8a55ad6038,-1.09818524131e+11 ethereum,compound,3,18692801,2023-12-01 16:37:47.000 UTC,0x2ebab17cebb7af15c526843dff20bc5e2072a03485a25f52089f94b508420171,238,borrow,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xed0da42ef260bf6a739a7fb9dda720d5124298dc,8.7e+20 -ethereum,compound,3,18335703,2023-10-12 17:04:11.000 UTC,0x1d898870f27904caf0f66323063810b5806ba5d908bb40aefe5a3f96d0c1c8c7,6,borrow_liquidation,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xf04fe5c670d6b31abca534c8c29abb6e4d111c6d,-3.9110250759e+10 -ethereum,compound,3,18692715,2023-12-01 16:20:35.000 UTC,0x3222445a8b610c8e146ac61c50aaf91e95967a11920dc8e56a919e120cfa23e7,199,repay,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0x4b7ba2dc783e136a8314902efde6c32531605789,-2.077015537e+09 +ethereum,compound,3,18335703,2023-10-12 17:04:11.000 UTC,0x1d898870f27904caf0f66323063810b5806ba5d908bb40aefe5a3f96d0c1c8c7,6,borrow_liquidation,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,0xf04fe5c670d6b31abca534c8c29abb6e4d111c6d,-3.9110250759e+10 +ethereum,compound,3,18692715,2023-12-01 16:20:35.000 UTC,0x3222445a8b610c8e146ac61c50aaf91e95967a11920dc8e56a919e120cfa23e7,199,repay,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,0x4b7ba2dc783e136a8314902efde6c32531605789,-2.077015537e+09 +ethereum,compound,3,15682385,2022-10-05 14:05:47.000 UTC,0xd9d86bfc8a9ecd97b8d2126a7c9ca51dee99d3be5dcf136b3ee691e981d9d1b0,129,borrow,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x8f1027cc0145e106122aa63e9e26e7afb7ace1f4,2.40E+11 +ethereum,compound,3,15925719,2022-11-08 13:49:35.000 UTC,0xca0816525a096225a8a3207327de083595defc0307b7db373a54e4199daec0e8,89,repay,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x9521f77aa4f5f3dd5c4b2da897c13b0c3d4e9791,-3.326823856e+09 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_supply_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_supply_seed.csv index 3d468d9f01e..498f4a4c668 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_supply_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_supply_seed.csv @@ -1,4 +1,6 @@ blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount -ethereum,compound,3,19055651,2024-01-21 13:51:35.000 UTC,0xd5239052b8125401e1e009834860244a80bb7cba9f7c9b8a65f1195b4865c64d,49,repay,0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0,0xbdebfd375bcb1e0f6dfd4646cd1598f4d5888a48,-1.6332878425165565e+18 +ethereum,compound,3,19055651,2024-01-21 13:51:35.000 UTC,0xd5239052b8125401e1e009834860244a80bb7cba9f7c9b8a65f1195b4865c64d,49,withdraw,0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0,0xbdebfd375bcb1e0f6dfd4646cd1598f4d5888a48,-1.6332878425165565e+18 ethereum,compound,3,19055748,2024-01-21 14:10:59.000 UTC,0x63476acfa66e8bbd8f7dfe5f6fc1f399d05a706cb5d7d73ac9e3e02a4fa3f701,103,supply,0x2260fac5e5542a773aa44fbcfedf7c193bc2c599,0x8fb1e48d47301fe6d506192b036dd25e17aca273,2.4693093e+07 ethereum,compound,3,18993677,2024-01-12 22:04:11.000 UTC,0xdf4199bccfe30494f3d9b16e685b990befb2802dc7ba59bfd474989c13afc8a2,5,supply_liquidation,0x2260fac5e5542a773aa44fbcfedf7c193bc2c599,0xe96552458b23b31911068ea7e800a4af36d5b79d,-7.601275486e+09 +ethereum,compound,3,20294467,2024-07-13 02:00:59.000 UTC,0x674eb6f75ec03efdfd3da6060fedfd82ba6bcf2e9780a016d11b13eac2635646,100,supply,0xdac17f958d2ee523a2206206994597c13d831ec7,0x40c5df45ff0f0782bff92149efb3361070353666,2.51365922574e+11 +ethereum,compound,3,20398251,2024-07-27 01:41:47.000 UTC,0xc1a19469356facc46d063cfb57dbf2a1aaabeecafff9f664c57412fc5682ec49,379,withdraw,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,0x67ff718804fe6d183f204d6b9e5b8561d6cb8846,-3.5233333641e+10 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_borrow_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_borrow_seed.csv index fd0fe987a2a..85c2620ecd2 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_borrow_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_borrow_seed.csv @@ -2,3 +2,5 @@ blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction polygon,compound,3,50620440,2023-12-01 17:06:53.000 UTC,0xbd9c874074dd350ea28fca1e5af475264efafe36bab6775d6d92fd8b0473503d,161,borrow,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0x1424a82d2d9cb3fc2d19638ee405a0c9141479d5,1e+10 polygon,compound,3,49224163,2023-10-27 18:27:55.000 UTC,0xaf74aa5617a60f0c68a610d8621d8c0badf3681d0984874d7d99a15e2c15fb7b,193,borrow_liquidation,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0x9312b13a05b3078f32dd35089f16971f6c3190e6,-2.24209472e+08 polygon,compound,3,50613651,2023-12-01 13:03:13.000 UTC,0x7de4ac5fd97c6fd73f2c04edce6adf17fc4a9df3f2d6eb63ebc563c1e91a1034,250,repay,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0x7eb4bd83390d03192df978af5ecf9e8bfd0bfbea,-2.0066279e+07 +polygon,compound,3,40115396,2023-03-08 17:37:24.000 UTC,0xc535dd6b5243d05d673213825f43cda0befa1d624844a85d6b6092d4b42cdf96,193,borrow,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0xaba16998347105c48a87eb47367af9761fb558ba,2.999999875e+09 +polygon,compound,3,48644964,2023-10-12 22:07:07.000 UTC,0x46ee78bd161b746671d595398a8bf6bea3d8ec719a86526980ecda29c7b7c8b2,152,repay,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0xefe5fec1bf728eca069e7afa0d936572fb3922c6,-5.296855520e+09 \ No newline at end of file diff --git a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_supply_seed.csv b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_supply_seed.csv index f30b3259706..fe3d63fcf71 100644 --- a/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_supply_seed.csv +++ b/dbt_subprojects/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_supply_seed.csv @@ -1,4 +1,6 @@ blockchain,project,version,block_number,block_time,tx_hash,evt_index,transaction_type,token_address,depositor,amount -polygon,compound,3,52579884,2024-01-21 11:05:57.000 UTC,0x0aa61b30e087ba55287626e0a899f34c40b33d69caba5af30dcfd34773b33135,469,repay,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,0x64627224808e2551834d7bd4b01d71d7c1126a94,-1.146319102e+09 +polygon,compound,3,52579884,2024-01-21 11:05:57.000 UTC,0x0aa61b30e087ba55287626e0a899f34c40b33d69caba5af30dcfd34773b33135,469,withdraw,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,0x64627224808e2551834d7bd4b01d71d7c1126a94,-1.146319102e+09 polygon,compound,3,52585374,2024-01-21 14:34:53.000 UTC,0x03e28afe19926f09b91521914143768094aa9fa0da7848dceac9dea16a82dcde,304,supply,0x7ceb23fd6bc0add59e62ac25578270cff1b9f619,0xcea60a3a1d4f116b247eea113ff44d009edbaf6a,1.784261352701818e+16 polygon,compound,3,52445562,2024-01-17 22:24:28.000 UTC,0x3223d8a78094c80cf132a288a71514d3a9726f011756ba6e4bba83ba9ad9167f,76,supply_liquidation,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,0xcfdd6663018840621fa812ba6043acb5b1fa29d1,-4.550000021952141e+20 +polygon,compound,3,41854708,2023-04-23 06:32:21.000 UTC,0x063e63893603d10cd62f204ae8ce8a5dfa8df73924834d941f802287e55caef8,291,supply,0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174,0x9caa41bbdd76d907305fc86f42fbecd61d7ae1b0,1.925475e+6 +polygon,compound,3,41879627,2023-04-23 09:59:31.000 UTC,0x116fcc37b69c122f948ea0504bd73c3442095eafd48413434a0b16a027a2c4ff,104,withdraw,0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174,0x9d8019bc4d6b3c7a4f65f794a4b77329695b7097,-9.99999e+5 \ No newline at end of file diff --git a/dbt_subprojects/nft/macros/platforms/element_v1_base_trades.sql b/dbt_subprojects/nft/macros/platforms/element_v1_base_trades.sql index ec78b4ab2c1..b6bb7cc4779 100644 --- a/dbt_subprojects/nft/macros/platforms/element_v1_base_trades.sql +++ b/dbt_subprojects/nft/macros/platforms/element_v1_base_trades.sql @@ -88,7 +88,7 @@ SELECT 'secondary' AS trade_type, erc1155Token AS nft_contract_address, cast(erc1155TokenId as uint256) AS nft_token_id, - uint256 '1' AS nft_amount, + cast(erc1155FillAmount as uint256) AS nft_amount, taker AS buyer, maker AS seller, cast(erc20FillAmount AS UINT256) AS price_raw, @@ -123,7 +123,7 @@ SELECT 'secondary' AS trade_type, erc1155Token AS nft_contract_address, cast(erc1155TokenId as uint256) AS nft_token_id, - uint256 '1' AS nft_amount, + cast(erc1155FillAmount as uint256) AS nft_amount, maker AS buyer, taker AS seller, cast(erc20FillAmount AS UINT256) AS price_raw, diff --git a/dbt_subprojects/nft/macros/platforms/seaport_v3_fork_trades.sql b/dbt_subprojects/nft/macros/platforms/seaport_v3_fork_trades.sql deleted file mode 100644 index d8972e25d53..00000000000 --- a/dbt_subprojects/nft/macros/platforms/seaport_v3_fork_trades.sql +++ /dev/null @@ -1,722 +0,0 @@ -{% macro seaport_v3_fork_trades( - blockchain - ,source_transactions - ,Seaport_evt_OrderFulfilled - ,Seaport_call_matchAdvancedOrders - ,Seaport_call_matchOrders - ,fee_wallet_list_cte - ,native_token_address = '0x0000000000000000000000000000000000000000' - ,alternative_token_address = '0x0000000000000000000000000000000000000000' - ,native_token_symbol = 'ETH' - ,start_date = '2023-02-01' - ,seaport_fork_address = '0x00000000006c3852cbef3e08e8df289169ede581' - ,project = 'seaport_fork' - ,version = 'seaport' -) %} ---This macro is a copy of seaport_v3_trades with support for a different contract address - -with source_ethereum_transactions as ( - select * - from {{ source_transactions }} - {% if not is_incremental() %} - where block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - where block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} -) -,ref_tokens_nft as ( - select * - from {{ source('tokens', 'nft') }} - where blockchain = '{{ blockchain }}' -) -,ref_tokens_erc20 as ( - select * - from {{ source('tokens', 'erc20') }} - where blockchain = '{{ blockchain }}' -) -,ref_nft_aggregators as ( - select * - from {{ ref('nft_aggregators') }} - where blockchain = '{{ blockchain }}' -) -,ref_nft_aggregators_marks as ( - select * - from {{ ref('nft_ethereum_aggregators_markers') }} -) -,source_prices_usd as ( - select * - from {{ source('prices', 'usd') }} - where blockchain = '{{ blockchain }}' - {% if not is_incremental() %} - and minute >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - and minute >= date_trunc('day', now() - interval '7' day) - {% endif %} -) -,fee_wallet_list as ( - select wallet_address, wallet_name - from {{ fee_wallet_list_cte }} -) -,iv_offer_consideration as ( - select evt_block_time as block_time - ,evt_block_number as block_number - ,evt_tx_hash as tx_hash - ,evt_index - ,'offer' as sub_type - ,offer_idx as sub_idx - ,case json_extract_scalar(element_at(offer,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as offer_first_item_type - ,case json_extract_scalar(element_at(consideration,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as consideration_first_item_type - ,offerer - ,recipient - ,offerer as sender - ,recipient as receiver - ,zone - ,from_hex(json_extract_scalar(offer_item,'$.token')) as token_contract_address - ,cast(json_extract_scalar(offer_item,'$.amount') as uint256) as original_amount - ,case json_extract_scalar(offer_item,'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as item_type - ,cast(json_extract_scalar(offer_item,'$.identifier') as uint256) as token_id - ,contract_address as platform_contract_address - ,cardinality(offer) as offer_cnt - ,cardinality(consideration) as consideration_cnt - ,order_hash - ,false as is_private -- will be deprecated in base_pairs - from - ( - select consideration - , contract_address - , evt_block_number - , evt_block_time - , evt_index - , evt_tx_hash - , offer - , offerer - , recipient - , zone - , orderHash AS order_hash - , offer_idx - , offer_item - from {{ Seaport_evt_OrderFulfilled }} - cross join unnest(offer) with ordinality as foo(offer_item, offer_idx) - where contract_address = {{ seaport_fork_address }} -- seaport v1.1 - and recipient != 0x0000000000000000000000000000000000000000 - {% if not is_incremental() %} - and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - and evt_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - ) - union all - select evt_block_time as block_time - ,evt_block_number as block_number - ,evt_tx_hash as tx_hash - ,evt_index - ,'consideration' as sub_type - ,consideration_idx as sub_idx - ,case json_extract_scalar(element_at(offer,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as offer_first_item_type - ,case json_extract_scalar(element_at(consideration,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as consideration_first_item_type - ,offerer - ,recipient - ,recipient as sender - ,from_hex(json_extract_scalar(consideration_item,'$.recipient')) as receiver - ,zone - ,from_hex(json_extract_scalar(consideration_item,'$.token')) as token_contract_address - ,cast(json_extract_scalar(consideration_item,'$.amount') as uint256) as original_amount - ,case json_extract_scalar(consideration_item,'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' -- actually not exists - end as item_type - ,cast(json_extract_scalar(consideration_item,'$.identifier') as uint256) as token_id - ,contract_address as platform_contract_address - ,cardinality(offer) as offer_cnt - ,cardinality(consideration) as consideration_cnt - ,order_hash - ,false as is_private -- will be deprecated in base_pairs - from - ( - select consideration - , contract_address - , evt_block_number - , evt_block_time - , evt_index - , evt_tx_hash - , offer - , offerer - , recipient - , zone - , orderHash AS order_hash - , consideration_item - , consideration_idx - from {{ Seaport_evt_OrderFulfilled }} - cross join unnest(consideration) with ordinality as foo(consideration_item,consideration_idx) - where contract_address = {{ seaport_fork_address }} -- Seaport v1.1 - and recipient != 0x0000000000000000000000000000000000000000 - {% if not is_incremental() %} - and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - and evt_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - ) -) -,iv_match_output as ( - select block_time - ,block_number - ,tx_hash - ,evt_index - ,sub_type - ,sub_idx - ,case offer_first_item - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - when '4' then 'erc721' - when '5' then 'erc1155' - else 'etc' - end as offer_first_item_type - ,case consider_first_item - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - when '4' then 'erc721' - when '5' then 'erc1155' - else 'etc' - end as consideration_first_item_type - ,offerer - ,receiver as recipient - ,sender - ,receiver - ,zone - ,token_contract_address - ,cast(original_amount as uint256) as original_amount - ,case item_type_code - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - when '4' then 'erc721' - when '5' then 'erc1155' - else 'etc' - end as item_type - ,token_id - ,platform_contract_address - ,1 as offer_cnt - ,1 as consideration_cnt - ,NULL as order_hash - ,false as is_private - from (select call_block_time as block_time - ,call_block_number as block_number - ,call_tx_hash as tx_hash - ,dense_rank() over (partition by call_tx_hash order by call_trace_address) as evt_index - ,'match_adv_ord' as sub_type - ,execution_idx as sub_idx - ,from_hex(json_extract_scalar(json_extract_scalar(advancedOrders[1],'$.parameters'),'$.zone')) as zone - ,from_hex(json_extract_scalar(json_extract_scalar(advancedOrders[1],'$.parameters'),'$.offerer')) as offerer - ,json_extract_scalar(json_extract_scalar(json_extract_scalar(advancedOrders[1],'$.parameters'),'$.offer[0]'),'$.itemType') as offer_first_item - ,json_extract_scalar(json_extract_scalar(json_extract_scalar(advancedOrders[1],'$.parameters'),'$.consideration[0]'),'$.itemType') as consider_first_item - ,from_hex(json_extract_scalar(execution,'$.offerer')) as sender - ,from_hex(json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.token')) as token_contract_address - ,json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.amount') as original_amount - ,json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.itemType') as item_type_code - ,cast(json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.identifier') as uint256) as token_id - ,from_hex(json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.recipient')) as receiver - ,contract_address as platform_contract_address - from (select * - from {{ Seaport_call_matchAdvancedOrders }} - cross join unnest(output_executions) with ordinality as foo(execution,execution_idx) - where call_success - and contract_address = {{ seaport_fork_address }} -- Seaport v1.1 - {% if not is_incremental() %} - and call_block_time >= timestamp '{{start_date}}' -- seaport first txn - {% else %} - and call_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - ) - union all - select call_block_time as block_time - ,call_block_number as block_number - ,call_tx_hash as tx_hash - ,dense_rank() over (partition by call_tx_hash order by call_trace_address) as evt_index - ,'match_ord' as sub_type - ,execution_idx as sub_idx - ,from_hex(json_extract_scalar(json_extract_scalar(orders[1],'$.parameters'),'$.zone')) as zone - ,from_hex(json_extract_scalar(json_extract_scalar(orders[1],'$.parameters'),'$.offerer')) as offerer - ,json_extract_scalar(json_extract_scalar(json_extract_scalar(orders[1],'$.parameters'),'$.offer[0]'),'$.itemType') as offer_first_item - ,json_extract_scalar(json_extract_scalar(json_extract_scalar(orders[1],'$.parameters'),'$.consideration[0]'),'$.itemType') as consider_first_item - ,from_hex(json_extract_scalar(execution,'$.offerer')) as sender - ,from_hex(json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.token')) as token_contract_address - ,json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.amount') as original_amount - ,json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.itemType') as item_type_code - ,cast(json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.identifier') as uint256) as token_id - ,from_hex(json_extract_scalar(json_extract_scalar(execution,'$.item'),'$.recipient')) as receiver - ,contract_address as platform_contract_address - from (select * - from {{ Seaport_call_matchOrders }} - cross join unnest(output_executions) with ordinality as foo(execution,execution_idx) - where call_success - and contract_address = {{ seaport_fork_address }} -- Seaport v1.1 - {% if not is_incremental() %} - and call_block_time >= timestamp '{{start_date}}' -- seaport first txn - {% else %} - and call_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - ) - ) -) -,iv_base_pairs as ( - select a.block_time - ,a.block_number - ,a.tx_hash - ,a.evt_index - ,a.sub_type - ,a.sub_idx - ,a.offer_first_item_type - ,a.consideration_first_item_type - ,a.offerer - ,a.recipient - ,a.sender - ,a.receiver - ,a.zone - ,a.token_contract_address - ,a.original_amount - ,a.item_type - ,a.token_id - ,a.platform_contract_address - ,a.offer_cnt - ,a.consideration_cnt - ,a.order_hash - ,a.is_private - ,a.is_self_trans - ,a.is_platform_fee - ,a.eth_erc_idx - ,a.nft_cnt - ,a.erc721_cnt - ,a.erc1155_cnt - ,case when offer_first_item_type = 'erc20' then 'offer accepted' - when offer_first_item_type in ('erc721','erc1155') then 'buy' - else 'etc' -- some txns has no nfts - end as order_type - ,case when offer_first_item_type = 'erc20' and sub_type = 'offer' and item_type = 'erc20' then true - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and item_type in ('native','erc20') then true - else false - end is_price - ,case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and eth_erc_idx = 0 then true -- offer accepted has no price at all. it has to be calculated. - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and eth_erc_idx = 1 then true - else false - end is_netprice - ,case when is_platform_fee then false - when offer_first_item_type = 'erc20' and sub_type = 'consideration' and eth_erc_idx > 0 then true - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and eth_erc_idx > 1 then true - else false - end is_creator_fee - ,sum(case when is_platform_fee then null - when offer_first_item_type = 'erc20' and sub_type = 'consideration' and eth_erc_idx > 0 then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and eth_erc_idx > 1 then 1 - end) over (partition by tx_hash, evt_index order by eth_erc_idx) as creator_fee_idx - ,case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc721','erc1155') then true - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc721','erc1155') then true - else false - end is_traded_nft - ,case when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and item_type in ('erc721','erc1155') then true - else false - end is_moved_nft - ,fee_wallet_name - from (select a.block_time - ,a.block_number - ,a.tx_hash - ,a.evt_index - ,a.sub_type - ,a.sub_idx - ,a.offer_first_item_type - ,a.consideration_first_item_type - ,a.offerer - ,a.recipient - ,a.sender - ,a.receiver - ,a.zone - ,a.token_contract_address - ,a.original_amount - ,a.item_type - ,a.token_id - ,a.platform_contract_address - ,a.offer_cnt - ,a.consideration_cnt - ,a.order_hash - ,a.is_private - ,f.wallet_name as fee_wallet_name - ,case when sender = receiver then true else false end is_self_trans - ,case when f.wallet_address is not null then true else false end as is_platform_fee - ,case when item_type in ('native','erc20') - then sum(case when item_type in ('native','erc20') then 1 end) over (partition by tx_hash, evt_index, sub_type order by sub_idx) - end as eth_erc_idx - ,sum(case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc721','erc1155') then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc721','erc1155') then 1 - end) over (partition by tx_hash, evt_index) as nft_cnt - ,sum(case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc721') then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc721') then 1 - end) over (partition by tx_hash, evt_index) as erc721_cnt - ,sum(case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc1155') then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc1155') then 1 - end) over (partition by tx_hash, evt_index) as erc1155_cnt - from iv_offer_consideration a - left join fee_wallet_list f on f.wallet_address = a.receiver - ) a - where not is_self_trans - -- match orders - union all - select a.block_time - ,a.block_number - ,a.tx_hash - ,a.evt_index - ,a.sub_type - ,a.sub_idx - ,a.offer_first_item_type - ,a.consideration_first_item_type - ,a.offerer - ,a.recipient - ,a.sender - ,a.receiver - ,a.zone - ,a.token_contract_address - ,a.original_amount - ,a.item_type - ,a.token_id - ,a.platform_contract_address - ,a.offer_cnt - ,a.consideration_cnt - ,a.order_hash - ,a.is_private - ,a.is_self_trans - ,a.is_platform_fee - ,a.eth_erc_idx - ,a.nft_cnt - ,a.erc721_cnt - ,a.erc1155_cnt - ,case when offer_first_item_type in ('erc20','native') then 'offer accepted' - when offer_first_item_type in ('erc721','erc1155') then 'buy' - else 'etc' -- some txns has no nfts - end as order_type - ,case when item_type in ('native','erc20') then true - else false - end is_price - ,false as is_netprice -- it has to be calculated. - ,case when is_platform_fee then false -- to os fee wallet has to be excluded - when offer_first_item_type in ('erc721','erc1155') and eth_erc_idx = 1 then false -- buy = first transfer is is profit - when offer_first_item_type in ('erc20','native') and eth_erc_idx = eth_erc_cnt then false -- offer_accepted = last transfer is is profit - when eth_erc_idx > 0 then true -- else is all creator fees - else false - end is_creator_fee - ,sum(case when is_platform_fee then null -- to os fee wallet has to be excluded - when offer_first_item_type in ('erc721','erc1155') and eth_erc_idx = 1 then null -- buy = first transfer is is profit - when offer_first_item_type in ('erc20','native') and eth_erc_idx = eth_erc_cnt then null -- offer_accepted = last transfer is is profit - when eth_erc_idx > 0 then 1 -- else is all creator fees - end) over (partition by tx_hash, evt_index order by eth_erc_idx) as creator_fee_idx - ,case when item_type in ('erc721','erc1155') then true - else false - end is_traded_nft - ,false as is_moved_nft - ,fee_wallet_name - from (select a.block_time - ,a.block_number - ,a.tx_hash - ,a.evt_index - ,a.sub_type - ,a.sub_idx - ,a.offer_first_item_type - ,a.consideration_first_item_type - ,a.offerer - ,a.recipient - ,a.sender - ,a.receiver - ,a.zone - ,a.token_contract_address - ,a.original_amount - ,a.item_type - ,a.token_id - ,a.platform_contract_address - ,a.offer_cnt - ,a.consideration_cnt - ,a.order_hash - ,a.is_private - ,f.wallet_name as fee_wallet_name - ,case when sender = receiver then true else false end is_self_trans - ,case when f.wallet_address is not null then true else false end as is_platform_fee - ,case when item_type in ('native','erc20') - then sum(case when item_type in ('native','erc20') then 1 end) over (partition by tx_hash, evt_index, sub_type order by sub_idx) - end as eth_erc_idx - ,sum(case when item_type in ('erc721','erc1155') then 1 end) over (partition by tx_hash, evt_index) as nft_cnt - ,sum(case when item_type in ('erc721') then 1 end) over (partition by tx_hash, evt_index) as erc721_cnt - ,sum(case when item_type in ('erc1155') then 1 end) over (partition by tx_hash, evt_index) as erc1155_cnt - ,sum(case when item_type in ('native','erc20') then 1 end) over (partition by tx_hash, evt_index) as eth_erc_cnt - from iv_match_output a - left join fee_wallet_list f on f.wallet_address = a.receiver - ) a - where not is_self_trans -) -,iv_volume as ( - select block_time - ,tx_hash - ,evt_index - ,max(token_contract_address) as token_contract_address - ,CAST(sum(case when is_price then original_amount end) AS DOUBLE) as price_amount_raw - ,sum(case when is_platform_fee then original_amount end) as platform_fee_amount_raw - ,max(case when is_platform_fee then receiver end) as platform_fee_receiver - ,sum(case when is_creator_fee then original_amount end) as creator_fee_amount_raw - ,sum(case when is_creator_fee and creator_fee_idx = 1 then original_amount end) as creator_fee_amount_raw_1 - ,sum(case when is_creator_fee and creator_fee_idx = 2 then original_amount end) as creator_fee_amount_raw_2 - ,sum(case when is_creator_fee and creator_fee_idx = 3 then original_amount end) as creator_fee_amount_raw_3 - ,sum(case when is_creator_fee and creator_fee_idx = 4 then original_amount end) as creator_fee_amount_raw_4 - ,sum(case when is_creator_fee and creator_fee_idx = 5 then original_amount end) as creator_fee_amount_raw_5 - ,max(case when is_creator_fee and creator_fee_idx = 1 then receiver end) as creator_fee_receiver_1 - ,max(case when is_creator_fee and creator_fee_idx = 2 then receiver end) as creator_fee_receiver_2 - ,max(case when is_creator_fee and creator_fee_idx = 3 then receiver end) as creator_fee_receiver_3 - ,max(case when is_creator_fee and creator_fee_idx = 4 then receiver end) as creator_fee_receiver_4 - ,max(case when is_creator_fee and creator_fee_idx = 5 then receiver end) as creator_fee_receiver_5 - ,max(a.fee_wallet_name) as fee_wallet_name - - from iv_base_pairs a - where 1=1 - and eth_erc_idx > 0 - group by 1,2,3 - having count(distinct token_contract_address) = 1 -- some private sale trade has more that one currencies -) -,iv_nfts as ( - select a.block_time - ,a.tx_hash - ,a.evt_index - ,a.block_number - ,a.sender as seller - ,a.receiver as buyer - ,case when nft_cnt > 1 then 'bundle trade' - else 'single item trade' - end as trade_type - ,a.order_type - ,a.token_contract_address as nft_contract_address - ,a.original_amount as nft_token_amount - ,a.token_id as nft_token_id - ,a.item_type as nft_token_standard - ,a.zone - ,a.platform_contract_address - ,b.token_contract_address - ,CAST(round(price_amount_raw / nft_cnt) as uint256) as price_amount_raw -- to truncate the odd number of decimal places - ,cast(platform_fee_amount_raw / nft_cnt as uint256) as platform_fee_amount_raw - ,platform_fee_receiver - ,cast(creator_fee_amount_raw / nft_cnt as uint256) as creator_fee_amount_raw - ,creator_fee_amount_raw_1 / nft_cnt as creator_fee_amount_raw_1 - ,creator_fee_amount_raw_2 / nft_cnt as creator_fee_amount_raw_2 - ,creator_fee_amount_raw_3 / nft_cnt as creator_fee_amount_raw_3 - ,creator_fee_amount_raw_4 / nft_cnt as creator_fee_amount_raw_4 - ,creator_fee_amount_raw_5 / nft_cnt as creator_fee_amount_raw_5 - ,creator_fee_receiver_1 - ,creator_fee_receiver_2 - ,creator_fee_receiver_3 - ,creator_fee_receiver_4 - ,creator_fee_receiver_5 - ,case when nft_cnt > 1 then true - else false - end as estimated_price - ,is_private - ,sub_type - ,sub_idx - ,order_hash - ,b.fee_wallet_name - from iv_base_pairs a - left join iv_volume b on b.block_time = a.block_time -- tx_hash and evt_index is PK, but for performance, block_time is included - and b.tx_hash = a.tx_hash - and b.evt_index = a.evt_index - where 1=1 - and a.is_traded_nft -) -,iv_trades as ( - select a.block_time - ,a.tx_hash - ,a.evt_index - ,a.block_number - ,a.seller - ,a.buyer - ,a.trade_type - ,a.order_type - ,a.nft_contract_address - ,a.nft_token_amount - ,a.nft_token_id - ,a.nft_token_standard - ,a.zone - ,a.platform_contract_address - ,a.token_contract_address - ,a.price_amount_raw - ,a.platform_fee_amount_raw - ,a.platform_fee_receiver - ,a.creator_fee_amount_raw - ,a.creator_fee_amount_raw_1 - ,a.creator_fee_amount_raw_2 - ,a.creator_fee_amount_raw_3 - ,a.creator_fee_amount_raw_4 - ,a.creator_fee_amount_raw_5 - ,a.creator_fee_receiver_1 - ,a.creator_fee_receiver_2 - ,a.creator_fee_receiver_3 - ,a.creator_fee_receiver_4 - ,a.creator_fee_receiver_5 - ,a.estimated_price - ,a.is_private - ,a.sub_type - ,a.sub_idx - ,n.name AS nft_token_name - ,t."from" as tx_from - ,t.to as tx_to - ,bytearray_reverse(bytearray_substring(bytearray_reverse(t.data),1,4)) as right_hash - ,case when a.token_contract_address = {{native_token_address}} then '{{native_token_symbol}}' - else e.symbol - end as token_symbol - ,case when a.token_contract_address = {{native_token_address}} then {{alternative_token_address}} - else a.token_contract_address - end as token_alternative_symbol - ,e.decimals as price_token_decimals - ,a.price_amount_raw / power(10, e.decimals) as price_amount - ,a.price_amount_raw / power(10, e.decimals) * p.price as price_amount_usd - ,a.platform_fee_amount_raw / power(10, e.decimals) as platform_fee_amount - ,a.platform_fee_amount_raw / power(10, e.decimals) * p.price as platform_fee_amount_usd - ,a.creator_fee_amount_raw / power(10, e.decimals) as creator_fee_amount - ,a.creator_fee_amount_raw / power(10, e.decimals) * p.price as creator_fee_amount_usd - ,coalesce(agg_m.aggregator_name, agg.name) as aggregator_name - ,agg.contract_address AS aggregator_address - ,a.fee_wallet_name - from iv_nfts a - inner join source_ethereum_transactions t on t.hash = a.tx_hash - left join ref_tokens_nft n on n.contract_address = nft_contract_address - left join ref_tokens_erc20 e on e.contract_address = case when a.token_contract_address = {{native_token_address}} then {{alternative_token_address}} - else a.token_contract_address - end - left join source_prices_usd p on p.contract_address = case when a.token_contract_address = {{native_token_address}} then {{alternative_token_address}} - else a.token_contract_address - end - and p.minute = date_trunc('minute', a.block_time) - left join ref_nft_aggregators agg on agg.contract_address = t.to - left join ref_nft_aggregators_marks agg_m on bytearray_starts_with(bytearray_reverse(t.data), bytearray_reverse(agg_m.hash_marker)) -) - -- Rename column to align other *.trades tables - -- But the columns ordering is according to convenience. - -- initcap the code value if needed -select - -- basic info - '{{blockchain}}' as blockchain - ,'{{project}}' as project - ,'{{version}}' as version - - -- order info - ,block_time - ,seller - ,buyer - ,trade_type - ,order_type as trade_category -- Buy / Offer Accepted - ,'Trade' as evt_type - - -- nft token info - ,nft_contract_address - ,nft_token_name as collection - ,nft_token_id as token_id - ,nft_token_amount as number_of_items - ,nft_token_standard as token_standard - - -- price info - ,price_amount as amount_original - ,price_amount_raw as amount_raw - ,price_amount_usd as amount_usd - ,token_symbol as currency_symbol - ,token_alternative_symbol as currency_contract - ,token_contract_address as original_currency_contract - ,price_token_decimals as currency_decimals -- in case calculating royalty1~4 - - -- project info (platform or exchange) - ,platform_contract_address as project_contract_address - ,platform_fee_receiver as platform_fee_receive_address - ,platform_fee_amount_raw - ,platform_fee_amount - ,platform_fee_amount_usd - - -- royalty info - ,creator_fee_receiver_1 as royalty_fee_receive_address - ,creator_fee_amount_raw as royalty_fee_amount_raw - ,creator_fee_amount as royalty_fee_amount - ,creator_fee_amount_usd as royalty_fee_amount_usd - ,creator_fee_receiver_1 as royalty_fee_receive_address_1 - ,creator_fee_receiver_2 as royalty_fee_receive_address_2 - ,creator_fee_receiver_3 as royalty_fee_receive_address_3 - ,creator_fee_receiver_4 as royalty_fee_receive_address_4 - ,creator_fee_receiver_5 as royalty_fee_receive_address_5 - ,creator_fee_amount_raw_1 as royalty_fee_amount_raw_1 - ,creator_fee_amount_raw_2 as royalty_fee_amount_raw_2 - ,creator_fee_amount_raw_3 as royalty_fee_amount_raw_3 - ,creator_fee_amount_raw_4 as royalty_fee_amount_raw_4 - ,creator_fee_amount_raw_5 as royalty_fee_amount_raw_5 - - -- aggregator - ,aggregator_name - ,aggregator_address - - -- tx - ,block_number - ,tx_hash - ,evt_index - ,tx_from - ,tx_to - ,right_hash - - -- seaport etc - ,zone as zone_address - ,estimated_price - ,is_private - ,sub_idx - ,sub_type - ,fee_wallet_name - ,token_symbol as royalty_fee_currency_symbol - ,case when price_amount_raw > uint256 '0' then CAST ((platform_fee_amount_raw / price_amount_raw * 100) AS DOUBLE) end platform_fee_percentage - ,case when price_amount_raw > uint256 '0' then CAST((creator_fee_amount_raw/ price_amount_raw * 100) AS DOUBLE) end royalty_fee_percentage - ,'seaport-' || CAST(tx_hash AS varchar) || '-' || cast(evt_index as varchar) || '-' || CAST(nft_contract_address AS varchar) || '-' || cast(nft_token_id as varchar) || '-' || cast(sub_type as varchar) || '-' || cast(sub_idx as varchar) as unique_trade_id - from iv_trades --- where ( zone in (0xf397619df7bfd4d1657ea9bdd9df7ff888731a11 --- ,0x9b814233894cd227f561b78cc65891aa55c62ad2 --- ,0x004c00500000ad104d7dbd00e3ae0a5c00560c00 --- ,0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd --- ,0x000000e7ec00e7b300774b00001314b8610022b8 -- newly added on seaport v1.4 --- ) --- or fee_wallet_name = 'opensea' --- ) -{% endmacro %} diff --git a/dbt_subprojects/nft/macros/platforms/seaport_v3_trades.sql b/dbt_subprojects/nft/macros/platforms/seaport_v3_trades.sql index 3e6b39bec4d..3fa8395480f 100644 --- a/dbt_subprojects/nft/macros/platforms/seaport_v3_trades.sql +++ b/dbt_subprojects/nft/macros/platforms/seaport_v3_trades.sql @@ -7,6 +7,9 @@ ,fee_wallet_list_cte ,start_date = '2023-02-01' ,native_currency_contract = '0x0000000000000000000000000000000000000000' + ,seaport_fork_address = '0x00000000006c3852cbef3e08e8df289169ede581' + ,project = 'opensea' + ,version = 'v3' ) %} with source_ethereum_transactions as ( @@ -81,7 +84,7 @@ with source_ethereum_transactions as ( , offer_item from {{ Seaport_evt_OrderFulfilled }} cross join unnest(offer) with ordinality as foo(offer_item, offer_idx) - where contract_address = 0x00000000006c3852cbef3e08e8df289169ede581 -- seaport v1.1 + where contract_address = {{ seaport_fork_address }} -- seaport v1.1 and recipient != 0x0000000000000000000000000000000000000000 {% if not is_incremental() %} and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn @@ -148,7 +151,7 @@ with source_ethereum_transactions as ( , consideration_idx from {{ Seaport_evt_OrderFulfilled }} cross join unnest(consideration) with ordinality as foo(consideration_item,consideration_idx) - where contract_address = 0x00000000006c3852cbef3e08e8df289169ede581 -- Seaport v1.1 + where contract_address = {{ seaport_fork_address }} -- Seaport v1.1 and recipient != 0x0000000000000000000000000000000000000000 {% if not is_incremental() %} and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn @@ -226,7 +229,7 @@ with source_ethereum_transactions as ( from {{ Seaport_call_matchAdvancedOrders }} cross join unnest(output_executions) with ordinality as foo(execution,execution_idx) where call_success - and contract_address = 0x00000000006c3852cbef3e08e8df289169ede581 -- Seaport v1.1 + and contract_address = {{ seaport_fork_address }} -- Seaport v1.1 {% if not is_incremental() %} and call_block_time >= timestamp '{{start_date}}' -- seaport first txn {% else %} @@ -255,7 +258,7 @@ with source_ethereum_transactions as ( from {{ Seaport_call_matchOrders }} cross join unnest(output_executions) with ordinality as foo(execution,execution_idx) where call_success - and contract_address = 0x00000000006c3852cbef3e08e8df289169ede581 -- Seaport v1.1 + and contract_address = {{ seaport_fork_address }} -- Seaport v1.1 {% if not is_incremental() %} and call_block_time >= timestamp '{{start_date}}' -- seaport first txn {% else %} @@ -576,8 +579,8 @@ with source_ethereum_transactions as ( select -- basic info '{{blockchain}}' as blockchain - ,'opensea' as project - ,'v3' as project_version + ,'{{project}}' as project + ,'{{version}}' as project_version -- order info ,block_time diff --git a/dbt_subprojects/nft/macros/platforms/seaport_v4_fork_trades.sql b/dbt_subprojects/nft/macros/platforms/seaport_v4_fork_trades.sql deleted file mode 100644 index b8f3db423a3..00000000000 --- a/dbt_subprojects/nft/macros/platforms/seaport_v4_fork_trades.sql +++ /dev/null @@ -1,575 +0,0 @@ -{# /* - 0x00000000000001ad428e4906ae43d8f9852d0dd6 Seaport v1.4 - 0x00000000000000adc04c56bf30ac9d3c0aaf14dc Seaport v1.5 - */ #} -{% macro seaport_v4_fork_trades( - blockchain - ,source_transactions - ,Seaport_evt_OrderFulfilled - ,Seaport_evt_OrdersMatched - ,fee_wallet_list_cte - ,native_token_address = '0x0000000000000000000000000000000000000000' - ,alternative_token_address = '0x0000000000000000000000000000000000000000' - ,native_token_symbol = 'ETH' - ,start_date = '2023-02-01' - ,Seaport_order_contracts = [ - '0x00000000000001ad428e4906ae43d8f9852d0dd6' - ,'0x00000000000000adc04c56bf30ac9d3c0aaf14dc' - ,'0x0000000000000068F116a894984e2DB1123eB395' - ] - ,project = 'seaport_fork' - ,version = 'seaport' -) %} - -with source_ethereum_transactions as ( - select * - from {{ source_transactions }} - {% if not is_incremental() %} - where block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - where block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} -) -,ref_tokens_nft as ( - select * - from {{ source('tokens', 'nft') }} - where blockchain = '{{ blockchain }}' -) -,ref_tokens_erc20 as ( - select * - from {{ source('tokens', 'erc20') }} - where blockchain = '{{ blockchain }}' -) -,ref_nft_aggregators as ( - select * - from {{ ref('nft_aggregators') }} - where blockchain = '{{ blockchain }}' -) -,ref_nft_aggregators_marks as ( - select * - from {{ ref('nft_ethereum_aggregators_markers') }} -) -,source_prices_usd as ( - select * - from {{ source('prices', 'usd') }} - where blockchain = '{{ blockchain }}' - {% if not is_incremental() %} - and minute >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - and minute >= date_trunc('day', now() - interval '7' day) - {% endif %} -) -,iv_orders_matched AS ( - select om_block_time - , om_tx_hash - , om_evt_index - , om_order_hash - , min(om_order_id) as om_order_id - from( - select evt_block_time as om_block_time - ,evt_tx_hash as om_tx_hash - ,evt_index as om_evt_index - ,om_order_id - ,om_order_hash - from {{ Seaport_evt_OrdersMatched }} - cross join unnest(orderhashes) with ordinality as foo(om_order_hash,om_order_id) - where 1=1 - {% if Seaport_order_contracts %} - and contract_address in ({% for order_contract in Seaport_order_contracts %} - {{order_contract}}{%- if not loop.last -%},{%- endif -%} - {% endfor %}) - {% endif %} - ) group by 1,2,3,4 -- deduplicate order hash re-use in advanced matching -) -,fee_wallet_list as ( - select wallet_address, wallet_name - from {{ fee_wallet_list_cte }} -) -,iv_offer_consideration as ( - select evt_block_time as block_time - ,evt_block_number as block_number - ,evt_tx_hash as tx_hash - ,evt_index - ,'offer' as sub_type - ,offer_idx as sub_idx - ,case json_extract_scalar(element_at(offer,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as offer_first_item_type - ,case json_extract_scalar(element_at(consideration,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as consideration_first_item_type - ,offerer - ,recipient - ,offerer as sender - ,recipient as receiver - ,zone - ,from_hex(json_extract_scalar(offer_item,'$.token')) as token_contract_address - ,cast(json_extract_scalar(offer_item,'$.amount') as uint256) as original_amount - ,case json_extract_scalar(offer_item,'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as item_type - ,cast(json_extract_scalar(offer_item,'$.identifier') as uint256) as token_id - ,contract_address as platform_contract_address - ,cardinality(offer) as offer_cnt - ,cardinality(consideration) as consideration_cnt - ,order_hash - ,false as is_private -- will be deprecated in base_pairs - from - ( - select consideration - , contract_address - , evt_block_number - , evt_block_time - , evt_index - , evt_tx_hash - , offer - , offerer - , recipient - , zone - , orderHash AS order_hash - , offer_idx - , offer_item - from {{ Seaport_evt_OrderFulfilled }} - cross join unnest(offer) with ordinality as foo(offer_item, offer_idx) - where 1=1 - {% if Seaport_order_contracts %} - and contract_address in ({% for order_contract in Seaport_order_contracts %} - {{order_contract}}{%- if not loop.last -%},{%- endif -%} - {% endfor %}) - {% endif %} - {% if not is_incremental() %} - and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - and evt_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - ) - union all - select evt_block_time as block_time - ,evt_block_number as block_number - ,evt_tx_hash as tx_hash - ,evt_index - ,'consideration' as sub_type - ,consideration_idx as sub_idx - ,case json_extract_scalar(element_at(offer,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as offer_first_item_type - ,case json_extract_scalar(element_at(consideration,1),'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' - end as consideration_first_item_type - ,offerer - ,recipient - ,recipient as sender - ,from_hex(json_extract_scalar(consideration_item,'$.recipient')) as receiver - ,zone - ,from_hex(json_extract_scalar(consideration_item,'$.token')) as token_contract_address - ,cast(json_extract_scalar(consideration_item,'$.amount') as uint256) as original_amount - ,case json_extract_scalar(consideration_item,'$.itemType') - when '0' then 'native' - when '1' then 'erc20' - when '2' then 'erc721' - when '3' then 'erc1155' - else 'etc' -- actually not exists - end as item_type - ,cast(json_extract_scalar(consideration_item,'$.identifier') as uint256) as token_id - ,contract_address as platform_contract_address - ,cardinality(offer) as offer_cnt - ,cardinality(consideration) as consideration_cnt - ,order_hash - ,false as is_private -- will be deprecated in base_pairs - from - ( - select consideration - , contract_address - , evt_block_number - , evt_block_time - , evt_index - , evt_tx_hash - , offer - , offerer - , recipient - , zone - , orderHash AS order_hash - , consideration_item - , consideration_idx - from {{ Seaport_evt_OrderFulfilled }} - cross join unnest(consideration) with ordinality as foo(consideration_item,consideration_idx) - where 1=1 - {% if Seaport_order_contracts %} - and contract_address in ({% for order_contract in Seaport_order_contracts %} - {{order_contract}}{%- if not loop.last -%},{%- endif -%} - {% endfor %}) - {% endif %} - {% if not is_incremental() %} - and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn - {% endif %} - {% if is_incremental() %} - and evt_block_time >= date_trunc('day', now() - interval '7' day) - {% endif %} - ) -) - -,iv_base_pairs as ( - select a.block_time - ,a.block_number - ,a.tx_hash - ,coalesce(a.om_evt_index, a.evt_index) as evt_index -- when order_matched exists, then replace evt_index to its - ,a.sub_type - ,a.sub_idx - ,a.offer_first_item_type - ,a.consideration_first_item_type - ,a.offerer - ,a.recipient - ,a.sender - ,a.receiver - ,a.zone - ,a.token_contract_address - ,a.original_amount - ,a.item_type - ,a.token_id - ,a.platform_contract_address - ,a.offer_cnt - ,a.consideration_cnt - ,a.order_hash - ,a.is_private - ,a.om_evt_index - ,a.om_order_id - ,a.is_self_trans - ,a.is_platform_fee - ,a.eth_erc_idx - ,a.nft_cnt - ,a.erc721_cnt - ,a.erc1155_cnt - ,case when offer_first_item_type = 'erc20' then 'offer accepted' - when offer_first_item_type in ('erc721','erc1155') then 'buy' - else 'etc' -- some txns has no nfts - end as order_type - ,case when om_order_id % 2 = 0 then false - when offer_first_item_type = 'erc20' and sub_type = 'offer' and item_type = 'erc20' then true - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and item_type in ('native','erc20') then true - else false - end is_price - ,case when om_order_id % 2 = 0 then false - when offer_first_item_type = 'erc20' and sub_type = 'consideration' and eth_erc_idx = 0 then true -- offer accepted has no price at all. it has to be calculated. - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and eth_erc_idx = 1 then true - else false - end is_netprice - ,case when is_platform_fee then false - when offer_first_item_type = 'erc20' and sub_type = 'consideration' and eth_erc_idx > 0 then true - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and eth_erc_idx > 1 then true - when om_order_id % 2 = 0 and item_type = 'erc20' then true -- hard code for order-matched joined additional creator fee, condition : 2nd order + erc20 - else false - end is_creator_fee - ,sum(case when is_platform_fee then null - when offer_first_item_type = 'erc20' and sub_type = 'consideration' and eth_erc_idx > 0 then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and eth_erc_idx > 1 then 1 - when om_order_id % 2 = 0 and item_type = 'erc20' then 1 - end) over (partition by tx_hash, coalesce(om_evt_index, evt_index) order by evt_index, eth_erc_idx) as creator_fee_idx - ,case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc721','erc1155') then true - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc721','erc1155') then true - else false - end is_traded_nft - ,case when offer_first_item_type in ('erc721','erc1155') and sub_type = 'consideration' and item_type in ('erc721','erc1155') then true - else false - end is_moved_nft - ,fee_wallet_name - from (select a.block_time - ,a.block_number - ,a.tx_hash - ,a.evt_index - ,a.sub_type - ,a.sub_idx - ,a.offer_first_item_type - ,a.consideration_first_item_type - ,a.offerer - ,a.recipient - ,a.sender - ,a.receiver - ,a.zone - ,a.token_contract_address - ,a.original_amount - ,a.item_type - ,a.token_id - ,a.platform_contract_address - ,a.offer_cnt - ,a.consideration_cnt - ,a.order_hash - ,a.is_private - ,b.om_evt_index - ,b.om_order_id - ,f.wallet_name as fee_wallet_name - ,case when sender = receiver then true else false end is_self_trans - ,case when f.wallet_address is not null then true else false end as is_platform_fee - ,case when item_type in ('native','erc20') - then sum(case when item_type in ('native','erc20') then 1 end) over (partition by tx_hash, evt_index, sub_type order by sub_idx) - end as eth_erc_idx - ,sum(case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc721','erc1155') then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc721','erc1155') then 1 - end) over (partition by tx_hash, evt_index) as nft_cnt - ,sum(case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc721') then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc721') then 1 - end) over (partition by tx_hash, evt_index) as erc721_cnt - ,sum(case when offer_first_item_type = 'erc20' and sub_type = 'consideration' and item_type in ('erc1155') then 1 - when offer_first_item_type in ('erc721','erc1155') and sub_type = 'offer' and item_type in ('erc1155') then 1 - end) over (partition by tx_hash, evt_index) as erc1155_cnt - from iv_offer_consideration a - left join fee_wallet_list f on f.wallet_address = a.receiver - left join iv_orders_matched b on b.om_tx_hash = a.tx_hash - and b.om_order_hash = a.order_hash - ) a - where not is_self_trans -) -,iv_volume as ( - select block_time - ,tx_hash - ,evt_index - ,max(token_contract_address) as token_contract_address - ,CAST(sum(case when is_price then original_amount end) AS DOUBLE) as price_amount_raw - ,sum(case when is_platform_fee then original_amount end) as platform_fee_amount_raw - ,max(case when is_platform_fee then receiver end) as platform_fee_receiver - ,sum(case when is_creator_fee then original_amount end) as creator_fee_amount_raw - ,sum(case when is_creator_fee and creator_fee_idx = 1 then original_amount end) as creator_fee_amount_raw_1 - ,sum(case when is_creator_fee and creator_fee_idx = 2 then original_amount end) as creator_fee_amount_raw_2 - ,sum(case when is_creator_fee and creator_fee_idx = 3 then original_amount end) as creator_fee_amount_raw_3 - ,sum(case when is_creator_fee and creator_fee_idx = 4 then original_amount end) as creator_fee_amount_raw_4 - ,sum(case when is_creator_fee and creator_fee_idx = 5 then original_amount end) as creator_fee_amount_raw_5 - ,max(case when is_creator_fee and creator_fee_idx = 1 then receiver end) as creator_fee_receiver_1 - ,max(case when is_creator_fee and creator_fee_idx = 2 then receiver end) as creator_fee_receiver_2 - ,max(case when is_creator_fee and creator_fee_idx = 3 then receiver end) as creator_fee_receiver_3 - ,max(case when is_creator_fee and creator_fee_idx = 4 then receiver end) as creator_fee_receiver_4 - ,max(case when is_creator_fee and creator_fee_idx = 5 then receiver end) as creator_fee_receiver_5 - ,max(a.fee_wallet_name) as fee_wallet_name - - from iv_base_pairs a - where 1=1 - and eth_erc_idx > 0 - group by 1,2,3 - having count(distinct token_contract_address) = 1 -- some private sale trade has more that one currencies -) -,iv_nfts as ( - select a.block_time - ,a.tx_hash - ,a.evt_index - ,a.block_number - ,a.sender as seller - ,a.receiver as buyer - ,case when nft_cnt > 1 then 'bundle trade' - else 'single item trade' - end as trade_type - ,a.order_type - ,a.token_contract_address as nft_contract_address - ,a.original_amount as nft_token_amount - ,a.token_id as nft_token_id - ,a.item_type as nft_token_standard - ,a.zone - ,a.platform_contract_address - ,b.token_contract_address - ,CAST(round(price_amount_raw / nft_cnt) as uint256) as price_amount_raw -- to truncate the odd number of decimal places - ,cast(platform_fee_amount_raw / nft_cnt as uint256) as platform_fee_amount_raw - ,platform_fee_receiver - ,cast(creator_fee_amount_raw / nft_cnt as uint256) as creator_fee_amount_raw - ,creator_fee_amount_raw_1 / nft_cnt as creator_fee_amount_raw_1 - ,creator_fee_amount_raw_2 / nft_cnt as creator_fee_amount_raw_2 - ,creator_fee_amount_raw_3 / nft_cnt as creator_fee_amount_raw_3 - ,creator_fee_amount_raw_4 / nft_cnt as creator_fee_amount_raw_4 - ,creator_fee_amount_raw_5 / nft_cnt as creator_fee_amount_raw_5 - ,creator_fee_receiver_1 - ,creator_fee_receiver_2 - ,creator_fee_receiver_3 - ,creator_fee_receiver_4 - ,creator_fee_receiver_5 - ,case when nft_cnt > 1 then true - else false - end as estimated_price - ,is_private - ,sub_type - ,sub_idx - ,order_hash - ,b.fee_wallet_name - from iv_base_pairs a - left join iv_volume b on b.block_time = a.block_time -- tx_hash and evt_index is PK, but for performance, block_time is included - and b.tx_hash = a.tx_hash - and b.evt_index = a.evt_index - where 1=1 - and a.is_traded_nft -) -,iv_trades as ( - select a.block_time - ,a.tx_hash - ,a.evt_index - ,a.block_number - ,a.seller - ,a.buyer - ,a.trade_type - ,a.order_type - ,a.nft_contract_address - ,a.nft_token_amount - ,a.nft_token_id - ,a.nft_token_standard - ,a.zone - ,a.platform_contract_address - ,a.token_contract_address - ,a.price_amount_raw - ,a.platform_fee_amount_raw - ,a.platform_fee_receiver - ,a.creator_fee_amount_raw - ,a.creator_fee_amount_raw_1 - ,a.creator_fee_amount_raw_2 - ,a.creator_fee_amount_raw_3 - ,a.creator_fee_amount_raw_4 - ,a.creator_fee_amount_raw_5 - ,a.creator_fee_receiver_1 - ,a.creator_fee_receiver_2 - ,a.creator_fee_receiver_3 - ,a.creator_fee_receiver_4 - ,a.creator_fee_receiver_5 - ,a.estimated_price - ,a.is_private - ,a.sub_type - ,a.sub_idx - ,n.name AS nft_token_name - ,t."from" as tx_from - ,t.to as tx_to - ,bytearray_reverse(bytearray_substring(bytearray_reverse(t.data),1,4)) as right_hash - ,case when a.token_contract_address = {{native_token_address}} then '{{native_token_symbol}}' - else e.symbol - end as token_symbol - ,case when a.token_contract_address = {{native_token_address}} then {{alternative_token_address}} - else a.token_contract_address - end as token_alternative_symbol - ,e.decimals as price_token_decimals - ,a.price_amount_raw / power(10, e.decimals) as price_amount - ,a.price_amount_raw / power(10, e.decimals) * p.price as price_amount_usd - ,a.platform_fee_amount_raw / power(10, e.decimals) as platform_fee_amount - ,a.platform_fee_amount_raw / power(10, e.decimals) * p.price as platform_fee_amount_usd - ,a.creator_fee_amount_raw / power(10, e.decimals) as creator_fee_amount - ,a.creator_fee_amount_raw / power(10, e.decimals) * p.price as creator_fee_amount_usd - ,coalesce(agg_m.aggregator_name, agg.name) as aggregator_name - ,agg.contract_address AS aggregator_address - ,a.fee_wallet_name - from iv_nfts a - inner join source_ethereum_transactions t on t.hash = a.tx_hash - left join ref_tokens_nft n on n.contract_address = nft_contract_address - left join ref_tokens_erc20 e on e.contract_address = case when a.token_contract_address = {{native_token_address}} then {{alternative_token_address}} - else a.token_contract_address - end - left join source_prices_usd p on p.contract_address = case when a.token_contract_address = {{native_token_address}} then {{alternative_token_address}} - else a.token_contract_address - end - and p.minute = date_trunc('minute', a.block_time) - left join ref_nft_aggregators agg on agg.contract_address = t.to - left join ref_nft_aggregators_marks agg_m on bytearray_starts_with(bytearray_reverse(t.data), bytearray_reverse(agg_m.hash_marker)) - where t."from" != 0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd -- this is a special address which transact English Auction, will handle later. test comment to force CI - -) - -- Rename column to align other *.trades tables - -- But the columns ordering is according to convenience. - -- initcap the code value if needed -select - -- basic info - '{{blockchain}}' as blockchain - ,'{{project}}' as project - ,'{{version}}' as version - - -- order info - ,block_time - ,seller - ,buyer - ,trade_type - ,order_type as trade_category -- Buy / Offer Accepted - ,'Trade' as evt_type - - -- nft token info - ,nft_contract_address - ,nft_token_name as collection - ,nft_token_id as token_id - ,nft_token_amount as number_of_items - ,nft_token_standard as token_standard - - -- price info - ,price_amount as amount_original - ,price_amount_raw as amount_raw - ,price_amount_usd as amount_usd - ,token_symbol as currency_symbol - ,token_alternative_symbol as currency_contract - ,token_contract_address as original_currency_contract - ,price_token_decimals as currency_decimals -- in case calculating royalty1~4 - - -- project info (platform or exchange) - ,platform_contract_address as project_contract_address - ,platform_fee_receiver as platform_fee_receive_address - ,platform_fee_amount_raw - ,platform_fee_amount - ,platform_fee_amount_usd - - -- royalty info - ,creator_fee_receiver_1 as royalty_fee_receive_address - ,creator_fee_amount_raw as royalty_fee_amount_raw - ,creator_fee_amount as royalty_fee_amount - ,creator_fee_amount_usd as royalty_fee_amount_usd - ,creator_fee_receiver_1 as royalty_fee_receive_address_1 - ,creator_fee_receiver_2 as royalty_fee_receive_address_2 - ,creator_fee_receiver_3 as royalty_fee_receive_address_3 - ,creator_fee_receiver_4 as royalty_fee_receive_address_4 - ,creator_fee_receiver_5 as royalty_fee_receive_address_5 - ,creator_fee_amount_raw_1 as royalty_fee_amount_raw_1 - ,creator_fee_amount_raw_2 as royalty_fee_amount_raw_2 - ,creator_fee_amount_raw_3 as royalty_fee_amount_raw_3 - ,creator_fee_amount_raw_4 as royalty_fee_amount_raw_4 - ,creator_fee_amount_raw_5 as royalty_fee_amount_raw_5 - - -- aggregator - ,aggregator_name - ,aggregator_address - - -- tx - ,block_number - ,tx_hash - ,evt_index - ,tx_from - ,tx_to - ,right_hash - - -- seaport etc - ,zone as zone_address - ,estimated_price - ,is_private - ,sub_idx - ,sub_type - ,fee_wallet_name - ,token_symbol as royalty_fee_currency_symbol - ,case when price_amount_raw > uint256 '0' then CAST ((platform_fee_amount_raw / price_amount_raw * 100) AS DOUBLE) end platform_fee_percentage - ,case when price_amount_raw > uint256 '0' then CAST((creator_fee_amount_raw/ price_amount_raw * 100) AS DOUBLE) end royalty_fee_percentage - ,'seaport-' || CAST(tx_hash AS varchar) || '-' || cast(evt_index as varchar) || '-' || CAST(nft_contract_address AS varchar) || '-' || cast(nft_token_id as varchar) || '-' || cast(sub_type as varchar) || '-' || cast(sub_idx as varchar) as unique_trade_id - from iv_trades --- where ( zone in (0xf397619df7bfd4d1657ea9bdd9df7ff888731a11 --- ,0x9b814233894cd227f561b78cc65891aa55c62ad2 --- ,0x004c00500000ad104d7dbd00e3ae0a5c00560c00 --- ,0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd --- ,0x000000e7ec00e7b300774b00001314b8610022b8 -- newly added on seaport v1.4 --- ) --- or fee_wallet_name = 'opensea' --- ) -{% endmacro %} diff --git a/dbt_subprojects/nft/macros/platforms/seaport_v4_trades.sql b/dbt_subprojects/nft/macros/platforms/seaport_v4_trades.sql index d915265c3fd..16ad67b706b 100644 --- a/dbt_subprojects/nft/macros/platforms/seaport_v4_trades.sql +++ b/dbt_subprojects/nft/macros/platforms/seaport_v4_trades.sql @@ -6,6 +6,13 @@ ,fee_wallet_list_cte ,start_date = '2023-02-01' ,native_currency_contract = '0x0000000000000000000000000000000000000000' + ,Seaport_order_contracts = [ + '0x00000000000001ad428e4906ae43d8f9852d0dd6' + ,'0x00000000000000adc04c56bf30ac9d3c0aaf14dc' + ,'0x0000000000000068F116a894984e2DB1123eB395' + ] + ,project = 'opensea' + ,version = 'v4' ) %} with source_ethereum_transactions as ( @@ -32,10 +39,9 @@ with source_ethereum_transactions as ( ,om_order_hash from {{ Seaport_evt_OrdersMatched }} cross join unnest(orderhashes) with ordinality as foo(om_order_hash,om_order_id) - where contract_address in (0x00000000000001ad428e4906ae43d8f9852d0dd6 -- Seaport v1.4 - ,0x00000000000000adc04c56bf30ac9d3c0aaf14dc -- Seaport v1.5 - ,0x0000000000000068F116a894984e2DB1123eB395 -- Seaport v1.6 - ) + where contract_address in ({% for order_contract in Seaport_order_contracts %} + {{order_contract}}{%- if not loop.last -%},{%- endif -%} + {% endfor %}) ) group by 1,2,3,4 -- deduplicate order hash re-use in advanced matching ) ,fee_wallet_list as ( @@ -100,10 +106,9 @@ with source_ethereum_transactions as ( , offer_item from {{ Seaport_evt_OrderFulfilled }} cross join unnest(offer) with ordinality as foo(offer_item, offer_idx) - where contract_address in (0x00000000000001ad428e4906ae43d8f9852d0dd6 -- Seaport v1.4 - ,0x00000000000000adc04c56bf30ac9d3c0aaf14dc -- Seaport v1.5 - ,0x0000000000000068F116a894984e2DB1123eB395 -- Seaport v1.6 - ) + where contract_address in ({% for order_contract in Seaport_order_contracts %} + {{order_contract}}{%- if not loop.last -%},{%- endif -%} + {% endfor %}) {% if not is_incremental() %} and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn {% endif %} @@ -169,10 +174,9 @@ with source_ethereum_transactions as ( , consideration_idx from {{ Seaport_evt_OrderFulfilled }} cross join unnest(consideration) with ordinality as foo(consideration_item,consideration_idx) - where contract_address in (0x00000000000001ad428e4906ae43d8f9852d0dd6 -- Seaport v1.4 - ,0x00000000000000adc04c56bf30ac9d3c0aaf14dc -- Seaport v1.5 - ,0x0000000000000068F116a894984e2DB1123eB395 -- Seaport v1.6 - ) + where contract_address in ({% for order_contract in Seaport_order_contracts %} + {{order_contract}}{%- if not loop.last -%},{%- endif -%} + {% endfor %}) {% if not is_incremental() %} and evt_block_time >= TIMESTAMP '{{start_date}}' -- seaport first txn {% endif %} @@ -415,8 +419,8 @@ with source_ethereum_transactions as ( select -- basic info '{{blockchain}}' as blockchain - ,'opensea' as project - ,'v4' as project_version + ,'{{project}}' as project + ,'{{version}}' as project_version -- order info ,block_time diff --git a/dbt_subprojects/nft/models/_sector/mints/_schema.yml b/dbt_subprojects/nft/models/_sector/mints/_schema.yml index 5996601b362..ddb268cff47 100644 --- a/dbt_subprojects/nft/models/_sector/mints/_schema.yml +++ b/dbt_subprojects/nft/models/_sector/mints/_schema.yml @@ -7,6 +7,7 @@ models: blockchain: ethereum, solana, bnb, optimism, arbitrum, polygon, zksync sector: nft contributors: soispoke, hildobby, ilemi, 0xRob, cat, umer_h_adil, lgingerich + docs_slug: /curated/trading/NFT/nft-mints config: tags: ['nft', 'opensea', 'looksrare', 'x2y2', 'magiceden', 'sudoswap', 'foundation', 'element', 'zora', 'ethereum', 'bnb', 'solana', 'events', 'polygon', 'optimism', 'arbitrum', 'rarible', 'aavegotchi', 'oneplanet', 'fractal', 'zksync'] description: > diff --git a/dbt_subprojects/nft/models/_sector/trades/MIGRATION.md b/dbt_subprojects/nft/models/_sector/trades/MIGRATION.md index 65c4df5a8c6..b5597f9ecf6 100644 --- a/dbt_subprojects/nft/models/_sector/trades/MIGRATION.md +++ b/dbt_subprojects/nft/models/_sector/trades/MIGRATION.md @@ -117,42 +117,3 @@ The following changes affect the users: - [deprecated] `unique_trade_id`, replaced by combination of (project,project_version,block_number,tx_hash,sub_tx_trade_id) - [deprecated] `evt_type` previously this was (trade/mint/burn), users can now leverage `trade_type` (primary/secondary) - [deprecated] `royalty_fee_currency_symbol`, users can use `currency_symbol` - - - -The migration for each protocol consists of 3 parts. -1. distilling the existing model to the base schema -2. validating the migration -2. purging the older model - -#### Ethereum -| Platform | Version | Trades (21/4/2023) | Migrated | Validated | Purged | -|-------------|:-------:|-------------------:|:--------:|:---------:|:------:| -| archipelago | v1 | 561 | [x] | [x] | [x] | -| blur | v1 | 3,067,180 | [x] | [x] | [x] | -| cryptopunks | v1 | 23,054 | [x] | [x] | [x] | -| element | v1 | 106,654 | [x] | [x] | [x] | -| foundation | v1 | 137,246 | [x] | [x] | [x] | -| looksrare | v1 | 401,647 | [x] | [x] | [x] | -| looksrare | v2 | 1,216 | [x] | [x] | [x] | -| opensea | v1 | 20,245,583 | | | | -| opensea | v3 | 14,110,690 | | | | -| opensea | v4 | 1,619,188 | | | | -| sudoswap | v1 | 300,750 | [x] | [x] | [x] | -| superrare | v1 | 38,864 | [x] | [x] | [x] | -| x2y2 | v1 | 1,843,487 | [x] | [x] | [x] | -| zora | v1 | 2,976 | [x] | [x] | [x] | -| zora | v2 | 3,491 | [x] | [x] | [x] | -| zora | v3 | 7,149 | [x] | [x] | [x] | -| trove | | | | | | -| liquidifty | | | | | | - -#### Optimism - -#### Arbitrum - -#### Polygon - -#### BNB - -#### Solana diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/nova/nft_nova_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/chains/nova/nft_nova_base_trades.sql new file mode 100644 index 00000000000..30c979b3fa7 --- /dev/null +++ b/dbt_subprojects/nft/models/_sector/trades/chains/nova/nft_nova_base_trades.sql @@ -0,0 +1,55 @@ +{{ config( + schema = 'nft_nova', + alias = 'base_trades', + materialized = 'view' + ) +}} + + +{% set nft_models = [ + ref('king_of_destiny_nova_base_trades') +,ref('opensea_v3_nova_base_trades') +,ref('opensea_v4_nova_base_trades') +] %} + +with base_union as ( +SELECT * FROM ( +{% for nft_model in nft_models %} + SELECT + blockchain, + project, + project_version, + cast(date_trunc('day', block_time) as date) as block_date, + cast(date_trunc('month', block_time) as date) as block_month, + block_time, + block_number, + tx_hash, + project_contract_address, + trade_category, --buy/sell/swap + trade_type, --primary/secondary + buyer, + seller, + nft_contract_address, + nft_token_id, + nft_amount, -- always 1 for erc721 + price_raw, + currency_contract, + platform_fee_amount_raw, + royalty_fee_amount_raw, + platform_fee_address, -- optional + royalty_fee_address, -- optional + sub_tx_trade_id, +-- tx_from, +-- tx_to, + row_number() over (partition by tx_hash, sub_tx_trade_id order by tx_hash) as duplicates_rank -- duplicates protection + FROM {{ nft_model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} + ) +where duplicates_rank = 1 +) + +-- this will be removed once tx_from and tx_to are available in the base event tables +{{ add_nft_tx_data('base_union', 'nova') }} diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/_schema.yml b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/_schema.yml new file mode 100644 index 00000000000..323f612205b --- /dev/null +++ b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/_schema.yml @@ -0,0 +1,51 @@ +version: 2 + +models: + - name: king_of_destiny_nova_base_trades + meta: + blockchain: nova + sector: nft + project: king_of_destiny + contributors: ['0xRob' ] + config: + tags: [ 'nova', 'nft', 'trades', 'king_of_destiny' ] + description: "king_of_destiny base trades" + tests: + - check_columns_nft_base_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [ 'block_number','tx_hash','sub_tx_trade_id' ] + + - name: opensea_v3_nova_base_trades + meta: + blockchain: nova + project: opensea + contributors: sohwak, 0xRob + config: + tags: [ 'opensea','base_trades','seaport' ] + description: > + Opensea base trades from seaport (v3) + tests: + - check_columns_nft_base_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_number + - tx_hash + - sub_tx_trade_id + + - name: opensea_v4_nova_base_trades + meta: + blockchain: nova + project: opensea + contributors: sohwak, 0xRob + config: + tags: [ 'opensea','base_trades','seaport' ] + description: > + Opensea base trades from seaport (v4) + tests: + - check_columns_nft_base_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_number + - tx_hash + - sub_tx_trade_id + diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/king_of_destiny_nova_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/king_of_destiny_nova_base_trades.sql new file mode 100644 index 00000000000..678b49e1875 --- /dev/null +++ b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/king_of_destiny_nova_base_trades.sql @@ -0,0 +1,55 @@ +{{ config( + schema = 'king_of_destiny_nova', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_number','tx_hash','sub_tx_trade_id'], + ) +}} + + +select + 'nova' as blockchain + ,'king_of_destiny' as project + ,'v1' as project_version + ,s.evt_block_time as block_time + ,cast(date_trunc('day', s.evt_block_time) as date) as block_date + ,cast(date_trunc('month', s.evt_block_time) as date) as block_month + ,s.evt_block_number as block_number + ,s.evt_tx_hash as tx_hash + ,'secondary' as trade_type + ,'Buy' as trade_category + ,s.evt_index + ,s.buyer + ,s.listingCreator as seller + ,s.contract_address as project_contract_address + ,s.tokenId as nft_token_id + ,s.assetContract as nft_contract_address + ,s.quantityBought as nft_amount + ,s.totalPricePaid as price_raw + ,from_hex(json_extract_scalar(l.listing, '$.currency')) as currency_contract + ,element_at(r.output_amounts,1) as royalty_fee_amount_raw + ,cast(null as uint256) as platform_fee_amount_raw + ,cast(null as varbinary) as platform_fee_address + ,element_at(r.output_recipients,1) as royalty_fee_address + ,s.listingId as listing_id + ,s.evt_index as sub_tx_trade_id +from {{source('king_of_destiny_nova','MarketplaceV3_DirectListingsLogic_evt_NewSale')}} s +left join {{source('king_of_destiny_nova','MarketplaceV3_DirectListingsLogic_evt_NewListing')}} l + on s.listingId = l.listingId + {% if is_incremental() %} + and {{incremental_predicate('l.evt_block_time')}} + {% endif %} +left join {{source('king_of_destiny_nova','MarketplaceV3_call_GetRoyalty')}} r + on s.evt_tx_hash = r.call_tx_hash + and s.evt_block_number = r.call_block_number + and s.totalPricePaid = r.value + and s.assetContract = r.tokenAddress + and s.tokenId = r.tokenId + {% if is_incremental() %} + and {{incremental_predicate('r.call_block_time')}} + {% endif %} +{% if is_incremental() %} +WHERE {{incremental_predicate('s.evt_block_time')}} +{% endif %} diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/opensea_v3_nova_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/opensea_v3_nova_base_trades.sql new file mode 100644 index 00000000000..59c98048ad7 --- /dev/null +++ b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/opensea_v3_nova_base_trades.sql @@ -0,0 +1,41 @@ +{{ config( + schema = 'opensea_v3_nova', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_number', 'tx_hash', 'sub_tx_trade_id'] + ) +}} +WITH fee_wallets as ( + select wallet_address, wallet_name from ( + values (0x5b3256965e7c3cf26e11fcaf296dfc8807c01073,'opensea') + ,(0x8de9c5a032463c561423387a9648c5c7bcc5bc90,'opensea') + ,(0x34ba0f2379bf9b81d09f7259892e26a8b0885095,'opensea') + ,(0x0000a26b00c1f0df003000390027140000faa719,'opensea') + ) as foo(wallet_address, wallet_name) +) +, trades as ( + {{ seaport_v3_trades( + blockchain = 'nova' + ,source_transactions = source('nova','transactions') + ,Seaport_evt_OrderFulfilled = source('seaport_nova','Seaport_evt_OrderFulfilled') + ,Seaport_call_matchAdvancedOrders = source('seaport_nova','Seaport_call_matchAdvancedOrders') + ,Seaport_call_matchOrders = source('seaport_nova','Seaport_call_matchOrders') + ,fee_wallet_list_cte = 'fee_wallets' + ,start_date = '2022-06-01' + ) + }} +) + +select * +from trades +where +( zone_address in (0xf397619df7bfd4d1657ea9bdd9df7ff888731a11 + ,0x9b814233894cd227f561b78cc65891aa55c62ad2 + ,0x004c00500000ad104d7dbd00e3ae0a5c00560c00 + ,0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd + ,0x000000e7ec00e7b300774b00001314b8610022b8 -- newly added on seaport v1.4 + ) + or fee_wallet_name = 'opensea' +) diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/opensea_v4_nova_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/opensea_v4_nova_base_trades.sql new file mode 100644 index 00000000000..f38e41ff8ff --- /dev/null +++ b/dbt_subprojects/nft/models/_sector/trades/chains/nova/platforms/opensea_v4_nova_base_trades.sql @@ -0,0 +1,43 @@ +{{ config( + schema = 'opensea_v4_nova', + alias = 'base_trades', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_number', 'tx_hash', 'sub_tx_trade_id'] + ) +}} + +WITH fee_wallets as ( + select wallet_address, wallet_name from ( + values (0x5b3256965e7c3cf26e11fcaf296dfc8807c01073,'opensea') + ,(0x8de9c5a032463c561423387a9648c5c7bcc5bc90,'opensea') + ,(0x34ba0f2379bf9b81d09f7259892e26a8b0885095,'opensea') + ,(0x0000a26b00c1f0df003000390027140000faa719,'opensea') + ) as foo(wallet_address, wallet_name) +) +, trades as ( + {{ seaport_v4_trades( + blockchain = 'nova' + ,source_transactions = source('nova','transactions') + ,Seaport_evt_OrderFulfilled = source('seaport_nova','Seaport_evt_OrderFulfilled') + ,Seaport_evt_OrdersMatched = source('seaport_nova','Seaport_evt_OrdersMatched') + ,fee_wallet_list_cte = 'fee_wallets' + ,start_date = '2023-01-05' + ) + }} +) + +select * +from trades +where +( zone_address in (0xf397619df7bfd4d1657ea9bdd9df7ff888731a11 + ,0x9b814233894cd227f561b78cc65891aa55c62ad2 + ,0x004c00500000ad104d7dbd00e3ae0a5c00560c00 + ,0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd + ,0x000000e7ec00e7b300774b00001314b8610022b8 -- newly added on seaport v1.4 + ,0x000056f7000000ece9003ca63978907a00ffd100 -- new signed zone for seaport v1.6 + ) + or fee_wallet_name = 'opensea' +) + diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/old/nft_old_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/chains/old/nft_old_base_trades.sql deleted file mode 100644 index a75064b76cf..00000000000 --- a/dbt_subprojects/nft/models/_sector/trades/chains/old/nft_old_base_trades.sql +++ /dev/null @@ -1,55 +0,0 @@ -{{ config( - schema = 'nft_old', - alias = 'base_trades', - materialized = 'view' - ) -}} - - --- while we refactor more marketplace models, they should be removed here and added to the chain specific base_trades unions. -{% set nft_models = [ -ref('nftearth_optimism_events') -,ref('mooar_polygon_events') -,ref('oneplanet_polygon_events') -,ref('quix_seaport_optimism_events') -] %} - - --- we have to do some column wrangling here to convert the old schema to the new base_trades schema -SELECT * FROM ( -{% for nft_model in nft_models %} - SELECT - blockchain, - project, - version as project_version, - cast(date_trunc('day', block_time) as date) as block_date, - cast(date_trunc('month', block_time) as date) as block_month, - block_time, - block_number, - tx_hash, - project_contract_address, - trade_category, - case when evt_type = 'Mint' then 'primary' else 'secondary' end as trade_type, - buyer, - seller, - nft_contract_address, - token_id as nft_token_id, - number_of_items as nft_amount, - amount_raw as price_raw, - currency_contract, - platform_fee_amount_raw, - royalty_fee_amount_raw, - cast(null as varbinary) as platform_fee_address, - royalty_fee_receive_address as royalty_fee_address, - tx_from, - tx_to, - cast(null as varbinary) as tx_data_marker, -- forwarc compatibility with aggregator marker matching - row_number() over (partition by tx_hash order by unique_trade_id) as sub_tx_trade_id, -- intermediate fix to fill this column - row_number() over (partition by tx_hash, unique_trade_id order by tx_hash) as duplicates_rank - FROM {{ nft_model }} - {% if not loop.last %} - UNION ALL - {% endif %} - {% endfor %} - ) -where duplicates_rank = 1 diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/_schema.yml b/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/_schema.yml deleted file mode 100644 index 362e4c02430..00000000000 --- a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/_schema.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 2 - -models: - - - name: mooar_polygon_events - meta: - blockchain: polygon - project: mooar - contributors: springzh - config: - tags: [ 'polygon','mooar','events','springzh' ] - description: > - Mooar events on Polygon - tests: - - check_columns_nft_old_events - - - name: oneplanet_polygon_events - meta: - blockchain: polygon - project: oneplanet - contributors: springzh - config: - tags: [ 'polygon','oneplanet','events','springzh' ] - description: > - OnePlanet events on Polygon - tests: - - check_columns_nft_old_events diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/quix_optimism_schema.yml b/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/quix_optimism_schema.yml deleted file mode 100644 index 33b22b22035..00000000000 --- a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/quix_optimism_schema.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: 2 - -models: - - name: quix_seaport_optimism_events - meta: - blockchain: optimism - project: quix - contributors: chuxin - config: - tags: ['optimism','seaport','events','chuxin'] - description: > - Quix Seaport events on Optimism - tests: - - check_columns_nft_old_events - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - tx_hash - - evt_index - - nft_contract_address - - token_id - - sub_type - - sub_idx - - check_seed: - seed_file: ref('quix_events_seed') - filter: - blockchain: optimism - project: quix - version: seaport - match_columns: - - tx_hash - - token_id - - seller - - evt_index - check_columns: - - buyer - - nft_contract_address diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/optimism/nft_optimism_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/nft_optimism_base_trades.sql index 17ba24f0af7..d513e2249a4 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/optimism/nft_optimism_base_trades.sql +++ b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/nft_optimism_base_trades.sql @@ -16,6 +16,8 @@ ,ref('element_optimism_base_trades') ,ref('opensea_v3_optimism_base_trades') ,ref('opensea_v4_optimism_base_trades') + ,ref('quix_seaport_optimism_base_trades') + ,ref('nftearth_optimism_base_trades') ] %} with base_union as ( diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/_schema.yml b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/_schema.yml index 5f8b540e25c..cfb000a85fe 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/_schema.yml +++ b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/_schema.yml @@ -198,3 +198,34 @@ models: - block_number - tx_hash - sub_tx_trade_id + + - name: quix_seaport_optimism_base_trades + meta: + blockchain: optimism + project: quix + contributors: chuxin + config: + tags: [ 'optimism','seaport','events','chuxin' ] + description: > + Quix Seaport events on Optimism + tests: + - check_columns_nft_base_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_number + - tx_hash + - sub_tx_trade_id + + - name: nftearth_optimism_base_trades + meta: + blockchain: optimism + project: nftearth + config: + tags: [ 'optimism','nftearth','trades' ] + tests: + - check_columns_nft_base_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_number + - tx_hash + - sub_tx_trade_id diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/nftearth_optimism_events.sql b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/nftearth_optimism_base_trades.sql similarity index 72% rename from dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/nftearth_optimism_events.sql rename to dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/nftearth_optimism_base_trades.sql index 7fc9d04e97c..fdcb2e99c32 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/nftearth_optimism_events.sql +++ b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/nftearth_optimism_base_trades.sql @@ -1,11 +1,10 @@ {{ config( schema = 'nftearth_optimism', - alias = 'events', - + alias = 'base_trades', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', - unique_key = ['block_number', 'tx_hash', 'evt_index', 'nft_contract_address', 'token_id', 'sub_type', 'sub_idx'] + unique_key = ['block_number', 'tx_hash', 'sub_tx_trade_id'] ) }} @@ -15,17 +14,15 @@ WITH fee_wallets as ( ) as foo(wallet_address, wallet_name) ) , trades as ( - {{ seaport_v3_fork_trades( + {{ seaport_v3_trades( blockchain = 'optimism' ,source_transactions = source('optimism','transactions') ,Seaport_evt_OrderFulfilled = source('nftearth_optimism','Seaport_evt_OrderFulfilled') ,Seaport_call_matchAdvancedOrders = source('nftearth_optimism','Seaport_call_matchAdvancedOrders') ,Seaport_call_matchOrders = source('nftearth_optimism','Seaport_call_matchOrders') ,fee_wallet_list_cte = 'fee_wallets' - ,native_token_address = '0x0000000000000000000000000000000000000000' - ,alternative_token_address = '0x4200000000000000000000000000000000000006' - ,native_token_symbol = 'ETH' ,start_date = '2023-01-31' + ,native_currency_contract = '0x4200000000000000000000000000000000000006' ,seaport_fork_address = '0x0f9b80fc3c8b9123d0aef43df58ebdbc034a8901' ,project = 'nftearth' ,version = 'v1' diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/quix_seaport_optimism_events.sql b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/quix_seaport_optimism_base_trades.sql similarity index 72% rename from dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/quix_seaport_optimism_events.sql rename to dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/quix_seaport_optimism_base_trades.sql index efcf7225094..379245b4010 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/quix_seaport_optimism_events.sql +++ b/dbt_subprojects/nft/models/_sector/trades/chains/optimism/platforms/quix_seaport_optimism_base_trades.sql @@ -1,11 +1,11 @@ {{ config( schema = 'quix_seaport_optimism', - alias = 'events', - + alias = 'base_trades', + materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', - unique_key = ['tx_hash', 'evt_index', 'nft_contract_address', 'token_id', 'sub_type', 'sub_idx'] + unique_key = ['block_number', 'tx_hash', 'sub_tx_trade_id'] ) }} @@ -15,17 +15,15 @@ WITH fee_wallets as ( ) as foo(wallet_address, wallet_name) ) , trades as ( - {{ seaport_v3_fork_trades( + {{ seaport_v3_trades( blockchain = 'optimism' ,source_transactions = source('optimism','transactions') ,Seaport_evt_OrderFulfilled = source('quixotic_optimism','Seaport_evt_OrderFulfilled') ,Seaport_call_matchAdvancedOrders = source('quixotic_optimism','Seaport_call_matchAdvancedOrders') ,Seaport_call_matchOrders = source('quixotic_optimism','Seaport_call_matchOrders') ,fee_wallet_list_cte = 'fee_wallets' - ,native_token_address = '0x0000000000000000000000000000000000000000' - ,alternative_token_address = '0x4200000000000000000000000000000000000006' - ,native_token_symbol = 'ETH' ,start_date = '2022-07-29' + ,native_currency_contract = '0x4200000000000000000000000000000000000006' ,seaport_fork_address = '0x998ef16ea4111094eb5ee72fc2c6f4e6e8647666' ,project = 'quix' ) diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/polygon/nft_polygon_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/nft_polygon_base_trades.sql index 62959678cbb..4e522e42f34 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/polygon/nft_polygon_base_trades.sql +++ b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/nft_polygon_base_trades.sql @@ -19,6 +19,8 @@ ,ref('magiceden_v2_polygon_base_trades') ,ref('opensea_v3_polygon_base_trades') ,ref('opensea_v4_polygon_base_trades') + ,ref('mooar_polygon_base_trades') + ,ref('oneplanet_polygon_base_trades') ] %} with base_union as ( diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/_schema.yml b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/_schema.yml index 384dad9ae2a..405c4bcd7dd 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/_schema.yml +++ b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/_schema.yml @@ -261,3 +261,31 @@ models: - nft_contract_address - nft_token_id - price_raw + + - name: mooar_polygon_base_trades + meta: + blockchain: polygon + project: mooar + contributors: springzh + config: + tags: [ 'polygon','mooar','events','springzh' ] + description: > + Mooar events on Polygon + tests: + - check_columns_nft_base_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [ 'block_number','tx_hash','sub_tx_trade_id' ] + + - name: oneplanet_polygon_base_trades + meta: + blockchain: polygon + project: oneplanet + contributors: springzh + config: + tags: [ 'polygon','oneplanet','events','springzh' ] + description: > + OnePlanet events on Polygon + tests: + - check_columns_nft_base_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [ 'block_number','tx_hash','sub_tx_trade_id' ] diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/mooar_polygon_events.sql b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/mooar_polygon_base_trades.sql similarity index 70% rename from dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/mooar_polygon_events.sql rename to dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/mooar_polygon_base_trades.sql index bae718ba200..45840065105 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/mooar_polygon_events.sql +++ b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/mooar_polygon_base_trades.sql @@ -1,11 +1,11 @@ {{ config( schema = 'mooar_polygon', - alias = 'events', - + alias = 'base_trades', + materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', - unique_key = ['tx_hash', 'evt_index', 'nft_contract_address', 'token_id', 'sub_type', 'sub_idx'] + unique_key = ['block_number', 'tx_hash', 'sub_tx_trade_id'] ) }} WITH fee_wallets as ( @@ -14,15 +14,13 @@ WITH fee_wallets as ( ) as foo(wallet_address, wallet_name) ) , trades as ( - {{ seaport_v4_fork_trades( + {{ seaport_v4_trades( blockchain = 'polygon' ,source_transactions = source('polygon','transactions') ,Seaport_evt_OrderFulfilled = source('gashero_polygon','MOOAR_evt_OrderFulfilled') ,Seaport_evt_OrdersMatched = source('gashero_polygon','MOOAR_evt_OrdersMatched') ,fee_wallet_list_cte = 'fee_wallets' - ,native_token_address = '0x0000000000000000000000000000000000000000' - ,alternative_token_address = '0x0000000000000000000000000000000000001010' - ,native_token_symbol = 'MATIC' + ,native_currency_contract = '0x0000000000000000000000000000000000001010' ,start_date = '2023-08-18' ,Seaport_order_contracts = ['0xaaaaaaaa33d3520a2266ce508bc079fcfe82c8e3'] ,project = 'mooar' diff --git a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/oneplanet_polygon_events.sql b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/oneplanet_polygon_base_trades.sql similarity index 73% rename from dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/oneplanet_polygon_events.sql rename to dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/oneplanet_polygon_base_trades.sql index a3c42c9d1d7..8bc0abd1809 100644 --- a/dbt_subprojects/nft/models/_sector/trades/chains/old/platforms/oneplanet_polygon_events.sql +++ b/dbt_subprojects/nft/models/_sector/trades/chains/polygon/platforms/oneplanet_polygon_base_trades.sql @@ -1,11 +1,11 @@ {{ config( schema = 'oneplanet_polygon', - alias = 'events', - + alias = 'base_trades', + materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', - unique_key = ['tx_hash', 'evt_index', 'nft_contract_address', 'token_id', 'sub_type', 'sub_idx'] + unique_key = ['block_number', 'tx_hash', 'sub_tx_trade_id'] ) }} @@ -15,17 +15,15 @@ WITH fee_wallets as ( ) as foo(wallet_address, wallet_name) ) , trades as ( - {{ seaport_v3_fork_trades( + {{ seaport_v3_trades( blockchain = 'polygon' ,source_transactions = source('polygon','transactions') ,Seaport_evt_OrderFulfilled = source('oneplanet_polygon','Seaport_evt_OrderFulfilled') ,Seaport_call_matchAdvancedOrders = source('oneplanet_polygon','Seaport_call_matchAdvancedOrders') ,Seaport_call_matchOrders = source('oneplanet_polygon','Seaport_call_matchOrders') ,fee_wallet_list_cte = 'fee_wallets' - ,native_token_address = '0x0000000000000000000000000000000000000000' - ,alternative_token_address = '0x0000000000000000000000000000000000001010' - ,native_token_symbol = 'MATIC' ,start_date = '2023-09-03' + ,native_currency_contract = '0x0000000000000000000000000000000000001010' ,seaport_fork_address = '0xcbbecf690e030d096794f7685a1bf4a58378a575' ,project = 'oneplanet' ,version = 'v1' diff --git a/dbt_subprojects/nft/models/_sector/trades/nft_base_trades.sql b/dbt_subprojects/nft/models/_sector/trades/nft_base_trades.sql index fc7cc294a65..d9d70881f68 100644 --- a/dbt_subprojects/nft/models/_sector/trades/nft_base_trades.sql +++ b/dbt_subprojects/nft/models/_sector/trades/nft_base_trades.sql @@ -16,7 +16,6 @@ ,ref('nft_base_base_trades') ,ref('nft_bnb_base_trades') ,ref('nft_ethereum_base_trades') - ,ref('nft_old_base_trades') ,ref('nft_optimism_base_trades') ,ref('nft_polygon_base_trades') ,ref('nft_zksync_base_trades') @@ -27,6 +26,7 @@ ,ref('nft_zora_base_trades') ,ref('nft_blast_base_trades') ,ref('nft_fantom_base_trades') + ,ref('nft_nova_base_trades') ] %} with base_union as ( diff --git a/dbt_subprojects/nft/models/_sector/trades/schema.yml b/dbt_subprojects/nft/models/_sector/trades/schema.yml index 3f4175b9d7c..bf8da98ab36 100644 --- a/dbt_subprojects/nft/models/_sector/trades/schema.yml +++ b/dbt_subprojects/nft/models/_sector/trades/schema.yml @@ -145,13 +145,14 @@ models: - name: nft_trades meta: - blockchain: ethereum, solana, bnb, optimism, arbitrum, polygon, blast, fantom + blockchain: ethereum, solana, bnb, optimism, arbitrum, polygon, blast, fantom, nova sector: nft - contributors: soispoke, hildobby, ilemi, cat + contributors: soispoke, hildobby, ilemi, cat, 0xRob + docs_slug: curated/trading/NFT/nft-trades config: tags: [ 'nft', 'opensea', 'looksrare', 'x2y2', 'magiceden', 'sudoswap', 'foundation', 'element', 'zora', 'ethereum', 'bnb', 'solana', 'optimism', 'arbitrum', 'trades','superrare', 'polygon', 'rarible', 'aavegotchi', 'oneplanet', 'fractal' ] description: > - NFT trades + The nft.trades table on Dune captures Non-Fungible Token (NFT) trades and swaps across various marketplaces. tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: @@ -190,7 +191,7 @@ models: meta: blockchain: ethereum, solana, polygon sector: nft - contributors: soispoke, hildobby, ilemi, cat + contributors: soispoke, hildobby, ilemi, cat, 0xRob config: tags: [ 'nft', 'opensea', 'looksrare', 'x2y2', 'magiceden', 'sudoswap', 'foundation', 'element', 'zora', 'ethereum', 'bnb', 'solana', 'fees','superrare', 'polygon', 'rarible', 'aavegotchi', 'oneplanet', 'fractal' ] description: > diff --git a/dbt_subprojects/nft/models/_sector/transfers/chains/nft_optimism_transfers.sql b/dbt_subprojects/nft/models/_sector/transfers/chains/nft_optimism_transfers.sql index 4f434cc8bdf..7a1eb63d06e 100644 --- a/dbt_subprojects/nft/models/_sector/transfers/chains/nft_optimism_transfers.sql +++ b/dbt_subprojects/nft/models/_sector/transfers/chains/nft_optimism_transfers.sql @@ -13,7 +13,7 @@ {{nft_transfers( blockchain='optimism' , base_transactions = source('optimism','transactions') - , erc721_transfers = source('erc721_optimism','evt_transfer') - , erc1155_single = source('erc1155_optimism','evt_transfersingle') - , erc1155_batch = source('erc1155_optimism', 'evt_transferbatch') + , erc721_transfers = source('erc721_optimism','evt_Transfer') + , erc1155_single = source('erc1155_optimism','evt_TransferSingle') + , erc1155_batch = source('erc1155_optimism', 'evt_TransferBatch') )}} diff --git a/dbt_subprojects/nft/models/_sector/wash_trades/_schema.yml b/dbt_subprojects/nft/models/_sector/wash_trades/_schema.yml index 73a0c85d719..dc2a68fc3ac 100644 --- a/dbt_subprojects/nft/models/_sector/wash_trades/_schema.yml +++ b/dbt_subprojects/nft/models/_sector/wash_trades/_schema.yml @@ -6,10 +6,11 @@ models: blockchain: arbitrum, avalanche_c, bnb, ethereum, gnosis, optimism, polygon, zksync, base, scroll, zora, blast, fantom sector: nft contributors: hildobby + docs_slug: /curated/trading/NFT/nft-wash-trades config: tags: ['nft', 'opensea', 'looksrare', 'x2y2', 'magiceden', 'sudoswap', 'foundation', 'element', 'zora', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'optimism', 'polygon', 'wash_trades', 'zksync', 'base', 'scroll', 'zora'] description: > - NFT wash trades labelling + Dataset for identifying and analyzing potential wash trading activities in NFT transactions across various marketplaces and blockchains columns: - &blockchain name: blockchain diff --git a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_schema.yml b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_schema.yml index b43826f879f..21a6dc5f953 100644 --- a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_schema.yml +++ b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_schema.yml @@ -445,4 +445,103 @@ models: - name: artist_name description: "Name of artist" - name: art_collection_unique_id - description: "Unique identifier - contract address and project id" \ No newline at end of file + description: "Unique identifier - contract address and project id" + + - name: nft_ethereum_metadata_xcopy_collections + meta: + blockchain: ethereum + sector: nft + contributors: cat + config: + tags: ['nft', 'ethereum', 'xcopy', 'metadata'] + description: > + Details for all XCOPY collections + columns: + - name: title + description: "Unique identifier - title of piece" + tests: + - unique + - name: art_type + description: "Type - 1/1, edition, etc." + - name: platform + description: "Platform minted on" + - name: edition_count + description: "Edition count" + - name: blockchain + description: "Blockchain" + - name: token_standard + description: "Token standard" + - name: contract_address + description: "Collection contract address" + - name: min_token_id + description: "Min token id in series" + - name: max_token_id + description: "Max token id in series" + - name: category + description: "Category. Optional field" + - name: link + description: "Link" + - name: mint_date + description: "Mint date. Varchar" + - name: mint_date_date + description: "Mint date. Date" + - name: mint_date_date_format + description: "Mint date. Date formatted" + + - name: nft_ethereum_metadata_xcopy_nonsequential_tokens + meta: + blockchain: ethereum + sector: nft + contributors: cat + config: + tags: ['nft', 'ethereum', 'xcopy', 'metadata'] + description: > + Token IDs for XCOPY collections that aren't in a range (e.g. id 3, 11, 19 instead of 1, 2, 3) + columns: + - name: title + description: "Title of piece" + - name: art_type + description: "Type - 1/1, edition, etc." + - name: nonsequential_token_id + description: "Actual token id" + - name: clean_token_id + description: "Token id for display purposes to match what is shown on marketplaces" + + - name: nft_ethereum_metadata_xcopy_full_list + meta: + blockchain: ethereum + sector: nft + contributors: cat + config: + tags: ['nft', 'ethereum', 'xcopy', 'metadata'] + description: > + Details for all XCOPY collections w/ all token IDs (either range or nonsequential tokens). Used for joining with any other talbe (e.g. nft.trades) + columns: + - name: title + description: "Title of piece" + - name: art_type + description: "Type - 1/1, edition, etc." + - name: platform + description: "Platform minted on" + - name: edition_count + description: "Edition count" + - name: blockchain + description: "Blockchain" + - name: token_standard + description: "Token standard" + - name: contract_address + description: "Collection contract address" + - name: min_token_id + description: "Min token id in series" + - name: max_token_id + description: "Max token id in series" + - name: nonsequential_token_id + description: "Actual token id" + - name: clean_token_id + description: "Token id for display purposes to match what is shown on marketplaces" + - name: category + description: "Category. Optional field" + - name: link + description: "Link" + - name: mint_date_date_format + description: "Mint date. Date formatted" \ No newline at end of file diff --git a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_collections.sql b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_collections.sql new file mode 100644 index 00000000000..185eda4b8f2 --- /dev/null +++ b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_collections.sql @@ -0,0 +1,269 @@ +{{ config( + tags = ['static'] + ,schema = 'nft_ethereum_metadata' + ,alias = 'xcopy_collections' + ,materialized = 'table' + ,post_hook='{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "sector", + spell_name = "nft_ethereum_metadata", + contributors = \'["cat"]\') }}' + ) +}} + +select * + , date(mint_date) as mint_date_date + , date_format(date(mint_date),'%b-%d-%Y') as mint_date_date_format + +from +( +select title, art_type, platform, edition_count, blockchain, token_standard, contract_address, min_token_id, max_token_id, category, link, mint_date +from (VALUES + ('BOT_ROT', 'Edition', 'Manifold', 250, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 8, 8, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/8','2024-09-11') + , ('SH_MASH_MA', 'Edition', 'Manifold', 250, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 7, 7, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/7','2024-07-25') + , ('XOMBO', 'Edition', 'Manifold', 500, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 6, 6, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/6','2024-07-25') + , ('CRAWLER', 'Edition', 'Manifold', 500, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 5, 5, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/5','2024-02-11') + , ('CHURN', 'Edition', 'Manifold', 250, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 4, 4, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/4','2024-01-15') + , ('SIDEWAYZ', 'Edition', 'Manifold', 420, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 3, 3, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/3','2024-01-11') + , ('BANG BANG', 'Edition', 'Manifold', 250, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 2, 2, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/2','2024-01-10') + , ('PROTO-GOUGE', 'Edition', 'Manifold', 99, 'Ethereum', 'erc1155', 0x55fda4cf1e821c6f13372d6337303a97eea829c1, 3, 3, 'GRIFT SZN', 'https://opensea.io/assets/ethereum/0x55fda4cf1e821c6f13372d6337303a97eea829c1/3','2023-12-13') + , ('PROTO-WRETCH', 'Edition', 'Manifold', 66, 'Ethereum', 'erc1155', 0x55fda4cf1e821c6f13372d6337303a97eea829c1, 2, 2, 'GRIFT SZN', 'https://opensea.io/assets/ethereum/0x55fda4cf1e821c6f13372d6337303a97eea829c1/2','2023-12-13') + , ('PROTO-SHADY', 'Edition', 'Manifold', 33, 'Ethereum', 'erc1155', 0x55fda4cf1e821c6f13372d6337303a97eea829c1, 1, 1, 'GRIFT SZN', 'https://opensea.io/assets/ethereum/0x55fda4cf1e821c6f13372d6337303a97eea829c1/1','2023-12-13') + , ('OBLIVION', 'Edition', 'Manifold', 500, 'Ethereum', 'erc1155', 0x3e34ff1790bf0a13efd7d77e75870cb525687338, 1, 1, 'DAMAGE CONTROL', 'https://opensea.io/assets/ethereum/0x3e34ff1790bf0a13efd7d77e75870cb525687338/1','2023-12-11') + , ('SIMULACRUM', 'Edition', 'Manifold', 42, 'Ethereum', 'erc1155', 0xbb6eefd83daab02fa1a697eb9d8495eec9f9b384, 2, 2, 'FRESH HELL', 'https://opensea.io/assets/ethereum/0xbb6eefd83daab02fa1a697eb9d8495eec9f9b384/2','2023-11-28') + , ('RΞMNANTS', 'Variant Edition', 'SuperRare', 250, 'Ethereum', 'erc721', 0xdfea2b364db868b1d2601d6b833d74db4de94460, 1, 250, '', 'https://opensea.io/collection/xcopy-remnants','2023-11-02') + , ('ALGO BRO', 'Edition', 'Manifold', 42, 'Ethereum', 'erc1155', 0xbb6eefd83daab02fa1a697eb9d8495eec9f9b384, 1, 1, 'FRESH HELL', 'https://opensea.io/assets/ethereum/0xbb6eefd83daab02fa1a697eb9d8495eec9f9b384/1','2023-10-20') + , ('CLUTCHES', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 43145, 43145, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/43145','2023-02-17') + , ('LUXURY MICROWAVE MASH', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 43143, 43143, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/43143','2023-02-17') + , ('AISLE 5 WORMHOLE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 43142, 43142, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/43142','2023-02-17') + , ('MESCO TETRO', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 43119, 43119, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/43119','2023-02-16') + , ('LA WHENEVER', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 43105, 43105, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/43105','2023-02-16') + , ('EXIT STRATEGY', 'Edition', 'The Memes by 6529', 420, 'Ethereum', 'erc1155', 0x33fd426905f149f8376e227d0c9d3340aad17af1, 47, 47, '', 'https://opensea.io/assets/ethereum/0x33fd426905f149f8376e227d0c9d3340aad17af1/47','2022-12-16') + , ('STEADY', 'Edition', 'Noble Gallery', 38, 'Ethereum', 'erc1155', 0x7e9b9ba1a3b4873279857056279cef6a4fcdf340, 32, 32, '', 'https://opensea.io/assets/ethereum/0x7e9b9ba1a3b4873279857056279cef6a4fcdf340/32','2022-12-06') + , ('DECAL BY XCOPY', 'Variant Edition', 'Deca', 100, 'Ethereum', 'erc721', 0xb034fa4ba0a5cca4bd9f5b9db845fb26c5500b8c, 0, 99, '', 'https://opensea.io/collection/decal-by-xcopy','2022-11-30') + , ('GOD IS TYPING...', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 36332, 36332, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/36332','2022-07-27') + , ('RIGHT CLICK SHARE', 'On-Chain Attestation', 'Deca', 1025, 'Ethereum', 'erc721', 0xd16809c0a7d82c9e7552a01fd608fff90efb564f, 0, 1024, '', 'https://opensea.io/collection/right-click-share','2022-05-31') + , ('THE FEAR', 'Edition', 'Fan Bits', 2, 'Ethereum', 'erc721', 0xeaf7888880a308dbd13ae74d1567cc20e1ff4f74, 1705, 1705, '', 'https://opensea.io/assets/ethereum/0xeaf7888880a308dbd13ae74d1567cc20e1ff4f74/1705','2022-04-10') + , ('HYPERION', 'Edition', 'Fan Bits', 2, 'Ethereum', 'erc721', 0xeaf7888880a308dbd13ae74d1567cc20e1ff4f74, 1686, 1686, '', 'https://opensea.io/assets/ethereum/0xeaf7888880a308dbd13ae74d1567cc20e1ff4f74/1686','2022-04-10') + , ('GOURMET SPICY', 'Variant Edition', 'Nifty Gateway', 24, 'Ethereum', 'erc721', 0x18a62e93fF3AB180e0c7abd4812595bf2bE3405F, 169000300001, 169000300024, '', 'https://opensea.io/collection/max-pain-and-frens-by-xcopy?search[query]=gourmet%20spicy','2022-03-24') + , ('DAMAGER LUXE', 'Variant Edition', 'Nifty Gateway', 12, 'Ethereum', 'erc721', 0x18a62e93fF3AB180e0c7abd4812595bf2bE3405F, 169000200001, 169000200012, '', 'https://opensea.io/collection/max-pain-and-frens-by-xcopy?search[query]=damager%20luxe','2022-03-24') + , ('WASTER', 'Variant Edition', 'Nifty Gateway', 6, 'Ethereum', 'erc721', 0x18a62e93fF3AB180e0c7abd4812595bf2bE3405F, 169000100001, 169000100006, '', 'https://opensea.io/collection/max-pain-and-frens-by-xcopy?search[query]=waster&search[sortAscending]=true&search[sortBy]=UNIT_PRICE','2022-03-24') + , ('MAX PAIN', 'Edition', 'Nifty Gateway', 7394, 'Ethereum', 'erc721', 0xd1169e5349d1cb9941f3dcba135c8a4b9eacfdde, 171000100001, 171000107394, '', 'https://opensea.io/collection/max-pain-and-frens-by-xcopy','2022-03-24') + , ('GUZZLER (RED)', 'Edition', 'Nifty Gateway', 21, 'Ethereum', 'erc721', 0x3696Cd00618a08C8793208385aE526677C889D4A, 170000100001, 170000100021, '', 'https://opensea.io/collection/xcopy-editions?search[query]=guzzler%20%2F21','2022-03-17') + , ('REACHBACK', 'Edition', 'Nifty Gateway', 34, 'Ethereum', 'erc721', 0x3696Cd00618a08C8793208385aE526677C889D4A, 170000200001, 170000200034, '', 'https://opensea.io/collection/xcopy-editions?search[query]=reachback','2022-03-17') + , ('DAMAGER', 'Edition', 'Nifty Gateway', 33, 'Ethereum', 'erc721', 0x3696Cd00618a08C8793208385aE526677C889D4A, 170000300001, 170000300033, '', 'https://opensea.io/collection/max-pain-and-frens-by-xcopy?search[query]=damager%20%2F33','2022-03-17') + , ('AFTERBURN (GREEN)', 'Edition', 'Nifty Gateway', 100, 'Ethereum', 'erc721', 0x42Df42A471e1Db2d4E4a1545B2F4b951f2dA06e4, 168000100001, 168000100100, '', 'https://opensea.io/collection/xcopy-editions?search[query]=afterburn%20%2F100','2022-03-17') + , ('''SPECIAL OPERATION''', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 33009, 33009, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/33009','2022-03-03') + , ('THE FUD', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 32171, 32171, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/32171','2022-02-01') + , ('GRIFTERS', 'Generative', 'Async Blueprints', 666, 'Ethereum', 'erc721', 0xc143bbfcdbdbed6d454803804752a064a622c1f3, 0, 665, '', 'https://opensea.io/collection/grifters-by-xcopy','2021-12-13') + , ('DECAY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 30801, 30801, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/30801','2021-11-30') + , ('RIP', 'Edition', 'Kolectiv', 10, 'Ethereum', 'erc721', 0x4764bc088a27f490353e8cf1558ba02fdc418c65, NULL, NULL, '', 'https://opensea.io/collection/kolectiv?search[stringTraits][0][name]=Artists&search[stringTraits][0][values][0]=XCOPY&search[stringTraits][1][name]=Art%20Piece&search[stringTraits][1][values][0]=RIP','2021-10-28') + , ('PUMP KING', 'Edition', 'Kolectiv', 25, 'Ethereum', 'erc721', 0x4764bc088a27f490353e8cf1558ba02fdc418c65, NULL, NULL, '', 'https://opensea.io/collection/kolectiv?search[stringTraits][0][name]=Artists&search[stringTraits][0][values][0]=XCOPY&search[stringTraits][1][name]=Art%20Piece&search[stringTraits][1][values][0]=PUMP%20KING','2021-10-28') + , ('BANGERS AND CRASH', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xABB3738f04Dc2Ec20f4AE4462c3d069d02AE045B, 3636000, 3636024, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=bangers','2021-10-26') + , ('DANKRUPT', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 29757, 29757, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/29757','2021-10-23') + , ('SUMMER.JPG', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 26722, 26722, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/26722','2021-08-01') + , ('THE DEATH OF CASH', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 25466, 25466, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/25466','2021-06-16') + , ('BEASTMODE', 'Edition', 'Kolectiv', 150, 'Ethereum', 'erc721', 0x4764bc088a27f490353e8cf1558ba02fdc418c65, NULL, NULL, '', 'https://opensea.io/collection/kolectiv?search[query]=beastmode&search[stringTraits][0][name]=Artists&search[stringTraits][0][values][0]=XCOPY','2021-06-14') + , ('NGMI', 'Unique', 'Sotheby’s', 1, 'Ethereum', 'erc721', 0xfd04E14334d876635E7eA46ae636D4a45D8ffDde, 0, 0, '', 'https://opensea.io/assets/ethereum/0xfd04E14334d876635E7eA46ae636D4a45D8ffDde/0','2021-05-28') + , ('SAINT_LESS (WAVES)', 'Edition', 'NFTBoxes', 200, 'Ethereum', 'erc721', 0x6d4530149e5B4483d2F7E60449C02570531A0751, NULL, NULL, 'SAINT_LESS', 'https://opensea.io/collection/series-1-april-2021?search[query]=waves&search[stringTraits][0][name]=artist%20name&search[stringTraits][0][values][0]=XCOPY','2021-04-28') + , ('SAINT_LESS (CONTROL)', 'Edition', 'NFTBoxes', 200, 'Ethereum', 'erc721', 0x6d4530149e5B4483d2F7E60449C02570531A0751, NULL, NULL, 'SAINT_LESS', 'https://opensea.io/collection/series-1-april-2021?search[query]=control&search[stringTraits][0][name]=artist%20name&search[stringTraits][0][values][0]=XCOPY','2021-04-28') + , ('SAINT_LESS (FIRE)', 'Edition', 'NFTBoxes', 200, 'Ethereum', 'erc721', 0x6d4530149e5B4483d2F7E60449C02570531A0751, NULL, NULL, 'SAINT_LESS', 'https://opensea.io/collection/series-1-april-2021?search[query]=fire&search[stringTraits][0][name]=artist%20name&search[stringTraits][0][values][0]=XCOPY','2021-04-28') + , ('GUZZLER (GREEN)', 'Edition', 'Nifty Gateway', 206, 'Ethereum', 'erc721', 0x8A939fd297FAb7388d6e6C634eEe3C863626bE57, 17600030001, 17600030206, '', 'https://opensea.io/collection/xcopy-editions?search[query]=guzzler%20%2F206','2021-03-24') + , ('TRAITORS', 'Edition', 'Nifty Gateway', 51, 'Ethereum', 'erc721', 0x8A939fd297FAb7388d6e6C634eEe3C863626bE57, 17600010001, 17600010051, '', 'https://opensea.io/collection/xcopy-editions?search[query]=traitors','2021-03-24') + , ('SIPHON', 'Edition', 'Nifty Gateway', 20, 'Ethereum', 'erc721', 0x905e7e152ecd7315f03d8d671578ea72684cca99, 33500010001, 33500010020, '', 'https://opensea.io/collection/xcopy-editions?search[query]=siphon','2021-03-24') + , ('AFTERBURN (RED)', 'Edition', 'Nifty Gateway', 870, 'Ethereum', 'erc721', 0x8a939fd297fab7388d6e6c634eee3c863626be57, 17600020001, 17600020870, '', 'https://opensea.io/collection/xcopy-editions?search[query]=afterburn%20%2F870','2021-03-24') + , ('PROOF OF WAR', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 21287, 21287, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/21287','2021-03-13') + , ('EXPERTS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 20551, 20551, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/20551','2021-03-03') + , ('THIS IS CLEARLY MONEY LAUNDERING', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 20407, 20407, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/20407','2021-03-01') + , ('NO FUTURE', 'Edition', 'KnownOrigin', 15, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 266101, 266115, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=no%20future','2021-01-13') + , ('THE_HORROR', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 18197, 18197, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/18197','2021-01-13') + , ('DO NOTHING', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 18069, 18069, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/18069','2021-01-10') + , ('DO NOTHING (NEW VARIANT)', 'Edition', 'KnownOrigin', 15, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 264601, 264615, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=do%20nothing','2021-01-10') + , ('BOTTOM FEEDER', 'Edition', 'Nifty Gateway', 38, 'Ethereum', 'erc721', 0xA8bD2de03228D1bb1686Fe813047f2a4C638723c, 3200010001, 3200010038, '', 'https://opensea.io/collection/xcopy-editions?search[query]=bottom%20feeder','2020-12-22') + , ('DISRUPTOR', 'Edition', 'Nifty Gateway', 10, 'Ethereum', 'erc721', 0x211899f45856E22Df75623A2C6ABe7997802ebC3, 17000010001, 17000010010, '', 'https://opensea.io/collection/xcopy-editions?search[query]=disruptor','2020-12-18') + , ('KNIFE CATCHER', 'Edition', 'Nifty Gateway', 10, 'Ethereum', 'erc721', 0x211899f45856E22Df75623A2C6ABe7997802ebC3, 17000020001, 17000020010, '', 'https://opensea.io/collection/xcopy-editions?search[query]=knife%20catcher','2020-12-18') + , ('YOUR TIME WON''T COME.', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 17234, 17234, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/17234','2020-12-14') + , ('CRYPTOARTLAND', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 16970, 16970, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/16970','2020-12-06') + , ('HAYDEN ADAMS', 'Unique', 'Nifty Gateway', 1, 'Ethereum', 'erc721', 0xc4560031bf20e5c930e77a61a4de9794db51e504, 13900010001, 13900010001, '', 'https://opensea.io/assets/ethereum/0xc4560031bf20e5c930e77a61a4de9794db51e504/13900010001','2020-12-04') + , ('BITCOIN PROTESTORS', 'Unique', 'Nifty Gateway', 1, 'Ethereum', 'erc721', 0xc4560031bf20e5c930e77a61a4de9794db51e504, 13900020001, 13900020001, '', 'https://opensea.io/assets/ethereum/0xc4560031bf20e5c930e77a61a4de9794db51e504/13900020001','2020-12-04') + , ('INSTABAGS', 'Edition', 'Rarible', 10, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 79409, 79409, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/79409','2020-11-16') + , ('THE DOOMED (BLACK & RED)', 'Edition', 'KnownOrigin', 15, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 220376, 220390, 'THE DOOMED', 'https://opensea.io/collection/xcopy-knownorigin?search[query]=black%20%26%20red&search[stringTraits][0][name]=Tag&search[stringTraits][0][values][0]=skull','2020-10-21') + , ('THE DOOMED (BLACK & GREEN)', 'Edition', 'KnownOrigin', 6, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 219726, 219731, 'THE DOOMED', 'https://opensea.io/collection/xcopy-knownorigin?search[query]=black%20%26%20green&search[stringTraits][0][name]=Tag&search[stringTraits][0][values][0]=skull','2020-10-21') + , ('THE DOOMED (RED)', 'Edition', 'KnownOrigin', 10, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 219176, 219185, 'THE DOOMED', 'https://opensea.io/collection/xcopy-knownorigin?search[query]=%28red%29&search[stringTraits][0][name]=Tag&search[stringTraits][0][values][0]=skull','2020-10-19') + , ('DUST', 'Edition', 'Rarible', 5, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 44940, 44940, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/44940','2020-10-14') + , ('THE FUCK YOU LOOKING AT?', 'Edition', 'Rarible', 10, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 43659, 43659, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/43659','2020-10-13') + , ('GHOULS', 'Edition', 'Rarible', 3, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 13775, 13775, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/13775','2020-09-20') + , ('BEASTS', 'Edition', 'Rarible', 10, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 9574, 9574, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/9574','2020-09-14') + , ('GOBBLE', 'Edition', 'Rarible', 15, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 9304, 9304, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/9304','2020-09-13') + , ('TOXIC BEAST', 'Edition', 'Rarible', 8, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 8797, 8797, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/8797','2020-09-12') + , ('THE BEAST', 'Edition', 'Rarible', 15, 'Ethereum', 'erc1155', 0xd07dc4262bcdbf85190c01c996b4c06a461d2430, 8129, 8129, '', 'https://opensea.io/assets/ethereum/0xd07dc4262bcdbf85190c01c996b4c06a461d2430/8129','2020-09-10') + , ('CRYPTOART DRAMA LEVEL (EXTREME)', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 13313, 13313, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/13313','2020-08-29') + , ('YOUR NEW FAVOURITE T-SHIRT ARRIVED', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 13283, 13283, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/13283','2020-08-28') + , ('FOREVER EYE-ROLLA', 'Unique', 'OpenSea', 1, 'Ethereum', 'erc721', 0x8d604ec183903dcd52a3af17dcc52bdf1cd5bc24, 3, 3, '', 'https://opensea.io/assets/ethereum/0x8d604ec183903dcd52a3af17dcc52bdf1cd5bc24/3','2020-08-25') + , ('EYE-ROLLA', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 203151, 203175, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=eye-rolla','2020-08-24') + , ('MORTAL', 'Edition', 'Nifty Gateway', 10, 'Ethereum', 'erc721', 0xd652d2633CDBfD5f27F50cdDb098e708fa8433f3, 4300010001, 4300010010, '', 'https://opensea.io/collection/xcopy-editions?search[query]=mortal','2020-08-18') + , ('DEATHLESS', 'Edition', 'Nifty Gateway', 20, 'Ethereum', 'erc721', 0xd652d2633CDBfD5f27F50cdDb098e708fa8433f3, 4300030001, 4300030020, '', 'https://opensea.io/collection/xcopy-editions?search[query]=deathless','2020-08-18') + , ('OVERLORD', 'Edition', 'Nifty Gateway', 20, 'Ethereum', 'erc721', 0xd652d2633CDBfD5f27F50cdDb098e708fa8433f3, 4300020001, 4300020020, '', 'https://opensea.io/collection/xcopy-editions?search[query]=overlord','2020-08-18') + , ('TERROR', 'Edition', 'KnownOrigin', 5, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 186476, 186480, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=terror','2020-06-24') + , ('FIVE EYES', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 11221, 11221, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/11221','2020-06-20') + , ('EVADER', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 11088, 11088, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/11088','2020-06-16') + , ('THE OTHER DEADNESS', 'Unique', 'OpenSea', 1, 'Ethereum', 'erc721', 0x8d604ec183903dcd52a3af17dcc52bdf1cd5bc24, 2, 2, '', 'https://opensea.io/assets/ethereum/0x8d604ec183903dcd52a3af17dcc52bdf1cd5bc24/2','2020-06-07') + , ('BROKEN', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 10720, 10720, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/10720','2020-06-04') + , ('HOPE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 10497, 10497, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/10497','2020-05-26') + , ('BACK TO SCHOOL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 10272, 10272, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/10272','2020-05-16') + , ('N', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 10093, 10093, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/10093','2020-05-09') + , ('XCOPY 00 - 15', 'On-Chain', 'PixelChain', 16, 'Ethereum', 'erc721', 0xbc0e164ee423b7800e355b012c06446e28b1a29d, NULL, NULL, '', 'https://opensea.io/collection/pixelchain?search[stringTraits][0][name]=Author&search[stringTraits][0][values][0]=XCOPY','2020-04-12') + , ('WFH_DEATH', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 9304, 9304, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/9304','2020-04-04') + , ('CITIZENS!', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 9129, 9129, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/9129','2020-03-28') + , ('BRITONS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 9038, 9038, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/9038','2020-03-25') + , ('PANIC STATIONS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 8803, 8803, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/8803','2020-03-15') + , ('ART HISTORY: VOLUMES I - X', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 8711, 8711, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/8711','2020-03-11') + , ('INFINITE BURN', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 8110, 8110, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/8110','2020-02-17') + , ('ONE LOVE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 7770, 7770, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/7770','2020-02-06') + , ('DATA_LORDS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 7533, 7533, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/7533','2020-01-30') + , ('E X P O S U R E', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 119326, 119350, '', 'https://opensea.io/collection/xcopy-knownorigin?search[stringTraits][0][name]=Tag&search[stringTraits][0][values][0]=exposure&search[sortAscending]=true&search[sortBy]=UNIT_PRICE','2020-01-20') + , ('BLOOD BUBBLE', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 115026, 115050, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=blood%20bubble','2020-01-12') + , ('BLOOD RUN', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 7009, 7009, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/7009','2020-01-11') + , ('THE RABBLE', 'Layer', 'Async Art', 44, 'Ethereum', 'erc721', 0xb6dAe651468E9593E4581705a09c10A76AC1e0c8, 432, 475, '', 'https://xcopy.art/works/the-rabble','2020-01-01') + , ('BANKSTA', 'Layer', 'Async Art', 8, 'Ethereum', 'erc721', 0x6c424C25e9F1ffF9642cB5B7750b0Db7312c29ad, 29, 36, '', 'https://xcopy.art/works/banksta','2020-01-01') + , ('DOOM PARTY', 'Layer', 'Async Art', 12, 'Ethereum', 'erc721', 0xb6dAe651468E9593E4581705a09c10A76AC1e0c8, 199, 210, '', 'https://xcopy.art/works/doom-party','2020-01-01') + , ('RESIST', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 109251, 109275, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=resist','2019-12-31') + , ('FOMO', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6708, 6708, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6708','2019-12-31') + , ('THE DAMAGE', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 108701, 108725, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=the%20damage','2019-12-30') + , ('D I S O R D E R', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6623, 6623, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6623','2019-12-29') + , ('BEST-CASE SCENARIO', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 108051, 108075, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=scenario','2019-12-28') + , ('THE BURNING', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6557, 6557, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6557','2019-12-27') + , ('NO FAVOUR (COLD)', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 107201, 107225, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=no%20favour','2019-12-26') + , ('O B E D I E N T', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6504, 6504, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6504','2019-12-25') + , ('THE DEADNESS', 'Edition', 'KnownOrigin', 25, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 105501, 105525, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=the%20deadness','2019-12-22') + , ('GODS OF TESCO METRO', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6396, 6396, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6396','2019-12-22') + , ('GOBSHITES', 'Edition', 'KnownOrigin', 20, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 104426, 104445, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=gobshites','2019-12-19') + , ('...BUT YOU CAN''T HANG IT ON YOUR WALL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6260, 6260, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6260','2019-12-18') + , ('A SEA OF MOTHERFUCKERS ON PLATFORM 24', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6186, 6186, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6186','2019-12-16') + , ('TRUTH OR POWER', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6141, 6141, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6141','2019-12-15') + , ('WEWORK BOI', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6100, 6100, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6100','2019-12-14') + , ('10TH FLOOR ETHICS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 6110, 6110, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/6110','2019-12-14') + , ('THE APPROPRIATE LOSS OF CONTROL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5882, 5882, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5882','2019-12-07') + , ('IN THE HOLE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5529, 5529, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5529','2019-11-23') + , ('HATEHOLE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5409, 5409, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5409','2019-11-20') + , ('HELLO ADMIN DM ME', 'Edition', 'KnownOrigin', 20, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 88501, 88520, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=HELLO%20ADMIN%20DM%20ME','2019-11-09') + , ('LA_H-U-M-A-N', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5143, 5143, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5143','2019-11-08') + , ('PTERON', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5114, 5114, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5114','2019-11-06') + , ('BAD CODE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5057, 5057, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5057','2019-11-02') + , ('PUPPY THERAPY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5041, 5041, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5041','2019-10-31') + , ('KING CRICKET SOUP', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 5009, 5009, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/5009','2019-10-28') + , ('SPLASH', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 4963, 4963, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/4963','2019-10-23') + , ('RUBBLE', 'Edition', 'KnownOrigin', 5, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 82301, 82305, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=rubble','2019-10-22') + , ('T H I N K', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 4917, 4917, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/4917','2019-10-17') + , ('RIGHT-CLICK AND SAVE AS GIRL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 4889, 4889, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/4889','2019-10-13') + , ('VIPER', 'Unique', 'OpenSea', 1, 'Ethereum', 'erc721', 0x8d604ec183903dcd52a3af17dcc52bdf1cd5bc24, 1, 1, '', 'https://opensea.io/assets/ethereum/0x8d604ec183903dcd52a3af17dcc52bdf1cd5bc24/1','2019-10-12') + , ('H-U-M-A-N', 'Edition', 'KnownOrigin', 15, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 80401, 80415, '', 'https://opensea.io/collection/xcopy-knownorigin?search[query]=h-u-m-a-n','2019-10-02') + , ('NO FAVOUR', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 4584, 4584, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/4584','2019-09-15') + , ('MR. ELEVATOR', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0, 4576, 4576, '', 'https://superrare.com/artwork/eth/0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0/4576','2019-09-14') + , ('MORTAL_', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 4386, 4386, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/4386','2019-09-01') + , ('THE STATE OF US (BLUE)', 'Edition', 'KnownOrigin', 20, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 74751, 74770, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=state%20of%20us','2019-08-30') + , ('YOU CAN''T BREATHE MONEY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 4371, 4371, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/4371','2019-08-30') + , ('SKIN, BONE, BLOOD', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 4295, 4295, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/4295','2019-08-24') + , ('LET THE BAD TIMES ROLL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 4057, 4057, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/4057','2019-08-07') + , ('OVERWHELM', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3999, 3999, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3999','2019-08-02') + , ('TRIGGER_OPTICS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3928, 3928, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3928','2019-07-25') + , ('T-R-E-N-D-E-R', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3767, 3767, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3767','2019-07-01') + , ('BAD FLAVOUR', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3722, 3722, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3722','2019-06-25') + , ('ECHOES OF A DEAD EARTH (BLUE)', 'Edition', 'KnownOrigin', 10, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 65401, 65410, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=echoes','2019-06-15') + , ('YOU''RE WASTING YOUR LIFE. LITERALLY.', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3566, 3566, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3566','2019-06-13') + , ('FEELS OFF-BRAND', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3548, 3548, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3548','2019-06-12') + , ('US AND THEM', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3370, 3370, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3370','2019-05-28') + , ('0', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3177, 3177, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3177','2019-05-14') + , ('DISCONNECT', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3144, 3144, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3144','2019-05-12') + , ('THE DOOMED (MONO)', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 3068, 3068, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/3068','2019-05-03') + , ('TAXMEN', 'Edition', 'KnownOrigin', 20, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 54201, 54220, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=taxmen','2019-04-29') + , ('TAXMAN', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2682, 2682, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2682','2019-04-02') + , ('THE USELESS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2460, 2460, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2460','2019-03-19') + , ('GOBSHITE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2423, 2423, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2423','2019-03-17') + , ('ORB', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2369, 2369, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2369','2019-03-15') + , ('THE STATE OF US', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2273, 2273, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2273','2019-03-10') + , ('DOOM', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2240, 2240, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2240','2019-03-08') + , ('FLESHTRAP', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2220, 2220, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2220','2019-03-07') + , ('DEATH BY ALGORITHM', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2172, 2172, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2172','2019-03-04') + , ('HAPPY CONSUME V2', 'Edition', 'RadiCards', 27, 'Ethereum', 'erc721', 0x580a29fa60b86aaff102743de5cba60bb5f9de75, NULL, NULL, 'HAPPY CONSUME', 'https://opensea.io/collection/radicards-v2?search[stringTraits][0][name]=artist&search[stringTraits][0][values][0]=XCOPY&search[sortAscending]=true&search[sortBy]=UNIT_PRICE','2019-02-03') + , ('HAPPY CONSUME V1', 'Edition', 'RadiCards', 7, 'Ethereum', 'erc721', 0xa29939f74c3e527c83011fab972b09ac68e71a47, NULL, NULL, 'HAPPY CONSUME', 'https://opensea.io/collection/radicards?search[stringTraits][0][name]=artist&search[stringTraits][0][values][0]=XCOPY','2018-12-20') + , ('SOME OTHER ASSHOLE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2123, 2123, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2123','2019-02-28') + , ('DON''T PANIC', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2076, 2076, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2076','2019-02-24') + , ('SPACE JUNKIE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2058, 2058, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2058','2019-02-23') + , ('UTOPIA', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2044, 2044, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2044','2019-02-21') + , ('DEATHWAVE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 2034, 2034, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/2034','2019-02-20') + , ('YOU COULD SERIOUSLY BE A MODEL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1985, 1985, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1985','2019-02-16') + , ('WHEN AIRDROP?', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1971, 1971, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1971','2019-02-15') + , ('AFTERGLOW', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1936, 1936, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1936','2019-02-11') + , ('HOUSE OF FOMO', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1906, 1906, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1906','2019-02-09') + , ('INFLUENCER', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1893, 1893, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1893','2019-02-08') + , ('FEEL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1842, 1842, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1842','2019-02-05') + , ('NULLWAVE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1825, 1825, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1825','2019-02-03') + , ('BREAKER', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1763, 1763, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1763','2019-01-29') + , ('NULL STARTED FOLLOWING YOU', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1747, 1747, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1747','2019-01-28') + , ('HELLO ADMIN PM ME', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1684, 1684, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1684','2019-01-24') + , ('$LAVE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1597, 1597, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1597','2019-01-18') + , ('LAST SELFIE', 'Edition', 'KnownOrigin', 10, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 30101, 30110, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=last%20selfie','2019-01-17') + , ('NULL LIKED YOUR POST', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1498, 1498, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1498','2019-01-14') + , ('BORN TO BUY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1340, 1340, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1340','2018-12-31') + , ('LURK', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1336, 1336, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1336','2018-12-30') + , ('THE JUNGLE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1329, 1329, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1329','2018-12-29') + , ('LAST HUMAN POLICE 2039', 'Edition', 'Digital Objects', 20, 'Ethereum', 'erc721', 0x6f9b9f2c75125079c029f6aecde745e09cf06f5a, NULL, NULL, 'DOA', 'https://opensea.io/collection/digital-objects-artwork?search[query]=Last%20Human%20Police%202039','2018-12-19') + , ('CHATBOT AND CHILL?', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1237, 1237, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1237','2018-12-13') + , ('REMNANT', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1198, 1198, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1198','2018-12-09') + , ('CRUNCH', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1180, 1180, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1180','2018-12-08') + , ('RIGHT-CLICK AND SAVE AS GUY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1154, 1154, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1154','2018-12-06') + , ('THE GOOD MEN WHO DO NOTHING', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1100, 1100, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1100','2018-11-30') + , ('MAN WITH NEW IPHONE ON THE HAMMERSMITH & CITY LINE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1077, 1077, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1077','2018-11-28') + , ('LIES (3)', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1057, 1057, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1057','2018-11-25') + , ('LIES (2)', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1056, 1056, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1056','2018-11-25') + , ('LIES (1)', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1055, 1055, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1055','2018-11-25') + , ('DISINTEGRATION', 'Edition', 'KnownOrigin', 50, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 27901, 27950, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=disintegration','2018-11-23') + , ('DEAD CAT BOUNCE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1032, 1032, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1032','2018-11-22') + , ('LOCKUP', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 1022, 1022, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/1022','2018-11-20') + , ('REKT GUTS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 990, 990, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/990','2018-11-17') + , ('AND HOW DOES THAT MAKE YOU FEEL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 991, 991, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/991','2018-11-17') + , ('GENERATION NULL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 992, 992, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/992','2018-11-17') + , ('DISTORTION THERAPY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 982, 982, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/982','2018-11-16') + , ('TAP YOUR CARD WHEN YOU''RE READY SIR', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 971, 971, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/971','2018-11-15') + , ('ALIGHT HERE FOR DYSTOPIA', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 951, 951, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/951','2018-11-13') + , ('JOBSWORTH 2029', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 928, 928, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/928','2018-11-10') + , ('THE DOOMED', 'Edition', 'KnownOrigin', 100, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 22001, 22100, 'THE DOOMED', 'https://opensea.io/collection/xcopy-knownorigin?search[stringTraits][0][name]=Tag&search[stringTraits][0][values][0]=skull&search[sortAscending]=true&search[sortBy]=UNIT_PRICE','2018-10-21') + , ('WANT_2', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 752, 752, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/752','2018-10-04') + , ('WANT_3', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 753, 753, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/753','2018-10-04') + , ('WANT_1', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 751, 751, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/751','2018-10-04') + , ('NEW TEETH 2033', 'Edition', 'Digital Objects', 30, 'Ethereum', 'erc721', 0x6f9b9f2c75125079c029f6aecde745e09cf06f5a, NULL, NULL, 'DOA', 'https://opensea.io/collection/digital-objects-artwork?search[query]=new%20teeth%202033','2018-09-15') + , ('HACKPROOF 2049', 'Edition', 'Digital Objects', 20, 'Ethereum', 'erc721', 0x6f9b9f2c75125079c029f6aecde745e09cf06f5a, NULL, NULL, 'DOA', 'https://opensea.io/collection/digital-objects-artwork?search[query]=HACKPROOF%202049','2018-09-07') + , ('DON''T SCROLL', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 642, 642, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/642','2018-08-27') + , ('ONE SQUEEZE IS ENOUGH FOR A SINK FULL OF DISHES', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 643, 643, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/643','2018-08-27') + , ('DISASTER SUIT', 'Edition', 'RARE Art Labs', 4, 'Ethereum', 'erc20', 0x648fb2945d5ea875366dbe685ca6c98b20f31319, NULL, NULL, '', 'https://etherscan.io/token/0x648fb2945d5ea875366dbe685ca6c98b20f31319#balances','2018-07-31') + , ('DIRTBAG', 'Edition', 'RARE Art Labs', 5, 'Ethereum', 'erc20', 0xf3aaa7e626a08319dc66804a753005ac19b3a70a, NULL, NULL, '', 'https://etherscan.io/token/0xf3aaa7e626a08319dc66804a753005ac19b3a70a#balances','2018-07-26') + , ('LOADING NEW CONFLICT...', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 506, 506, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/506','2018-07-24') + , ('LOADING NEW CONFLICT... REDUX 4', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 510, 510, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/510','2018-07-24') + , ('LOADING NEW CONFLICT... REDUX 1', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 507, 507, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/507','2018-07-24') + , ('LOADING NEW CONFLICT... REDUX 2', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 508, 508, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/508','2018-07-24') + , ('LOADING NEW CONFLICT... REDUX 5', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 511, 511, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/511','2018-07-24') + , ('LOADING NEW CONFLICT... REDUX 6', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 512, 512, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/512','2018-07-24') + , ('LOADING NEW CONFLICT... REDUX 3', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 509, 509, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/509','2018-07-24') + , ('F IS FOR FUCKUP', 'Edition', 'RARE Art Labs', 4, 'Ethereum', 'erc20', 0x1601549afbff70b0072d9f09479a7f22bc4ec6ce, NULL, NULL, '', 'https://etherscan.io/token/0x1601549afbff70b0072d9f09479a7f22bc4ec6ce#balances','2018-06-27') + , ('CRACKED', 'Edition', 'RARE Art Labs', 6, 'Ethereum', 'erc20', 0x4ac03cc252c74de4518108754c00dcfde9f874dd, NULL, NULL, '', 'https://etherscan.io/token/0x4ac03cc252c74de4518108754c00dcfde9f874dd#balances','2018-06-27') + , ('DEATH WANNABE', 'Edition', 'RARE Art Labs', 4, 'Ethereum', 'erc20', 0xf7cde84938b9bcbc5783cac37270b6d5bc5fabdc, NULL, NULL, '', 'https://etherscan.io/token/0xf7cde84938b9bcbc5783cac37270b6d5bc5fabdc#balances','2018-06-26') + , ('DEPARTED', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 150, 150, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/150','2018-06-07') + , ('NEVER', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 147, 147, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/147','2018-06-06') + , ('NOT SO FUNGIBLE OFFERING', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 124, 124, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/124','2018-05-26') + , ('TWO HUMANS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 110, 110, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/110','2018-05-19') + , ('DISSOLUTION', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 108, 108, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/108','2018-05-17') + , ('VAPING WON''T SAVE YOU', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 8, 8, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/8','2018-04-08') + , ('POST DEBT', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 16, 16, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/16','2018-04-08') + , ('FEEDING', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 6, 6, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/6','2018-04-08') + , ('CHART RIOT', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 15, 15, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/15','2018-04-08') + , ('DEATH DIP', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 14, 14, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/14','2018-04-08') + , ('ANXIETY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 13, 13, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/13','2018-04-08') + , ('REFLECTION', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 12, 12, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/12','2018-04-08') + , ('ALL TIME HIGH IN THE CITY', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 11, 11, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/11','2018-04-08') + , ('A COIN FOR THE FERRYMAN', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 10, 10, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/10','2018-04-08') + , ('GREEDY GUTS', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 9, 9, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/9','2018-04-08') + , ('SOME ASSHOLE', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 7, 7, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/7','2018-04-08') + , ('ECHOES OF A DEAD EARTH', 'Unique', 'SuperRare', 1, 'Ethereum', 'erc721', 0x41a322b28d0ff354040e2cbc676f0320d8c8850d, 5, 5, '', 'https://superrare.com/artwork/eth/0x41a322b28d0ff354040e2cbc676f0320d8c8850d/5','2018-04-07') + , ('$LAVE (Edition)', 'Edition', 'KnownOrigin', 5, 'Ethereum', 'erc721', 0xFBeef911Dc5821886e1dda71586d90eD28174B7d, 70101, 70105, '', 'https://opensea.io/collection/xcopy-knownorigin?search[collections][0]=xcopy-knownorigin&search[query]=%24lave','2019-08-08') +) as temp_table (title, art_type, platform, edition_count, blockchain, token_standard, contract_address, min_token_id, max_token_id, category, link, mint_date) +) a \ No newline at end of file diff --git a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_full_list.sql b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_full_list.sql new file mode 100644 index 00000000000..a1ae00bd3bf --- /dev/null +++ b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_full_list.sql @@ -0,0 +1,25 @@ +{{ config( + tags = ['static'] + ,schema = 'nft_ethereum_metadata' + ,alias = 'xcopy_full_list' + ,materialized = 'table' + ) +}} + +select a.title + , a.art_type + , platform + , edition_count + , blockchain + , token_standard + , contract_address + , min_token_id + , max_token_id + , nonsequential_token_id + , clean_token_id + , category + , link + , mint_date_date_format +from {{ ref('nft_ethereum_metadata_xcopy_collections') }} a +full outer join {{ ref('nft_ethereum_metadata_xcopy_nonsequential_tokens') }} b +on a.title = b.title and a.art_type = b.art_type \ No newline at end of file diff --git a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_nonsequential_tokens.sql b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_nonsequential_tokens.sql new file mode 100644 index 00000000000..3cc350d2ad2 --- /dev/null +++ b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_xcopy_nonsequential_tokens.sql @@ -0,0 +1,871 @@ +{{ config( + tags = ['static'] + ,schema = 'nft_ethereum_metadata' + ,alias = 'xcopy_nonsequential_tokens' + ,materialized = 'table' + ,post_hook='{{ expose_spells(blockchains = \'["ethereum"]\', + spell_type = "sector", + spell_name = "nft_ethereum_metadata", + contributors = \'["cat"]\') }}' + ) +}} + +select title, art_type, nonsequential_token_id, clean_token_id +from (VALUES + ('RIP','Edition','252264280693941333345366803702820938089','1') + ,('RIP','Edition','214880632600303657076191225046770561119','2') + ,('RIP','Edition','296102166960570169077318684867552524940','3') + ,('RIP','Edition','21332812927098253635079730802479329217','4') + ,('RIP','Edition','226055192786530751889226314318558936073','5') + ,('RIP','Edition','175009717137871034414111420750683314117','6') + ,('RIP','Edition','32961679442187591330574904633163320169','7') + ,('RIP','Edition','176318058505532878374309779331213187030','8') + ,('RIP','Edition','311642605889318514893691170985061739408','9') + ,('PUMP KING','Edition','88331063584758877166564057112564958829','1') + ,('PUMP KING','Edition','139529417961217481603208910702244291038','2') + ,('PUMP KING','Edition','244969585820676034341309330377683551590','3') + ,('PUMP KING','Edition','327792097426363702653495587232111475928','4') + ,('PUMP KING','Edition','104440182641744439184522316430731820854','5') + ,('PUMP KING','Edition','45970350647121304994753490750978586122','6') + ,('PUMP KING','Edition','278227066180341048220711793697054165204','7') + ,('PUMP KING','Edition','129999074442180253254086361011954589174','8') + ,('PUMP KING','Edition','315152929021352556211942328523092435406','9') + ,('PUMP KING','Edition','48817527207105082573197374621519094215','10') + ,('PUMP KING','Edition','81397273150932250706341853930652791852','11') + ,('PUMP KING','Edition','283978650214208866305309417836958994231','12') + ,('PUMP KING','Edition','160145498453075919651335157100565229160','13') + ,('PUMP KING','Edition','28799083937101008559941301725996573602','14') + ,('PUMP KING','Edition','21625995195017358824578458155041860836','15') + ,('PUMP KING','Edition','277670785464486496542751103300506653842','16') + ,('PUMP KING','Edition','17353159195654029163649758795957590552','17') + ,('PUMP KING','Edition','96662790055641564826797430999805837748','18') + ,('PUMP KING','Edition','184638508106580331141234062705073158661','19') + ,('PUMP KING','Edition','3331127962977557101199400311788990877','20') + ,('PUMP KING','Edition','41396983396306470802203342437515495567','21') + ,('PUMP KING','Edition','67768646616837447945147360744243157371','22') + ,('PUMP KING','Edition','23382927273593857309565017840119944800','23') + ,('BEASTMODE','Edition','266715396197602482315318935136057559534','1') + ,('BEASTMODE','Edition','82286464012503494149287593875507813086','2') + ,('BEASTMODE','Edition','241049653987385934167900837632443755967','3') + ,('BEASTMODE','Edition','29784821647533316779353435470424894892','4') + ,('BEASTMODE','Edition','333351959649378743948321648623369829849','5') + ,('BEASTMODE','Edition','2889214226296994778127445411569449451','6') + ,('BEASTMODE','Edition','124890482598990580409094581902449982347','7') + ,('BEASTMODE','Edition','54024719195518490637900606135881532824','8') + ,('BEASTMODE','Edition','40869322719738028117845350002720031653','9') + ,('BEASTMODE','Edition','160598414537052620826927155391696921061','10') + ,('BEASTMODE','Edition','4054372539874140766848381638464323030','11') + ,('BEASTMODE','Edition','229574853402569258779594293905148757','12') + ,('BEASTMODE','Edition','212318462847578549156584983986947504133','13') + ,('BEASTMODE','Edition','137541837980024930434186018066284310221','14') + ,('BEASTMODE','Edition','335396910855279488354867387012071850078','15') + ,('BEASTMODE','Edition','24170325354119207578390591359099112293','16') + ,('BEASTMODE','Edition','216676174816235142623198725288595283728','17') + ,('BEASTMODE','Edition','317218063788857135528843947449920766021','18') + ,('BEASTMODE','Edition','253382811934490310793207063248670760338','19') + ,('BEASTMODE','Edition','98285944004391695680974025092277747006','20') + ,('BEASTMODE','Edition','116144003067771891732893517711960955968','21') + ,('BEASTMODE','Edition','320983337223610636548897965766640838736','22') + ,('BEASTMODE','Edition','316499034547539142228145407653213698686','23') + ,('BEASTMODE','Edition','304684151601233986844424440236448375860','24') + ,('BEASTMODE','Edition','71795025706149736389781459976171496630','25') + ,('BEASTMODE','Edition','81941828717923545277517020409249174176','26') + ,('BEASTMODE','Edition','188117503457288561280114749892341784550','27') + ,('BEASTMODE','Edition','233946919886370783277799923247632826210','28') + ,('BEASTMODE','Edition','253783699963457181547873712935402264925','29') + ,('BEASTMODE','Edition','99099736626100204336780857421956319670','30') + ,('BEASTMODE','Edition','169397724952845809606348219461242219296','31') + ,('BEASTMODE','Edition','335518740499401538265898966208096889186','32') + ,('BEASTMODE','Edition','233201212463948003937058150939281065035','33') + ,('BEASTMODE','Edition','270867006287707040225801688498988415732','34') + ,('BEASTMODE','Edition','3176665067532424178202872554225795089','35') + ,('BEASTMODE','Edition','169886768211628701319949341433328515052','36') + ,('BEASTMODE','Edition','315339877777231525588717431812147653444','37') + ,('BEASTMODE','Edition','67469023212723736497945231247892101178','38') + ,('BEASTMODE','Edition','205131026994428836131382306453982984613','39') + ,('BEASTMODE','Edition','201802898291669243527258290842791432393','40') + ,('BEASTMODE','Edition','132789554661189220654384874431061068836','41') + ,('BEASTMODE','Edition','20352467449907756431350333103896457197','42') + ,('BEASTMODE','Edition','26907330535619235958373803505333674900','43') + ,('BEASTMODE','Edition','54471969754007925219506732113144922014','44') + ,('BEASTMODE','Edition','167031896783237259300898052294271575901','45') + ,('BEASTMODE','Edition','97079089178784854754812777026315644285','46') + ,('BEASTMODE','Edition','115435301807783892231990626604479415930','47') + ,('BEASTMODE','Edition','94450957618024140198953231428805749466','48') + ,('BEASTMODE','Edition','81582876578721918917547675600904011175','49') + ,('BEASTMODE','Edition','77716934145628458203178182747624707252','50') + ,('BEASTMODE','Edition','191112128362738968076312583494389134996','51') + ,('BEASTMODE','Edition','1077703223329744370502735921011256885','52') + ,('BEASTMODE','Edition','254500933276614568698695029525803826514','53') + ,('BEASTMODE','Edition','122077628425304511934089945488742255352','54') + ,('BEASTMODE','Edition','282995275446544278572125601335177693628','55') + ,('BEASTMODE','Edition','162965410353662767737115035108246639687','56') + ,('BEASTMODE','Edition','39580183309875896518942963824805917535','57') + ,('BEASTMODE','Edition','210830955545826935247472082115435336841','58') + ,('BEASTMODE','Edition','338353553261662314585355946608172775647','59') + ,('BEASTMODE','Edition','14755600450057516993873450814162200674','60') + ,('BEASTMODE','Edition','108332626030592166003317758994671751906','61') + ,('BEASTMODE','Edition','124844620299659242829264669601181904719','62') + ,('BEASTMODE','Edition','311579119796449496735133110628982316550','63') + ,('BEASTMODE','Edition','241819250705449977429439457650005998633','64') + ,('BEASTMODE','Edition','111527486617850606949090084034487862768','65') + ,('BEASTMODE','Edition','268476969803832976864459672348078867328','66') + ,('BEASTMODE','Edition','1461371291560311384303616727164531766','67') + ,('BEASTMODE','Edition','303434323476029068660599749324412761119','68') + ,('BEASTMODE','Edition','7528334072359656644075716991060313469','69') + ,('BEASTMODE','Edition','299221344511346696989367012736589095621','70') + ,('BEASTMODE','Edition','105190775943169534413122086424240328989','71') + ,('BEASTMODE','Edition','301198230809297955733738831019925085081','72') + ,('BEASTMODE','Edition','159406383054928441140507057472373638374','73') + ,('BEASTMODE','Edition','210160296792030989095053506910248080811','74') + ,('BEASTMODE','Edition','154783218080539221869652402172865773127','75') + ,('BEASTMODE','Edition','291210490858397731000233137956602544977','76') + ,('BEASTMODE','Edition','143516174294248179129086471384080235795','77') + ,('BEASTMODE','Edition','305463829528911091340426642037371348716','78') + ,('BEASTMODE','Edition','312250897823112770498306508266631863342','79') + ,('BEASTMODE','Edition','54363091254596540564281375310432933565','80') + ,('BEASTMODE','Edition','178876665553802370657950300401605044165','81') + ,('BEASTMODE','Edition','63731519574394976116127154406508925313','82') + ,('BEASTMODE','Edition','237093856908898187420704234215910245502','83') + ,('BEASTMODE','Edition','134296052141670447280948725081716474734','84') + ,('BEASTMODE','Edition','103364854576714419381180987512755086443','85') + ,('BEASTMODE','Edition','134779691363837663778019408946466177877','86') + ,('BEASTMODE','Edition','305086143656350838369367136865671249496','87') + ,('BEASTMODE','Edition','199492258708530473779786856437184961371','88') + ,('BEASTMODE','Edition','101577269911957586831590036541236735388','89') + ,('BEASTMODE','Edition','170371780190804271992028797695025743034','90') + ,('BEASTMODE','Edition','110924071018051395820509559428587796199','91') + ,('BEASTMODE','Edition','24706190067222065322305779040821209221','92') + ,('BEASTMODE','Edition','279723703405600780413881452709119822967','93') + ,('BEASTMODE','Edition','267750321734620064533844024426702617271','94') + ,('BEASTMODE','Edition','300568812464251062721190663797269153774','95') + ,('BEASTMODE','Edition','151132785520794642514197734956716966950','96') + ,('BEASTMODE','Edition','301609901844194392876329773090208231310','97') + ,('BEASTMODE','Edition','65139961217635596980149564377583297764','98') + ,('BEASTMODE','Edition','135260774535189848547014483277513767425','99') + ,('BEASTMODE','Edition','131218840578329014017393929184820677177','100') + ,('BEASTMODE','Edition','113441420861612270171829423225331237415','101') + ,('BEASTMODE','Edition','44652766275747871436878482223130716326','102') + ,('BEASTMODE','Edition','296011901599247733908029641966004118955','103') + ,('BEASTMODE','Edition','10907671383810233273751295063874809215','104') + ,('BEASTMODE','Edition','286017869951737329727411798117364415138','105') + ,('BEASTMODE','Edition','150070020168876227291183986968780598644','106') + ,('BEASTMODE','Edition','28290662096005180946464705458620184755','107') + ,('XCOPY 00 - 15','On-Chain','695','0') + ,('XCOPY 00 - 15','On-Chain','698','1') + ,('XCOPY 00 - 15','On-Chain','817','2') + ,('XCOPY 00 - 15','On-Chain','904','3') + ,('XCOPY 00 - 15','On-Chain','1556','4') + ,('XCOPY 00 - 15','On-Chain','2595','5') + ,('XCOPY 00 - 15','On-Chain','2594','6') + ,('XCOPY 00 - 15','On-Chain','2598','7') + ,('XCOPY 00 - 15','On-Chain','2699','8') + ,('XCOPY 00 - 15','On-Chain','2700','9') + ,('XCOPY 00 - 15','On-Chain','2703','10') + ,('XCOPY 00 - 15','On-Chain','2705','11') + ,('XCOPY 00 - 15','On-Chain','2707','12') + ,('XCOPY 00 - 15','On-Chain','2731','13') + ,('XCOPY 00 - 15','On-Chain','2732','14') + ,('XCOPY 00 - 15','On-Chain','2733','15') + ,('HAPPY CONSUME V1','Edition','105','7') + ,('HAPPY CONSUME V1','Edition','44','4') + ,('HAPPY CONSUME V1','Edition','100','6') + ,('HAPPY CONSUME V1','Edition','25','2') + ,('HAPPY CONSUME V1','Edition','26','3') + ,('HAPPY CONSUME V1','Edition','10','1') + ,('HAPPY CONSUME V1','Edition','33','5') + ,('HAPPY CONSUME V2','Edition','331','27') + ,('HAPPY CONSUME V2','Edition','330','26') + ,('HAPPY CONSUME V2','Edition','329','25') + ,('HAPPY CONSUME V2','Edition','328','24') + ,('HAPPY CONSUME V2','Edition','327','23') + ,('HAPPY CONSUME V2','Edition','326','22') + ,('HAPPY CONSUME V2','Edition','325','21') + ,('HAPPY CONSUME V2','Edition','324','20') + ,('HAPPY CONSUME V2','Edition','323','19') + ,('HAPPY CONSUME V2','Edition','322','18') + ,('HAPPY CONSUME V2','Edition','321','17') + ,('HAPPY CONSUME V2','Edition','320','16') + ,('HAPPY CONSUME V2','Edition','319','15') + ,('HAPPY CONSUME V2','Edition','318','14') + ,('HAPPY CONSUME V2','Edition','317','13') + ,('HAPPY CONSUME V2','Edition','316','12') + ,('HAPPY CONSUME V2','Edition','315','11') + ,('HAPPY CONSUME V2','Edition','314','10') + ,('HAPPY CONSUME V2','Edition','313','9') + ,('HAPPY CONSUME V2','Edition','312','8') + ,('HAPPY CONSUME V2','Edition','311','7') + ,('HAPPY CONSUME V2','Edition','310','6') + ,('HAPPY CONSUME V2','Edition','309','5') + ,('HAPPY CONSUME V2','Edition','157','4') + ,('HAPPY CONSUME V2','Edition','34','3') + ,('HAPPY CONSUME V2','Edition','27','2') + ,('HAPPY CONSUME V2','Edition','6','1') + ,('SAINT_LESS (WAVES)','Edition','17501','1') + ,('SAINT_LESS (WAVES)','Edition','17509','2') + ,('SAINT_LESS (WAVES)','Edition','17517','3') + ,('SAINT_LESS (WAVES)','Edition','17525','4') + ,('SAINT_LESS (WAVES)','Edition','17533','5') + ,('SAINT_LESS (WAVES)','Edition','17541','6') + ,('SAINT_LESS (WAVES)','Edition','17549','7') + ,('SAINT_LESS (WAVES)','Edition','17557','8') + ,('SAINT_LESS (WAVES)','Edition','17565','9') + ,('SAINT_LESS (WAVES)','Edition','17573','10') + ,('SAINT_LESS (WAVES)','Edition','17581','11') + ,('SAINT_LESS (WAVES)','Edition','17589','12') + ,('SAINT_LESS (WAVES)','Edition','17597','13') + ,('SAINT_LESS (WAVES)','Edition','17605','14') + ,('SAINT_LESS (WAVES)','Edition','17613','15') + ,('SAINT_LESS (WAVES)','Edition','17621','16') + ,('SAINT_LESS (WAVES)','Edition','17629','17') + ,('SAINT_LESS (WAVES)','Edition','17637','18') + ,('SAINT_LESS (WAVES)','Edition','17645','19') + ,('SAINT_LESS (WAVES)','Edition','17653','20') + ,('SAINT_LESS (WAVES)','Edition','17661','21') + ,('SAINT_LESS (WAVES)','Edition','17669','22') + ,('SAINT_LESS (WAVES)','Edition','17677','23') + ,('SAINT_LESS (WAVES)','Edition','17685','24') + ,('SAINT_LESS (WAVES)','Edition','17693','25') + ,('SAINT_LESS (WAVES)','Edition','17701','26') + ,('SAINT_LESS (WAVES)','Edition','17709','27') + ,('SAINT_LESS (WAVES)','Edition','17717','28') + ,('SAINT_LESS (WAVES)','Edition','17725','29') + ,('SAINT_LESS (WAVES)','Edition','17733','30') + ,('SAINT_LESS (WAVES)','Edition','17741','31') + ,('SAINT_LESS (WAVES)','Edition','17749','32') + ,('SAINT_LESS (WAVES)','Edition','17757','33') + ,('SAINT_LESS (WAVES)','Edition','17765','34') + ,('SAINT_LESS (WAVES)','Edition','17773','35') + ,('SAINT_LESS (WAVES)','Edition','17781','36') + ,('SAINT_LESS (WAVES)','Edition','17789','37') + ,('SAINT_LESS (WAVES)','Edition','17797','38') + ,('SAINT_LESS (WAVES)','Edition','17805','39') + ,('SAINT_LESS (WAVES)','Edition','17813','40') + ,('SAINT_LESS (WAVES)','Edition','17821','41') + ,('SAINT_LESS (WAVES)','Edition','17829','42') + ,('SAINT_LESS (WAVES)','Edition','17837','43') + ,('SAINT_LESS (WAVES)','Edition','17845','44') + ,('SAINT_LESS (WAVES)','Edition','17853','45') + ,('SAINT_LESS (WAVES)','Edition','17861','46') + ,('SAINT_LESS (WAVES)','Edition','17869','47') + ,('SAINT_LESS (WAVES)','Edition','17877','48') + ,('SAINT_LESS (WAVES)','Edition','17885','49') + ,('SAINT_LESS (WAVES)','Edition','17893','50') + ,('SAINT_LESS (WAVES)','Edition','17901','51') + ,('SAINT_LESS (WAVES)','Edition','17909','52') + ,('SAINT_LESS (WAVES)','Edition','17917','53') + ,('SAINT_LESS (WAVES)','Edition','17925','54') + ,('SAINT_LESS (WAVES)','Edition','17933','55') + ,('SAINT_LESS (WAVES)','Edition','17941','56') + ,('SAINT_LESS (WAVES)','Edition','17949','57') + ,('SAINT_LESS (WAVES)','Edition','17957','58') + ,('SAINT_LESS (WAVES)','Edition','17965','59') + ,('SAINT_LESS (WAVES)','Edition','17973','60') + ,('SAINT_LESS (WAVES)','Edition','17981','61') + ,('SAINT_LESS (WAVES)','Edition','17989','62') + ,('SAINT_LESS (WAVES)','Edition','17997','63') + ,('SAINT_LESS (WAVES)','Edition','18005','64') + ,('SAINT_LESS (WAVES)','Edition','18013','65') + ,('SAINT_LESS (WAVES)','Edition','18021','66') + ,('SAINT_LESS (WAVES)','Edition','18029','67') + ,('SAINT_LESS (WAVES)','Edition','18037','68') + ,('SAINT_LESS (WAVES)','Edition','18045','69') + ,('SAINT_LESS (WAVES)','Edition','18053','70') + ,('SAINT_LESS (WAVES)','Edition','18061','71') + ,('SAINT_LESS (WAVES)','Edition','18069','72') + ,('SAINT_LESS (WAVES)','Edition','18077','73') + ,('SAINT_LESS (WAVES)','Edition','18085','74') + ,('SAINT_LESS (WAVES)','Edition','18093','75') + ,('SAINT_LESS (WAVES)','Edition','18101','76') + ,('SAINT_LESS (WAVES)','Edition','18109','77') + ,('SAINT_LESS (WAVES)','Edition','18117','78') + ,('SAINT_LESS (WAVES)','Edition','18125','79') + ,('SAINT_LESS (WAVES)','Edition','18133','80') + ,('SAINT_LESS (WAVES)','Edition','18141','81') + ,('SAINT_LESS (WAVES)','Edition','18149','82') + ,('SAINT_LESS (WAVES)','Edition','18157','83') + ,('SAINT_LESS (WAVES)','Edition','18165','84') + ,('SAINT_LESS (WAVES)','Edition','18173','85') + ,('SAINT_LESS (WAVES)','Edition','18181','86') + ,('SAINT_LESS (WAVES)','Edition','18189','87') + ,('SAINT_LESS (WAVES)','Edition','18197','88') + ,('SAINT_LESS (WAVES)','Edition','18205','89') + ,('SAINT_LESS (WAVES)','Edition','18213','90') + ,('SAINT_LESS (WAVES)','Edition','18221','91') + ,('SAINT_LESS (WAVES)','Edition','18229','92') + ,('SAINT_LESS (WAVES)','Edition','18237','93') + ,('SAINT_LESS (WAVES)','Edition','18245','94') + ,('SAINT_LESS (WAVES)','Edition','18253','95') + ,('SAINT_LESS (WAVES)','Edition','18261','96') + ,('SAINT_LESS (WAVES)','Edition','18269','97') + ,('SAINT_LESS (WAVES)','Edition','18277','98') + ,('SAINT_LESS (WAVES)','Edition','18285','99') + ,('SAINT_LESS (WAVES)','Edition','18293','100') + ,('SAINT_LESS (WAVES)','Edition','18301','101') + ,('SAINT_LESS (WAVES)','Edition','18309','102') + ,('SAINT_LESS (WAVES)','Edition','18317','103') + ,('SAINT_LESS (WAVES)','Edition','18325','104') + ,('SAINT_LESS (WAVES)','Edition','18333','105') + ,('SAINT_LESS (WAVES)','Edition','18341','106') + ,('SAINT_LESS (WAVES)','Edition','18349','107') + ,('SAINT_LESS (WAVES)','Edition','18357','108') + ,('SAINT_LESS (WAVES)','Edition','18365','109') + ,('SAINT_LESS (WAVES)','Edition','18373','110') + ,('SAINT_LESS (WAVES)','Edition','18381','111') + ,('SAINT_LESS (WAVES)','Edition','18389','112') + ,('SAINT_LESS (WAVES)','Edition','18397','113') + ,('SAINT_LESS (WAVES)','Edition','18405','114') + ,('SAINT_LESS (WAVES)','Edition','18413','115') + ,('SAINT_LESS (WAVES)','Edition','18421','116') + ,('SAINT_LESS (WAVES)','Edition','18429','117') + ,('SAINT_LESS (WAVES)','Edition','18437','118') + ,('SAINT_LESS (WAVES)','Edition','18445','119') + ,('SAINT_LESS (WAVES)','Edition','18453','120') + ,('SAINT_LESS (WAVES)','Edition','18461','121') + ,('SAINT_LESS (WAVES)','Edition','18469','122') + ,('SAINT_LESS (WAVES)','Edition','18477','123') + ,('SAINT_LESS (WAVES)','Edition','18485','124') + ,('SAINT_LESS (WAVES)','Edition','18493','125') + ,('SAINT_LESS (WAVES)','Edition','18501','126') + ,('SAINT_LESS (WAVES)','Edition','18509','127') + ,('SAINT_LESS (WAVES)','Edition','18517','128') + ,('SAINT_LESS (WAVES)','Edition','18525','129') + ,('SAINT_LESS (WAVES)','Edition','18533','130') + ,('SAINT_LESS (WAVES)','Edition','18541','131') + ,('SAINT_LESS (WAVES)','Edition','18549','132') + ,('SAINT_LESS (WAVES)','Edition','18557','133') + ,('SAINT_LESS (WAVES)','Edition','18565','134') + ,('SAINT_LESS (WAVES)','Edition','18573','135') + ,('SAINT_LESS (WAVES)','Edition','18581','136') + ,('SAINT_LESS (WAVES)','Edition','18589','137') + ,('SAINT_LESS (WAVES)','Edition','18597','138') + ,('SAINT_LESS (WAVES)','Edition','18605','139') + ,('SAINT_LESS (WAVES)','Edition','18613','140') + ,('SAINT_LESS (WAVES)','Edition','18621','141') + ,('SAINT_LESS (WAVES)','Edition','18629','142') + ,('SAINT_LESS (WAVES)','Edition','18637','143') + ,('SAINT_LESS (WAVES)','Edition','18645','144') + ,('SAINT_LESS (WAVES)','Edition','18653','145') + ,('SAINT_LESS (WAVES)','Edition','18661','146') + ,('SAINT_LESS (WAVES)','Edition','18669','147') + ,('SAINT_LESS (WAVES)','Edition','18677','148') + ,('SAINT_LESS (WAVES)','Edition','18685','149') + ,('SAINT_LESS (WAVES)','Edition','18693','150') + ,('SAINT_LESS (WAVES)','Edition','18701','151') + ,('SAINT_LESS (WAVES)','Edition','18709','152') + ,('SAINT_LESS (WAVES)','Edition','18717','153') + ,('SAINT_LESS (WAVES)','Edition','18725','154') + ,('SAINT_LESS (WAVES)','Edition','18733','155') + ,('SAINT_LESS (WAVES)','Edition','18741','156') + ,('SAINT_LESS (WAVES)','Edition','18749','157') + ,('SAINT_LESS (WAVES)','Edition','18757','158') + ,('SAINT_LESS (WAVES)','Edition','18765','159') + ,('SAINT_LESS (WAVES)','Edition','18773','160') + ,('SAINT_LESS (WAVES)','Edition','18781','161') + ,('SAINT_LESS (WAVES)','Edition','18789','162') + ,('SAINT_LESS (WAVES)','Edition','18797','163') + ,('SAINT_LESS (WAVES)','Edition','18805','164') + ,('SAINT_LESS (WAVES)','Edition','18813','165') + ,('SAINT_LESS (WAVES)','Edition','18821','166') + ,('SAINT_LESS (WAVES)','Edition','18829','167') + ,('SAINT_LESS (WAVES)','Edition','18837','168') + ,('SAINT_LESS (WAVES)','Edition','18845','169') + ,('SAINT_LESS (WAVES)','Edition','18853','170') + ,('SAINT_LESS (WAVES)','Edition','18861','171') + ,('SAINT_LESS (WAVES)','Edition','18869','172') + ,('SAINT_LESS (WAVES)','Edition','18877','173') + ,('SAINT_LESS (WAVES)','Edition','18885','174') + ,('SAINT_LESS (WAVES)','Edition','18893','175') + ,('SAINT_LESS (WAVES)','Edition','18901','176') + ,('SAINT_LESS (WAVES)','Edition','18909','177') + ,('SAINT_LESS (WAVES)','Edition','18917','178') + ,('SAINT_LESS (WAVES)','Edition','18925','179') + ,('SAINT_LESS (WAVES)','Edition','18933','180') + ,('SAINT_LESS (WAVES)','Edition','18941','181') + ,('SAINT_LESS (WAVES)','Edition','18949','182') + ,('SAINT_LESS (WAVES)','Edition','18957','183') + ,('SAINT_LESS (WAVES)','Edition','18965','184') + ,('SAINT_LESS (WAVES)','Edition','18973','185') + ,('SAINT_LESS (WAVES)','Edition','18981','186') + ,('SAINT_LESS (WAVES)','Edition','18989','187') + ,('SAINT_LESS (WAVES)','Edition','18997','188') + ,('SAINT_LESS (WAVES)','Edition','19005','189') + ,('SAINT_LESS (WAVES)','Edition','19013','190') + ,('SAINT_LESS (WAVES)','Edition','19021','191') + ,('SAINT_LESS (WAVES)','Edition','19029','192') + ,('SAINT_LESS (WAVES)','Edition','19037','193') + ,('SAINT_LESS (WAVES)','Edition','19045','194') + ,('SAINT_LESS (WAVES)','Edition','19053','195') + ,('SAINT_LESS (WAVES)','Edition','19061','196') + ,('SAINT_LESS (WAVES)','Edition','19069','197') + ,('SAINT_LESS (WAVES)','Edition','19077','198') + ,('SAINT_LESS (WAVES)','Edition','19085','199') + ,('SAINT_LESS (WAVES)','Edition','19093','200') + ,('SAINT_LESS (CONTROL)','Edition','15901','1') + ,('SAINT_LESS (CONTROL)','Edition','15909','2') + ,('SAINT_LESS (CONTROL)','Edition','15917','3') + ,('SAINT_LESS (CONTROL)','Edition','15925','4') + ,('SAINT_LESS (CONTROL)','Edition','15933','5') + ,('SAINT_LESS (CONTROL)','Edition','15941','6') + ,('SAINT_LESS (CONTROL)','Edition','15949','7') + ,('SAINT_LESS (CONTROL)','Edition','15957','8') + ,('SAINT_LESS (CONTROL)','Edition','15965','9') + ,('SAINT_LESS (CONTROL)','Edition','15973','10') + ,('SAINT_LESS (CONTROL)','Edition','15981','11') + ,('SAINT_LESS (CONTROL)','Edition','15989','12') + ,('SAINT_LESS (CONTROL)','Edition','15997','13') + ,('SAINT_LESS (CONTROL)','Edition','16005','14') + ,('SAINT_LESS (CONTROL)','Edition','16013','15') + ,('SAINT_LESS (CONTROL)','Edition','16021','16') + ,('SAINT_LESS (CONTROL)','Edition','16029','17') + ,('SAINT_LESS (CONTROL)','Edition','16037','18') + ,('SAINT_LESS (CONTROL)','Edition','16045','19') + ,('SAINT_LESS (CONTROL)','Edition','16053','20') + ,('SAINT_LESS (CONTROL)','Edition','16061','21') + ,('SAINT_LESS (CONTROL)','Edition','16069','22') + ,('SAINT_LESS (CONTROL)','Edition','16077','23') + ,('SAINT_LESS (CONTROL)','Edition','16085','24') + ,('SAINT_LESS (CONTROL)','Edition','16093','25') + ,('SAINT_LESS (CONTROL)','Edition','16101','26') + ,('SAINT_LESS (CONTROL)','Edition','16109','27') + ,('SAINT_LESS (CONTROL)','Edition','16117','28') + ,('SAINT_LESS (CONTROL)','Edition','16125','29') + ,('SAINT_LESS (CONTROL)','Edition','16133','30') + ,('SAINT_LESS (CONTROL)','Edition','16141','31') + ,('SAINT_LESS (CONTROL)','Edition','16149','32') + ,('SAINT_LESS (CONTROL)','Edition','16157','33') + ,('SAINT_LESS (CONTROL)','Edition','16165','34') + ,('SAINT_LESS (CONTROL)','Edition','16173','35') + ,('SAINT_LESS (CONTROL)','Edition','16181','36') + ,('SAINT_LESS (CONTROL)','Edition','16189','37') + ,('SAINT_LESS (CONTROL)','Edition','16197','38') + ,('SAINT_LESS (CONTROL)','Edition','16205','39') + ,('SAINT_LESS (CONTROL)','Edition','16213','40') + ,('SAINT_LESS (CONTROL)','Edition','16221','41') + ,('SAINT_LESS (CONTROL)','Edition','16229','42') + ,('SAINT_LESS (CONTROL)','Edition','16237','43') + ,('SAINT_LESS (CONTROL)','Edition','16245','44') + ,('SAINT_LESS (CONTROL)','Edition','16253','45') + ,('SAINT_LESS (CONTROL)','Edition','16261','46') + ,('SAINT_LESS (CONTROL)','Edition','16269','47') + ,('SAINT_LESS (CONTROL)','Edition','16277','48') + ,('SAINT_LESS (CONTROL)','Edition','16285','49') + ,('SAINT_LESS (CONTROL)','Edition','16293','50') + ,('SAINT_LESS (CONTROL)','Edition','16301','51') + ,('SAINT_LESS (CONTROL)','Edition','16309','52') + ,('SAINT_LESS (CONTROL)','Edition','16317','53') + ,('SAINT_LESS (CONTROL)','Edition','16325','54') + ,('SAINT_LESS (CONTROL)','Edition','16333','55') + ,('SAINT_LESS (CONTROL)','Edition','16341','56') + ,('SAINT_LESS (CONTROL)','Edition','16349','57') + ,('SAINT_LESS (CONTROL)','Edition','16357','58') + ,('SAINT_LESS (CONTROL)','Edition','16365','59') + ,('SAINT_LESS (CONTROL)','Edition','16373','60') + ,('SAINT_LESS (CONTROL)','Edition','16381','61') + ,('SAINT_LESS (CONTROL)','Edition','16389','62') + ,('SAINT_LESS (CONTROL)','Edition','16397','63') + ,('SAINT_LESS (CONTROL)','Edition','16405','64') + ,('SAINT_LESS (CONTROL)','Edition','16413','65') + ,('SAINT_LESS (CONTROL)','Edition','16421','66') + ,('SAINT_LESS (CONTROL)','Edition','16429','67') + ,('SAINT_LESS (CONTROL)','Edition','16437','68') + ,('SAINT_LESS (CONTROL)','Edition','16445','69') + ,('SAINT_LESS (CONTROL)','Edition','16453','70') + ,('SAINT_LESS (CONTROL)','Edition','16461','71') + ,('SAINT_LESS (CONTROL)','Edition','16469','72') + ,('SAINT_LESS (CONTROL)','Edition','16477','73') + ,('SAINT_LESS (CONTROL)','Edition','16485','74') + ,('SAINT_LESS (CONTROL)','Edition','16493','75') + ,('SAINT_LESS (CONTROL)','Edition','16501','76') + ,('SAINT_LESS (CONTROL)','Edition','16509','77') + ,('SAINT_LESS (CONTROL)','Edition','16517','78') + ,('SAINT_LESS (CONTROL)','Edition','16525','79') + ,('SAINT_LESS (CONTROL)','Edition','16533','80') + ,('SAINT_LESS (CONTROL)','Edition','16541','81') + ,('SAINT_LESS (CONTROL)','Edition','16549','82') + ,('SAINT_LESS (CONTROL)','Edition','16557','83') + ,('SAINT_LESS (CONTROL)','Edition','16565','84') + ,('SAINT_LESS (CONTROL)','Edition','16573','85') + ,('SAINT_LESS (CONTROL)','Edition','16581','86') + ,('SAINT_LESS (CONTROL)','Edition','16589','87') + ,('SAINT_LESS (CONTROL)','Edition','16597','88') + ,('SAINT_LESS (CONTROL)','Edition','16605','89') + ,('SAINT_LESS (CONTROL)','Edition','16613','90') + ,('SAINT_LESS (CONTROL)','Edition','16621','91') + ,('SAINT_LESS (CONTROL)','Edition','16629','92') + ,('SAINT_LESS (CONTROL)','Edition','16637','93') + ,('SAINT_LESS (CONTROL)','Edition','16645','94') + ,('SAINT_LESS (CONTROL)','Edition','16653','95') + ,('SAINT_LESS (CONTROL)','Edition','16661','96') + ,('SAINT_LESS (CONTROL)','Edition','16669','97') + ,('SAINT_LESS (CONTROL)','Edition','16677','98') + ,('SAINT_LESS (CONTROL)','Edition','16685','99') + ,('SAINT_LESS (CONTROL)','Edition','16693','100') + ,('SAINT_LESS (CONTROL)','Edition','16701','101') + ,('SAINT_LESS (CONTROL)','Edition','16709','102') + ,('SAINT_LESS (CONTROL)','Edition','16717','103') + ,('SAINT_LESS (CONTROL)','Edition','16725','104') + ,('SAINT_LESS (CONTROL)','Edition','16733','105') + ,('SAINT_LESS (CONTROL)','Edition','16741','106') + ,('SAINT_LESS (CONTROL)','Edition','16749','107') + ,('SAINT_LESS (CONTROL)','Edition','16757','108') + ,('SAINT_LESS (CONTROL)','Edition','16765','109') + ,('SAINT_LESS (CONTROL)','Edition','16773','110') + ,('SAINT_LESS (CONTROL)','Edition','16781','111') + ,('SAINT_LESS (CONTROL)','Edition','16789','112') + ,('SAINT_LESS (CONTROL)','Edition','16797','113') + ,('SAINT_LESS (CONTROL)','Edition','16805','114') + ,('SAINT_LESS (CONTROL)','Edition','16813','115') + ,('SAINT_LESS (CONTROL)','Edition','16821','116') + ,('SAINT_LESS (CONTROL)','Edition','16829','117') + ,('SAINT_LESS (CONTROL)','Edition','16837','118') + ,('SAINT_LESS (CONTROL)','Edition','16845','119') + ,('SAINT_LESS (CONTROL)','Edition','16853','120') + ,('SAINT_LESS (CONTROL)','Edition','16861','121') + ,('SAINT_LESS (CONTROL)','Edition','16869','122') + ,('SAINT_LESS (CONTROL)','Edition','16877','123') + ,('SAINT_LESS (CONTROL)','Edition','16885','124') + ,('SAINT_LESS (CONTROL)','Edition','16893','125') + ,('SAINT_LESS (CONTROL)','Edition','16901','126') + ,('SAINT_LESS (CONTROL)','Edition','16909','127') + ,('SAINT_LESS (CONTROL)','Edition','16917','128') + ,('SAINT_LESS (CONTROL)','Edition','16925','129') + ,('SAINT_LESS (CONTROL)','Edition','16933','130') + ,('SAINT_LESS (CONTROL)','Edition','16941','131') + ,('SAINT_LESS (CONTROL)','Edition','16949','132') + ,('SAINT_LESS (CONTROL)','Edition','16957','133') + ,('SAINT_LESS (CONTROL)','Edition','16965','134') + ,('SAINT_LESS (CONTROL)','Edition','16973','135') + ,('SAINT_LESS (CONTROL)','Edition','16981','136') + ,('SAINT_LESS (CONTROL)','Edition','16989','137') + ,('SAINT_LESS (CONTROL)','Edition','16997','138') + ,('SAINT_LESS (CONTROL)','Edition','17005','139') + ,('SAINT_LESS (CONTROL)','Edition','17013','140') + ,('SAINT_LESS (CONTROL)','Edition','17021','141') + ,('SAINT_LESS (CONTROL)','Edition','17029','142') + ,('SAINT_LESS (CONTROL)','Edition','17037','143') + ,('SAINT_LESS (CONTROL)','Edition','17045','144') + ,('SAINT_LESS (CONTROL)','Edition','17053','145') + ,('SAINT_LESS (CONTROL)','Edition','17061','146') + ,('SAINT_LESS (CONTROL)','Edition','17069','147') + ,('SAINT_LESS (CONTROL)','Edition','17077','148') + ,('SAINT_LESS (CONTROL)','Edition','17085','149') + ,('SAINT_LESS (CONTROL)','Edition','17093','150') + ,('SAINT_LESS (CONTROL)','Edition','17101','151') + ,('SAINT_LESS (CONTROL)','Edition','17109','152') + ,('SAINT_LESS (CONTROL)','Edition','17117','153') + ,('SAINT_LESS (CONTROL)','Edition','17125','154') + ,('SAINT_LESS (CONTROL)','Edition','17133','155') + ,('SAINT_LESS (CONTROL)','Edition','17141','156') + ,('SAINT_LESS (CONTROL)','Edition','17149','157') + ,('SAINT_LESS (CONTROL)','Edition','17157','158') + ,('SAINT_LESS (CONTROL)','Edition','17165','159') + ,('SAINT_LESS (CONTROL)','Edition','17173','160') + ,('SAINT_LESS (CONTROL)','Edition','17181','161') + ,('SAINT_LESS (CONTROL)','Edition','17189','162') + ,('SAINT_LESS (CONTROL)','Edition','17197','163') + ,('SAINT_LESS (CONTROL)','Edition','17205','164') + ,('SAINT_LESS (CONTROL)','Edition','17213','165') + ,('SAINT_LESS (CONTROL)','Edition','17221','166') + ,('SAINT_LESS (CONTROL)','Edition','17229','167') + ,('SAINT_LESS (CONTROL)','Edition','17237','168') + ,('SAINT_LESS (CONTROL)','Edition','17245','169') + ,('SAINT_LESS (CONTROL)','Edition','17253','170') + ,('SAINT_LESS (CONTROL)','Edition','17261','171') + ,('SAINT_LESS (CONTROL)','Edition','17269','172') + ,('SAINT_LESS (CONTROL)','Edition','17277','173') + ,('SAINT_LESS (CONTROL)','Edition','17285','174') + ,('SAINT_LESS (CONTROL)','Edition','17293','175') + ,('SAINT_LESS (CONTROL)','Edition','17301','176') + ,('SAINT_LESS (CONTROL)','Edition','17309','177') + ,('SAINT_LESS (CONTROL)','Edition','17317','178') + ,('SAINT_LESS (CONTROL)','Edition','17325','179') + ,('SAINT_LESS (CONTROL)','Edition','17333','180') + ,('SAINT_LESS (CONTROL)','Edition','17341','181') + ,('SAINT_LESS (CONTROL)','Edition','17349','182') + ,('SAINT_LESS (CONTROL)','Edition','17357','183') + ,('SAINT_LESS (CONTROL)','Edition','17365','184') + ,('SAINT_LESS (CONTROL)','Edition','17373','185') + ,('SAINT_LESS (CONTROL)','Edition','17381','186') + ,('SAINT_LESS (CONTROL)','Edition','17389','187') + ,('SAINT_LESS (CONTROL)','Edition','17397','188') + ,('SAINT_LESS (CONTROL)','Edition','17405','189') + ,('SAINT_LESS (CONTROL)','Edition','17413','190') + ,('SAINT_LESS (CONTROL)','Edition','17421','191') + ,('SAINT_LESS (CONTROL)','Edition','17429','192') + ,('SAINT_LESS (CONTROL)','Edition','17437','193') + ,('SAINT_LESS (CONTROL)','Edition','17445','194') + ,('SAINT_LESS (CONTROL)','Edition','17453','195') + ,('SAINT_LESS (CONTROL)','Edition','17461','196') + ,('SAINT_LESS (CONTROL)','Edition','17469','197') + ,('SAINT_LESS (CONTROL)','Edition','17477','198') + ,('SAINT_LESS (CONTROL)','Edition','17485','199') + ,('SAINT_LESS (CONTROL)','Edition','17493','200') + ,('SAINT_LESS (FIRE)','Edition','14301','1') + ,('SAINT_LESS (FIRE)','Edition','14309','2') + ,('SAINT_LESS (FIRE)','Edition','14317','3') + ,('SAINT_LESS (FIRE)','Edition','14325','4') + ,('SAINT_LESS (FIRE)','Edition','14333','5') + ,('SAINT_LESS (FIRE)','Edition','14341','6') + ,('SAINT_LESS (FIRE)','Edition','14349','7') + ,('SAINT_LESS (FIRE)','Edition','14357','8') + ,('SAINT_LESS (FIRE)','Edition','14365','9') + ,('SAINT_LESS (FIRE)','Edition','14373','10') + ,('SAINT_LESS (FIRE)','Edition','14381','11') + ,('SAINT_LESS (FIRE)','Edition','14389','12') + ,('SAINT_LESS (FIRE)','Edition','14397','13') + ,('SAINT_LESS (FIRE)','Edition','14405','14') + ,('SAINT_LESS (FIRE)','Edition','14413','15') + ,('SAINT_LESS (FIRE)','Edition','14421','16') + ,('SAINT_LESS (FIRE)','Edition','14429','17') + ,('SAINT_LESS (FIRE)','Edition','14437','18') + ,('SAINT_LESS (FIRE)','Edition','14445','19') + ,('SAINT_LESS (FIRE)','Edition','14453','20') + ,('SAINT_LESS (FIRE)','Edition','14461','21') + ,('SAINT_LESS (FIRE)','Edition','14469','22') + ,('SAINT_LESS (FIRE)','Edition','14477','23') + ,('SAINT_LESS (FIRE)','Edition','14485','24') + ,('SAINT_LESS (FIRE)','Edition','14493','25') + ,('SAINT_LESS (FIRE)','Edition','14501','26') + ,('SAINT_LESS (FIRE)','Edition','14509','27') + ,('SAINT_LESS (FIRE)','Edition','14517','28') + ,('SAINT_LESS (FIRE)','Edition','14525','29') + ,('SAINT_LESS (FIRE)','Edition','14533','30') + ,('SAINT_LESS (FIRE)','Edition','14541','31') + ,('SAINT_LESS (FIRE)','Edition','14549','32') + ,('SAINT_LESS (FIRE)','Edition','14557','33') + ,('SAINT_LESS (FIRE)','Edition','14565','34') + ,('SAINT_LESS (FIRE)','Edition','14573','35') + ,('SAINT_LESS (FIRE)','Edition','14581','36') + ,('SAINT_LESS (FIRE)','Edition','14589','37') + ,('SAINT_LESS (FIRE)','Edition','14597','38') + ,('SAINT_LESS (FIRE)','Edition','14605','39') + ,('SAINT_LESS (FIRE)','Edition','14613','40') + ,('SAINT_LESS (FIRE)','Edition','14621','41') + ,('SAINT_LESS (FIRE)','Edition','14629','42') + ,('SAINT_LESS (FIRE)','Edition','14637','43') + ,('SAINT_LESS (FIRE)','Edition','14645','44') + ,('SAINT_LESS (FIRE)','Edition','14653','45') + ,('SAINT_LESS (FIRE)','Edition','14661','46') + ,('SAINT_LESS (FIRE)','Edition','14669','47') + ,('SAINT_LESS (FIRE)','Edition','14677','48') + ,('SAINT_LESS (FIRE)','Edition','14685','49') + ,('SAINT_LESS (FIRE)','Edition','14693','50') + ,('SAINT_LESS (FIRE)','Edition','14701','51') + ,('SAINT_LESS (FIRE)','Edition','14709','52') + ,('SAINT_LESS (FIRE)','Edition','14717','53') + ,('SAINT_LESS (FIRE)','Edition','14725','54') + ,('SAINT_LESS (FIRE)','Edition','14733','55') + ,('SAINT_LESS (FIRE)','Edition','14741','56') + ,('SAINT_LESS (FIRE)','Edition','14749','57') + ,('SAINT_LESS (FIRE)','Edition','14757','58') + ,('SAINT_LESS (FIRE)','Edition','14765','59') + ,('SAINT_LESS (FIRE)','Edition','14773','60') + ,('SAINT_LESS (FIRE)','Edition','14781','61') + ,('SAINT_LESS (FIRE)','Edition','14789','62') + ,('SAINT_LESS (FIRE)','Edition','14797','63') + ,('SAINT_LESS (FIRE)','Edition','14805','64') + ,('SAINT_LESS (FIRE)','Edition','14813','65') + ,('SAINT_LESS (FIRE)','Edition','14821','66') + ,('SAINT_LESS (FIRE)','Edition','14829','67') + ,('SAINT_LESS (FIRE)','Edition','14837','68') + ,('SAINT_LESS (FIRE)','Edition','14845','69') + ,('SAINT_LESS (FIRE)','Edition','14853','70') + ,('SAINT_LESS (FIRE)','Edition','14861','71') + ,('SAINT_LESS (FIRE)','Edition','14869','72') + ,('SAINT_LESS (FIRE)','Edition','14877','73') + ,('SAINT_LESS (FIRE)','Edition','14885','74') + ,('SAINT_LESS (FIRE)','Edition','14893','75') + ,('SAINT_LESS (FIRE)','Edition','14901','76') + ,('SAINT_LESS (FIRE)','Edition','14909','77') + ,('SAINT_LESS (FIRE)','Edition','14917','78') + ,('SAINT_LESS (FIRE)','Edition','14925','79') + ,('SAINT_LESS (FIRE)','Edition','14933','80') + ,('SAINT_LESS (FIRE)','Edition','14941','81') + ,('SAINT_LESS (FIRE)','Edition','14949','82') + ,('SAINT_LESS (FIRE)','Edition','14957','83') + ,('SAINT_LESS (FIRE)','Edition','14965','84') + ,('SAINT_LESS (FIRE)','Edition','14973','85') + ,('SAINT_LESS (FIRE)','Edition','14981','86') + ,('SAINT_LESS (FIRE)','Edition','14989','87') + ,('SAINT_LESS (FIRE)','Edition','14997','88') + ,('SAINT_LESS (FIRE)','Edition','15005','89') + ,('SAINT_LESS (FIRE)','Edition','15013','90') + ,('SAINT_LESS (FIRE)','Edition','15021','91') + ,('SAINT_LESS (FIRE)','Edition','15029','92') + ,('SAINT_LESS (FIRE)','Edition','15037','93') + ,('SAINT_LESS (FIRE)','Edition','15045','94') + ,('SAINT_LESS (FIRE)','Edition','15053','95') + ,('SAINT_LESS (FIRE)','Edition','15061','96') + ,('SAINT_LESS (FIRE)','Edition','15069','97') + ,('SAINT_LESS (FIRE)','Edition','15077','98') + ,('SAINT_LESS (FIRE)','Edition','15085','99') + ,('SAINT_LESS (FIRE)','Edition','15093','100') + ,('SAINT_LESS (FIRE)','Edition','15101','101') + ,('SAINT_LESS (FIRE)','Edition','15109','102') + ,('SAINT_LESS (FIRE)','Edition','15117','103') + ,('SAINT_LESS (FIRE)','Edition','15125','104') + ,('SAINT_LESS (FIRE)','Edition','15133','105') + ,('SAINT_LESS (FIRE)','Edition','15141','106') + ,('SAINT_LESS (FIRE)','Edition','15149','107') + ,('SAINT_LESS (FIRE)','Edition','15157','108') + ,('SAINT_LESS (FIRE)','Edition','15165','109') + ,('SAINT_LESS (FIRE)','Edition','15173','110') + ,('SAINT_LESS (FIRE)','Edition','15181','111') + ,('SAINT_LESS (FIRE)','Edition','15189','112') + ,('SAINT_LESS (FIRE)','Edition','15197','113') + ,('SAINT_LESS (FIRE)','Edition','15205','114') + ,('SAINT_LESS (FIRE)','Edition','15213','115') + ,('SAINT_LESS (FIRE)','Edition','15221','116') + ,('SAINT_LESS (FIRE)','Edition','15229','117') + ,('SAINT_LESS (FIRE)','Edition','15237','118') + ,('SAINT_LESS (FIRE)','Edition','15245','119') + ,('SAINT_LESS (FIRE)','Edition','15253','120') + ,('SAINT_LESS (FIRE)','Edition','15261','121') + ,('SAINT_LESS (FIRE)','Edition','15269','122') + ,('SAINT_LESS (FIRE)','Edition','15277','123') + ,('SAINT_LESS (FIRE)','Edition','15285','124') + ,('SAINT_LESS (FIRE)','Edition','15293','125') + ,('SAINT_LESS (FIRE)','Edition','15301','126') + ,('SAINT_LESS (FIRE)','Edition','15309','127') + ,('SAINT_LESS (FIRE)','Edition','15317','128') + ,('SAINT_LESS (FIRE)','Edition','15325','129') + ,('SAINT_LESS (FIRE)','Edition','15333','130') + ,('SAINT_LESS (FIRE)','Edition','15341','131') + ,('SAINT_LESS (FIRE)','Edition','15349','132') + ,('SAINT_LESS (FIRE)','Edition','15357','133') + ,('SAINT_LESS (FIRE)','Edition','15365','134') + ,('SAINT_LESS (FIRE)','Edition','15373','135') + ,('SAINT_LESS (FIRE)','Edition','15381','136') + ,('SAINT_LESS (FIRE)','Edition','15389','137') + ,('SAINT_LESS (FIRE)','Edition','15397','138') + ,('SAINT_LESS (FIRE)','Edition','15405','139') + ,('SAINT_LESS (FIRE)','Edition','15413','140') + ,('SAINT_LESS (FIRE)','Edition','15421','141') + ,('SAINT_LESS (FIRE)','Edition','15429','142') + ,('SAINT_LESS (FIRE)','Edition','15437','143') + ,('SAINT_LESS (FIRE)','Edition','15445','144') + ,('SAINT_LESS (FIRE)','Edition','15453','145') + ,('SAINT_LESS (FIRE)','Edition','15461','146') + ,('SAINT_LESS (FIRE)','Edition','15469','147') + ,('SAINT_LESS (FIRE)','Edition','15477','148') + ,('SAINT_LESS (FIRE)','Edition','15485','149') + ,('SAINT_LESS (FIRE)','Edition','15493','150') + ,('SAINT_LESS (FIRE)','Edition','15501','151') + ,('SAINT_LESS (FIRE)','Edition','15509','152') + ,('SAINT_LESS (FIRE)','Edition','15517','153') + ,('SAINT_LESS (FIRE)','Edition','15525','154') + ,('SAINT_LESS (FIRE)','Edition','15533','155') + ,('SAINT_LESS (FIRE)','Edition','15541','156') + ,('SAINT_LESS (FIRE)','Edition','15549','157') + ,('SAINT_LESS (FIRE)','Edition','15557','158') + ,('SAINT_LESS (FIRE)','Edition','15565','159') + ,('SAINT_LESS (FIRE)','Edition','15573','160') + ,('SAINT_LESS (FIRE)','Edition','15581','161') + ,('SAINT_LESS (FIRE)','Edition','15589','162') + ,('SAINT_LESS (FIRE)','Edition','15597','163') + ,('SAINT_LESS (FIRE)','Edition','15605','164') + ,('SAINT_LESS (FIRE)','Edition','15613','165') + ,('SAINT_LESS (FIRE)','Edition','15621','166') + ,('SAINT_LESS (FIRE)','Edition','15629','167') + ,('SAINT_LESS (FIRE)','Edition','15637','168') + ,('SAINT_LESS (FIRE)','Edition','15645','169') + ,('SAINT_LESS (FIRE)','Edition','15653','170') + ,('SAINT_LESS (FIRE)','Edition','15661','171') + ,('SAINT_LESS (FIRE)','Edition','15669','172') + ,('SAINT_LESS (FIRE)','Edition','15677','173') + ,('SAINT_LESS (FIRE)','Edition','15685','174') + ,('SAINT_LESS (FIRE)','Edition','15693','175') + ,('SAINT_LESS (FIRE)','Edition','15701','176') + ,('SAINT_LESS (FIRE)','Edition','15709','177') + ,('SAINT_LESS (FIRE)','Edition','15717','178') + ,('SAINT_LESS (FIRE)','Edition','15725','179') + ,('SAINT_LESS (FIRE)','Edition','15733','180') + ,('SAINT_LESS (FIRE)','Edition','15741','181') + ,('SAINT_LESS (FIRE)','Edition','15749','182') + ,('SAINT_LESS (FIRE)','Edition','15757','183') + ,('SAINT_LESS (FIRE)','Edition','15765','184') + ,('SAINT_LESS (FIRE)','Edition','15773','185') + ,('SAINT_LESS (FIRE)','Edition','15781','186') + ,('SAINT_LESS (FIRE)','Edition','15789','187') + ,('SAINT_LESS (FIRE)','Edition','15797','188') + ,('SAINT_LESS (FIRE)','Edition','15805','189') + ,('SAINT_LESS (FIRE)','Edition','15813','190') + ,('SAINT_LESS (FIRE)','Edition','15821','191') + ,('SAINT_LESS (FIRE)','Edition','15829','192') + ,('SAINT_LESS (FIRE)','Edition','15837','193') + ,('SAINT_LESS (FIRE)','Edition','15845','194') + ,('SAINT_LESS (FIRE)','Edition','15853','195') + ,('SAINT_LESS (FIRE)','Edition','15861','196') + ,('SAINT_LESS (FIRE)','Edition','15869','197') + ,('SAINT_LESS (FIRE)','Edition','15877','198') + ,('SAINT_LESS (FIRE)','Edition','15885','199') + ,('SAINT_LESS (FIRE)','Edition','15893','200') + ,('LAST HUMAN POLICE 2039','Edition','380786389345959939','1') + ,('LAST HUMAN POLICE 2039','Edition','380786389346222083','2') + ,('LAST HUMAN POLICE 2039','Edition','380786389345992707','3') + ,('LAST HUMAN POLICE 2039','Edition','380786389346123779','4') + ,('LAST HUMAN POLICE 2039','Edition','380786389346156547','5') + ,('LAST HUMAN POLICE 2039','Edition','380786389346025475','6') + ,('LAST HUMAN POLICE 2039','Edition','380786389346091011','7') + ,('LAST HUMAN POLICE 2039','Edition','380786389346058243','8') + ,('LAST HUMAN POLICE 2039','Edition','380786389346189315','9') + ,('LAST HUMAN POLICE 2039','Edition','380786389346549763','10') + ,('LAST HUMAN POLICE 2039','Edition','380786389346254851','11') + ,('LAST HUMAN POLICE 2039','Edition','380786389346516995','12') + ,('LAST HUMAN POLICE 2039','Edition','380786389346287619','13') + ,('LAST HUMAN POLICE 2039','Edition','380786389346320387','14') + ,('LAST HUMAN POLICE 2039','Edition','380786389346353155','15') + ,('LAST HUMAN POLICE 2039','Edition','380786389346385923','16') + ,('LAST HUMAN POLICE 2039','Edition','380786389346484227','17') + ,('LAST HUMAN POLICE 2039','Edition','380786389346418691','18') + ,('LAST HUMAN POLICE 2039','Edition','380786389346451459','19') + ,('NEW TEETH 2033','Edition','380786771184680961','1') + ,('NEW TEETH 2033','Edition','380786771184648193','2') + ,('NEW TEETH 2033','Edition','380786771183828993','3') + ,('NEW TEETH 2033','Edition','380786771183861761','4') + ,('NEW TEETH 2033','Edition','380786771183992833','5') + ,('NEW TEETH 2033','Edition','380786771183894529','6') + ,('NEW TEETH 2033','Edition','380786771183927297','7') + ,('NEW TEETH 2033','Edition','380786771183960065','8') + ,('NEW TEETH 2033','Edition','380786771184025601','9') + ,('NEW TEETH 2033','Edition','380786771184091137','10') + ,('NEW TEETH 2033','Edition','380786771184189441','11') + ,('NEW TEETH 2033','Edition','380786771184254977','12') + ,('NEW TEETH 2033','Edition','380786771184222209','13') + ,('NEW TEETH 2033','Edition','380786771184713729','14') + ,('NEW TEETH 2033','Edition','380786771184746497','15') + ,('NEW TEETH 2033','Edition','380786771184058369','16') + ,('NEW TEETH 2033','Edition','380786771184123905','17') + ,('NEW TEETH 2033','Edition','380786771184156673','18') + ,('NEW TEETH 2033','Edition','380786771184287745','19') + ,('NEW TEETH 2033','Edition','380786771184320513','20') + ,('NEW TEETH 2033','Edition','380786771184418817','21') + ,('NEW TEETH 2033','Edition','380786771184353281','22') + ,('NEW TEETH 2033','Edition','380786771184386049','23') + ,('NEW TEETH 2033','Edition','380786771184451585','24') + ,('NEW TEETH 2033','Edition','380786771184484353','25') + ,('NEW TEETH 2033','Edition','380786771184517121','26') + ,('NEW TEETH 2033','Edition','380786771184549889','27') + ,('NEW TEETH 2033','Edition','380786771184615425','28') + ,('NEW TEETH 2033','Edition','380786771184582657','29') + ,('HACKPROOF 2049','Edition','380785988122935300','1') + ,('HACKPROOF 2049','Edition','380785988122968068','2') + ,('HACKPROOF 2049','Edition','380785988123099140','3') + ,('HACKPROOF 2049','Edition','380785988123131908','4') + ,('HACKPROOF 2049','Edition','380785988123000836','5') + ,('HACKPROOF 2049','Edition','380785988123033604','6') + ,('HACKPROOF 2049','Edition','380785988123066372','7') + ,('HACKPROOF 2049','Edition','380785988123164676','8') + ,('HACKPROOF 2049','Edition','380785988123197444','9') + ,('HACKPROOF 2049','Edition','380785988123525124','10') + ,('HACKPROOF 2049','Edition','380785988123230212','11') + ,('HACKPROOF 2049','Edition','380785988123262980','12') + ,('HACKPROOF 2049','Edition','380785988123295748','13') + ,('HACKPROOF 2049','Edition','380785988123328516','14') + ,('HACKPROOF 2049','Edition','380785988123361284','15') + ,('HACKPROOF 2049','Edition','380785988123394052','16') + ,('HACKPROOF 2049','Edition','380785988123492356','17') + ,('HACKPROOF 2049','Edition','380785988123459588','18') + ,('HACKPROOF 2049','Edition','380785988123426820','19') +) as temp_table (title, art_type, nonsequential_token_id, clean_token_id) \ No newline at end of file diff --git a/dbt_subprojects/nft/models/nft_metrics/ethereum/nft_ethereum_wallet_metrics.sql b/dbt_subprojects/nft/models/nft_metrics/ethereum/nft_ethereum_wallet_metrics.sql index aca3ea0e2f8..3bf4e7da62e 100644 --- a/dbt_subprojects/nft/models/nft_metrics/ethereum/nft_ethereum_wallet_metrics.sql +++ b/dbt_subprojects/nft/models/nft_metrics/ethereum/nft_ethereum_wallet_metrics.sql @@ -138,6 +138,7 @@ reservoir_floors as ( from {{source('reservoir', 'collection_floor_ask_events')}} where 1 = 1 and valid_until_dt > current_date + and valid_until < 100000000000 -- overflow protection ), reservoir_floors_latest_avg as ( diff --git a/dbt_subprojects/nft/packages.yml b/dbt_subprojects/nft/packages.yml index 6152b330974..ff9ca2cf98a 100644 --- a/dbt_subprojects/nft/packages.yml +++ b/dbt_subprojects/nft/packages.yml @@ -1,3 +1,3 @@ packages: - package: dbt-labs/dbt_utils - version: 1.1.1 \ No newline at end of file + version: 1.3.0 \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_schema.yml b/dbt_subprojects/solana/models/_sector/dex/_schema.yml similarity index 92% rename from dbt_subprojects/solana/models/_sector/dex/dex_solana_schema.yml rename to dbt_subprojects/solana/models/_sector/dex/_schema.yml index d9b9ae9eff3..79f9ce36a3c 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_schema.yml +++ b/dbt_subprojects/solana/models/_sector/dex/_schema.yml @@ -18,10 +18,14 @@ models: meta: blockchain: solana contributors: ["ilemi", "0xRob"] + docs_slug: /curated/trading/solana/dex-solana-trades config: tags: ['solana','dex'] description: > - enriched dex trades on Solana + The dex_solana.trades table captures detailed data on decentralized exchange (DEX) trades on the Solana blockchain, recording all trade events across various protocols. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [ 'tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index', 'block_month'] columns: - &blockchain name: blockchain diff --git a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/_schema.yml b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/_schema.yml index fd9bb8acfbb..270652d829a 100644 --- a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/_schema.yml +++ b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/_schema.yml @@ -476,3 +476,62 @@ models: - check_bot_trades_seed: seed_file: ref('unibot_solana_trades_seed') blockchain: solana + + - name: mev_x_solana_bot_trades + meta: + blockchain: solana + sector: dex + project: mev_x + contributors: whale_hunter + config: + tags: ["solana", "dex", "mev_x", "trades"] + description: > + MevX trades on Solana + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_id + - tx_index + - outer_instruction_index + - inner_instruction_index + - check_bot_trades_seed: + seed_file: ref('mev_x_solana_trades_seed') + blockchain: solana + + - name: alpha_dex_solana_bot_trades + meta: + blockchain: solana + sector: dex + project: alpha_dex + contributors: whale_hunter + config: + tags: ["solana", "dex", "alpha_dex", "trades"] + description: > + Alpha Dex trades on Solana + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_id + - tx_index + - outer_instruction_index + - inner_instruction_index + - check_bot_trades_seed: + seed_file: ref('alpha_dex_solana_trades_seed') + blockchain: solana + + - name: alpha_dex_solana_bot_users + meta: + blockchain: solana + sector: dex + project: alpha_dex + contributors: whale_hunter + description: > + alpha_dex users on Solana + config: + tags: ["solana", "dex", "bot_trades"] + columns: + - name: user + tests: unique + diff --git a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/dex_solana_bot_trades.sql b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/dex_solana_bot_trades.sql index 66625b22746..418cd77f123 100644 --- a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/dex_solana_bot_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/dex_solana_bot_trades.sql @@ -6,7 +6,7 @@ post_hook = '{{ expose_spells( blockchains = \'["solana"]\', spell_type = "sector", - spell_name = "bot_trades", + spell_name = "dex_solana", contributors = \'["whale_hunter", "hosuke"]\') }}' ) }} @@ -26,6 +26,8 @@ , ref('sol_gun_solana_bot_trades') , ref('consortium_key_solana_bot_trades') , ref('tirador_solana_bot_trades') + , ref('mev_x_solana_bot_trades') + , ref('alpha_dex_solana_bot_trades') ] %} {% for bot in solana_trading_bot %} @@ -60,4 +62,4 @@ FROM {{ bot }} {% if not loop.last %} UNION ALL {% endif %} -{% endfor %} \ No newline at end of file +{% endfor %} diff --git a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/alpha_dex_solana_bot_trades.sql b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/alpha_dex_solana_bot_trades.sql new file mode 100644 index 00000000000..27a4fc0c138 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/alpha_dex_solana_bot_trades.sql @@ -0,0 +1,124 @@ +{{ + config( + alias='bot_trades', + schema='alpha_dex_solana', + partition_by=['block_month'], + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key=[ + 'blockchain', + 'tx_id', + 'tx_index', + 'outer_instruction_index', + 'inner_instruction_index', + ] + ) +}} + +{% set project_start_date = '2024-06-02' %} +{% set fee_receiver = '6qgwjhV2RQxcPffRdtQBTTEezRykQKXqhcDyv1z3r9tq' %} +{% set wsol_token = 'So11111111111111111111111111111111111111112' %} + +with + all_fee_payments as ( + select * from {{ref('alpha_dex_solana_bot_users')}} + ), + bot_trades as ( + select + trades.block_time, + cast(date_trunc('day', trades.block_time) as date) as block_date, + cast(date_trunc('month', trades.block_time) as date) as block_month, + 'solana' as blockchain, + amount_usd, + if(token_sold_mint_address = '{{wsol_token}}', 'Buy', 'Sell') as type, + token_bought_amount, + token_bought_symbol, + token_bought_mint_address as token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_mint_address as token_sold_address, + 0 as fee_usd, + 0 AS fee_token_amount, + 'SOL' as fee_token_symbol, + '{{wsol_token}}' as fee_token_address, + project, + version, + token_pair, + project_program_id as project_contract_address, + trader_id as user, + trades.tx_id, + tx_index, + outer_instruction_index, + inner_instruction_index + from {{ ref('dex_solana_trades') }} as trades + join all_fee_payments on trades.trader_id = all_fee_payments.user + join + {{ source('solana', 'transactions') }} as transactions + on ( + trades.block_time = transactions.block_time + and trades.tx_id = id + {% if is_incremental() %} + and {{ incremental_predicate('transactions.block_time') }} + and {{ incremental_predicate('trades.block_time') }} + {% else %} + and transactions.block_time >= timestamp '{{project_start_date}}' + and trades.block_time >= timestamp '{{project_start_date}}' + {% endif %} + ) + where + trades.trader_id != '{{fee_receiver}}' -- Exclude trades signed by FeeWallet + and transactions.signer != '{{fee_receiver}}' -- Exclude trades signed by FeeWallet + ), + highest_inner_instruction_index_for_each_trade as ( + select + tx_id, + outer_instruction_index, + max(inner_instruction_index) as highest_inner_instruction_index + from bot_trades + group by tx_id, outer_instruction_index + ) +select + block_time, + block_date, + block_month, + 'Alpha Dex' as bot, + blockchain, + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + fee_usd, + fee_token_amount, + fee_token_symbol, + fee_token_address, + project, + version, + token_pair, + project_contract_address, + user, + bot_trades.tx_id, + tx_index, + bot_trades.outer_instruction_index, + coalesce(inner_instruction_index, 0) as inner_instruction_index, + if( + inner_instruction_index = highest_inner_instruction_index, true, false + ) as is_last_trade_in_transaction +from bot_trades +join + highest_inner_instruction_index_for_each_trade + on ( + bot_trades.tx_id = highest_inner_instruction_index_for_each_trade.tx_id + and bot_trades.outer_instruction_index + = highest_inner_instruction_index_for_each_trade.outer_instruction_index + ) +order by + block_time desc, + tx_index desc, + outer_instruction_index desc, + inner_instruction_index desc diff --git a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/alpha_dex_solana_bot_users.sql b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/alpha_dex_solana_bot_users.sql new file mode 100644 index 00000000000..b21a64e673b --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/alpha_dex_solana_bot_users.sql @@ -0,0 +1,32 @@ +{{ + config( + alias='bot_users', + schema='alpha_dex_solana', + materialized='incremental', + file_format='delta', + incremental_strategy='merge', + unique_key='user' + ) +}} + +{% set project_start_date = '2024-06-02' %} +{% set fee_receiver = '6qgwjhV2RQxcPffRdtQBTTEezRykQKXqhcDyv1z3r9tq' %} + + +select distinct + signer as user +from {{ source('solana', 'account_activity') }} as activity +inner join {{ source("solana", "transactions") }} as transactions + on tx_id = id + and transactions.block_time = activity.block_time + {% if is_incremental() %} + and {{ incremental_predicate('activity.block_time') }} + and {{ incremental_predicate('transactions.block_time') }} + {% else %} + and activity.block_time >= timestamp '{{project_start_date}}' + and transactions.block_time >= timestamp '{{project_start_date}}' + {% endif %} +where + tx_success + and balance_change > 0 + and address = '{{fee_receiver}}' diff --git a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/mev_x_solana_bot_trades.sql b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/mev_x_solana_bot_trades.sql new file mode 100644 index 00000000000..16a9f18b18f --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/mev_x_solana_bot_trades.sql @@ -0,0 +1,160 @@ +{{ config( + alias = 'bot_trades', + schema = 'mev_x', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['blockchain', 'tx_id', 'tx_index', 'outer_instruction_index', 'inner_instruction_index'] + ) +}} + +{% set project_start_date = '2024-07-16' %} +{% set buy_fee_receiver_1 = '3kxSQybWEeQZsMuNWMRJH4TxrhwoDwfv41TNMLRzFP5A' %} +{% set sell_fee_receiver_1 = 'BS3CyJ9rRC4Tp8G7f86r6hGvuu3XdrVGNVpbNM9U5WRZ' %} +{% set sell_fee_receiver_2 = '4Lpvp1q69SHentfYcMBUrkgvppeEx6ovHCSYjg4UYXiq' %} +{% set wsol_token = 'So11111111111111111111111111111111111111112' %} + +WITH + allFeePayments AS ( + SELECT + tx_id, + 'SOL' AS feeTokenType, + balance_change / 1e9 AS fee_token_amount, + '{{wsol_token}}' AS fee_token_mint_address + FROM + {{ source('solana','account_activity') }} + WHERE + {% if is_incremental() %} + {{ incremental_predicate('block_time') }} + {% else %} + block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + AND tx_success + AND balance_change > 0 + AND ( + address = '{{buy_fee_receiver_1}}' + OR address = '{{sell_fee_receiver_1}}' + OR address = '{{sell_fee_receiver_2}}' + ) + ), + botTrades AS ( + SELECT + trades.block_time, + CAST(date_trunc('day', trades.block_time) AS date) AS block_date, + CAST(date_trunc('month', trades.block_time) AS date) AS block_month, + 'solana' AS blockchain, + amount_usd, + IF( + token_sold_mint_address = '{{wsol_token}}', + 'Buy', + 'Sell' + ) AS type, + token_bought_amount, + token_bought_symbol, + token_bought_mint_address AS token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_mint_address AS token_sold_address, + fee_token_amount * price AS fee_usd, + fee_token_amount, + IF(feeTokenType = 'SOL', 'SOL', symbol) AS fee_token_symbol, + fee_token_mint_address AS fee_token_address, + project, + version, + token_pair, + project_program_id AS project_contract_address, + trader_id AS user, + trades.tx_id, + tx_index, + outer_instruction_index, + inner_instruction_index + FROM + {{ ref('dex_solana_trades') }} AS trades + JOIN allFeePayments AS feePayments ON trades.tx_id = feePayments.tx_id + LEFT JOIN {{ source('prices', 'usd') }} AS feeTokenPrices ON ( + feeTokenPrices.blockchain = 'solana' + AND fee_token_mint_address = toBase58 (feeTokenPrices.contract_address) + AND date_trunc('minute', block_time) = minute + {% if is_incremental() %} + AND {{ incremental_predicate('minute') }} + {% else %} + AND minute >= TIMESTAMP '{{project_start_date}}' + {% endif %} + ) + JOIN {{ source('solana','transactions') }} AS transactions ON ( + trades.tx_id = id + {% if is_incremental() %} + AND {{ incremental_predicate('transactions.block_time') }} + {% else %} + AND transactions.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + ) + WHERE + trades.trader_id != '{{buy_fee_receiver_1}}' -- Exclude trades signed by FeeWallet + AND trades.trader_id != '{{sell_fee_receiver_1}}' -- Exclude trades signed by FeeWallet + AND trades.trader_id != '{{sell_fee_receiver_2}}' -- Exclude trades signed by FeeWallet + AND transactions.signer != '{{buy_fee_receiver_1}}' -- Exclude trades signed by FeeWallet + AND transactions.signer != '{{sell_fee_receiver_1}}' -- Exclude trades signed by FeeWallet + AND transactions.signer != '{{sell_fee_receiver_2}}' -- Exclude trades signed by FeeWallet + {% if is_incremental() %} + AND {{ incremental_predicate('trades.block_time') }} + {% else %} + AND trades.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + ), + highestInnerInstructionIndexForEachTrade AS ( + SELECT + tx_id, + outer_instruction_index, + MAX(inner_instruction_index) AS highestInnerInstructionIndex + FROM + botTrades + GROUP BY + tx_id, + outer_instruction_index + ) +SELECT + block_time, + block_date, + block_month, + 'MevX Bot' as bot, + blockchain, + amount_usd, + type, + token_bought_amount, + token_bought_symbol, + token_bought_address, + token_sold_amount, + token_sold_symbol, + token_sold_address, + fee_usd, + fee_token_amount, + fee_token_symbol, + fee_token_address, + project, + version, + token_pair, + project_contract_address, + user, + botTrades.tx_id, + tx_index, + botTrades.outer_instruction_index, + COALESCE(inner_instruction_index, 0) AS inner_instruction_index, + IF( + inner_instruction_index = highestInnerInstructionIndex, + true, + false + ) AS is_last_trade_in_transaction +FROM + botTrades + JOIN highestInnerInstructionIndexForEachTrade ON ( + botTrades.tx_id = highestInnerInstructionIndexForEachTrade.tx_id + AND botTrades.outer_instruction_index = highestInnerInstructionIndexForEachTrade.outer_instruction_index + ) +ORDER BY + block_time DESC, + tx_index DESC, + outer_instruction_index DESC, + inner_instruction_index DESC diff --git a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/tirador_solana_bot_trades.sql b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/tirador_solana_bot_trades.sql index 5593ebd4869..6fd0eb8710c 100644 --- a/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/tirador_solana_bot_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/bot_trades/solana/platforms/tirador_solana_bot_trades.sql @@ -41,7 +41,6 @@ WITH CAST(date_trunc('day', trades.block_time) AS date) AS block_date, CAST(date_trunc('month', trades.block_time) AS date) AS block_month, 'solana' AS blockchain, - 'Tirador' AS bot, amount_usd, IF( token_sold_mint_address = '{{wsol_token}}', @@ -112,6 +111,7 @@ SELECT block_time, block_date, block_month, + 'Tirador' AS bot, blockchain, amount_usd, type, diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql index 1b34528512e..ad9e2b60a09 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql @@ -7,11 +7,8 @@ incremental_strategy = 'merge', partition_by = ['block_month'], incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'], - post_hook='{{ expose_spells(\'["solana"]\', - "project", - "dex", - \'["ilemi","0xRob"]\') }}') + unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'] + ) }} {% set solana_dexes = [ @@ -21,9 +18,9 @@ , ref('phoenix_v1_base_trades') , ref('lifinity_v1_base_trades') , ref('lifinity_v2_base_trades') - , ref('meteora_v1_solana_trades') - , ref('meteora_v2_solana_trades') - , ref('goosefx_ssl_v2_solana_trades') + , ref('meteora_v1_solana_base_trades') + , ref('meteora_v2_solana_base_trades') + , ref('goosefx_ssl_v2_solana_base_trades') , ref('pumpdotfun_solana_base_trades') ] %} @@ -34,32 +31,27 @@ SELECT , version , CAST(date_trunc('month', block_time) AS DATE) as block_month , block_time - , cast(null as bigint) as block_slot -- todo: implement when all models are converted + , block_slot , trade_source --- , token_bought_symbol --- , token_sold_symbol --- , token_pair --- , token_bought_amount --- , token_sold_amount , token_bought_amount_raw , token_sold_amount_raw --- , amount_usd , fee_tier --- , fee_usd , token_bought_mint_address , token_sold_mint_address , token_bought_vault , token_sold_vault , project_program_id - , cast(null as varchar) as project_main_id -- todo: implement when all models are converted + , project_main_id , trader_id , tx_id , outer_instruction_index , inner_instruction_index , tx_index -FROM {{ dex }} +FROM + {{ dex }} {% if is_incremental() %} -WHERE {{incremental_predicate('block_time')}} +WHERE + {{incremental_predicate('block_time')}} {% endif %} {% if not loop.last %} UNION ALL diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_price_hour.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_price_hour.sql index c30da89c0c1..ffe0b333c9d 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_price_hour.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_price_hour.sql @@ -10,8 +10,8 @@ unique_key = ['blockchain', 'contract_address', 'hour'], pre_hook='{{ enforce_join_distribution("PARTITIONED") }}', post_hook='{{ expose_spells(\'["solana"]\', - "project", - "dex", + "sector", + "dex_solana", \'["get_nimbus"]\') }}') }} diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql index 0ed4edd998e..058814deff8 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql @@ -9,82 +9,94 @@ incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'], post_hook='{{ expose_spells(\'["solana"]\', - "project", - "dex", - \'["ilemi,0xRob"]\') }}') + "sector", + "dex_solana", + \'["ilemi","0xRob","jeff-dude"]\') }}') }} with base_trades as ( - select * from {{ ref('dex_solana_base_trades')}} + SELECT + * + FROM + {{ ref('dex_solana_base_trades')}} {% if is_incremental() %} - WHERE {{incremental_predicate('block_time')}} + WHERE + {{incremental_predicate('block_time')}} {% endif %} ) SELECT bt.blockchain - , project - , version - , CAST(date_trunc('month', block_time) AS DATE) as block_month + , bt.project + , bt.version + , bt.block_month , bt.block_time , bt.block_slot - , trade_source + , bt.trade_source , token_bought.symbol as token_bought_symbol , token_sold.symbol as token_sold_symbol , case when lower(token_bought.symbol) > lower(token_sold.symbol) then concat(token_bought.symbol, '-', token_sold.symbol) else concat(token_sold.symbol, '-', token_bought.symbol) end as token_pair - , token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) as token_bought_amount - , token_sold_amount_raw / pow(10,coalesce(token_sold.decimals, 9)) as token_sold_amount - , token_bought_amount_raw - , token_sold_amount_raw + , bt.token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) as token_bought_amount + , bt.token_sold_amount_raw / pow(10,coalesce(token_sold.decimals, 9)) as token_sold_amount + , bt.token_bought_amount_raw + , bt.token_sold_amount_raw , COALESCE( -- if bought token is trusted, prefer that price, else default to sold token then bought token. case when tt_bought.symbol is not null then - token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price + bt.token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price else null end - , token_sold_amount_raw / pow(10,coalesce(token_sold.decimals, 9)) * p_sold.price - , token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price) + , bt.token_sold_amount_raw / pow(10,coalesce(token_sold.decimals, 9)) * p_sold.price + , bt.token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price) as amount_usd - , fee_tier - , fee_tier * + , bt.fee_tier + , bt.fee_tier * COALESCE( -- if bought token is trusted, prefer that price, else default to sold token then bought token. case when tt_bought.symbol is not null then - token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price + bt.token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price else null end - , token_sold_amount_raw / pow(10,coalesce(token_sold.decimals, 9)) * p_sold.price - , token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price) + , bt.token_sold_amount_raw / pow(10,coalesce(token_sold.decimals, 9)) * p_sold.price + , bt.token_bought_amount_raw / pow(10,coalesce(token_bought.decimals, 9)) * p_bought.price) as fee_usd - , token_bought_mint_address - , token_sold_mint_address - , token_bought_vault - , token_sold_vault - , project_program_id - , project_main_id - , trader_id - , tx_id - , outer_instruction_index - , inner_instruction_index - , tx_index -FROM base_trades bt -LEFT JOIN {{ ref('tokens_solana_fungible') }} token_bought ON token_bought.token_mint_address = token_bought_mint_address -LEFT JOIN {{ ref('tokens_solana_fungible') }} token_sold ON token_sold.token_mint_address = token_sold_mint_address -LEFT JOIN {{ source('prices', 'usd') }} p_bought + , bt.token_bought_mint_address + , bt.token_sold_mint_address + , bt.token_bought_vault + , bt.token_sold_vault + , bt.project_program_id + , bt.project_main_id + , bt.trader_id + , bt.tx_id + , bt.outer_instruction_index + , bt.inner_instruction_index + , bt.tx_index +FROM + base_trades bt +LEFT JOIN + {{ ref('tokens_solana_fungible') }} token_bought + ON token_bought.token_mint_address = bt.token_bought_mint_address +LEFT JOIN + {{ ref('tokens_solana_fungible') }} token_sold + ON token_sold.token_mint_address = bt.token_sold_mint_address +LEFT JOIN + {{ source('prices', 'usd') }} p_bought ON p_bought.blockchain = 'solana' AND date_trunc('minute', bt.block_time) = p_bought.minute - AND token_bought_mint_address = toBase58(p_bought.contract_address) + AND bt.token_bought_mint_address = toBase58(p_bought.contract_address) {% if is_incremental() %} AND {{incremental_predicate('p_bought.minute')}} {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} p_sold +LEFT JOIN + {{ source('prices', 'usd') }} p_sold ON p_sold.blockchain = 'solana' AND date_trunc('minute', bt.block_time) = p_sold.minute - AND token_sold_mint_address = toBase58(p_sold.contract_address) + AND bt.token_sold_mint_address = toBase58(p_sold.contract_address) {% if is_incremental() %} AND {{incremental_predicate('p_sold.minute')}} {% endif %} -- if bought token is trusted, prefer that price, else default to sold token then bought token. -LEFT JOIN {{ source('prices','trusted_tokens') }} tt_bought +LEFT JOIN + {{ source('prices','trusted_tokens') }} tt_bought ON bt.token_bought_mint_address = toBase58(tt_bought.contract_address) - AND bt.blockchain = tt_bought.blockchain + AND bt.blockchain = tt_bought.blockchain \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/goosefx/_schema.yml b/dbt_subprojects/solana/models/_sector/dex/goosefx/_schema.yml index 102b4cc12ff..943705c15e9 100644 --- a/dbt_subprojects/solana/models/_sector/dex/goosefx/_schema.yml +++ b/dbt_subprojects/solana/models/_sector/dex/goosefx/_schema.yml @@ -1,22 +1,27 @@ version: 2 models: - - name: goosefx_ssl_v2_solana_trades + - name: goosefx_ssl_v2_solana_base_trades meta: blockchain: solana - contributors: [ilemi] + contributors: [ ilemi ] config: - tags: ['solana','dex'] + tags: [ 'solana','dex' ] description: > all goosefx ssl v2 dex trades on Solana tests: + - check_columns_solana_dex_trades - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_month - - tx_id - - outer_instruction_index - - inner_instruction_index - - tx_index + combination_of_columns: [ 'tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index', 'block_month' ] + + - name: goosefx_ssl_v2_solana_trades + meta: + blockchain: solana + contributors: [ilemi] + config: + tags: ['solana','dex'] + description: > + all goosefx ssl v2 dex trades on Solana columns: - &blockchain name: blockchain @@ -33,9 +38,12 @@ models: - &block_time name: block_time description: "UTC event block time of each DEX trade" + - &block_slot + name: block_slot + description: "block slot of each DEX trade" - &trade_source name: trade_source - description: "Was the trade a direct call to the whirlpool or did it go through another program like Jupiter (Dex Aggregator)" + description: "Was the trade a direct call to the dexor did it go through another program like Jupiter (Dex Aggregator)" - &token_bought_symbol name: token_bought_symbol description: "Token symbol for token bought in the trade" @@ -62,10 +70,10 @@ models: description: "USD value of the trade at time of execution" - &fee_tier name: fee_tier - description: "Whirlpool fee tier (fee %)" + description: "dexfee tier (fee %)" - &fee_usd name: fee_usd - description: "Whirlpool fee usd paid on swap" + description: "dexfee usd paid on swap" - &token_bought_mint_address name: token_bought_address description: "token mint address of the token bought" @@ -74,13 +82,16 @@ models: description: "token mint address of the token sold" - &token_bought_vault name: token_bought_vault - description: "token associated address for the whirlpool, of the token bought" + description: "token associated address for thedex, of the token bought" - &token_sold_vault name: token_sold_vault - description: "token associated address for the whirlpool, of the token sold" + description: "token associated address for thedex, of the token sold" - &project_program_id name: project_program_id description: "pool program id of the project" + - &project_main_id + name: project_main_id + description: "main program id of the project" - &trader_id name: trader_id description: "id (address) of trader who purchased a token" diff --git a/dbt_subprojects/solana/models/_sector/dex/goosefx/goosefx_ssl_v2_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/goosefx/goosefx_ssl_v2_solana_base_trades.sql new file mode 100644 index 00000000000..50015c5f759 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/goosefx/goosefx_ssl_v2_solana_base_trades.sql @@ -0,0 +1,96 @@ + {{ + config( + schema = 'goosefx_ssl_v2_solana', + alias = 'base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'] + ) +}} + +{% set project_start_date = '2023-08-01' %} --grabbed program deployed at time (account created at). + +WITH + all_swaps as ( + SELECT + sp.call_block_time as block_time + , sp.call_block_slot as block_slot + , 'goosefx_ssl' as project + , 2 as version + , 'solana' as blockchain + , case when sp.call_is_inner = False then 'direct' + else sp.call_outer_executing_account + end as trade_source + -- token bought is always the second instruction (transfer) in the inner instructions + , trs_2.amount as token_bought_amount_raw + , trs_1.amount as token_sold_amount_raw + , sp.account_pair as pool_id --p.pool_id + , sp.call_tx_signer as trader_id + , sp.call_tx_id as tx_id + , sp.call_outer_instruction_index as outer_instruction_index + , COALESCE(sp.call_inner_instruction_index, 0) as inner_instruction_index + , sp.call_tx_index as tx_index + , COALESCE(trs_2.token_mint_address, cast(null as varchar)) as token_bought_mint_address + , COALESCE(trs_1.token_mint_address, cast(null as varchar)) as token_sold_mint_address + , trs_2.from_token_account as token_bought_vault + , trs_1.to_token_account as token_sold_vault + FROM + {{ source('goosefx_solana', 'gfx_ssl_v2_call_swap') }} sp + INNER JOIN + {{ ref('tokens_solana_transfers') }} trs_1 + ON trs_1.tx_id = sp.call_tx_id + AND trs_1.block_date = sp.call_block_date + AND trs_1.block_time = sp.call_block_time + AND trs_1.outer_instruction_index = sp.call_outer_instruction_index + AND trs_1.inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 1 + {% if is_incremental() %} + AND {{incremental_predicate('trs_1.block_time')}} + {% else %} + AND trs_1.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + INNER JOIN + {{ ref('tokens_solana_transfers') }} trs_2 + ON trs_2.tx_id = sp.call_tx_id + AND trs_2.block_date = sp.call_block_date + AND trs_2.block_time = sp.call_block_time + AND trs_2.outer_instruction_index = sp.call_outer_instruction_index + AND trs_2.inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 2 + {% if is_incremental() %} + AND {{incremental_predicate('trs_2.block_time')}} + {% else %} + AND trs_2.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + WHERE + 1=1 + {% if is_incremental() %} + AND {{incremental_predicate('sp.call_block_time')}} + {% else %} + AND sp.call_block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} +) +SELECT + tb.blockchain + , tb.project + , tb.version + , CAST(date_trunc('month', tb.block_time) AS DATE) as block_month + , tb.block_time + , tb.block_slot + , tb.trade_source + , tb.token_bought_amount_raw + , tb.token_sold_amount_raw + , cast(null as double) as fee_tier + , tb.token_sold_mint_address + , tb.token_bought_mint_address + , tb.token_sold_vault + , tb.token_bought_vault + , tb.pool_id as project_program_id + , 'GFXsSL5sSaDfNFQUYsHekbWBW1TsFdjDYzACh62tEHxn' as project_main_id + , tb.trader_id + , tb.tx_id + , tb.outer_instruction_index + , tb.inner_instruction_index + , tb.tx_index +FROM all_swaps tb \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/goosefx/goosefx_ssl_v2_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/goosefx/goosefx_ssl_v2_solana_trades.sql index d729266bd1d..415079368b1 100644 --- a/dbt_subprojects/solana/models/_sector/dex/goosefx/goosefx_ssl_v2_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/goosefx/goosefx_ssl_v2_solana_trades.sql @@ -2,143 +2,16 @@ config( schema = 'goosefx_ssl_v2_solana', alias = 'trades', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'] - ) + materialized = 'view', + post_hook='{{ expose_spells(\'["solana"]\', + "project", + "goosefx", + \'["ilemi"]\') }}') }} - -{% set project_start_date = '2023-08-01' %} --grabbed program deployed at time (account created at). - - WITH - pools as ( - --technically not used below, but here for a dex_solana.pools spell later on. - SELECT - tkA.symbol as tokenA_symbol - , tkA.decimals as tokenA_decimals - , ip.account_mintOne as tokenA - , ip.account_mintOneSecondaryVault as tokenAVault - , tkB.symbol as tokenB_symbol - , tkB.decimals as tokenB_decimals - , ip.account_mintTwo as tokenB - , ip.account_mintTwoSecondaryVault as tokenBVault - , cast(null as varchar) as fee_tier - , ip.account_pair as pool_id - , ip.call_tx_id as init_tx - , ip.call_block_time as init_time - FROM {{ source('goosefx_solana', 'gfx_ssl_v2_call_createPair') }} ip - LEFT JOIN {{ ref('tokens_solana_fungible') }} tkA ON tkA.token_mint_address = ip.account_mintOne - LEFT JOIN {{ ref('tokens_solana_fungible') }} tkB ON tkB.token_mint_address = ip.account_mintTwo - ) - - , all_swaps as ( - SELECT - sp.call_block_time as block_time - , 'goosefx_ssl' as project - , 2 as version - , 'solana' as blockchain - , case when sp.call_is_inner = False then 'direct' - else sp.call_outer_executing_account - end as trade_source - , case - when lower(dec_1.symbol) > lower(dec_2.symbol) then concat(dec_1.symbol, '-', dec_2.symbol) - else concat(dec_2.symbol, '-', dec_1.symbol) - end as token_pair - , COALESCE(dec_2.symbol, dec_2.token_mint_address) as token_bought_symbol - -- -- token bought is always the second instruction (transfer) in the inner instructions - , trs_2.amount as token_bought_amount_raw - , trs_2.amount/pow(10,COALESCE(dec_2.decimals,9)) as token_bought_amount - , COALESCE(dec_1.symbol, dec_1.token_mint_address) as token_sold_symbol - , trs_1.amount as token_sold_amount_raw - , trs_1.amount/pow(10,COALESCE(dec_1.decimals,9)) as token_sold_amount - , account_pair as pool_id --p.pool_id - , sp.call_tx_signer as trader_id - , sp.call_tx_id as tx_id - , sp.call_outer_instruction_index as outer_instruction_index - , COALESCE(sp.call_inner_instruction_index, 0) as inner_instruction_index - , sp.call_tx_index as tx_index - , COALESCE(tk_2.token_mint_address, cast(null as varchar)) as token_bought_mint_address - , COALESCE(tk_1.token_mint_address, cast(null as varchar)) as token_sold_mint_address - , trs_2.account_source as token_bought_vault - , trs_1.account_destination as token_sold_vault - FROM {{ source('goosefx_solana', 'gfx_ssl_v2_call_swap') }} sp - INNER JOIN {{ source('spl_token_solana', 'spl_token_call_transfer') }} trs_1 - ON trs_1.call_tx_id = sp.call_tx_id - AND trs_1.call_block_time = sp.call_block_time - AND trs_1.call_outer_instruction_index = sp.call_outer_instruction_index - AND trs_1.call_inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 1 - {% if is_incremental() %} - AND {{incremental_predicate('trs_1.call_block_time')}} - {% else %} - AND trs_1.call_block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - INNER JOIN {{ source('spl_token_solana', 'spl_token_call_transfer') }} trs_2 - ON trs_2.call_tx_id = sp.call_tx_id - AND trs_2.call_block_time = sp.call_block_time - AND trs_2.call_outer_instruction_index = sp.call_outer_instruction_index - AND trs_2.call_inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 2 - {% if is_incremental() %} - AND {{incremental_predicate('trs_2.call_block_time')}} - {% else %} - AND trs_2.call_block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - --we want to get what token was transfered out first as this is the sold token. THIS MUST BE THE DESTINATION account, the source account is commonly created/closed through swap legs. - LEFT JOIN {{ ref('solana_utils_token_accounts') }} tk_1 ON tk_1.address = trs_1.account_destination - LEFT JOIN {{ ref('solana_utils_token_accounts') }} tk_2 ON tk_2.address = trs_2.account_source - LEFT JOIN {{ ref('tokens_solana_fungible') }} dec_1 ON dec_1.token_mint_address = tk_1.token_mint_address - LEFT JOIN {{ ref('tokens_solana_fungible') }} dec_2 ON dec_2.token_mint_address = tk_2.token_mint_address - WHERE 1=1 - {% if is_incremental() %} - AND {{incremental_predicate('sp.call_block_time')}} - {% else %} - AND sp.call_block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - ) - -SELECT - tb.blockchain - , tb.project - , tb.version - , CAST(date_trunc('month', tb.block_time) AS DATE) as block_month - , tb.block_time - , tb.token_pair - , tb.trade_source - , tb.token_bought_symbol - , tb.token_bought_amount - , tb.token_bought_amount_raw - , tb.token_sold_symbol - , tb.token_sold_amount - , tb.token_sold_amount_raw - , COALESCE(tb.token_sold_amount * p_sold.price, tb.token_bought_amount * p_bought.price) as amount_usd - , cast(null as double) as fee_tier - , cast(null as double) as fee_usd - , tb.token_sold_mint_address - , tb.token_bought_mint_address - , tb.token_sold_vault - , tb.token_bought_vault - , tb.pool_id as project_program_id - , tb.trader_id - , tb.tx_id - , tb.outer_instruction_index - , tb.inner_instruction_index - , tb.tx_index -FROM all_swaps tb -LEFT JOIN {{ source('prices', 'usd') }} p_bought ON p_bought.blockchain = 'solana' - AND date_trunc('minute', tb.block_time) = p_bought.minute - AND token_bought_mint_address = toBase58(p_bought.contract_address) - {% if is_incremental() %} - AND {{incremental_predicate('p_bought.minute')}} - {% else %} - AND p_bought.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} p_sold ON p_sold.blockchain = 'solana' - AND date_trunc('minute', tb.block_time) = p_sold.minute - AND token_sold_mint_address = toBase58(p_sold.contract_address) - {% if is_incremental() %} - AND {{incremental_predicate('p_sold.minute')}} - {% else %} - AND p_sold.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} \ No newline at end of file +select + * +from + {{ ref('dex_solana_trades') }} +where + project = 'goosefx_ssl' + and version = 2 \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/meteora/_schema.yml b/dbt_subprojects/solana/models/_sector/dex/meteora/_schema.yml index f9d7c041a3d..e9ad50c0d5c 100644 --- a/dbt_subprojects/solana/models/_sector/dex/meteora/_schema.yml +++ b/dbt_subprojects/solana/models/_sector/dex/meteora/_schema.yml @@ -1,6 +1,31 @@ version: 2 models: + - name: meteora_v1_solana_base_trades + meta: + blockchain: solana + contributors: [ ilemi ] + config: + tags: [ 'solana','dex' ] + description: > + all meteora amm dex trades on Solana + tests: + - check_columns_solana_dex_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [ 'tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index', 'block_month' ] + - name: meteora_v2_solana_base_trades + meta: + blockchain: solana + contributors: [ ilemi ] + config: + tags: [ 'solana','dex' ] + description: > + all meteora amm dex trades on Solana + tests: + - check_columns_solana_dex_trades + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [ 'tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index', 'block_month' ] + - name: meteora_v1_solana_trades meta: blockchain: solana @@ -9,14 +34,6 @@ models: tags: ['solana','dex'] description: > all meteora amm dex trades on Solana - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_month - - tx_id - - outer_instruction_index - - inner_instruction_index - - tx_index columns: - &blockchain name: blockchain @@ -33,6 +50,9 @@ models: - &block_time name: block_time description: "UTC event block time of each DEX trade" + - &block_slot + name: block_slot + description: "block slot of each DEX trade" - &trade_source name: trade_source description: "Was the trade a direct call to the pool or did it go through another program like Jupiter (Dex Aggregator)" @@ -80,7 +100,10 @@ models: description: "token associated address, of the token sold" - &project_program_id name: project_program_id - description: "Project program id that the trade was executed on - like the pool id" + description: "pool program id of the project" + - &project_main_id + name: project_main_id + description: "main program id of the project" - &trader_id name: trader_id description: "id (address) of trader who purchased a token" @@ -105,20 +128,13 @@ models: tags: ['solana','dex'] description: > all meteora lb_clmm dex trades on Solana - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_month - - tx_id - - outer_instruction_index - - inner_instruction_index - - tx_index columns: - *blockchain - *project - *version - *block_month - *block_time + - *block_slot - *trade_source - *token_bought_symbol - *token_sold_symbol @@ -135,6 +151,7 @@ models: - *token_bought_vault - *token_sold_vault - *project_program_id + - *project_main_id - *trader_id - *tx_id - *outer_instruction_index diff --git a/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v1_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v1_solana_base_trades.sql new file mode 100644 index 00000000000..5e6f2ac9e37 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v1_solana_base_trades.sql @@ -0,0 +1,116 @@ + {{ + config( + schema = 'meteora_v1_solana', + alias = 'base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'] + ) +}} + +{% set project_start_date = '2021-03-21' %} --grabbed program deployed at time (account created at). + +WITH + all_swaps as ( + SELECT + sp.call_block_time as block_time + , sp.call_block_slot as block_slot + , 'meteora' as project + , 1 as version + , 'solana' as blockchain + , case when sp.call_is_inner = False then 'direct' + else sp.call_outer_executing_account + end as trade_source + -- -- token bought is always the second instruction (transfer) in the inner instructions + , trs_2.amount as token_bought_amount_raw + , trs_1.amount as token_sold_amount_raw + , sp.account_pool as pool_id --p.pool_id + , sp.call_tx_signer as trader_id + , sp.call_tx_id as tx_id + , sp.call_outer_instruction_index as outer_instruction_index + , COALESCE(sp.call_inner_instruction_index, 0) as inner_instruction_index + , sp.call_tx_index as tx_index + , COALESCE(trs_2.token_mint_address, cast(null as varchar)) as token_bought_mint_address + , COALESCE(trs_1.token_mint_address, cast(null as varchar)) as token_sold_mint_address + , trs_2.from_token_account as token_bought_vault + , trs_1.to_token_account as token_sold_vault + FROM ( + SELECT + sp.* + , dp.call_inner_instruction_index as deposit_index + , row_number() over (partition by sp.call_tx_id, sp.call_outer_instruction_index, sp.call_inner_instruction_index order by dp.call_inner_instruction_index asc) as first_deposit + FROM + {{ source('meteora_pools_solana', 'amm_call_swap') }} sp + LEFT JOIN + {{ source('meteora_vault_solana', 'vault_call_deposit') }} dp ON sp.call_tx_id = dp.call_tx_id + AND sp.call_block_slot = dp.call_block_slot + AND sp.call_outer_instruction_index = dp.call_outer_instruction_index + and COALESCE(sp.call_inner_instruction_index, 0) < dp.call_inner_instruction_index + {% if is_incremental() %} + AND {{incremental_predicate('dp.call_block_time')}} + {% else %} + AND dp.call_block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + WHERE + 1=1 + {% if is_incremental() %} + AND {{incremental_predicate('sp.call_block_time')}} + {% else %} + AND sp.call_block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + ) sp + INNER JOIN + {{ ref('tokens_solana_transfers') }} trs_1 + ON trs_1.tx_id = sp.call_tx_id + AND trs_1.block_date = sp.call_block_date + AND trs_1.block_time = sp.call_block_time + AND trs_1.outer_instruction_index = sp.call_outer_instruction_index + AND trs_1.inner_instruction_index = sp.deposit_index + 1 + {% if is_incremental() %} + AND {{incremental_predicate('trs_1.block_time')}} + {% else %} + AND trs_1.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + INNER JOIN + {{ ref('tokens_solana_transfers') }} trs_2 + ON trs_2.tx_id = sp.call_tx_id + AND trs_2.block_date = sp.call_block_date + AND trs_2.block_time = sp.call_block_time + AND trs_2.outer_instruction_index = sp.call_outer_instruction_index + AND trs_2.inner_instruction_index = sp.deposit_index + 4 + {% if is_incremental() %} + AND {{incremental_predicate('trs_2.block_time')}} + {% else %} + AND trs_2.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + WHERE + 1=1 + and first_deposit = 1 --keep only the first deposit after swap invoke + ) + +SELECT + tb.blockchain + , tb.project + , tb.version + , CAST(date_trunc('month', tb.block_time) AS DATE) as block_month + , tb.block_time + , tb.block_slot + , tb.trade_source + , tb.token_bought_amount_raw + , tb.token_sold_amount_raw + , cast(null as double) as fee_tier + , tb.token_sold_mint_address + , tb.token_bought_mint_address + , tb.token_sold_vault + , tb.token_bought_vault + , tb.pool_id as project_program_id + , 'Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB' as project_main_id + , tb.trader_id + , tb.tx_id + , tb.outer_instruction_index + , tb.inner_instruction_index + , tb.tx_index +FROM all_swaps tb \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v1_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v1_solana_trades.sql index 56ec89c5816..f75b3c2ce80 100644 --- a/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v1_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v1_solana_trades.sql @@ -2,161 +2,16 @@ config( schema = 'meteora_v1_solana', alias = 'trades', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'] - ) + materialized = 'view', + post_hook='{{ expose_spells(\'["solana"]\', + "project", + "meteroa", + \'["ilemi"]\') }}') }} - -{% set project_start_date = '2021-03-21' %} --grabbed program deployed at time (account created at). - - WITH - pools as ( - --technically not used below, but here for a dex_solana.pools spell later on. - SELECT - tkA.symbol as tokenA_symbol - , tkA.decimals as tokenA_decimals - , ip.account_tokenAMint as tokenA - , ip.account_aTokenVault as tokenAVault - , tkB.symbol as tokenB_symbol - , tkB.decimals as tokenB_decimals - , ip.account_tokenAMint as tokenB - , ip.account_bTokenVault as tokenBVault - , cast(null as varchar) as fee_tier - , ip.account_pool as pool_id - , ip.call_tx_id as init_tx - , ip.call_block_time as init_time - FROM {{ source('meteora_pools_solana', 'amm_call_initialize') }} ip - LEFT JOIN {{ ref('tokens_solana_fungible') }} tkA ON tkA.token_mint_address = ip.account_tokenAMint - LEFT JOIN {{ ref('tokens_solana_fungible') }} tkB ON tkB.token_mint_address = ip.account_tokenBMint - --force - ) - - , all_swaps as ( - SELECT - sp.call_block_time as block_time - , 'meteora' as project - , 1 as version - , 'solana' as blockchain - , case when sp.call_is_inner = False then 'direct' - else sp.call_outer_executing_account - end as trade_source - , case - when lower(dec_1.symbol) > lower(dec_2.symbol) then concat(dec_1.symbol, '-', dec_2.symbol) - else concat(dec_2.symbol, '-', dec_1.symbol) - end as token_pair - , COALESCE(dec_2.symbol, dec_2.token_mint_address) as token_bought_symbol - -- -- token bought is always the second instruction (transfer) in the inner instructions - , trs_2.amount as token_bought_amount_raw - , trs_2.amount/pow(10,COALESCE(dec_2.decimals,9)) as token_bought_amount - , COALESCE(dec_1.symbol, dec_1.token_mint_address) as token_sold_symbol - , trs_1.amount as token_sold_amount_raw - , trs_1.amount/pow(10,COALESCE(dec_1.decimals,9)) as token_sold_amount - , account_pool as pool_id --p.pool_id - , sp.call_tx_signer as trader_id - , sp.call_tx_id as tx_id - , sp.call_outer_instruction_index as outer_instruction_index - , COALESCE(sp.call_inner_instruction_index, 0) as inner_instruction_index - , sp.call_tx_index as tx_index - , COALESCE(tk_2.token_mint_address, cast(null as varchar)) as token_bought_mint_address - , COALESCE(tk_1.token_mint_address, cast(null as varchar)) as token_sold_mint_address - , trs_2.account_source as token_bought_vault - , trs_1.account_destination as token_sold_vault - FROM ( - SELECT - sp.* - , dp.call_inner_instruction_index as deposit_index - , row_number() over (partition by sp.call_tx_id, sp.call_outer_instruction_index, sp.call_inner_instruction_index order by dp.call_inner_instruction_index asc) as first_deposit - FROM {{ source('meteora_pools_solana', 'amm_call_swap') }} sp - LEFT JOIN {{ source('meteora_vault_solana', 'vault_call_deposit') }} dp ON sp.call_tx_id = dp.call_tx_id - AND sp.call_block_slot = dp.call_block_slot - AND sp.call_outer_instruction_index = dp.call_outer_instruction_index - and COALESCE(sp.call_inner_instruction_index, 0) < dp.call_inner_instruction_index - {% if is_incremental() %} - AND {{incremental_predicate('dp.call_block_time')}} - {% else %} - AND dp.call_block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - WHERE 1=1 - {% if is_incremental() %} - AND {{incremental_predicate('sp.call_block_time')}} - {% else %} - AND sp.call_block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - ) sp - INNER JOIN {{ source('spl_token_solana', 'spl_token_call_transfer') }} trs_1 - ON trs_1.call_tx_id = sp.call_tx_id - AND trs_1.call_block_time = sp.call_block_time - AND trs_1.call_outer_instruction_index = sp.call_outer_instruction_index - AND trs_1.call_inner_instruction_index = sp.deposit_index + 1 - {% if is_incremental() %} - AND {{incremental_predicate('trs_1.call_block_time')}} - {% else %} - AND trs_1.call_block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - INNER JOIN {{ source('spl_token_solana', 'spl_token_call_transfer') }} trs_2 - ON trs_2.call_tx_id = sp.call_tx_id - AND trs_2.call_block_time = sp.call_block_time - AND trs_2.call_outer_instruction_index = sp.call_outer_instruction_index - AND trs_2.call_inner_instruction_index = sp.deposit_index + 4 - {% if is_incremental() %} - AND {{incremental_predicate('trs_2.call_block_time')}} - {% else %} - AND trs_2.call_block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - --we want to get what token was transfered out first as this is the sold token. THIS MUST BE THE DESTINATION account, the source account is commonly created/closed through swap legs. - LEFT JOIN {{ ref('solana_utils_token_accounts') }} tk_1 ON tk_1.address = trs_1.account_destination - LEFT JOIN {{ ref('solana_utils_token_accounts') }} tk_2 ON tk_2.address = trs_2.account_source - LEFT JOIN {{ ref('tokens_solana_fungible') }} dec_1 ON dec_1.token_mint_address = tk_1.token_mint_address - LEFT JOIN {{ ref('tokens_solana_fungible') }} dec_2 ON dec_2.token_mint_address = tk_2.token_mint_address - WHERE 1=1 - and first_deposit = 1 --keep only the first deposit after swap invoke - ) - -SELECT - tb.blockchain - , tb.project - , tb.version - , CAST(date_trunc('month', tb.block_time) AS DATE) as block_month - , tb.block_time - , tb.token_pair - , tb.trade_source - , tb.token_bought_symbol - , tb.token_bought_amount - , tb.token_bought_amount_raw - , tb.token_sold_symbol - , tb.token_sold_amount - , tb.token_sold_amount_raw - , COALESCE(tb.token_sold_amount * p_sold.price, tb.token_bought_amount * p_bought.price) as amount_usd - , cast(null as double) as fee_tier - , cast(null as double) as fee_usd - , tb.token_sold_mint_address - , tb.token_bought_mint_address - , tb.token_sold_vault - , tb.token_bought_vault - , tb.pool_id as project_program_id - , tb.trader_id - , tb.tx_id - , tb.outer_instruction_index - , tb.inner_instruction_index - , tb.tx_index -FROM all_swaps tb -LEFT JOIN {{ source('prices', 'usd') }} p_bought ON p_bought.blockchain = 'solana' - AND date_trunc('minute', tb.block_time) = p_bought.minute - AND token_bought_mint_address = toBase58(p_bought.contract_address) - {% if is_incremental() %} - AND {{incremental_predicate('p_bought.minute')}} - {% else %} - AND p_bought.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} p_sold ON p_sold.blockchain = 'solana' - AND date_trunc('minute', tb.block_time) = p_sold.minute - AND token_sold_mint_address = toBase58(p_sold.contract_address) - {% if is_incremental() %} - AND {{incremental_predicate('p_sold.minute')}} - {% else %} - AND p_sold.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} \ No newline at end of file +select + * +from + {{ ref('dex_solana_trades') }} +where + project = 'meteora' + and version = 1 \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v2_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v2_solana_base_trades.sql new file mode 100644 index 00000000000..170158fc389 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v2_solana_base_trades.sql @@ -0,0 +1,92 @@ + {{ + config( + schema = 'meteora_v2_solana', + alias = 'base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'] + ) +}} + +{% set project_start_date = '2023-11-01' %} --grabbed program deployed at time (account created at). + +WITH + all_swaps as ( + SELECT + sp.call_block_time as block_time + , sp.call_block_slot as block_slot + , 'meteora' as project + , 2 as version + , 'solana' as blockchain + , case when sp.call_is_inner = False then 'direct' + else sp.call_outer_executing_account + end as trade_source + -- -- token bought is always the second instruction (transfer) in the inner instructions + , trs_2.amount as token_bought_amount_raw + , trs_1.amount as token_sold_amount_raw + , sp.account_lbPair as pool_id --p.pool_id + , sp.call_tx_signer as trader_id + , sp.call_tx_id as tx_id + , sp.call_outer_instruction_index as outer_instruction_index + , COALESCE(sp.call_inner_instruction_index, 0) as inner_instruction_index + , sp.call_tx_index as tx_index + , COALESCE(trs_2.token_mint_address, cast(null as varchar)) as token_bought_mint_address + , COALESCE(trs_1.token_mint_address, cast(null as varchar)) as token_sold_mint_address + , trs_2.from_token_account as token_bought_vault + , trs_1.to_token_account as token_sold_vault + FROM + {{ source('meteora_solana','lb_clmm_call_swap') }} sp + INNER JOIN + {{ ref('tokens_solana_transfers') }} trs_1 + ON trs_1.tx_id = sp.call_tx_id + AND trs_1.block_date = sp.call_block_date + AND trs_1.block_time = sp.call_block_time + AND trs_1.outer_instruction_index = sp.call_outer_instruction_index + AND trs_1.inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 1 + {% if is_incremental() %} + AND {{incremental_predicate('trs_1.block_time')}} + {% else %} + AND trs_1.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + INNER JOIN + {{ ref('tokens_solana_transfers') }} trs_2 + ON trs_2.tx_id = sp.call_tx_id + AND trs_2.block_date = sp.call_block_date + AND trs_2.block_time = sp.call_block_time + AND trs_2.outer_instruction_index = sp.call_outer_instruction_index + AND trs_2.inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 2 + {% if is_incremental() %} + AND {{incremental_predicate('trs_2.block_time')}} + {% else %} + AND trs_2.block_time >= TIMESTAMP '{{project_start_date}}' + {% endif %} + WHERE + 1=1 + ) + +SELECT + tb.blockchain + , tb.project + , tb.version + , CAST(date_trunc('month', tb.block_time) AS DATE) as block_month + , tb.block_time + , tb.block_slot + , tb.trade_source + , tb.token_bought_amount_raw + , tb.token_sold_amount_raw + , cast(null as double) as fee_tier + , tb.token_sold_mint_address + , tb.token_bought_mint_address + , tb.token_sold_vault + , tb.token_bought_vault + , tb.pool_id as project_program_id + , 'LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo' as project_main_id + , tb.trader_id + , tb.tx_id + , tb.outer_instruction_index + , tb.inner_instruction_index + , tb.tx_index +FROM all_swaps tb \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v2_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v2_solana_trades.sql index c10f6770dc1..1174d0eb221 100644 --- a/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v2_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/meteora/meteora_v2_solana_trades.sql @@ -2,115 +2,16 @@ config( schema = 'meteora_v2_solana', alias = 'trades', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'] - ) + materialized = 'view', + post_hook='{{ expose_spells(\'["solana"]\', + "project", + "meteroa", + \'["ilemi"]\') }}') }} - -{% set project_start_date = '2023-11-01' %} --grabbed program deployed at time (account created at). - - WITH - all_swaps as ( - SELECT - sp.call_block_time as block_time - , 'meteora' as project - , 2 as version - , 'solana' as blockchain - , case when sp.call_is_inner = False then 'direct' - else sp.call_outer_executing_account - end as trade_source - , case - when lower(dec_1.symbol) > lower(dec_2.symbol) then concat(dec_1.symbol, '-', dec_2.symbol) - else concat(dec_2.symbol, '-', dec_1.symbol) - end as token_pair - , COALESCE(dec_2.symbol, dec_2.token_mint_address) as token_bought_symbol - -- -- token bought is always the second instruction (transfer) in the inner instructions - , trs_2.amount as token_bought_amount_raw - , trs_2.amount/pow(10,COALESCE(dec_2.decimals,9)) as token_bought_amount - , COALESCE(dec_1.symbol, dec_1.token_mint_address) as token_sold_symbol - , trs_1.amount as token_sold_amount_raw - , trs_1.amount/pow(10,COALESCE(dec_1.decimals,9)) as token_sold_amount - , account_lbPair as pool_id --p.pool_id - , sp.call_tx_signer as trader_id - , sp.call_tx_id as tx_id - , sp.call_outer_instruction_index as outer_instruction_index - , COALESCE(sp.call_inner_instruction_index, 0) as inner_instruction_index - , sp.call_tx_index as tx_index - , COALESCE(trs_2.token_mint_address, cast(null as varchar)) as token_bought_mint_address - , COALESCE(trs_1.token_mint_address, cast(null as varchar)) as token_sold_mint_address - , trs_2.from_token_account as token_bought_vault - , trs_1.to_token_account as token_sold_vault - FROM {{ source('meteora_solana','lb_clmm_call_swap') }} sp - INNER JOIN {{ ref('tokens_solana_transfers') }} trs_1 - ON trs_1.tx_id = sp.call_tx_id - AND trs_1.block_time = sp.call_block_time - AND trs_1.outer_instruction_index = sp.call_outer_instruction_index - AND trs_1.inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 1 - {% if is_incremental() %} - AND {{incremental_predicate('trs_1.block_time')}} - {% else %} - AND trs_1.block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - INNER JOIN {{ ref('tokens_solana_transfers') }} trs_2 - ON trs_2.tx_id = sp.call_tx_id - AND trs_2.block_time = sp.call_block_time - AND trs_2.outer_instruction_index = sp.call_outer_instruction_index - AND trs_2.inner_instruction_index = COALESCE(sp.call_inner_instruction_index,0) + 2 - {% if is_incremental() %} - AND {{incremental_predicate('trs_2.block_time')}} - {% else %} - AND trs_2.block_time >= TIMESTAMP '{{project_start_date}}' - {% endif %} - LEFT JOIN {{ ref('tokens_solana_fungible') }} dec_1 ON dec_1.token_mint_address = trs_1.token_mint_address - LEFT JOIN {{ ref('tokens_solana_fungible') }} dec_2 ON dec_2.token_mint_address = trs_2.token_mint_address - WHERE 1=1 - ) - -SELECT - tb.blockchain - , tb.project - , tb.version - , CAST(date_trunc('month', tb.block_time) AS DATE) as block_month - , tb.block_time - , tb.token_pair - , tb.trade_source - , tb.token_bought_symbol - , tb.token_bought_amount - , tb.token_bought_amount_raw - , tb.token_sold_symbol - , tb.token_sold_amount - , tb.token_sold_amount_raw - , COALESCE(tb.token_sold_amount * p_sold.price, tb.token_bought_amount * p_bought.price) as amount_usd - , cast(null as double) as fee_tier - , cast(null as double) as fee_usd - , tb.token_sold_mint_address - , tb.token_bought_mint_address - , tb.token_sold_vault - , tb.token_bought_vault - , tb.pool_id as project_program_id - , tb.trader_id - , tb.tx_id - , tb.outer_instruction_index - , tb.inner_instruction_index - , tb.tx_index -FROM all_swaps tb -LEFT JOIN {{ source('prices', 'usd') }} p_bought ON p_bought.blockchain = 'solana' - AND date_trunc('minute', tb.block_time) = p_bought.minute - AND token_bought_mint_address = toBase58(p_bought.contract_address) - {% if is_incremental() %} - AND {{incremental_predicate('p_bought.minute')}} - {% else %} - AND p_bought.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} -LEFT JOIN {{ source('prices', 'usd') }} p_sold ON p_sold.blockchain = 'solana' - AND date_trunc('minute', tb.block_time) = p_sold.minute - AND token_sold_mint_address = toBase58(p_sold.contract_address) - {% if is_incremental() %} - AND {{incremental_predicate('p_sold.minute')}} - {% else %} - AND p_sold.minute >= TIMESTAMP '{{project_start_date}}' - {% endif %} \ No newline at end of file +select + * +from + {{ ref('dex_solana_trades') }} +where + project = 'meteora' + and version = 2 \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_base_trades.sql index 879200f6b55..66bf69d2361 100644 --- a/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_base_trades.sql @@ -1,19 +1,15 @@ {{ config( - - schema = 'phoenix_v1', - alias = 'base_trades', - partition_by = ['block_month'], - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], - unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'], - pre_hook='{{ enforce_join_distribution("PARTITIONED") }}', - post_hook='{{ expose_spells(\'["solana"]\', - "project", - "phoenix", - \'["ilemi","jarryx"]\') }}') + schema = 'phoenix_v1', + alias = 'base_trades', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['tx_id', 'outer_instruction_index', 'inner_instruction_index', 'tx_index','block_month'], + pre_hook='{{ enforce_join_distribution("PARTITIONED") }}' + ) }} {% set project_start_date = '2023-02-15' %} --grabbed program deployed at time (account created at) diff --git a/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_trades.sql b/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_trades.sql index 9c1e398984a..e0a0dae3cae 100644 --- a/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_trades.sql @@ -5,7 +5,8 @@ post_hook='{{ expose_spells(\'["solana"]\', "project", "phoenix", - \'["ilemi","jarryx"]\') }}') + \'["ilemi","jarryx"]\') }}' + ) }} -- backwards compatible view so we don't break any user queries diff --git a/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/_schema.yml b/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/_schema.yml new file mode 100644 index 00000000000..7e7a3f18393 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/_schema.yml @@ -0,0 +1,138 @@ +version: 2 + +models: + - name: dex_solana_sandwiches + meta: + blockchain: solana + sector: dex + contributors: hildobby, ilemi + config: + tags: ['dex', 'mev', 'sandwiches', 'solana'] + description: > + DEX MEV Sandwich Trades on Solana + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_id + - outer_instruction_index + - inner_instruction_index + columns: + - &blockchain + name: blockchain + description: "Blockchain" + - &project + name: project + description: "Project name of the DEX" + - &version + name: version + description: "Version of the contract built and deployed by the DEX project" + - &block_time + name: block_time + description: "UTC event block time of each DEX trade" + - &block_month + name: block_month + description: "UTC event block month of each DEX trade" + - &block_number + name: block_number + description: "the block number of the block that the offer was created in" + - &token_sold_mint_address + name: token_sold_mint_address + description: "Contract address of the token sold" + - &token_bought_mint_address + name: token_bought_mint_address + description: "Contract address of the token bought" + - &token_sold_symbol + name: token_sold_symbol + description: "Token symbol for token sold in the trade" + - &token_bought_symbol + name: token_bought_symbol + description: "Token symbol for token bought in the trade" + - &trader_id + name: trader_id + description: "Trader ID" + - &tx_id + name: tx_hash + description: "Unique transaction hash value tied to each transaction on the DEX" + - &token_pair + name: token_pair + description: "Token symbol pair for each token involved in the trade" + - &tx_index + name: tx_index + description: "Index of the transaction in block" + - &token_sold_amount_raw + name: token_sold_amount_raw + description: "Raw value of the token sold at time of execution in the original currency" + - &token_bought_amount_raw + name: token_bought_amount_raw + description: "Raw value of the token bought at time of execution in the original currency" + - &token_sold_amount + name: token_sold_amount + description: "Value of the token sold at time of execution in the original currency" + - &token_bought_amount + name: token_bought_amount + description: "Value of the token bought at time of execution in the original currency" + - &amount_usd + name: amount_usd + description: "USD Value" + - &fee_tier + name: fee_tier + description: "" + - &fee_usd + name: fee_usd + description: "" + - &project_program_id + name: project_program_id + description: "" + - &outer_instruction_index + name: outer_instruction_index + description: "" + - &inner_instruction_index + name: inner_instruction_index + description: "" + - &trade_source + name: trade_source + description: "" + + - name: dex_solana_sandwiched + meta: + blockchain: solana + sector: dex + contributors: hildobby, ilemi + config: + tags: ['dex', 'mev', 'sandwiched', 'solana'] + description: > + DEX MEV Sandwiched Trades on Solana + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - tx_id + - outer_instruction_index + - inner_instruction_index + columns: + - *blockchain + - *project + - *version + - *block_time + - *block_month + - *block_number + - *token_sold_mint_address + - *token_bought_mint_address + - *token_sold_symbol + - *token_bought_symbol + - *trader_id + - *tx_id + - *token_pair + - *tx_index + - *token_sold_amount_raw + - *token_bought_amount_raw + - *token_sold_amount + - *token_bought_amount + - *amount_usd + - *fee_tier + - *fee_usd + - *project_program_id + - *outer_instruction_index + - *inner_instruction_index + - *trade_source \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/dex_solana_sandwiched.sql b/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/dex_solana_sandwiched.sql new file mode 100644 index 00000000000..16a9be69fab --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/dex_solana_sandwiched.sql @@ -0,0 +1,89 @@ +{% set blockchain = 'solana' %} + +{{ config( + schema = 'dex_' + blockchain, + alias = 'sandwiched', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'tx_id', 'outer_instruction_index', 'inner_instruction_index'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] +) +}} + +WITH sandwiches AS ( + SELECT + * + FROM + {{ ref('dex_solana_sandwiches') }} + {% if is_incremental() %} + WHERE + {{ incremental_predicate('block_time') }} + {% endif %} +), +sandwich_bounds AS ( + SELECT + front.block_month + , front.block_time + , front.tx_id AS min_tx_id + , back.tx_id AS max_tx_id + , front.project_program_id + , front.token_bought_mint_address + , front.token_sold_mint_address + FROM sandwiches as front + INNER JOIN sandwiches as back + ON front.block_month=back.block_month + AND front.block_time=back.block_time + AND front.trader_id=back.trader_id + AND front.project_program_id=back.project_program_id + AND front.token_sold_mint_address=back.token_bought_mint_address + AND front.token_bought_mint_address=back.token_sold_mint_address + AND front.tx_index+1 < back.tx_index +), dex AS ( + SELECT + * + FROM + {{ ref('dex_solana_trades') }} + WHERE + blockchain='{{blockchain}}' + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% endif %} +) +SELECT DISTINCT + dt.blockchain + , dt.project + , dt.version + , dt.block_time + , dt.block_slot + , dt.block_month + , dt.token_sold_mint_address + , dt.token_bought_mint_address + , dt.token_sold_vault + , dt.token_bought_vault + , dt.token_sold_symbol + , dt.token_bought_symbol + , dt.trader_id + , dt.tx_id + , dt.token_pair + , dt.token_sold_amount_raw + , dt.token_bought_amount_raw + , dt.token_sold_amount + , dt.token_bought_amount + , dt.amount_usd + , dt.fee_tier + , dt.fee_usd + , dt.project_program_id + , dt.outer_instruction_index + , dt.inner_instruction_index + , dt.trade_source + , dt.tx_index +FROM dex as dt +INNER JOIN sandwich_bounds as sb + ON sb.block_month=dt.block_month + AND sb.block_time=dt.block_time + AND sb.project_program_id=dt.project_program_id + AND sb.token_bought_mint_address=dt.token_bought_mint_address + AND sb.token_sold_mint_address=dt.token_sold_mint_address + AND dt.tx_id BETWEEN sb.min_tx_id AND sb.max_tx_id \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/dex_solana_sandwiches.sql b/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/dex_solana_sandwiches.sql new file mode 100644 index 00000000000..ee0bcd01a23 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/dex/sandwiches/solana/dex_solana_sandwiches.sql @@ -0,0 +1,101 @@ +{% set blockchain = 'solana' %} + +{{ config( + schema = 'dex_' + blockchain, + alias = 'sandwiches', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain', 'tx_id', 'outer_instruction_index', 'inner_instruction_index'] + ) +}} + +WITH dex AS ( + SELECT + * + FROM + {{ ref('dex_solana_trades') }} + WHERE + blockchain = '{{blockchain}}' + {% if is_incremental() %} + AND {{ incremental_predicate('block_time') }} + {% endif %} +) +, indexed_sandwich_trades AS ( + -- Checking that each frontrun trade has a matching backrun and at least one victim in between + SELECT DISTINCT + front.block_month + , front.block_time + , t.tx_id_unwrapped AS tx_id + , front.project_program_id + FROM dex as front + INNER JOIN dex as back + ON front.block_month=back.block_month + AND front.block_time=back.block_time + AND front.project_program_id=back.project_program_id + AND front.trader_id=back.trader_id + AND front.tx_index + 1 < back.tx_index + AND front.token_sold_mint_address=back.token_bought_mint_address + AND front.token_bought_mint_address=back.token_sold_mint_address + {% if is_incremental() %} + AND {{ incremental_predicate('back.block_time') }} + {% endif %} + INNER JOIN dex as victim + ON front.block_month=victim.block_month + AND front.block_time=victim.block_time + AND front.project_program_id=victim.project_program_id + AND victim.trader_id BETWEEN front.trader_id AND back.trader_id + AND front.token_bought_mint_address=victim.token_bought_mint_address + AND front.token_sold_mint_address=victim.token_sold_mint_address + {% if is_incremental() %} + AND {{ incremental_predicate('victim.block_time') }} + {% endif %} + CROSS JOIN UNNEST(ARRAY[front.tx_id, back.tx_id]) AS t(tx_id_unwrapped) + WHERE + 1 = 1 + {% if is_incremental() %} + AND {{ incremental_predicate('front.block_time') }} + {% endif %} +) + +-- Joining back with dex.trades to get the rest of the data & adding block_number and tx_index to the mix +SELECT + dt.blockchain + , dt.project + , dt.version + , dt.block_time + , dt.block_month + , dt.block_slot + , dt.token_sold_mint_address + , dt.token_bought_mint_address + , dt.token_sold_vault + , dt.token_bought_vault + , dt.token_sold_symbol + , dt.token_bought_symbol + , dt.trader_id + , dt.tx_id + , dt.token_pair + , dt.tx_index + , dt.token_sold_amount_raw + , dt.token_bought_amount_raw + , dt.token_sold_amount + , dt.token_bought_amount + , dt.amount_usd + , dt.fee_tier + , dt.fee_usd + , dt.project_program_id + , dt.outer_instruction_index + , dt.inner_instruction_index + , dt.trade_source +FROM dex as dt +INNER JOIN indexed_sandwich_trades as s + ON dt.block_month=s.block_month + AND dt.block_time=s.block_time + AND dt.tx_id=s.tx_id + AND dt.project_program_id=s.project_program_id +WHERE + 1 = 1 + {% if is_incremental() %} + AND {{ incremental_predicate('dt.block_time') }} + {% endif %} \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/nft/platforms/magiceden_mmm_solana_trades.sql b/dbt_subprojects/solana/models/_sector/nft/platforms/magiceden_mmm_solana_trades.sql index 4f568b796c7..5b7a6d42d82 100644 --- a/dbt_subprojects/solana/models/_sector/nft/platforms/magiceden_mmm_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/nft/platforms/magiceden_mmm_solana_trades.sql @@ -1,7 +1,6 @@ {{ config( schema = 'magiceden_mmm_solana' - , alias = 'trades' ,materialized = 'incremental' ,file_format = 'delta' @@ -15,510 +14,287 @@ ) }} -with - royalty_logs as ( - with - nested_logs as ( - select distinct - call_tx_id, - call_block_slot, - call_outer_instruction_index, - call_inner_instruction_index, - -- read all the fees from the log, if the log is truncated, no fees - cast( - json_extract_scalar( - json_parse(split(logs, ' ') [3]), - '$.royalty_paid' - ) as double - ) as royalty_paid, - cast( - json_extract_scalar(json_parse(split(logs, ' ') [3]), '$.total_price') as double - ) as total_price, - cast( - json_extract_scalar(json_parse(split(logs, ' ') [3]), '$.lp_fee') as double - ) as lp_fee, - logs - from - ( - ( - select - call_tx_id, - call_block_slot, - call_outer_instruction_index, - call_inner_instruction_index, - call_log_messages - from - {{ source('magic_eden_solana','mmm_call_solFulfillBuy') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_tx_id, - call_block_slot, - call_outer_instruction_index, - call_inner_instruction_index, - call_log_messages - from - {{ source('magic_eden_solana','mmm_call_solFulfillSell') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_tx_id, - call_block_slot, - call_outer_instruction_index, - call_inner_instruction_index, - call_log_messages - from - {{ source('magic_eden_solana','mmm_call_solMip1FulfillBuy') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_tx_id, - call_block_slot, - call_outer_instruction_index, - call_inner_instruction_index, - call_log_messages - from - {{ source('magic_eden_solana','mmm_call_solMip1FulfillSell') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_tx_id, - call_block_slot, - call_outer_instruction_index, - call_inner_instruction_index, - call_log_messages - from - {{ source('magic_eden_solana','mmm_call_solOcpFulfillBuy') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_tx_id, - call_block_slot, - call_outer_instruction_index, - call_inner_instruction_index, - call_log_messages - from - {{ source('magic_eden_solana','mmm_call_solOcpFulfillSell') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - ) - left join unnest (call_log_messages) as log_messages (logs) ON True - where - logs like 'Program log: {"lp_fee":%,"royalty_paid":%,"total_price":%}' --must log these fields. hopefully no other programs out there log them hahaha - and try(json_parse(split(logs, ' ') [3])) is not null --valid hex - ) +with source_data as ( + select + 'solFulfillBuy' as call_type, + call_tx_id, + call_block_slot, + call_block_time, + call_outer_instruction_index, + call_inner_instruction_index, + call_log_messages, + call_tx_signer, + account_owner as account_buyer, + call_tx_signer as account_seller, + account_assetMint as account_tokenMint, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.minPaymentAmount') as double) as buyerPrice, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.assetAmount') as double) as tokenSize, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.makerFeeBp') as double) as makerFeeBp, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.takerFeeBp') as double) as takerFeeBp, + call_account_arguments + from {{ source('magic_eden_solana','mmm_call_solFulfillBuy') }} + {% if is_incremental() %} + where {{incremental_predicate('call_block_time')}} + {% endif %} + + union all + + select + 'solMip1FulfillBuy' as call_type, + call_tx_id, + call_block_slot, + call_block_time, + call_outer_instruction_index, + call_inner_instruction_index, + call_log_messages, + call_tx_signer, + account_owner as account_buyer, + call_tx_signer as account_seller, + account_assetMint as account_tokenMint, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.minPaymentAmount') as double) as buyerPrice, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.assetAmount') as double) as tokenSize, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.makerFeeBp') as double) as makerFeeBp, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.takerFeeBp') as double) as takerFeeBp, + call_account_arguments + from {{ source('magic_eden_solana','mmm_call_solMip1FulfillBuy') }} + {% if is_incremental() %} + where {{incremental_predicate('call_block_time')}} + {% endif %} + + union all + + select + 'solOcpFulfillBuy' as call_type, + call_tx_id, + call_block_slot, + call_block_time, + call_outer_instruction_index, + call_inner_instruction_index, + call_log_messages, + call_tx_signer, + account_owner as account_buyer, + call_tx_signer as account_seller, + account_assetMint as account_tokenMint, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.minPaymentAmount') as double) as buyerPrice, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.assetAmount') as double) as tokenSize, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.makerFeeBp') as double) as makerFeeBp, + cast(json_value(args, 'strict $.SolFulfillBuyArgs.takerFeeBp') as double) as takerFeeBp, + call_account_arguments + from {{ source('magic_eden_solana','mmm_call_solOcpFulfillBuy') }} + {% if is_incremental() %} + where {{incremental_predicate('call_block_time')}} + {% endif %} + + union all + + select + 'solFulfillSell' as call_type, + call_tx_id, + call_block_slot, + call_block_time, + call_outer_instruction_index, + call_inner_instruction_index, + call_log_messages, + call_tx_signer, + call_tx_signer as account_buyer, + account_owner as account_seller, + account_assetMint as account_tokenMint, + cast(json_value(args, 'strict $.SolFulfillSellArgs.maxPaymentAmount') as double) as buyerPrice, + cast(json_value(args, 'strict $.SolFulfillSellArgs.assetAmount') as double) as tokenSize, + cast(json_value(args, 'strict $.SolFulfillSellArgs.makerFeeBp') as double) as makerFeeBp, + cast(json_value(args, 'strict $.SolFulfillSellArgs.takerFeeBp') as double) as takerFeeBp, + call_account_arguments + from {{ source('magic_eden_solana','mmm_call_solFulfillSell') }} + {% if is_incremental() %} + where {{incremental_predicate('call_block_time')}} + {% endif %} + + union all + + select + 'solMip1FulfillSell' as call_type, + call_tx_id, + call_block_slot, + call_block_time, + call_outer_instruction_index, + call_inner_instruction_index, + call_log_messages, + call_tx_signer, + call_tx_signer as account_buyer, + account_owner as account_seller, + account_assetMint as account_tokenMint, + cast(json_value(args, 'strict $.SolMip1FulfillSellArgs.maxPaymentAmount') as double) as buyerPrice, + cast(json_value(args, 'strict $.SolMip1FulfillSellArgs.assetAmount') as double) as tokenSize, + cast(json_value(args, 'strict $.SolMip1FulfillSellArgs.makerFeeBp') as double) as makerFeeBp, + cast(json_value(args, 'strict $.SolMip1FulfillSellArgs.takerFeeBp') as double) as takerFeeBp, + call_account_arguments + from {{ source('magic_eden_solana','mmm_call_solMip1FulfillSell') }} + {% if is_incremental() %} + where {{incremental_predicate('call_block_time')}} + {% endif %} + + union all + + select + 'solOcpFulfillSell' as call_type, + call_tx_id, + call_block_slot, + call_block_time, + call_outer_instruction_index, + call_inner_instruction_index, + call_log_messages, + call_tx_signer, + call_tx_signer as account_buyer, + account_owner as account_seller, + account_assetMint as account_tokenMint, + cast(json_value(args, 'strict $.SolOcpFulfillSellArgs.maxPaymentAmount') as double) as buyerPrice, + cast(json_value(args, 'strict $.SolOcpFulfillSellArgs.assetAmount') as double) as tokenSize, + cast(json_value(args, 'strict $.SolOcpFulfillSellArgs.makerFeeBp') as double) as makerFeeBp, + cast(json_value(args, 'strict $.SolOcpFulfillSellArgs.takerFeeBp') as double) as takerFeeBp, + call_account_arguments + from {{ source('magic_eden_solana','mmm_call_solOcpFulfillSell') }} + {% if is_incremental() %} + where {{incremental_predicate('call_block_time')}} + {% endif %} +), + +royalty_logs as ( + select distinct + call_tx_id, + call_block_slot, + call_outer_instruction_index, + call_inner_instruction_index, + cast(json_extract_scalar(json_parse(split(logs, ' ')[3]), '$.royalty_paid') as double) as royalty_paid, + cast(json_extract_scalar(json_parse(split(logs, ' ')[3]), '$.total_price') as double) as total_price, + cast(json_extract_scalar(json_parse(split(logs, ' ')[3]), '$.lp_fee') as double) as lp_fee, + row_number() over ( + partition by call_tx_id + order by call_outer_instruction_index asc, call_inner_instruction_index asc + ) as log_order + from source_data + left join unnest(call_log_messages) as log_messages (logs) on true + where logs like 'Program log: {"lp_fee":%,"royalty_paid":%,"total_price":%}' + and try(json_parse(split(logs, ' ')[3])) is not null +), + +-- Rest of the CTEs remain the same + +priced_tokens as ( + select + symbol, + to_base58(contract_address) as token_mint_address + from {{ source('prices', 'usd_latest') }} p + where p.blockchain = 'solana' + {% if is_incremental() %} + and {{incremental_predicate('p.minute')}} + {% endif %} +), + +trades as ( + with numbered_source_data as ( select *, row_number() over ( - partition by - call_tx_id - order by - call_outer_instruction_index asc, - call_inner_instruction_index asc - ) as log_order - from - nested_logs - ), - priced_tokens as ( - select - symbol, - to_base58(contract_address) as token_mint_address - from - {{ source('prices', 'usd_latest') }} p - where - p.blockchain = 'solana' - {% if is_incremental() %} - AND {{incremental_predicate('p.minute')}} - {% endif %} - ), - trades as ( - select - case - when account_buyer = call_tx_signer then 'buy' - else 'sell' - end as trade_category, - 'SOL' as trade_token_symbol, - 'So11111111111111111111111111111111111111112' as trade_token_mint, - total_price as price, - makerFeeBp / 1e4 * rl.total_price as maker_fee, - takerFeeBp / 1e4 * rl.total_price as taker_fee, - tokenSize as token_size, - rl.royalty_paid as royalty_fee, - rl.lp_fee as amm_fee, - trade.call_instruction_name as instruction, - trade.account_tokenMint, - trade.account_buyer, - trade.account_seller, - trade.call_outer_instruction_index as outer_instruction_index, - trade.call_inner_instruction_index as inner_instruction_index, - trade.call_block_time, - trade.call_block_slot, - trade.call_tx_id, - trade.call_tx_signer - from - ( - ( - select - call_instruction_name, - account_owner as account_buyer, - call_tx_signer as account_seller, - account_assetMint as account_tokenMint, - cast( - json_value( - args, - 'strict $.SolFulfillBuyArgs.minPaymentAmount' - ) as double - ) as buyerPrice, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.assetAmount') as double - ) as tokenSize, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.makerFeeBp') as double - ) as makerFeeBp, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.takerFeeBp') as double - ) as takerFeeBp, - call_outer_instruction_index, - call_inner_instruction_index, - call_block_time, - call_block_slot, - call_tx_id, - call_tx_signer, - call_account_arguments, - row_number() over ( - partition by - call_tx_id - order by - call_outer_instruction_index asc, - call_inner_instruction_index asc - ) as call_order - from - {{ source('magic_eden_solana','mmm_call_solFulfillBuy') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_instruction_name, - account_owner as account_buyer, - call_tx_signer as account_seller, - account_assetMint as account_tokenMint, - cast( - json_value( - args, - 'strict $.SolFulfillBuyArgs.minPaymentAmount' - ) as double - ) as buyerPrice, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.assetAmount') as double - ) as tokenSize, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.makerFeeBp') as double - ) as makerFeeBp, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.takerFeeBp') as double - ) as takerFeeBp, - call_outer_instruction_index, - call_inner_instruction_index, - call_block_time, - call_block_slot, - call_tx_id, - call_tx_signer, - call_account_arguments, - row_number() over ( - partition by - call_tx_id - order by - call_outer_instruction_index asc, - call_inner_instruction_index asc - ) as call_order - from - {{ source('magic_eden_solana','mmm_call_solMip1FulfillBuy') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_instruction_name, - account_owner as account_buyer, - call_tx_signer as account_seller, - account_assetMint as account_tokenMint, - cast( - json_value( - args, - 'strict $.SolFulfillBuyArgs.minPaymentAmount' - ) as double - ) as buyerPrice, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.assetAmount') as double - ) as tokenSize, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.makerFeeBp') as double - ) as makerFeeBp, - cast( - json_value(args, 'strict $.SolFulfillBuyArgs.takerFeeBp') as double - ) as takerFeeBp, - call_outer_instruction_index, - call_inner_instruction_index, - call_block_time, - call_block_slot, - call_tx_id, - call_tx_signer, - call_account_arguments, - row_number() over ( - partition by - call_tx_id - order by - call_outer_instruction_index asc, - call_inner_instruction_index asc - ) as call_order - from - {{ source('magic_eden_solana','mmm_call_solOcpFulfillBuy') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_instruction_name, - call_tx_signer as account_buyer, - account_owner as account_seller, - account_assetMint as account_tokenMint, - cast( - json_value( - args, - 'strict $.SolFulfillSellArgs.maxPaymentAmount' - ) as double - ) as buyerPrice, - cast( - json_value(args, 'strict $.SolFulfillSellArgs.assetAmount') as double - ) as tokenSize, - cast( - json_value(args, 'strict $.SolFulfillSellArgs.makerFeeBp') as double - ) as makerFeeBp, - cast( - json_value(args, 'strict $.SolFulfillSellArgs.takerFeeBp') as double - ) as takerFeeBp, - call_outer_instruction_index, - call_inner_instruction_index, - call_block_time, - call_block_slot, - call_tx_id, - call_tx_signer, - call_account_arguments, - row_number() over ( - partition by - call_tx_id - order by - call_outer_instruction_index asc, - call_inner_instruction_index asc - ) as call_order - from - {{ source('magic_eden_solana','mmm_call_solFulfillSell') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_instruction_name, - call_tx_signer as account_buyer, - account_owner as account_seller, - account_assetMint as account_tokenMint, - cast( - json_value( - args, - 'strict $.SolMip1FulfillSellArgs.maxPaymentAmount' - ) as double - ) as buyerPrice, - cast( - json_value( - args, - 'strict $.SolMip1FulfillSellArgs.assetAmount' - ) as double - ) as tokenSize, - cast( - json_value( - args, - 'strict $.SolMip1FulfillSellArgs.makerFeeBp' - ) as double - ) as makerFeeBp, - cast( - json_value( - args, - 'strict $.SolMip1FulfillSellArgs.takerFeeBp' - ) as double - ) as takerFeeBp, - call_outer_instruction_index, - call_inner_instruction_index, - call_block_time, - call_block_slot, - call_tx_id, - call_tx_signer, - call_account_arguments, - row_number() over ( - partition by - call_tx_id - order by - call_outer_instruction_index asc, - call_inner_instruction_index asc - ) as call_order - from - {{ source('magic_eden_solana','mmm_call_solMip1FulfillSell') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - union all - ( - select - call_instruction_name, - call_tx_signer as account_buyer, - account_owner as account_seller, - account_assetMint as account_tokenMint, - cast( - json_value( - args, - 'strict $.SolOcpFulfillSellArgs.maxPaymentAmount' - ) as double - ) as buyerPrice, - cast( - json_value( - args, - 'strict $.SolOcpFulfillSellArgs.assetAmount' - ) as double - ) as tokenSize, - cast( - json_value(args, 'strict $.SolOcpFulfillSellArgs.makerFeeBp') as double - ) as makerFeeBp, - cast( - json_value(args, 'strict $.SolOcpFulfillSellArgs.takerFeeBp') as double - ) as takerFeeBp, - call_outer_instruction_index, - call_inner_instruction_index, - call_block_time, - call_block_slot, - call_tx_id, - call_tx_signer, - call_account_arguments, - row_number() over ( - partition by - call_tx_id - order by - call_outer_instruction_index asc, - call_inner_instruction_index asc - ) as call_order - from - {{ source('magic_eden_solana','mmm_call_solOcpFulfillSell') }} - {% if is_incremental() %} - where {{incremental_predicate('call_block_time')}} - {% endif %} - ) - ) trade - left join royalty_logs rl ON trade.call_tx_id = rl.call_tx_id - and trade.call_block_slot = rl.call_block_slot - and trade.call_order = rl.log_order - left join priced_tokens pt ON contains( - trade.call_account_arguments, - pt.token_mint_address - ) - ), - raw_nft_trades as ( - select - 'solana' as blockchain, - 'magiceden' as project, - 'mmm' as version, - t.call_block_time as block_time, - 'secondary' as trade_type, - token_size as number_of_items, - t.trade_category, - t.account_buyer as buyer, - t.account_seller as seller, - t.price as amount_raw, - t.price / pow(10, p.decimals) as amount_original, - t.price / pow(10, p.decimals) * p.price as amount_usd, - t.trade_token_symbol as currency_symbol, - t.trade_token_mint as currency_address, - cast(null as varchar) as account_merkle_tree, - cast(null as bigint) leaf_id, - t.account_tokenMint as account_mint, - 'mmm3XBJg5gk8XJxEKBvdgptZz6SgK4tXvn36sodowMc' as project_program_id, - cast(null as varchar) as aggregator_name, - cast(null as varchar) as aggregator_address, - t.call_tx_id as tx_id, - t.call_block_slot as block_slot, - t.call_tx_signer as tx_signer, - t.taker_fee as taker_fee_amount_raw, - t.taker_fee / pow(10, p.decimals) as taker_fee_amount, - t.taker_fee / pow(10, p.decimals) * p.price as taker_fee_amount_usd, - case - when t.taker_fee = 0 - or t.price = 0 then 0 - else t.taker_fee / t.price - end as taker_fee_percentage, - t.maker_fee as maker_fee_amount_raw, - t.maker_fee / pow(10, p.decimals) as maker_fee_amount, - t.maker_fee / pow(10, p.decimals) * p.price as maker_fee_amount_usd, - case - when t.maker_fee = 0 - or t.price = 0 then 0 - else t.maker_fee / t.price - end as maker_fee_percentage, - t.amm_fee as amm_fee_amount_raw, - t.amm_fee / pow(10, p.decimals) as amm_fee_amount, - t.amm_fee / pow(10, p.decimals) * p.price as amm_fee_amount_usd, - case - when t.amm_fee = 0 - or t.price = 0 then 0 - else t.amm_fee / t.price - end as amm_fee_percentage, - t.royalty_fee as royalty_fee_amount_raw, - t.royalty_fee / pow(10, p.decimals) as royalty_fee_amount, - t.royalty_fee / pow(10, p.decimals) * p.price as royalty_fee_amount_usd, - case - when t.royalty_fee = 0 - or t.price = 0 then 0 - else t.royalty_fee / t.price - end as royalty_fee_percentage, - t.instruction, - t.outer_instruction_index, - coalesce(t.inner_instruction_index, 0) as inner_instruction_index - from - trades t - left join {{ source('prices', 'usd') }} p ON p.blockchain = 'solana' - and to_base58(p.contract_address) = t.trade_token_mint - and p.minute = date_trunc('minute', t.call_block_time) - {% if is_incremental() %} - and {{incremental_predicate('p.minute')}} - {% endif %} + partition by call_tx_id + order by call_outer_instruction_index asc, call_inner_instruction_index asc + ) as row_num + from source_data + ) + select + case when s.account_buyer = s.call_tx_signer then 'buy' else 'sell' end as trade_category, + 'SOL' as trade_token_symbol, + 'So11111111111111111111111111111111111111112' as trade_token_mint, + rl.total_price as price, + s.makerFeeBp / 1e4 * rl.total_price as maker_fee, + s.takerFeeBp / 1e4 * rl.total_price as taker_fee, + s.tokenSize as token_size, + rl.royalty_paid as royalty_fee, + rl.lp_fee as amm_fee, + s.call_type as instruction, + s.account_tokenMint, + s.account_buyer, + s.account_seller, + s.call_outer_instruction_index as outer_instruction_index, + s.call_inner_instruction_index as inner_instruction_index, + s.call_block_time, + s.call_block_slot, + s.call_tx_id, + s.call_tx_signer, + s.call_account_arguments + from numbered_source_data s + left join royalty_logs rl on s.call_tx_id = rl.call_tx_id + and s.call_block_slot = rl.call_block_slot + and s.row_num = rl.log_order + left join priced_tokens pt on contains(s.call_account_arguments, pt.token_mint_address) +), +raw_nft_trades as ( + select + 'solana' as blockchain, + 'magiceden' as project, + 'mmm' as version, + t.call_block_time as block_time, + 'secondary' as trade_type, + token_size as number_of_items, + t.trade_category, + t.account_buyer as buyer, + t.account_seller as seller, + t.price as amount_raw, + t.price / pow(10, p.decimals) as amount_original, + t.price / pow(10, p.decimals) * p.price as amount_usd, + t.trade_token_symbol as currency_symbol, + t.trade_token_mint as currency_address, + cast(null as varchar) as account_merkle_tree, + cast(null as bigint) leaf_id, + t.account_tokenMint as account_mint, + 'mmm3XBJg5gk8XJxEKBvdgptZz6SgK4tXvn36sodowMc' as project_program_id, + cast(null as varchar) as aggregator_name, + cast(null as varchar) as aggregator_address, + t.call_tx_id as tx_id, + t.call_block_slot as block_slot, + t.call_tx_signer as tx_signer, + t.taker_fee as taker_fee_amount_raw, + t.taker_fee / pow(10, p.decimals) as taker_fee_amount, + t.taker_fee / pow(10, p.decimals) * p.price as taker_fee_amount_usd, + case + when t.taker_fee = 0 + or t.price = 0 then 0 + else t.taker_fee / t.price + end as taker_fee_percentage, + t.maker_fee as maker_fee_amount_raw, + t.maker_fee / pow(10, p.decimals) as maker_fee_amount, + t.maker_fee / pow(10, p.decimals) * p.price as maker_fee_amount_usd, + case + when t.maker_fee = 0 + or t.price = 0 then 0 + else t.maker_fee / t.price + end as maker_fee_percentage, + t.amm_fee as amm_fee_amount_raw, + t.amm_fee / pow(10, p.decimals) as amm_fee_amount, + t.amm_fee / pow(10, p.decimals) * p.price as amm_fee_amount_usd, + case + when t.amm_fee = 0 + or t.price = 0 then 0 + else t.amm_fee / t.price + end as amm_fee_percentage, + t.royalty_fee as royalty_fee_amount_raw, + t.royalty_fee / pow(10, p.decimals) as royalty_fee_amount, + t.royalty_fee / pow(10, p.decimals) * p.price as royalty_fee_amount_usd, + case + when t.royalty_fee = 0 + or t.price = 0 then 0 + else t.royalty_fee / t.price + end as royalty_fee_percentage, + t.instruction, + t.outer_instruction_index, + coalesce(t.inner_instruction_index, 0) as inner_instruction_index + from + trades t + left join {{ source('prices', 'usd') }} p ON p.blockchain = 'solana' + and to_base58(p.contract_address) = t.trade_token_mint + and p.minute = date_trunc('minute', t.call_block_time) + {% if is_incremental() %} + and {{incremental_predicate('p.minute')}} + {% endif %} ) select * diff --git a/dbt_subprojects/solana/models/jupiter/jupiter_solana_aggregator_swaps.sql b/dbt_subprojects/solana/models/jupiter/jupiter_solana_aggregator_swaps.sql index e8a86bf5a0a..ebcc159fcb7 100644 --- a/dbt_subprojects/solana/models/jupiter/jupiter_solana_aggregator_swaps.sql +++ b/dbt_subprojects/solana/models/jupiter/jupiter_solana_aggregator_swaps.sql @@ -164,7 +164,7 @@ l.amm , l.tx_id , l.block_slot , l.block_time -, date_trunc('month', l.block_time) as block_month +, CAST(date_trunc('month', l.block_time) as DATE) as block_month , l.tx_signer , l.jup_version FROM ( diff --git a/dbt_subprojects/solana/models/jupiter/jupiter_solana_schema.yml b/dbt_subprojects/solana/models/jupiter/jupiter_solana_schema.yml index 09b6c404821..5c9903411e3 100644 --- a/dbt_subprojects/solana/models/jupiter/jupiter_solana_schema.yml +++ b/dbt_subprojects/solana/models/jupiter/jupiter_solana_schema.yml @@ -60,6 +60,7 @@ models: meta: blockchain: solana contributors: [ilemi] + docs_slug: /trading/solana/jupiter-aggregator-trades config: tags: ['solana','jupiter','swaps'] description: > diff --git a/dbt_subprojects/solana/models/solana_utils/solana_utils_daily_balances.sql b/dbt_subprojects/solana/models/solana_utils/solana_utils_daily_balances.sql index a928b529e24..ab404ca0ca5 100644 --- a/dbt_subprojects/solana/models/solana_utils/solana_utils_daily_balances.sql +++ b/dbt_subprojects/solana/models/solana_utils/solana_utils_daily_balances.sql @@ -45,6 +45,8 @@ SELECT , token_mint_address , token_balance , token_balance_owner + , block_time + , block_slot , {{ dbt_utils.generate_surrogate_key(['address', 'token_mint_address', 'day']) }} as unique_address_key , now() as updated_at FROM updated_balances diff --git a/dbt_subprojects/solana/models/solana_utils/solana_utils_latest_balances.sql b/dbt_subprojects/solana/models/solana_utils/solana_utils_latest_balances.sql index 1d757e3aa5f..75ed1194fc7 100644 --- a/dbt_subprojects/solana/models/solana_utils/solana_utils_latest_balances.sql +++ b/dbt_subprojects/solana/models/solana_utils/solana_utils_latest_balances.sql @@ -21,6 +21,8 @@ WITH , token_mint_address , token_balance , token_balance_owner + , block_time + , block_slot , row_number() OVER (partition by address order by day desc) as latest_balance FROM {{ ref('solana_utils_daily_balances') }} {% if is_incremental() %} @@ -31,6 +33,8 @@ WITH SELECT ub.address + , ub.block_time + , ub.block_slot , ub.sol_balance , ub.token_balance , coalesce(ub.token_mint_address, tk.token_mint_address) as token_mint_address diff --git a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_schema.yml b/dbt_subprojects/solana/models/tokens/solana/_schema.yml similarity index 100% rename from dbt_subprojects/solana/models/tokens/solana/tokens_solana_schema.yml rename to dbt_subprojects/solana/models/tokens/solana/_schema.yml diff --git a/dbt_subprojects/solana/models/tokens/solana/_sources.yml b/dbt_subprojects/solana/models/tokens/solana/_sources.yml new file mode 100644 index 00000000000..294bf600f1a --- /dev/null +++ b/dbt_subprojects/solana/models/tokens/solana/_sources.yml @@ -0,0 +1,42 @@ +version: 2 + +sources: + - name: spl_token_solana + description: "spl_token decoded tables" + tables: + - name: spl_token_call_initializeMint + - name: spl_token_call_initializeMint2 + - name: spl_token_call_transfer + - name: spl_token_call_transferChecked + - name: spl_token_call_mintTo + - name: spl_token_call_mintToChecked + - name: spl_token_call_burn + - name: spl_token_call_burnChecked + + - name: spl_token_2022_solana + description: "spl_token 2022 decoded tables" + tables: + - name: spl_token_2022_call_initializeMint + - name: spl_token_2022_call_initializeMint2 + - name: spl_token_2022_call_transferFeeExtension + - name: spl_token_2022_call_transferChecked + - name: spl_token_2022_call_mintTo + - name: spl_token_2022_call_mintToChecked + - name: spl_token_2022_call_burn + - name: spl_token_2022_call_burnChecked + + - name: mpl_token_metadata_solana + description: "mpl metadata decoded tables" + tables: + - name: mpl_token_metadata_call_Create + - name: mpl_token_metadata_call_CreateMetadataAccount + - name: mpl_token_metadata_call_CreateMetadataAccountV2 + - name: mpl_token_metadata_call_CreateMetadataAccountV3 + - name: mpl_token_metadata_call_CreateMasterEdition + - name: mpl_token_metadata_call_CreateMasterEditionV3 + - name: mpl_token_metadata_call_Verify + - name: bubblegum_solana + description: "bubblegum cNFT minting decoded tables" + tables: + - name: bubblegum_call_mintV1 + - name: bubblegum_call_mintToCollectionV1 \ No newline at end of file diff --git a/dbt_subprojects/solana/models/tokens/solana/tokens_solana.sources.yml b/dbt_subprojects/solana/models/tokens/solana/tokens_solana.sources.yml deleted file mode 100644 index 5a17103eee3..00000000000 --- a/dbt_subprojects/solana/models/tokens/solana/tokens_solana.sources.yml +++ /dev/null @@ -1,79 +0,0 @@ -version: 2 - -sources: - - name: spl_token_solana - description: "spl_token decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - tables: - - name: spl_token_call_initializeMint - loaded_at_field: call_block_time - - name: spl_token_call_initializeMint2 - loaded_at_field: call_block_time - - name: spl_token_call_transfer - loaded_at_field: call_block_time - - name: spl_token_call_transferChecked - loaded_at_field: call_block_time - - name: spl_token_call_mintTo - loaded_at_field: call_block_time - - name: spl_token_call_mintToChecked - loaded_at_field: call_block_time - - name: spl_token_call_burn - loaded_at_field: call_block_time - - name: spl_token_call_burnChecked - loaded_at_field: call_block_time - - - name: spl_token_2022_solana - description: "spl_token 2022 decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - tables: - - name: spl_token_2022_call_initializeMint - loaded_at_field: call_block_time - - name: spl_token_2022_call_initializeMint2 - loaded_at_field: call_block_time - - name: spl_token_2022_call_transferFeeExtension - loaded_at_field: call_block_time - - name: spl_token_2022_call_transferChecked - loaded_at_field: call_block_time - - name: spl_token_2022_call_mintTo - loaded_at_field: call_block_time - - name: spl_token_2022_call_mintToChecked - loaded_at_field: call_block_time - - name: spl_token_2022_call_burn - loaded_at_field: call_block_time - - name: spl_token_2022_call_burnChecked - loaded_at_field: call_block_time - - - name: mpl_token_metadata_solana - description: "mpl metadata decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - tables: - - name: mpl_token_metadata_call_Create - loaded_at_field: call_block_time - - name: mpl_token_metadata_call_CreateMetadataAccount - loaded_at_field: call_block_time - - name: mpl_token_metadata_call_CreateMetadataAccountV2 - loaded_at_field: call_block_time - - name: mpl_token_metadata_call_CreateMetadataAccountV3 - loaded_at_field: call_block_time - - name: mpl_token_metadata_call_CreateMasterEdition - loaded_at_field: call_block_time - - name: mpl_token_metadata_call_CreateMasterEditionV3 - loaded_at_field: call_block_time - - name: mpl_token_metadata_call_Verify - loaded_at_field: call_block_time - - name: bubblegum_solana - description: "bubblegum cNFT minting decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - tables: - - name: bubblegum_call_mintV1 - loaded_at_field: call_block_time - - name: bubblegum_call_mintToCollectionV1 - loaded_at_field: call_block_time \ No newline at end of file diff --git a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fees_history.sql b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fees_history.sql index 38554163a3f..3e82d78dc6a 100644 --- a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fees_history.sql +++ b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fees_history.sql @@ -10,7 +10,7 @@ unique_key = ['account_mint','fee_time'], post_hook='{{ expose_spells(\'["solana"]\', "sector", - "tokens", + "tokens_solana", \'["ilemi"]\') }}') }} --we need the fee basis points and maximum fee for token2022 transfers because the fee amount is not emitted in transferChecked diff --git a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fungible.sql b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fungible.sql index 3ff2f4301a9..65336581e19 100644 --- a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fungible.sql +++ b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_fungible.sql @@ -5,7 +5,7 @@ materialized = 'table', post_hook='{{ expose_spells(\'["solana"]\', "sector", - "tokens", + "tokens_solana", \'["ilemi"]\') }}' ) }} diff --git a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_nft.sql b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_nft.sql index d0b7076b9db..8a9756b9d87 100644 --- a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_nft.sql +++ b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_nft.sql @@ -6,7 +6,7 @@ materialized='table', post_hook='{{ expose_spells(\'["solana"]\', "sector", - "tokens", + "tokens_solana", \'["ilemi"]\') }}' ) }} diff --git a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_transfers.sql b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_transfers.sql index 7f850601d13..a5bacd252f3 100644 --- a/dbt_subprojects/solana/models/tokens/solana/tokens_solana_transfers.sql +++ b/dbt_subprojects/solana/models/tokens/solana/tokens_solana_transfers.sql @@ -10,7 +10,7 @@ unique_key = ['tx_id','outer_instruction_index','inner_instruction_index', 'block_slot'], post_hook='{{ expose_spells(\'["solana"]\', "sector", - "tokens", + "tokens_solana", \'["ilemi"]\') }}') }} diff --git a/dbt_subprojects/solana/packages.yml b/dbt_subprojects/solana/packages.yml index d4f9f38e076..ff9ca2cf98a 100644 --- a/dbt_subprojects/solana/packages.yml +++ b/dbt_subprojects/solana/packages.yml @@ -1,3 +1,3 @@ packages: - package: dbt-labs/dbt_utils - version: 1.2.0 \ No newline at end of file + version: 1.3.0 \ No newline at end of file diff --git a/dbt_subprojects/solana/seeds/alpha_dex/alpha_dex_solana_trades_seed.csv b/dbt_subprojects/solana/seeds/alpha_dex/alpha_dex_solana_trades_seed.csv new file mode 100644 index 00000000000..a60bfb9858f --- /dev/null +++ b/dbt_subprojects/solana/seeds/alpha_dex/alpha_dex_solana_trades_seed.csv @@ -0,0 +1,21 @@ +block_time,block_date,block_month,bot,blockchain,amount_usd,type,token_bought_amount,token_bought_symbol,token_bought_address,token_sold_amount,token_sold_symbol,token_sold_address,fee_usd,fee_token_amount,fee_token_symbol,fee_token_address,project,version,token_pair,project_contract_address,user,tx_id,tx_index,outer_instruction_index,inner_instruction_index,is_last_trade_in_transaction +2024-07-04 15:31:10.000 UTC,2024-07-04,2024-07-01,Alpha Dex,solana,268.36,Buy,65167.086368,BOBBY,48yNDqabAvGNfnkhadsV1MAvtp44fFDdHBRBdFhvpump,2,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-BOBBY,6pgNsBb4xJdfouzejx7qDYpibgRnLvopivtNGF6XJyys,5wgWiWxtXbbEaeis6eVjqwuBFJh4QzpWazmQt48m2ckU,4TH8nsLfeCyi4vpZBAKgHCJbiQeiCCX5xcVT8CKTwcZCTiVqrtL8MGrcLscGAKPJejFy1Bgfni75b1z16tCSjjJ7,71,5,0,true +2024-07-13 20:18:22.000 UTC,2024-07-13,2024-07-01,Alpha Dex,solana,70.11,Buy,2531493.950401,PINKY,J7YzdJMF7NxvSBqJi3uWGV3gGv367qbXdgG23qSrpump,0.5,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,SOL-PINKY,6n5RN92t4hh4pHs3aPaQNBXNpEcwtwVWPAm33jZK1Jds,KXxHQY8e1QTXf7oK2ZY8qqjpD1MW7j36ykJwq8Sg7PR,4jL7dszLcRMCCY6hPHK28cToYTocNvHAMaPD3hRZKa2D4Fj53EBjPyxqgwn7DHCDQ8Q449F8jgH64ug6G1B2m2dE,1440,5,4,true +2024-07-01 23:22:53.000 UTC,2024-07-01,2024-07-01,Alpha Dex,solana,73.355,Buy,3036223.686595,RAW,Ci5Rtq47wk3FuKLw4pyhJR236jkeFWXivwPcKbe3pump,0.5,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-RAW,BXcndJA2FDacDW2hXvg4dA1vBXHX3frx1gMuyq142pq1,DpbU5BoRvWQqAVJFj5dQfT51D7qitmxM7pUNiaMGi2nK,5FiULyBRobWsxhScRe2di2E5dirXjNZrWqXeker7QpafwWBWMLhw3ocmGhSrkH3r6iiixZ2MpMhdyYxg3NLdMxSU,12,5,0,true +2024-07-31 04:37:27.000 UTC,2024-07-31,2024-07-01,Alpha Dex,solana,269.685,Buy,634170.565465,Knight,LVCQ1YmeK6DECKqcwmscyDRxUYJpiGth9ppGKtopump,1.5,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-Knight,HgGd3E2HWsAzb4PpoXbgfZDjwSnBN7MBgQAFouREhcXG,DvNtzjS6umGVuv7uvXtP9GPW8Xdkie1jZ6V9bgf7Hte2,5TkmqSZg526uM2VMbEbB39SwSKEyqrGLn7Vd1NE3F79oZPp7iqNvAgGPZRtrhNazDp8J6wPdE3Rsaxr4PPnVB5Gh,573,7,1,true +2024-07-25 02:50:52.000 UTC,2024-07-25,2024-07-01,Alpha Dex,solana,2021.596454679576,Buy,2020.436724,USDC,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,11.9,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,whirlpool,1,USDC-SOL,FpCMFDFGYotvufJ7HrFHsWEiiQCGbkLCtwHiDnh7o28Q,DvNtzjS6umGVuv7uvXtP9GPW8Xdkie1jZ6V9bgf7Hte2,4ErtKWQAx36hLweQyv2h9VbzJSoLDvBwDybH9rn5sE5xWDSUgpwZMQSqouM2UdWwEi2cNGXXLtBvx7qoLn7YeHRW,110,6,1,true +2024-07-01 03:15:46.000 UTC,2024-07-01,2024-07-01,Alpha Dex,solana,29.532,Buy,35063.62997,JACK,EUZ7aBJu8sQLXhW3AX3K93SGtTF4FCKU3pnZJj5opump,0.2,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-JACK,DxtDW7Vg3kzvGn3X61rDTjoLcPB7xKtqsQv229nGgnBA,F3t7RR4R92jVfR6YUnjUS4kLnB2dUYCHXvKKzFtjWuCs,2GUnfYZ5o3Ftocw8cBCAmmdA5ePJ5dzacpVvtPvgjoSgUUebPFaJK9N5iwa43fBPSGrSFrjncWTzsSw1d9iKzYv6,601,6,0,true +2024-07-30 19:39:57.000 UTC,2024-07-30,2024-07-01,Alpha Dex,solana,17.718,Buy,15217.140662,PUPPERFISH,7fMP2Ez2j1wzvoFnVF9WEQkbpeeFjhvHtzx4fUCcpump,0.1,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-PUPPERFISH,6oBCVrc7nkCQcdfsVs545jY2tUAPdKXGRvAb5Ke8K6uj,F8YqrAuW4cN8JVJ1TdTQtdXv9CS3HoAjM8qk87PCRrfF,SFn29ePnTiNn1HjzZyku9vGUQB1A5Ha385iY9nURhpqCJ1hRvsyjAbrn5HLpTBT12a2CVMN4cuprdVhcFz1fFRQ,2419,2,6,true +2024-07-26 11:47:27.000 UTC,2024-07-26,2024-07-01,Alpha Dex,solana,3576.6000000000004,Buy,89044.890098,DOLAN,4YK1njyeCkBuXG6phNtidJWKCbBhB659iwGkUJx98P5Z,20,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-DOLAN,A4XeGGhWRcyYRnZqHwDanEow9nrodSJDRHEwcpCbuk4e,DpbU5BoRvWQqAVJFj5dQfT51D7qitmxM7pUNiaMGi2nK,5jLNdz1X9s4t2DKMZSRBHcCDkPXnDQXSiZL8DwKq6dqrSTiebHN28zyvU13V8h55F6ekbz3jswucb2YhGw6czTUC,1742,5,0,true +2024-07-16 19:23:18.000 UTC,2024-07-16,2024-07-01,Alpha Dex,solana,40.505,Buy,3762153.264029,Pep,6aSC2PwRuEeE1eV6m9Zie1bSbnpje8eDaNy76SUspump,0.25,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-Pep,9CcnvqgEpGSw1oiegmzkexYPmoaPXwpY1AbvwTswkc5P,8DSWt2FhamzorVXKgF24o1mTAe4f7ontiW9ADDqyMRUP,2nfSBWexU7eBPC1tXYkoyQRNEccLiAwHBE6dDutjuRH7W54QFQweSwhXSfxTdKdca2mafecCKRLnRcUKX83qsD7t,42,6,0,true +2024-07-24 12:55:00.000 UTC,2024-07-24,2024-07-01,Alpha Dex,solana,1501.4399999999998,Buy,1180215.413387,SHIBY,AEKUy9xPYaUPPbuh2K1koBCLrvyFTjD89xa3M9eRpump,8.5,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-SHIBY,7mrHoG7uyhGJPWr7mZ9zP8SMAX3qQz3ehxNCvWXgv6M8,Hh67Q6jwk9CnqigWzUoAEXbnKEMTxHetvDofya5agmDa,2xinDkXQa8qcnNVLCW4HjSssrAjqq8JPj8oov7CH7NXZYh56nPh9cwGa3AKxLEoPpRTvDcCZQosqjmBZzD7V2U5d,445,6,1,true +2024-07-22 15:44:13.000 UTC,2024-07-22,2024-07-01,Alpha Dex,solana,42.227248241906,Sell,42.197246,USDT,Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB,42.206999,USDC,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,0,0,SOL,So11111111111111111111111111111111111111112,whirlpool,1,USDT-USDC,4fuUiYxTQ6QCrdSq9ouBYcTM7bqSwYTSyLueGZLTy4T4,J8kVAqbVhsrr64YAhvzTo57n7H9u9LhjsY47GUpXs8Jp,59PAihrTjkuj4NootdDvE5PLg1htctQcaakQFAGEpGUy6mHH3F7f7v2anp4BcTNmzLg4jCHpny34Zgg6Z2f7xgjB,199,3,11,true +2024-07-22 15:44:13.000 UTC,2024-07-22,2024-07-01,Alpha Dex,solana,42.25313124990701,Buy,42.206999,USDC,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,0.235040232,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,meteora,2,USDC-SOL,GMgh4NtWrGaUf1RR2kcXD7LY1jou1qFAuSsQeKp5ow4a,J8kVAqbVhsrr64YAhvzTo57n7H9u9LhjsY47GUpXs8Jp,59PAihrTjkuj4NootdDvE5PLg1htctQcaakQFAGEpGUy6mHH3F7f7v2anp4BcTNmzLg4jCHpny34Zgg6Z2f7xgjB,199,3,6,false +2024-07-09 01:11:12.000 UTC,2024-07-09,2024-07-01,Alpha Dex,solana,100.2930466258,Sell,0.720289045,SOL,So11111111111111111111111111111111111111112,3590.834054,ZACK,8vCAUbxejdtaxn6jnX5uaQTyTZLmXALg9u1bvFCAjtx7,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,ZACK-SOL,7896DcX977xMJboS6BJvgkK4sB5p2FhctJx81DntbyCX,5wgWiWxtXbbEaeis6eVjqwuBFJh4QzpWazmQt48m2ckU,2gqYV2Z4vWmX1fJDdC5dVTgJZEnvxgpWYaCLgA8teWTQ4sGHKN6mHRA2YUHuUwgrfNvD8hgHPosCy5EDKRALwTcu,981,5,0,true +2024-07-09 01:11:17.000 UTC,2024-07-09,2024-07-01,Alpha Dex,solana,77.62927500184001,Sell,0.557521366,SOL,So11111111111111111111111111111111111111112,266037.792147,ZAZU,n7EksMkvk3WT5FjQ3HBMLm9XYU3EnoXUSJ7PoWpxsoG,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,ZAZU-SOL,GyW6v1xdTRq1LSMp9WHyBwiuupmUwC3qQaXA3BgDiYX9,5wgWiWxtXbbEaeis6eVjqwuBFJh4QzpWazmQt48m2ckU,4da6yRMZPPvUnbw4A6HUSaeCYwpGnsVfQXrg2x9TyG9ipHJZ33zYcXirHrRDDzFJCeBpGRic2ysSCAFnSuYkyhcp,57,5,0,true +2024-07-09 01:11:36.000 UTC,2024-07-09,2024-07-01,Alpha Dex,solana,139.24,Buy,38452.070975,hehe,BreuhVohXX5fv6q41uyb3sojtAuGoGaiAhKBMtcrpump,1,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-hehe,23KJaRate7XthAQ7C5XbJJYK5cyG1sNA2ikCPsiAcbVP,5wgWiWxtXbbEaeis6eVjqwuBFJh4QzpWazmQt48m2ckU,4suif8Wta5oQEVgwrDpzsybHadvnDZ2gfWAZKTugqmYUGeBPARPoqrGrTZ7K7293rUcKx3EDNct2hjNRgYgMcTEM,879,6,0,true +2024-07-12 02:47:42.000 UTC,2024-07-12,2024-07-01,Alpha Dex,solana,68.78,Buy,1360590.640326,JACK,EUZ7aBJu8sQLXhW3AX3K93SGtTF4FCKU3pnZJj5opump,0.5,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-JACK,DxtDW7Vg3kzvGn3X61rDTjoLcPB7xKtqsQv229nGgnBA,EGd2qwpvSc6L7n1z6v3Pwn59rTk8DEYBx1k1Q9JDXgJ1,4LZjgrW1TtsEFYEvnio4wEGhngx9m775piMw8vbxn6RBV1WJLVeEcY6szED9Vag6qawpR5EfaNb8PFVVLuN5wmLx,189,5,0,true +2024-07-12 02:47:51.000 UTC,2024-07-12,2024-07-01,Alpha Dex,solana,68.78,Buy,1346944.923794,JACK,EUZ7aBJu8sQLXhW3AX3K93SGtTF4FCKU3pnZJj5opump,0.5,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-JACK,DxtDW7Vg3kzvGn3X61rDTjoLcPB7xKtqsQv229nGgnBA,EGd2qwpvSc6L7n1z6v3Pwn59rTk8DEYBx1k1Q9JDXgJ1,2YE3AxrJspysfYFYYPjAkMpbsBS63F6LQd9kgZa4Gip8Mhk73yTXt8sVAAt9fVQT5TifvhFov8D1gueSxtEVdsZ6,1899,5,0,true +2024-07-21 04:10:23.000 UTC,2024-07-21,2024-07-01,Alpha Dex,solana,86.685,Buy,3192695.290384,POUND,FiromfyosqaWqzStxD15WRpidHz5rzFK6uwpPQsEJ1iq,0.5,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-POUND,8GHpqhSKmw4y6ZN4x2LkSYFBKL3ke7sRLmWSmRUb2PcG,BrYmV7Q7ubsPsDFHTuKqr5MnVBUU2TQRS9BFgLhDGJJi,sBhapgFxkxFHzASbvSmSpZZcJXzKFG61LvTRLggWSLvM7jZsvJeMYsyBTYwLy6fEujdrX2KtWPfJeNFGJ67fTKa,426,6,0,true +2024-07-02 02:30:17.000 UTC,2024-07-02,2024-07-01,Alpha Dex,solana,25.175300000000004,Buy,142966.19295,ROCCO,D1D3PL5SqEEUp2nL9jrmXLnZgGdfivTwo6jiLQXYpump,0.17,SOL,So11111111111111111111111111111111111111112,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-ROCCO,FTgLHPRhM4YSwzMG3pr9zBtQ39mxziuVqF8SPjYWM1yG,8BQ4Vg1c93mxCEXTEvggD6HaHiViEcNEENqTqo2HjoEw,A5Q84FeFTYL9Mk5SuicE6XmH3795RECwCNBCEm4WFPd2abGzTx4NpfHrHbeU1kTrfdhN89zqRhDc5LVXEwTAUhX,251,5,0,true +2024-07-30 18:49:17.000 UTC,2024-07-30,2024-07-01,Alpha Dex,solana,105.80594424505001,Sell,0.593914927,SOL,So11111111111111111111111111111111111111112,1181574.214978,TROLL,5VdeDCrUMC71RrSYYFetkuq7UX58g9uakDJ548yyivaK,0,0,SOL,So11111111111111111111111111111111111111112,raydium,4,TROLL-SOL,3ugXdBF1JKms4kBjKoLKKseAnU9sc4sPKNEJvQrJgpVF,8ZVcJxHSoJhVGESAt1NSZWteqJyDrNSC5edTiDNvcptY,4sW53CXqRjvmueg2RphJqZbBZkFUzp3G38FBX8TXkpKsDK3CZWkCw4T3EwpGGWWq5SzJ3PPSDJnw5NRWeBGfqBsF,699,3,0,true diff --git a/dbt_subprojects/solana/seeds/mev_x/mev_x_solana_trades_seed.csv b/dbt_subprojects/solana/seeds/mev_x/mev_x_solana_trades_seed.csv new file mode 100644 index 00000000000..13c63409d0c --- /dev/null +++ b/dbt_subprojects/solana/seeds/mev_x/mev_x_solana_trades_seed.csv @@ -0,0 +1,21 @@ +block_time,block_date,block_month,bot,blockchain,amount_usd,type,token_bought_amount,token_bought_symbol,token_bought_address,token_sold_amount,token_sold_symbol,token_sold_address,fee_usd,fee_token_amount,fee_token_symbol,fee_token_address,project,version,token_pair,project_contract_address,user,tx_id,tx_index,outer_instruction_index,inner_instruction_index,is_last_trade_in_transaction +2024-07-31 16:12:03.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,1.1213760531299999,Sell,0.006206077,SOL,So11111111111111111111111111111111111111112,25594.412879,MAMA,FoJ5WjecurF547wnowLmNKXvSLJVFRsVkCGSFCRkpump,0.006610543650000001,0.000036585,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-MAMA,5qU4rUsjUQg3PTE5QPfQyXYAFZ88PPxD3MJNQ2CwZGuV,6iXYwVvpr3btWvMeYeZtwPZM9xc5gMRXfYjq4snZekXH,2fJsLrQdaGumzfb2ciG8h793ERbhZFYHfQuHhNxFtUx44dWNaz7g5jShDxeeDLAY5ZUwAbMjkzVgGQmyNNfNY7Lz,2664,5,0,true +2024-07-26 09:15:00.000 UTC,2024-07-26,2024-07-01,MevX Bot,solana,0.17874,Buy,55.015667999,STBOT,2x8o3hA5S5fBxCSE9hzVTf3RohcMWHqkDNKNEPuzprD5,0.001,SOL,So11111111111111111111111111111111111111112,0.0017874000000000002,0.00001,SOL,So11111111111111111111111111111111111111112,raydium,4,STBOT-SOL,BuZAMghNCsoVZcL2xaEYp84LtGh71Xhb7xkod1SaVs7n,919XysJivUF8q3gXbM5sgL9w7BVY9Lth6DhUnTxYGVQk,4wagFS8jcgYWVEijtVA1sAsykRxosT84ovoJkXTk4LZDDqpqm8GgFPo6HiKwZscnkHLwMviFAY1B7FMQjk2mmVvP,765,5,0,true +2024-07-31 22:07:22.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,17.378,Buy,257153.969313,toby,AULCAENV7ErJSL1TnfvaEWLXTn23XvUdDshXyT3Wpump,0.1,SOL,So11111111111111111111111111111111111111112,0.05213399999999999,0.0003,SOL,So11111111111111111111111111111111111111112,raydium,4,toby-SOL,BUVroMHAmy6USYWYuCgzh8xri2knVHnaXroZh3YrZ7vP,GQGCRDBcVMaNQC3H159nxNGsZQEgcWpCMjFM4m6jw8fD,4PyyEkmvhouyUov6LroQZiYuFQVimAZarNTjtUCLk9Ytfr2ubpMBu8x4oEpSCCV1EvZnRuqckzW2wEhXfF9NfYqA,41,6,0,true +2024-07-30 08:16:35.000 UTC,2024-07-30,2024-07-01,MevX Bot,solana,0.365,Buy,4322.858459,BROG,7Hpdn3ZHZyDrqQ2LPPZjaTwn1wYakcjMzRLeMR7pump,0.002,SOL,So11111111111111111111111111111111111111112,0.0010948174999999998,0.000005999,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-BROG,3hjaY6AmmHQ7JtqYxPuAJscZFgNxLhwoVeCmAZJh5qzN,xPLLoKTE7kvTkAYdYq37akbjsZBBrUBZz8TWveJYfuA,4NyAq5qJUP2eCrdoTwVGTBp2DtYkqh4CFy7Z8Bn75CmDaeHHJfEx1AUBDFLEe2hM867xqqBSYd6N9z4AD6pShvrH,1795,5,0,true +2024-07-29 16:50:17.000 UTC,2024-07-29,2024-07-01,MevX Bot,solana,0.46005523726,Buy,27407.321006,ASCENT,Bi7gobmgcXi18DbLsZXH44RkiCsqYb1zr68qRyFBpump,0.002481286,SOL,So11111111111111111111111111111111111111112,0.00111227459,0.000005999,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,SOL-ASCENT,A5GqmYJoQB825Lgzx74XbRmthVarQZxVjEvgTmxLp7Yt,xPLLoKTE7kvTkAYdYq37akbjsZBBrUBZz8TWveJYfuA,PrbaGxCcJpZm3NKy71ooczXkpcyoaBhKGHTtnCRsjZHRg39d8ZbC519KskRZJS5hwvVNSqX6DgkhfJ4ch9shFUR,2032,2,4,true +2024-07-30 12:17:53.000 UTC,2024-07-30,2024-07-01,MevX Bot,solana,36.146,Buy,421.340472,SCF,GiG7Hr61RVm4CSUxJmgiCoySFQtdiwxtqf64MsRppump,0.2,SOL,So11111111111111111111111111111111111111112,0.072292,0.0004,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-SCF,6USpEBbN94DUYLUi4a2wo3AZDCyozon1PLGYu27jzPkX,GQGCRDBcVMaNQC3H159nxNGsZQEgcWpCMjFM4m6jw8fD,3paJEacLYKC2YupZ72zx2f2rBE3Levijp25bQJTSrps2Fj6G5erEWxBKieDpF8QFo6wGrGkdSBGsoiEo81rpWhyR,2214,6,0,true +2024-07-29 14:36:38.000 UTC,2024-07-29,2024-07-01,MevX Bot,solana,0.43615960752,Buy,27698.695242,Shit,81A6zE2oe5NTv13ss5XX67fZhTRaJznAoh6zWjsGpump,0.002304309,SOL,So11111111111111111111111111111111111111112,0.00113549072,0.000005999,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,SOL-Shit,6RCeNNmfoPhqzpen8iRLRoDyE4xZo7NjncwMJB1fDxiv,xPLLoKTE7kvTkAYdYq37akbjsZBBrUBZz8TWveJYfuA,4oFQFujVYFdTQaA6h2W6peTXM2NnXuiRniVcKTux94uhNyxwxjwrTzBn9HtYsQwGXKaXA2r3sMKxtFZVBuZx3mqv,2836,2,4,true +2024-07-30 04:24:57.000 UTC,2024-07-30,2024-07-01,MevX Bot,solana,82.43659165362,Sell,0.450620923,SOL,So11111111111111111111111111111111111111112,15006432.803214,METIS,6aZXdTupa4DCLmKFKBAMuRn4bSNzST76u81KqpVvpump,0.16487302854,0.000901241,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,SOL-METIS,,xPLLoKTE7kvTkAYdYq37akbjsZBBrUBZz8TWveJYfuA,2vnFZHV5DrUhztFCU2p6Ccmw4g7Bv4g4LXu4ruu1Uf7hSdBzBYjToVZXTVrF6t516A68G98FjMv6o3nkF2CTjryf,1911,2,2,true +2024-07-31 13:35:26.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,12.24652021746,Sell,0.066972111,SOL,So11111111111111111111111111111111111111112,2014407.797148,MRHAMY,Hz2B7PAgQ1G5CyoUwsCjQTBsnwKkwEDqaho7ejJtpump,0.02449299984,0.000133944,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,SOL-MRHAMY,C76zwhjv7aKxKTn8H7gwTe32L8y7AUXrT7QzYq1kXfkH,GQGCRDBcVMaNQC3H159nxNGsZQEgcWpCMjFM4m6jw8fD,57wW3xuN8U5MwJcv7JY1zoppNPNkSfswfDdiBj3zTqZejdjbWiRpgazfBF9hK5nAhzi7tzTdCYdXnKAqUMYP8yyW,852,2,2,true +2024-07-31 04:39:48.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,0.197769,Buy,67.613422398,STBOT,2x8o3hA5S5fBxCSE9hzVTf3RohcMWHqkDNKNEPuzprD5,0.0011,SOL,So11111111111111111111111111111111111111112,0.000395538,0.0000022,SOL,So11111111111111111111111111111111111111112,raydium,4,STBOT-SOL,BuZAMghNCsoVZcL2xaEYp84LtGh71Xhb7xkod1SaVs7n,D43s9ixnEh7ej8QAJUoLwkgEoXtNnXv7UrGwnA38zzUu,3kPRdaENm7ohGZpj7aZPsecUDWMJc43bFv9cHTidTnVEay6FtghBj1sFRCCXULPTmYfc75BvikyyS3kNuVG5uqxS,3076,5,0,true +2024-07-31 09:46:48.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,2.0973854483500003,Sell,0.011389549,SOL,So11111111111111111111111111111111111111112,1212.79464,LGBTQ,12B5pSnrTvCvZnkRjL5EHpYP6GSWKKwGC9iXjUhApump,0.004195673600000001,0.000022784,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-LGBTQ,8B5hGbQpHrALvcYxAFypyW6cP3B573r7eFaDiMU69ekk,EfmBCaEqav8AxgDHAyMCu3d35svpd6Z9bhZ9FtrGERQW,4CeDZ8djJLjN5yK3GnJ9sjt96Ujo1vtmxC7YVRnU52cHYfDRoConcJG3sWRbkQpY4Rei7iupSUrNiL4sv29hzzHu,780,5,0,true +2024-07-31 04:12:45.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,17.86427696517,Sell,0.098866993,SOL,So11111111111111111111111111111111111111112,196.026459,SCF,GiG7Hr61RVm4CSUxJmgiCoySFQtdiwxtqf64MsRppump,0.03572855646,0.000197734,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-SCF,6USpEBbN94DUYLUi4a2wo3AZDCyozon1PLGYu27jzPkX,HMdDkwZwPFDwyP2rsnbcLy586CV36Q63dG5KEkTgs79g,9iDAJxJaovrfvmDmL8GUALzW1zFPFqVoThatMvmtwNGFUUJXwR7fm35o7oAJw9mpYGZgsiHV518k5VWQAuc42zD,472,5,0,true +2024-07-29 12:06:16.000 UTC,2024-07-29,2024-07-01,MevX Bot,solana,0.40425090816000003,Buy,21975.151728,AOBA,7G2NUoAd2VkrNgRVqaBnYhxbm2ZsYHSuxr3m33GPpump,0.002115168,SOL,So11111111111111111111111111111111111111112,0.00114652888,0.000005999,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,SOL-AOBA,7zicz3L5E47xSFtyTSJn5aD61iCJS5f9AWsj9dBGBoyk,xPLLoKTE7kvTkAYdYq37akbjsZBBrUBZz8TWveJYfuA,3esitmfUqeNm75pC23LxsFWXLr9UNgpAKEk8h8AV8HKV2tGsqxuvAJ2pdAHbSTBTZYMG2PxB346g9z64qQJKY2xR,940,2,4,true +2024-07-30 04:57:56.000 UTC,2024-07-30,2024-07-01,MevX Bot,solana,36.542140249999996,Buy,941623.435987,TWUMP,Cw3usfmqdmYAgnCri9gZm6LGpm66bGk5K5epBxA8pump,0.20012125,SOL,So11111111111111111111111111111111111111112,0.07304000000000001,0.0004,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,TWUMP-SOL,Hw53vjanoPkrNEfJvxMK7rneC6aSXaHCPio6f4DuHiDx,GQGCRDBcVMaNQC3H159nxNGsZQEgcWpCMjFM4m6jw8fD,4boYnaod9yNrYbhewuw9qH7kac8zu4rWxTbrCoCd4cTP9xvm21yjmPjvMYxfNZgbr7LvfL5oJAM5m7qwjnznuJNR,492,3,4,true +2024-07-29 11:15:21.000 UTC,2024-07-29,2024-07-01,MevX Bot,solana,99.26279854959999,Sell,0.52111927,SOL,So11111111111111111111111111111111111111112,15647656.280247,MABA,8qCivboDonBbe82GcF4Jj4MQ84eVuqdA5Po2BV3epump,0.19852549424,0.001042238,SOL,So11111111111111111111111111111111111111112,pumpdotfun,1,SOL-MABA,,xPLLoKTE7kvTkAYdYq37akbjsZBBrUBZz8TWveJYfuA,3E63m4q1eDgCAwMWXLJzcB8AqGRmAFb6zc95iZ53DMkEw6VV1qgZLWTt3xJzsXrCYqxcqFtihGY8F9RMn1FTfkrR,587,2,2,true +2024-07-30 16:19:11.000 UTC,2024-07-30,2024-07-01,MevX Bot,solana,18.122,Buy,262381.408195,brev,AHRousa4gA5ETm6n1SY9nB5YxcN1EaZy2pD7vjCVpump,0.1,SOL,So11111111111111111111111111111111111111112,0.054366,0.0003,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-brev,J3A4FYBdqzVRG3WtSYF2kUV84gnoVbBukRdShkFkzB9c,GQGCRDBcVMaNQC3H159nxNGsZQEgcWpCMjFM4m6jw8fD,3ZVxzTwQuzUFEEWqsnkiJ3bZKjFD9WcHp8P1Rhw3fCf9t68P76zeCywMQ5UbXZvgN2fRHJDWUkUMnonMxcBvBYZB,1767,6,0,true +2024-07-26 16:37:16.000 UTC,2024-07-26,2024-07-01,MevX Bot,solana,3.6148420283599996,Sell,0.019871596,SOL,So11111111111111111111111111111111111111112,4472285338.2823,$TOAD,FViMp5phQH2bX81S7Yyn1yXjj3BRddFBNcMCbTH8FCze,0.007250023049999999,0.000039855,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-$TOAD,GRjpvpES5zEWq1fxSZXjEvbafg56UxKyFvy5Rk1WS615,3gNBGUCM99SA6onvQ89K3uuycg2JDibHDgNCiNBbTPB7,XTbyczuLNaPkPUvdn67re3sfKsihdQMEG6TXMouh3nc4AKEn5kr62ZsUVhHwFqbcC2CFypHqCz7Bt5zwmpCsyw9,271,5,0,true +2024-07-31 05:36:32.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,1.7985,Buy,615.979071067,STBOT,2x8o3hA5S5fBxCSE9hzVTf3RohcMWHqkDNKNEPuzprD5,0.01,SOL,So11111111111111111111111111111111111111112,0.0035970000000000004,0.00002,SOL,So11111111111111111111111111111111111111112,raydium,4,STBOT-SOL,BuZAMghNCsoVZcL2xaEYp84LtGh71Xhb7xkod1SaVs7n,ChtvYJj12KwF2JNKqtbL9ZJq5mRcbt5hZkaRE2s2t278,61uShHp5hP7JpEaoaDhHGRWv37mzAvKc72qncGPzeL1MPKk84xBLXcyc43Qn3Tf8JkSryX9fnT8bXCk8Bx1UFZDr,138,5,0,true +2024-07-31 15:42:49.000 UTC,2024-07-31,2024-07-01,MevX Bot,solana,24.71007948136,Sell,0.136716164,SOL,So11111111111111111111111111111111111111112,1438433.939583,POOL,FbewxJUqdZH3C6pY9P5viQTeaxu1vEXpiTWHvJyapump,0.051563676079999995,0.000285292,SOL,So11111111111111111111111111111111111111112,raydium,4,SOL-POOL,3zx53KCWAqPpdF8NanEbXEEAPizPXfcboYpT3cnEuMUN,E7c1BDxWzVikhphm6vQtHjnvVoHFUPn9wi6FavZQFPYt,2qmh4aypjoCtgsrWDiyMSz12F5BGJjZcwX648wqCjuLVRsr26rTCamzgPeV3JAypEBvLrKTqvsmV1vU64bK3G7GN,1481,5,0,true +2024-07-30 14:47:54.000 UTC,2024-07-30,2024-07-01,MevX Bot,solana,48.9361783302,Sell,0.270007605,SOL,So11111111111111111111111111111111111111112,16437.857253434,STBOT,2x8o3hA5S5fBxCSE9hzVTf3RohcMWHqkDNKNEPuzprD5,0.09787231860000001,0.000540015,SOL,So11111111111111111111111111111111111111112,raydium,4,STBOT-SOL,BuZAMghNCsoVZcL2xaEYp84LtGh71Xhb7xkod1SaVs7n,E7c1BDxWzVikhphm6vQtHjnvVoHFUPn9wi6FavZQFPYt,4fAP8p2iyp2uipEDYXPB7Xist7hBH92cMSAW86a5L1UwDbw337nYZ4gtxL7E2bUQevF5PZ4QwVRdcG93EnVQBJLG,176,5,0,true diff --git a/dbt_subprojects/tokens/macros/transfers/transfers_base.sql b/dbt_subprojects/tokens/macros/transfers/transfers_base.sql index fa7226a24c2..1cbc45054fa 100644 --- a/dbt_subprojects/tokens/macros/transfers/transfers_base.sql +++ b/dbt_subprojects/tokens/macros/transfers/transfers_base.sql @@ -1,7 +1,8 @@ -{% macro transfers_base(blockchain, traces, transactions, erc20_transfers, native_contract_address = null) %} +{% macro transfers_base(blockchain, traces, transactions, erc20_transfers, native_contract_address = null, include_traces = true) %} {%- set token_standard_20 = 'bep20' if blockchain == 'bnb' else 'erc20' -%} WITH transfers AS ( + {% if include_traces %} SELECT block_date , block_time @@ -16,7 +17,7 @@ WITH transfers AS ( {% endif %} , 'native' AS token_standard , "from" - , to + , COALESCE(to,address) AS to -- Contract Creation has NULL "to" address, but transaction might have value that goes to contract created , value AS amount_raw FROM {{ traces }} WHERE success @@ -27,8 +28,9 @@ WITH transfers AS ( {% endif %} UNION ALL + {% endif %} - SELECT + SELECT cast(date_trunc('day', t.evt_block_time) as date) AS block_date , t.evt_block_time AS block_time , t.evt_block_number AS block_number @@ -59,6 +61,7 @@ SELECT -- We have to create this unique key because evt_index and trace_address can be null {{dbt_utils.generate_surrogate_key(['t.block_number', 'tx.index', 't.evt_index', "array_join(t.trace_address, ',')"])}} as unique_key , '{{blockchain}}' as blockchain + , cast(date_trunc('month', t.block_date) as date) AS block_month , t.block_date , t.block_time , t.block_number diff --git a/dbt_subprojects/tokens/macros/transfers/transfers_base_wrapped_token.sql b/dbt_subprojects/tokens/macros/transfers/transfers_base_wrapped_token.sql index 9a98003bd86..d9afc272e79 100644 --- a/dbt_subprojects/tokens/macros/transfers/transfers_base_wrapped_token.sql +++ b/dbt_subprojects/tokens/macros/transfers/transfers_base_wrapped_token.sql @@ -42,6 +42,7 @@ SELECT -- We have to create this unique key because evt_index and trace_address can be null {{dbt_utils.generate_surrogate_key(['t.block_number', 'tx.index', 't.evt_index', "array_join(trace_address, ',')"])}} as unique_key , '{{blockchain}}' as blockchain + , cast(date_trunc('month', t.block_time) as date) AS block_month , cast(date_trunc('day', t.block_time) as date) as block_date , t.block_time , t.block_number diff --git a/dbt_subprojects/tokens/macros/transfers/transfers_enrich.sql b/dbt_subprojects/tokens/macros/transfers/transfers_enrich.sql index 34971870b33..95d71fd05d0 100644 --- a/dbt_subprojects/tokens/macros/transfers/transfers_enrich.sql +++ b/dbt_subprojects/tokens/macros/transfers/transfers_enrich.sql @@ -14,6 +14,7 @@ END , evms_info_model = null , transfers_start_date = '2000-01-01' , blockchain = null + , usd_amount_threshold = 25000000000 ) %} @@ -45,49 +46,80 @@ WITH base_transfers as ( minute >= TIMESTAMP '{{ transfers_start_date }}' {% endif %} ) +, transfers as ( + SELECT + t.unique_key + , t.blockchain + , t.block_month + , t.block_date + , t.block_time + , t.block_number + , t.tx_hash + , t.evt_index + , t.trace_address + , t.token_standard + , t.tx_from + , t.tx_to + , t.tx_index + , t."from" + , t.to + , t.contract_address + , {{case_when_token_standard('evms_info.native_token_symbol', 'tokens_erc20.symbol', 'NULL')}} AS symbol + , t.amount_raw + , {{case_when_token_standard('t.amount_raw / power(10, 18)', 't.amount_raw / power(10, tokens_erc20.decimals)', 'cast(t.amount_raw as double)')}} AS amount + , prices.price AS price_usd + , {{case_when_token_standard('(t.amount_raw / power(10, 18)) * prices.price', + '(t.amount_raw / power(10, tokens_erc20.decimals)) * prices.price', + 'NULL')}} AS amount_usd + FROM + base_transfers as t + INNER JOIN + {{ evms_info_model }} as evms_info + ON evms_info.blockchain = t.blockchain + LEFT JOIN + {{ tokens_erc20_model }} as tokens_erc20 + ON tokens_erc20.blockchain = t.blockchain + AND tokens_erc20.contract_address = t.contract_address + LEFT JOIN + prices + ON date_trunc('minute', t.block_time) = prices.minute + AND CASE + WHEN t.token_standard = 'native' + THEN + prices.blockchain IS NULL + AND prices.contract_address IS NULL + AND evms_info.native_token_symbol = prices.symbol + ELSE + prices.blockchain = '{{ blockchain }}' + AND t.contract_address = prices.contract_address + END +) SELECT - t.unique_key - , t.blockchain - , t.block_date - , t.block_time - , t.block_number - , t.tx_hash - , t.evt_index - , t.trace_address - , t.token_standard - , t.tx_from - , t.tx_to - , t.tx_index - , t."from" - , t.to - , t.contract_address - , {{case_when_token_standard('evms_info.native_token_symbol', 'tokens_erc20.symbol', 'NULL')}} AS symbol - , t.amount_raw - , {{case_when_token_standard('t.amount_raw / power(10, 18)', 't.amount_raw / power(10, tokens_erc20.decimals)', 'cast(t.amount_raw as double)')}} AS amount - , prices.price AS price_usd - , {{case_when_token_standard('(t.amount_raw / power(10, 18)) * prices.price', - '(t.amount_raw / power(10, tokens_erc20.decimals)) * prices.price', - 'NULL')}} AS amount_usd + unique_key + , blockchain + , block_month + , block_date + , block_time + , block_number + , tx_hash + , evt_index + , trace_address + , token_standard + , tx_from + , tx_to + , tx_index + , "from" + , to + , contract_address + , symbol + , amount_raw + , amount + , price_usd + , CASE + WHEN amount_usd >= {{ usd_amount_threshold }} + THEN CAST(NULL as double) + ELSE amount_usd -- Select only transfers where USD amount is less than the threshold + END AS amount_usd FROM - base_transfers as t -INNER JOIN - {{ evms_info_model }} as evms_info - ON evms_info.blockchain = t.blockchain -LEFT JOIN - {{ tokens_erc20_model }} as tokens_erc20 - ON tokens_erc20.blockchain = t.blockchain - AND tokens_erc20.contract_address = t.contract_address -LEFT JOIN - prices - ON date_trunc('minute', t.block_time) = prices.minute - AND CASE - WHEN t.token_standard = 'native' - THEN - prices.blockchain IS NULL - AND prices.contract_address IS NULL - AND evms_info.native_token_symbol = prices.symbol - ELSE - prices.blockchain = '{{ blockchain }}' - AND t.contract_address = prices.contract_address - END + transfers {%- endmacro %} \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/prices/_schema.yml b/dbt_subprojects/tokens/models/prices/_schema.yml index 4c52e2e0c21..4b2c89003aa 100644 --- a/dbt_subprojects/tokens/models/prices/_schema.yml +++ b/dbt_subprojects/tokens/models/prices/_schema.yml @@ -52,7 +52,7 @@ models: - name: prices_trusted_tokens meta: sector: prices - contributors: hosuke + contributors: hosuke, jeff-dude config: tags: [ 'prices', 'stability' ] description: "List of trusted tokens across blockchains" @@ -62,9 +62,7 @@ models: - blockchain - contract_address columns: - - name: blockchain - description: "Native blockchain of the token" - - name: symbol - description: "Token symbol" - - name: contract_address - description: "Contract address of the token" + - *blockchain + - *contract_address + - *symbol + - *decimals \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/prices/arbitrum/prices_arbitrum_tokens.sql b/dbt_subprojects/tokens/models/prices/arbitrum/prices_arbitrum_tokens.sql index 4073d18e944..b5715edd066 100644 --- a/dbt_subprojects/tokens/models/prices/arbitrum/prices_arbitrum_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/arbitrum/prices_arbitrum_tokens.sql @@ -15,7 +15,7 @@ SELECT FROM ( VALUES - + ('dlcbtc-dlcbtc', 'arbitrum', 'dlcBTC', 0x050C24dBf1eEc17babE5fc585F06116A259CC77A, 8), ('0xbtc-0xbitcoin','arbitrum','0xBTC',0x7cb16cb78ea464ad35c8a50abf95dff3c9e09d5d,8), ('aave-new','arbitrum','AAVE',0xba5ddd1f9d7f570dc94a51479a000e3bce967196,18), ('ageur-ageur','arbitrum','agEUR',0xfa5ed56a203466cbbc2430a43c66b9d8723528e7,18), @@ -225,5 +225,7 @@ FROM ('fuse-fuse-network', 'arbitrum', 'FUSE', 0x6b021b3f68491974be6d4009fee61a4e3c708fd6, 18), ('catch-spacecatch', 'arbitrum', 'CATCH', 0xf0a479c9c3378638ec603b8b6b0d75903902550b, 18), ('tap-taptoken', 'arbitrum', 'TAP', 0x2c650dab03a59332e2e0c0c4a7f726913e5028c1, 18), - ('shibai-aishiba', 'arbitrum', 'SHIBAI', 0xfa296fca3c7dba4a92a42ec0b5e2138da3b29050, 6) + ('shibai-aishiba', 'arbitrum', 'SHIBAI', 0xfa296fca3c7dba4a92a42ec0b5e2138da3b29050, 6), + ('usdm-mountain-protocol-usd', 'arbitrum', 'USDM', 0x59d9356e565ab3a36dd77763fc0d87feaf85508c, 18), + ('usdz-anzen-usdz', 'arbitrum', 'USDZ', 0x5018609ab477cc502e170a5accf5312b86a4b94f, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql b/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql index 0c9a117d4c8..b41a16f864f 100644 --- a/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql @@ -142,5 +142,30 @@ FROM ('mrsmiggles-mrs-miggles','base','MRSMIGGLES',0x31b28012f61fc3600e1c076bafc9fd997fb2da90, 18), ('king-king-of-memes','base','KING',0x420b0fa3de2efcf2b2fd04152eb1df36a09717cd, 18), ('trump-maga','base','TRUMP',0x2e1d332893dc16124194e598a29866d2d5e8786b, 18), - ('donuts-the-simpsons','base','DONUTS',0xcc0733b7ba63b446624002441c4816d7fec8f4e0, 18) + ('donuts-the-simpsons','base','DONUTS',0xcc0733b7ba63b446624002441c4816d7fec8f4e0, 18), + ('bolt-bolt-on-base','base','BOLT',0x7cf7132ede0ca592a236b6198a681bb7b42dd5ae, 18), + ('berf-berf','base','BERF',0xfc5462143a3178cf044e97c491f6bcb5e38f173e, 18), + ('boda-based-yoda','base','BODA',0x6bd81aad9b25ad1e0b99c47ed01b34eacf4b8be7, 18), + ('loa-law-of-attraction','base','LOA',0x8d3419b9a18651f3926a205ee0b1acea1e7192de, 18), + --('brett4-brett-20','base','BRETT',0x1a475d06d967aeb686c98de80d079d72097aeacf, 9), --token inactive + ('bchb-bitcoin-cash-on-base','base','BCHB',0x1791b55e734df69b4906a4178a83dbe63c4f8421, 18), + ('brogg-brett39s-dog','base','BROGG',0xc36f19bccd51e3f1163eff07b5edf9d2850acec4, 18), + --('maba-make-america-based-again','base','MABA',0xd9ea93a38d1771c870128f9134d4622d331c04c8, 18), --token inactive + ('peepo1-peepo','base','PEEPO',0x9409c81d5bf8fd6e651f08e1c81c8b175a1e64f7, 18), + ('polluk-jasse-polluk','base','POLLUK',0x22222bd682745cf032006394750739684e45a5f8, 18), + ('boys-boysclubbase','base','$BOYS',0x4d58608eff50b691a3b76189af2a7a123df1e9ba, 9), + ('aerobud-aerobud','base','AEROBUD',0xfad8cb754230dbfd249db0e8eccb5142dd675a0d, 18), + --('normie1-normie','base','NORMIE',0x7f12d13b34f5f4f0a9449c16bcd42f0da47af200, 9), --token inactive + ('ethb-ethereum-on-base','base','ETHB',0x8d285df5be4570097e84241090fca8034ab18547, 18), + ('pepe-pepe-on-base','base','PEPE',0x80f45eacf6537498ecc660e4e4a2d2f99e195cf4, 18), + ('bum-willybumbum','base','BUM',0x4b8ec286fd218adb992e3df1a8d9fcf6de38d583, 18), + ('nippy-cat-on-catnip','base','NIPPY',0x7a31512fb17be839b24276c211e941932c9d20e1, 18), + ('roxy-roxy-frog','base','ROXY',0x10a7a84c91988138f8dbbc82a23b02c8639e2552, 18), + ('pov-degen-pov','base','POV',0x4c96a67b0577358894407af7bc3158fc1dffbeb5, 18), + ('chomp-chompcoin','base','CHOMP',0xebff2db643cf955247339c8c6bcd8406308ca437, 18), + ('birddog-bird-dog-on-base','base','BIRDDOG',0x92af6f53febd6b4c6f5293840b6076a1b82c4bc2, 18), + ('albert-albert-the-alien','base','ALBERT',0x0c067fc190cde145b0c537765a78d4e19873a5cc, 18), + ('tn100x-tn100x','base','TN100X',0x5b5dee44552546ecea05edea01dcd7be7aa6144a, 18), + ('rdat-rdatadao','base','RDAT',0x4498cd8ba045e00673402353f5a4347562707e7d, 18), + ('usdz-anzen-usdz', 'base', 'USDZ',0x04d5ddf5f3a8939889f11e97f8c4bb48317f1938, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/blast/prices_blast_tokens.sql b/dbt_subprojects/tokens/models/prices/blast/prices_blast_tokens.sql index ed9be8805d7..e0f88963654 100644 --- a/dbt_subprojects/tokens/models/prices/blast/prices_blast_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/blast/prices_blast_tokens.sql @@ -19,5 +19,8 @@ FROM ('usdb-usdb','blast','USDB',0x4300000000000000000000000000000000000003,18), ('weth-weth', 'blast', 'bpETH', 0xb772d5c5f4a2eef67dfbc89aa658d2711341b8e5, 18), ('yolo-yolo-games','blast','YOLO',0xf77dd21c5ce38ac08786be35ef1d1dec1a6a15f3,18), - ('blast-blast-token','blast','BLAST',0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad,18) + ('blast-blast-token','blast','BLAST',0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad,18), + ('bag-bagwin','blast','BAG',0xb9dfcd4cf589bb8090569cb52fac1b88dbe4981f,18), + ('usdz-anzen-usdz','blast','USDz',0x52056ed29fe015f4ba2e3b079d10c0b87f46e8c6,18), + ('bpepe-blastin-pepes','blast','bPEPE',0xb6e0d8a730c6e5c85c637b1cf7ad6fd07927b965,18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/bnb/prices_bnb_tokens.sql b/dbt_subprojects/tokens/models/prices/bnb/prices_bnb_tokens.sql index 5ed8c85bd96..ad1a2b53fab 100644 --- a/dbt_subprojects/tokens/models/prices/bnb/prices_bnb_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/bnb/prices_bnb_tokens.sql @@ -270,7 +270,14 @@ FROM ('wsm-wall-street-memes', 'bnb', 'WSM', 0xb62e45c3df611dce236a6ddc7a493d79f9dfadef, 18), ('the-thena', 'bnb', 'THE', 0xf4c8e32eadec4bfe97e0f595add0f4450a863a11, 18), ('lista-lista-dao', 'bnb', 'LISTA', 0xfceb31a79f71ac9cbdcf853519c1b12d379edc46, 18), - ('opul-opuloustoken-via-chainportio', 'bnb', 'OPUL', 0x686318000d982bc8dcc1cdcf8ffd22322f0960ed, 18) + ('opul-opuloustoken-via-chainportio', 'bnb', 'OPUL', 0x686318000d982bc8dcc1cdcf8ffd22322f0960ed, 18), + ('pepe-pepecoin-bsc', 'bnb', 'PEPE', 0xb46584e0efde3092e04010a13f2eae62adb3b9f0, 18), + ('babydoge-baby-doge-coin', 'bnb', 'BABYDOGE', 0xc748673057861a797275cd8a068abb95a902e8de, 9), + ('bwjup-bsc-wrapped-jupiter', 'bnb', 'bwJUP', 0x0231f91e02debd20345ae8ab7d71a41f8e140ce7, 18), + ('lovely-lovely-inu-finance', 'bnb', 'LOVELY', 0x9e24415d1e549ebc626a13a482bb117a2b43e9cf, 8), + --('pvc-pvc-meta','bnb','PVC',0x75ca521892de7f2ecfb070cab545c250d0ceb7e3, 9), --token_id not found + ('bvsd-bvsd','bnb','BVSD',0x7f9ad7a5854658d984924e868187b2135514fb88, 18), + ('coco-coco-coin', 'bnb', 'COCO', 0xf563e86e461de100cfcfd8b65daa542d3d4b0550, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) where contract_address not in ( 0x2ab0e9e4ee70fff1fb9d67031e44f6410170d00e -- bXEN has bad price feed. diff --git a/dbt_subprojects/tokens/models/prices/celo/prices_celo_tokens.sql b/dbt_subprojects/tokens/models/prices/celo/prices_celo_tokens.sql index 8340e298543..8bb307e023b 100644 --- a/dbt_subprojects/tokens/models/prices/celo/prices_celo_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/celo/prices_celo_tokens.sql @@ -31,5 +31,10 @@ FROM ('sushi-sushi', 'celo', 'SUSHI', 0xd15ec721c2a896512ad29c671997dd68f9593226, 18), ('pact-impactmarket', 'celo', 'PACT', 0x46c9757c5497c5b1f2eb73ae79b6b67d119b0b58, 18), ('usdc-usd-coin', 'celo', 'USDC', 0xceba9300f2b948710d2653dd7b07f33a8b32118c, 6), - ('usdt-tether', 'celo', 'USDT', 0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e, 6) + ('usdt-tether', 'celo', 'USDT', 0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e, 6), + ('plastik-plastiks', 'celo', 'PLASTIK', 0x27cd006548df7c8c8e9fdc4a67fa05c2e3ca5cf9, 9), + ('scelo-savings-celo', 'celo', 'SCELO', 0x2879bfd5e7c4ef331384e908aaa3bd3014b703fa, 18), + ('btcbr-bitcoinbr', 'celo', 'BTCBR', 0xe9dc987b939a7b33270e56532297cf82716c79a3, 18), + ('usdglo-glo-dollar', 'celo', 'USDGLO', 0x4f604735c1cf31399c6e711d5962b2b3e0225ad3, 18), + ('abr-allbridge', 'celo', 'ABR', 0x6e512bfc33be36f2666754e996ff103ad1680cc9, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/ethereum/prices_ethereum_tokens.sql b/dbt_subprojects/tokens/models/prices/ethereum/prices_ethereum_tokens.sql index 416387f553c..b3e19dbe1f6 100644 --- a/dbt_subprojects/tokens/models/prices/ethereum/prices_ethereum_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/ethereum/prices_ethereum_tokens.sql @@ -157,7 +157,6 @@ FROM ('fx-function-x', 'ethereum', 'FX', 0x8c15ef5b4b21951d50e53e4fbda8298ffad25057, 18), ('fxc-flexacoin', 'ethereum', 'FXC', 0x4a57e687b9126435a9b19e4a802113e266adebde, 18), ('fxs-frax-share', 'ethereum', 'FXS', 0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0, 18), - ('gala-gala', 'ethereum', 'GALA', 0x15d4c048f83bd7e37d49ea4c83a07267ec4203da, 8), ('gbp-pound-sterling-token', 'ethereum', 'ibGBP', 0x69681f8fde45345c3870bcd5eaf4a05a60e7d227, 18), ('gcr-global-coin-research', 'ethereum', 'GCR', 0x6307b25a665efc992ec1c1bc403c38f3ddd7c661, 4), ('gen-daostack', 'ethereum', 'GEN', 0x543ff227f64aa17ea132bf9886cab5db55dcaddf, 18), @@ -875,6 +874,7 @@ FROM ('kuma-kuma-inu', 'ethereum', 'KUMA', 0x48c276e8d03813224bb1e55f953adb6d02fd3e02, 18), ('cor-coreto', 'ethereum', 'COR', 0x9c2dc0c3cc2badde84b0025cf4df1c5af288d835, 18), ('cqt-covalent', 'ethereum', 'CQT', 0xd417144312dbf50465b1c641d016962017ef6240, 18), + ('cxt-covalent-x-token', 'ethereum', 'CXT', 0x7ABc8A5768E6bE61A6c693a6e4EAcb5B60602C4D, 18), ('glq-graphlinq', 'ethereum', 'GLQ', 0x9f9c8ec3534c3ce16f928381372bfbfbfb9f4d24, 18), ('dfyn-dfyn-network', 'ethereum', 'DFYN', 0x9695e0114e12c0d3a3636fab5a18e6b737529023, 18), ('woofy-woofy', 'ethereum', 'WOOFY', 0xd0660cd418a64a1d44e9214ad8e459324d8157f1, 12), @@ -1823,7 +1823,21 @@ FROM ('alph-alephium', 'ethereum', 'ALPH', 0x590f820444fa3638e022776752c5eef34e2f89a6, 18), ('apex-apex-token', 'ethereum', 'APEX', 0x52A8845DF664D76C69d2EEa607CD793565aF42B8, 18), ('puff-puff-token', 'ethereum', 'PUFF', 0x18fa05ee5e478eed8925946abb41d09aec5d34d6, 18), - ('usdy-ondo-us-dollar-yield', 'ethereum', 'USDY', 0x96f6ef951840721adbf46ac996b59e0235cb985c, 18) + ('usdy-ondo-us-dollar-yield', 'ethereum', 'USDY', 0x96f6ef951840721adbf46ac996b59e0235cb985c, 18), + ('pzeth-renzo-restaked-lst', 'ethereum', 'pzETH', 0x8c9532a60E0E7C6BbD2B2c1303F63aCE1c3E9811, 18), + ('sx-sx-network', 'ethereum', 'SX', 0xbe9f61555f50dd6167f2772e9cf7519790d96624, 18), + ('rch-rch-token', 'ethereum', 'RCH', 0x57B96D4aF698605563A4653D882635da59Bf11AF, 18), + ('raft-raft', 'ethereum', 'RAFT', 0x4c5cb5d87709387f8821709f7a6664f00dcf0c93, 18), + ('neiro3-neiro', 'ethereum', 'NEIRO', 0xee2a03aa6dacf51c18679c516ad5283d8e7c2637, 9), + ('neiro-first-neiro-on-ethereum', 'ethereum', 'NEIRO', 0x812ba41e071c7b7fa4ebcfb62df5f45f6fa853ee, 9), + ('fuku-fuku-kun', 'ethereum', 'FUKU', 0x1001271083c249bd771e1bb76c22d935809a61ee, 9), + ('elon-elon-memelord', 'ethereum', 'ELON', 0x69420e3a3aa9e17dea102bb3a9b3b73dcddb9528, 9), + ('bar-gold-standard', 'ethereum', 'BAR', 0x777be1c6075c20184c4fd76344b7b0b7c858fe6b, 18), + ('ftw-black-agnus', 'ethereum', 'FTW', 0x306fD3e7b169Aa4ee19412323e1a5995B8c1a1f4, 18), + ('synt-synternet','ethereum','SYNT',0xda987c655ebc38c801db64a8608bc1aa56cd9a31, 18), + ('babydoge-baby-doge-coin', 'ethereum', 'BABYDOGE', 0xac57de9c1a09fec648e93eb98875b212db0d460b, 9), + ('usdz-anzen-usdz', 'ethereum', 'USDZ', 0xa469b7ee9ee773642b3e93e842e5d9b5baa10067, 18), + ('lbtc-lombard-staked-btc', 'ethereum', 'LBTC', 0x8236a87084f8b84306f72007f36f2618a5634494, 8) ) as temp (token_id, blockchain, symbol, contract_address, decimals) where contract_address not in ( -- bad price feeds diff --git a/dbt_subprojects/tokens/models/prices/fantom/prices_fantom_tokens.sql b/dbt_subprojects/tokens/models/prices/fantom/prices_fantom_tokens.sql index ec4c5ac8a78..cc99d43fe1b 100644 --- a/dbt_subprojects/tokens/models/prices/fantom/prices_fantom_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/fantom/prices_fantom_tokens.sql @@ -88,7 +88,8 @@ FROM ('polter-polterfinance-protocol-token', 'fantom', 'POLTER', 0x5c725631FD299703D0A74C23F89a55c6B9A0C52F, 18), ('equal-equalizer-dex', 'fantom', 'EQUAL', 0x3fd3a0c85b70754efc07ac9ac0cbbdce664865a6, 18), ('ftails-ftails', 'fantom', 'FTAILS', 0x5cf90b977c86415a53ce3b7be13b26f6abddfee2, 18), - ('fbux-fantom-money-market', 'fantom', 'FBUX', 0x1e2ea3f3209d66647f959cf00627107e079b870d, 18) + -- ('fbux-fantom-money-market', 'fantom', 'FBUX', 0x1e2ea3f3209d66647f959cf00627107e079b870d, 18), + ('spirit-spiritswap', 'fantom', 'SPIRIT', 0x5cc61a78f164885776aa610fb0fe1257df78e59b, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) where contract_address not in ( -- bad price feeds diff --git a/dbt_subprojects/tokens/models/prices/mantle/prices_mantle_tokens.sql b/dbt_subprojects/tokens/models/prices/mantle/prices_mantle_tokens.sql index bb695b42c7e..2e539e012b6 100644 --- a/dbt_subprojects/tokens/models/prices/mantle/prices_mantle_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/mantle/prices_mantle_tokens.sql @@ -30,5 +30,6 @@ FROM ('usde-ethena-usde', 'mantle', 'USDe', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34, 18), ('puff-puff-token', 'mantle', 'PUFF', 0x26a6b0dcdcfb981362afa56d581e4a7dba3be140, 18), ('moe-merchant-moe', 'mantle', 'MOE', 0x4515A45337F461A11Ff0FE8aBF3c606AE5dC00c9, 18), - ('usdy-ondo-us-dollar-yield', 'mantle', 'USDY', 0x5bE26527e817998A7206475496fDE1E68957c5A6, 18) + ('usdy-ondo-us-dollar-yield', 'mantle', 'USDY', 0x5bE26527e817998A7206475496fDE1E68957c5A6, 18), + ('svl-slash-vision-labs', 'mantle', 'SVL', 0xabbeed1d173541e0546b38b1c0394975be200000, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/optimism/prices_optimism_tokens_curated.sql b/dbt_subprojects/tokens/models/prices/optimism/prices_optimism_tokens_curated.sql index 94498778cbf..6187769ada5 100644 --- a/dbt_subprojects/tokens/models/prices/optimism/prices_optimism_tokens_curated.sql +++ b/dbt_subprojects/tokens/models/prices/optimism/prices_optimism_tokens_curated.sql @@ -131,5 +131,7 @@ FROM ('usdv-verified-usd', 'USDV', 0x323665443cef804a3b5206103304bd4872ea4253, 6), ('zro-layerzero', 'ZRO', 0x6985884c4392d348587b19cb9eaaf157f13271cd, 18), ('rseth-rseth', 'rsETH', 0x4186bfc76e2e237523cbc30fd220fe055156b41f, 18), - ('dola-dola', 'DOLA',0x8ae125e8653821e851f12a49f7765db9a9ce7384, 18) + ('dola-dola', 'DOLA',0x8ae125e8653821e851f12a49f7765db9a9ce7384, 18), + ('wld-worldcoin', 'WLD',0xdc6ff44d5d932cbd77b52e5612ba0529dc6226f1, 18), + ('pendle-pendle', 'PENDLE',0xbc7b1ff1c6989f006a1185318ed4e7b5796e66e1, 18) ) as temp (token_id, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql index 5ef4a6af58d..4c257410454 100644 --- a/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql @@ -41,7 +41,8 @@ FROM ('kava-kava', null, 'KAVA', null, null), ('kuji-kujira', null, 'KUJI', null, null), ('ltc-litecoin', null, 'LTC', null, null), - ('matic-polygon', null, 'MATIC', null, null), + ('matic-polygon', null, 'MATIC', null, null), --maintain legacy native token for legacy queries + ('matic-polygon', null, 'POL', null, null), --no full history for 'pol-polygon-ecosystem-token' API ID on coinpaprika ('miota-iota', null, 'MIOTA', null, null), ('mnt-mantle', null, 'MNT', null, null), ('mona-monacoin', null, 'MONA', null, null), diff --git a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql index 6c01f1c23b8..bbca149afe6 100644 --- a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql @@ -7,126 +7,146 @@ ) }} - --- Generated from https://dune.com/queries/3355223 -SELECT blockchain AS blockchain - , symbol AS symbol - , contract_address AS contract_address -FROM (VALUES ('arbitrum', 'USDC.e', 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8), - ('arbitrum', 'WETH', 0x82af49447d8a07e3bd95bd0d56f35241523fbab1), - ('arbitrum', 'USDC', 0xaf88d065e77c8cc2239327c5edb3a432268e5831), - ('arbitrum', 'USDT', 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9), - ('arbitrum', 'ARB', 0x912ce59144191c1204e64559fe8253a0e49e6548), - ('arbitrum', 'WBTC', 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f), - ('arbitrum', 'DAI', 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1), - ('avalanche_c', 'WAVAX', 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7), - ('avalanche_c', 'USDC', 0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e), - ('avalanche_c', 'USDt', 0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7), - ('avalanche_c', 'USDT.e', 0xc7198437980c041c805a1edcba50c1ce5db95118), - ('avalanche_c', 'BTC.b', 0x152b9d0fdc40c096757f570a51e494bd4b943e50), - ('avalanche_c', 'WETH.e', 0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab), - ('avalanche_c', 'DAI.e', 0xd586e7f844cea2f87f50152665bcbc2c279d8d70), - ('base', 'USDbC', 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca), - ('base', 'USDC', 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913), - ('base', 'WETH', 0x4200000000000000000000000000000000000006), - ('base', 'DAI', 0x50c5725949a6f0c72e6c4a641f24049a917db0cb), - ('base', 'axlUSDC', 0xeb466342c4d449bc9f53a865d5cb90586f405215), - ('base', 'cbETH', 0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22), - ('base', 'wstETH', 0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452), - ('bnb', 'USDT', 0x55d398326f99059ff775485246999027b3197955), - ('bnb', 'WBNB', 0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c), - ('bnb', 'BUSD', 0xe9e7cea3dedca5984780bafc599bd69add087d56), - ('bnb', 'USDC', 0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d), - ('bnb', 'ETH', 0x2170ed0880ac9a755fd29b2688956bd959f933f8), - ('bnb', 'BTCB', 0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c), - ('bnb', 'DAI', 0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3), - ('celo', 'cUSD', 0x765de816845861e75a25fca122bb6898b8b1282a), - ('celo', 'CELO', 0x471ece3750da237f93b8e339c536989b8978a438), - ('celo', 'USDC', 0xceba9300f2b948710d2653dd7b07f33a8b32118c), - ('celo', 'cEUR', 0xd8763cba276a3738e6de85b4b3bf5fded6d6ca73), - ('celo', 'BTC', 0xd629eb00deced2a080b7ec630ef6ac117e614f1b), - ('celo', 'BIFI', 0x639a647fbe20b6c8ac19e48e2de44ea792c62c5c), - ('celo', 'USD₮', 0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e), - ('ethereum', 'WETH', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2), - ('ethereum', 'USDT', 0xdac17f958d2ee523a2206206994597c13d831ec7), - ('ethereum', 'USDC', 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48), - ('ethereum', 'DAI', 0x6b175474e89094c44da98b954eedeac495271d0f), - ('ethereum', 'WBTC', 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599), - ('ethereum', 'crvUSD', 0xf939e0a03fb07f59a73314e73794be0e57ac1b4e), - ('fantom', 'WFTM', 0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83), - ('fantom', 'USDC', 0x04068da6c83afcfa0e13ba15a6696662335d5b75), - ('fantom', 'WETH', 0x74b23882a30290451a17c44f4f05243b6b58c76d), - ('fantom', 'DAI', 0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e), - ('fantom', 'WBTC', 0x321162cd933e2be498cd2267a90534a804051b11), - ('fantom', 'axlUSDC', 0x1b6382dbdea11d97f24495c9a90b7c88469134a4), - ('fantom', 'USDC', 0x28a92dde19d9989f39a49905d7c9c2fac7799bdf), - ('gnosis', 'WXDAI', 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d), - ('gnosis', 'WETH', 0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1), - ('gnosis', 'USDC', 0xddafbb505ad214d7b80b1f830fccc89b60fb7a83), - ('gnosis', 'wstETH', 0x6c76971f98945ae98dd7d4dfca8711ebea946ea6), - ('gnosis', 'GNO', 0x9c58bacc331c9aa871afd802db6379a98e80cedb), - ('gnosis', 'USDT', 0x4ecaba5870353805a9f068101a40e0f32ed605c6), - ('gnosis', 'WBTC', 0x8e5bbbb09ed1ebde8674cda39a0c169401db4252), - ('gnosis', 'DAI', 0x44fa8e6f47987339850636f88629646662444217), - ('gnosis', 'BUSD', 0xdd96b45877d0e8361a4ddb732da741e97f3191ff), - ('linea', 'WETH', 0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f), - ('linea', 'USDC', 0x176211869ca2b568f2a7d4ee941e073a821ee1ff), - ('linea', 'USDT', 0xa219439258ca9da29e9cc4ce5596924745e12b93), - ('linea', 'WBTC', 0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4), - ('linea', 'wstETH', 0xb5bedd42000b71fdde22d3ee8a79bd49a568fc8f), - ('mantle', 'USDT', 0x201eba5cc46d216ce6dc03f6a759e8e766e956ae), - ('mantle', 'WETH', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111), - ('mantle', 'USDC', 0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9), - ('mantle', 'mETH', 0xcda86a272531e8640cd7f1a92c01839911b90bb0), - ('mantle', 'MNT', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000), - ('mantle', 'JOE', 0x371c7ec6d8039ff7933a2aa28eb827ffe1f52f07), - ('mantle', 'WMNT', 0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8), - ('mantle', 'axlUSDC', 0xeb466342c4d449bc9f53a865d5cb90586f405215), - ('optimism', 'USDC.e', 0x7f5c764cbc14f9669b88837ca1490cca17c31607), - ('optimism', 'WETH', 0x4200000000000000000000000000000000000006), - ('optimism', 'USDT', 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58), - ('optimism', 'USDC', 0x0b2c639c533813f4aa9d7837caf62653d097ff85), - ('optimism', 'DAI', 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1), - ('optimism', 'OP', 0x4200000000000000000000000000000000000042), - ('optimism', 'WBTC', 0x68f180fcce6836688e9084f035309e29bf0a2095), - ('optimism', 'sUSD', 0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9), - ('optimism', 'wstETH', 0x1f32b1c2345538c0c6f582fcb022739c4a194ebb), - ('optimism', 'WLD', 0xdc6ff44d5d932cbd77b52e5612ba0529dc6226f1), - ('polygon', 'USDC.e', 0x2791bca1f2de4661ed88a30c99a7a9449aa84174), - ('polygon', 'USDT', 0xc2132d05d31c914a87c6611c10748aeb04b58e8f), - ('polygon', 'WMATIC', 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270), - ('polygon', 'WETH', 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619), - ('polygon', 'DAI', 0x8f3cf7ad23cd3cadbd9735aff958023239c6a063), - ('polygon', 'WBTC', 0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6), - ('polygon', 'USDC', 0x3c499c542cef5e3811e1192ce70d8cc03d5c3359), - ('scroll', 'USDC', 0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4), - ('scroll', 'WETH', 0x5300000000000000000000000000000000000004), - ('scroll', 'USDT', 0xf55bec9cafdbe8730f096aa55dad6d22d44099df), - ('scroll', 'WBTC', 0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1), - ('scroll', 'wstETH', 0xf610a9dfb7c89644979b4a0f27063e9e7d7cda32), - ('solana', 'SOL', from_base58('So11111111111111111111111111111111111111112')), - ('solana', 'mSOL', from_base58('mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So')), - ('solana', 'USDT', from_base58('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')), - ('solana', 'USDC', from_base58('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v')), - ('zkevm', 'WETH', 0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9), - ('zkevm', 'USDT', 0x1e4a5963abfd975d8c9021ce480b42188849d41d), - ('zkevm', 'USDC', 0x37eaa0ef3549a5bb7d431be78a3d99bd360d19e5), - ('zkevm', 'MATIC', 0xa2036f0538221a77a3937f1379699f44945018d0), - ('zkevm', 'rETH', 0xb23c20efce6e24acca0cef9b7b7aa196b84ec942), - ('zksync', 'USDC.e', 0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4), - ('zksync', 'BUSD', 0x2039bb4116b4efc145ec4f0e2ea75012d6c0f181), - ('zksync', 'WETH', 0x5aea5775959fbc2557cc8789bc1bf90a239d9a91), - ('zksync', 'USDT.e', 0x493257fd37edb34451f62edf8d2a0c418852ba4c), - ('zksync', 'ETH', 0x000000000000000000000000000000000000800a), - ('zksync', 'WBTC', 0xbbeb516fb02a01611cbbe0453fe3c580d7281011), - ('zora', 'WETH', 0x4200000000000000000000000000000000000006), - ('sei', 'WSEI', 0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7), - ('sei', 'USDC', 0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F1), - ('sei', 'USDT', 0xB75D0B03c06A926e488e2659DF1A861F860bD3d1), - ('sei', 'WETH', 0x160345fC359604fC6e70E3c5fAcbdE5F7A9342d8), - ('nova', 'USDC', 0x750ba8b76187092B0D1E87E28daaf484d1b5273b), - ('nova', 'WBTC', 0x1d05e4e72cD994cdF976181CfB0707345763564d), - ('nova', 'DAI', 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1), - ('nova', 'WETH', 0x722E8BdD2ce80A4422E880164f2079488e115365), - ('nova', 'ARB', 0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD) -) AS t (blockchain, symbol, contract_address) +WITH trusted_tokens AS ( + -- Originally generated from https://dune.com/queries/3355223 + -- Maintained manually moving forward + SELECT + blockchain + , contract_address + FROM ( + VALUES + ('arbitrum', 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8) + , ('arbitrum', 0x82af49447d8a07e3bd95bd0d56f35241523fbab1) + , ('arbitrum', 0xaf88d065e77c8cc2239327c5edb3a432268e5831) + , ('arbitrum', 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9) + , ('arbitrum', 0x912ce59144191c1204e64559fe8253a0e49e6548) + , ('arbitrum', 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f) + , ('arbitrum', 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1) + , ('avalanche_c', 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7) + , ('avalanche_c', 0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e) + , ('avalanche_c', 0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7) + , ('avalanche_c', 0xc7198437980c041c805a1edcba50c1ce5db95118) + , ('avalanche_c', 0x152b9d0fdc40c096757f570a51e494bd4b943e50) + , ('avalanche_c', 0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab) + , ('avalanche_c', 0xd586e7f844cea2f87f50152665bcbc2c279d8d70) + , ('base', 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca) + , ('base', 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913) + , ('base', 0x4200000000000000000000000000000000000006) + , ('base', 0x50c5725949a6f0c72e6c4a641f24049a917db0cb) + , ('base', 0xeb466342c4d449bc9f53a865d5cb90586f405215) + , ('base', 0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22) + , ('base', 0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452) + , ('blast', 0x4300000000000000000000000000000000000004) + , ('blast', 0x4300000000000000000000000000000000000003) + , ('blast', 0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad) + , ('blast', 0xf77dd21c5ce38ac08786be35ef1d1dec1a6a15f3) + , ('bnb', 0x55d398326f99059ff775485246999027b3197955) + , ('bnb', 0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c) + , ('bnb', 0xe9e7cea3dedca5984780bafc599bd69add087d56) + , ('bnb', 0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d) + , ('bnb', 0x2170ed0880ac9a755fd29b2688956bd959f933f8) + , ('bnb', 0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c) + , ('bnb', 0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3) + , ('celo', 0x765de816845861e75a25fca122bb6898b8b1282a) + , ('celo', 0x471ece3750da237f93b8e339c536989b8978a438) + , ('celo', 0xceba9300f2b948710d2653dd7b07f33a8b32118c) + , ('celo', 0xd8763cba276a3738e6de85b4b3bf5fded6d6ca73) + , ('celo', 0xd629eb00deced2a080b7ec630ef6ac117e614f1b) + , ('celo', 0x639a647fbe20b6c8ac19e48e2de44ea792c62c5c) + , ('celo', 0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e) + , ('ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) + , ('ethereum', 0xdac17f958d2ee523a2206206994597c13d831ec7) + , ('ethereum', 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48) + , ('ethereum', 0x6b175474e89094c44da98b954eedeac495271d0f) + , ('ethereum', 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599) + , ('ethereum', 0xf939e0a03fb07f59a73314e73794be0e57ac1b4e) + , ('fantom', 0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83) + , ('fantom', 0x04068da6c83afcfa0e13ba15a6696662335d5b75) + , ('fantom', 0x74b23882a30290451a17c44f4f05243b6b58c76d) + , ('fantom', 0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e) + , ('fantom', 0x321162cd933e2be498cd2267a90534a804051b11) + , ('fantom', 0x1b6382dbdea11d97f24495c9a90b7c88469134a4) + , ('fantom', 0x28a92dde19d9989f39a49905d7c9c2fac7799bdf) + , ('gnosis', 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d) + , ('gnosis', 0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1) + , ('gnosis', 0xddafbb505ad214d7b80b1f830fccc89b60fb7a83) + , ('gnosis', 0x6c76971f98945ae98dd7d4dfca8711ebea946ea6) + , ('gnosis', 0x9c58bacc331c9aa871afd802db6379a98e80cedb) + , ('gnosis', 0x4ecaba5870353805a9f068101a40e0f32ed605c6) + , ('gnosis', 0x8e5bbbb09ed1ebde8674cda39a0c169401db4252) + , ('gnosis', 0x44fa8e6f47987339850636f88629646662444217) + , ('gnosis', 0xdd96b45877d0e8361a4ddb732da741e97f3191ff) + , ('linea', 0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f) + , ('linea', 0x176211869ca2b568f2a7d4ee941e073a821ee1ff) + , ('linea', 0xa219439258ca9da29e9cc4ce5596924745e12b93) + , ('linea', 0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4) + , ('linea', 0xb5bedd42000b71fdde22d3ee8a79bd49a568fc8f) + , ('mantle', 0x201eba5cc46d216ce6dc03f6a759e8e766e956ae) + , ('mantle', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111) + , ('mantle', 0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9) + , ('mantle', 0xcda86a272531e8640cd7f1a92c01839911b90bb0) + , ('mantle', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000) + , ('mantle', 0x371c7ec6d8039ff7933a2aa28eb827ffe1f52f07) + , ('mantle', 0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8) + , ('mantle', 0xeb466342c4d449bc9f53a865d5cb90586f405215) + , ('nova', 0x750ba8b76187092B0D1E87E28daaf484d1b5273b) + , ('nova', 0x1d05e4e72cD994cdF976181CfB0707345763564d) + , ('nova', 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1) + , ('nova', 0x722E8BdD2ce80A4422E880164f2079488e115365) + , ('nova', 0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD) + , ('optimism', 0x7f5c764cbc14f9669b88837ca1490cca17c31607) + , ('optimism', 0x4200000000000000000000000000000000000006) + , ('optimism', 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58) + , ('optimism', 0x0b2c639c533813f4aa9d7837caf62653d097ff85) + , ('optimism', 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1) + , ('optimism', 0x4200000000000000000000000000000000000042) + , ('optimism', 0x68f180fcce6836688e9084f035309e29bf0a2095) + , ('optimism', 0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9) + , ('optimism', 0x1f32b1c2345538c0c6f582fcb022739c4a194ebb) + , ('optimism', 0xdc6ff44d5d932cbd77b52e5612ba0529dc6226f1) + , ('polygon', 0x2791bca1f2de4661ed88a30c99a7a9449aa84174) + , ('polygon', 0xc2132d05d31c914a87c6611c10748aeb04b58e8f) + , ('polygon', 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270) + , ('polygon', 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619) + , ('polygon', 0x8f3cf7ad23cd3cadbd9735aff958023239c6a063) + , ('polygon', 0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6) + , ('polygon', 0x3c499c542cef5e3811e1192ce70d8cc03d5c3359) + , ('scroll', 0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4) + , ('scroll', 0x5300000000000000000000000000000000000004) + , ('scroll', 0xf55bec9cafdbe8730f096aa55dad6d22d44099df) + , ('scroll', 0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1) + , ('scroll', 0xf610a9dfb7c89644979b4a0f27063e9e7d7cda32) + , ('sei', 0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7) + , ('sei', 0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F1) + , ('sei', 0xB75D0B03c06A926e488e2659DF1A861F860bD3d1) + , ('sei', 0x160345fC359604fC6e70E3c5fAcbdE5F7A9342d8) + , ('solana', from_base58('So11111111111111111111111111111111111111112')) + , ('solana', from_base58('mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So')) + , ('solana', from_base58('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')) + , ('solana', from_base58('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v')) + , ('zkevm', 0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9) + , ('zkevm', 0x1e4a5963abfd975d8c9021ce480b42188849d41d) + , ('zkevm', 0x37eaa0ef3549a5bb7d431be78a3d99bd360d19e5) + , ('zkevm', 0xa2036f0538221a77a3937f1379699f44945018d0) + , ('zkevm', 0xb23c20efce6e24acca0cef9b7b7aa196b84ec942) + , ('zksync', 0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4) + , ('zksync', 0x2039bb4116b4efc145ec4f0e2ea75012d6c0f181) + , ('zksync', 0x5aea5775959fbc2557cc8789bc1bf90a239d9a91) + , ('zksync', 0x493257fd37edb34451f62edf8d2a0c418852ba4c) + , ('zksync', 0x000000000000000000000000000000000000800a) + , ('zksync', 0xbbeb516fb02a01611cbbe0453fe3c580d7281011) + , ('zora', 0x4200000000000000000000000000000000000006) + ) AS t (blockchain, contract_address) +) +SELECT + p.token_id + , p.blockchain + , p.contract_address + , p.symbol + , p.decimals +FROM + {{ ref('prices_tokens') }} AS p +INNER JOIN + trusted_tokens AS tt + ON p.blockchain = tt.blockchain + AND p.contract_address = tt.contract_address diff --git a/dbt_subprojects/tokens/models/prices/scroll/prices_scroll_tokens.sql b/dbt_subprojects/tokens/models/prices/scroll/prices_scroll_tokens.sql index 7a789506aa0..b750d136d72 100644 --- a/dbt_subprojects/tokens/models/prices/scroll/prices_scroll_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/scroll/prices_scroll_tokens.sql @@ -31,5 +31,8 @@ FROM ('pxeth-pirex-ether', 'scroll', 'pxETH ', 0x9e0d7d79735e1c63333128149c7b616a0dc0bbdb, 18), ('frxeth-frax-ether', 'scroll', 'frxETH ', 0xecc68d0451e20292406967fe7c04280e5238ac7d, 18), ('weeth-wrapped-eeth', 'scroll', 'weETH ', 0x01f0a31698C4d065659b9bdC21B3610292a1c506, 18), - ('solvbtc-solv-protocol-solvbtc', 'scroll', 'SolvBTC ', 0x3ba89d490ab1c0c9cc2313385b30710e838370a4, 18) + ('solvbtc-solv-protocol-solvbtc', 'scroll', 'SolvBTC ', 0x3ba89d490ab1c0c9cc2313385b30710e838370a4, 18), + ('pufeth-pufeth', 'scroll', 'pufETH ', 0xc4d46E8402F476F269c379677C99F18E22Ea030e, 18), + ('usde-ethena-usde', 'scroll', 'USDe', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34, 18), + ('susde-ethena-staked-usde', 'scroll', 'sUSDe', 0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/solana/prices_solana_tokens.sql b/dbt_subprojects/tokens/models/prices/solana/prices_solana_tokens.sql index 1213f73e885..23a59fd675b 100644 --- a/dbt_subprojects/tokens/models/prices/solana/prices_solana_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/solana/prices_solana_tokens.sql @@ -699,5 +699,6 @@ FROM ('mother-mother-iggy', 'solana', 'MOTHER', '3S8qX1MsMqRbiwKg2cQyx7nis1oHMgaCuc9c4VfvVdPN', 6), ('mumu1-mumu-the-bull', 'solana', 'MUMU', '5LafQUrVco6o7KMz42eqVEJ9LW31StPyGjeeu5sKoMtA', 6), ('nub-nubcat','solana', 'NUB', 'GtDZKAqvMZMnti46ZewMiXCa4oXF4bZxwQPoKzXPFxZn', 9), - ('bunk-bunkee', 'solana', 'BUNK', '2nhjjqSkA8FYCUdJvQhYjbtZdPjZbNo8VtNKTkJ3hncb', 6) + ('bunk-bunkee', 'solana', 'BUNK', '2nhjjqSkA8FYCUdJvQhYjbtZdPjZbNo8VtNKTkJ3hncb', 6), + ('maneki-maneki', 'solana', 'MANEKI', '25hAyBQfoDhfWx9ay6rarbgvWGwDdNqcHsXS3jQ3mTDJ', 5) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/zkevm/prices_zkevm_tokens.sql b/dbt_subprojects/tokens/models/prices/zkevm/prices_zkevm_tokens.sql index 98c88734bf3..dd328c8ade9 100644 --- a/dbt_subprojects/tokens/models/prices/zkevm/prices_zkevm_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/zkevm/prices_zkevm_tokens.sql @@ -26,6 +26,9 @@ FROM ('bal-balancer','zkevm','BAL',0x120ef59b80774f02211563834d8e3b72cb1649d6,18), ('usdt-tether','zkevm','USDT',0x1e4a5963abfd975d8c9021ce480b42188849d41d,6), ('gyd-gyro-dollar','zkevm','GYD',0xca5d8f8a8d49439357d3cf46ca2e720702f132b8,18), - ('wsteth-wrapped-liquid-staked-ether-20', 'zkevm', 'wstETH',0x5d8cff95d7a57c0bf50b30b43c7cc0d52825d4a9,18) + ('wsteth-wrapped-liquid-staked-ether-20', 'zkevm', 'wstETH',0x5d8cff95d7a57c0bf50b30b43c7cc0d52825d4a9,18), + ('wbtc-wrapped-bitcoin','zkevm','WBTC',0xea034fb02eb1808c2cc3adbc15f447b93cbe08e1,8), + ('cake-pancakeswap','zkevm','CAKE',0x0d1e753a25ebda689453309112904807625befbe,18), + ('aave-new','zkevm','AAVE',0x68791cfe079814c46e0e25c19bcc5bfc71a744f7,18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/zksync/prices_zksync_tokens.sql b/dbt_subprojects/tokens/models/prices/zksync/prices_zksync_tokens.sql index 94a724e056e..d8b270cf6f0 100644 --- a/dbt_subprojects/tokens/models/prices/zksync/prices_zksync_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/zksync/prices_zksync_tokens.sql @@ -56,6 +56,7 @@ FROM ('zat-zkapes-token', 'zksync', 'ZAT', 0x47EF4A5641992A72CFd57b9406c9D9cefEE8e0C4, 18), ('kat-karat', 'zksync', 'KAT', 0xCDb7D260c107499C80B4b748e8331c64595972a1, 18), ('zkid-zksync-id', 'zksync', 'ZKID', 0x2141d7fe06A1d69c016fC638bA75b6Ef92Fa1435, 18), - ('zk-zksync', 'zksync', 'ZK', 0x5A7d6b2F92C77FAD6CCaBd7EE0624E64907Eaf3E, 18) + ('zk-zksync', 'zksync', 'ZK', 0x5A7d6b2F92C77FAD6CCaBd7EE0624E64907Eaf3E, 18), + ('weeth-wrapped-eeth', 'zksync', 'weETH', 0xc1fa6e2e8667d9be0ca938a54c7e0285e9df924a, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/tokens/_schema.yml b/dbt_subprojects/tokens/models/tokens/_schema.yml index 24973d74253..6de4d57b157 100644 --- a/dbt_subprojects/tokens/models/tokens/_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/_schema.yml @@ -5,9 +5,9 @@ models: meta: blockchain: arbitrum, avalanche_c, bnb, ethereum, gnosis, mantle, optimism, fantom, polygon, base, blast, sepolia, sei, nova sector: tokens - contributors: hildobby, 0xManny, dot2dotseurat, soispoke, mtitus6, wuligy, angus_1, Henrystats, viniabussafi, jeff-dude + contributors: hildobby, 0xManny, dot2dotseurat, soispoke, mtitus6, wuligy, angus_1, Henrystats, viniabussafi, jeff-dude, rantum config: - tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei', 'nova'] + tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei', 'nova', 'linea'] description: > Crosschain ERC20 tokens tests: @@ -63,3 +63,31 @@ models: description: "NFT collection symbol" - name: standard description: "NFT collection standard" + + - name: tokens_erc20_stablecoins + meta: + blockchain: arbitrum, avalanche_c, bnb, ethereum, fantom, gnosis, optimism, polygon, base + sector: tokens + contributors: hildobby, synthquest + config: + tags: ['tokens','stablecoin', 'arbitrum','avalanche_c','bnb','ethereum','fantom','gnosis','optimism','polygon','base'] + description: > + Stablecoin (ERC20) tokens + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - contract_address + columns: + - name: blockchain + description: blockchain name + - name: contract_address + description: token contract address + - name: name + description: token backing + - name: symbol + description: token symbol + - name: decimal + description: token decimals + - name: backing + description: token backing diff --git a/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_erc20.sql b/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_erc20.sql index 4b1cb6d47f9..fc06a736b80 100644 --- a/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_erc20.sql @@ -93,4 +93,22 @@ FROM (VALUES , (0x777cf5ba9c291a1a8f57ff14836f6f9dc5c0f9dd, 'SOLID', 18) , (0x7448c7456a97769F6cD04F1E83A4a23cCdC46aBD, 'MAV', 18) , (0x17A8541B82BF67e10B0874284b4Ae66858cb1fd5, 'PSM', 18) + , (0xD9FBA68D89178e3538e708939332c79efC540179, 'stataArbGHO', 18) + , (0x89AEc2023f89E26Dbb7eaa7a98fe3996f9d112A8, 'stataArbFRAX', 18) + , (0xbC404429558292eE2D769E57d57D6E74bbd2792d, 'sUSX', 18) + , (0xa1b91fe9fd52141ff8cac388ce3f10bfdc1de79d, '$WIF', 6) + , (0x90364aa61234b85251ad943681433904c35fa5ce, 'METIS', 18) + , (0x4026affabd9032bcc87fa05c02f088905f3dc09b, 'SWISE', 18) + , (0xf6d22e29496313d89ad6261fbae8d118181561de, 'GT', 18) + , (0xe7076d4bb604dea53adaa424fce0336ee7f975ff, 'auraezETH/wstETH', 18) + , (0xb3cf6721d8f88f7547d90ed8e4119e09945efa9a, 'aurarsETH/wETH', 18) + , (0x2f7242373f4b2c831870c145376c4fc9ac76a35d, 'aurarsETH/rETH/wstETH', 18) + , (0xc99b6fd0486448f100891ca43c015fd6f09c8bd0, 'aurarwstETH-WETH-BPT', 18) + , (0x5043a95c4ae68c32b936513cc144401b06893154, 'aura4POOL-BPT', 18) + , (0x324fe9b8a46973d63a4d8e08bcbe9df6da1f9dff, 'aurarETH/wETH BPT', 18) + , (0xc87b37a581ec3257b734886d9d3a581f5a9d056c, 'ATH', 18) + , (0x93fa0b88c0c78e45980fa74cdd87469311b7b3e4, 'XBG', 18) + , (0x9aee3c99934c88832399d6c6e08ad802112ebeab, 'FU', 18) + , (0xe47ba52f326806559c1dec7ddd997f6957d0317d, 'SHELL', 18) + , (0x79ead7a012d97ed8deece279f9bc39e264d7eef9, 'Bonsai', 18) ) AS temp_table (contract_address, symbol, decimals) diff --git a/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_erc20_stablecoins.sql new file mode 100644 index 00000000000..335216bcd6b --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_erc20_stablecoins.sql @@ -0,0 +1,34 @@ +{{ config( + schema = 'tokens_arbitrum' + , alias = 'erc20_stablecoins' + , tags=['static'] + , post_hook='{{ expose_spells(\'["arbitrum"]\', + "sector", + "tokens_arbitrum", + \'["synthquest"]\') }}' + , unique_key = ['contract_address'] + ) +}} + +SELECT blockchain, contract_address, backing, symbol, decimals, name +FROM (VALUES + + ('arbitrum', 0x641441c631e2f909700d2f41fd87f0aa6a6b4edb, 'Crypto-backed stablecoin', 'USX', 18, ''), + ('arbitrum', 0x680447595e8b7b3aa1b43beb9f6098c79ac2ab3f, 'Algorithmic stablecoin', 'USDD', 18, ''), + ('arbitrum', 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9, 'Fiat-backed stablecoin', 'USDT', 6, ''), + ('arbitrum', 0xaf88d065e77c8cc2239327c5edb3a432268e5831, 'Fiat-backed stablecoin', 'USDC', 6, ''), + ('arbitrum', 0xfea7a6a0b346362bf88a9e4a88416b77a57d6c2a, 'Crypto-backed stablecoin', 'MIM', 18, ''), + ('arbitrum', 0xa970af1a584579b618be4d69ad6f73459d112f95, 'Crypto-backed stablecoin', 'sUSD', 18, ''), + ('arbitrum', 0xddc0385169797937066bbd8ef409b5b3c0dfeb52, 'RWA-backed stablecoin', 'wUSDR', 9, ''), + ('arbitrum', 0xe80772eaf6e2e18b651f160bc9158b2a5cafca65, 'Crypto-backed stablecoin', 'USD+', 6, ''), + ('arbitrum', 0x17fc002b466eec40dae837fc4be5c67993ddbd6f, 'Hybrid stablecoin', 'FRAX', 18, ''), + ('arbitrum', 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1, 'Hybrid stablecoin', 'DAI', 18, ''), + ('arbitrum', 0x64343594ab9b56e99087bfa6f2335db24c2d1f17, 'Crypto-backed stablecoin', 'VST', 18, ''), + ('arbitrum', 0xd74f5255d557944cf7dd0e45ff521520002d5748, 'Crypto-backed stablecoin', 'USDs', 18, ''), + ('arbitrum', 0x3f56e0c36d275367b8c502090edf38289b3dea0d, 'Crypto-backed stablecoin', 'MAI', 18, ''), + ('arbitrum', 0xb1084db8d3c05cebd5fa9335df95ee4b8a0edc30, 'Crypto-backed stablecoin', 'USDT+', 6, ''), + ('arbitrum', 0x3509f19581afedeff07c53592bc0ca84e4855475, 'Crypto-backed stablecoin', 'xUSD', 18, ''), + ('arbitrum', 0x59d9356e565ab3a36dd77763fc0d87feaf85508c, 'Fiat-backed stablecoin', 'USDM', 18, ''), + ('arbitrum', 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8, 'Fiat-backed stablecoin', 'USDC', 6, ''), + ('arbitrum', 0x4d15a3a2286d883af0aa1b3f21367843fac63e07, 'Fiat-backed stablecoin', 'TUSD', 18, '') + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_schema.yml b/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_schema.yml index e875305d821..0d566872dc6 100644 --- a/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/arbitrum/tokens_arbitrum_schema.yml @@ -6,7 +6,7 @@ models: blockchain: arbitrum sector: tokens project: erc20 - contributors: soispoke, dot2dotseurat, mtitus6, maybeYonas + contributors: soispoke, dot2dotseurat, mtitus6, maybeYonas, rantum config: tags: ['table', 'erc20'] description: "ERC20 Token Addresses, Symbols and Decimals" @@ -81,3 +81,26 @@ models: - unique - name: standard description: "The NFT standard erc721/erc1155/..." + + - name: tokens_arbitrum_erc20_stablecoins + meta: + blockchain: arbitrum + sector: stablecoins + contributors: synthquest + config: + tags: ['tokens', 'arbitrum', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. + columns: + - name: blockchain + description: "Blockchain name" + - name: contract_address + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" + - name: symbol + description: "Stablecoin symbol" + - name: name + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" diff --git a/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_erc20_stablecoins.sql new file mode 100644 index 00000000000..c6d569bd584 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_erc20_stablecoins.sql @@ -0,0 +1,32 @@ +{{ config( + schema = 'tokens_avalanche_c' + , alias = 'erc20_stablecoins' + , tags=['static'] + , post_hook='{{ expose_spells(\'["avalanche_c"]\', + "sector", + "tokens_avalanche_c", + \'["synthquest"]\') }}' + , unique_key = ['contract_address'] + ) +}} + +SELECT blockchain, contract_address, backing, symbol, decimals, name +FROM (VALUES + + ('avalanche_c', 0x111111111111ed1d73f860f57b2798b683f2d325, 'Crypto-backed stablecoin', 'YUSD', 18, ''), + ('avalanche_c', 0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7, 'Fiat-backed stablecoin', 'USDt', 6, ''), + ('avalanche_c', 0xab05b04743e0aeaf9d2ca81e5d3b8385e4bf961e, 'Hybrid stablecoin', 'USDS', 18, ''), + ('avalanche_c', 0x00000000efe302beaa2b3e6e1b18d08d69a9012a, 'Fiat-backed stablecoin', 'AUSD', 6, ''), + ('avalanche_c', 0x130966628846bfd36ff31a822705796e8cb8c18d, 'Crypto-backed stablecoin', 'MIM', 18, ''), + ('avalanche_c', 0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64, 'Hybrid stablecoin', 'FRAX', 18, ''), + ('avalanche_c', 0xd586e7f844cea2f87f50152665bcbc2c279d8d70, 'Crypto-backed stablecoin', 'DAI.e', 18, ''), + ('avalanche_c', 0x3b55e45fd6bd7d4724f5c47e0d1bcaedd059263e, 'Crypto-backed stablecoin', 'miMatic', 18, ''), + ('avalanche_c', 0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e, 'Fiat-backed stablecoin', 'USDC', 6, ''), + ('avalanche_c', 0x9c9e5fd8bbc25984b178fdce6117defa39d2db39, 'Fiat-backed stablecoin', 'BUSD', 18, ''), + ('avalanche_c', 0xf14f4ce569cb3679e99d5059909e23b07bd2f387, 'Crypto-backed stablecoin', 'NXUSD', 18, ''), + ('avalanche_c', 0x1c20e891bab6b1727d14da358fae2984ed9b59eb, 'Fiat-backed stablecoin', 'TUSD', 18, ''), + ('avalanche_c', 0xdacde03d7ab4d81feddc3a20faa89abac9072ce2, 'Crypto-backed stablecoin', 'USP', 18, ''), + ('avalanche_c', 0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664, 'Crypto-backed stablecoin', 'USDC.e', 6, ''), + ('avalanche_c', 0x8861f5c40a0961579689fdf6cdea2be494f9b25a, 'Hybrid stablecoin', 'iUSDS', 18, '') + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_schema.yml b/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_schema.yml index 33c7d6a409a..22c9c8c7cec 100644 --- a/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_schema.yml @@ -85,3 +85,26 @@ models: tests: - accepted_values: values: [ 'erc721', 'erc1155'] + + - name: tokens_avalanche_c_erc20_stablecoins + meta: + blockchain: avalanche_c + sector: stablecoins + contributors: synthquest + config: + tags: ['tokens', 'avalanche_c', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. + columns: + - name: blockchain + description: "Blockchain name" + - name: contract_address + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" + - name: symbol + description: "Stablecoin symbol" + - name: name + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql b/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql index 66f7758984d..f6321bf090b 100644 --- a/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql @@ -250,4 +250,135 @@ FROM (VALUES , (0x013b6451e2b2131052d3473593bd786df5143faf, 'FRENCH', 18) , (0x31b28012f61fc3600e1c076bafc9fd997fb2da90, 'MRSMIGGLES', 18) , (0x420b0fa3de2efcf2b2fd04152eb1df36a09717cd, 'KING', 18) + , (0x190b2aA820495c0e92840E8FA699741976cd6439, 'rETH', 18) + , (0x85e90a5430af45776548adb82ee4cd9e33b08077, 'DINO', 18) + , (0x7c6b91D9Be155A6Db01f749217d76fF02A7227F2, 'BAL', 18) + , (0xa1e4240C9E9B8db3ba9e7625A9571c3B0FF71988, 'PJ', 18) + , (0x340c070260520ae477b88caa085a33531897145b, '9MM', 18) + , (0x38d513ec43dda20f323f26c7bef74c5cf80b6477, 'CARLO', 18) + , (0x8d3419b9a18651f3926a205ee0b1acea1e7192de, 'LOA', 18) + , (0xed899bfdb28c8ad65307fa40f4acab113ae2e14c, 'ROOST', 18) + , (0x6bd81aad9b25ad1e0b99c47ed01b34eacf4b8be7, 'BODA', 18) + , (0x75570e1189ffc1d63b3417cdf0889f87cd3e9bd1, 'Bunny', 18) + , (0x1c7a460413dd4e964f96d8dfc56e7223ce88cd85, 'SEAM', 18) + , (0x8319767a7b602f88e376368dca1b92d38869b9b4, 'PEACH', 18) + , (0x42069de48741db40aef864f8764432bbccbd0b69, 'BETS', 18) + , (0x1ccb4b14a11e0f2994a7ecbbd4cc69632f4c7c76, 'CCC', 18) + , (0xacd1caef47e4c47bafe8a51b3f4305fc38203b7a, 'LUNE', 18) + , (0xd327d36eb6e1f250d191cd62497d08b4aaa843ce, 'FOMO', 9) + , (0x00e57ec29ef2ba7df07ad10573011647b2366f6d, 'TOSHE', 18) + , (0xf1b4ddf712e108cf43711b1c39f2fddb0d5ce243, 'BASE', 18) + , (0x87c211144b1d9bdaa5a791b8099ea4123dc31d21, 'BCP', 18) + , (0xa5fbc981ebd8f4e791be8bd7a9b7cb144d145bf9, 'MEMEGOD', 18) + , (0x30d19fb77c3ee5cfa97f73d72c6a1e509fa06aef, 'CONDO', 18) + , (0x8b781e0f2967571e96d5d95b3cb61e27785eeaa5, 'BORKIE', 18) + , (0x3159fb5589acd6bf9f82eb0efe8382ed55aed8fd, 'APU', 18) + , (0x029635e83bc26c96006298e05798cdda76a2e7a5, 'SYD', 18) + , (0x314da69de85145fdd5b7580971e9db0388a2cdc4, 'BSW', 18) + , (0x8ad5b9007556749de59e088c88801a3aaa87134b, 'FARTHER', 18) + , (0x64cc19a52f4d631ef5be07947caba14ae00c52eb, 'KIBBLE', 18) + , (0x45096bd2871911ee82a3084d77a01efa3c9c6733, 'BUB', 18) + , (0x44fccd875c8e80b37f38530f434386a6d59141bb, 'DTB', 18) + , (0xfd008f937b4d73eeb00cf74ce90c392be5f07f96, 'MOON', 18) + , (0x160381343365de6d5e7d32172987b3e6bd1cce71, 'Mari', 18) + , (0x546d239032b24eceee0cb05c92fc39090846adc7, 'SEED', 18) + , (0x4c584cbc3a221998dc003349e1c12a4179e97b25, 'BMONEY', 18) + , (0x9721b1ce4ffd8af047bbdfd87e4e20ddc544513a, 'BROS', 18) + , (0xc41ba5737baf6bd0ccd5daf7eee39874e4ad45ff, 'DEGENS', 18) + , (0x10c1b6f768e13c624a4a23337f1a5ba5c9be0e4b, 'WARPIE', 18) + , (0xfd9fa4f785331ce88b5af8994a047ba087c705d8, '$blue', 18) + , (0x420697291f6ce9fbb34e9feddd61868ca2f81f5c, 'MONEYBEE', 18) + , (0x9a589baa21f0492bd4f35a33915986db56d8eecf, 'CATZ', 18) + , (0x2156006a207a793b4069a2b72be58dc2bd759232, 'COIN', 18) + , (0x17931cfc3217261ce0fa21bb066633c463ed8634, 'BASED', 18) + , (0xb9ea61ed1c9942011e5e44f7fae3efddbf277b1e, 'CHIP', 18) + , (0xea6f7e7e0f46a9e0f4e2048eb129d879f609d632, 'PERCY', 18) + , (0x05ad8adc21778f2a2c6800852f05fb949ef507dc, 'HACHI', 18) + , (0x8fe815417913a93ea99049fc0718ee1647a2a07c, 'XSWAP', 18) + , (0x9260409d4719c235c7c199106219f9616d66bde0, 'ArabWif', 18) + , (0x1c22374032e7e5a1bbde3d943f5deb310db060dd, 'onchain', 18) + , (0x57d0ffb02f73aa09dd22d7e81d6c0c81054ab5d9, 'DRAGGY', 18) + , (0xb59c8912c83157a955f9d715e556257f432c35d7, 'TRUF', 18) + , (0x619c4bbbd65f836b78b36cbe781513861d57f39d, 'BWB', 18) + , (0xffcd2489d5492c526126e699b15646b204dd4b2b, 'GCAT', 18) + , (0x1f1aa4d239002bb818536c95e9b762a1fc8484c1, 'RAIN', 18) + , (0x9aaae745cf2830fb8ddc6248b17436dc3a5e701c, 'GOCHU', 18) + , (0x5e1773eb46e74f3a3511fdfe4ba730b3b50411e5, 'BOCAT', 18) + , (0xada3214dc8a4ec6873424e3aba36e8073cf078a5, 'XMRB', 9) + , (0xf086206423f9e9686192bee98c042131d7bc1336, 'DONGUS', 18) + , (0x48164ea5df090e80a0eaee1147e466ea28669221, 'MOB', 18) + , (0x72d1eb99bebadc114c52526f55c9bbad5870dd5c, 'FRENS', 18) + , (0xebe41d50635cddc9a56473fb500f45ac143294bd, 'WAT', 18) + , (0xa617c0c739845b2941bd8edd05c9f993ecc97c18, 'GMR', 18) + , (0x5812fb91b48467dbbe3394d6d3ef7be9707dcddf, 'FISH', 9) + , (0x00000ef506a961089d388276989a967c96c8e314, 'NETA', 18) + , (0x21831890dcefdcbcc5bedce6edb008dd3cdc9c33, 'KICHI', 18) + , (0x1804e3db872eed4141e482ff74c56862f2791103, 'Rocco', 18) + , (0xe652e7448b3beb0e952c9d9493f8899edae058d3, 'CRACK', 18) + , (0x7c101a0e141517009d3138743213e3e835a809de, 'COSMIC', 18) + , (0x980a3662ddbffa895af03c54e7b97cb3bc868ed2, 'ELARA', 9) + , (0x2533b7bed37d1e7366f3d5c9215ceb51b65ac40b, 'LOL', 18) + , (0xecbc993c4b29eb5a192712d689b63a8a665a8f78, 'BaKiK', 18) + , (0x7fdd7419428955dbf36d4176af5a8f09ad29d1f3, 'BOSHI', 18) + , (0xb8e0b7d0df89673e4f6f82a66ef642a1cd46e010, '$REFLECT', 18) + , (0x81f5d76cfb4e49114d9f7a7d04ec108297f4de24, 'BABYCLUB', 18) + , (0x1c1ec1bb5f12f24c97231165b13f3eab9d4ec00e, '2FAI', 9) + , (0xf4509f6c51c780beae92e2740d33607cdc0c42f3, '$CHOO', 18) + , (0x47c6fecd5e41b234f47846760c060934732f2024, 'RALLY', 18) + , (0x528757e34a5617aa3aabe0593225fe33669e921c, 'DRAGON', 9) + , (0x692991ddefadfd6947f8a59a2be4bad14f7ea73f, 'BASED', 18) + , (0xb488fcb23333e7baa28d1dfd7b69a5d3a8bfeb3a, 'terminal', 18) + , (0x8069ef9b21bf292ba05ae527e1960c9676816ee6, 'GME', 11) + , (0xf3c052f2baab885c610a748eb01dfbb643ba835b, 'GULP', 18) + , (0x064e496e3017a07c25754ab3c13e0d8371aded93, 'Billy', 18) + , (0x8619986e425bb1a78b3facfb1f2086aca91b6088, 'DAY1', 18) + , (0xc39f3069d9e58c50582d84c80bd664804e823856, 'SnapCat', 9) + , (0xb5116fe1193ea5ba1d3116e83b637f2d7f315dcc, 'BTC', 18) + , (0xfca95aeb5bf44ae355806a5ad14659c940dc6bf7, 'SHIB', 9) + , (0xdf068fd33f2297dc4c11c99f00fe3565d63398ce, 'Baseman', 18) + , (0x1d8968f4589ee9cbf960cc1ecc9bcf4e24d043cd, 'FOOL', 18) + , (0x8eed3ccb8ab1b178e2dd66d185e08f72d2fc4df9, '$PAPA', 18) + , (0x2816a491dd0b7a88d84cbded842a618e59016888, 'LONG', 18) + , (0x59a32d4b86ffcce0a7f388d6d858c6a0371915ab, 'MAMAI', 18) + , (0xdf3be0ba8450304fa305c9637f6209495ce4f31e, 'BABYNORMUS', 18) + , (0xb6ca1a05315eb64abe842fd37b94b52934792383, 'ETHISM', 18) + , (0x4744767b43b62207dc343c5b540f0aef54e31f94, 'TUTTER', 18) + , (0xb7cfe05915ef0c040c6dde2007c9ddab26259e04, 'MOLLY', 18) + , (0x419423aad02cf951850e336da067db3235baf932, 'BASEWIFHAT', 18) + , (0x96b3478cf54f373c5a3d0ad43d7e5160f3b48dbe, 'NEKO', 18) + , (0x8a7ef77c5cfcaf520c012ada94ac4826814a34aa, 'LOL', 18) + , (0xf0e71975ed873d435837c53554a4373edc72015a, 'YrPi', 9) + , (0xd7ffe0ba4464582706411742899ba467fc833005, 'RD', 18) + , (0x95017e6f16375e63e5cb4d3a5fbf3c40775b08f4, 'CATCH', 18) + , (0x08e4c025819e1f4b5ccc1fa86d7df5bc47a0231d, 'Peplo', 18) + , (0x8dcb20a4cb69c6a4b5f61ff3a62c8fbc4312e25c, 'PANCAKE', 18) + , (0x69ba5ef917ef6ae8ad748717682ca5aae4da1eed, 'SHARKE', 18) + , (0x59a1686faaa2d9d1d9c8d4acd5ab6fd108fdbff3, 'QUEEN', 9) + , (0xa88303cabc6a8797d487988bec3b164f298cfda9, 'BABO', 18) + , (0x35b788b3ae9b1a75aea5893972f5012386a0f920, 'BabyCrash', 18) + , (0x44f8396f60129a30724560ea731122dcf7b8352f, 'RENT', 18) + , (0xee034e475a4be2def50df8a867f2986c4e47211f, 'GN', 9) + , (0x717f9a91b23ca88d1ca735be20e4007c65dc35ef, 'HALO', 18) + , (0x7a43121e70f10a5b7f114e5962158e0aa4c74508, 'RWASS', 18) + , (0xd7eace7eb073dbc73270592efce06cfec2ccec4c, 'FREN', 18) + , (0xe2e50097c2789ae1b52e9a15603eda02517b4628, 'BAPE', 18) + , (0x40be61a8c047e84aa974eac296eaabf09945d3b2, 'BUIDL', 18) + , (0xaf19e4456c0de828496d93c7fd7eaed9b7132eeb, 'SLRS', 18) + , (0x38029c62dfa30d9fd3cadf4c64e9b2ab21dbda17, 'Dubbz', 18) + , (0x089fc731c23d8c7de67b1cd9fc3eb42893cbf3c1, '$SMOG', 18) + , (0x18dd0cbc659347749480f5732683a7df5c44c6cd, 'BWF', 18) + , (0x8b3389fe40aab36cde72d41ba623752b4beb2731, 'SBM', 18) + , (0x26eaf1bae909954ee702c315eb59eba6a2fb6c2a, 'TOP G', 18) + , (0xf95e1c0a67492720ca22842122fe7fa63d5519e5, 'LUNARLENS', 18) + , (0xab8d437481cd68ab5f14ba483e7e81952fd720bd, 'FUN', 18) + , (0xceee43899c4b5ecf1b9b7af6c3012598b3d5295e, 'BCAT', 18) + , (0x471e49de9a1521768d169aec6aa586dc0d0d64cc, 'BOB', 18) + , (0xa7296cefae8477a81e23230ca5d3a3d6f49d3764, 'FIT', 18) + , (0xbd2a89f43c209f23423db5a01a62a9ed107d07d9, 'AIMC', 18) + , (0xa8507c43d1f2029bd3ca3d3e8978ec15b1bc8a7f, 'SHINJA', 18) + , (0xf62fb3d97bdafd50f028ba4d5fb5beda0038cae0, 'BLO', 18) + , (0xdb19b61fc52eb16fbe1e4e9e5441949040512d32, 'NULL', 18) + , (0x37e428349c8e754c8f70b90f4a0c50cee50b174b, 'BRETT420', 18) + , (0x0066cadd8822f2f260db3395dcfa6015bb9c1042, '🍌', 18) + , (0xbb4f69a0fca3f63477b6b3b2a3e8491e5425a356, 'GRASS', 18) ) AS temp_table (contract_address, symbol, decimals) diff --git a/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20_stablecoins.sql new file mode 100644 index 00000000000..8cbcbdcb911 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20_stablecoins.sql @@ -0,0 +1,26 @@ +{{ config( + schema = 'tokens_base' + , alias = 'erc20_stablecoins' + , tags=['static'] + , post_hook='{{ expose_spells(\'["base"]\', + "sector", + "tokens_base", + \'["synthquest"]\') }}' + , unique_key = ['contract_address'] + ) +}} + +SELECT blockchain, contract_address, backing, symbol, decimals, name +FROM (VALUES + + ('base', 0x60a3e35cc302bfa44cb288bc5a4f316fdb1adb42, 'Fiat-backed stablecoin', 'EURC', 6, ''), + ('base', 0xb79dd08ea68a908a97220c76d19a6aa9cbde4376, 'Crypto-backed stablecoin', 'USD+', 6, ''), + ('base', 0xcc7ff230365bd730ee4b352cc2492cedac49383e, 'Algorithmic stablecoin', 'hyUSD', 18, ''), + ('base', 0xcfa3ef56d303ae4faaba0592388f19d7c3399fb4, 'Crypto-backed stablecoin', 'eUSD', 18, ''), + ('base', 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, 'Fiat-backed stablecoin', 'USDC', 6, ''), + ('base', 0x04d5ddf5f3a8939889f11e97f8c4bb48317f1938, 'Fiat-backed stablecoin', 'USDz', 18, ''), + ('base', 0x4621b7a9c75199271f773ebd9a499dbd165c3191, 'Crypto-backed stablecoin', 'DOLA', 18, ''), + ('base', 0xca72827a3d211cfd8f6b00ac98824872b72cab49, 'Fiat-backed stablecoin', 'cgUSD', 6, '') + + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/base/tokens_base_schema.yml b/dbt_subprojects/tokens/models/tokens/base/tokens_base_schema.yml index 46487efa49d..3cd3f9fe144 100644 --- a/dbt_subprojects/tokens/models/tokens/base/tokens_base_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/base/tokens_base_schema.yml @@ -6,7 +6,7 @@ models: blockchain: base sector: tokens project: erc20 - contributors: hildobby + contributors: hildobby, rantum config: tags: ['table', 'erc20', 'base'] description: "All ERC20 Token Addresses on Base - with mapped Symbols and Decimals if known." @@ -81,3 +81,26 @@ models: tests: - accepted_values: values: [ 'erc721', 'erc1155' ] + + - name: tokens_base_erc20_stablecoins + meta: + blockchain: base + sector: stablecoins + contributors: synthquest + config: + tags: ['tokens', 'base', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. + columns: + - name: blockchain + description: "Blockchain name" + - name: contract_address + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" + - name: symbol + description: "Stablecoin symbol" + - name: name + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_bep20.sql b/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_bep20.sql index 57508ec8220..21782b7f17d 100644 --- a/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_bep20.sql +++ b/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_bep20.sql @@ -588,4 +588,9 @@ FROM (VALUES , (0x1cebf8735c8d1365cb4c2117787dc811ea6148e0, 'DUSD', 18) , (0xefc41e176a20ae15c7c20da48d40d83d098845d8, 'SPRT', 18) , (0xd691d9a68C887BDF34DA8c36f63487333ACfD103, 'MAV', 18) + , (0x2b5d9adea07b590b638ffc165792b2c610eda649, 'CKP', 18) + , (0x3b6564b5da73a41d3a66e6558a98fd0e9e1e77ad, 'UTS', 18) + , (0x6985884c4392d348587b19cb9eaaf157f13271cd, 'ZRO', 18) + , (0xfceb31a79f71ac9cbdcf853519c1b12d379edc46, 'LISTA', 18) + , (0x0e7779e698052f8fe56c415c3818fcf89de9ac6d, 'ULTI', 18) ) AS temp_table (contract_address, symbol, decimals) \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_erc20_stablecoins.sql new file mode 100644 index 00000000000..2d1457e851f --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_erc20_stablecoins.sql @@ -0,0 +1,43 @@ +{{ config( + schema = 'tokens_bnb' + , alias = 'erc20_stablecoins' + , tags=['static'] + , post_hook='{{ expose_spells(\'["bnb"]\', + "sector", + "tokens_bnb", + \'["synthquest"]\') }}' + , unique_key = ['contract_address'] + ) +}} + +SELECT blockchain, contract_address, backing, symbol, decimals, name +FROM (VALUES + + ('bnb', 0x14016e85a25aeb13065688cafb43044c2ef86784, 'Fiat-backed stablecoin', 'TUSD', 18, ''), + ('bnb', 0x23396cf899ca06c4472205fc903bdb4de249d6fc, 'Algorithmic stablecoin', 'UST', 18, ''), + ('bnb', 0x0782b6d8c4551b9760e74c0545a9bcd90bdc41e5, 'Crypto-backed stablecoin', 'HAY', 18, ''), + ('bnb', 0x90c97f71e18723b0cf0dfa30ee176ab653e89f40, 'Hybrid stablecoin', 'FRAX', 18, ''), + ('bnb', 0x6bf2be9468314281cd28a94c35f967cafd388325, 'Hybrid stablecoin', 'oUSD', 18, ''), + ('bnb', 0x55d398326f99059ff775485246999027b3197955, 'Fiat-backed stablecoin', 'USDT', 18, ''), + ('bnb', 0xde7d1ce109236b12809c45b23d22f30dba0ef424, 'Hybrid stablecoin', 'USDS', 18, ''), + ('bnb', 0xfa4ba88cf97e282c505bea095297786c16070129, 'Fiat-backed stablecoin', 'CUSD', 18, ''), + ('bnb', 0xc5f0f7b66764f6ec8c8dff7ba683102295e16409, 'Fiat-backed stablecoin', 'FDUSD', 18, ''), + ('bnb', 0x2952beb1326accbb5243725bd4da2fc937bca087, 'RWA-backed stablecoin', 'wUSDR', 9, ''), + ('bnb', 0x1d6cbdc6b29c6afbae65444a1f65ba9252b8ca83, 'Crypto-backed stablecoin', 'TOR', 18, ''), + ('bnb', 0xb0b195aefa3650a6908f15cdac7d92f8a5791b0b, 'Crypto-backed stablecoin', 'BOB', 18, ''), + ('bnb', 0x6458df5d764284346c19d88a104fd3d692471499, 'Hybrid stablecoin', 'iUSDS', 18, ''), + ('bnb', 0x2f29bc0ffaf9bff337b31cbe6cb5fb3bf12e5840, 'Crypto-backed stablecoin', 'DOLA', 18, ''), + ('bnb', 0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d, 'Fiat-backed stablecoin', 'USDC', 18, ''), + ('bnb', 0x3f56e0c36d275367b8c502090edf38289b3dea0d, 'Crypto-backed stablecoin', 'MAI', 18, ''), + ('bnb', 0x4bd17003473389a42daf6a0a729f6fdb328bbbd7, 'Crypto-backed stablecoin', 'VAI', 18, ''), + ('bnb', 0xf0186490b18cb74619816cfc7feb51cdbe4ae7b9, 'RWA-backed stablecoin', 'zUSD', 18, ''), + ('bnb', 0xfe19f0b51438fd612f6fd59c1dbb3ea319f433ba, 'Crypto-backed stablecoin', 'MIM', 18, ''), + ('bnb', 0xe9e7cea3dedca5984780bafc599bd69add087d56, 'Fiat-backed stablecoin', 'BUSD', 18, ''), + ('bnb', 0xb5102cee1528ce2c760893034a4603663495fd72, 'Crypto-backed stablecoin', 'USX', 18, ''), + ('bnb', 0xb7f8cd00c5a06c0537e2abff0b58033d02e5e094, 'Crypto-backed stablecoin', 'PAX', 18, ''), + ('bnb', 0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3, 'Hybrid stablecoin', 'DAI', 18, ''), + ('bnb', 0xd17479997f34dd9156deef8f95a52d81d265be9c, 'Algorithmic stablecoin', 'USDD', 18, '') + + + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_schema.yml b/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_schema.yml index a92c8032276..5ebe3c50929 100644 --- a/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/bnb/tokens_bnb_schema.yml @@ -6,7 +6,7 @@ models: blockchain: bnb sector: tokens project: bep20 - contributors: hildobby + contributors: hildobby, rantum config: tags: ['tokens', 'metadata', 'bep20', 'bnb'] description: "BEP20 Token Addresses, Symbols and Decimals" @@ -81,3 +81,26 @@ models: tests: - accepted_values: values: [ 'bep721', 'bep1155' ] + + - name: tokens_bnb_erc20_stablecoins + meta: + blockchain: bnb + sector: stablecoins + contributors: synthquest + config: + tags: ['tokens', 'bnb', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. + columns: + - name: blockchain + description: "Blockchain name" + - name: contract_address + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" + - name: symbol + description: "Stablecoin symbol" + - name: name + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql index 4e0bf25a6ca..cf35f9e8226 100644 --- a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql @@ -4588,4 +4588,41 @@ FROM (VALUES , ( 0xDfFb77dB95E16B791178D28CF994b13E84036076, 'BLU', 18) , ( 0x866a2bf4e572cbcf37d5071a7a58503bfb36be1b, 'M', 6) , ( 0x20157dbabb84e3bbfe68c349d0d44e48ae7b5ad2, 'dlcBTC', 8) + , ( 0xe1B4d34E8754600962Cd944B535180Bd758E6c2e, 'agETH', 18) + , ( 0x5C5b196aBE0d54485975D1Ec29617D42D9198326, 'stdeUSD', 18) + , ( 0x09db87a538bd693e9d08544577d5ccfaa6373a48, 'ynETH', 18) + , ( 0x3b50805453023a91a8bf641e279401a0b23fa6f9, 'REZ', 18) + , ( 0x7777cec341e7434126864195adef9b05dcc3489c, 'ONI', 18) + , ( 0x3ffeea07a27fab7ad1df5297fa75e77a43cb5790, 'PEIPEI', 18) + , ( 0x00f116ac0c304c570daaa68fa6c30a86a04b5c5f, 'INF', 18) + , ( 0x777be1c6075c20184c4fd76344b7b0b7c858fe6b, 'BAR', 18) + , ( 0xaa32f860756f6dcd5a684dc2aadf6c0921257a9a, 'YUNA', 18) + , ( 0xa045fe936e26e1e1e1fb27c1f2ae3643acde0171, 'KAI', 9) + , ( 0x9e566e28c61690f8afe0468f523e137b1ff29f01, 'GNCAT', 9) + , ( 0x7f911119435d8ded9f018194b4b6661331379a3d, 'FWOG', 18) + , ( 0x6985884c4392d348587b19cb9eaaf157f13271cd, 'ZRO', 18) + , ( 0x7b0df1cd724ec34ec9bc4bd19749b01afb490761, 'KOIN', 9) + , ( 0xb60fdf036f2ad584f79525b5da76c5c531283a1b, 'NEMO', 9) + , ( 0x5b342f03d126314d925fa57a45654f92905e6451, 'MNTA', 18) + , ( 0x8149745670881d99700078ede5903a1a7bebe262, 'PEPAY', 18) + , ( 0xb6f4d11d6c274f8f0a55d101b65223a45a3d1128, 'eBAKE', 9) + , ( 0xb35875b40f5ea5483c84ccd6e4ab0afc42a3c355, 'Nerio', 9) + , ( 0xf7554eac0bf20d702e69d08c425e817abb976aea, 'MAHA', 18) + , ( 0x3742f3fcc56b2d46c7b8ca77c23be60cd43ca80a, 'stAVAIL', 18) + , ( 0xd8eb27a94e610a7b859758ed1f2d47ad224bfaaa, 'GOPEPE', 18) + , ( 0xf7760c2c0677078b1d1b6b8463f1de1c6c91a9f8, 'PP', 18) + , ( 0x78128d17a89e5fe51bd0e757cfbc5703c34c7fb6, '$EWT', 18) + , ( 0xf1ff59fa458bee12d6526dbd92290090bf670e29, 'fluffy', 18) + , ( 0xffe9ae172dd1fc9929ba6902873e09fadf81afd7, 'GLOW', 18) + , ( 0xb146823fb8ea064d14ba1a52e3e55cde09afff2d, 'EYE', 18) + , ( 0x88ce174c655b6d11210a069b2c106632dabdb068, 'YAWN', 18) + , ( 0xf6b6235f6725f84457f5d6f0b0aa3c962a079977, 'WBKN', 18) + , ( 0x1039bae6254178ee2f6123cd64cde9e4ca79d779, 'WUKONG', 18) + , ( 0xe1c8d908f0e495cf6d8459547d1d28b72bf04bf2, 'TSAI', 18) + , ( 0x132b96b1152bb6be197501e8220a74d3e63e4682, 'WUKONG', 9) + , ( 0x516d339afa72f6959b8e06a31fbc32da3e49348b, 'CNCT', 18) + , ( 0x60407266586e204792b69b024558aa18228ab12f, 'MBAKER', 18) + , ( 0x048d07bd350ba516b84587e147284881b593eb86, 'SYNK', 18) + , ( 0xbbd91d5cda7085a186b1354e1b0744bb58ad7cf6, 'ZOMBIE', 9) + ) AS temp_table (contract_address, symbol, decimals) diff --git a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20_stablecoins.sql index c5e0def8a80..8072f092389 100644 --- a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20_stablecoins.sql +++ b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20_stablecoins.sql @@ -1,39 +1,66 @@ {{ config( - alias = 'stablecoins' + schema = 'tokens_ethereum' + , alias = 'erc20_stablecoins' , tags=['static'] , post_hook='{{ expose_spells(\'["ethereum"]\', "sector", "tokens_ethereum", - \'["gentrexha", "dot2dotseurat"]\') }}' + \'["Henrystats", "synthquest"]\') }}' + , unique_key = ['contract_address'] ) }} -SELECT contract_address, symbol, decimals, name +SELECT blockchain, contract_address, backing, symbol, decimals, name FROM (VALUES - (0xbc6da0fe9ad5f3b0d58160288917aa56653660e9, 'alUSD', 18, 'Alchemix USD'), - (0xd46ba6d942050d489dbd938a2c909a5d5039a161, 'AMPL', 9, 'Ampleforth'), - (0x4fabb145d64652a948d72533023f6e7a623c7c53, 'BUSD', 18, 'Binance USD'), - (0x6b175474e89094c44da98b954eedeac495271d0f, 'DAI', 18, 'Dai'), - (0xdb25f211ab05b1c97d595516f45794528a807ad8, 'EURS', 18, 'STASIS EURS'), - (0x956f47f50a910163d8bf957cf5846d573e7f87ca, 'FEI', 18, 'Fei USD'), - (0x853d955acef822db058eb8505911ed77f175b99e, 'FRAX', 18, 'Frax'), - (0x056fd409e1d7a124bd7017459dfea2f387b6d5cd, 'GUSD', 2, 'Gemini Dollar'), - (0xdf574c24545e5ffecb9a659c229253d4111d87e1, 'HUSD', 8, 'HUSD'), - (0x5f98805A4E8be255a32880FDeC7F6728C6568bA0, 'LUSD', 18, 'Liquity USD'), - (0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3, 'MIM', 18, 'Magic Internet Money'), - (0xe2f2a5c287993345a840db3b0845fbc70f5935a5, 'MUSD', 18, 'mStable USD'), - (0x8e870d67f660d95d5be530380d0ec0bd388289e1, 'PAX', 18, 'Paxos Standard'), - (0x03ab458634910aad20ef5f1c8ee96f1d6ac54919, 'RAI', 18, 'Rai Reflex Index'), - (0x57Ab1ec28D129707052df4dF418D58a2D46d5f51, 'sUSD', 18, 'Synthetix sUSD'), - (0x57Ab1E02fEE23774580C119740129eAC7081e9D3, 'sUSD', 18, 'Synthetix sUSD'), - (0x0000000000085d4780b73119b644ae5ecd22b376, 'TUSD', 18, 'TrueUSD'), - (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 'USDC', 6, 'USD Coin'), - (0x674c6ad92fd080e4004b2312b45f796a192d27a0, 'USDN', 18, 'Neutrino USD'), - (0x1456688345527bE1f37E9e627DA0837D6f08C925, 'USDP', 18, 'Pax Dollar'), - (0xdac17f958d2ee523a2206206994597c13d831ec7, 'USDT', 6, 'Tether'), - (0xa47c8bf37f92abed4a126bda807a7b7498661acd, 'UST', 18, 'Wrapped UST Token'), - (0xa693b19d2931d498c5b318df961919bb4aee87a5, 'UST', 6, 'UST (Wormhole)'), - (0xe07F9D810a48ab5c3c914BA3cA53AF14E4491e8A, 'GYD', 18, 'Gyro Dollar'), - (0x73a15fed60bf67631dc6cd7bc5b6e8da8190acf5, 'USD0', 18, 'Usual USD'), - (0x866a2bf4e572cbcf37d5071a7a58503bfb36be1b, 'M', 6, 'M by M^0') - ) AS temp_table (contract_address, symbol, decimals, name) + + ('ethereum', 0x6b175474e89094c44da98b954eedeac495271d0f, 'Hybrid stablecoin', 'DAI', 18, 'Dai'), + ('ethereum', 0x96f6ef951840721adbf46ac996b59e0235cb985c, 'Fiat-backed stablecoin', 'USDY', 18, ''), + ('ethereum', 0xc5f0f7b66764f6ec8c8dff7ba683102295e16409, 'Fiat-backed stablecoin', 'FDUSD', 18, ''), + ('ethereum', 0x8d6cebd76f18e1558d4db88138e2defb3909fad6, 'Crypto-backed stablecoin', 'MAI', 18, ''), + ('ethereum', 0x5f98805a4e8be255a32880fdec7f6728c6568ba0, 'Crypto-backed stablecoin', 'LUSD', 18, 'Liquity USD'), + ('ethereum', 0xf9c2b386ff5df088ac717ab0010587bad3bc1ab1, 'Hybrid stablecoin', 'iUSDS', 18, ''), + ('ethereum', 0x45fdb1b92a649fb6a64ef1511d3ba5bf60044838, 'Hybrid stablecoin', 'USDS', 18, ''), + ('ethereum', 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, 'Fiat-backed stablecoin', 'USDC', 6, 'USD Coin'), + ('ethereum', 0xdac17f958d2ee523a2206206994597c13d831ec7, 'Fiat-backed stablecoin', 'USDT', 6, 'Tether'), + ('ethereum', 0xbea0000029ad1c77d3d5d23ba2d8893db9d1efab, 'Algorithmic stablecoin', 'BEAN', 6, ''), + ('ethereum', 0xe2f2a5c287993345a840db3b0845fbc70f5935a5, 'Crypto-backed stablecoin', 'mUSD', 18, 'mStable USD'), + ('ethereum', 0x7712c34205737192402172409a8f7ccef8aa2aec, 'Fiat-backed stablecoin', 'BUIDL', 6, ''), + ('ethereum', 0x4fabb145d64652a948d72533023f6e7a623c7c53, 'Fiat-backed stablecoin', 'BUSD', 18, 'Binance USD'), + ('ethereum', 0x1456688345527be1f37e9e627da0837d6f08c925, 'Crypto-backed stablecoin', 'USDP', 18, 'Pax Dollar'), + ('ethereum', 0x2a8e1e676ec238d8a992307b495b45b3feaa5e86, 'Crypto-backed stablecoin', 'OUSD', 18, ''), + ('ethereum', 0x0c10bf8fcb7bf5412187a595ab97a3609160b5c6, 'Algorithmic stablecoin', 'USDD', 18, ''), + ('ethereum', 0x8e870d67f660d95d5be530380d0ec0bd388289e1, 'Fiat-backed stablecoin', 'USDP', 18, 'Paxos Standard'), + ('ethereum', 0x853d955acef822db058eb8505911ed77f175b99e, 'Hybrid stablecoin', 'FRAX', 18, 'Frax'), + ('ethereum', 0x6c3ea9036406852006290770bedfcaba0e23a0e8, 'Fiat-backed stablecoin', 'PYUSD', 6, ''), + ('ethereum', 0xdf574c24545e5ffecb9a659c229253d4111d87e1, 'Fiat-backed stablecoin', 'HUSD', 8, 'HUSD'), + ('ethereum', 0xc285b7e09a4584d027e5bc36571785b515898246, 'Fiat-backed stablecoin', 'CUSD', 18, ''), + ('ethereum', 0xdc59ac4fefa32293a95889dc396682858d52e5db, 'Algorithmic stablecoin', 'BEAN', 6, ''), + ('ethereum', 0xa774ffb4af6b0a91331c084e1aebae6ad535e6f3, 'Crypto-backed stablecoin', 'FLEXUSD', 18, ''), + ('ethereum', 0xa47c8bf37f92abed4a126bda807a7b7498661acd, 'Algorithmic stablecoin', 'UST', 18, 'Wrapped UST Token'), + ('ethereum', 0x0000000000085d4780b73119b644ae5ecd22b376, 'Fiat-backed stablecoin', 'TUSD', 18, 'TrueUSD'), + ('ethereum', 0x4c9edd5852cd905f086c759e8383e09bff1e68b3, 'Crypto-backed stablecoin', 'USDe', 18, ''), + ('ethereum', 0xc56c2b7e71b54d38aab6d52e94a04cbfa8f604fa, 'Fiat-backed stablecoin', 'ZUSD', 6, ''), + ('ethereum', 0x0a5e677a6a24b2f1a2bf4f3bffc443231d2fdec8, 'Crypto-backed stablecoin', 'USX', 18, ''), + ('ethereum', 0x196f4727526ea7fb1e17b2071b3d8eaa38486988, 'Crypto-backed stablecoin', 'RSV', 18, ''), + ('ethereum', 0xbc6da0fe9ad5f3b0d58160288917aa56653660e9, 'Crypto-backed stablecoin', 'alUSD', 18, 'Alchemix USD'), + ('ethereum', 0x73a15fed60bf67631dc6cd7bc5b6e8da8190acf5, 'Fiat-backed stablecoin', 'USD0', 18, 'Usual USD'), + ('ethereum', 0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3, 'Crypto-backed stablecoin', 'MIM', 18, 'Magic Internet Money'), + ('ethereum', 0xd5a14081a34d256711b02bbef17e567da48e80b5, 'RWA-backed stablecoin', 'wUSDR', 9, ''), + ('ethereum', 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 'Crypto-backed stablecoin', 'sUSD', 18, 'Synthetix sUSD'), + ('ethereum', 0x056fd409e1d7a124bd7017459dfea2f387b6d5cd, 'Fiat-backed stablecoin', 'GUSD', 2, 'Gemini Dollar'), + ('ethereum', 0x1c48f86ae57291f7686349f12601910bd8d470bb, 'Fiat-backed stablecoin', 'USDK', 18, ''), + ('ethereum', 0x865377367054516e17014ccded1e7d814edc9ce4, 'Crypto-backed stablecoin', 'DOLA', 18, ''), + ('ethereum', 0xb0b195aefa3650a6908f15cdac7d92f8a5791b0b, 'Crypto-backed stablecoin', 'BOB', 18, ''), + ('ethereum', 0x956f47f50a910163d8bf957cf5846d573e7f87ca, 'Algorithmic stablecoin', 'FEI', 18, 'Fei USD'), + ('ethereum', 0x9a1997c130f4b2997166975d9aff92797d5134c2, 'RWA-backed stablecoin', 'USDap', 18, ''), + ('ethereum', 0xd46ba6d942050d489dbd938a2c909a5d5039a161, 'Crypto-backed stablecoin', 'AMPL', 9, 'Ampleforth'), + ('ethereum', 0x03ab458634910aad20ef5f1c8ee96f1d6ac54919, 'Crypto-backed stablecoin', 'RAI', 18, 'Rai Reflex Index'), + ('ethereum', 0x674c6ad92fd080e4004b2312b45f796a192d27a0, 'Algorithmic stablecoin', 'USDN', 18, 'Neutrino USD'), + ('ethereum', 0x866a2bf4e572cbcf37d5071a7a58503bfb36be1b, 'Fiat-backed stablecoin', 'M', 6, 'M by M^0'), + ('ethereum', 0x57Ab1E02fEE23774580C119740129eAC7081e9D3, 'Crypto-backed stablecoin', 'sUSD', 18, 'Synthetix sUSD'), + ('ethereum', 0xa693b19d2931d498c5b318df961919bb4aee87a5, 'Crypto-backed stablecoin', 'UST', 6, 'UST (Wormhole)'), + ('ethereum', 0xe07F9D810a48ab5c3c914BA3cA53AF14E4491e8A, 'Crypto-backed stablecoin', 'GYD', 18, 'Gyro Dollar'), + ('ethereum', 0xdb25f211ab05b1c97d595516f45794528a807ad8, 'Fiat-backed stablecoin', 'EURS', 18, 'STASIS EURS') + + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_schema.yml b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_schema.yml index f3d409b6995..2577f0e571e 100644 --- a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_schema.yml @@ -6,7 +6,7 @@ models: blockchain: ethereum sector: tokens project: erc20 - contributors: soispoke, dot2dotseurat + contributors: soispoke, dot2dotseurat, rantum config: tags: ['table', 'erc20'] description: "ERC20 Token Addresses, Symbols and Decimals" @@ -88,23 +88,25 @@ models: - name: tokens_ethereum_erc20_stablecoins meta: blockchain: ethereum - sector: tokens - project: erc20 - contributors: gentrexha + sector: stablecoins + contributors: synthquest config: - tags: [ 'table', 'erc20', 'stablecoins' ] - description: "ERC20 Stablecoin Token Addresses, Symbols and Decimals" + tags: ['tokens', 'ethereum', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. columns: + - name: blockchain + description: "Blockchain name" - name: contract_address - description: "ERC20 stablecoin token contract address" - tests: - - unique + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" - name: symbol - description: "ERC20 stablecoin token symbol" - - name: decimals - description: "Number of decimals, refers to how divisible an ERC20 stablecoin token can be" + description: "Stablecoin symbol" - name: name - description: "ERC20 stablecoin token name" + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" - name: tokens_ethereum_nft_standards meta: diff --git a/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_erc20_stablecoins.sql index 5b58d18f6ff..0fe2a86254d 100644 --- a/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_erc20_stablecoins.sql +++ b/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_erc20_stablecoins.sql @@ -1,26 +1,38 @@ {{ config( - alias = 'stablecoins' + schema = 'tokens_fantom' + , alias = 'erc20_stablecoins' , tags=['static'] , post_hook='{{ expose_spells(\'["fantom"]\', "sector", "tokens_fantom", - \'["Henrystats"]\') }}' + \'["Henrystats", "synthquest"]\') }}' + , unique_key = ['contract_address'] ) }} -SELECT contract_address, symbol, decimals, name +SELECT blockchain, contract_address, backing, symbol, decimals, name FROM (VALUES - (0xc54A1684fD1bef1f077a336E6be4Bd9a3096a6Ca, '2SHARES', 18, '2SHARE'), - (0x04068DA6C83AFCFA0e13ba15A6696662335D5B75, 'USDC', 6, 'USD Coin'), - (0x049d68029688eAbF473097a2fC38ef61633A3C7A, 'fUSDT', 6, 'Frapped USDT'), - (0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E, 'DAI', 18, 'Dai Stablecoin'), - (0xdc301622e621166BD8E82f2cA0A26c13Ad0BE355, 'FRAX', 18, 'Frax'), - (0xAd84341756Bf337f5a0164515b1f6F993D194E1f, 'FUSD', 18, 'Fantom Foundation USD'), - (0x7a6e4E3CC2ac9924605DCa4bA31d1831c84b44aE, '2OMB', 18, '2omb Token'), - (0x846e4D51d7E2043C1a87E0Ab7490B93FB940357b, 'UST', 6, 'UST (Wormhole)'), - (0x87a5C9B60A3aaf1064006FE64285018e50e0d020, 'MAGIK', 18, 'Magik'), - (0x9879aBDea01a879644185341F7aF7d8343556B7a, 'TUSD', 18, 'TrueUSD'), - (0x1D3918043d22de2D799a4d80f72Efd50Db90B5Af, 'sPDO', 18, 'pDollar Share'), - (0x5f0456F728E2D59028b4f5B8Ad8C604100724C6A, 'L3USD', 18, 'L3USD'), - (0xb9D62c829fbF7eAff1EbA4E50F3D0480b66c1748, 'PDO', 18, 'pDollar') - ) AS temp_table (contract_address, symbol, decimals, name) \ No newline at end of file + ('fantom', 0x5f0456f728e2d59028b4f5b8ad8c604100724c6a, 'Hybrid stablecoin', 'L3USD', 18, 'L3USD'), + ('fantom', 0x3129662808bec728a27ab6a6b9afd3cbaca8a43c, 'Crypto-backed stablecoin', 'DOLA', 18, ''), + ('fantom', 0x9879abdea01a879644185341f7af7d8343556b7a, 'Fiat-backed stablecoin', 'TUSD', 18, 'TrueUSD'), + ('fantom', 0x0def844ed26409c5c46dda124ec28fb064d90d27, 'Hybrid stablecoin', 'CoUSD', 18, ''), + ('fantom', 0xb9d62c829fbf7eaff1eba4e50f3d0480b66c1748, 'Hybrid stablecoin', 'PDO', 18, 'pDollar'), + ('fantom', 0x7a6e4e3cc2ac9924605dca4ba31d1831c84b44ae, 'Hybrid stablecoin', '2OMB', 18, '2omb Token'), + ('fantom', 0x87a5c9b60a3aaf1064006fe64285018e50e0d020, 'Hybrid stablecoin', 'MAGIK', 18, 'Magik'), + ('fantom', 0x74e23df9110aa9ea0b6ff2faee01e740ca1c642e, 'Crypto-backed stablecoin', 'TOR', 18, ''), + ('fantom', 0xfb98b335551a418cd0737375a2ea0ded62ea213b, 'Crypto-backed stablecoin', 'miMATIC', 18, ''), + ('fantom', 0x04068da6c83afcfa0e13ba15a6696662335d5b75, 'Fiat-backed stablecoin', 'USDC', 6, 'USD Coin'), + ('fantom', 0x82f0b8b456c1a451378467398982d4834b6829c1, 'Crypto-backed stablecoin', 'MIM', 18, ''), + ('fantom', 0xdc301622e621166bd8e82f2ca0a26c13ad0be355, 'Hybrid stablecoin', 'FRAX', 18, 'Frax'), + ('fantom', 0xb67fa6defce4042070eb1ae1511dcd6dcc6a532e, 'Crypto-backed stablecoin', 'alUSD', 18, ''), + ('fantom', 0x846e4d51d7e2043c1a87e0ab7490b93fb940357b, 'Hybrid stablecoin', 'UST', 6, 'UST (Wormhole)'), + ('fantom', 0xad84341756bf337f5a0164515b1f6f993d194e1f, 'Hybrid stablecoin', 'FUSD', 18, 'Fantom Foundation USD'), + ('fantom', 0x049d68029688eabf473097a2fc38ef61633a3c7a, 'Fiat-backed stablecoin', 'fUSDT', 6, 'Frapped USDT'), + ('fantom', 0xe2d27f06f63d98b8e11b38b5b08a75d0c8dd62b9, 'Algorithmic stablecoin', 'UST', 6, ''), + ('fantom', 0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e, 'Crypto-backed stablecoin', 'DAI', 18, 'Dai Stablecoin'), + ('fantom', 0x6fc9383486c163fa48becdec79d6058f984f62ca, 'Hybrid stablecoin', 'USDB', 18, ''), + ('fantom', 0xc54a1684fd1bef1f077a336e6be4bd9a3096a6ca, 'Hybrid stablecoin', '2SHARES', 18, '2SHARE'), + ('fantom', 0x1d3918043d22de2d799a4d80f72efd50db90b5af, 'Hybrid stablecoin', 'sPDO', 18, 'pDollar Share') + + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_schema.yml b/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_schema.yml index 4d6b5f3eb00..8ddf73fab1c 100644 --- a/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/fantom/tokens_fantom_schema.yml @@ -89,23 +89,25 @@ models: - name: tokens_fantom_erc20_stablecoins meta: blockchain: fantom - sector: tokens - project: erc20 - contributors: Henrystats + sector: stablecoins + contributors: synthquest config: - tags: [ 'table', 'erc20', 'stablecoins' ] - description: "ERC20 Stablecoin Token Addresses, Symbols and Decimals" + tags: ['tokens', 'fantom', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. columns: + - name: blockchain + description: "Blockchain name" - name: contract_address - description: "ERC20 stablecoin token contract address" - tests: - - unique + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" - name: symbol - description: "ERC20 stablecoin token symbol" - - name: decimals - description: "Number of decimals, refers to how divisible an ERC20 stablecoin token can be" + description: "Stablecoin symbol" - name: name - description: "ERC20 stablecoin token name" + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" - name: tokens_fantom_nft_standards meta: diff --git a/dbt_subprojects/tokens/models/tokens/gnosis/tokens_gnosis_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/gnosis/tokens_gnosis_erc20_stablecoins.sql new file mode 100644 index 00000000000..e2e816c9eb3 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/gnosis/tokens_gnosis_erc20_stablecoins.sql @@ -0,0 +1,21 @@ +{{ config( + schema = 'tokens_gnosis' + , alias = 'erc20_stablecoins' + , tags=['static'] + , post_hook='{{ expose_spells(\'["gnosis"]\', + "sector", + "tokens_gnosis", + \'["synthquest"]\') }}' + , unique_key = ['contract_address'] + ) +}} + +SELECT blockchain, contract_address, backing, symbol, decimals, name +FROM (VALUES + ('gnosis', 0xdd96b45877d0e8361a4ddb732da741e97f3191ff, 'Fiat-backed stablecoin', 'BUSD', 18, ''), + ('gnosis', 0x4ecaba5870353805a9f068101a40e0f32ed605c6, 'Fiat-backed stablecoin', 'USDT', 6, ''), + ('gnosis', 0x3f56e0c36d275367b8c502090edf38289b3dea0d, 'Crypto-backed stablecoin', 'MAI', 18, ''), + ('gnosis', 0x44fa8e6f47987339850636f88629646662444217, 'Hybrid stablecoin', 'DAI', 18, ''), + ('gnosis', 0xddafbb505ad214d7b80b1f830fccc89b60fb7a83, 'Fiat-backed stablecoin', 'USDC', 6, '') + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/gnosis/tokens_gnosis_schema.yml b/dbt_subprojects/tokens/models/tokens/gnosis/tokens_gnosis_schema.yml index 30caa673f35..d53675e86d6 100644 --- a/dbt_subprojects/tokens/models/tokens/gnosis/tokens_gnosis_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/gnosis/tokens_gnosis_schema.yml @@ -86,3 +86,26 @@ models: tests: - accepted_values: values: [ 'erc721', 'erc1155'] + + - name: tokens_gnosis_erc20_stablecoins + meta: + blockchain: gnosis + sector: stablecoins + contributors: synthquest + config: + tags: ['tokens', 'gnosis', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. + columns: + - name: blockchain + description: "Blockchain name" + - name: contract_address + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" + - name: symbol + description: "Stablecoin symbol" + - name: name + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/linea/tokens_linea_erc20.sql b/dbt_subprojects/tokens/models/tokens/linea/tokens_linea_erc20.sql new file mode 100644 index 00000000000..f16bc1ff104 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/linea/tokens_linea_erc20.sql @@ -0,0 +1,35 @@ +{{ + config( + schema = 'tokens_linea' + ,alias = 'erc20' + ,tags = ['static'] + ,materialized = 'table' + ) +}} + +SELECT + contract_address + , symbol + , decimals +FROM (VALUES + (0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f, 'WETH', 18), + (0xaaaac83751090c6ea42379626435f805ddf54dc8, 'NILE', 18), + (0x78354f8dccb269a615a7e0a24f9b0718fdc3c7a7, 'ZERO', 18), + (0x1bf74c010e6320bab11e2e5a532b5ac15e0b8aa6, 'weETH', 18), + (0xa219439258ca9da29e9cc4ce5596924745e12b93, 'USDT', 6), + (0x5fbdf89403270a1846f5ae7d113a989f850d1566, 'FOXY', 18), + (0xd2671165570f41bbb3b0097893300b6eb6101e6c, 'wrsETH', 18), + (0x43e8809ea748eff3204ee01f08872f063e44065f, 'MENDI', 18), + (0x176211869ca2b568f2a7d4ee941e073a821ee1ff, 'USDC', 6), + (0x63ba74893621d3d12f13cec1e86517ec3d329837, 'LUSD', 18), + (0xacb54d07ca167934f57f829bee2cc665e1a5ebef, 'CROAK', 18), + (0x82cc61354d78b846016b559e3ccd766fa7e793d5, 'LINDA', 18), + (0x2416092f143378750bb29b79ed961ab195cceea5, 'ezETH', 18), + (0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4, 'WBTC', 8), + (0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5, 'DAI', 18), + (0x894134a25a5fac1c2c26f1d8fbf05111a3cb9487, 'GRAI', 18), + (0xeb466342c4d449bc9f53a865d5cb90586f405215, 'axlUSDC', 6), + (0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34, 'USDe', 18), + (0x59846bfc18fc21df6bed378748f99ea38f44d50a, 'lzIT', 6), + (0x1a51b19ce03dbe0cb44c1528e34a7edd7771e9af, 'LYNX', 18) +) AS temp_table (contract_address, symbol, decimals) \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/linea/tokens_linea_schema.yml b/dbt_subprojects/tokens/models/tokens/linea/tokens_linea_schema.yml new file mode 100644 index 00000000000..d2fb3fd6976 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/linea/tokens_linea_schema.yml @@ -0,0 +1,21 @@ +version: 2 + +models: + - name: tokens_linea_erc20 + meta: + blockchain: linea + sector: tokens + project: erc20 + contributors: rantum + config: + tags: ['table', 'erc20'] + description: "ERC20 Token Addresses, Symbols and Decimals" + columns: + - name: contract_address + description: "ERC20 token contract address" + tests: + - unique + - name: symbol + description: "ERC20 token symbol" + - name: decimals + description: "Number of decimals, refers to how divisible an ERC20 token can be" diff --git a/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_curated.sql b/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_curated.sql index e4931bd50bd..fbb3b7e3457 100644 --- a/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_curated.sql +++ b/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_curated.sql @@ -448,6 +448,9 @@ WITH raw_token_list AS ( ,(0x43a502d7e947c8a2ebbaf7627e104ddcc253abc6, 's_aOptDAI', 18, 'receipt') ,(0x337b4b933d60f40cb57dd19ae834af103f049810, 's_aOptWETH', 18, 'receipt') ,(0xe62dda84e579e6a37296bcfc74c97349d2c59ce3, 'ysWETH', 18, 'receipt') + ,(0xd08C3F25862077056cb1b710937576Af899a4959, 'InstETH', 18, 'underlying') + ,(0x57f5e098cad7a3d1eed53991d4d66c45c9af7812, 'wUSDM', 18, 'receipt') + ,(0xbfd5206962267c7b4b4a8b3d76ac2e1b2a5c4d5e, 'OSAK', 18, 'underlying') ) AS temp_table (contract_address, symbol, decimals, token_type) ) SELECT diff --git a/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_stablecoins.sql index 36b166d1761..42837c64d4d 100644 --- a/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_stablecoins.sql +++ b/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_erc20_stablecoins.sql @@ -1,66 +1,49 @@ {{ config( - alias='stablecoins' + schema = 'tokens_optimism' + , alias = 'erc20_stablecoins' , tags=['static'] , post_hook='{{ expose_spells(\'["optimism"]\', "sector", "tokens_optimism", - \'["msilb7"]\') }}' + \'["msilb7", "synthquest"]\') }}' + , unique_key = ['contract_address'] ) }} --- In this table we include underlying stablecoin tokens on Optimism. --- LP Tokens (i.e. 3crv) should not be included since these are made up of udnerlying stables. --- This is a lookup tables that's helpful for any analysis that focuses on stablecoins. - -SELECT - tbl.contract_address - , et.symbol,et. decimals - , tbl.name, tbl.currency_peg, tbl.reserve_type - +SELECT blockchain, contract_address, backing, symbol, decimals, name FROM (VALUES - --Type sourced from Defillama's mappings when relevant: https://defillama.com/stablecoins - (0xda10009cbd5d07dd0cecc66161fc93d7c9000da1, 'Dai Stablecoin', 'USD', 'Crypto-Backed') - ,(0x94b008aa00579c1307b0ef2c499ad98a8ce58e58, 'Tether USD', 'USD', 'Fiat-Backed') - ,(0x7f5c764cbc14f9669b88837ca1490cca17c31607, 'USD Coin', 'USD', 'Fiat-Backed') - ,(0xc40f949f8a4e094d1b49a23ea9241d289b7b2819, 'LUSD Stablecoin', 'USD', 'Crypto-Backed') - ,(0xbfd291da8a403daaf7e5e9dc1ec0aceacd4848b9, 'dForce USD', 'USD', 'Crypto-Backed') - ,(0x2e3d870790dc77a83dd1d18184acc7439a53f475, 'FRAX', 'USD', 'Algorithmic') - ,(0xba28feb4b6a6b81e3f26f08b83a19e715c4294fd, 'UST (Wormhole)', 'USD', 'Algorithmic') - ,(0xfb21b70922b9f6e3c6274bcd6cb1aa8a0fe20b80, 'Terra USD', 'USD', 'Algorithmic') - ,(0x7113370218f31764c1b6353bdf6004d86ff6b9cc, 'Decentralized USD','USD','Algorithmic') - ,(0xcb59a0a753fdb7491d5f3d794316f1ade197b21e, 'TrueUSD','USD','Fiat-Backed') - ,(0xcb8fa9a76b8e203d8c3797bf438d8fb81ea3326a, 'Alchemix USD','USD','Algorithmic') - ,(0xb0b195aefa3650a6908f15cdac7d92f8a5791b0b, 'BOB','USD','Crypto-Backed') - ,(0xdfa46478f9e5ea86d57387849598dbfb2e964b02, 'Mai Stablecoin','USD','Crypto-Backed') - ,(0x7fb688ccf682d58f86d7e38e03f9d22e7705448b, 'Rai Reflex Index','None','Crypto-Backed') - ,(0x340fe1d898eccaad394e2ba0fc1f93d27c7b717a, 'Wrapped USDR','USD','Algorithmic') - ,(0x9c9e5fd8bbc25984b178fdce6117defa39d2db39, 'Binance-Peg BUSD Token','USD','Fiat-Backed') - ,(0xb153fb3d196a8eb25522705560ac152eeec57901, 'Magic Internet Money','USD','Crypto-Backed') - ,(0x8ae125e8653821e851f12a49f7765db9a9ce7384, 'Dola USD Stablecoin','USD','Crypto-Backed') - ,(0x73cb180bf0521828d8849bc8CF2B920918e23032, 'USD+', 'USD','Crypto-Backed') - ,(0x9485aca5bbbe1667ad97c7fe7c4531a624c8b1ed, 'agEUR', 'EUR', 'Crypto-Backed') - ,(0x79af5dd14e855823fa3e9ecacdf001d99647d043, 'Jarvis Synthetic Euro','EUR','Crypto-Backed') - ,(0x970d50d09f3a656b43e11b0d45241a84e3a6e011, 'DAI+', 'USD','Crypto-Backed') - - -- --Synthetix Tokens - ,(0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9, 'Synth sUSD', 'USD', 'Crypto-Backed') - ,(0xfbc4198702e81ae77c06d58f81b629bdf36f0a71, 'Synth sEUR', 'EUR', 'Crypto-Backed') - ,(0xa3a538ea5d5838dc32dde15946ccd74bdd5652ff, 'Synth sINR', 'INR', 'Crypto-Backed') - - - -- --Transfer Tokens (Common Among Bridges) - ,(0x25d8039bb044dc227f741a9e381ca4ceae2e6ae8, 'USD Coin Hop Token', 'USD', 'Bridge-Backed') - ,(0x3666f603cc164936c1b87e207f36beba4ac5f18a, 'USD Coin Hop Token', 'USD', 'Bridge-Backed') - ,(0x2057c8ecb70afd7bee667d76b4cd373a325b1a20, 'Tether USD Hop Token', 'USD', 'Bridge-Backed') - ,(0x56900d66d74cb14e3c86895789901c9135c95b16, 'DAI Hop Token', 'USD', 'Bridge-Backed') - ,(0x67c10c397dd0ba417329543c1a40eb48aaa7cd00, 'Synapse USD', 'USD', 'Bridge-Backed') - - ) AS tbl (contract_address, name, currency_peg, reserve_type) - --- JOIN FOR DATA QUALITY --- -- Enforce that the token is listen in "tokens_optimism_erc20.sql" --- -- Pull symbol and decimals from root table - -INNER JOIN {{source('tokens_optimism', 'erc20')}} et - ON et.contract_address = tbl.contract_address - AND et.is_counted_in_tvl = 1 -- Make sure we don't include any receipt or placeholder tokens + ('optimism', 0xfb21b70922b9f6e3c6274bcd6cb1aa8a0fe20b80, 'Algorithmic stablecoin', 'UST', 6, 'Terra USD'), + ('optimism', 0x970d50d09f3a656b43e11b0d45241a84e3a6e011, 'Crypto-backed stablecoin', 'DAI+', 18, 'DAI+'), + ('optimism', 0xdfa46478f9e5ea86d57387849598dbfb2e964b02, 'Crypto-backed stablecoin', 'MAI', 18, 'Mai Stablecoin'), + ('optimism', 0x3666f603cc164936c1b87e207f36beba4ac5f18a, 'Bridge-backed stablecoin', 'hUSD', 6, 'USD Coin Hop Token'), + ('optimism', 0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9, 'Crypto-backed stablecoin', 'sUSD', 18, 'Synth sUSD'), + ('optimism', 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1, 'Crypto-backed stablecoin', 'DAI', 18, 'Dai Stablecoin'), + ('optimism', 0xc40f949f8a4e094d1b49a23ea9241d289b7b2819, 'Crypto-backed stablecoin', 'LUSD', 18, 'LUSD Stablecoin'), + ('optimism', 0x25d8039bb044dc227f741a9e381ca4ceae2e6ae8, 'Bridge-backed stablecoin', 'hUSDC', 6, 'USD Coin Hop Token'), + ('optimism', 0x79af5dd14e855823fa3e9ecacdf001d99647d043, 'Crypto-backed stablecoin', 'EUR', 18, 'Jarvis Synthetic Euro'), + ('optimism', 0xfbc4198702e81ae77c06d58f81b629bdf36f0a71, 'Crypto-backed stablecoin', 'sEUR', 18, 'Synth sEUR'), + ('optimism', 0xcb59a0a753fdb7491d5f3d794316f1ade197b21e, 'Fiat-backed stablecoin', 'TUSD', 18, 'TrueUSD'), + ('optimism', 0x7fb688ccf682d58f86d7e38e03f9d22e7705448b, 'Crypto-backed stablecoin', 'RAI', 18, 'Rai Reflex Index'), + ('optimism', 0xcb8fa9a76b8e203d8c3797bf438d8fb81ea3326a, 'Algorithmic stablecoin', 'alUSD', 18, 'Alchemix USD'), + ('optimism', 0x340fe1d898eccaad394e2ba0fc1f93d27c7b717a, 'Algorithmic stablecoin', 'wUSDR', 9, 'Wrapped USDR'), + ('optimism', 0x2e3d870790dc77a83dd1d18184acc7439a53f475, 'Hybrid stablecoin', 'FRAX', 18, 'FRAX'), + ('optimism', 0xb0b195aefa3650a6908f15cdac7d92f8a5791b0b, 'Crypto-backed stablecoin', 'BOB', 18, 'BOB'), + ('optimism', 0x8ae125e8653821e851f12a49f7765db9a9ce7384, 'Crypto-backed stablecoin', 'DOLA', 18, 'Dola USD Stablecoin'), + ('optimism', 0x0b2c639c533813f4aa9d7837caf62653d097ff85, 'Fiat-backed stablecoin', 'USDC', 6, 'Circle USDC'), + ('optimism', 0x67c10c397dd0ba417329543c1a40eb48aaa7cd00, 'Bridge-backed stablecoin', 'nUSD', 18, 'Synapse USD'), + ('optimism', 0x56900d66d74cb14e3c86895789901c9135c95b16, 'Bridge-backed stablecoin', 'hDAI', 18, 'DAI Hop Token'), + ('optimism', 0x73cb180bf0521828d8849bc8cf2b920918e23032, 'Crypto-backed stablecoin', 'USD+', 6, 'USD+'), + ('optimism', 0x59d9356e565ab3a36dd77763fc0d87feaf85508c, 'Fiat-backed stablecoin', 'USDM', 18, ''), + ('optimism', 0xb153fb3d196a8eb25522705560ac152eeec57901, 'Crypto-backed stablecoin', 'MIM', 18, 'Magic Internet Money'), + ('optimism', 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58, 'Fiat-backed stablecoin', 'USDT', 6, 'Tether USD'), + ('optimism', 0x7f5c764cbc14f9669b88837ca1490cca17c31607, 'Fiat-backed stablecoin', 'USDC.e', 6, 'USD Coin'), + ('optimism', 0xa3a538ea5d5838dc32dde15946ccd74bdd5652ff, 'Crypto-backed stablecoin', 'sINR', 18, 'Synth sINR'), + ('optimism', 0x9c9e5fd8bbc25984b178fdce6117defa39d2db39, 'Fiat-backed stablecoin', 'BUSD', 18, 'Binance-Peg BUSD Token'), + ('optimism', 0x7113370218f31764c1b6353bdf6004d86ff6b9cc, 'Algorithmic stablecoin', 'USDD', 18, 'Decentralized USD'), + ('optimism', 0x2057c8ecb70afd7bee667d76b4cd373a325b1a20, 'Bridge-backed stablecoin', 'hUSDT', 6, 'Tether USD Hop Token'), + ('optimism', 0x9485aca5bbbe1667ad97c7fe7c4531a624c8b1ed, 'Crypto-backed stablecoin', 'agEUR', 18, 'agEUR'), + ('optimism', 0xbfd291da8a403daaf7e5e9dc1ec0aceacd4848b9, 'Crypto-backed stablecoin', 'USX', 18, 'dForce USD'), + ('optimism', 0xba28feb4b6a6b81e3f26f08b83a19e715c4294fd, 'Algorithmic stablecoin', 'UST', 6, 'UST (Wormhole)') + + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_schema.yml b/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_schema.yml index 6e8afb8c534..b3bb4c83c68 100644 --- a/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/optimism/tokens_optimism_schema.yml @@ -37,7 +37,7 @@ models: blockchain: optimism sector: tokens project: erc20 - contributors: msilb7 + contributors: msilb7, rantum config: tags: ['table', 'erc20', 'optimism'] description: "Manually identified ERC20 Token Addresses, Symbols and Decimals" @@ -172,32 +172,25 @@ models: - name: tokens_optimism_erc20_stablecoins meta: blockchain: optimism - sector: tokens - project: erc20 - contributors: msilb7 + sector: stablecoins + contributors: synthquest config: - tags: [ 'table', 'erc20', 'stablecoins' ] - description: "Optimism ERC20 Stablecoin Token Addresses, Symbols, Decimals, and Information" + tags: ['tokens', 'optimism', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. columns: + - name: blockchain + description: "Blockchain name" - name: contract_address - description: "ERC20 stablecoin token contract address" - tests: - - unique - - not_null + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" - name: symbol - description: "ERC20 stablecoin token symbol" - - name: decimals - description: "Number of decimals, refers to how divisible an ERC20 stablecoin token can be" + description: "Stablecoin symbol" - name: name - description: "ERC20 stablecoin token name" - - name: currency_peg - description: "What currency is the stablecoin pegged to" - - &reserve_type - name: reserve_type - description: "What is the type of backing for the stablecoin" - tests: - - accepted_values: - values: ['Crypto-Backed','Fiat-Backed','Algorithmic','Bridge-Backed'] + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" - name: tokens_optimism_nft_standards meta: diff --git a/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_erc20.sql b/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_erc20.sql index df983de9138..6e911f2ebfd 100644 --- a/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_erc20.sql @@ -46,4 +46,9 @@ FROM (VALUES , (0xc3323b6e71925b25943fb7369ee6769837e9c676, 'PORIGON', 18) , (0x365e13f973bd62024be8a70a225684c58baad03c, 'MPM', 18) , (0xA135f5A2Fb085c15BF56e5703e61167Fb5Ae7E42, 'MIKI', 18) + , (0x3c69d114664d48357d820dbdd121a8071eac99bf, 'GALAXIS', 18) + , (0x683565196c3eab450003c964d4bad1fd3068d4cc, 'VDA', 18) + , (0x94f05506b6a9c564839d8e95b21f9fb4f42ff2aa, 'SFRIED', 18) + , (0x9b8b6a1298d34b3c4bbddce8a7ff0149121592c1, 'AMBO', 18) + , (0xe9d2fa815b95a9d087862a09079549f351dab9bd, 'BONSAI', 18) ) AS temp_table (contract_address, symbol, decimals) diff --git a/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_erc20_stablecoins.sql new file mode 100644 index 00000000000..3e705292284 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_erc20_stablecoins.sql @@ -0,0 +1,37 @@ +{{ config( + schema = 'tokens_polygon' + , alias = 'erc20_stablecoins' + , tags=['static'] + , post_hook='{{ expose_spells(\'["polygon"]\', + "sector", + "tokens_polygon", + \'["synthquest"]\') }}' + , unique_key = ['contract_address'] + ) +}} + +SELECT blockchain, contract_address, backing, symbol, decimals, name +FROM (VALUES + ('polygon', 0x2791bca1f2de4661ed88a30c99a7a9449aa84174, 'Fiat-backed stablecoin', 'USDC', 6, ''), + ('polygon', 0x3c499c542cef5e3811e1192ce70d8cc03d5c3359, 'Fiat-backed stablecoin', 'USDC', 6, ''), + ('polygon', 0x692597b009d13c4049a947cab2239b7d6517875f, 'Algorithmic stablecoin', 'UST', 18, ''), + ('polygon', 0xcf66eb3d546f0415b368d98a95eaf56ded7aa752, 'Crypto-backed stablecoin', 'USX', 18, ''), + ('polygon', 0x8f3cf7ad23cd3cadbd9735aff958023239c6a063, 'Hybrid stablecoin', 'DAI', 18, ''), + ('polygon', 0x2e1ad108ff1d8c782fcbbb89aad783ac49586756, 'Fiat-backed stablecoin', 'TUSD', 18, ''), + ('polygon', 0xd86b5923f3ad7b585ed81b448170ae026c65ae9a, 'Hybrid stablecoin', 'IRON', 18, ''), + ('polygon', 0xffa4d863c96e743a2e1513824ea006b8d0353c57, 'Algorithmic stablecoin', 'USDD', 18, ''), + ('polygon', 0x9c9e5fd8bbc25984b178fdce6117defa39d2db39, 'Fiat-backed stablecoin', 'BUSD', 18, ''), + ('polygon', 0x49a0400587a7f65072c87c4910449fdcc5c47242, 'Crypto-backed stablecoin', 'MIM', 18, ''), + ('polygon', 0x2f1b1662a895c6ba01a99dcaf56778e7d77e5609, 'Hybrid stablecoin', 'USDS', 18, ''), + ('polygon', 0xaf0d9d65fc54de245cda37af3d18cbec860a4d4b, 'RWA-backed stablecoin', 'wUSDR', 9, ''), + ('polygon', 0x45c32fa6df82ead1e2ef74d17b76547eddfaff89, 'Hybrid stablecoin', 'FRAX', 18, ''), + ('polygon', 0x66f31345cb9477b427a1036d43f923a557c432a4, 'Hybrid stablecoin', 'iUSDS', 18, ''), + ('polygon', 0xb0b195aefa3650a6908f15cdac7d92f8a5791b0b, 'Crypto-backed stablecoin', 'BOB', 18, ''), + ('polygon', 0xc2132d05d31c914a87c6611c10748aeb04b58e8f, 'Fiat-backed stablecoin', 'USDT', 6, ''), + ('polygon', 0xa3fa99a148fa48d14ed51d610c367c61876997f1, 'Crypto-backed stablecoin', 'miMATIC', 18, ''), + ('polygon', 0xdab529f40e671a1d4bf91361c21bf9f0c9712ab7, 'Fiat-backed stablecoin', 'BUSD', 18, ''), + ('polygon', 0x3a3e7650f8b9f667da98f236010fbf44ee4b2975, 'Crypto-backed stablecoin', 'xUSD', 18, ''), + ('polygon', 0x23001f892c0c82b79303edc9b9033cd190bb21c7, 'Crypto-backed stablecoin', 'LUSD', 18, '') + + + ) AS temp_table (blockchain, contract_address, backing, symbol, decimals, name) diff --git a/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_schema.yml b/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_schema.yml index 5056c5f769e..69aa6724c74 100644 --- a/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/polygon/tokens_polygon_schema.yml @@ -81,3 +81,26 @@ models: tests: - accepted_values: values: [ 'erc721', 'erc1155' ] + + - name: tokens_polygon_erc20_stablecoins + meta: + blockchain: polygon + sector: stablecoins + contributors: synthquest + config: + tags: ['tokens', 'polygon', 'erc20', 'stablecoins'] + description: > + Selection of stablecoin token addresses. + columns: + - name: blockchain + description: "Blockchain name" + - name: contract_address + description: "Stablecoin contract address" + - name: backing + description: "Stablecoin backing" + - name: symbol + description: "Stablecoin symbol" + - name: name + description: "Stablecoin project name" + - name: decimals + description: "Number of decimals" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_erc20.sql b/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_erc20.sql index 61bdbe0aba7..78c0a6f023e 100644 --- a/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_erc20.sql @@ -25,4 +25,6 @@ FROM (VALUES , (0x608ef9a3bffe206b86c3108218003b3cfbf99c84, 'KNC', 18) , (0x79379c0e09a41d7978f883a56246290ee9a8c4d3, 'AAVE', 18) , (0x5300000000000000000000000000000000000004, 'WETH', 18) + , (0xaaae8378809bb8815c08d3c59eb0c7d1529ad769, 'NURI', 18) + , (0x8731d54e9d02c286767d56ac03e8037c07e01e98, 'STG', 18) ) AS temp_table (contract_address, symbol, decimals) \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_schema.yml b/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_schema.yml index b59b397f529..72eef1c075c 100644 --- a/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/scroll/tokens_scroll_schema.yml @@ -6,7 +6,7 @@ models: blockchain: scroll sector: tokens project: erc20 - contributors: lgingerich + contributors: lgingerich, rantum config: tags: ['table', 'erc20'] description: "ERC20 Token Addresses, Symbols and Decimals" diff --git a/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql b/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql index fa5d8aac7b9..f2ba6348830 100644 --- a/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql @@ -3,10 +3,10 @@ schema = 'tokens' ,alias = 'erc20' ,materialized = 'table' - ,post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","bnb","celo","ethereum","fantom","fuse","gnosis","goerli","mantle","optimism","polygon","scroll","zkevm","zksync","zora","blast","sepolia","sei","nova"]\', + ,post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","bnb","celo","ethereum","fantom","fuse","gnosis","goerli","mantle","optimism","polygon","scroll","zkevm","zksync","zora","blast","sepolia","sei","nova","linea"]\', "sector", "tokens", - \'["bh2smith","0xManny","hildobby","soispoke","dot2dotseurat","mtitus6","wuligy","lgingerich","0xRob","jeff-dude","viniabussafi","IrishLatte19","angus_1","Henrystats"]\') }}' + \'["bh2smith","0xManny","hildobby","soispoke","dot2dotseurat","mtitus6","wuligy","lgingerich","0xRob","jeff-dude","viniabussafi","IrishLatte19","angus_1","Henrystats","rantum"]\') }}' ) }} @@ -37,6 +37,7 @@ ,'tokens_sepolia': {'blockchain': 'sepolia', 'model': ref('tokens_sepolia_erc20')} ,'tokens_sei': {'blockchain': 'sei', 'model': ref('tokens_sei_erc20')} ,'tokens_nova': {'blockchain': 'nova', 'model': ref('tokens_nova_erc20')} + ,'tokens_linea': {'blockchain': 'linea', 'model': ref('tokens_linea_erc20')} } %} with diff --git a/dbt_subprojects/tokens/models/tokens/tokens_erc20_stablecoins.sql b/dbt_subprojects/tokens/models/tokens/tokens_erc20_stablecoins.sql new file mode 100644 index 00000000000..a51741e0877 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/tokens_erc20_stablecoins.sql @@ -0,0 +1,42 @@ +{{ config( + schema='tokens', + alias = 'erc20_stablecoins', + materialized='table', + tags = ['static'], + post_hook = '{{ expose_spells(\'["ethereum", "arbitrum", "gnosis", "optimism", "bnb", "avalanche_c", "polygon", "fantom", "base"]\', + "sector", + "stablecoins", + \'["synthquest"]\') }}' + ) +}} + +{% set stables_models = [ + ref('tokens_arbitrum_erc20_stablecoins') +, ref('tokens_avalanche_c_erc20_stablecoins') +, ref('tokens_bnb_erc20_stablecoins') +, ref('tokens_ethereum_erc20_stablecoins') +, ref('tokens_fantom_erc20_stablecoins') +, ref('tokens_gnosis_erc20_stablecoins') +, ref('tokens_optimism_erc20_stablecoins') +, ref('tokens_polygon_erc20_stablecoins') +, ref('tokens_base_erc20_stablecoins') +] %} + + +SELECT * +FROM +( + {% for model in stables_models %} + SELECT + blockchain + , contract_address + , backing + , symbol + , decimals + , name + FROM {{ model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/_schema.yml b/dbt_subprojects/tokens/models/transfers_and_balances/_schema.yml new file mode 100644 index 00000000000..5b9a6ab9cb9 --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/_schema.yml @@ -0,0 +1,55 @@ +version: 2 + +models: + - name: tokens_transfers + meta: + docs_slug: /curated/asset-tracking/evm/token-transfers + sector: tokens + contributors: aalan3, jeff-dude, 0xBoxer + config: + tags: ['tokens','transfers'] + description: > + Transfers of all kinds of fungible tokens across all evm networks on dune + columns: + - name: unique_key + description: "Surrogate key to identify unique row" + - name: blockchain + description: "The blockchain of the transfer" + - name: block_month + description: "The month of the block" + - name: block_date + description: "The date of the block" + - name: block_time + description: "The time of the block" + - name: block_number + description: "The block number" + - name: tx_hash + description: "The transaction hash" + - name: evt_index + description: "The log event index of the transfer" + - name: trace_address + description: "The trace address of the transfer" + - name: token_standard + description: "The token standard of the transfer" + - name: tx_from + description: "The transaction sender" + - name: tx_to + description: "The transaction receiver" + - name: tx_index + description: "The transaction index" + - name: from + description: "The sender of the transfer" + - name: to + description: "The receiver of the transfer" + - name: contract_address + description: "The contract address of the transfer" + - name: symbol + description: "The token symbol transferred" + - name: amount_raw + description: "The raw amount of the transfer" + - name: amount + description: "The display amount of the transfer" + - name: price_usd + description: "The USD price used to calculate the amount_usd" + - name: amount_usd + description: "The USD amount of the transfer" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_base_transfers.sql index 9f698a17dc8..99924408bcd 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_arbitrum', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -15,6 +15,6 @@ traces = source('arbitrum','traces'), transactions = source('arbitrum','transactions'), erc20_transfers = source('erc20_arbitrum','evt_transfer'), - native_contract_address = null, + native_contract_address = null ) }} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_transfers.sql index 91d9471e85c..a13163bb2a8 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_arbitrum', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_base_transfers.sql index 8ad998cd9eb..b1d3f143975 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_avalanche_c', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_transfers.sql index f1c8fc32019..a39d39c652d 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_avalanche_c', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_base_transfers.sql index 9700366294b..e7faff2b1a8 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_base', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_transfers.sql index 9761d7ba542..1900c3eaab5 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/base/tokens_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_base', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_base_transfers.sql index c25bd007405..becf21e9fc2 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_blast', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_transfers.sql index 402d5198397..6ec565ff64d 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/blast/tokens_blast_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_blast', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_base_transfers.sql index d3cafa8a480..0c9af17ecc2 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_bnb', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_transfers.sql index 6ef4e17834b..699f7a91f3a 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/bnb/tokens_bnb_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_bnb', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_base_transfers.sql index 7081434502a..81b032cafa8 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_celo', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_transfers.sql index 88f1706f1f5..8e0be084ff7 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/celo/tokens_celo_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_celo', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_base_transfers.sql index ade7289de88..9af2d0e87d2 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_base_transfers.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_ethereum', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -15,7 +15,7 @@ traces = source('ethereum','traces'), transactions = source('ethereum','transactions'), erc20_transfers = source('erc20_ethereum','evt_Transfer'), - native_contract_address = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', + native_contract_address = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' )}} UNION ALL diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_transfers.sql index b92d827b3b8..62d36fb8682 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_ethereum', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_base_transfers.sql index 63e9ab3cb7b..3bce12e1077 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_fantom', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_transfers.sql index 215b152dc80..3218794b472 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/fantom/tokens_fantom_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_fantom', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/_schema.yml b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/_schema.yml index b1be82600a2..75d20e52d77 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/_schema.yml +++ b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/_schema.yml @@ -2,105 +2,114 @@ version: 2 models: - name: tokens_gnosis_base_transfers + description: "Basic token transfer records on the Gnosis blockchain." meta: blockchain: gnosis sector: tokens - contributors: aalan3, jeff-dude + contributors: ['aalan3', 'jeff-dude', 'hdser'] config: - tags: ['tokens','transfers', 'gnosis'] - description: > - Token transfers - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - unique_key - columns: + tags: ['tokens', 'base', 'transfers', 'gnosis'] + columns: &base_columns - name: unique_key - description: "Surrogate key to identify unique row" + description: "Surrogate key to identify unique row." - name: blockchain - description: "The blockchain of the transfers" + description: "The blockchain where the transfer occurred." - name: block_date - description: "The date of the block" + description: "The date of the block in which the transfer was recorded." - name: block_time - description: "The time of the block" + description: "The exact time when the block was mined." - name: block_number - description: "The block number" + description: "The number of the block in the blockchain." - name: tx_hash - description: "The transaction hash" + description: "The hash of the transaction." - name: evt_index - description: "The log event index of the transfer if any" + description: "The log event index of the transfer if any." - name: trace_address - description: "The trace address of the transfer if any" + description: "The trace address of the transfer if any." - name: token_standard - description: "The token standard of the transfer" + description: "The token standard of the transfer." - name: tx_from - description: "The transaction sender" + description: "The transaction sender." - name: tx_to - description: "The transaction receiver" + description: "The transaction receiver." - name: tx_index - description: "The transaction index" + description: "The transaction index." - name: from - description: "The sender of the transfer" + description: "The sender of the transfer." - name: to - description: "The receiver of the transfer" + description: "The receiver of the transfer." - name: contract_address - description: "The contract address of the transfer" + description: "The contract address of the transfer." - name: amount_raw - description: "The raw amount of the transfer" + description: "The raw amount of the transfer." - name: tokens_gnosis_transfers + description: "All token transfers on the Gnosis blockchain, enriched with additional data." meta: blockchain: gnosis sector: tokens - contributors: aalan3, jeff-dude + contributors: ['aalan3', 'jeff-dude', 'hdser'] config: - tags: ['tokens','transfers', 'gnosis'] - description: > - Token transfers - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_date - - unique_key - columns: - - name: unique_key - description: "Surrogate key to identify unique row" - - name: blockchain - description: "The blockchain of the transfers" - - name: block_date - description: "The date of the block" - - name: block_time - description: "The time of the block" - - name: block_number - description: "The block number" - - name: tx_hash - description: "The transaction hash" - - name: evt_index - description: "The log event index of the transfer if any" - - name: trace_address - description: "The trace address of the transfer if any" - - name: token_standard - description: "The token standard of the transfer" - - name: tx_from - description: "The transaction sender" - - name: tx_to - description: "The transaction receiver" - - name: tx_index - description: "The transaction index" - - name: from - description: "The sender of the transfer" - - name: to - description: "The receiver of the transfer" - - name: contract_address - description: "The contract address of the transfer" + tags: ['tokens', 'transfers', 'gnosis'] + columns: + - <<: *base_columns - name: symbol - description: "The token symbol transferred" - - name: amount_raw - description: "The raw amount of the transfer" + description: "The token symbol transferred." - name: amount - description: "The formatted amount of the transfer" + description: "The formatted amount of the transfer." - name: price_usd - description: "The USD price used to calculate the amount_usd" + description: "The USD price used to calculate the amount_usd." - name: amount_usd - description: "The USD amount of the transfer" \ No newline at end of file + description: "The USD amount of the transfer." + + - name: tokens_gnosis_suicide_transfers + description: "Token transfers related to account destruction or contract suicide on the Gnosis blockchain." + meta: + blockchain: gnosis + sector: tokens + contributors: ['hdser'] + config: + tags: ['tokens', 'suicide', 'transfers', 'gnosis'] + columns: + - <<: *base_columns + - name: refund_address + description: "The refund address in case of a suicide transaction." + + - name: tokens_gnosis_base_without_suicide_transfers + description: "All token transfers excluding suicides on the Gnosis blockchain." + meta: + blockchain: gnosis + sector: tokens + contributors: ['hdser'] + config: + tags: ['tokens', 'base', 'non-suicide', 'transfers', 'gnosis'] + columns: + - <<: *base_columns + + - name: tokens_gnosis_base_non_standard_transfers + description: "Non-standard transfers involving RewardByBlock contract" + meta: + blockchain: gnosis + sector: tokens + contributors: ['hdser'] + config: + tags: ['tokens', 'non-standard', 'transfers', 'gnosis'] + columns: + - <<: *base_columns + - name: transfer_type + description: "Type of transfer such as 'gas_fee', 'reward', or 'standard'." + + - name: tokens_gnosis_base_full_transfers + description: "Comprehensive dataset of all types of transfers including standard, non-standard, and suicide-related on the Gnosis blockchain." + meta: + blockchain: gnosis + sector: tokens + contributors: ['hdser'] + config: + tags: ['tokens', 'full', 'transfers', 'gnosis'] + columns: + - <<: *base_columns + - name: transfer_type + description: "Type of transfer such as 'gas_fee', 'reward', or 'standard'." + + diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_full_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_full_transfers.sql new file mode 100644 index 00000000000..8a27ead3806 --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_full_transfers.sql @@ -0,0 +1,37 @@ +{{config( + schema = 'tokens_gnosis', + alias = 'base_full_transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['block_date','unique_key'], +) +}} + +WITH + +tokens_gnosis_base_without_suicide_transfers AS ( + SELECT + * + FROM + {{ ref('tokens_gnosis_base_without_suicide_transfers') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_time')}} + {% endif %} +), + +tokens_gnosis_suicide_transfers AS ( + SELECT + * + FROM + {{ ref('tokens_gnosis_suicide_transfers') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_time')}} + {% endif %} +) + +SELECT * FROM tokens_gnosis_base_without_suicide_transfers +UNION ALL +SELECT * FROM tokens_gnosis_suicide_transfers \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_non_standard_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_non_standard_transfers.sql new file mode 100644 index 00000000000..928f38f2771 --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_non_standard_transfers.sql @@ -0,0 +1,181 @@ +{{config( + schema = 'tokens_gnosis', + alias = 'base_non_standard_transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['block_date','unique_key'], +) +}} + +WITH + +gas_fee as ( + SELECT + 'gas_fee' as transfer_type + , cast(date_trunc('month', block_time) as date) AS block_month + , cast(date_trunc('day', block_time) as date) AS block_date + , block_time AS block_time + , block_number AS block_number + , hash AS tx_hash + , NULL AS evt_index + , CAST(NULL AS ARRAY) AS trace_address + , CAST(NULL AS varbinary) AS contract_address + , 'native' AS token_standard + , "from" + , CAST(NULL AS varbinary) AS to + , gas_used * gas_price AS amount_raw + FROM + {{ source('gnosis', 'transactions') }} + WHERE + gas_price != UINT256 '0' + {% if is_incremental() %} + AND {{incremental_predicate('block_time')}} + {% endif %} +), + +gas_fee_collection as ( + SELECT + 'gas_fee_collection' as transfer_type + , cast(date_trunc('month', t1.block_time) as date) AS block_month + , cast(date_trunc('day', t1.block_time) as date) AS block_date + , t1.block_time AS block_time + , t1.block_number AS block_number + , t1.hash AS tx_hash + , NULL AS evt_index + , CAST(NULL AS ARRAY) AS trace_address + , CAST(NULL AS varbinary) AS contract_address + , 'native' AS token_standard + , CAST(NULL AS varbinary) AS "from" + , 0x6BBe78ee9e474842Dbd4AB4987b3CeFE88426A92 AS to -- fee collector + , t1.gas_used * COALESCE(t2.base_fee_per_gas, CAST(0 AS UINT256)) AS amount_raw + FROM + {{ source('gnosis', 'transactions') }} t1 + INNER JOIN + {{ source('gnosis', 'blocks') }} t2 + ON + t2.number = t1.block_number + WHERE + t1.gas_price != UINT256 '0' + {% if is_incremental() %} + AND {{incremental_predicate('t1.block_time')}} + AND {{incremental_predicate('t2.time')}} + {% endif %} +), + +gas_fee_rewards as ( + SELECT + 'gas_fee_rewards' as transfer_type + , cast(date_trunc('month', t1.block_time) as date) AS block_month + , cast(date_trunc('day', t1.block_time) as date) AS block_date + , t1.block_time AS block_time + , t1.block_number AS block_number + , t1.hash AS tx_hash + , NULL AS evt_index + , CAST(NULL AS ARRAY) AS trace_address + , CAST(NULL AS varbinary) AS contract_address + , 'native' AS token_standard + , CAST(NULL AS varbinary) AS "from" + , t2.miner AS to + ,t1.gas_used * ( t1.gas_price - COALESCE(t2.base_fee_per_gas,CAST(0 AS UINT256)) ) AS amount_raw + FROM + {{ source('gnosis', 'transactions') }} t1 + INNER JOIN + {{ source('gnosis', 'blocks') }} t2 + ON + t2.number = t1.block_number + WHERE + t1.gas_price != UINT256 '0' + {% if is_incremental() %} + AND {{incremental_predicate('t1.block_time')}} + AND {{incremental_predicate('t2.time')}} + {% endif %} +), + +block_reward AS ( + SELECT + 'block_reward' as transfer_type + , cast(date_trunc('month', evt_block_time) as date) AS block_month + , cast(date_trunc('day', evt_block_time) as date) AS block_date + , evt_block_time AS block_time + , evt_block_number AS block_number + , evt_tx_hash AS tx_hash + , evt_index + , CAST(NULL AS ARRAY) AS trace_address + , CAST(NULL AS varbinary) AS contract_address + , 'native' AS token_standard + , CAST(NULL AS varbinary) AS "from" + , receiver AS to + , amount AS amount_raw + FROM + {{ source('xdai_gnosis', 'RewardByBlock_evt_AddedReceiver') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('evt_block_time')}} + {% endif %} + + UNION ALL + + SELECT + 'block_reward' as transfer_type + , cast(date_trunc('month', evt_block_time) as date) AS block_month + , cast(date_trunc('day', evt_block_time) as date) AS block_date + , evt_block_time AS block_time + , evt_block_number AS block_number + , evt_tx_hash AS tx_hash + , evt_index + , CAST(NULL AS ARRAY) AS trace_address + , CAST(NULL AS varbinary) AS contract_address + , 'native' AS token_standard + , CAST(NULL AS varbinary) AS "from" + , receiver AS to + , amount AS amount_raw + FROM + {{ source('xdai_gnosis', 'BlockRewardAuRa_evt_AddedReceiver') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('evt_block_time')}} + {% endif %} +), + +non_standard_transfers AS ( + SELECT * FROM gas_fee + UNION ALL + SELECT * FROM gas_fee_collection + UNION ALL + SELECT * FROM gas_fee_rewards + UNION ALL + SELECT * FROM block_reward +) + + +SELECT + -- We have to create this unique key because evt_index and trace_address can be null + {{dbt_utils.generate_surrogate_key(['t.block_number', 'tx.index', 't.transfer_type', "array_join(t.trace_address, ',')"])}} as unique_key + , t.transfer_type + , 'gnosis' as blockchain + , t.block_month + , t.block_date + , t.block_time + , t.block_number + , t.tx_hash + , t.evt_index + , t.trace_address + , t.token_standard + , tx."from" AS tx_from + , tx."to" AS tx_to + , tx."index" AS tx_index + , t."from" + , t.to + , t.contract_address + , t.amount_raw +FROM non_standard_transfers t +INNER JOIN {{ source('gnosis', 'transactions') }} tx ON + cast(date_trunc('day', tx.block_time) as date) = t.block_date + AND tx.block_number = t.block_number + AND tx.hash = t.tx_hash + {% if is_incremental() %} + AND {{incremental_predicate('tx.block_time')}} + {% endif %} +WHERE + t.amount_raw > UINT256 '0' \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_transfers.sql index 49c6ba84c84..51c38fc1e59 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_gnosis', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -18,3 +18,17 @@ native_contract_address = null ) }} + +UNION ALL + +SELECT * +FROM +( + {{transfers_base_wrapped_token( + blockchain='gnosis', + transactions = source('gnosis','transactions'), + wrapped_token_deposit = source('wxdai_gnosis', 'WXDAI_evt_Deposit'), + wrapped_token_withdrawal = source('wxdai_gnosis', 'WXDAI_evt_Withdrawal'), + ) + }} +) \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_without_suicide_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_without_suicide_transfers.sql new file mode 100644 index 00000000000..7cc0c448fcb --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_without_suicide_transfers.sql @@ -0,0 +1,69 @@ +{{config( + schema = 'tokens_gnosis', + alias = 'base_wihout_suicide_transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['block_date','unique_key'], +) +}} + +WITH + +tokens_gnosis_base_transfers AS ( + SELECT + unique_key + , blockchain + , block_month + , block_date + , block_time + , block_number + , tx_hash + , evt_index + , trace_address + , token_standard + , tx_from + , tx_to + , tx_index + , "from" + , to + , contract_address + , amount_raw + FROM + {{ ref('tokens_gnosis_base_transfers') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_time')}} + {% endif %} +), + +tokens_gnosis_base_non_standard_transfers AS ( + SELECT + unique_key + , blockchain + , block_month + , block_date + , block_time + , block_number + , tx_hash + , evt_index + , trace_address + , token_standard + , tx_from + , tx_to + , tx_index + , "from" + , to + , contract_address + , amount_raw + FROM + {{ ref('tokens_gnosis_base_non_standard_transfers') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('block_time')}} + {% endif %} +) + +SELECT * FROM tokens_gnosis_base_transfers +UNION ALL +SELECT * FROM tokens_gnosis_base_non_standard_transfers \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_suicide_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_suicide_transfers.sql new file mode 100644 index 00000000000..f94a62eef50 --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_suicide_transfers.sql @@ -0,0 +1,136 @@ +{{config( + schema = 'tokens_gnosis', + alias = 'suicide_transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['block_date','unique_key'], +) +}} + +WITH + +suicide AS ( + SELECT + cast(date_trunc('month', block_time) as date) AS block_month + , cast(date_trunc('day', block_time) as date) AS block_date + , block_time + , block_number + , tx_hash + , tx_index + , trace_address + , tx_from + , tx_to + , address + , refund_address + FROM + {{ source('gnosis', 'traces') }} + WHERE + type = 'suicide' + AND + success +), + +suicide_events AS ( + SELECT + * + ,ROW_NUMBER() OVER (PARTITION BY address ORDER BY block_time) AS event_sequence + ,LAG(block_time) OVER (PARTITION BY address ORDER BY block_time) AS previous_block_time + FROM + suicide +), + +tokens_gnosis_base_without_suicide_transfers AS ( + SELECT + address + ,event_sequence + ,SUM(amount_raw) AS amount_raw + FROM ( + SELECT + t2.address + ,-t1.amount_raw AS amount_raw + ,t2.event_sequence + FROM + {{ ref('tokens_gnosis_base_without_suicide_transfers') }} t1 + INNER JOIN + suicide_events t2 + ON + t2.address = t1."from" + WHERE + t1.token_standard = 'native' + AND + (t1.block_time > t2.previous_block_time OR t2.previous_block_time IS NULL) + AND + t1.block_time <= t2.block_time + + UNION ALL + + SELECT + t2.address + ,t1.amount_raw AS amount_raw + ,t2.event_sequence + FROM + {{ ref('tokens_gnosis_base_without_suicide_transfers') }} t1 + INNER JOIN + suicide_events t2 + ON + t2.address = t1."to" + WHERE + t1.token_standard = 'native' + AND + (t1.block_time > t2.previous_block_time OR t2.previous_block_time IS NULL) + AND + t1.block_time <= t2.block_time + + ) + GROUP BY + 1, 2 +), + +suicide_balances AS ( + SELECT + address + ,event_sequence + ,SUM(amount_raw) AS amount_raw + FROM + tokens_gnosis_base_without_suicide_transfers + GROUP BY 1, 2 +) + +SELECT + {{dbt_utils.generate_surrogate_key(['t2.block_number', 'tx.index', 'NULL', "array_join(t2.trace_address, ',')"])}} as unique_key + , 'gnosis' as blockchain + , t2.block_month + , t2.block_date + , t2.block_time + , t2.block_number + , t2.tx_hash + , CAST(NULL AS INTEGER) AS evt_index + , t2.trace_address + , 'native' AS token_standard + , t2.tx_from + , t2.tx_to + , t2.tx_index + , t2.address AS "from" + , t2.refund_address AS to + , CAST(NULL AS varbinary) AS contract_address + , CAST(t1.amount_raw AS UINT256) AS amount_raw +FROM + suicide_balances t1 +INNER JOIN + suicide_events t2 + ON + t2.address = t1.address + AND + t2.event_sequence = t1.event_sequence +INNER JOIN {{ source('gnosis', 'transactions') }} tx ON + cast(date_trunc('day', tx.block_time) as date) = t2.block_date + AND tx.block_number = t2.block_number + AND tx.hash = t2.tx_hash + {% if is_incremental() %} + AND {{incremental_predicate('tx.block_time')}} + {% endif %} +WHERE + CAST(t1.amount_raw AS UINT256) > UINT256 '0' \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_transfers.sql index 1b03a3bd9c3..c12740b2989 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_gnosis', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -16,11 +16,11 @@ {{ transfers_enrich( - base_transfers = ref('tokens_gnosis_base_transfers') + base_transfers = ref('tokens_gnosis_base_full_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') , evms_info_model = source('evms','info') , transfers_start_date = '2018-10-09' , blockchain = 'gnosis' ) -}} +}} \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_base_transfers.sql index 05a438b22d7..e0267aff121 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_linea', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -15,6 +15,6 @@ traces = source('linea','traces'), transactions = source('linea','transactions'), erc20_transfers = source('erc20_linea','evt_transfer'), - native_contract_address = '0x000000000000000000000000000000000000800a' + native_contract_address = null ) }} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_transfers.sql index 0ec82c4053d..da00e7d83b9 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/linea/tokens_linea_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_linea', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_base_transfers.sql index 37ec8818a7f..fe023b1c1cd 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_mantle', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_transfers.sql index 9afb14a44fc..b05976bd01c 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/mantle/tokens_mantle_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_mantle', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_base_transfers.sql index a11a13f57d8..2c1d7de786f 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_optimism', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_transfers.sql index fcb6e410e13..fc0c9bb3248 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/optimism/tokens_optimism_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_optimism', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_base_transfers.sql index 36e5c656327..c09422c2dd7 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_polygon', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_transfers.sql index 93e9ec6486c..8763190d483 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/polygon/tokens_polygon_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_polygon', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_base_transfers.sql index c710ccd16fb..a557c6e81ce 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_scroll', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -15,6 +15,6 @@ traces = source('scroll','traces'), transactions = source('scroll','transactions'), erc20_transfers = source('erc20_scroll','evt_transfer'), - native_contract_address = '0x000000000000000000000000000000000000800a' + native_contract_address = null ) }} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_transfers.sql index 99a1b5e2531..093c4f89781 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/scroll/tokens_scroll_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_scroll', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sei/_schema.yml b/dbt_subprojects/tokens/models/transfers_and_balances/sei/_schema.yml new file mode 100644 index 00000000000..4133e73e718 --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/sei/_schema.yml @@ -0,0 +1,106 @@ +version: 2 + +models: + - name: tokens_sei_base_transfers + meta: + blockchain: sei + sector: tokens + contributors: aalan3, jeff-dude + config: + tags: ['tokens','transfers', 'sei'] + description: > + Token transfers + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - unique_key + columns: + - name: unique_key + description: "Surrogate key to identify unique row" + - name: blockchain + description: "The blockchain of the transfers" + - name: block_date + description: "The date of the block" + - name: block_time + description: "The time of the block" + - name: block_number + description: "The block number" + - name: tx_hash + description: "The transaction hash" + - name: evt_index + description: "The log event index of the transfer if any" + - name: trace_address + description: "The trace address of the transfer if any" + - name: token_standard + description: "The token standard of the transfer" + - name: tx_from + description: "The transaction sender" + - name: tx_to + description: "The transaction receiver" + - name: tx_index + description: "The transaction index" + - name: from + description: "The sender of the transfer" + - name: to + description: "The receiver of the transfer" + - name: contract_address + description: "The contract address of the transfer" + - name: amount_raw + description: "The raw amount of the transfer" + + - name: tokens_sei_transfers + meta: + blockchain: sei + sector: tokens + contributors: aalan3, jeff-dude + config: + tags: ['tokens','transfers', 'sei'] + description: > + Token transfers + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - unique_key + columns: + - name: unique_key + description: "Surrogate key to identify unique row" + - name: blockchain + description: "The blockchain of the transfers" + - name: block_date + description: "The date of the block" + - name: block_time + description: "The time of the block" + - name: block_number + description: "The block number" + - name: tx_hash + description: "The transaction hash" + - name: evt_index + description: "The log event index of the transfer if any" + - name: trace_address + description: "The trace address of the transfer if any" + - name: token_standard + description: "The token standard of the transfer" + - name: tx_from + description: "The transaction sender" + - name: tx_to + description: "The transaction receiver" + - name: tx_index + description: "The transaction index" + - name: from + description: "The sender of the transfer" + - name: to + description: "The receiver of the transfer" + - name: contract_address + description: "The contract address of the transfer" + - name: symbol + description: "The token symbol transferred" + - name: amount_raw + description: "The raw amount of the transfer" + - name: amount + description: "The formatted amount of the transfer" + - name: price_usd + description: "The USD price used to calculate the amount_usd" + - name: amount_usd + description: "The USD amount of the transfer" diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sei/tokens_sei_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sei/tokens_sei_base_transfers.sql new file mode 100644 index 00000000000..91cb3731c65 --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/sei/tokens_sei_base_transfers.sql @@ -0,0 +1,20 @@ +{{config( + schema = 'tokens_sei', + alias = 'base_transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['block_date','unique_key'], +) +}} + +{{transfers_base( + blockchain='sei', + traces = source('sei','traces'), + transactions = source('sei','transactions'), + erc20_transfers = source('erc20_sei','evt_transfer'), + native_contract_address = null +) +}} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sei/tokens_sei_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sei/tokens_sei_transfers.sql new file mode 100644 index 00000000000..548f01962de --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/sei/tokens_sei_transfers.sql @@ -0,0 +1,26 @@ +{{config( + schema = 'tokens_sei', + alias = 'transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_date','unique_key'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_date')], + post_hook='{{ expose_spells(\'["sei"]\', + "sector", + "tokens", + \'["aalan3", "jeff-dude"]\') }}' +) +}} + +{{ + transfers_enrich( + base_transfers = ref('tokens_sei_base_transfers') + , tokens_erc20_model = source('tokens', 'erc20') + , prices_model = source('prices', 'usd') + , evms_info_model = source('evms','info') + , transfers_start_date = '2024-05-27' + , blockchain = 'sei' + ) +}} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql index d5e32baeead..dfa38cbd772 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql @@ -1,33 +1,78 @@ {{ config( schema = 'tokens' , alias = 'transfers' + , post_hook='{{ expose_spells(\'[ + "arbitrum" + ,"avalanche_c" + ,"base" + ,"blast" + ,"bnb" + ,"celo" + ,"ethereum" + ,"fantom" + ,"gnosis" + ,"linea" + ,"mantle" + ,"optimism" + ,"polygon" + ,"scroll" + ,"sei" + ,"zkevm" + ,"zksync" + ,"zora" + ]\', + "sector", + "tokens", + \'["aalan3", "jeff-dude"]\') }}' ) }} {% set chains = [ - 'ethereum' - ,'optimism' - ,'polygon' - ,'bnb' + 'arbitrum' ,'avalanche_c' - ,'gnosis' - ,'fantom' - ,'arbitrum' - ,'celo' ,'base' - ,'zksync' - ,'zora' - ,'scroll' - ,'zkevm' + ,'blast' + ,'bnb' + ,'celo' + ,'ethereum' + ,'fantom' + ,'gnosis' ,'linea' ,'mantle' - ,'blast' + ,'optimism' + ,'polygon' + ,'scroll' + ,'sei' + ,'zkevm' + ,'zksync' + ,'zora' ] %} SELECT * FROM ( {% for chain in chains %} - SELECT * + SELECT + unique_key + , blockchain + , block_month + , block_date + , block_time + , block_number + , tx_hash + , evt_index + , trace_address + , token_standard + , tx_from + , tx_to + , tx_index + , "from" + , "to" + , contract_address + , symbol + , amount_raw + , amount + , price_usd + , amount_usd FROM {{ ref('tokens_'~chain~'_transfers') }} {% if not loop.last %} UNION ALL diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_base_transfers.sql index 97af39bcf7f..0a9d4f57c8d 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_zkevm', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -15,6 +15,6 @@ traces = source('zkevm','traces'), transactions = source('zkevm','transactions'), erc20_transfers = source('erc20_zkevm','evt_transfer'), - native_contract_address = '0x000000000000000000000000000000000000800a' + native_contract_address = null ) }} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_transfers.sql index d9021ba8454..2f9a3cdcec5 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_zkevm', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_base_transfers.sql index 698f7c87653..a375d6cc7ab 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_zksync', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -15,6 +15,7 @@ traces = source('zksync','traces'), transactions = source('zksync','transactions'), erc20_transfers = source('erc20_zksync','evt_transfer'), - native_contract_address = '0x000000000000000000000000000000000000800a' + native_contract_address = '0x000000000000000000000000000000000000800a', + include_traces = false ) }} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_transfers.sql index e65163c1953..7f0e53e6e46 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/zksync/tokens_zksync_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_zksync', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -20,7 +20,7 @@ , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') , evms_info_model = source('evms','info') - , transfers_start_date = '2023-02-15' + , transfers_start_date = '2023-02-14' , blockchain = 'zksync' ) }} diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_base_transfers.sql index 519af2121af..3ec68edefa5 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_base_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_base_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_zora', alias = 'base_transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_transfers.sql index f611877aed6..dfe879508ae 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/zora/tokens_zora_transfers.sql @@ -1,7 +1,7 @@ {{config( schema = 'tokens_zora', alias = 'transfers', - partition_by = ['block_date'], + partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', diff --git a/dbt_subprojects/tokens/packages.yml b/dbt_subprojects/tokens/packages.yml index 2aba5d8c3e6..14901e90610 100644 --- a/dbt_subprojects/tokens/packages.yml +++ b/dbt_subprojects/tokens/packages.yml @@ -1,6 +1,6 @@ packages: - package: dbt-labs/dbt_utils - version: 1.1.1 + version: 1.3.0 - package: dbt-labs/codegen version: 0.12.1 - package: starburstdata/trino_utils diff --git a/docs/ci_test/ci_test_overview.md b/docs/ci_test/ci_test_overview.md index e1cdb88257d..12c8b80d714 100644 --- a/docs/ci_test/ci_test_overview.md +++ b/docs/ci_test/ci_test_overview.md @@ -1,6 +1,6 @@ # CI Tests as GH Workflows in Spellbook -Any time a PR is opened in Spellbook, there are a few GH workflows which automatically run on each commit. The `dbt slim ci` workflow kicks off the continuous integration (CI) tests, which are required to pass in order to prepare for final merge into the main branch. The code which runs the CI workflow can be found [here](/.github/workflows/dbt_slim_ci.yml), but in general, the steps included are: +Any time a PR is opened in Spellbook, there are a few GH workflows which automatically run on each commit. The `dbt slim ci` workflow kicks off the continuous integration (CI) tests, which are required to pass in order to prepare for final merge into the main branch. The code which runs the CI workflow can be found [here](/.github/workflows/dbt_run.yml), but in general, the steps included are: - Setup environment variables: - `GIT_SHA` – unique hash value tied to the commit within a PR, used downstream to name CI output test spells. diff --git a/models/README.md b/models/README.md index 2e6b8e0d193..bbfef11ed76 100644 --- a/models/README.md +++ b/models/README.md @@ -1 +1 @@ -All models live in [dbt_subprojects](../dbt_subprojects/), please continuing building in the proper subproject and refer to main [readme](../README.md) for more information. \ No newline at end of file +All models live in [dbt_subprojects](../dbt_subprojects/), please continuing building in the proper subproject and refer to main [readme](../README.md) for more information. diff --git a/scripts/collect_manifests.py b/scripts/collect_manifests.py new file mode 100644 index 00000000000..01e2b497b8e --- /dev/null +++ b/scripts/collect_manifests.py @@ -0,0 +1,42 @@ +import os +import subprocess +import shutil + +# need to make sure dbt deps are installed for all subprojects + +# Define the base directory of the repo, adjusting for script's location +base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'dbt_subprojects')) + +# Define the list of subprojects to compile +subprojects = ['daily_spellbook', 'dex', 'hourly_spellbook', 'nft', 'solana', 'tokens'] + +# Directory to store the collected manifest.json files +output_dir = os.path.join(base_dir, 'manifests') +os.makedirs(output_dir, exist_ok=True) + +def run_dbt_compile(project_dir): + """Run `dbt compile` in the specified project directory.""" + try: + result = subprocess.run(['dbt', 'compile'], cwd=project_dir, check=True, capture_output=True, text=True) + print(f"Successfully compiled {project_dir}") + except subprocess.CalledProcessError as e: + print(f"Error compiling {project_dir}: {e.stdout}\n{e.stderr}") + +def collect_manifest(project_dir): + """Collect the manifest.json file from the project directory.""" + manifest_path = os.path.join(project_dir, 'target', 'manifest.json') + if os.path.exists(manifest_path): + dest_path = os.path.join(output_dir, f"{os.path.basename(project_dir)}_manifest.json") + shutil.copy(manifest_path, dest_path) + print(f"Collected {manifest_path} to {dest_path}") + else: + print(f"manifest.json not found in {project_dir}") + +def main(): + for subproject in subprojects: + project_dir = os.path.join(base_dir, subproject) + run_dbt_compile(project_dir) + collect_manifest(project_dir) + +if __name__ == "__main__": + main() diff --git a/scripts/upload-spell-metadata/readme.md b/scripts/upload-spell-metadata/readme.md new file mode 100644 index 00000000000..a1ae0ca0194 --- /dev/null +++ b/scripts/upload-spell-metadata/readme.md @@ -0,0 +1,56 @@ +# upload-to-dune.py + +## Overview + +`upload-to-dune.py` collects metadata from models and sources, combines it into a CSV, and uploads it to Dune Analytics. This maintains an up-to-date record of Spellbook models and sources on Dune. + +Before being able to run the script, you need to run the `collect_manifests.py` script first to generate the manifest files. + +## Functionality + +### Manifest Parsing + +Extracts information from multiple JSON manifest files. Sources only get read ones, models all get read. If there is a table that is defined as both source and model, the model's information is used. + +### CSV Creation + +Creates a CSV file with the combined model and source information. + +### Dune Upload + +Uploads the CSV to Dune Analytics via API. + +## Requirements + +- Python 3.x +- Python packages: `json`, `csv`, `os`, `requests`, `dotenv` +- Dune Analytics API key (stored in a `.env` file as `DUNE_API_KEY`) +- Correct project structure with manifest files in `dbt_subprojects/manifests` + +## How to Run + +1. Ensure all requirements are met. +2. Navigate to the script's directory. +3. Run: `python upload-to-dune.py` +4. Check console output for upload status. + +## Output + +- CSV file: `combined_dbt_models_sources.csv` +- Console output showing CSV file size and response from Dune API after upload attempt. + +| Column Name | Description | +| ------------------ | ------------------------------------------------------------------------------- | +| model_name | The name of the dbt model e.g. `dex.trades` | +| schema | The database schema where the model is located e.g. `dex` | +| alias | The alias of the model e.g. `trades` | +| partition_by | The column(s) used for partitioning the model, if applicable. empty for sources | +| column | The name of a specific column in the model | +| column_description | A description of the column's content or purpose defined in spellbook yml files | +| meta_origin | The origin of the metadata for this model. Either `source` or `model` | + +## Troubleshooting + +- Verify Python packages are installed. +- Check Dune API key is correct and set properly. +- Ensure manifest files are in the correct location and format. diff --git a/scripts/upload-spell-metadata/upload-to-dune.py b/scripts/upload-spell-metadata/upload-to-dune.py new file mode 100644 index 00000000000..e3b4854b322 --- /dev/null +++ b/scripts/upload-spell-metadata/upload-to-dune.py @@ -0,0 +1,135 @@ +import json +import csv +import os +import requests +import dotenv +from dotenv import load_dotenv + +# Load environment variables +load_dotenv() + +# Set up paths +script_dir = os.path.dirname(os.path.abspath(__file__)) +project_root = os.path.dirname(os.path.dirname(script_dir)) + +# Get API key from environment variable +api_key = os.getenv("DUNE_API_KEY") + +# Directory containing the manifest files +manifests_dir = os.path.join(project_root, 'dbt_subprojects', 'manifests') + +# CSV file to store combined data +csv_file_path = os.path.join(project_root, 'dbt_subprojects', 'manifests' , 'combined_dbt_models_sources.csv') + +def parse_manifest(file_path): + with open(file_path, 'r') as file: + data = json.load(file) + + info = {} + + # Parse sources + for unique_id, source_details in data['sources'].items(): + schema = source_details.get('schema') + name = source_details.get('name') + full_name = f"{schema}.{name}" + source_columns = source_details.get('columns', {}) + info[full_name] = { + 'schema': schema, + 'name': name, + 'columns': source_columns, + 'partition_by': '', + 'meta_origin': 'source' + } + + # Parse models (merging with source info if exists) + for node_id, node_details in data['nodes'].items(): + if node_details.get('resource_type') == 'model': + schema = node_details.get('schema') + alias = node_details.get('alias') + full_name = f"{schema}.{alias}" + partition_by = node_details.get('config', {}).get('partition_by') + model_columns = node_details.get('columns', {}) + + if full_name in info: + # Merge columns, prioritizing model descriptions + merged_columns = {**info[full_name]['columns'], **model_columns} + else: + merged_columns = model_columns + + info[full_name] = { + 'schema': schema, + 'name': alias, + 'columns': merged_columns, + 'partition_by': partition_by, + 'meta_origin': 'model' + } + + return info + +# Combine all manifests into a single CSV +with open(csv_file_path, 'w', newline='') as csvfile: + csvwriter = csv.writer(csvfile) + csvwriter.writerow(['model_name', 'schema', 'alias', 'partition_by', 'column', 'column_description', 'meta_origin']) + + combined_info = {} + + for filename in os.listdir(manifests_dir): + if filename.endswith('_manifest.json'): + file_path = os.path.join(manifests_dir, filename) + manifest_info = parse_manifest(file_path) + + # Update combined_info, merging column information + for full_name, details in manifest_info.items(): + if full_name not in combined_info: + combined_info[full_name] = details + else: + # Merge columns, keeping all descriptions + combined_info[full_name]['columns'] = { + **combined_info[full_name]['columns'], + **details['columns'] + } + # Update meta_origin to 'model' if it's a model + if details['meta_origin'] == 'model': + combined_info[full_name]['meta_origin'] = 'model' + combined_info[full_name]['partition_by'] = details['partition_by'] + + # Write combined information to CSV + for full_name, details in combined_info.items(): + schema = details['schema'] + name = details['name'] + partition_by = details['partition_by'] + meta_origin = details['meta_origin'] + + if details['columns']: + for column_name, column_details in details['columns'].items(): + column_description = column_details.get('description', 'No description available') + csvwriter.writerow([full_name, schema, name, partition_by, column_name, column_description, meta_origin]) + else: + csvwriter.writerow([full_name, schema, name, partition_by, '', '', meta_origin]) + +# Upload the CSV to Dune +url = 'https://api.dune.com/api/v1/table/upload/csv' + +with open(csv_file_path, 'r') as file: + data = file.read() + # Print the size of the CSV file + file_size = os.path.getsize(csv_file_path) + print('CSV file size:', file_size/1000, 'kilobytes') + + # Set the headers and metadata for the CSV data + headers = {'X-Dune-Api-Key': api_key} + + # Construct the payload for the API + payload = { + "table_name": "spellbook_table_infos", + "description": "Combined Spellbook models and sources metadata", + "data": str(data), + "is_private": False + } + + # Send the POST request to the HTTP endpoint + response = requests.post(url, data=json.dumps(payload), headers=headers) + + # Print the response status code and content + print('Response status code:', response.status_code) + print('Response content:', response.content) \ No newline at end of file diff --git a/sources/_base_sources/arbitrum_base_sources.yml b/sources/_base_sources/arbitrum_base_sources.yml deleted file mode 100644 index a7e28f6e8d6..00000000000 --- a/sources/_base_sources/arbitrum_base_sources.yml +++ /dev/null @@ -1,403 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: arbitrum - description: "Arbitrum raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "An Arbitrum transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of ETH transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - name: effective_gas_price - - name: gas_used_for_l1 - - - name: traces - loaded_at_field: block_time - description: "An Arbitrum trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "An Arbitrum trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the arbitrum smart contract generating the log" - - name: function_name - description: "Name of the arbitrum smart contract function generating the log" - - name: namespace - description: "Namespace of the arbitrum smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "An Arbitrum log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the arbitrum smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "An Arbitrum log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the arbitrum smart contract generating the log" - - name: contract_name - description: "Name of the arbitrum smart contract generating the log" - - name: event_name - description: "Name of the arbitrum smart contract event generating the log" - - name: namespace - description: "Namespace of the arbitrum smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Arbitrum; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Arbitrum creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_arbitrum - description: "Transfers events for ERC20 tokens on Arbitrum." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Arbitrum." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Arbitrum." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_arbitrum - description: "Transfers events for ERC1155 tokens on Arbitrum." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Arbitrum." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Arbitrum." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Arbitrum." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_arbitrum - description: "Transfers events for ERC721 tokens on Arbitrum." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Arbitrum." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Arbitrum." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Arbitrum." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/avalanche_c_base_sources.yml b/sources/_base_sources/avalanche_c_base_sources.yml deleted file mode 100644 index 6790869208b..00000000000 --- a/sources/_base_sources/avalanche_c_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: avalanche_c - description: "Avalanche_c raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "An Avalanche_c transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of AVAX transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of AVAX - each gwei is equal to 10-9 AVAX" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "An Avalanche_c trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "An Avalanche trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Avalanche smart contract generating the log" - - name: function_name - description: "Name of the Avalanche smart contract function generating the log" - - name: namespace - description: "Namespace of the Avalanche smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "An Avalanche_c log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the avalanche_c smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "An Avalanche c log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Avalanche smart contract generating the log" - - name: contract_name - description: "Name of the Avalanche smart contract generating the log" - - name: event_name - description: "Name of the Avalanche smart contract event generating the log" - - name: namespace - description: "Namespace of the Avalanche smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Avalanche_c; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Avalanche creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_avalanche_c - description: "Transfers events for ERC20 tokens on Avalanche_c." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Avalanche_c." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Avalanche." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_avalanche_c - description: "Transfers events for ERC1155 tokens on Avalanche_c." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Avalanche_c." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Avalanche_c." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Avalanche." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_avalanche_c - description: "Transfers events for ERC721 tokens on Avalanche_c." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Avalanche_c." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Avalanche." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Avalanche." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/base_base_sources.yml b/sources/_base_sources/base_base_sources.yml deleted file mode 100644 index a8c314537c1..00000000000 --- a/sources/_base_sources/base_base_sources.yml +++ /dev/null @@ -1,421 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: base - description: "Base raw tables including transactions, traces and logs (Same schema as Optimism - OP Chains)." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions_0006 - description: "underlying transactions table. base.transactions is an exposed view of this table." - loaded_at_field: block_time - - name: transactions - loaded_at_field: block_time - description: "A Base transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of ETH transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - name: l1_block_number - description: "Block number on L1" - - name: l1_fee - description: "L1 Fees that the Base protocol pays to submit L2 transactions to L1 (also referred to as L1 Security Fees or Security Costs)" - - name: l1_fee_scalar - description: "This value covers the change in L1 gas price between the time the transaction is submitted and when it is published, as well as the income Base needs to keep the system running. Currently set at 1.0" - - name: l1_gas_price - description: "Gas price on L1" - - name: l1_gas_used - description: "The gas used on L1 to publish the transaction" - - name: l1_timestamp - description: "The timestamp when the transaction is batched and confirmed on L1" - - name: l1_tx_origin - description: "L1 transaction origin address. This is not null for L1→L2 transactions: https://optimistic.etherscan.io/txsEnqueued" - - - name: traces - loaded_at_field: block_time - description: "A Base trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Base trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Base smart contract generating the log" - - name: function_name - description: "Name of the Base smart contract function generating the log" - - name: namespace - description: "Namespace of the Base smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A Base log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the Base smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Base log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Base smart contract generating the log" - - name: contract_name - description: "Name of the Base smart contract generating the log" - - name: event_name - description: "Name of the Base smart contract event generating the log" - - name: namespace - description: "Namespace of the Base smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Base; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the Base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - name: creation_traces - loaded_at_field: block_time - description: "Base creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_base - description: "Transfers events for ERC20 tokens on Base." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Base." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Base." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_block_number - - *evt_block_time - - *evt_index - - *evt_tx_hash - - &owner - name: owner - - &spender - name: spender - - *value - - - name: erc1155_base - description: "Transfers events for ERC1155 tokens on Base." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Base." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Base." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Base." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - *owner - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_base - description: "Transfers events for ERC721 tokens on Base." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Base." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Base." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Base." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator diff --git a/sources/_base_sources/beacon_base_sources.yml b/sources/_base_sources/beacon_base_sources.yml deleted file mode 100644 index adcfbc6eb4f..00000000000 --- a/sources/_base_sources/beacon_base_sources.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: 2 - -sources: - # Beacon chain tables - - name: beacon - description: "Ethereum beacon chain raw tables." - tables: - - name: blobs - description: "An Ethereum blob refers to a large data packet stored on the beacon chain temporarily, see EIP-4844." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_epoch - name: block_epoch - description: "A specific epoch during which this block was proposed. An epoch is a division of time in Ethereum's Proof of Stake mechanism." - - &block_slot - name: block_slot - description: "A slot in which a validator has the opportunity to propose a new block. Each slot represents a chance for a block to be added." - - &index - name: index - description: "Index of the blob in the block slot" - - &proposer_index - name: proposer_index - description: "Identifier for the validator that proposed the specific block." - - &kzg_commitment - name: kzg_commitment - description: "A cryptographic commitment used to ensure data integrity within blob transactions. KZG commitments are a form of cryptographic proof used to represent blob data within blocks." - - &kzg_commitment_inclusion_proof - name: kzg_commitment_inclusion_proof - description: "A cryptographic proof that verifies the inclusion of the KZG commitment within the block." - - &kzg_proof - name: kzg_proof - description: "A cryptographic proof associated with the KZG commitment, used to validate the data within blob transactions." - - &body_root - name: body_root - description: "A cryptographic hash representing the aggregated transactions (including blob transactions) within the block." - - &parent_root - name: parent_root - description: "A hash of the parent block, linking the current block to the previous one in the blockchain." - - &state_root - name: state_root - description: "A cryptographic hash representing the entire state of the system after the block's transactions have been applied." - - &signature - name: signature - description: "A digital signature of the block proposer, verifying the authenticity and integrity of the block." - - &blob - name: blob - description: "Content of the blob, large data packets used in blob-carrying transactions." - - - name: blocks - description: "beacon chain blocks/slots" diff --git a/sources/_base_sources/bitcoin_base_sources.yml b/sources/_base_sources/bitcoin_base_sources.yml deleted file mode 100644 index 98360f9f148..00000000000 --- a/sources/_base_sources/bitcoin_base_sources.yml +++ /dev/null @@ -1,166 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: bitcoin - description: "Bitcoin raw tables including blocks, transactions, inputs and outputs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: blocks - loaded_at_field: time - description: "Block data of bitcoin" - columns: - - name: time - description: The block time - - name: height - description: The block number - - name: date - description: The block date - - name: hash - description: The block hash - - name: transaction_count - description: The number of transactions in the block - - name: size - description: The size of the block - - name: mint_reward - description: The output paid out to the miner for minting the block - - name: total_fees - description: The fees paid out to the miner from transaction users. Each transaction's fee is what's left of output after input is subtracted from it. - - name: total_reward - description: The static reward given to the miner. It is the sum of the outputs in the coinbase transaction (the first transaction). - - name: stripped_size - description: The size of the block excluding witness data - - name: weight - description: The block weight as defined in BIP 141 - - name: chainwork - description: The expected number of hashes required to produce the current chain - - name: difficulty - description: The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0 - - name: merkle_root - description: The root node of a Merkle tree, where leaves are transaction hashes - - name: nonce - description: The number of transactions made by the sender prior to this one - - name: coinbase - description: The data specified in the coinbase transaction of the block - - name: previous_block_hash - description: The hash of the previous block - - name: bits - description: The difficulty threshold specified in block header - - - name: transactions - loaded_at_field: block_time - description: "The bitcoin transactions" - columns: - - name: block_time - description: The block time - - name: block_date - description: The block date - - name: block_height - description: The block number - - name: block_hash - description: The hash of the block that contains this transaction - - name: index - description: The number of the transaction in the block. - - name: id - description: The id (hash) of this transaction - - name: input_value - description: Total value of inputs in the transaction - - name: output_value - description: Total value of outputs in the transaction - - name: fee - description: The transaction fee paid to the miner. = output_value - input_value - - name: input_count - description: The number of inputs in the transaction - - name: output_count - description: The number of outputs in the transaction - - name: size - description: The size of this transaction in bytes - - name: virtual_size - description: The virtual transaction size (differs from size for witness transactions) - - name: is_coinbase - description: The transaction is a coinbase transaction, which is the first transaction in a block - - name: coinbase - description: If the transaction is a coinbase transaction, contains the coinbase data. Otherwise, null. - - name: input - description: Transaction inputs - - name: output - description: Transaction outputs. See outputs table. - - name: lock_time - description: Earliest time that miners can include the transaction in their hashing of the Merkle root to attach it in the latest block of the blockchain - - name: hex - description: The transaction encoded as hexadecimal - - - name: inputs - loaded_at_field: block_time - description: "The inputs of Bitcoin" - columns: - - name: block_time - description: The block time - - name: block_date - description: The block date - - name: block_height - description: The block number - - name: index - description: The index of the input - - name: block_hash - description: The block hash of the output - - name: tx_id - description: The transaction id that this input was used - - name: spent_block_height - description: The block height of the output - - name: spent_tx_id - description: The transaction id of the output - - name: spent_output_number - description: The output number - - name: value - description: The number of Satoshis attached to this input - - name: address - description: The address that owned/owns the output used as input - - name: type - description: The address type of the input - - name: coinbase - description: This input was the coinbase input in the transaction - - name: is_coinbase - description: True if coinbase is not null, else false - - name: script_asm - description: Symbolic representation of the bitcoin's script language op-codes - - name: script_hex - description: Hexadecimal representation of the bitcoin's script language op-codes - - name: script_desc - description: The description - - name: script_signature_asm - description: Symbolic representation of the bitcoin's script language op-codes - - name: script_signature_hex - description: Hexadecimal representation of the bitcoin's script language op-codes - - name: sequence - description: A number intended to allow unconfirmed time-locked transactions to be updated before being finalized; not currently used except to disable locktime in a transaction - - name: witness_data - description: Witness data - - - name: outputs - loaded_at_field: block_time - description: "Output of Bitcoin" - columns: - - name: block_time - description: The block time - - name: block_date - description: The block date - - name: block_height - description: The block number - - name: block_hash - description: The block hash - - name: tx_id - description: The id (hash) of the transaction this is from - - name: index - description: 0-indexed number of an output within a transaction. Used by inputs to identify outputs. - - name: value - description: The number of Satoshis attached to this output - - name: script_asm - description: Symbolic representation of the bitcoin's script language op-codes - - name: script_hex - description: Hexadecimal representation of the bitcoin's script language op-codes - - name: address - description: The address that owns this output - - name: type - description: The address type of the output diff --git a/sources/_base_sources/blast_base_sources.yml b/sources/_base_sources/blast_base_sources.yml deleted file mode 100644 index b397dacf71d..00000000000 --- a/sources/_base_sources/blast_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: blast - description: "blast raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A blast transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of blast transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of blast - each gwei is equal to 10-9 blast" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A blast trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A blast trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the blast smart contract generating the log" - - name: function_name - description: "Name of the blast smart contract function generating the log" - - name: namespace - description: "Namespace of the blast smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A blast log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the blast smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A blast log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the blast smart contract generating the log" - - name: contract_name - description: "Name of the blast smart contract generating the log" - - name: event_name - description: "Name of the blast smart contract event generating the log" - - name: namespace - description: "Namespace of the blast smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on blast; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "blast creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_blast - description: "Transfers events for ERC20 tokens on blast." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on blast." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on blast." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_blast - description: "Transfers events for ERC1155 tokens on blast." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on blast." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on blast." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on blast." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_blast - description: "Transfers events for ERC721 tokens on blast." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on blast." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on blast." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on blast." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/bnb_base_sources.yml b/sources/_base_sources/bnb_base_sources.yml deleted file mode 100644 index 888c74a0bf6..00000000000 --- a/sources/_base_sources/bnb_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: bnb - description: "BNB raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A BNB transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of BNB transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of BNB - each gwei is equal to 10-9 BNB" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A BNB trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A BNB trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the BNB smart contract generating the log" - - name: function_name - description: "Name of the BNB smart contract function generating the log" - - name: namespace - description: "Namespace of the BNB smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A BNB log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the BNB smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A BNB log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the BNB smart contract generating the log" - - name: contract_name - description: "Name of the BNB smart contract generating the log" - - name: event_name - description: "Name of the BNB smart contract event generating the log" - - name: namespace - description: "Namespace of the BNB smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on BNB; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "BNB creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # BEP Transfer Tables - - name: erc20_bnb - description: "Transfers events for BEP20 tokens on BNB." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for BEP20 tokens on BNB." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "BEP20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of BEP20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on BNB." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_bnb - description: "Transfers events for BEP1155 tokens on BNB." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for BEP1155 tokens on BNB." - columns: - - name: contract_address - description: "BEP1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "BEP1155 token ID" - - name: value - description: "Amount of BEP1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for BEP1155 tokens on BNB." - columns: - - name: contract_address - description: "BEP1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "BEP1155 token IDs" - - name: values - description: "Amounts of BEP1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on BNB." - columns: - - name: contract_address - description: "BEP1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_bnb - description: "Transfers events for BEP721 tokens on BNB." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for BEP721 tokens on BNB." - columns: - - name: contract_address - description: "BEP721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "BEP721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on BNB." - columns: - - name: contract_address - description: "BEP721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on BNB." - columns: - - name: contract_address - description: "BEP721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/celo_base_sources.yml b/sources/_base_sources/celo_base_sources.yml deleted file mode 100644 index f4dbc1db2b8..00000000000 --- a/sources/_base_sources/celo_base_sources.yml +++ /dev/null @@ -1,403 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: celo - description: "Celo raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A Celo transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of ETH transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of CELO - each gwei is equal to 10-9 CELO" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - name: effective_gas_price - - name: gas_used_for_l1 - - - name: traces - loaded_at_field: block_time - description: "A Celo trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Celo trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the celo smart contract generating the log" - - name: function_name - description: "Name of the celo smart contract function generating the log" - - name: namespace - description: "Namespace of the celo smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A Celo log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the celo smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Celo log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the celo smart contract generating the log" - - name: contract_name - description: "Name of the celo smart contract generating the log" - - name: event_name - description: "Name of the celo smart contract event generating the log" - - name: namespace - description: "Namespace of the celo smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Celo; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Celo creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_celo - description: "Transfers events for ERC20 tokens on Celo." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Celo." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Celo." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_celo - description: "Transfers events for ERC1155 tokens on Celo." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Celo." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Celo." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Celo." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_celo - description: "Transfers events for ERC721 tokens on Celo." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Celo." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Celo." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Celo." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/degen_base_sources.yml b/sources/_base_sources/degen_base_sources.yml deleted file mode 100644 index 7a190eee21e..00000000000 --- a/sources/_base_sources/degen_base_sources.yml +++ /dev/null @@ -1,111 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: degen - description: "Degen raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "An Degen transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of ETH transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - name: effective_gas_price - - name: gas_used_for_l1 - - - name: logs - loaded_at_field: block_time - description: "An Degen log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the degen smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: index - description: "Log index" - - &tx_index - name: tx_index - description: "Transaction index" - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty \ No newline at end of file diff --git a/sources/_base_sources/ethereum_base_sources.yml b/sources/_base_sources/ethereum_base_sources.yml deleted file mode 100644 index da934d641a6..00000000000 --- a/sources/_base_sources/ethereum_base_sources.yml +++ /dev/null @@ -1,440 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: ethereum - description: "Ethereum raw tables including transactions, traces and logs." - tables: - - name: transactions_0006 - description: "underlying transactions table. ethereum.transactions is an exposed view of this table." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - - name: transactions - description: "An Ethereum transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of ETH transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - description: "An Ethereum trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - description: "An Ethereum trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Ethereum smart contract generating the log" - - name: function_name - description: "Name of the Ethereum smart contract function generating the log" - - name: namespace - description: "Namespace of the Ethereum smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - description: "An Ethereum log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the ethereum smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - description: "An Ethereum log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Ethereum smart contract generating the log" - - name: contract_name - description: "Name of the Ethereum smart contract generating the log" - - name: event_name - description: "Name of the Ethereum smart contract event generating the log" - - name: namespace - description: "Namespace of the Ethereum smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - description: "A view keeping track of what contracts are decoded on Dune on Ethereum; contains information associated with the decoded contract such as namespace, name, address, ABI." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - description: "Ethereum creation traces" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - - name: withdrawals - description: "Ethereum withdrawals" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: block_time - - # ERC Transfer Tables - - name: erc20_ethereum - description: "Transfers events for ERC20 tokens on Ethereum." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Ethereum." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Ethereum." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_ethereum - description: "Transfers events for ERC1155 tokens on Ethereum." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Ethereum." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Ethereum." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Ethereum." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_ethereum - description: "Transfers events for ERC721 tokens on Ethereum." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Ethereum." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Ethereum." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Ethereum." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator diff --git a/sources/_base_sources/evm/arbitrum_base_sources.yml b/sources/_base_sources/evm/arbitrum_base_sources.yml new file mode 100644 index 00000000000..8ccdbfc0315 --- /dev/null +++ b/sources/_base_sources/evm/arbitrum_base_sources.yml @@ -0,0 +1,445 @@ +version: 2 + +sources: + # arbitrum Tables + - name: arbitrum + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/arbitrum/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("arbitrum_transactions_doc") }}' + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including arbitrum fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in arbitrum)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/arbitrum/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("arbitrum_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/arbitrum/decoded/traces_decoded + short_description: The `arbitrum.traces_decoded` table contains decoded traces, including additional information arbitrumd on submitted smart contracts and their ABIs. + description: '{{ doc("arbitrum_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/arbitrum/raw/logs + short_description: The `arbitrum.logs` table contains information about event logs emitted by smart contracts on the arbitrum blockchain. + description: '{{ doc("arbitrum_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/arbitrum/decoded/logs_decoded + short_description: The `arbitrum.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("arbitrum_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/arbitrum/raw/blocks + short_description: The `arbitrum.blocks` table contains information about arbitrum blocks. Each row represents a single block. + description: '{{ doc("arbitrum_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the arbitrum unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in arbitrum)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in arbitrum)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in arbitrum)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for arbitrum)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for arbitrum)." + + + - name: contracts + meta: + docs_slug: /evm/arbitrum/raw/contracts + short_description: The `arbitrum.contracts` table tracks decoded contracts on arbitrum, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("arbitrum_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: arbitrum + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'arbitrum', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/arbitrum/raw/creation_traces + short_description: The `arbitrum.creation_traces` table contains information about contract creation traces on the arbitrum blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("arbitrum_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_arbitrum + description: "Transfer events for ERC20 tokens on arbitrum" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/arbitrum/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the arbitrum blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_arbitrum_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's arbitrum unit" + + - name: evt_approval + meta: + docs_slug: /evm/arbitrum/decoded/interfaces/erc20/evt_approval + short_description: The `arbitrum.evt_approval` table contains approval events for ERC20 tokens on arbitrum, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_arbitrum_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_arbitrum + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/arbitrum/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_arbitrum_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/arbitrum/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_arbitrum_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/arbitrum/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_arbitrum_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "arbitrum address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "arbitrum address of the token owner granting or revoking approval" + - name: operator + description: "arbitrum address being granted or revoked permission to operate all tokens" + + - name: erc721_arbitrum + description: '{{ doc("erc721_arbitrum_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/arbitrum/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_arbitrum_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/arbitrum/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `arbitrum.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the arbitrum blockchain. + description: '{{ doc("erc721_arbitrum_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/arbitrum_docs_block.md b/sources/_base_sources/evm/arbitrum_docs_block.md new file mode 100644 index 00000000000..2f1f91b72bc --- /dev/null +++ b/sources/_base_sources/evm/arbitrum_docs_block.md @@ -0,0 +1,221 @@ +{% docs arbitrum_transactions_doc %} + +The `arbitrum.transactions` table contains detailed information about transactions on the arbitrum blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on arbitrum. + +{% enddocs %} + +{% docs arbitrum_traces_doc %} + +The `arbitrum.traces` table contains records of execution steps for transactions on the arbitrum blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the arbitrum network. + +{% enddocs %} + +{% docs arbitrum_traces_decoded_doc %} + +The `arbitrum.traces_decoded` table contains a subset of decoded traces from the arbitrum blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `arbitrum.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_arbitrum.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs arbitrum_logs_doc %} + +The `arbitrum.logs` table contains event logs emitted by smart contracts on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the arbitrum network. + +{% enddocs %} + +{% docs arbitrum_logs_decoded_doc %} + +The `arbitrum.logs_decoded` table contains a subset of decoded logs from the arbitrum blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `arbitrum.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_arbitrum.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs arbitrum_blocks_doc %} + +The `arbitrum.blocks` table contains information about arbitrum blocks. It provides essential data about each block in the arbitrum blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs arbitrum_contracts_doc %} + +The `arbitrum.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs arbitrum_creation_traces_doc %} + +The `arbitrum.creation_traces` table contains data about contract creation events on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the arbitrum network. It's essentially a filtered version of the `arbitrum.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_arbitrum_evt_transfer_doc %} + +The `erc20_arbitrum.evt_transfer` table contains Transfer events for ERC20 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the arbitrum network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_arbitrum_evt_approval_doc %} + +The `erc20_arbitrum.evt_approval` table contains Approval events for ERC20 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the arbitrum network. + +{% enddocs %} + +{% docs erc1155_arbitrum_evt_transfersingle_doc %} + +The `erc1155_arbitrum.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the arbitrum network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_arbitrum_evt_transferbatch_doc %} + +The `erc1155_arbitrum.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the arbitrum network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_arbitrum_evt_ApprovalForAll_doc %} + +The `erc1155_arbitrum.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the arbitrum network. + +{% enddocs %} + +{% docs erc721_arbitrum_evt_transfer_doc %} + +The `erc721_arbitrum.evt_transfer` table contains Transfer events for ERC721 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the arbitrum network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_arbitrum_evt_Approval_doc %} + +The `erc721_arbitrum.evt_Approval` table contains Approval events for ERC721 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the arbitrum network. + +{% enddocs %} + +{% docs erc721_arbitrum_evt_ApprovalForAll_doc %} + +The `erc721_arbitrum.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the arbitrum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the arbitrum network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/avalanche_c_base_sources.yml b/sources/_base_sources/evm/avalanche_c_base_sources.yml new file mode 100644 index 00000000000..f8c4234ee9b --- /dev/null +++ b/sources/_base_sources/evm/avalanche_c_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # avalanche_c Tables + - name: avalanche_c + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/avalanche_c/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("avalanche_c_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including avalanche_c fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in avalanche_c)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/avalanche_c/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("avalanche_c_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/avalanche_c/decoded/traces_decoded + short_description: The `avalanche_c.traces_decoded` table contains decoded traces, including additional information avalanche_cd on submitted smart contracts and their ABIs. + description: '{{ doc("avalanche_c_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/avalanche_c/raw/logs + short_description: The `avalanche_c.logs` table contains information about event logs emitted by smart contracts on the avalanche_c blockchain. + description: '{{ doc("avalanche_c_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/avalanche_c/decoded/logs_decoded + short_description: The `avalanche_c.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("avalanche_c_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/avalanche_c/raw/blocks + short_description: The `avalanche_c.blocks` table contains information about avalanche_c blocks. Each row represents a single block. + description: '{{ doc("avalanche_c_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the avalanche_c unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in avalanche_c)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in avalanche_c)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in avalanche_c)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for avalanche_c)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for avalanche_c)." + + + - name: contracts + meta: + docs_slug: /evm/avalanche_c/raw/contracts + short_description: The `avalanche_c.contracts` table tracks decoded contracts on avalanche_c, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("avalanche_c_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: avalanche_c + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'avalanche_c', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/avalanche_c/raw/creation_traces + short_description: The `avalanche_c.creation_traces` table contains information about contract creation traces on the avalanche_c blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("avalanche_c_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_avalanche_c + description: "Transfer events for ERC20 tokens on avalanche_c" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/avalanche_c/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the avalanche_c blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_avalanche_c_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's avalanche_c unit" + + - name: evt_approval + meta: + docs_slug: /evm/avalanche_c/decoded/interfaces/erc20/evt_approval + short_description: The `avalanche_c.evt_approval` table contains approval events for ERC20 tokens on avalanche_c, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_avalanche_c_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_avalanche_c + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/avalanche_c/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_avalanche_c_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/avalanche_c/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_avalanche_c_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/avalanche_c/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_avalanche_c_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "avalanche_c address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "avalanche_c address of the token owner granting or revoking approval" + - name: operator + description: "avalanche_c address being granted or revoked permission to operate all tokens" + + - name: erc721_avalanche_c + description: '{{ doc("erc721_avalanche_c_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/avalanche_c/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_avalanche_c_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/avalanche_c/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `avalanche_c.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the avalanche_c blockchain. + description: '{{ doc("erc721_avalanche_c_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/avalanche_c_docs_block.md b/sources/_base_sources/evm/avalanche_c_docs_block.md new file mode 100644 index 00000000000..1a1ad6479b4 --- /dev/null +++ b/sources/_base_sources/evm/avalanche_c_docs_block.md @@ -0,0 +1,221 @@ +{% docs avalanche_c_transactions_doc %} + +The `avalanche_c.transactions` table contains detailed information about transactions on the avalanche_c blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on avalanche_c. + +{% enddocs %} + +{% docs avalanche_c_traces_doc %} + +The `avalanche_c.traces` table contains records of execution steps for transactions on the avalanche_c blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the avalanche_c network. + +{% enddocs %} + +{% docs avalanche_c_traces_decoded_doc %} + +The `avalanche_c.traces_decoded` table contains a subset of decoded traces from the avalanche_c blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `avalanche_c.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_avalanche_c.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs avalanche_c_logs_doc %} + +The `avalanche_c.logs` table contains event logs emitted by smart contracts on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the avalanche_c network. + +{% enddocs %} + +{% docs avalanche_c_logs_decoded_doc %} + +The `avalanche_c.logs_decoded` table contains a subset of decoded logs from the avalanche_c blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `avalanche_c.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_avalanche_c.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs avalanche_c_blocks_doc %} + +The `avalanche_c.blocks` table contains information about avalanche_c blocks. It provides essential data about each block in the avalanche_c blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs avalanche_c_contracts_doc %} + +The `avalanche_c.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs avalanche_c_creation_traces_doc %} + +The `avalanche_c.creation_traces` table contains data about contract creation events on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the avalanche_c network. It's essentially a filtered version of the `avalanche_c.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_avalanche_c_evt_transfer_doc %} + +The `erc20_avalanche_c.evt_transfer` table contains Transfer events for ERC20 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the avalanche_c network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_avalanche_c_evt_approval_doc %} + +The `erc20_avalanche_c.evt_approval` table contains Approval events for ERC20 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the avalanche_c network. + +{% enddocs %} + +{% docs erc1155_avalanche_c_evt_transfersingle_doc %} + +The `erc1155_avalanche_c.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the avalanche_c network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_avalanche_c_evt_transferbatch_doc %} + +The `erc1155_avalanche_c.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the avalanche_c network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_avalanche_c_evt_ApprovalForAll_doc %} + +The `erc1155_avalanche_c.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the avalanche_c network. + +{% enddocs %} + +{% docs erc721_avalanche_c_evt_transfer_doc %} + +The `erc721_avalanche_c.evt_transfer` table contains Transfer events for ERC721 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the avalanche_c network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_avalanche_c_evt_Approval_doc %} + +The `erc721_avalanche_c.evt_Approval` table contains Approval events for ERC721 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the avalanche_c network. + +{% enddocs %} + +{% docs erc721_avalanche_c_evt_ApprovalForAll_doc %} + +The `erc721_avalanche_c.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the avalanche_c blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the avalanche_c network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/base_base_sources.yml b/sources/_base_sources/evm/base_base_sources.yml new file mode 100644 index 00000000000..5a85673a995 --- /dev/null +++ b/sources/_base_sources/evm/base_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # base Tables + - name: base + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/base/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("base_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including base fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in base)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/base/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("base_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/base/decoded/traces_decoded + short_description: The `base.traces_decoded` table contains decoded traces, including additional information based on submitted smart contracts and their ABIs. + description: '{{ doc("base_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/base/raw/logs + short_description: The `base.logs` table contains information about event logs emitted by smart contracts on the base blockchain. + description: '{{ doc("base_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/base/decoded/logs_decoded + short_description: The `base.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("base_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/base/raw/blocks + short_description: The `base.blocks` table contains information about base blocks. Each row represents a single block. + description: '{{ doc("base_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the base unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in base)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in base)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in base)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for base)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for base)." + + + - name: contracts + meta: + docs_slug: /evm/base/raw/contracts + short_description: The `base.contracts` table tracks decoded contracts on base, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("base_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: base + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'base', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/base/raw/creation_traces + short_description: The `base.creation_traces` table contains information about contract creation traces on the base blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("base_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_base + description: "Transfer events for ERC20 tokens on base" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/base/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the base blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_base_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's base unit" + + - name: evt_Approval + meta: + docs_slug: /evm/base/decoded/interfaces/erc20/evt_approval + short_description: The `base.evt_approval` table contains approval events for ERC20 tokens on base, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_base_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_base + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/base/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_base_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/base/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_base_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/base/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_base_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "base address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "base address of the token owner granting or revoking approval" + - name: operator + description: "base address being granted or revoked permission to operate all tokens" + + - name: erc721_base + description: '{{ doc("erc721_base_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/base/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_base_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/base/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `base.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the base blockchain. + description: '{{ doc("erc721_base_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/base_docs_block.md b/sources/_base_sources/evm/base_docs_block.md new file mode 100644 index 00000000000..ac6355af518 --- /dev/null +++ b/sources/_base_sources/evm/base_docs_block.md @@ -0,0 +1,221 @@ +{% docs base_transactions_doc %} + +The `base.transactions` table contains detailed information about transactions on the base blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on base. + +{% enddocs %} + +{% docs base_traces_doc %} + +The `base.traces` table contains records of execution steps for transactions on the base blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the base network. + +{% enddocs %} + +{% docs base_traces_decoded_doc %} + +The `base.traces_decoded` table contains a subset of decoded traces from the base blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `base.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_base.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs base_logs_doc %} + +The `base.logs` table contains event logs emitted by smart contracts on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the base network. + +{% enddocs %} + +{% docs base_logs_decoded_doc %} + +The `base.logs_decoded` table contains a subset of decoded logs from the base blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `base.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_base.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs base_blocks_doc %} + +The `base.blocks` table contains information about base blocks. It provides essential data about each block in the base blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs base_contracts_doc %} + +The `base.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs base_creation_traces_doc %} + +The `base.creation_traces` table contains data about contract creation events on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the base network. It's essentially a filtered version of the `base.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_base_evt_transfer_doc %} + +The `erc20_base.evt_transfer` table contains Transfer events for ERC20 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the base network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_base_evt_approval_doc %} + +The `erc20_base.evt_approval` table contains Approval events for ERC20 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the base network. + +{% enddocs %} + +{% docs erc1155_base_evt_transfersingle_doc %} + +The `erc1155_base.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the base network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_base_evt_transferbatch_doc %} + +The `erc1155_base.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the base network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_base_evt_ApprovalForAll_doc %} + +The `erc1155_base.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the base network. + +{% enddocs %} + +{% docs erc721_base_evt_transfer_doc %} + +The `erc721_base.evt_transfer` table contains Transfer events for ERC721 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the base network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_base_evt_Approval_doc %} + +The `erc721_base.evt_Approval` table contains Approval events for ERC721 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the base network. + +{% enddocs %} + +{% docs erc721_base_evt_ApprovalForAll_doc %} + +The `erc721_base.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the base blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the base network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/blast_base_sources.yml b/sources/_base_sources/evm/blast_base_sources.yml new file mode 100644 index 00000000000..52f22aab5ea --- /dev/null +++ b/sources/_base_sources/evm/blast_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # Blast Tables + - name: blast + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/blast/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("blast_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including blast fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in Blast)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/blast/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("blast_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/blast/decoded/traces_decoded + short_description: The `blast.traces_decoded` table contains decoded traces, including additional information blastd on submitted smart contracts and their ABIs. + description: '{{ doc("blast_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/blast/raw/logs + short_description: The `blast.logs` table contains information about event logs emitted by smart contracts on the Blast blockchain. + description: '{{ doc("blast_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/blast/decoded/logs_decoded + short_description: The `blast.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("blast_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/blast/raw/blocks + short_description: The `blast.blocks` table contains information about Blast blocks. Each row represents a single block. + description: '{{ doc("blast_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the blast unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in Blast)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in Blast)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in Blast)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for Blast)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for Blast)." + + + - name: contracts + meta: + docs_slug: /evm/blast/raw/contracts + short_description: The `blast.contracts` table tracks decoded contracts on Blast, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("blast_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: blast + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'blast', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/blast/raw/creation_traces + short_description: The `blast.creation_traces` table contains information about contract creation traces on the Blast blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("blast_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_blast + description: "Transfer events for ERC20 tokens on Blast" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/blast/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the Blast blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_blast_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's blast unit" + + - name: evt_approval + meta: + docs_slug: /evm/blast/decoded/interfaces/erc20/evt_approval + short_description: The `blast.evt_approval` table contains approval events for ERC20 tokens on Blast, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_blast_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_blast + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/blast/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_blast_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/blast/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_blast_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/blast/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_blast_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Blast address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "Blast address of the token owner granting or revoking approval" + - name: operator + description: "Blast address being granted or revoked permission to operate all tokens" + + - name: erc721_blast + description: '{{ doc("erc721_blast_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/blast/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_blast_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/blast/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `blast.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the Blast blockchain. + description: '{{ doc("erc721_blast_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/blast_docs_block.md b/sources/_base_sources/evm/blast_docs_block.md new file mode 100644 index 00000000000..f03aaf29216 --- /dev/null +++ b/sources/_base_sources/evm/blast_docs_block.md @@ -0,0 +1,221 @@ +{% docs blast_transactions_doc %} + +The `blast.transactions` table contains detailed information about transactions on the Blast blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on Blast. + +{% enddocs %} + +{% docs blast_traces_doc %} + +The `blast.traces` table contains records of execution steps for transactions on the Blast blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the Blast network. + +{% enddocs %} + +{% docs blast_traces_decoded_doc %} + +The `blast.traces_decoded` table contains a subset of decoded traces from the Blast blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `blast.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_blast.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs blast_logs_doc %} + +The `blast.logs` table contains event logs emitted by smart contracts on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the Blast network. + +{% enddocs %} + +{% docs blast_logs_decoded_doc %} + +The `blast.logs_decoded` table contains a subset of decoded logs from the Blast blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `blast.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_blast.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs blast_blocks_doc %} + +The `blast.blocks` table contains information about Blast blocks. It provides essential data about each block in the Blast blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs blast_contracts_doc %} + +The `blast.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs blast_creation_traces_doc %} + +The `blast.creation_traces` table contains data about contract creation events on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the Blast network. It's essentially a filtered version of the `blast.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_blast_evt_transfer_doc %} + +The `erc20_blast.evt_transfer` table contains Transfer events for ERC20 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the Blast network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_blast_evt_approval_doc %} + +The `erc20_blast.evt_approval` table contains Approval events for ERC20 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the Blast network. + +{% enddocs %} + +{% docs erc1155_blast_evt_transfersingle_doc %} + +The `erc1155_blast.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the Blast network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_blast_evt_transferbatch_doc %} + +The `erc1155_blast.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the Blast network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_blast_evt_ApprovalForAll_doc %} + +The `erc1155_blast.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the Blast network. + +{% enddocs %} + +{% docs erc721_blast_evt_transfer_doc %} + +The `erc721_blast.evt_transfer` table contains Transfer events for ERC721 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the Blast network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_blast_evt_Approval_doc %} + +The `erc721_blast.evt_Approval` table contains Approval events for ERC721 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the Blast network. + +{% enddocs %} + +{% docs erc721_blast_evt_ApprovalForAll_doc %} + +The `erc721_blast.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the Blast blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the Blast network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/bnb_base_sources.yml b/sources/_base_sources/evm/bnb_base_sources.yml new file mode 100644 index 00000000000..706d483d00e --- /dev/null +++ b/sources/_base_sources/evm/bnb_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # bnb Tables + - name: bnb + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/bnb/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("bnb_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including bnb fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in bnb)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/bnb/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("bnb_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/bnb/decoded/traces_decoded + short_description: The `bnb.traces_decoded` table contains decoded traces, including additional information bnbd on submitted smart contracts and their ABIs. + description: '{{ doc("bnb_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/bnb/raw/logs + short_description: The `bnb.logs` table contains information about event logs emitted by smart contracts on the bnb blockchain. + description: '{{ doc("bnb_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/bnb/decoded/logs_decoded + short_description: The `bnb.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("bnb_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/bnb/raw/blocks + short_description: The `bnb.blocks` table contains information about bnb blocks. Each row represents a single block. + description: '{{ doc("bnb_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the bnb unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in bnb)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in bnb)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in bnb)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for bnb)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for bnb)." + + + - name: contracts + meta: + docs_slug: /evm/bnb/raw/contracts + short_description: The `bnb.contracts` table tracks decoded contracts on bnb, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("bnb_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: bnb + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'bnb', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/bnb/raw/creation_traces + short_description: The `bnb.creation_traces` table contains information about contract creation traces on the bnb blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("bnb_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_bnb + description: "Transfer events for ERC20 tokens on bnb" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/bnb/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the bnb blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_bnb_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's bnb unit" + + - name: evt_approval + meta: + docs_slug: /evm/bnb/decoded/interfaces/erc20/evt_approval + short_description: The `bnb.evt_approval` table contains approval events for ERC20 tokens on bnb, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_bnb_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_bnb + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/bnb/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_bnb_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/bnb/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_bnb_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/bnb/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_bnb_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "bnb address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "bnb address of the token owner granting or revoking approval" + - name: operator + description: "bnb address being granted or revoked permission to operate all tokens" + + - name: erc721_bnb + description: '{{ doc("erc721_bnb_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/bnb/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_bnb_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/bnb/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `bnb.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the bnb blockchain. + description: '{{ doc("erc721_bnb_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/bnb_docs_block.md b/sources/_base_sources/evm/bnb_docs_block.md new file mode 100644 index 00000000000..11e0ca1c45a --- /dev/null +++ b/sources/_base_sources/evm/bnb_docs_block.md @@ -0,0 +1,221 @@ +{% docs bnb_transactions_doc %} + +The `bnb.transactions` table contains detailed information about transactions on the bnb blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on bnb. + +{% enddocs %} + +{% docs bnb_traces_doc %} + +The `bnb.traces` table contains records of execution steps for transactions on the bnb blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the bnb network. + +{% enddocs %} + +{% docs bnb_traces_decoded_doc %} + +The `bnb.traces_decoded` table contains a subset of decoded traces from the bnb blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `bnb.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_bnb.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs bnb_logs_doc %} + +The `bnb.logs` table contains event logs emitted by smart contracts on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the bnb network. + +{% enddocs %} + +{% docs bnb_logs_decoded_doc %} + +The `bnb.logs_decoded` table contains a subset of decoded logs from the bnb blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `bnb.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_bnb.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs bnb_blocks_doc %} + +The `bnb.blocks` table contains information about bnb blocks. It provides essential data about each block in the bnb blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs bnb_contracts_doc %} + +The `bnb.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs bnb_creation_traces_doc %} + +The `bnb.creation_traces` table contains data about contract creation events on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the bnb network. It's essentially a filtered version of the `bnb.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_bnb_evt_transfer_doc %} + +The `erc20_bnb.evt_transfer` table contains Transfer events for ERC20 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the bnb network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_bnb_evt_approval_doc %} + +The `erc20_bnb.evt_approval` table contains Approval events for ERC20 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the bnb network. + +{% enddocs %} + +{% docs erc1155_bnb_evt_transfersingle_doc %} + +The `erc1155_bnb.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the bnb network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_bnb_evt_transferbatch_doc %} + +The `erc1155_bnb.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the bnb network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_bnb_evt_ApprovalForAll_doc %} + +The `erc1155_bnb.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the bnb network. + +{% enddocs %} + +{% docs erc721_bnb_evt_transfer_doc %} + +The `erc721_bnb.evt_transfer` table contains Transfer events for ERC721 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the bnb network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_bnb_evt_Approval_doc %} + +The `erc721_bnb.evt_Approval` table contains Approval events for ERC721 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the bnb network. + +{% enddocs %} + +{% docs erc721_bnb_evt_ApprovalForAll_doc %} + +The `erc721_bnb.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the bnb blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the bnb network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/bob_base_sources.yml b/sources/_base_sources/evm/bob_base_sources.yml new file mode 100644 index 00000000000..d775a2add1b --- /dev/null +++ b/sources/_base_sources/evm/bob_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # bob Tables + - name: bob + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/bob/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("bob_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including bob fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in bob)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/bob/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("bob_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/bob/decoded/traces_decoded + short_description: The `bob.traces_decoded` table contains decoded traces, including additional information bobd on submitted smart contracts and their ABIs. + description: '{{ doc("bob_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/bob/raw/logs + short_description: The `bob.logs` table contains information about event logs emitted by smart contracts on the bob blockchain. + description: '{{ doc("bob_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/bob/decoded/logs_decoded + short_description: The `bob.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("bob_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/bob/raw/blocks + short_description: The `bob.blocks` table contains information about bob blocks. Each row represents a single block. + description: '{{ doc("bob_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the bob unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in bob)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in bob)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in bob)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for bob)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for bob)." + + + - name: contracts + meta: + docs_slug: /evm/bob/raw/contracts + short_description: The `bob.contracts` table tracks decoded contracts on bob, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("bob_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: bob + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'bob', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/bob/raw/creation_traces + short_description: The `bob.creation_traces` table contains information about contract creation traces on the bob blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("bob_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_bob + description: "Transfer events for ERC20 tokens on bob" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/bob/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the bob blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_bob_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's bob unit" + + - name: evt_approval + meta: + docs_slug: /evm/bob/decoded/interfaces/erc20/evt_approval + short_description: The `bob.evt_approval` table contains approval events for ERC20 tokens on bob, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_bob_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_bob + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/bob/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_bob_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/bob/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_bob_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/bob/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_bob_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "bob address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "bob address of the token owner granting or revoking approval" + - name: operator + description: "bob address being granted or revoked permission to operate all tokens" + + - name: erc721_bob + description: '{{ doc("erc721_bob_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/bob/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_bob_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/bob/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `bob.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the bob blockchain. + description: '{{ doc("erc721_bob_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/bob_docs_block.md b/sources/_base_sources/evm/bob_docs_block.md new file mode 100644 index 00000000000..80695bfc2fd --- /dev/null +++ b/sources/_base_sources/evm/bob_docs_block.md @@ -0,0 +1,221 @@ +{% docs bob_transactions_doc %} + +The `bob.transactions` table contains detailed information about transactions on the bob blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on bob. + +{% enddocs %} + +{% docs bob_traces_doc %} + +The `bob.traces` table contains records of execution steps for transactions on the bob blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the bob network. + +{% enddocs %} + +{% docs bob_traces_decoded_doc %} + +The `bob.traces_decoded` table contains a subset of decoded traces from the bob blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `bob.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_bob.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs bob_logs_doc %} + +The `bob.logs` table contains event logs emitted by smart contracts on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the bob network. + +{% enddocs %} + +{% docs bob_logs_decoded_doc %} + +The `bob.logs_decoded` table contains a subset of decoded logs from the bob blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `bob.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_bob.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs bob_blocks_doc %} + +The `bob.blocks` table contains information about bob blocks. It provides essential data about each block in the bob blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs bob_contracts_doc %} + +The `bob.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs bob_creation_traces_doc %} + +The `bob.creation_traces` table contains data about contract creation events on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the bob network. It's essentially a filtered version of the `bob.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_bob_evt_transfer_doc %} + +The `erc20_bob.evt_transfer` table contains Transfer events for ERC20 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the bob network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_bob_evt_approval_doc %} + +The `erc20_bob.evt_approval` table contains Approval events for ERC20 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the bob network. + +{% enddocs %} + +{% docs erc1155_bob_evt_transfersingle_doc %} + +The `erc1155_bob.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the bob network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_bob_evt_transferbatch_doc %} + +The `erc1155_bob.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the bob network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_bob_evt_ApprovalForAll_doc %} + +The `erc1155_bob.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the bob network. + +{% enddocs %} + +{% docs erc721_bob_evt_transfer_doc %} + +The `erc721_bob.evt_transfer` table contains Transfer events for ERC721 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the bob network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_bob_evt_Approval_doc %} + +The `erc721_bob.evt_Approval` table contains Approval events for ERC721 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the bob network. + +{% enddocs %} + +{% docs erc721_bob_evt_ApprovalForAll_doc %} + +The `erc721_bob.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the bob blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the bob network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/celo_base_sources.yml b/sources/_base_sources/evm/celo_base_sources.yml new file mode 100644 index 00000000000..27ff91b3b5d --- /dev/null +++ b/sources/_base_sources/evm/celo_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # celo Tables + - name: celo + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/celo/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("celo_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including celo fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in celo)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/celo/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("celo_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/celo/decoded/traces_decoded + short_description: The `celo.traces_decoded` table contains decoded traces, including additional information celod on submitted smart contracts and their ABIs. + description: '{{ doc("celo_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/celo/raw/logs + short_description: The `celo.logs` table contains information about event logs emitted by smart contracts on the celo blockchain. + description: '{{ doc("celo_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/celo/decoded/logs_decoded + short_description: The `celo.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("celo_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/celo/raw/blocks + short_description: The `celo.blocks` table contains information about celo blocks. Each row represents a single block. + description: '{{ doc("celo_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the celo unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in celo)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in celo)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in celo)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for celo)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for celo)." + + + - name: contracts + meta: + docs_slug: /evm/celo/raw/contracts + short_description: The `celo.contracts` table tracks decoded contracts on celo, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("celo_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: celo + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'celo', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/celo/raw/creation_traces + short_description: The `celo.creation_traces` table contains information about contract creation traces on the celo blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("celo_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_celo + description: "Transfer events for ERC20 tokens on celo" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/celo/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the celo blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_celo_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's celo unit" + + - name: evt_approval + meta: + docs_slug: /evm/celo/decoded/interfaces/erc20/evt_approval + short_description: The `celo.evt_approval` table contains approval events for ERC20 tokens on celo, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_celo_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_celo + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/celo/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_celo_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/celo/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_celo_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/celo/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_celo_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "celo address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "celo address of the token owner granting or revoking approval" + - name: operator + description: "celo address being granted or revoked permission to operate all tokens" + + - name: erc721_celo + description: '{{ doc("erc721_celo_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/celo/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_celo_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/celo/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `celo.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the celo blockchain. + description: '{{ doc("erc721_celo_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/celo_docs_block.md b/sources/_base_sources/evm/celo_docs_block.md new file mode 100644 index 00000000000..443fc01074a --- /dev/null +++ b/sources/_base_sources/evm/celo_docs_block.md @@ -0,0 +1,221 @@ +{% docs celo_transactions_doc %} + +The `celo.transactions` table contains detailed information about transactions on the celo blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on celo. + +{% enddocs %} + +{% docs celo_traces_doc %} + +The `celo.traces` table contains records of execution steps for transactions on the celo blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the celo network. + +{% enddocs %} + +{% docs celo_traces_decoded_doc %} + +The `celo.traces_decoded` table contains a subset of decoded traces from the celo blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `celo.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_celo.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs celo_logs_doc %} + +The `celo.logs` table contains event logs emitted by smart contracts on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the celo network. + +{% enddocs %} + +{% docs celo_logs_decoded_doc %} + +The `celo.logs_decoded` table contains a subset of decoded logs from the celo blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `celo.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_celo.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs celo_blocks_doc %} + +The `celo.blocks` table contains information about celo blocks. It provides essential data about each block in the celo blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs celo_contracts_doc %} + +The `celo.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs celo_creation_traces_doc %} + +The `celo.creation_traces` table contains data about contract creation events on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the celo network. It's essentially a filtered version of the `celo.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_celo_evt_transfer_doc %} + +The `erc20_celo.evt_transfer` table contains Transfer events for ERC20 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the celo network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_celo_evt_approval_doc %} + +The `erc20_celo.evt_approval` table contains Approval events for ERC20 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the celo network. + +{% enddocs %} + +{% docs erc1155_celo_evt_transfersingle_doc %} + +The `erc1155_celo.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the celo network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_celo_evt_transferbatch_doc %} + +The `erc1155_celo.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the celo network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_celo_evt_ApprovalForAll_doc %} + +The `erc1155_celo.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the celo network. + +{% enddocs %} + +{% docs erc721_celo_evt_transfer_doc %} + +The `erc721_celo.evt_transfer` table contains Transfer events for ERC721 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the celo network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_celo_evt_Approval_doc %} + +The `erc721_celo.evt_Approval` table contains Approval events for ERC721 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the celo network. + +{% enddocs %} + +{% docs erc721_celo_evt_ApprovalForAll_doc %} + +The `erc721_celo.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the celo blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the celo network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/degen_base_sources.yml b/sources/_base_sources/evm/degen_base_sources.yml new file mode 100644 index 00000000000..3948d1204ea --- /dev/null +++ b/sources/_base_sources/evm/degen_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # degen Tables + - name: degen + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/degen/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("degen_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including degen fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in degen)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/degen/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("degen_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/degen/decoded/traces_decoded + short_description: The `degen.traces_decoded` table contains decoded traces, including additional information degend on submitted smart contracts and their ABIs. + description: '{{ doc("degen_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/degen/raw/logs + short_description: The `degen.logs` table contains information about event logs emitted by smart contracts on the degen blockchain. + description: '{{ doc("degen_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/degen/decoded/logs_decoded + short_description: The `degen.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("degen_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/degen/raw/blocks + short_description: The `degen.blocks` table contains information about degen blocks. Each row represents a single block. + description: '{{ doc("degen_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the degen unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in degen)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in degen)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in degen)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for degen)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for degen)." + + + - name: contracts + meta: + docs_slug: /evm/degen/raw/contracts + short_description: The `degen.contracts` table tracks decoded contracts on degen, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("degen_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: degen + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'degen', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/degen/raw/creation_traces + short_description: The `degen.creation_traces` table contains information about contract creation traces on the degen blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("degen_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_degen + description: "Transfer events for ERC20 tokens on degen" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/degen/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the degen blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_degen_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's degen unit" + + - name: evt_approval + meta: + docs_slug: /evm/degen/decoded/interfaces/erc20/evt_approval + short_description: The `degen.evt_approval` table contains approval events for ERC20 tokens on degen, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_degen_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_degen + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/degen/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_degen_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/degen/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_degen_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/degen/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_degen_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "degen address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "degen address of the token owner granting or revoking approval" + - name: operator + description: "degen address being granted or revoked permission to operate all tokens" + + - name: erc721_degen + description: '{{ doc("erc721_degen_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/degen/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_degen_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/degen/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `degen.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the degen blockchain. + description: '{{ doc("erc721_degen_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/degen_docs_block.md b/sources/_base_sources/evm/degen_docs_block.md new file mode 100644 index 00000000000..23bb8b410ab --- /dev/null +++ b/sources/_base_sources/evm/degen_docs_block.md @@ -0,0 +1,221 @@ +{% docs degen_transactions_doc %} + +The `degen.transactions` table contains detailed information about transactions on the degen blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on degen. + +{% enddocs %} + +{% docs degen_traces_doc %} + +The `degen.traces` table contains records of execution steps for transactions on the degen blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the degen network. + +{% enddocs %} + +{% docs degen_traces_decoded_doc %} + +The `degen.traces_decoded` table contains a subset of decoded traces from the degen blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `degen.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_degen.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs degen_logs_doc %} + +The `degen.logs` table contains event logs emitted by smart contracts on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the degen network. + +{% enddocs %} + +{% docs degen_logs_decoded_doc %} + +The `degen.logs_decoded` table contains a subset of decoded logs from the degen blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `degen.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_degen.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs degen_blocks_doc %} + +The `degen.blocks` table contains information about degen blocks. It provides essential data about each block in the degen blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs degen_contracts_doc %} + +The `degen.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs degen_creation_traces_doc %} + +The `degen.creation_traces` table contains data about contract creation events on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the degen network. It's essentially a filtered version of the `degen.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_degen_evt_transfer_doc %} + +The `erc20_degen.evt_transfer` table contains Transfer events for ERC20 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the degen network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_degen_evt_approval_doc %} + +The `erc20_degen.evt_approval` table contains Approval events for ERC20 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the degen network. + +{% enddocs %} + +{% docs erc1155_degen_evt_transfersingle_doc %} + +The `erc1155_degen.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the degen network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_degen_evt_transferbatch_doc %} + +The `erc1155_degen.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the degen network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_degen_evt_ApprovalForAll_doc %} + +The `erc1155_degen.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the degen network. + +{% enddocs %} + +{% docs erc721_degen_evt_transfer_doc %} + +The `erc721_degen.evt_transfer` table contains Transfer events for ERC721 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the degen network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_degen_evt_Approval_doc %} + +The `erc721_degen.evt_Approval` table contains Approval events for ERC721 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the degen network. + +{% enddocs %} + +{% docs erc721_degen_evt_ApprovalForAll_doc %} + +The `erc721_degen.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the degen blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the degen network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/ethereum_base_sources.yml b/sources/_base_sources/evm/ethereum_base_sources.yml new file mode 100644 index 00000000000..fe867ab67bd --- /dev/null +++ b/sources/_base_sources/evm/ethereum_base_sources.yml @@ -0,0 +1,470 @@ +version: 2 + +sources: + # ethereum Tables + - name: ethereum + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/ethereum/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("ethereum_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including ethereum fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in ethereum)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/ethereum/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("ethereum_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/ethereum/decoded/traces_decoded + short_description: The `ethereum.traces_decoded` table contains decoded traces, including additional information ethereumd on submitted smart contracts and their ABIs. + description: '{{ doc("ethereum_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/ethereum/raw/logs + short_description: The `ethereum.logs` table contains information about event logs emitted by smart contracts on the ethereum blockchain. + description: '{{ doc("ethereum_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/ethereum/decoded/logs_decoded + short_description: The `ethereum.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("ethereum_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/ethereum/raw/blocks + short_description: The `ethereum.blocks` table contains information about ethereum blocks. Each row represents a single block. + description: '{{ doc("ethereum_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the ethereum unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in ethereum)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in ethereum)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in ethereum)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for ethereum)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for ethereum)." + + - name: contracts + meta: + docs_slug: /evm/ethereum/raw/contracts + short_description: The `ethereum.contracts` table tracks decoded contracts on ethereum, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("ethereum_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: ethereum + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'ethereum', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/ethereum/raw/creation_traces + short_description: The `ethereum.creation_traces` table contains information about contract creation traces on the ethereum blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("ethereum_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + - name: withdrawals + meta: + docs_slug: /ethereum/withdrawals + short_description: "This table contains information about withdrawals from the beacon chain to Ethereum Mainnet." + description: '{{ doc("ethereum_withdrawals_doc") }}' + columns: + - name: block_time + description: "The exact UTC timestamp when the block containing this withdrawal was added to the chain" + - name: block_number + description: "The sequential number of the block containing this withdrawal" + - name: index + description: "Position of this withdrawal within its containing block" + - name: validator_index + description: "Unique identifier of the validator associated with this withdrawal" + - name: amount + description: "Amount of ETH withdrawn, measured in wei (1 ETH = 10^18 wei)" + - name: address + description: "Address of the account receiving the withdrawn ETH" + - name: withdrawals_root + description: "Merkle root of all withdrawals in this block, used for verification purposes" + - name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this withdrawal" + - name: block_date + description: "The UTC date of the block in which this withdrawal was included" + + # ERC Transfer Tables + - name: erc20_ethereum + description: "Transfer events for ERC20 tokens on ethereum" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/ethereum/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the ethereum blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_ethereum_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's ethereum unit" + + - name: evt_approval + meta: + docs_slug: /evm/ethereum/decoded/interfaces/erc20/evt_approval + short_description: The `ethereum.evt_approval` table contains approval events for ERC20 tokens on ethereum, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_ethereum_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_ethereum + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/ethereum/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_ethereum_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/ethereum/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_ethereum_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/ethereum/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_ethereum_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "ethereum address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "ethereum address of the token owner granting or revoking approval" + - name: operator + description: "ethereum address being granted or revoked permission to operate all tokens" + + - name: erc721_ethereum + description: '{{ doc("erc721_ethereum_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/ethereum/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_ethereum_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/ethereum/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `ethereum.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the ethereum blockchain. + description: '{{ doc("erc721_ethereum_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/ethereum_docs_block.md b/sources/_base_sources/evm/ethereum_docs_block.md new file mode 100644 index 00000000000..f695ed52b0b --- /dev/null +++ b/sources/_base_sources/evm/ethereum_docs_block.md @@ -0,0 +1,227 @@ +{% docs ethereum_transactions_doc %} + +The `ethereum.transactions` table contains detailed information about transactions on the ethereum blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on ethereum. + +{% enddocs %} + +{% docs ethereum_traces_doc %} + +The `ethereum.traces` table contains records of execution steps for transactions on the ethereum blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the ethereum network. + +{% enddocs %} + +{% docs ethereum_traces_decoded_doc %} + +The `ethereum.traces_decoded` table contains a subset of decoded traces from the ethereum blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `ethereum.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_ethereum.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs ethereum_logs_doc %} + +The `ethereum.logs` table contains event logs emitted by smart contracts on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the ethereum network. + +{% enddocs %} + +{% docs ethereum_logs_decoded_doc %} + +The `ethereum.logs_decoded` table contains a subset of decoded logs from the ethereum blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `ethereum.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_ethereum.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs ethereum_blocks_doc %} + +The `ethereum.blocks` table contains information about ethereum blocks. It provides essential data about each block in the ethereum blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs ethereum_contracts_doc %} + +The `ethereum.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs ethereum_creation_traces_doc %} + +The `ethereum.creation_traces` table contains data about contract creation events on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the ethereum network. It's essentially a filtered version of the `ethereum.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_ethereum_evt_transfer_doc %} + +The `erc20_ethereum.evt_transfer` table contains Transfer events for ERC20 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the ethereum network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_ethereum_evt_approval_doc %} + +The `erc20_ethereum.evt_approval` table contains Approval events for ERC20 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the ethereum network. + +{% enddocs %} + +{% docs erc1155_ethereum_evt_transfersingle_doc %} + +The `erc1155_ethereum.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the ethereum network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_ethereum_evt_transferbatch_doc %} + +The `erc1155_ethereum.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the ethereum network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_ethereum_evt_ApprovalForAll_doc %} + +The `erc1155_ethereum.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the ethereum network. + +{% enddocs %} + +{% docs erc721_ethereum_evt_transfer_doc %} + +The `erc721_ethereum.evt_transfer` table contains Transfer events for ERC721 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the ethereum network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_ethereum_evt_Approval_doc %} + +The `erc721_ethereum.evt_Approval` table contains Approval events for ERC721 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the ethereum network. + +{% enddocs %} + +{% docs erc721_ethereum_evt_ApprovalForAll_doc %} + +The `erc721_ethereum.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the ethereum blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the ethereum network. + +{% enddocs %} + +{% docs ethereum_withdrawals_doc %} +The `ethereum.withdrawals` table is not yet documented. TBD +{% enddocs %} + + diff --git a/sources/_base_sources/evm/fantom_base_sources.yml b/sources/_base_sources/evm/fantom_base_sources.yml new file mode 100644 index 00000000000..b3fc4ba5fc9 --- /dev/null +++ b/sources/_base_sources/evm/fantom_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # fantom Tables + - name: fantom + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/fantom/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("fantom_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including fantom fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in fantom)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/fantom/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("fantom_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/fantom/decoded/traces_decoded + short_description: The `fantom.traces_decoded` table contains decoded traces, including additional information fantomd on submitted smart contracts and their ABIs. + description: '{{ doc("fantom_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/fantom/raw/logs + short_description: The `fantom.logs` table contains information about event logs emitted by smart contracts on the fantom blockchain. + description: '{{ doc("fantom_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/fantom/decoded/logs_decoded + short_description: The `fantom.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("fantom_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/fantom/raw/blocks + short_description: The `fantom.blocks` table contains information about fantom blocks. Each row represents a single block. + description: '{{ doc("fantom_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the fantom unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in fantom)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in fantom)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in fantom)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for fantom)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for fantom)." + + + - name: contracts + meta: + docs_slug: /evm/fantom/raw/contracts + short_description: The `fantom.contracts` table tracks decoded contracts on fantom, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("fantom_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: fantom + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'fantom', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/fantom/raw/creation_traces + short_description: The `fantom.creation_traces` table contains information about contract creation traces on the fantom blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("fantom_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_fantom + description: "Transfer events for ERC20 tokens on fantom" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/fantom/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the fantom blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_fantom_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's fantom unit" + + - name: evt_approval + meta: + docs_slug: /evm/fantom/decoded/interfaces/erc20/evt_approval + short_description: The `fantom.evt_approval` table contains approval events for ERC20 tokens on fantom, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_fantom_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_fantom + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/fantom/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_fantom_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/fantom/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_fantom_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/fantom/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_fantom_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "fantom address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "fantom address of the token owner granting or revoking approval" + - name: operator + description: "fantom address being granted or revoked permission to operate all tokens" + + - name: erc721_fantom + description: '{{ doc("erc721_fantom_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/fantom/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_fantom_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/fantom/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `fantom.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the fantom blockchain. + description: '{{ doc("erc721_fantom_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/fantom_docs_block.md b/sources/_base_sources/evm/fantom_docs_block.md new file mode 100644 index 00000000000..8458380a410 --- /dev/null +++ b/sources/_base_sources/evm/fantom_docs_block.md @@ -0,0 +1,221 @@ +{% docs fantom_transactions_doc %} + +The `fantom.transactions` table contains detailed information about transactions on the fantom blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on fantom. + +{% enddocs %} + +{% docs fantom_traces_doc %} + +The `fantom.traces` table contains records of execution steps for transactions on the fantom blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the fantom network. + +{% enddocs %} + +{% docs fantom_traces_decoded_doc %} + +The `fantom.traces_decoded` table contains a subset of decoded traces from the fantom blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `fantom.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_fantom.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs fantom_logs_doc %} + +The `fantom.logs` table contains event logs emitted by smart contracts on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the fantom network. + +{% enddocs %} + +{% docs fantom_logs_decoded_doc %} + +The `fantom.logs_decoded` table contains a subset of decoded logs from the fantom blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `fantom.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_fantom.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs fantom_blocks_doc %} + +The `fantom.blocks` table contains information about fantom blocks. It provides essential data about each block in the fantom blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs fantom_contracts_doc %} + +The `fantom.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs fantom_creation_traces_doc %} + +The `fantom.creation_traces` table contains data about contract creation events on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the fantom network. It's essentially a filtered version of the `fantom.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_fantom_evt_transfer_doc %} + +The `erc20_fantom.evt_transfer` table contains Transfer events for ERC20 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the fantom network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_fantom_evt_approval_doc %} + +The `erc20_fantom.evt_approval` table contains Approval events for ERC20 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the fantom network. + +{% enddocs %} + +{% docs erc1155_fantom_evt_transfersingle_doc %} + +The `erc1155_fantom.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the fantom network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_fantom_evt_transferbatch_doc %} + +The `erc1155_fantom.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the fantom network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_fantom_evt_ApprovalForAll_doc %} + +The `erc1155_fantom.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the fantom network. + +{% enddocs %} + +{% docs erc721_fantom_evt_transfer_doc %} + +The `erc721_fantom.evt_transfer` table contains Transfer events for ERC721 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the fantom network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_fantom_evt_Approval_doc %} + +The `erc721_fantom.evt_Approval` table contains Approval events for ERC721 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the fantom network. + +{% enddocs %} + +{% docs erc721_fantom_evt_ApprovalForAll_doc %} + +The `erc721_fantom.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the fantom blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the fantom network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/gnosis_base_sources.yml b/sources/_base_sources/evm/gnosis_base_sources.yml new file mode 100644 index 00000000000..9bdae5048d5 --- /dev/null +++ b/sources/_base_sources/evm/gnosis_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # gnosis Tables + - name: gnosis + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/gnosis/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("gnosis_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including gnosis fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in gnosis)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/gnosis/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("gnosis_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/gnosis/decoded/traces_decoded + short_description: The `gnosis.traces_decoded` table contains decoded traces, including additional information gnosisd on submitted smart contracts and their ABIs. + description: '{{ doc("gnosis_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/gnosis/raw/logs + short_description: The `gnosis.logs` table contains information about event logs emitted by smart contracts on the gnosis blockchain. + description: '{{ doc("gnosis_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/gnosis/decoded/logs_decoded + short_description: The `gnosis.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("gnosis_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/gnosis/raw/blocks + short_description: The `gnosis.blocks` table contains information about gnosis blocks. Each row represents a single block. + description: '{{ doc("gnosis_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the gnosis unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in gnosis)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in gnosis)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in gnosis)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for gnosis)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for gnosis)." + + + - name: contracts + meta: + docs_slug: /evm/gnosis/raw/contracts + short_description: The `gnosis.contracts` table tracks decoded contracts on gnosis, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("gnosis_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: gnosis + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'gnosis', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/gnosis/raw/creation_traces + short_description: The `gnosis.creation_traces` table contains information about contract creation traces on the gnosis blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("gnosis_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_gnosis + description: "Transfer events for ERC20 tokens on gnosis" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/gnosis/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the gnosis blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_gnosis_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's gnosis unit" + + - name: evt_approval + meta: + docs_slug: /evm/gnosis/decoded/interfaces/erc20/evt_approval + short_description: The `gnosis.evt_approval` table contains approval events for ERC20 tokens on gnosis, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_gnosis_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_gnosis + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/gnosis/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_gnosis_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/gnosis/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_gnosis_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/gnosis/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_gnosis_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "gnosis address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "gnosis address of the token owner granting or revoking approval" + - name: operator + description: "gnosis address being granted or revoked permission to operate all tokens" + + - name: erc721_gnosis + description: '{{ doc("erc721_gnosis_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/gnosis/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_gnosis_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/gnosis/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `gnosis.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the gnosis blockchain. + description: '{{ doc("erc721_gnosis_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/gnosis_docs_block.md b/sources/_base_sources/evm/gnosis_docs_block.md new file mode 100644 index 00000000000..81d038dcda8 --- /dev/null +++ b/sources/_base_sources/evm/gnosis_docs_block.md @@ -0,0 +1,221 @@ +{% docs gnosis_transactions_doc %} + +The `gnosis.transactions` table contains detailed information about transactions on the gnosis blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on gnosis. + +{% enddocs %} + +{% docs gnosis_traces_doc %} + +The `gnosis.traces` table contains records of execution steps for transactions on the gnosis blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the gnosis network. + +{% enddocs %} + +{% docs gnosis_traces_decoded_doc %} + +The `gnosis.traces_decoded` table contains a subset of decoded traces from the gnosis blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `gnosis.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_gnosis.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs gnosis_logs_doc %} + +The `gnosis.logs` table contains event logs emitted by smart contracts on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the gnosis network. + +{% enddocs %} + +{% docs gnosis_logs_decoded_doc %} + +The `gnosis.logs_decoded` table contains a subset of decoded logs from the gnosis blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `gnosis.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_gnosis.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs gnosis_blocks_doc %} + +The `gnosis.blocks` table contains information about gnosis blocks. It provides essential data about each block in the gnosis blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs gnosis_contracts_doc %} + +The `gnosis.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs gnosis_creation_traces_doc %} + +The `gnosis.creation_traces` table contains data about contract creation events on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the gnosis network. It's essentially a filtered version of the `gnosis.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_gnosis_evt_transfer_doc %} + +The `erc20_gnosis.evt_transfer` table contains Transfer events for ERC20 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the gnosis network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_gnosis_evt_approval_doc %} + +The `erc20_gnosis.evt_approval` table contains Approval events for ERC20 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the gnosis network. + +{% enddocs %} + +{% docs erc1155_gnosis_evt_transfersingle_doc %} + +The `erc1155_gnosis.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the gnosis network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_gnosis_evt_transferbatch_doc %} + +The `erc1155_gnosis.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the gnosis network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_gnosis_evt_ApprovalForAll_doc %} + +The `erc1155_gnosis.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the gnosis network. + +{% enddocs %} + +{% docs erc721_gnosis_evt_transfer_doc %} + +The `erc721_gnosis.evt_transfer` table contains Transfer events for ERC721 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the gnosis network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_gnosis_evt_Approval_doc %} + +The `erc721_gnosis.evt_Approval` table contains Approval events for ERC721 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the gnosis network. + +{% enddocs %} + +{% docs erc721_gnosis_evt_ApprovalForAll_doc %} + +The `erc721_gnosis.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the gnosis blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the gnosis network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/goerli_base_sources.yml b/sources/_base_sources/evm/goerli_base_sources.yml new file mode 100644 index 00000000000..c6e1f15c505 --- /dev/null +++ b/sources/_base_sources/evm/goerli_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # goerli Tables + - name: goerli + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/goerli/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("goerli_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including goerli fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in goerli)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/goerli/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("goerli_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/goerli/decoded/traces_decoded + short_description: The `goerli.traces_decoded` table contains decoded traces, including additional information goerlid on submitted smart contracts and their ABIs. + description: '{{ doc("goerli_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/goerli/raw/logs + short_description: The `goerli.logs` table contains information about event logs emitted by smart contracts on the goerli blockchain. + description: '{{ doc("goerli_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/goerli/decoded/logs_decoded + short_description: The `goerli.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("goerli_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/goerli/raw/blocks + short_description: The `goerli.blocks` table contains information about goerli blocks. Each row represents a single block. + description: '{{ doc("goerli_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the goerli unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in goerli)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in goerli)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in goerli)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for goerli)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for goerli)." + + + - name: contracts + meta: + docs_slug: /evm/goerli/raw/contracts + short_description: The `goerli.contracts` table tracks decoded contracts on goerli, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("goerli_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: goerli + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'goerli', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/goerli/raw/creation_traces + short_description: The `goerli.creation_traces` table contains information about contract creation traces on the goerli blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("goerli_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_goerli + description: "Transfer events for ERC20 tokens on goerli" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/goerli/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the goerli blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_goerli_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's goerli unit" + + - name: evt_approval + meta: + docs_slug: /evm/goerli/decoded/interfaces/erc20/evt_approval + short_description: The `goerli.evt_approval` table contains approval events for ERC20 tokens on goerli, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_goerli_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_goerli + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/goerli/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_goerli_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/goerli/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_goerli_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/goerli/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_goerli_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "goerli address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "goerli address of the token owner granting or revoking approval" + - name: operator + description: "goerli address being granted or revoked permission to operate all tokens" + + - name: erc721_goerli + description: '{{ doc("erc721_goerli_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/goerli/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_goerli_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/goerli/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `goerli.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the goerli blockchain. + description: '{{ doc("erc721_goerli_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/goerli_docs_block.md b/sources/_base_sources/evm/goerli_docs_block.md new file mode 100644 index 00000000000..46de18f61f0 --- /dev/null +++ b/sources/_base_sources/evm/goerli_docs_block.md @@ -0,0 +1,221 @@ +{% docs goerli_transactions_doc %} + +The `goerli.transactions` table contains detailed information about transactions on the goerli blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on goerli. + +{% enddocs %} + +{% docs goerli_traces_doc %} + +The `goerli.traces` table contains records of execution steps for transactions on the goerli blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the goerli network. + +{% enddocs %} + +{% docs goerli_traces_decoded_doc %} + +The `goerli.traces_decoded` table contains a subset of decoded traces from the goerli blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `goerli.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_goerli.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs goerli_logs_doc %} + +The `goerli.logs` table contains event logs emitted by smart contracts on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the goerli network. + +{% enddocs %} + +{% docs goerli_logs_decoded_doc %} + +The `goerli.logs_decoded` table contains a subset of decoded logs from the goerli blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `goerli.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_goerli.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs goerli_blocks_doc %} + +The `goerli.blocks` table contains information about goerli blocks. It provides essential data about each block in the goerli blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs goerli_contracts_doc %} + +The `goerli.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs goerli_creation_traces_doc %} + +The `goerli.creation_traces` table contains data about contract creation events on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the goerli network. It's essentially a filtered version of the `goerli.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_goerli_evt_transfer_doc %} + +The `erc20_goerli.evt_transfer` table contains Transfer events for ERC20 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the goerli network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_goerli_evt_approval_doc %} + +The `erc20_goerli.evt_approval` table contains Approval events for ERC20 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the goerli network. + +{% enddocs %} + +{% docs erc1155_goerli_evt_transfersingle_doc %} + +The `erc1155_goerli.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the goerli network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_goerli_evt_transferbatch_doc %} + +The `erc1155_goerli.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the goerli network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_goerli_evt_ApprovalForAll_doc %} + +The `erc1155_goerli.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the goerli network. + +{% enddocs %} + +{% docs erc721_goerli_evt_transfer_doc %} + +The `erc721_goerli.evt_transfer` table contains Transfer events for ERC721 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the goerli network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_goerli_evt_Approval_doc %} + +The `erc721_goerli.evt_Approval` table contains Approval events for ERC721 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the goerli network. + +{% enddocs %} + +{% docs erc721_goerli_evt_ApprovalForAll_doc %} + +The `erc721_goerli.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the goerli blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the goerli network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/linea_base_sources.yml b/sources/_base_sources/evm/linea_base_sources.yml new file mode 100644 index 00000000000..d4afa1f7c5d --- /dev/null +++ b/sources/_base_sources/evm/linea_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # linea Tables + - name: linea + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/linea/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("linea_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including linea fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in linea)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/linea/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("linea_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/linea/decoded/traces_decoded + short_description: The `linea.traces_decoded` table contains decoded traces, including additional information linead on submitted smart contracts and their ABIs. + description: '{{ doc("linea_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/linea/raw/logs + short_description: The `linea.logs` table contains information about event logs emitted by smart contracts on the linea blockchain. + description: '{{ doc("linea_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/linea/decoded/logs_decoded + short_description: The `linea.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("linea_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/linea/raw/blocks + short_description: The `linea.blocks` table contains information about linea blocks. Each row represents a single block. + description: '{{ doc("linea_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the linea unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in linea)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in linea)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in linea)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for linea)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for linea)." + + + - name: contracts + meta: + docs_slug: /evm/linea/raw/contracts + short_description: The `linea.contracts` table tracks decoded contracts on linea, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("linea_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: linea + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'linea', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/linea/raw/creation_traces + short_description: The `linea.creation_traces` table contains information about contract creation traces on the linea blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("linea_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_linea + description: "Transfer events for ERC20 tokens on linea" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/linea/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the linea blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_linea_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's linea unit" + + - name: evt_approval + meta: + docs_slug: /evm/linea/decoded/interfaces/erc20/evt_approval + short_description: The `linea.evt_approval` table contains approval events for ERC20 tokens on linea, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_linea_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_linea + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/linea/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_linea_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/linea/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_linea_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/linea/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_linea_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "linea address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "linea address of the token owner granting or revoking approval" + - name: operator + description: "linea address being granted or revoked permission to operate all tokens" + + - name: erc721_linea + description: '{{ doc("erc721_linea_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/linea/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_linea_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/linea/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `linea.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the linea blockchain. + description: '{{ doc("erc721_linea_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/linea_docs_block.md b/sources/_base_sources/evm/linea_docs_block.md new file mode 100644 index 00000000000..832a4f3aaae --- /dev/null +++ b/sources/_base_sources/evm/linea_docs_block.md @@ -0,0 +1,221 @@ +{% docs linea_transactions_doc %} + +The `linea.transactions` table contains detailed information about transactions on the linea blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on linea. + +{% enddocs %} + +{% docs linea_traces_doc %} + +The `linea.traces` table contains records of execution steps for transactions on the linea blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the linea network. + +{% enddocs %} + +{% docs linea_traces_decoded_doc %} + +The `linea.traces_decoded` table contains a subset of decoded traces from the linea blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `linea.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_linea.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs linea_logs_doc %} + +The `linea.logs` table contains event logs emitted by smart contracts on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the linea network. + +{% enddocs %} + +{% docs linea_logs_decoded_doc %} + +The `linea.logs_decoded` table contains a subset of decoded logs from the linea blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `linea.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_linea.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs linea_blocks_doc %} + +The `linea.blocks` table contains information about linea blocks. It provides essential data about each block in the linea blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs linea_contracts_doc %} + +The `linea.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs linea_creation_traces_doc %} + +The `linea.creation_traces` table contains data about contract creation events on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the linea network. It's essentially a filtered version of the `linea.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_linea_evt_transfer_doc %} + +The `erc20_linea.evt_transfer` table contains Transfer events for ERC20 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the linea network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_linea_evt_approval_doc %} + +The `erc20_linea.evt_approval` table contains Approval events for ERC20 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the linea network. + +{% enddocs %} + +{% docs erc1155_linea_evt_transfersingle_doc %} + +The `erc1155_linea.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the linea network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_linea_evt_transferbatch_doc %} + +The `erc1155_linea.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the linea network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_linea_evt_ApprovalForAll_doc %} + +The `erc1155_linea.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the linea network. + +{% enddocs %} + +{% docs erc721_linea_evt_transfer_doc %} + +The `erc721_linea.evt_transfer` table contains Transfer events for ERC721 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the linea network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_linea_evt_Approval_doc %} + +The `erc721_linea.evt_Approval` table contains Approval events for ERC721 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the linea network. + +{% enddocs %} + +{% docs erc721_linea_evt_ApprovalForAll_doc %} + +The `erc721_linea.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the linea blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the linea network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/mantle_base_sources.yml b/sources/_base_sources/evm/mantle_base_sources.yml new file mode 100644 index 00000000000..3dbbbddf8e4 --- /dev/null +++ b/sources/_base_sources/evm/mantle_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # mantle Tables + - name: mantle + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/mantle/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("mantle_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including mantle fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in mantle)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/mantle/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("mantle_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/mantle/decoded/traces_decoded + short_description: The `mantle.traces_decoded` table contains decoded traces, including additional information mantled on submitted smart contracts and their ABIs. + description: '{{ doc("mantle_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/mantle/raw/logs + short_description: The `mantle.logs` table contains information about event logs emitted by smart contracts on the mantle blockchain. + description: '{{ doc("mantle_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/mantle/decoded/logs_decoded + short_description: The `mantle.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("mantle_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/mantle/raw/blocks + short_description: The `mantle.blocks` table contains information about mantle blocks. Each row represents a single block. + description: '{{ doc("mantle_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the mantle unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in mantle)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in mantle)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in mantle)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for mantle)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for mantle)." + + + - name: contracts + meta: + docs_slug: /evm/mantle/raw/contracts + short_description: The `mantle.contracts` table tracks decoded contracts on mantle, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("mantle_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: mantle + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'mantle', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/mantle/raw/creation_traces + short_description: The `mantle.creation_traces` table contains information about contract creation traces on the mantle blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("mantle_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_mantle + description: "Transfer events for ERC20 tokens on mantle" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/mantle/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the mantle blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_mantle_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's mantle unit" + + - name: evt_approval + meta: + docs_slug: /evm/mantle/decoded/interfaces/erc20/evt_approval + short_description: The `mantle.evt_approval` table contains approval events for ERC20 tokens on mantle, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_mantle_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_mantle + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/mantle/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_mantle_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/mantle/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_mantle_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/mantle/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_mantle_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "mantle address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "mantle address of the token owner granting or revoking approval" + - name: operator + description: "mantle address being granted or revoked permission to operate all tokens" + + - name: erc721_mantle + description: '{{ doc("erc721_mantle_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/mantle/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_mantle_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/mantle/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `mantle.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the mantle blockchain. + description: '{{ doc("erc721_mantle_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/mantle_docs_block.md b/sources/_base_sources/evm/mantle_docs_block.md new file mode 100644 index 00000000000..95c245d8ffd --- /dev/null +++ b/sources/_base_sources/evm/mantle_docs_block.md @@ -0,0 +1,221 @@ +{% docs mantle_transactions_doc %} + +The `mantle.transactions` table contains detailed information about transactions on the mantle blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on mantle. + +{% enddocs %} + +{% docs mantle_traces_doc %} + +The `mantle.traces` table contains records of execution steps for transactions on the mantle blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the mantle network. + +{% enddocs %} + +{% docs mantle_traces_decoded_doc %} + +The `mantle.traces_decoded` table contains a subset of decoded traces from the mantle blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `mantle.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_mantle.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs mantle_logs_doc %} + +The `mantle.logs` table contains event logs emitted by smart contracts on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the mantle network. + +{% enddocs %} + +{% docs mantle_logs_decoded_doc %} + +The `mantle.logs_decoded` table contains a subset of decoded logs from the mantle blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `mantle.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_mantle.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs mantle_blocks_doc %} + +The `mantle.blocks` table contains information about mantle blocks. It provides essential data about each block in the mantle blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs mantle_contracts_doc %} + +The `mantle.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs mantle_creation_traces_doc %} + +The `mantle.creation_traces` table contains data about contract creation events on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the mantle network. It's essentially a filtered version of the `mantle.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_mantle_evt_transfer_doc %} + +The `erc20_mantle.evt_transfer` table contains Transfer events for ERC20 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the mantle network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_mantle_evt_approval_doc %} + +The `erc20_mantle.evt_approval` table contains Approval events for ERC20 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the mantle network. + +{% enddocs %} + +{% docs erc1155_mantle_evt_transfersingle_doc %} + +The `erc1155_mantle.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the mantle network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_mantle_evt_transferbatch_doc %} + +The `erc1155_mantle.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the mantle network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_mantle_evt_ApprovalForAll_doc %} + +The `erc1155_mantle.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the mantle network. + +{% enddocs %} + +{% docs erc721_mantle_evt_transfer_doc %} + +The `erc721_mantle.evt_transfer` table contains Transfer events for ERC721 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the mantle network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_mantle_evt_Approval_doc %} + +The `erc721_mantle.evt_Approval` table contains Approval events for ERC721 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the mantle network. + +{% enddocs %} + +{% docs erc721_mantle_evt_ApprovalForAll_doc %} + +The `erc721_mantle.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the mantle blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the mantle network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/mode_base_sources.yml b/sources/_base_sources/evm/mode_base_sources.yml new file mode 100644 index 00000000000..d1907e2b930 --- /dev/null +++ b/sources/_base_sources/evm/mode_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # mode Tables + - name: mode + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/mode/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("mode_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including mode fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in mode)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/mode/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("mode_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/mode/decoded/traces_decoded + short_description: The `mode.traces_decoded` table contains decoded traces, including additional information moded on submitted smart contracts and their ABIs. + description: '{{ doc("mode_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/mode/raw/logs + short_description: The `mode.logs` table contains information about event logs emitted by smart contracts on the mode blockchain. + description: '{{ doc("mode_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/mode/decoded/logs_decoded + short_description: The `mode.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("mode_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/mode/raw/blocks + short_description: The `mode.blocks` table contains information about mode blocks. Each row represents a single block. + description: '{{ doc("mode_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the mode unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in mode)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in mode)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in mode)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for mode)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for mode)." + + + - name: contracts + meta: + docs_slug: /evm/mode/raw/contracts + short_description: The `mode.contracts` table tracks decoded contracts on mode, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("mode_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: mode + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'mode', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/mode/raw/creation_traces + short_description: The `mode.creation_traces` table contains information about contract creation traces on the mode blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("mode_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_mode + description: "Transfer events for ERC20 tokens on mode" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/mode/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the mode blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_mode_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's mode unit" + + - name: evt_approval + meta: + docs_slug: /evm/mode/decoded/interfaces/erc20/evt_approval + short_description: The `mode.evt_approval` table contains approval events for ERC20 tokens on mode, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_mode_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_mode + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/mode/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_mode_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/mode/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_mode_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/mode/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_mode_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "mode address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "mode address of the token owner granting or revoking approval" + - name: operator + description: "mode address being granted or revoked permission to operate all tokens" + + - name: erc721_mode + description: '{{ doc("erc721_mode_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/mode/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_mode_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/mode/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `mode.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the mode blockchain. + description: '{{ doc("erc721_mode_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/mode_docs_block.md b/sources/_base_sources/evm/mode_docs_block.md new file mode 100644 index 00000000000..f5b6c02d1df --- /dev/null +++ b/sources/_base_sources/evm/mode_docs_block.md @@ -0,0 +1,221 @@ +{% docs mode_transactions_doc %} + +The `mode.transactions` table contains detailed information about transactions on the mode blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on mode. + +{% enddocs %} + +{% docs mode_traces_doc %} + +The `mode.traces` table contains records of execution steps for transactions on the mode blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the mode network. + +{% enddocs %} + +{% docs mode_traces_decoded_doc %} + +The `mode.traces_decoded` table contains a subset of decoded traces from the mode blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `mode.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_mode.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs mode_logs_doc %} + +The `mode.logs` table contains event logs emitted by smart contracts on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the mode network. + +{% enddocs %} + +{% docs mode_logs_decoded_doc %} + +The `mode.logs_decoded` table contains a subset of decoded logs from the mode blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `mode.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_mode.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs mode_blocks_doc %} + +The `mode.blocks` table contains information about mode blocks. It provides essential data about each block in the mode blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs mode_contracts_doc %} + +The `mode.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs mode_creation_traces_doc %} + +The `mode.creation_traces` table contains data about contract creation events on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the mode network. It's essentially a filtered version of the `mode.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_mode_evt_transfer_doc %} + +The `erc20_mode.evt_transfer` table contains Transfer events for ERC20 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the mode network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_mode_evt_approval_doc %} + +The `erc20_mode.evt_approval` table contains Approval events for ERC20 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the mode network. + +{% enddocs %} + +{% docs erc1155_mode_evt_transfersingle_doc %} + +The `erc1155_mode.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the mode network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_mode_evt_transferbatch_doc %} + +The `erc1155_mode.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the mode network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_mode_evt_ApprovalForAll_doc %} + +The `erc1155_mode.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the mode network. + +{% enddocs %} + +{% docs erc721_mode_evt_transfer_doc %} + +The `erc721_mode.evt_transfer` table contains Transfer events for ERC721 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the mode network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_mode_evt_Approval_doc %} + +The `erc721_mode.evt_Approval` table contains Approval events for ERC721 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the mode network. + +{% enddocs %} + +{% docs erc721_mode_evt_ApprovalForAll_doc %} + +The `erc721_mode.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the mode blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the mode network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/optimism_base_sources.yml b/sources/_base_sources/evm/optimism_base_sources.yml new file mode 100644 index 00000000000..62e3a112db7 --- /dev/null +++ b/sources/_base_sources/evm/optimism_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # optimism Tables + - name: optimism + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/optimism/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("optimism_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including optimism fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in optimism)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/optimism/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("optimism_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/optimism/decoded/traces_decoded + short_description: The `optimism.traces_decoded` table contains decoded traces, including additional information optimismd on submitted smart contracts and their ABIs. + description: '{{ doc("optimism_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/optimism/raw/logs + short_description: The `optimism.logs` table contains information about event logs emitted by smart contracts on the optimism blockchain. + description: '{{ doc("optimism_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/optimism/decoded/logs_decoded + short_description: The `optimism.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("optimism_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/optimism/raw/blocks + short_description: The `optimism.blocks` table contains information about optimism blocks. Each row represents a single block. + description: '{{ doc("optimism_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the optimism unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in optimism)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in optimism)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in optimism)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for optimism)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for optimism)." + + + - name: contracts + meta: + docs_slug: /evm/optimism/raw/contracts + short_description: The `optimism.contracts` table tracks decoded contracts on optimism, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("optimism_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: optimism + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'optimism', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/optimism/raw/creation_traces + short_description: The `optimism.creation_traces` table contains information about contract creation traces on the optimism blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("optimism_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_optimism + description: "Transfer events for ERC20 tokens on optimism" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/optimism/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the optimism blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_optimism_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's optimism unit" + + - name: evt_Approval + meta: + docs_slug: /evm/optimism/decoded/interfaces/erc20/evt_approval + short_description: The `optimism.evt_approval` table contains approval events for ERC20 tokens on optimism, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_optimism_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_optimism + description: "events related to ERC1155 tokens" + tables: + - name: evt_TransferSingle + meta: + docs_slug: /evm/optimism/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_optimism_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_TransferBatch + meta: + docs_slug: /evm/optimism/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_optimism_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/optimism/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_optimism_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "optimism address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "optimism address of the token owner granting or revoking approval" + - name: operator + description: "optimism address being granted or revoked permission to operate all tokens" + + - name: erc721_optimism + description: '{{ doc("erc721_optimism_evt_transfer_doc") }}' + tables: + - name: evt_Transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/optimism/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_optimism_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/optimism/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `optimism.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the optimism blockchain. + description: '{{ doc("erc721_optimism_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/optimism_docs_block.md b/sources/_base_sources/evm/optimism_docs_block.md new file mode 100644 index 00000000000..9720839f530 --- /dev/null +++ b/sources/_base_sources/evm/optimism_docs_block.md @@ -0,0 +1,221 @@ +{% docs optimism_transactions_doc %} + +The `optimism.transactions` table contains detailed information about transactions on the optimism blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on optimism. + +{% enddocs %} + +{% docs optimism_traces_doc %} + +The `optimism.traces` table contains records of execution steps for transactions on the optimism blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the optimism network. + +{% enddocs %} + +{% docs optimism_traces_decoded_doc %} + +The `optimism.traces_decoded` table contains a subset of decoded traces from the optimism blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `optimism.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_optimism.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs optimism_logs_doc %} + +The `optimism.logs` table contains event logs emitted by smart contracts on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the optimism network. + +{% enddocs %} + +{% docs optimism_logs_decoded_doc %} + +The `optimism.logs_decoded` table contains a subset of decoded logs from the optimism blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `optimism.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_optimism.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs optimism_blocks_doc %} + +The `optimism.blocks` table contains information about optimism blocks. It provides essential data about each block in the optimism blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs optimism_contracts_doc %} + +The `optimism.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs optimism_creation_traces_doc %} + +The `optimism.creation_traces` table contains data about contract creation events on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the optimism network. It's essentially a filtered version of the `optimism.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_optimism_evt_transfer_doc %} + +The `erc20_optimism.evt_transfer` table contains Transfer events for ERC20 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the optimism network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_optimism_evt_approval_doc %} + +The `erc20_optimism.evt_approval` table contains Approval events for ERC20 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the optimism network. + +{% enddocs %} + +{% docs erc1155_optimism_evt_transfersingle_doc %} + +The `erc1155_optimism.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the optimism network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_optimism_evt_transferbatch_doc %} + +The `erc1155_optimism.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the optimism network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_optimism_evt_ApprovalForAll_doc %} + +The `erc1155_optimism.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the optimism network. + +{% enddocs %} + +{% docs erc721_optimism_evt_transfer_doc %} + +The `erc721_optimism.evt_transfer` table contains Transfer events for ERC721 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the optimism network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_optimism_evt_Approval_doc %} + +The `erc721_optimism.evt_Approval` table contains Approval events for ERC721 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the optimism network. + +{% enddocs %} + +{% docs erc721_optimism_evt_ApprovalForAll_doc %} + +The `erc721_optimism.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the optimism blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the optimism network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/polygon_base_sources.yml b/sources/_base_sources/evm/polygon_base_sources.yml new file mode 100644 index 00000000000..aea25200b50 --- /dev/null +++ b/sources/_base_sources/evm/polygon_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # polygon Tables + - name: polygon + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/polygon/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("polygon_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including polygon fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in polygon)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/polygon/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("polygon_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/polygon/decoded/traces_decoded + short_description: The `polygon.traces_decoded` table contains decoded traces, including additional information polygond on submitted smart contracts and their ABIs. + description: '{{ doc("polygon_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/polygon/raw/logs + short_description: The `polygon.logs` table contains information about event logs emitted by smart contracts on the polygon blockchain. + description: '{{ doc("polygon_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/polygon/decoded/logs_decoded + short_description: The `polygon.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("polygon_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/polygon/raw/blocks + short_description: The `polygon.blocks` table contains information about polygon blocks. Each row represents a single block. + description: '{{ doc("polygon_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the polygon unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in polygon)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in polygon)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in polygon)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for polygon)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for polygon)." + + + - name: contracts + meta: + docs_slug: /evm/polygon/raw/contracts + short_description: The `polygon.contracts` table tracks decoded contracts on polygon, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("polygon_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: polygon + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'polygon', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/polygon/raw/creation_traces + short_description: The `polygon.creation_traces` table contains information about contract creation traces on the polygon blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("polygon_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_polygon + description: "Transfer events for ERC20 tokens on polygon" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/polygon/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the polygon blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_polygon_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's polygon unit" + + - name: evt_approval + meta: + docs_slug: /evm/polygon/decoded/interfaces/erc20/evt_approval + short_description: The `polygon.evt_approval` table contains approval events for ERC20 tokens on polygon, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_polygon_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_polygon + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/polygon/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_polygon_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/polygon/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_polygon_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/polygon/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_polygon_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "polygon address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "polygon address of the token owner granting or revoking approval" + - name: operator + description: "polygon address being granted or revoked permission to operate all tokens" + + - name: erc721_polygon + description: '{{ doc("erc721_polygon_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/polygon/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_polygon_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/polygon/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `polygon.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the polygon blockchain. + description: '{{ doc("erc721_polygon_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/polygon_docs_block.md b/sources/_base_sources/evm/polygon_docs_block.md new file mode 100644 index 00000000000..45720ebfb83 --- /dev/null +++ b/sources/_base_sources/evm/polygon_docs_block.md @@ -0,0 +1,221 @@ +{% docs polygon_transactions_doc %} + +The `polygon.transactions` table contains detailed information about transactions on the polygon blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on polygon. + +{% enddocs %} + +{% docs polygon_traces_doc %} + +The `polygon.traces` table contains records of execution steps for transactions on the polygon blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the polygon network. + +{% enddocs %} + +{% docs polygon_traces_decoded_doc %} + +The `polygon.traces_decoded` table contains a subset of decoded traces from the polygon blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `polygon.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_polygon.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs polygon_logs_doc %} + +The `polygon.logs` table contains event logs emitted by smart contracts on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the polygon network. + +{% enddocs %} + +{% docs polygon_logs_decoded_doc %} + +The `polygon.logs_decoded` table contains a subset of decoded logs from the polygon blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `polygon.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_polygon.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs polygon_blocks_doc %} + +The `polygon.blocks` table contains information about polygon blocks. It provides essential data about each block in the polygon blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs polygon_contracts_doc %} + +The `polygon.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs polygon_creation_traces_doc %} + +The `polygon.creation_traces` table contains data about contract creation events on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the polygon network. It's essentially a filtered version of the `polygon.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_polygon_evt_transfer_doc %} + +The `erc20_polygon.evt_transfer` table contains Transfer events for ERC20 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the polygon network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_polygon_evt_approval_doc %} + +The `erc20_polygon.evt_approval` table contains Approval events for ERC20 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the polygon network. + +{% enddocs %} + +{% docs erc1155_polygon_evt_transfersingle_doc %} + +The `erc1155_polygon.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the polygon network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_polygon_evt_transferbatch_doc %} + +The `erc1155_polygon.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the polygon network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_polygon_evt_ApprovalForAll_doc %} + +The `erc1155_polygon.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the polygon network. + +{% enddocs %} + +{% docs erc721_polygon_evt_transfer_doc %} + +The `erc721_polygon.evt_transfer` table contains Transfer events for ERC721 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the polygon network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_polygon_evt_Approval_doc %} + +The `erc721_polygon.evt_Approval` table contains Approval events for ERC721 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the polygon network. + +{% enddocs %} + +{% docs erc721_polygon_evt_ApprovalForAll_doc %} + +The `erc721_polygon.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the polygon blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the polygon network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/scroll_base_sources.yml b/sources/_base_sources/evm/scroll_base_sources.yml new file mode 100644 index 00000000000..de74e1ee24e --- /dev/null +++ b/sources/_base_sources/evm/scroll_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # scroll Tables + - name: scroll + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/scroll/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("scroll_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including scroll fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in scroll)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/scroll/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("scroll_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/scroll/decoded/traces_decoded + short_description: The `scroll.traces_decoded` table contains decoded traces, including additional information scrolld on submitted smart contracts and their ABIs. + description: '{{ doc("scroll_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/scroll/raw/logs + short_description: The `scroll.logs` table contains information about event logs emitted by smart contracts on the scroll blockchain. + description: '{{ doc("scroll_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/scroll/decoded/logs_decoded + short_description: The `scroll.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("scroll_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/scroll/raw/blocks + short_description: The `scroll.blocks` table contains information about scroll blocks. Each row represents a single block. + description: '{{ doc("scroll_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the scroll unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in scroll)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in scroll)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in scroll)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for scroll)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for scroll)." + + + - name: contracts + meta: + docs_slug: /evm/scroll/raw/contracts + short_description: The `scroll.contracts` table tracks decoded contracts on scroll, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("scroll_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: scroll + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'scroll', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/scroll/raw/creation_traces + short_description: The `scroll.creation_traces` table contains information about contract creation traces on the scroll blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("scroll_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_scroll + description: "Transfer events for ERC20 tokens on scroll" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/scroll/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the scroll blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_scroll_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's scroll unit" + + - name: evt_approval + meta: + docs_slug: /evm/scroll/decoded/interfaces/erc20/evt_approval + short_description: The `scroll.evt_approval` table contains approval events for ERC20 tokens on scroll, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_scroll_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_scroll + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/scroll/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_scroll_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/scroll/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_scroll_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/scroll/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_scroll_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "scroll address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "scroll address of the token owner granting or revoking approval" + - name: operator + description: "scroll address being granted or revoked permission to operate all tokens" + + - name: erc721_scroll + description: '{{ doc("erc721_scroll_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/scroll/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_scroll_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/scroll/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `scroll.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the scroll blockchain. + description: '{{ doc("erc721_scroll_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/scroll_docs_block.md b/sources/_base_sources/evm/scroll_docs_block.md new file mode 100644 index 00000000000..a986749fef5 --- /dev/null +++ b/sources/_base_sources/evm/scroll_docs_block.md @@ -0,0 +1,221 @@ +{% docs scroll_transactions_doc %} + +The `scroll.transactions` table contains detailed information about transactions on the scroll blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on scroll. + +{% enddocs %} + +{% docs scroll_traces_doc %} + +The `scroll.traces` table contains records of execution steps for transactions on the scroll blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the scroll network. + +{% enddocs %} + +{% docs scroll_traces_decoded_doc %} + +The `scroll.traces_decoded` table contains a subset of decoded traces from the scroll blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `scroll.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_scroll.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs scroll_logs_doc %} + +The `scroll.logs` table contains event logs emitted by smart contracts on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the scroll network. + +{% enddocs %} + +{% docs scroll_logs_decoded_doc %} + +The `scroll.logs_decoded` table contains a subset of decoded logs from the scroll blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `scroll.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_scroll.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs scroll_blocks_doc %} + +The `scroll.blocks` table contains information about scroll blocks. It provides essential data about each block in the scroll blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs scroll_contracts_doc %} + +The `scroll.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs scroll_creation_traces_doc %} + +The `scroll.creation_traces` table contains data about contract creation events on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the scroll network. It's essentially a filtered version of the `scroll.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_scroll_evt_transfer_doc %} + +The `erc20_scroll.evt_transfer` table contains Transfer events for ERC20 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the scroll network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_scroll_evt_approval_doc %} + +The `erc20_scroll.evt_approval` table contains Approval events for ERC20 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the scroll network. + +{% enddocs %} + +{% docs erc1155_scroll_evt_transfersingle_doc %} + +The `erc1155_scroll.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the scroll network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_scroll_evt_transferbatch_doc %} + +The `erc1155_scroll.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the scroll network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_scroll_evt_ApprovalForAll_doc %} + +The `erc1155_scroll.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the scroll network. + +{% enddocs %} + +{% docs erc721_scroll_evt_transfer_doc %} + +The `erc721_scroll.evt_transfer` table contains Transfer events for ERC721 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the scroll network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_scroll_evt_Approval_doc %} + +The `erc721_scroll.evt_Approval` table contains Approval events for ERC721 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the scroll network. + +{% enddocs %} + +{% docs erc721_scroll_evt_ApprovalForAll_doc %} + +The `erc721_scroll.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the scroll blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the scroll network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/sei_base_sources.yml b/sources/_base_sources/evm/sei_base_sources.yml new file mode 100644 index 00000000000..132cfad584d --- /dev/null +++ b/sources/_base_sources/evm/sei_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # sei Tables + - name: sei + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/sei/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("sei_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including sei fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in sei)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/sei/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("sei_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/sei/decoded/traces_decoded + short_description: The `sei.traces_decoded` table contains decoded traces, including additional information seid on submitted smart contracts and their ABIs. + description: '{{ doc("sei_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/sei/raw/logs + short_description: The `sei.logs` table contains information about event logs emitted by smart contracts on the sei blockchain. + description: '{{ doc("sei_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/sei/decoded/logs_decoded + short_description: The `sei.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("sei_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/sei/raw/blocks + short_description: The `sei.blocks` table contains information about sei blocks. Each row represents a single block. + description: '{{ doc("sei_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the sei unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in sei)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in sei)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in sei)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for sei)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for sei)." + + + - name: contracts + meta: + docs_slug: /evm/sei/raw/contracts + short_description: The `sei.contracts` table tracks decoded contracts on sei, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("sei_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: sei + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'sei', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/sei/raw/creation_traces + short_description: The `sei.creation_traces` table contains information about contract creation traces on the sei blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("sei_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_sei + description: "Transfer events for ERC20 tokens on sei" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/sei/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the sei blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_sei_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's sei unit" + + - name: evt_Approval + meta: + docs_slug: /evm/sei/decoded/interfaces/erc20/evt_approval + short_description: The `sei.evt_approval` table contains approval events for ERC20 tokens on sei, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_sei_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_sei + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/sei/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_sei_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/sei/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_sei_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/sei/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_sei_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "sei address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "sei address of the token owner granting or revoking approval" + - name: operator + description: "sei address being granted or revoked permission to operate all tokens" + + - name: erc721_sei + description: '{{ doc("erc721_sei_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/sei/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_sei_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/sei/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `sei.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the sei blockchain. + description: '{{ doc("erc721_sei_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/sei_docs_block.md b/sources/_base_sources/evm/sei_docs_block.md new file mode 100644 index 00000000000..c26e7849dc5 --- /dev/null +++ b/sources/_base_sources/evm/sei_docs_block.md @@ -0,0 +1,221 @@ +{% docs sei_transactions_doc %} + +The `sei.transactions` table contains detailed information about transactions on the sei blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on sei. + +{% enddocs %} + +{% docs sei_traces_doc %} + +The `sei.traces` table contains records of execution steps for transactions on the sei blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the sei network. + +{% enddocs %} + +{% docs sei_traces_decoded_doc %} + +The `sei.traces_decoded` table contains a subset of decoded traces from the sei blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `sei.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_sei.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs sei_logs_doc %} + +The `sei.logs` table contains event logs emitted by smart contracts on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the sei network. + +{% enddocs %} + +{% docs sei_logs_decoded_doc %} + +The `sei.logs_decoded` table contains a subset of decoded logs from the sei blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `sei.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_sei.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs sei_blocks_doc %} + +The `sei.blocks` table contains information about sei blocks. It provides essential data about each block in the sei blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs sei_contracts_doc %} + +The `sei.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs sei_creation_traces_doc %} + +The `sei.creation_traces` table contains data about contract creation events on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the sei network. It's essentially a filtered version of the `sei.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_sei_evt_transfer_doc %} + +The `erc20_sei.evt_transfer` table contains Transfer events for ERC20 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the sei network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_sei_evt_approval_doc %} + +The `erc20_sei.evt_approval` table contains Approval events for ERC20 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the sei network. + +{% enddocs %} + +{% docs erc1155_sei_evt_transfersingle_doc %} + +The `erc1155_sei.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the sei network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_sei_evt_transferbatch_doc %} + +The `erc1155_sei.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the sei network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_sei_evt_ApprovalForAll_doc %} + +The `erc1155_sei.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the sei network. + +{% enddocs %} + +{% docs erc721_sei_evt_transfer_doc %} + +The `erc721_sei.evt_transfer` table contains Transfer events for ERC721 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the sei network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_sei_evt_Approval_doc %} + +The `erc721_sei.evt_Approval` table contains Approval events for ERC721 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the sei network. + +{% enddocs %} + +{% docs erc721_sei_evt_ApprovalForAll_doc %} + +The `erc721_sei.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the sei blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the sei network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/zkevm_base_sources.yml b/sources/_base_sources/evm/zkevm_base_sources.yml new file mode 100644 index 00000000000..bfffcee1dc0 --- /dev/null +++ b/sources/_base_sources/evm/zkevm_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # zkevm Tables + - name: zkevm + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/zkevm/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("zkevm_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including zkevm fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in zkevm)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/zkevm/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("zkevm_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/zkevm/decoded/traces_decoded + short_description: The `zkevm.traces_decoded` table contains decoded traces, including additional information zkevmd on submitted smart contracts and their ABIs. + description: '{{ doc("zkevm_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/zkevm/raw/logs + short_description: The `zkevm.logs` table contains information about event logs emitted by smart contracts on the zkevm blockchain. + description: '{{ doc("zkevm_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/zkevm/decoded/logs_decoded + short_description: The `zkevm.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("zkevm_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/zkevm/raw/blocks + short_description: The `zkevm.blocks` table contains information about zkevm blocks. Each row represents a single block. + description: '{{ doc("zkevm_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the zkevm unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in zkevm)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in zkevm)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in zkevm)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for zkevm)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for zkevm)." + + + - name: contracts + meta: + docs_slug: /evm/zkevm/raw/contracts + short_description: The `zkevm.contracts` table tracks decoded contracts on zkevm, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("zkevm_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: zkevm + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'zkevm', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/zkevm/raw/creation_traces + short_description: The `zkevm.creation_traces` table contains information about contract creation traces on the zkevm blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("zkevm_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_zkevm + description: "Transfer events for ERC20 tokens on zkevm" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/zkevm/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the zkevm blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_zkevm_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's zkevm unit" + + - name: evt_approval + meta: + docs_slug: /evm/zkevm/decoded/interfaces/erc20/evt_approval + short_description: The `zkevm.evt_approval` table contains approval events for ERC20 tokens on zkevm, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_zkevm_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_zkevm + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/zkevm/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_zkevm_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/zkevm/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_zkevm_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/zkevm/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_zkevm_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "zkevm address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "zkevm address of the token owner granting or revoking approval" + - name: operator + description: "zkevm address being granted or revoked permission to operate all tokens" + + - name: erc721_zkevm + description: '{{ doc("erc721_zkevm_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/zkevm/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_zkevm_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/zkevm/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `zkevm.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the zkevm blockchain. + description: '{{ doc("erc721_zkevm_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/zkevm_docs_block.md b/sources/_base_sources/evm/zkevm_docs_block.md new file mode 100644 index 00000000000..da740886f5b --- /dev/null +++ b/sources/_base_sources/evm/zkevm_docs_block.md @@ -0,0 +1,221 @@ +{% docs zkevm_transactions_doc %} + +The `zkevm.transactions` table contains detailed information about transactions on the zkevm blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on zkevm. + +{% enddocs %} + +{% docs zkevm_traces_doc %} + +The `zkevm.traces` table contains records of execution steps for transactions on the zkevm blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the zkevm network. + +{% enddocs %} + +{% docs zkevm_traces_decoded_doc %} + +The `zkevm.traces_decoded` table contains a subset of decoded traces from the zkevm blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `zkevm.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_zkevm.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs zkevm_logs_doc %} + +The `zkevm.logs` table contains event logs emitted by smart contracts on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the zkevm network. + +{% enddocs %} + +{% docs zkevm_logs_decoded_doc %} + +The `zkevm.logs_decoded` table contains a subset of decoded logs from the zkevm blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `zkevm.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_zkevm.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs zkevm_blocks_doc %} + +The `zkevm.blocks` table contains information about zkevm blocks. It provides essential data about each block in the zkevm blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs zkevm_contracts_doc %} + +The `zkevm.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs zkevm_creation_traces_doc %} + +The `zkevm.creation_traces` table contains data about contract creation events on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the zkevm network. It's essentially a filtered version of the `zkevm.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_zkevm_evt_transfer_doc %} + +The `erc20_zkevm.evt_transfer` table contains Transfer events for ERC20 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the zkevm network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_zkevm_evt_approval_doc %} + +The `erc20_zkevm.evt_approval` table contains Approval events for ERC20 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the zkevm network. + +{% enddocs %} + +{% docs erc1155_zkevm_evt_transfersingle_doc %} + +The `erc1155_zkevm.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the zkevm network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_zkevm_evt_transferbatch_doc %} + +The `erc1155_zkevm.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the zkevm network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_zkevm_evt_ApprovalForAll_doc %} + +The `erc1155_zkevm.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the zkevm network. + +{% enddocs %} + +{% docs erc721_zkevm_evt_transfer_doc %} + +The `erc721_zkevm.evt_transfer` table contains Transfer events for ERC721 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the zkevm network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_zkevm_evt_Approval_doc %} + +The `erc721_zkevm.evt_Approval` table contains Approval events for ERC721 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the zkevm network. + +{% enddocs %} + +{% docs erc721_zkevm_evt_ApprovalForAll_doc %} + +The `erc721_zkevm.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the zkevm blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the zkevm network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/zksync_base_sources.yml b/sources/_base_sources/evm/zksync_base_sources.yml new file mode 100644 index 00000000000..e118ede6f9c --- /dev/null +++ b/sources/_base_sources/evm/zksync_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # zksync Tables + - name: zksync + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/zksync/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("zksync_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including zksync fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in zksync)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/zksync/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("zksync_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/zksync/decoded/traces_decoded + short_description: The `zksync.traces_decoded` table contains decoded traces, including additional information zksyncd on submitted smart contracts and their ABIs. + description: '{{ doc("zksync_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/zksync/raw/logs + short_description: The `zksync.logs` table contains information about event logs emitted by smart contracts on the zksync blockchain. + description: '{{ doc("zksync_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/zksync/decoded/logs_decoded + short_description: The `zksync.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("zksync_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/zksync/raw/blocks + short_description: The `zksync.blocks` table contains information about zksync blocks. Each row represents a single block. + description: '{{ doc("zksync_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the zksync unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in zksync)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in zksync)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in zksync)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for zksync)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for zksync)." + + + - name: contracts + meta: + docs_slug: /evm/zksync/raw/contracts + short_description: The `zksync.contracts` table tracks decoded contracts on zksync, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("zksync_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: zksync + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'zksync', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/zksync/raw/creation_traces + short_description: The `zksync.creation_traces` table contains information about contract creation traces on the zksync blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("zksync_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_zksync + description: "Transfer events for ERC20 tokens on zksync" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/zksync/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the zksync blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_zksync_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's zksync unit" + + - name: evt_approval + meta: + docs_slug: /evm/zksync/decoded/interfaces/erc20/evt_approval + short_description: The `zksync.evt_approval` table contains approval events for ERC20 tokens on zksync, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_zksync_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_zksync + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/zksync/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_zksync_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/zksync/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_zksync_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/zksync/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_zksync_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "zksync address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "zksync address of the token owner granting or revoking approval" + - name: operator + description: "zksync address being granted or revoked permission to operate all tokens" + + - name: erc721_zksync + description: '{{ doc("erc721_zksync_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/zksync/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_zksync_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/zksync/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `zksync.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the zksync blockchain. + description: '{{ doc("erc721_zksync_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/zksync_docs_block.md b/sources/_base_sources/evm/zksync_docs_block.md new file mode 100644 index 00000000000..9680ecc16d7 --- /dev/null +++ b/sources/_base_sources/evm/zksync_docs_block.md @@ -0,0 +1,221 @@ +{% docs zksync_transactions_doc %} + +The `zksync.transactions` table contains detailed information about transactions on the zksync blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on zksync. + +{% enddocs %} + +{% docs zksync_traces_doc %} + +The `zksync.traces` table contains records of execution steps for transactions on the zksync blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the zksync network. + +{% enddocs %} + +{% docs zksync_traces_decoded_doc %} + +The `zksync.traces_decoded` table contains a subset of decoded traces from the zksync blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `zksync.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_zksync.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs zksync_logs_doc %} + +The `zksync.logs` table contains event logs emitted by smart contracts on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the zksync network. + +{% enddocs %} + +{% docs zksync_logs_decoded_doc %} + +The `zksync.logs_decoded` table contains a subset of decoded logs from the zksync blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `zksync.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_zksync.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs zksync_blocks_doc %} + +The `zksync.blocks` table contains information about zksync blocks. It provides essential data about each block in the zksync blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs zksync_contracts_doc %} + +The `zksync.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs zksync_creation_traces_doc %} + +The `zksync.creation_traces` table contains data about contract creation events on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the zksync network. It's essentially a filtered version of the `zksync.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_zksync_evt_transfer_doc %} + +The `erc20_zksync.evt_transfer` table contains Transfer events for ERC20 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the zksync network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_zksync_evt_approval_doc %} + +The `erc20_zksync.evt_approval` table contains Approval events for ERC20 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the zksync network. + +{% enddocs %} + +{% docs erc1155_zksync_evt_transfersingle_doc %} + +The `erc1155_zksync.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the zksync network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_zksync_evt_transferbatch_doc %} + +The `erc1155_zksync.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the zksync network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_zksync_evt_ApprovalForAll_doc %} + +The `erc1155_zksync.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the zksync network. + +{% enddocs %} + +{% docs erc721_zksync_evt_transfer_doc %} + +The `erc721_zksync.evt_transfer` table contains Transfer events for ERC721 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the zksync network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_zksync_evt_Approval_doc %} + +The `erc721_zksync.evt_Approval` table contains Approval events for ERC721 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the zksync network. + +{% enddocs %} + +{% docs erc721_zksync_evt_ApprovalForAll_doc %} + +The `erc721_zksync.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the zksync blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the zksync network. + +{% enddocs %} diff --git a/sources/_base_sources/evm/zora_base_sources.yml b/sources/_base_sources/evm/zora_base_sources.yml new file mode 100644 index 00000000000..ada5505b97a --- /dev/null +++ b/sources/_base_sources/evm/zora_base_sources.yml @@ -0,0 +1,448 @@ +version: 2 + +sources: + # zora Tables + - name: zora + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/zora/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("zora_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including zora fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in zora)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/zora/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("zora_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/zora/decoded/traces_decoded + short_description: The `zora.traces_decoded` table contains decoded traces, including additional information zorad on submitted smart contracts and their ABIs. + description: '{{ doc("zora_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/zora/raw/logs + short_description: The `zora.logs` table contains information about event logs emitted by smart contracts on the zora blockchain. + + description: '{{ doc("zora_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/zora/decoded/logs_decoded + short_description: The `zora.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + + description: '{{ doc("zora_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/zora/raw/blocks + short_description: The `zora.blocks` table contains information about zora blocks. Each row represents a single block. + description: '{{ doc("zora_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the zora unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in zora)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in zora)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in zora)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for zora)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for zora)." + + - name: contracts + meta: + docs_slug: /evm/zora/raw/contracts + short_description: The `zora.contracts` table tracks decoded contracts on zora, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("zora_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: zora + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'zora', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/zora/raw/creation_traces + short_description: The `zora.creation_traces` table contains information about contract creation traces on the zora blockchain. It includes details about newly created contracts, their creators, and the contract code. + + description: '{{ doc("zora_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_zora + description: "Transfer events for ERC20 tokens on zora" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/zora/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the zora blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_zora_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's zora unit" + + - name: evt_approval + meta: + docs_slug: /evm/zora/decoded/interfaces/erc20/evt_approval + short_description: The `zora.evt_approval` table contains approval events for ERC20 tokens on zora, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_zora_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_zora + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/zora/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_zora_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/zora/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_zora_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/zora/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_zora_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "zora address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "zora address of the token owner granting or revoking approval" + - name: operator + description: "zora address being granted or revoked permission to operate all tokens" + + - name: erc721_zora + description: '{{ doc("erc721_zora_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/zora/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_zora_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/zora/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `zora.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the zora blockchain. + description: '{{ doc("erc721_zora_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/zora_docs_block.md b/sources/_base_sources/evm/zora_docs_block.md new file mode 100644 index 00000000000..a43a3a386b4 --- /dev/null +++ b/sources/_base_sources/evm/zora_docs_block.md @@ -0,0 +1,221 @@ +{% docs zora_transactions_doc %} + +The `zora.transactions` table contains detailed information about transactions on the zora blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on zora. + +{% enddocs %} + +{% docs zora_traces_doc %} + +The `zora.traces` table contains records of execution steps for transactions on the zora blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the zora network. + +{% enddocs %} + +{% docs zora_traces_decoded_doc %} + +The `zora.traces_decoded` table contains a subset of decoded traces from the zora blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `zora.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_zora.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs zora_logs_doc %} + +The `zora.logs` table contains event logs emitted by smart contracts on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the zora network. + +{% enddocs %} + +{% docs zora_logs_decoded_doc %} + +The `zora.logs_decoded` table contains a subset of decoded logs from the zora blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `zora.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_zora.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs zora_blocks_doc %} + +The `zora.blocks` table contains information about zora blocks. It provides essential data about each block in the zora blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs zora_contracts_doc %} + +The `zora.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs zora_creation_traces_doc %} + +The `zora.creation_traces` table contains data about contract creation events on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the zora network. It's essentially a filtered version of the `zora.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_zora_evt_transfer_doc %} + +The `erc20_zora.evt_transfer` table contains Transfer events for ERC20 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the zora network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_zora_evt_approval_doc %} + +The `erc20_zora.evt_approval` table contains Approval events for ERC20 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the zora network. + +{% enddocs %} + +{% docs erc1155_zora_evt_transfersingle_doc %} + +The `erc1155_zora.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the zora network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_zora_evt_transferbatch_doc %} + +The `erc1155_zora.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the zora network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_zora_evt_ApprovalForAll_doc %} + +The `erc1155_zora.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the zora network. + +{% enddocs %} + +{% docs erc721_zora_evt_transfer_doc %} + +The `erc721_zora.evt_transfer` table contains Transfer events for ERC721 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the zora network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_zora_evt_Approval_doc %} + +The `erc721_zora.evt_Approval` table contains Approval events for ERC721 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the zora network. + +{% enddocs %} + +{% docs erc721_zora_evt_ApprovalForAll_doc %} + +The `erc721_zora.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the zora blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the zora network. + +{% enddocs %} diff --git a/sources/_base_sources/fantom_base_sources.yml b/sources/_base_sources/fantom_base_sources.yml deleted file mode 100644 index cfd5403924a..00000000000 --- a/sources/_base_sources/fantom_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: fantom - description: "Fantom raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A Fantom transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of Fantom transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of Fantom - each gwei is equal to 10-9 Fantom" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A Fantom trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Fantom trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Fantom smart contract generating the log" - - name: function_name - description: "Name of the Fantom smart contract function generating the log" - - name: namespace - description: "Namespace of the Fantom smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A Fantom log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the Fantom smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Fantom log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Fantom smart contract generating the log" - - name: contract_name - description: "Name of the Fantom smart contract generating the log" - - name: event_name - description: "Name of the Fantom smart contract event generating the log" - - name: namespace - description: "Namespace of the Fantom smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Fantom; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Fantom creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_fantom - description: "Transfers events for ERC20 tokens on Fantom." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Fantom." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Fantom." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_fantom - description: "Transfers events for ERC1155 tokens on Fantom." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Fantom." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Fantom." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Fantom." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_fantom - description: "Transfers events for ERC721 tokens on Fantom." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Fantom." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Fantom." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Fantom." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/gnosis_base_sources.yml b/sources/_base_sources/gnosis_base_sources.yml deleted file mode 100644 index 1889df90cc5..00000000000 --- a/sources/_base_sources/gnosis_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: gnosis - description: "Gnosis raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A Gnosis transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of xDAI transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of xDAI - each gwei is equal to 10-9 xDAI" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A Gnosis trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Gnosis trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Gnosis smart contract generating the log" - - name: function_name - description: "Name of the Gnosis smart contract function generating the log" - - name: namespace - description: "Namespace of the Gnosis smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "An Ethereum log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the gnosis smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Gnosis log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Gnosis smart contract generating the log" - - name: contract_name - description: "Name of the Gnosis smart contract generating the log" - - name: event_name - description: "Name of the Gnosis smart contract event generating the log" - - name: namespace - description: "Namespace of the Gnosis smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Gnosis; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Gnosis creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_gnosis - description: "Transfers events for ERC20 tokens on Gnosis." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Gnosis." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Gnosis." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_gnosis - description: "Transfers events for ERC1155 tokens on Gnosis." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Gnosis." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Gnosis." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Gnosis." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_gnosis - description: "Transfers events for ERC721 tokens on Gnosis." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Gnosis." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Gnosis." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Gnosis." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/goerli_base_sources.yml b/sources/_base_sources/goerli_base_sources.yml deleted file mode 100644 index e51a5c4bddc..00000000000 --- a/sources/_base_sources/goerli_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: goerli - description: "Goerli raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A Goerli transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of Goerli transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of Goerli - each gwei is equal to 10-9 Goerli" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A Goerli trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Goerli trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Goerli smart contract generating the log" - - name: function_name - description: "Name of the Goerli smart contract function generating the log" - - name: namespace - description: "Namespace of the Goerli smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A Goerli log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the Goerli smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Goerli log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Goerli smart contract generating the log" - - name: contract_name - description: "Name of the Goerli smart contract generating the log" - - name: event_name - description: "Name of the Goerli smart contract event generating the log" - - name: namespace - description: "Namespace of the Goerli smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Goerli; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Goerli creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_goerli - description: "Transfers events for ERC20 tokens on Goerli." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Goerli." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Goerli." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_goerli - description: "Transfers events for ERC1155 tokens on Goerli." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Goerli." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Goerli." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Goerli." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_goerli - description: "Transfers events for ERC721 tokens on Goerli." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Goerli." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Goerli." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Goerli." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/linea_base_sources.yml b/sources/_base_sources/linea_base_sources.yml deleted file mode 100644 index feca2854ea7..00000000000 --- a/sources/_base_sources/linea_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: linea - description: "linea raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A linea transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of linea transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of linea - each gwei is equal to 10-9 linea" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A linea trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A linea trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the linea smart contract generating the log" - - name: function_name - description: "Name of the linea smart contract function generating the log" - - name: namespace - description: "Namespace of the linea smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A linea log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the linea smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A linea log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the linea smart contract generating the log" - - name: contract_name - description: "Name of the linea smart contract generating the log" - - name: event_name - description: "Name of the linea smart contract event generating the log" - - name: namespace - description: "Namespace of the linea smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on linea; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "linea creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_linea - description: "Transfers events for ERC20 tokens on linea." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on linea." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on linea." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_linea - description: "Transfers events for ERC1155 tokens on linea." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on linea." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on linea." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on linea." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_linea - description: "Transfers events for ERC721 tokens on linea." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on linea." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on linea." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on linea." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/mantle_base_sources.yml b/sources/_base_sources/mantle_base_sources.yml deleted file mode 100644 index 06723c765c2..00000000000 --- a/sources/_base_sources/mantle_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: mantle - description: "Mantle raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A mantle transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of mantle transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of mantle - each gwei is equal to 10-9 mantle" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A mantle trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A mantle trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the mantle smart contract generating the log" - - name: function_name - description: "Name of the mantle smart contract function generating the log" - - name: namespace - description: "Namespace of the mantle smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A mantle log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the mantle smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A mantle log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the mantle smart contract generating the log" - - name: contract_name - description: "Name of the mantle smart contract generating the log" - - name: event_name - description: "Name of the mantle smart contract event generating the log" - - name: namespace - description: "Namespace of the mantle smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on mantle; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "mantle creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_mantle - description: "Transfers events for ERC20 tokens on mantle." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on mantle." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on mantle." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_mantle - description: "Transfers events for ERC1155 tokens on mantle." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on mantle." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on mantle." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on mantle." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_mantle - description: "Transfers events for ERC721 tokens on mantle." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on mantle." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on mantle." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on mantle." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator diff --git a/sources/_base_sources/mode_base_sources.yml b/sources/_base_sources/mode_base_sources.yml deleted file mode 100644 index 057430bbf79..00000000000 --- a/sources/_base_sources/mode_base_sources.yml +++ /dev/null @@ -1,169 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: mode - description: "Mode raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "An Mode transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of ETH transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - name: l1_block_number - description: "Block number on L1" - - name: l1_fee - description: "L1 Fees that the Mode protocol pays to submit L2 transactions to L1 (also referred to as L1 Security Fees or Security Costs)" - - name: l1_fee_scalar - description: "This value covers the change in L1 gas price between the time the transaction is submitted and when it is published, as well as the income Mode needs to keep the system running. Currently set at 1.0" - - name: l1_gas_price - description: "Gas price on L1" - - name: l1_gas_used - description: "The gas used on L1 to publish the transaction" - - name: l1_timestamp - description: "The timestamp when the transaction is batched and confirmed on L1" - - name: l1_tx_origin - description: "L1 transaction origin address. This is not null for L1→L2 transactions: https://optimistic.etherscan.io/txsEnqueued" - - - name: traces - loaded_at_field: block_time - description: "A mantle trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: logs - loaded_at_field: block_time - description: "An Mode log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the mode smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty \ No newline at end of file diff --git a/sources/_base_sources/optimism_base_sources.yml b/sources/_base_sources/optimism_base_sources.yml deleted file mode 100644 index 0ec54f6acae..00000000000 --- a/sources/_base_sources/optimism_base_sources.yml +++ /dev/null @@ -1,415 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: optimism - description: "Optimism raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "An Optimism transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of ETH transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - name: l1_block_number - description: "Block number on L1" - - name: l1_fee - description: "L1 Fees that the Optimism protocol pays to submit L2 transactions to L1 (also referred to as L1 Security Fees or Security Costs)" - - name: l1_fee_scalar - description: "This value covers the change in L1 gas price between the time the transaction is submitted and when it is published, as well as the income Optimism needs to keep the system running. Currently set at 1.0" - - name: l1_gas_price - description: "Gas price on L1" - - name: l1_gas_used - description: "The gas used on L1 to publish the transaction" - - name: l1_timestamp - description: "The timestamp when the transaction is batched and confirmed on L1" - - name: l1_tx_origin - description: "L1 transaction origin address. This is not null for L1→L2 transactions: https://optimistic.etherscan.io/txsEnqueued" - - - name: traces - loaded_at_field: block_time - description: "An Optimism trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "An Optimism trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Optimism smart contract generating the log" - - name: function_name - description: "Name of the Optimism smart contract function generating the log" - - name: namespace - description: "Namespace of the Optimism smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "An Optimism log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the optimism smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "An Optimism log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Optimism smart contract generating the log" - - name: contract_name - description: "Name of the Optimism smart contract generating the log" - - name: event_name - description: "Name of the Optimism smart contract event generating the log" - - name: namespace - description: "Namespace of the Optimism smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Optimism; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Optimism creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - - # ERC Transfer Tables - - name: erc20_optimism - description: "Transfers events for ERC20 tokens on Optimism." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Optimism." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Optimism." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_block_number - - *evt_block_time - - *evt_index - - *evt_tx_hash - - &owner - name: owner - - &spender - name: spender - - *value - - - name: erc1155_optimism - description: "Transfers events for ERC1155 tokens on Optimism." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Optimism." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Optimism." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Optimism." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - *owner - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_optimism - description: "Transfers events for ERC721 tokens on Optimism." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Optimism." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Optimism." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Optimism." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator diff --git a/sources/_base_sources/other/aptos_base_sources.yml b/sources/_base_sources/other/aptos_base_sources.yml new file mode 100644 index 00000000000..bf66f30e3ac --- /dev/null +++ b/sources/_base_sources/other/aptos_base_sources.yml @@ -0,0 +1,544 @@ +version: 2 +sources: + - name: aptos + description: tables in the aptos schema + tables: + - name: blocks + meta: + docs_slug: /aptos/blocks + short_description: no description yet for aptos.blocks. TBD + + description: '{{ doc("aptos_blocks_doc") }}' + columns: + - name: block_height + description: The block height of the block in the Aptos blockchain. + - name: block_timestamp + description: The timestamp of the block in the Aptos blockchain. + - name: block_date + description: The date of the block in the Aptos blockchain. + - name: block_hash + description: The hash of the block in the Aptos blockchain. + - name: first_version + description: The first version number in the block. A version is a sequentially increasing number that increments for every transaction + - name: last_version + description: The last version number in the block. A version is a sequentially increasing number that increments for every transaction + - name: proposer + description: The address of the account that proposed the block. + - name: round + description: A round consists of achieving consensus on a block of transactions and their execution results. + - name: epoch + description: An epoch is the period of time between reconfigurations of the validator set and other administrative actions by the blockchain. On Aptos mainnet currently, it is every 2 hours. + - name: metadata_id + description: The metadata ID of the block in the Aptos blockchain. + - name: failed_proposer_indices + description: The indices of the validators who failed to propose the block. + - name: previous_block_votes_bitvec + description: Bit vector of the validators who voted for the previous block. + - name: transactions_count + description: The number of transactions in the block. + - name: events + meta: + docs_slug: /aptos/events + short_description: Table containing Aptos blockchain events + + description: '{{ doc("aptos_events_doc") }}' + columns: + - name: block_height + description: The height of the block in the Aptos blockchain + - name: block_date + description: The date of the block + - name: block_timestamp + description: The timestamp of the block + - name: block_hash + description: The hash of the block in the Aptos blockchain + - name: block_first_version + description: The first version number in the block. A version is a sequentially increasing number that increments for every transaction + - name: block_last_version + description: The last version number in the block. A version is a sequentially increasing number that increments for every transaction + - name: block_proposer + description: The address of the account that proposed the block + - name: block_round + description: A round consists of achieving consensus on a block of transactions and their execution results + - name: block_epoch + description: An epoch is the period of time between reconfigurations of the validator set and other administrative actions by the blockchain. On Aptos mainnet currently, it is every 2 hours + - name: block_metadata_id + description: The metadata ID of the block in the Aptos blockchain + - name: block_failed_proposer_indices + description: The indices of the validators who failed to propose the block + - name: block_previous_block_votes_bitvec + description: Bit vector of the validators who voted for the previous block + - name: tx_index + description: The index of the transaction within the block + - name: tx_type + description: The type of the transaction + - name: tx_hash + description: The hash of the transaction + - name: tx_version + description: The version number of the transaction + - name: tx_gas_used + description: The amount of gas used by the transaction + - name: tx_vm_status + description: The status of the virtual machine after executing the transaction + - name: tx_success + description: Whether the transaction was successful or not + - name: tx_state_change_hash + description: The hash of the state changes caused by the transaction + - name: tx_event_root_hash + description: The root hash of the events emitted by the transaction + - name: tx_state_checkpoint_hash + description: The hash of the state checkpoint after the transaction + - name: tx_accumulator_root_hash + description: The root hash of the accumulator after the transaction + - name: event_index + description: The index of the event within the transaction + - name: event_type + description: The type of the event + - name: guid_account_address + description: The global unique identifier (GUID) of the account address linked to the event + - name: guid_creation_number + description: The creation number of the event's GUID + - name: event_sequence_number + description: The sequence number of the event for this GUID + - name: data + description: The data associated with the event + - name: move_modules + meta: + docs_slug: /aptos/move_modules + short_description: The Move modules deployed on Aptos + description: '{{ doc("aptos_move_modules_doc") }}' + columns: + - name: block_height + description: The height of the block containing the move module + - name: block_date + description: The date of the block containing the move module + - name: block_timestamp + description: The timestamp of the block containing the move module + - name: block_hash + description: The hash of the block containing the move module + - name: block_first_version + description: The first version number in the block containing the move module + - name: block_last_version + description: The last version number in the block containing the move module + - name: block_proposer + description: The proposer of the block containing the move module + - name: block_round + description: The round number of the block containing the move module + - name: block_epoch + description: The epoch number of the block containing the move module + - name: block_metadata_id + description: The metadata ID of the block containing the move module + - name: block_failed_proposer_indices + description: The indices of failed proposers for the block containing the move module + - name: block_previous_block_votes_bitvec + description: The bitvector of votes from the previous block + - name: tx_index + description: The index of the transaction within the block + - name: tx_type + description: The type of the transaction + - name: tx_hash + description: The hash of the transaction + - name: tx_version + description: The version number of the transaction + - name: tx_gas_used + description: The amount of gas used by the transaction + - name: tx_vm_status + description: The VM status of the transaction + - name: tx_success + description: Whether the transaction was successful + - name: tx_state_change_hash + description: The hash of the state changes caused by the transaction + - name: tx_event_root_hash + description: The root hash of the events emitted by the transaction + - name: tx_state_checkpoint_hash + description: The hash of the state checkpoint after the transaction + - name: tx_accumulator_root_hash + description: The root hash of the accumulator after the transaction + - name: write_set_change_index + description: The index of the write set change + - name: write_set_change_type + description: The type of the write set change + - name: move_state_key_hash + description: The hash of the Move state key + - name: move_is_deletion + description: Whether the Move operation is a deletion + - name: move_address + description: The address associated with the Move module + - name: move_module_address + description: The address of the Move module + - name: move_module_bytecode + description: The bytecode of the Move module + - name: move_module_module_name + description: The name of the Move module + - name: move_module_friends + description: The friends of the Move module + - name: move_module_exposed_functions + description: The exposed functions of the Move module + - name: move_module_structs + description: The structs defined in the Move module + - name: move_resources + meta: + docs_slug: /aptos/move_resources + short_description: The Move resources deployed on Aptos + description: '{{ doc("aptos_move_resources_doc") }}' + columns: + - name: block_height + description: The height of the block containing the move resource + - name: block_date + description: The date of the block containing the move resource + - name: block_timestamp + description: The timestamp of the block containing the move resource + - name: block_hash + description: The hash of the block containing the move resource + - name: block_first_version + description: The first version number in the block containing the move resource + - name: block_last_version + description: The last version number in the block containing the move resource + - name: block_proposer + description: The proposer of the block containing the move resource + - name: block_round + description: The round number of the block containing the move resource + - name: block_epoch + description: The epoch number of the block containing the move resource + - name: block_metadata_id + description: The metadata ID of the block containing the move resource + - name: block_failed_proposer_indices + description: The indices of failed proposers for the block containing the move resource + - name: block_previous_block_votes_bitvec + description: The bitvector of votes from the previous block + - name: tx_index + description: The index of the transaction within the block + - name: tx_type + description: The type of the transaction + - name: tx_hash + description: The hash of the transaction + - name: tx_version + description: The version number of the transaction + - name: tx_gas_used + description: The amount of gas used by the transaction + - name: tx_vm_status + description: The VM status of the transaction + - name: tx_success + description: Whether the transaction was successful + - name: tx_state_change_hash + description: The hash of the state changes caused by the transaction + - name: tx_event_root_hash + description: The root hash of the events emitted by the transaction + - name: tx_state_checkpoint_hash + description: The hash of the state checkpoint after the transaction + - name: tx_accumulator_root_hash + description: The root hash of the accumulator after the transaction + - name: write_set_change_index + description: The index of the write set change + - name: write_set_change_type + description: The type of the write set change + - name: move_state_key_hash + description: The hash of the Move state key + - name: move_is_deletion + description: Whether the Move operation is a deletion + - name: move_data + description: The data associated with the Move resource + - name: move_address + description: The address associated with the Move resource + - name: move_module_address + description: The address of the Move module containing the resource + - name: move_resource_module + description: The name of the Move module containing the resource + - name: move_resource_name + description: The name of the Move resource + - name: move_resource_generic_type_params + description: The generic type parameters of the Move resource + - name: move_table_items + meta: + docs_slug: /aptos/move_table_items + short_description: Table items in Move tables on Aptos + + description: '{{ doc("aptos_move_table_items_doc") }}' + columns: + - name: block_height + description: The height of the block containing the move table item + - name: block_date + description: The date of the block containing the move table item + - name: block_timestamp + description: The timestamp of the block containing the move table item + - name: block_hash + description: The hash of the block containing the move table item + - name: block_first_version + description: The first version number in the block containing the move table item + - name: block_last_version + description: The last version number in the block containing the move table item + - name: block_proposer + description: The proposer of the block containing the move table item + - name: block_round + description: The round number of the block containing the move table item + - name: block_epoch + description: The epoch number of the block containing the move table item + - name: block_metadata_id + description: The metadata ID of the block containing the move table item + - name: block_failed_proposer_indices + description: The indices of failed proposers for the block containing the move table item + - name: block_previous_block_votes_bitvec + description: The bitvector of votes from the previous block + - name: tx_index + description: The index of the transaction within the block + - name: tx_type + description: The type of the transaction + - name: tx_hash + description: The hash of the transaction + - name: tx_version + description: The version number of the transaction + - name: tx_gas_used + description: The amount of gas used by the transaction + - name: tx_vm_status + description: The VM status of the transaction + - name: tx_success + description: Whether the transaction was successful + - name: tx_state_change_hash + description: The hash of the state changes caused by the transaction + - name: tx_event_root_hash + description: The root hash of the events emitted by the transaction + - name: tx_state_checkpoint_hash + description: The hash of the state checkpoint after the transaction + - name: tx_accumulator_root_hash + description: The root hash of the accumulator after the transaction + - name: write_set_change_index + description: The index of the write set change + - name: write_set_change_type + description: The type of the write set change + - name: move_state_key_hash + description: The hash of the Move state key + - name: move_is_deletion + description: Whether the Move operation is a deletion + - name: move_table_item_handle + description: The handle of the Move table item + - name: move_table_item_key + description: The key of the Move table item + - name: move_table_item_value + description: The value of the Move table item + - name: move_data + description: The data associated with the Move table item + - name: signatures + meta: + docs_slug: /aptos/signatures + short_description: Signatures for transactions on Aptos + description: '{{ doc("aptos_signatures_doc") }}' + columns: + - name: block_height + description: The height of the block containing the signature + - name: block_date + description: The date of the block containing the signature + - name: block_timestamp + description: The timestamp of the block containing the signature + - name: block_hash + description: The hash of the block containing the signature + - name: block_first_version + description: The first version number in the block containing the signature + - name: block_last_version + description: The last version number in the block containing the signature + - name: block_proposer + description: The proposer of the block containing the signature + - name: block_round + description: The round number of the block containing the signature + - name: block_epoch + description: The epoch number of the block containing the signature + - name: block_metadata_id + description: The metadata ID of the block containing the signature + - name: block_failed_proposer_indices + description: The indices of failed proposers for the block containing the signature + - name: block_previous_block_votes_bitvec + description: The bitvector of votes from the previous block + - name: tx_index + description: The index of the transaction within the block + - name: tx_type + description: The type of the transaction + - name: tx_hash + description: The hash of the transaction + - name: tx_version + description: The version number of the transaction + - name: tx_gas_used + description: The amount of gas used by the transaction + - name: tx_vm_status + description: The VM status of the transaction + - name: tx_success + description: Whether the transaction was successful + - name: tx_state_change_hash + description: The hash of the state changes caused by the transaction + - name: tx_event_root_hash + description: The root hash of the events emitted by the transaction + - name: tx_state_checkpoint_hash + description: The hash of the state checkpoint after the transaction + - name: tx_accumulator_root_hash + description: The root hash of the accumulator after the transaction + - name: tx_timestamp + description: The timestamp of the transaction + - name: tx_sender + description: The address of the transaction sender + - name: tx_max_gas_amount + description: The maximum amount of gas allowed for the transaction + - name: tx_gas_unit_price + description: The price per unit of gas for the transaction + - name: tx_sequence_number + description: The sequence number of the transaction + - name: tx_expiration_timestamp_secs + description: The expiration timestamp of the transaction in seconds + - name: type + description: The type of the signature + - name: signer_type + description: The type of the signer + - name: signer_signature_type + description: The type of the signer's signature + - name: is_single_sender + description: Whether the transaction has a single sender + - name: signer_address + description: The address of the signer + - name: secondary_signer_index + description: The index of the secondary signer, if applicable + - name: public_key + description: The public key associated with the signature + - name: signature + description: The actual signature + - name: bitmap + description: The bitmap associated with the signature, if applicable + - name: bitmap_public_key_index + description: The index of the public key in the bitmap, if applicable + - name: threshold + description: The threshold for multi-signature transactions, if applicable + - name: transactions + meta: + docs_slug: /aptos/transactions + short_description: Transactions on the Aptos blockchain + description: '{{ doc("aptos_transactions_doc") }}' + columns: + - name: block_height + description: The height of the block containing the transaction + - name: block_date + description: The date of the block containing the transaction + - name: block_timestamp + description: The timestamp of the block containing the transaction + - name: block_hash + description: The hash of the block containing the transaction + - name: block_first_version + description: The first version number in the block containing the transaction + - name: block_last_version + description: The last version number in the block containing the transaction + - name: block_proposer + description: The proposer of the block containing the transaction + - name: block_round + description: The round number of the block containing the transaction + - name: block_epoch + description: The epoch number of the block containing the transaction + - name: block_metadata_id + description: The metadata ID of the block containing the transaction + - name: block_failed_proposer_indices + description: The indices of failed proposers for the block containing the transaction + - name: block_previous_block_votes_bitvec + description: The bitvector of votes from the previous block + - name: tx_index + description: The index of the transaction within the block + - name: tx_type + description: The type of the transaction + - name: hash + description: The hash of the transaction + - name: version + description: The version number of the transaction + - name: gas_used + description: The amount of gas used by the transaction + - name: vm_status + description: The VM status after executing the transaction + - name: success + description: Whether the transaction was successful + - name: state_change_hash + description: The hash of the state changes caused by the transaction + - name: event_root_hash + description: The root hash of the events emitted by the transaction + - name: state_checkpoint_hash + description: The hash of the state checkpoint after the transaction + - name: accumulator_root_hash + description: The root hash of the accumulator after the transaction + - name: events_count + description: The number of events emitted by the transaction + - name: changes_count + description: The number of state changes caused by the transaction + - name: user_transactions + meta: + docs_slug: /aptos/user_transactions + short_description: no description yet for aptos.user_transactions. TBD + description: '{{ doc("aptos_user_transactions_doc") }}' + columns: + - name: block_height + description: No description provided. TBD + - name: block_date + description: No description provided. TBD + - name: block_timestamp + description: No description provided. TBD + - name: block_hash + description: No description provided. TBD + - name: block_first_version + description: No description provided. TBD + - name: block_last_version + description: No description provided. TBD + - name: block_proposer + description: No description provided. TBD + - name: block_round + description: No description provided. TBD + - name: block_epoch + description: No description provided. TBD + - name: block_metadata_id + description: No description provided. TBD + - name: block_failed_proposer_indices + description: No description provided. TBD + - name: block_previous_block_votes_bitvec + description: No description provided. TBD + - name: tx_index + description: No description provided. TBD + - name: tx_type + description: No description provided. TBD + - name: hash + description: No description provided. TBD + - name: version + description: No description provided. TBD + - name: gas_used + description: No description provided. TBD + - name: vm_status + description: No description provided. TBD + - name: success + description: No description provided. TBD + - name: state_change_hash + description: No description provided. TBD + - name: event_root_hash + description: No description provided. TBD + - name: state_checkpoint_hash + description: No description provided. TBD + - name: accumulator_root_hash + description: No description provided. TBD + - name: timestamp + description: No description provided. TBD + - name: sender + description: No description provided. TBD + - name: max_gas_amount + description: No description provided. TBD + - name: gas_unit_price + description: No description provided. TBD + - name: sequence_number + description: No description provided. TBD + - name: expiration_timestamp_secs + description: No description provided. TBD + - name: events_count + description: No description provided. TBD + - name: changes_count + description: No description provided. TBD + - name: payload_type + description: No description provided. TBD + - name: entry_function_name + description: No description provided. TBD + - name: entry_function_module_name + description: No description provided. TBD + - name: entry_function_module_address + description: No description provided. TBD + - name: script_bytecode + description: No description provided. TBD + - name: script_abi + description: No description provided. TBD + - name: type_arguments + description: No description provided. TBD + - name: arguments + description: No description provided. TBD diff --git a/sources/_base_sources/other/aptos_docs_block.md b/sources/_base_sources/other/aptos_docs_block.md new file mode 100644 index 00000000000..50d854cf8ce --- /dev/null +++ b/sources/_base_sources/other/aptos_docs_block.md @@ -0,0 +1,33 @@ +{% docs aptos_blocks_doc %} +This table represents the blocks in the Aptos blockchain. A block is a collection of transactions, and is identified by a unique block identifier. Each block contains a timestamp and a reference to the previous block hash, forming a chain of blocks. The block structure is crucial for the blockchain’s integrity and security, ensuring a verifiable and tamper-evident ledger. +{% enddocs %} + +{% docs aptos_events_doc %} +This table captures the events that are emitted by smart contracts on the Aptos blockchain. Events are used to log significant actions and changes in smart contracts, such as token transfers or updates to contract states. Each event is linked to the transaction that triggered it, providing a detailed audit trail of contract interactions. +{% enddocs %} + +{% docs aptos_move_modules_doc %} +This table contains data on Move modules deployed on the Aptos blockchain. Move modules contain the bytecode for smart contracts and define the functionality and types used by Move resources. This table provides insight into the smart contract code running on the network, including the module’s author, name, and bytecode. +{% enddocs %} + +{% docs aptos_move_resources_doc %} +This table stores information about the Move resources on the Aptos blockchain. Move resources are persistent data structures that are owned by user accounts and can represent various on-chain assets or states. This table includes details on the resource type, the account that owns it, and the resource’s data. +{% enddocs %} + +{% docs aptos_move_table_items_doc %} +This table tracks the items stored in Move’s table data structures on the Aptos blockchain. The Move table is a high-performance, typed data structure used for storing and querying on-chain data. This table details the key-value pairs stored, facilitating efficient data access and manipulation within smart contracts. +{% enddocs %} + +{% docs aptos_signatures_doc %} +This table documents the signatures associated with transactions on the Aptos blockchain. Signatures are critical for securing transactions, proving the identity of the sender, and ensuring data integrity. This table includes the signature type, data, and the transaction it authenticates, offering insights into the security mechanisms at play. + +{% enddocs %} + +{% docs aptos_transactions_doc %} +This table contains information about all transactions on the Aptos blockchain, including both user-initiated and system transactions. Transactions are the actions that modify the state of the blockchain, such as transfers of tokens or the execution of smart contracts. Each transaction is uniquely identified and linked to the block in which it was included. +{% enddocs %} + +{% docs aptos_user_transactions_doc %} +This table specifically tracks transactions initiated by users of the Aptos blockchain. It includes details such as the sender, the type of transaction, and the gas used, providing insights into how users interact with the network and its smart contracts. +{% enddocs %} + diff --git a/sources/_base_sources/other/beacon_base_sources.yml b/sources/_base_sources/other/beacon_base_sources.yml new file mode 100644 index 00000000000..b31a595a1f9 --- /dev/null +++ b/sources/_base_sources/other/beacon_base_sources.yml @@ -0,0 +1,106 @@ +version: 2 + +sources: + # Beacon chain tables + - name: beacon + description: "Ethereum mainnet beacon chain raw tables." + tables: + - name: blobs + meta: + docs_slug: /evm/ethereum/beacon/blobs + short_description: The `beacon.blobs` table contains information about blobs on the Ethereum mainnet beacon chain, introduced with EIP-4844. + description: '{{ doc("beacon_blobs_doc") }}' + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this blob was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this blob was proposed" + - &block_slot + name: block_slot + description: "The slot number in which this blob was included" + - &block_epoch + name: block_epoch + description: "The epoch number in which this blob was included" + - name: index + description: "Index of the blob within its block" + - name: proposer_index + description: "Index of the validator that proposed the block containing this blob" + - name: kzg_commitment + description: "KZG commitment for this blob, used for data availability and integrity verification" + - name: kzg_commitment_inclusion_proof + description: "Proof of inclusion for the KZG commitment in the block" + - name: kzg_proof + description: "KZG proof associated with this blob" + - name: blob + description: "The actual content of the blob" + + - name: blocks + meta: + docs_slug: /evm/ethereum/beacon/beacon_blocks + short_description: The `beacon.blocks` table contains information about blocks on the Ethereum mainnet beacon chain. + description: '{{ doc("beacon_blocks_doc") }}' + columns: + - *block_date + - *block_time + - *block_slot + - *block_epoch + - name: proposer_index + description: "Index of the validator that proposed this block" + - name: parent_root + description: "Root hash of the parent block" + - name: state_root + description: "Root hash of the state after this block" + - name: body_root + description: "Root hash of the block body" + - name: signature + description: "BLS signature of the block proposer" + + - name: attestations + meta: + docs_slug: /evm/ethereum/beacon/beacon_attestations + short_description: The `beacon.attestations` table contains information about attestations on the Ethereum mainnet beacon chain. + description: '{{ doc("beacon_attestations_doc") }}' + columns: + - *block_date + - *block_time + - *block_slot + - *block_epoch + - name: aggregation_bits + description: "Bitfield representing which validators have attested" + - name: beacon_block_root + description: "Root hash of the beacon block being attested to" + - name: source_epoch + description: "Source epoch for the attestation (previous justified epoch)" + - name: target_epoch + description: "Target epoch for the attestation (current epoch)" + - name: signature + description: "Aggregate signature of all attesters" + + - name: validators + meta: + docs_slug: /evm/ethereum/beacon/beacon_validators + short_description: The `beacon.validators` table contains information about validators on the Ethereum mainnet beacon chain. + description: '{{ doc("beacon_validators_doc") }}' + columns: + - name: validator_index + description: "Unique index assigned to the validator" + - name: public_key + description: "BLS public key of the validator" + - name: balance + description: "Current balance of the validator in Gwei" + - name: effective_balance + description: "Effective balance used for rewards and penalties, capped at 32 ETH" + - name: slashed + description: "Boolean indicating if the validator has been slashed" + - name: activation_eligibility_epoch + description: "Epoch when the validator became eligible for activation" + - name: activation_epoch + description: "Epoch when the validator was activated" + - name: exit_epoch + description: "Epoch when the validator exited or will exit" + - name: withdrawable_epoch + description: "Epoch when the validator's funds become withdrawable" + - name: last_update_time + description: "Timestamp of the last update to this validator's information" diff --git a/sources/_base_sources/other/beacon_docs_block.md b/sources/_base_sources/other/beacon_docs_block.md new file mode 100644 index 00000000000..2cddf647132 --- /dev/null +++ b/sources/_base_sources/other/beacon_docs_block.md @@ -0,0 +1,31 @@ +{% docs beacon_blobs_doc %} + +## Table Description + +The `beacon.blobs` table contains information about blobs on the Ethereum mainnet beacon chain, introduced with EIP-4844. Each row represents a single blob, including details such as the block it was included in, its index, and associated KZG commitments and proofs. + +{% enddocs %} + +{% docs beacon_blocks_doc %} + +## Table Description + +The `beacon.blocks` table contains information about blocks on the Ethereum mainnet beacon chain. Each row represents a single block, including details such as the block time, slot, epoch, proposer, and various root hashes. + +{% enddocs %} + +{% docs beacon_attestations_doc %} + +## Table Description + +The `beacon.attestations` table contains information about attestations on the Ethereum mainnet beacon chain. Each row represents a single attestation, including details such as the block it was included in, aggregation bits, and source and target epochs. + +{% enddocs %} + +{% docs beacon_validators_doc %} + +## Table Description + +The `beacon.validators` table contains information about validators on the Ethereum mainnet beacon chain. Each row represents a single validator, including details such as their index, public key, balance, and various epoch-related information. + +{% enddocs %} diff --git a/sources/_base_sources/other/bitcoin_base_sources.yml b/sources/_base_sources/other/bitcoin_base_sources.yml new file mode 100644 index 00000000000..2fb6711d9a7 --- /dev/null +++ b/sources/_base_sources/other/bitcoin_base_sources.yml @@ -0,0 +1,149 @@ +version: 2 + +sources: + # Base Tables + - name: bitcoin + description: "Base raw tables including blocks, transactions, inputs, and outputs for the Bitcoin blockchain." + tables: + - name: blocks + meta: + docs_slug: /bitcoin/raw/blocks + short_description: The `bitcoin.blocks` table contains detailed information about blocks on the Bitcoin blockchain, including block data, transaction counts, and mining rewards. + description: '{{ doc("bitcoin_blocks_doc") }}' + columns: + - &block_time + name: time + description: "The exact UTC timestamp when this block was mined" + - &block_height + name: height + description: "The sequential number of this block in the Bitcoin blockchain" + - &block_date + name: date + description: "The UTC date of this block" + - &block_hash + name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: transaction_count + description: "The number of transactions included in this block" + - name: size + description: "The size of this block in bytes" + - name: mint_reward + description: "The total reward given to the miner for minting this block, including block reward and transaction fees" + - name: total_fees + description: "The sum of all transaction fees in this block" + - name: total_reward + description: "The static block reward given to the miner, not including transaction fees" + - name: stripped_size + description: "The size of the block excluding witness data" + - name: weight + description: "The block weight as defined in BIP 141" + - name: chainwork + description: "The expected number of hashes required to produce the current chain" + - name: difficulty + description: "The mining difficulty for this block" + - name: merkle_root + description: "The root hash of the merkle tree of transactions in this block" + - name: nonce + description: "The nonce used to generate this block" + - name: coinbase + description: "The coinbase data (arbitrary data miners can include in a coinbase transaction)" + - name: previous_block_hash + description: "The hash of the previous block in the chain" + - name: bits + description: "The compact format of the difficulty target for this block" + + - name: transactions + meta: + docs_slug: /bitcoin/raw/transactions + short_description: The `bitcoin.transactions` table contains detailed information about transactions on the Bitcoin blockchain, including input and output values, fees, and sizes. + description: '{{ doc("bitcoin_transactions_doc") }}' + columns: + - *block_time + - *block_date + - *block_height + - *block_hash + - name: index + description: "The position of this transaction within its containing block" + - &tx_id + name: id + description: "Unique 256-bit identifier (hash) of this transaction" + - name: input_value + description: "Total value of all inputs in this transaction, in satoshis" + - name: output_value + description: "Total value of all outputs in this transaction, in satoshis" + - name: fee + description: "The transaction fee paid to the miner, in satoshis" + - name: input_count + description: "The number of inputs in this transaction" + - name: output_count + description: "The number of outputs in this transaction" + - name: size + description: "The size of this transaction in bytes" + - name: virtual_size + description: "The virtual size of this transaction (differs from size for SegWit transactions)" + - name: is_coinbase + description: "Boolean flag indicating whether this is a coinbase transaction" + - name: coinbase + description: "The coinbase data for coinbase transactions, null otherwise" + - name: lock_time + description: "The lock time of this transaction" + - name: hex + description: "The raw transaction data in hexadecimal format" + + - name: inputs + meta: + docs_slug: /bitcoin/raw/inputs + short_description: The `bitcoin.inputs` table contains information about transaction inputs on the Bitcoin blockchain, including spent outputs and script details. + description: '{{ doc("bitcoin_inputs_doc") }}' + columns: + - *block_time + - *block_date + - *block_height + - *block_hash + - name: index + description: "The position of this input within the transaction" + - *tx_id + - name: spent_tx_id + description: "The transaction ID of the output being spent" + - name: spent_output_index + description: "The index of the output being spent within its transaction" + - name: value + description: "The value of this input in satoshis" + - name: address + description: "The Bitcoin address associated with this input" + - name: type + description: "The type of the address (e.g., P2PKH, P2SH, P2WPKH)" + - name: is_coinbase + description: "Boolean flag indicating whether this is a coinbase input" + - name: script_asm + description: "The input script in human-readable ASM format" + - name: script_hex + description: "The input script in hexadecimal format" + - name: witness + description: "The witness data for SegWit inputs" + + - name: outputs + meta: + docs_slug: /bitcoin/raw/outputs + short_description: The `bitcoin.outputs` table contains information about transaction outputs on the Bitcoin blockchain, including values, addresses, and script details. + description: '{{ doc("bitcoin_outputs_doc") }}' + columns: + - *block_time + - *block_date + - *block_height + - *block_hash + - *tx_id + - name: index + description: "The position of this output within the transaction" + - name: value + description: "The value of this output in satoshis" + - name: address + description: "The Bitcoin address associated with this output" + - name: type + description: "The type of the address (e.g., P2PKH, P2SH, P2WPKH)" + - name: script_asm + description: "The output script in human-readable ASM format" + - name: script_hex + description: "The output script in hexadecimal format" + - name: is_spent + description: "Boolean flag indicating whether this output has been spent" \ No newline at end of file diff --git a/sources/_base_sources/other/bitcoin_docs_block.md b/sources/_base_sources/other/bitcoin_docs_block.md new file mode 100644 index 00000000000..c89866580c8 --- /dev/null +++ b/sources/_base_sources/other/bitcoin_docs_block.md @@ -0,0 +1,31 @@ +{% docs bitcoin_blocks_doc %} + +## Table Description + +The `bitcoin.blocks` table contains information about blocks on the Bitcoin blockchain. Each row represents a single block, including details such as the block time, height, hash, transaction count, size, mining rewards, difficulty, and various blockchain-specific information like merkle root and nonce. + +{% enddocs %} + +{% docs bitcoin_transactions_doc %} + +## Table Description + +The `bitcoin.transactions` table contains information about transactions on the Bitcoin blockchain. Each row represents a single transaction, including details such as the block it was included in, transaction ID, input and output values, fees, size, and whether it's a coinbase transaction. It also includes information about the transaction's inputs and outputs, as well as its lock time and raw hexadecimal representation. + +{% enddocs %} + +{% docs bitcoin_inputs_doc %} + +## Table Description + +The `bitcoin.inputs` table contains information about transaction inputs on the Bitcoin blockchain. Each row represents a single input, including details such as the block and transaction it belongs to, the previous output being spent, input value, associated address, and script information. It also includes data specific to coinbase inputs and witness data for SegWit transactions. + +{% enddocs %} + +{% docs bitcoin_outputs_doc %} + +## Table Description + +The `bitcoin.outputs` table contains information about transaction outputs on the Bitcoin blockchain. Each row represents a single output, including details such as the block and transaction it belongs to, output index, value, recipient address, and script information. This table is crucial for tracking the creation of new unspent transaction outputs (UTXOs) in the Bitcoin network. + +{% enddocs %} \ No newline at end of file diff --git a/sources/_base_sources/solana_base_sources.yml b/sources/_base_sources/other/solana_base_sources.yml similarity index 83% rename from sources/_base_sources/solana_base_sources.yml rename to sources/_base_sources/other/solana_base_sources.yml index 2c69f264bdf..75ff1e83dc7 100644 --- a/sources/_base_sources/solana_base_sources.yml +++ b/sources/_base_sources/other/solana_base_sources.yml @@ -1,17 +1,16 @@ version: 2 sources: -# Base Tables + # Base Tables - name: solana - description: "Solana raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } tables: - name: blocks loaded_at_field: time - name: transactions - loaded_at_field: block_time - description: "A Solana transaction contains a compact-array of signatures, followed by a message. Each item in the signatures array is a digital signature of the given message.." + meta: + docs_slug: /solana/transactions + short_description: The 'solana.transactions' table contains detailed information about transactions on the Solana blockchain, including account keys, block data, transaction data, and more. + description: '{{ doc("solana_transactions_doc") }}' columns: - name: account_keys description: "Array of addresses" @@ -63,8 +62,10 @@ sources: description: "Success" - name: rewards - loaded_at_field: block_time - description: "A Solana transaction contains a compact-array of signatures, followed by a message. Each item in the signatures array is a digital signature of the given message.." + description: '{{ doc("solana_rewards_doc") }}' + meta: + docs_slug: /solana/rewards + short_description: The `solana.rewards` table contains detailed information about rewards on the Solana blockchain, including account keys, block data, transaction data, and more. columns: - *block_date - *block_hash @@ -84,8 +85,10 @@ sources: description: "Vote account commission when the reward was credited, only present for voting and staking rewards" - name: account_activity - loaded_at_field: block_time - description: "A Solana transaction contains a compact-array of signatures, followed by a message. Each item in the signatures array is a digital signature of the given message.." + description: '{{ doc("solana_account_activity_doc") }}' + meta: + docs_slug: /solana/account_activity + short_description: The `solana.account_activity` table contains detailed information about account activity on the Solana blockchain, including account keys, block data, transaction data, and more. columns: - *block_slot - *block_hash @@ -121,8 +124,7 @@ sources: description: "The address of the mint token associated with this account" - name: instruction_calls - loaded_at_field: block_time - description: "This is an unnested table of solana.transactions. There can be multiple instructions in a transaction, so having an exploded view here will make it a little easier to work with the data" + description: '{{ doc("solana_instruction_calls_doc") }}' columns: - *block_slot - *block_hash @@ -160,12 +162,17 @@ sources: description: "The log messages emitted by the transaction" - name: system_program_solana - description: "system program decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } + description: tables in the system_program_solana schema tables: - name: system_program_call_Transfer - loaded_at_field: call_block_time + meta: + docs_slug: '' + short_description: '' + description: '' + - name: system_program_call_TransferWithSeed - loaded_at_field: call_block_time \ No newline at end of file + meta: + docs_slug: '' + short_description: '' + description: '' + diff --git a/sources/_base_sources/other/solana_docs_block.md b/sources/_base_sources/other/solana_docs_block.md new file mode 100644 index 00000000000..090b6c9f6d1 --- /dev/null +++ b/sources/_base_sources/other/solana_docs_block.md @@ -0,0 +1,50 @@ +{% docs solana_transactions_doc %} +The `solana.transactions` table contains detailed information about transactions on the Solana blockchain. It includes data such as account keys, block information, transaction details, and more. Key columns include: + +- `account_keys`: Array of addresses involved in the transaction +- `block_date`, `block_hash`, `block_slot`, `block_time`: Information about the block containing the transaction +- `fee`: Transaction fee +- `id`: Unique transaction identifier +- `instructions`: Details of the transaction instructions +- `signatures`: Transaction signatures +- `success`: Indicates whether the transaction was successful +{% enddocs %} + +{% docs solana_rewards_doc %} +The `solana.rewards` table provides information about rewards on the Solana blockchain. It captures details about reward distributions, including: + +- `block_date`, `block_hash`, `block_slot`, `block_time`: Information about the block where the reward was processed +- `lamports`: Number of reward lamports credited or debited by the account +- `pre_balances` and `post_balances`: Account balances before and after the reward was applied +- `recipient`: Public key of the account that received the reward +- `reward_type`: Type of reward (e.g., 'Fee', 'Rent', 'Voting', 'Staking') +- `commission`: Vote account commission for voting and staking rewards +{% enddocs %} + +{% docs solana_account_activity_doc %} +The `solana.account_activity` table tracks detailed account activity on the Solana blockchain. It includes information such as: + +- `block_slot`, `block_hash`, `block_time`, `block_date`: Block details for the activity +- `address`: The address (public key) of the account +- `tx_id`, `tx_index`, `tx_success`: Transaction information +- `signed`: Indicates if the account signed the transaction +- `writeable`: Shows if the account had read-write access in the transaction +- `pre_balance`, `post_balance`, `balance_change`: Account balance information +- `pre_token_balance`, `post_token_balance`, `token_balance_change`: Token balance details +- `token_mint_address`: Address of the associated mint token +{% enddocs %} + +{% docs solana_instruction_calls_doc %} +The `solana.instruction_calls` table provides detailed information about instruction calls within Solana transactions. Key columns include: + +- `block_slot`, `block_hash`, `block_time`, `block_date`: Block information +- `index`, `tx_index`: Order and position of the instruction +- `outer_instruction_index`, `inner_instruction_index`: Indexes for outer and inner instructions +- `executing_account`: Account key of the program that executed the instruction +- `data`: Program input data +- `is_inner`: Indicates if the instruction is an inner instruction +- `account_arguments`: List of accounts passed to the program +- `tx_id`, `tx_success`: Transaction identifier and status +- `log_messages`: Log messages emitted by the transaction +{% enddocs %} + diff --git a/sources/_base_sources/other/starknet_base_sources.yml b/sources/_base_sources/other/starknet_base_sources.yml new file mode 100644 index 00000000000..1650cd3e9e6 --- /dev/null +++ b/sources/_base_sources/other/starknet_base_sources.yml @@ -0,0 +1,201 @@ +version: 2 +sources: + - name: starknet + description: tables in the starknet schema + tables: + - name: transactions + meta: + docs_slug: /starknet/transactions + short_description: 'Table containing detailed information about Starknet transactions' + description: '{{ doc("starknet_transactions_doc") }}' + columns: + - name: block_date + description: "The UTC date of the block in which this transaction was included" + - name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - name: block_number + description: "The sequential number of the block containing this transaction" + - name: block_l1_da_mode + description: "The data availability mode for the block (BLOB or CALLDATA)" + - name: block_l1_data_gas_price_in_fri + description: "L1 data gas price in FRI (for v3+ transactions)" + - name: block_l1_data_gas_price_in_wei + description: "L1 data gas price in wei (for pre-v3 transactions)" + - name: block_l1_gas_price_in_fri + description: "L1 gas price in FRI (for v3+ transactions)" + - name: block_l1_gas_price_in_wei + description: "L1 gas price in wei (for pre-v3 transactions)" + - name: block_starknet_version + description: "Version of Starknet used for this block" + - name: block_status + description: "Status of the block (ACCEPTED_ON_L1 or ACCEPTED_ON_L2)" + - name: fee_data_availability_mode + description: "Storage domain of the account's balance for fee charging (L1 or L2)" + - name: index + description: "Position of this transaction within its containing block" + - name: max_fee + description: "Maximum fee the transaction initiator is willing to pay" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: nonce_data_availability_mode + description: "Data availability mode for the nonce" + - name: resource_bounds_l1_gas_max_amount + description: "Maximum amount of L1 gas resources allowed for the transaction" + - name: resource_bounds_l1_gas_max_price_per_unit + description: "Maximum price per unit of L1 gas resources" + - name: tip + description: "Additional fee paid as a tip" + - name: type + description: "Type of transaction (INVOKE, L1_HANDLER, DECLARE, DEPLOY_ACCOUNT, or DEPLOY)" + - name: version + description: "Version of the transaction structure" + - name: actual_fee_amount + description: "Actual amount of fee paid for the transaction" + - name: actual_fee_unit + description: "Unit of the actual fee (wei or fri)" + - name: execution_resources_bitwise_builtin_applications + description: "Number of bitwise builtin applications used in execution" + - name: execution_resources_data_availability_l1_gas + description: "Amount of L1 gas used for data availability" + - name: execution_resources_data_availability_l1_data_gas + description: "Amount of L1 data gas used for data availability" + - name: execution_resources_ec_op_builtin_applications + description: "Number of EC operation builtin applications used in execution" + - name: execution_resources_ecdsa_builtin_applications + description: "Number of ECDSA builtin applications used in execution" + - name: execution_resources_keccak_builtin_applications + description: "Number of Keccak builtin applications used in execution" + - name: execution_resources_memory_holes + description: "Number of memory holes used in execution" + - name: execution_resources_pedersen_builtin_applications + description: "Number of Pedersen builtin applications used in execution" + - name: execution_resources_poseidon_builtin_applications + description: "Number of Poseidon builtin applications used in execution" + - name: execution_resources_range_check_builtin_applications + description: "Number of range check builtin applications used in execution" + - name: execution_resources_segment_arena_builtin + description: "Number of segment arena builtin applications used in execution" + - name: execution_resources_steps + description: "Number of steps used in execution" + - name: execution_status + description: "Status of the transaction execution" + - name: finality_status + description: "Finality status of the transaction" + - name: receipt_type + description: "Type of receipt for the transaction" + - name: block_hash + description: "Unique identifier (hash) of the block containing this transaction" + - name: block_new_root + description: "New state root after this block" + - name: block_parent_hash + description: "Hash of the previous block in the blockchain" + - name: block_sequencer_address + description: "Address of the sequencer who produced this block" + - name: calldata + description: "Input data for the transaction" + - name: class_hash + description: "Hash of the contract class" + - name: compiled_class_hash + description: "Hash of the compiled contract class" + - name: constructor_calldata + description: "Calldata for contract constructor" + - name: contract_address + description: "Address of the contract involved in the transaction" + - name: contract_address_salt + description: "Salt used in contract address generation" + - name: entry_point_selector + description: "Selector of the contract entry point" + - name: hash + description: "Unique identifier (hash) of this transaction" + - name: sender_address + description: "Address of the account that initiated this transaction" + - name: signature + description: "Signature of the transaction" + - name: message_hash + description: "Hash of the message in the transaction" + - name: messages_sent + description: "Messages sent during the transaction" + - name: revert_reason + description: "Reason for transaction revert, if applicable" + - name: transaction_hash + description: "Hash of the transaction" + - name: state_diff + description: "State difference caused by this transaction" + - name: blocks + meta: + docs_slug: /starknet/blocks + short_description: 'Table containing information about Starknet blocks' + description: '{{ doc("starknet_blocks_doc") }}' + columns: + - name: date + description: "The UTC date of this block" + - name: number + description: "The sequential number of this block in the blockchain" + - name: time + description: "The exact UTC timestamp when this block was added to the chain" + - name: l1_da_mode + description: "The data availability mode for the block (BLOB or CALLDATA)" + - name: l1_data_gas_price_in_fri + description: "L1 data gas price in FRI (for v3+ transactions)" + - name: l1_data_gas_price_in_wei + description: "L1 data gas price in wei (for pre-v3 transactions)" + - name: l1_gas_price_in_fri + description: "L1 gas price in FRI (for v3+ transactions)" + - name: l1_gas_price_in_wei + description: "L1 gas price in wei (for pre-v3 transactions)" + - name: starknet_version + description: "Version of Starknet used for this block" + - name: tx_count + description: "Number of transactions in this block" + - name: hash + description: "Unique identifier (hash) of this block" + - name: new_root + description: "New state root after this block" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: sequencer_address + description: "Address of the sequencer who produced this block" + - name: events + meta: + docs_slug: /starknet/events + short_description: 'Table containing information about events emitted on Starknet' + description: '{{ doc("starknet_events_doc") }}' + columns: + - name: block_date + description: "The UTC date of the block in which this event was emitted" + - name: block_time + description: "The exact UTC timestamp of the block in which this event was emitted" + - name: block_number + description: "The sequential number of the block containing this event" + - name: block_l1_da_mode + description: "The data availability mode for the block (BLOB or CALLDATA)" + - name: block_l1_data_gas_price_in_fri + description: "L1 data gas price in FRI for the block (for v3+ transactions)" + - name: block_l1_data_gas_price_in_wei + description: "L1 data gas price in wei for the block (for pre-v3 transactions)" + - name: block_l1_gas_price_in_fri + description: "L1 gas price in FRI for the block (for v3+ transactions)" + - name: block_l1_gas_price_in_wei + description: "L1 gas price in wei for the block (for pre-v3 transactions)" + - name: block_starknet_version + description: "Version of Starknet used for the block containing this event" + - name: block_status + description: "Status of the block containing this event (ACCEPTED_ON_L1 or ACCEPTED_ON_L2)" + - name: event_index + description: "Index of this event within the transaction" + - name: block_hash + description: "Unique identifier (hash) of the block containing this event" + - name: block_new_root + description: "New state root after the block containing this event" + - name: block_parent_hash + description: "Hash of the previous block in the blockchain" + - name: block_sequencer_address + description: "Address of the sequencer who produced the block containing this event" + - name: data + description: "The data associated with the event" + - name: keys + description: "The keys associated with the event" + - name: from_address + description: "The address of the L2 contract sending the message" + - name: class_hash + description: "Hash of the contract class that emitted this event" diff --git a/sources/_base_sources/other/starknet_docs_block.md b/sources/_base_sources/other/starknet_docs_block.md new file mode 100644 index 00000000000..48c131f2419 --- /dev/null +++ b/sources/_base_sources/other/starknet_docs_block.md @@ -0,0 +1,12 @@ +{% docs starknet_transactions_doc %} +This table contains information about all transactions on the Starknet blockchain, including both user-initiated and system transactions. Transactions are the actions that modify the state of the blockchain, such as transfers of tokens or the execution of smart contracts. Each transaction is uniquely identified and linked to the block in which it was included. +{% enddocs %} + +{% docs starknet_blocks_doc %} +This table represents the blocks in the Starknet blockchain. A block is a collection of transactions, and is identified by a unique block identifier. Each block contains a timestamp and a reference to the previous block hash, forming a chain of blocks. The block structure is crucial for the blockchain’s integrity and security, ensuring a verifiable and tamper-evident ledger. +{% enddocs %} + +{% docs starknet_events_doc %} +This table captures the events that are emitted by smart contracts on the Starknet blockchain. Events are used to log significant actions and changes in smart contracts, such as token transfers or updates to contract states. Each event is linked to the transaction that triggered it, providing a detailed audit trail of contract interactions. +{% enddocs %} + diff --git a/sources/_base_sources/other/tron_base_sources.yml b/sources/_base_sources/other/tron_base_sources.yml new file mode 100644 index 00000000000..00553304d97 --- /dev/null +++ b/sources/_base_sources/other/tron_base_sources.yml @@ -0,0 +1,119 @@ +version: 2 +sources: + - name: tron + description: tables in the tron schema + tables: + - name: transactions + meta: + docs_slug: /tron/transactions + short_description: + description: '{{ doc("tron_transactions_doc") }}' + columns: + - name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - name: block_number + description: "The sequential number of the block containing this transaction" + - name: value + description: "Amount of TRX sent from sender to recipient (if any), measured in sun (1 TRX = 10^6 sun)" + - name: gas_limit + description: "Maximum number of energy units this transaction can consume" + - name: gas_price + description: "Price per unit of energy for this transaction, denominated in sun" + - name: gas_used + description: "Actual amount of energy units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per energy unit the initiator is willing to pay" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per energy unit the initiator is willing to pay as a tip" + - name: priority_fee_per_gas + description: "Actual additional fee per energy unit paid as a tip" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - name: from + description: "Address of the account that initiated and signed this transaction" + - name: to + description: "Address of the recipient account or contract for this transaction" + - name: block_hash + description: "Unique identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for energy optimization" + - name: block_date + description: "The UTC date of the block in which this transaction was included" + - name: blocks + meta: + docs_slug: /tron/blocks + short_description: "The tron.blocks table contains information about Tron blocks. Each row represents a single block." + description: '{{ doc("tron_blocks_doc") }}' + columns: + - name: time + description: "Timestamp when this block was added to the chain" + - name: number + description: "Sequential position of this block in the blockchain" + - name: gas_limit + description: "Maximum amount of energy that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of energy actually consumed by all transactions in this block" + - name: difficulty + description: "Measure of how difficult it was to produce this block (may be deprecated in Tron)" + - name: total_difficulty + description: "Total chain difficulty up to this block (may be deprecated in Tron)" + - name: size + description: "Size of this block in bytes" + - name: base_fee_per_gas + description: "Minimum fee per energy unit required for transaction inclusion in this block" + - name: hash + description: "Unique identifier (hash) of this block" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: miner + description: "Address of the block producer who produced this block" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in Tron)" + - name: date + description: "The UTC date when this block was added to the chain" + - name: logs + meta: + docs_slug: /tron/logs + short_description: "The tron.logs table contains information about event logs emitted by smart contracts on the Tron blockchain." + description: '{{ doc("tron_logs_doc") }}' + columns: + - name: block_time + description: "The exact UTC timestamp when the block containing this log was added to the chain" + - name: block_number + description: "The sequential number of the block containing this log" + - name: block_hash + description: "Unique identifier (hash) of the block containing this log" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: tx_hash + description: "Unique identifier (hash) of the transaction containing this log" + - name: index + description: "Position of this log within the block" + - name: tx_index + description: "Position of the parent transaction within its containing block" + - name: block_date + description: "The UTC date of the block in which this log was included" + - name: tx_from + description: "Address of the account that initiated the transaction containing this log" + - name: tx_to + description: "Address of the recipient account or contract for the transaction containing this log" diff --git a/sources/_base_sources/other/tron_docs_block.md b/sources/_base_sources/other/tron_docs_block.md new file mode 100644 index 00000000000..df706232ac9 --- /dev/null +++ b/sources/_base_sources/other/tron_docs_block.md @@ -0,0 +1,38 @@ +{% docs tron_transactions_doc %} +The `tron.transactions` table contains detailed information about transactions on the Tron blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Transaction type (e.g., TRX transfer, smart contract interaction) +- Status: success or failure +- Energy usage and fees +- Contract data for smart contract interactions + +This table is used for analyzing transaction patterns, energy consumption, value transfers, and overall network activity on Tron. +{% enddocs %} + +{% docs tron_blocks_doc %} +The `tron.blocks` table contains information about Tron blocks. It provides essential data about each block in the Tron blockchain, including: + +- Block number and hash +- Timestamp +- Parent block hash +- Number of transactions +- Block size +- Witness address (block producer) + +This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance on the Tron network. +{% enddocs %} + +{% docs tron_logs_doc %} +The `tron.logs` table contains event logs emitted by smart contracts on the Tron blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Event topics (including the event signature hash) +- Raw data + +This table is used for tracking contract events and state changes on the Tron network, enabling detailed analysis of smart contract interactions and decentralized application (DApp) activity. +{% enddocs %} + diff --git a/sources/_base_sources/polygon_base_sources.yml b/sources/_base_sources/polygon_base_sources.yml deleted file mode 100644 index 450bcae4c8e..00000000000 --- a/sources/_base_sources/polygon_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: polygon - description: "Polygon raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A Polygon transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of MATIC transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of MATIC - each gwei is equal to 10-9 MATIC" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A Polygon trace is a small atomic action that modify the internal state of the Polygon Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Polygon trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Polygon smart contract generating the log" - - name: function_name - description: "Name of the Polygon smart contract function generating the log" - - name: namespace - description: "Namespace of the Polygon smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A polygon log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the polygon smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Polygon log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Polygon smart contract generating the log" - - name: contract_name - description: "Name of the Polygon smart contract generating the log" - - name: event_name - description: "Name of the Polygon smart contract event generating the log" - - name: namespace - description: "Namespace of the Polygon smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Polygon; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Polygon creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_polygon - description: "Transfers events for ERC20 tokens on Polygon." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Polygon." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Polygon." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_polygon - description: "Transfers events for ERC1155 tokens on Polygon." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Polygon." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Polygon." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Polygon." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_polygon - description: "Transfers events for ERC721 tokens on Polygon." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Polygon." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Polygon." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Polygon." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator diff --git a/sources/_base_sources/scroll_base_sources.yml b/sources/_base_sources/scroll_base_sources.yml deleted file mode 100644 index d36150daca8..00000000000 --- a/sources/_base_sources/scroll_base_sources.yml +++ /dev/null @@ -1,434 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: scroll - description: "Scroll raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A Scroll transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of Ether transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of Ether - each gwei is equal to 10-9 Ether" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A Scroll trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Scroll trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Scroll smart contract generating the log" - - name: function_name - description: "Name of the Scroll smart contract function generating the log" - - name: namespace - description: "Namespace of the Scroll smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A Scroll log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the Scroll smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Scroll log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Scroll smart contract generating the log" - - name: contract_name - description: "Name of the Scroll smart contract generating the log" - - name: event_name - description: "Name of the Scroll smart contract event generating the log" - - name: namespace - description: "Namespace of the Scroll smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Scroll; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Scroll creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_scroll - description: "Transfers events for ERC20 tokens on Scroll." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Scroll." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - &evt_tx_from - name: evt_tx_from - description: "transaction from address" - - &evt_tx_to - name: evt_tx_to - description: "transaction to address" - - &evt_tx_index - name: evt_tx_index - description: "transaction index" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Scroll." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_scroll - description: "Transfers events for ERC1155 tokens on Scroll." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Scroll." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Scroll." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Scroll." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_scroll - description: "Transfers events for ERC721 tokens on Scroll." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Scroll." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Scroll." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Scroll." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *approved - - *owner - - *operator diff --git a/sources/_base_sources/sei_base_sources.yml b/sources/_base_sources/sei_base_sources.yml deleted file mode 100644 index 5ebc2ee2abf..00000000000 --- a/sources/_base_sources/sei_base_sources.yml +++ /dev/null @@ -1,426 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: sei - description: "Sei raw tables including transactions, traces and logs" - tables: - - name: transactions - description: "A Sei transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &block_number - name: block_number - - &value - name: value - description: "Amount of asset transferred from sender to recipient" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: priority_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - name: chain_id - - &block_date - name: block_date - description: "Block event date in UTC" - - - name: traces - description: "A Sei trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - - &tx_from - name: tx_from - - &tx_to - name: tx_to - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - - name: revert_reason - - *block_date - - - name: traces_decoded - description: "A Sei trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: namespace - description: "Namespace of the Sei smart contract generating the log" - - name: contract_name - description: "Name of the Sei smart contract generating the log" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - *tx_from - - *tx_to - - name: signature - description: "Signature of the event" - - name: function_name - description: "Name of the Sei smart contract function generating the log" - - - name: logs - description: "A Base log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the Base smart contract generating the log" - - name: topic0 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic1 - description: "Second topic" - - name: topic2 - description: "Third topic" - - name: topic3 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - *block_date - - *tx_from - - *tx_to - - - name: logs_decoded - description: "A Sei log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: namespace - description: "Namespace of the Sei smart contract generating the log" - - name: contract_name - description: "Name of the Sei smart contract generating the log" - - name: contract_address - description: "Address of the Sei smart contract generating the log" - - *tx_hash - - *tx_from - - *tx_to - - name: index - description: "Log index" - - name: signature - description: "Signature of the event" - - name: event_name - description: "Name of the Sei smart contract event generating the log" - - - name: blocks - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: time - - name: number - - name: gas_limit - - name: gas_used - - name: difficulty - - name: total_difficulty - - name: size - - name: base_fee_per_gas - - name: hash - - name: parent_hash - - name: miner - - name: nonce - - name: state_root - - name: transactions_root - - name: receipts_root - - name: date - - - name: contracts - description: "A view keeping track of what contracts are decoded on Dune on Sei; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi_id - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the Sei contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - description: "Sei creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - name: block_month - - # ERC Transfer Tables - - name: erc20_sei - description: "Transfers events for ERC20 tokens on Sei." - tables: - - name: evt_transfer - description: "Transfers events for ERC20 tokens on Sei." - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_tx_from - name: evt_tx_from - - &evt_tx_to - name: evt_tx_to - - &evt_tx_index - name: evt_tx_index - - &evt_index - name: evt_index - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - - &evt_block_date - name: evt_block_date - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_Approval - description: "Approval events for ERC20 tokens on Sei." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_block_date - - &owner - name: owner - - &spender - name: spender - - *value - - - name: erc1155_sei - description: "Transfers events for ERC1155 tokens on Sei." - tables: - - name: evt_transfersingle - description: "Single transfers events for ERC1155 tokens on Sei." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *evt_index - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_block_date - - *from - - name: id - description: "ERC1155 token ID" - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." - - *to - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - description: "Batch transfers events for ERC1155 tokens on Sei." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *evt_index - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_block_date - - *from - - name: ids - description: "ERC1155 token IDs" - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." - - *to - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - description: "Approval for all events for ERC1155 tokens on Sei." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *evt_index - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_block_date - - name: account - description: "Account" - - &approved - name: approved - description: "Is approved" - - &operator - name: operator - description: "Opperator" - - - name: erc721_sei - description: "Transfers events for ERC721 tokens on Sei." - tables: - - name: evt_transfer - description: "Transfers events for ERC721 tokens on Sei." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *evt_index - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_block_date - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - description: "Approval events for ERC721 tokens on Sei." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *evt_index - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_block_date - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - description: "Approval for all events for ERC721 tokens on Sei." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *evt_index - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_block_date - - *approved - - *operator diff --git a/sources/_base_sources/starknet_base_sources.yml b/sources/_base_sources/starknet_base_sources.yml deleted file mode 100644 index bd2be34c0c0..00000000000 --- a/sources/_base_sources/starknet_base_sources.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: starknet - tables: - - name: transactions - - name: blocks - - name: calls - - name: events - - name: receipts \ No newline at end of file diff --git a/sources/_base_sources/zkevm_base_sources.yml b/sources/_base_sources/zkevm_base_sources.yml deleted file mode 100644 index ce1c896b47d..00000000000 --- a/sources/_base_sources/zkevm_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: zkevm - description: "polygon zkEVM raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A polygon zkEVM transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of polygon zkEVM transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of polygon zkEVM - each gwei is equal to 10-9 polygon zkEVM" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A polygon zkEVM trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A polygon zkEVM trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the polygon zkEVM smart contract generating the log" - - name: function_name - description: "Name of the polygon zkEVM smart contract function generating the log" - - name: namespace - description: "Namespace of the polygon zkEVM smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A polygon zkEVM log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the polygon zkEVM smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A polygon zkEVM log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the polygon zkEVM smart contract generating the log" - - name: contract_name - description: "Name of the polygon zkEVM smart contract generating the log" - - name: event_name - description: "Name of the polygon zkEVM smart contract event generating the log" - - name: namespace - description: "Namespace of the polygon zkEVM smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on polygon zkEVM; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "polygon zkEVM creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_zkevm - description: "Transfers events for ERC20 tokens on polygon zkEVM." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on polygon zkEVM." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on polygon zkEVM." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_zkevm - description: "Transfers events for ERC1155 tokens on polygon zkEVM." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on polygon zkEVM." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on polygon zkEVM." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on polygon zkEVM." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_zkevm - description: "Transfers events for ERC721 tokens on polygon zkEVM." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on polygon zkEVM." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on polygon zkEVM." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on polygon zkEVM." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/zksync_base_sources.yml b/sources/_base_sources/zksync_base_sources.yml deleted file mode 100644 index c50a2cd0a97..00000000000 --- a/sources/_base_sources/zksync_base_sources.yml +++ /dev/null @@ -1,404 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: zksync - description: "zkSync raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A zkSync transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of zkSync transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of zkSync - each gwei is equal to 10-9 zkSync" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A zkSync trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A zkSync trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the zkSync smart contract generating the log" - - name: function_name - description: "Name of the zkSync smart contract function generating the log" - - name: namespace - description: "Namespace of the zkSync smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A zkSync log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the zkSync smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A zkSync log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the zkSync smart contract generating the log" - - name: contract_name - description: "Name of the zkSync smart contract generating the log" - - name: event_name - description: "Name of the zkSync smart contract event generating the log" - - name: namespace - description: "Namespace of the zkSync smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on zkSync; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "zkSync creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_zksync - description: "Transfers events for ERC20 tokens on zkSync." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on zkSync." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on zkSync." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_zksync - description: "Transfers events for ERC1155 tokens on zkSync." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on zkSync." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on zkSync." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on zkSync." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_zksync - description: "Transfers events for ERC721 tokens on zkSync." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on zkSync." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on zkSync." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on zkSync." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *approved - - *owner - - *operator \ No newline at end of file diff --git a/sources/_base_sources/zora_base_sources.yml b/sources/_base_sources/zora_base_sources.yml deleted file mode 100644 index 24bc0b2932c..00000000000 --- a/sources/_base_sources/zora_base_sources.yml +++ /dev/null @@ -1,434 +0,0 @@ -version: 2 - -sources: - # Base Tables - - name: zora - description: "Zora raw tables including transactions, traces and logs." - freshness: - warn_after: { count: 12, period: hour } - tables: - - name: transactions - loaded_at_field: block_time - description: "A Zora transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." - columns: - - &block_date - name: block_date - description: "Block event date in UTC" - - &block_time - name: block_time - description: "Timestamp for block event time in UTC" - - &value - name: value - description: "Amount of Ether transferred from sender to recipient" - - &block_number - name: block_number - description: "Block number" - - name: gas_limit - description: "Maximum amount of gas units that can be consumed by the transaction" - - name: gas_price - description: "Gas price denoted in gwei, which itself is a denomination of Ether - each gwei is equal to 10-9 Ether" - - name: gas_used - description: "Number of gas units consumed by the transaction" - - name: max_fee_per_gas - description: "Maximum amount of gas willing to be paid for the transaction" - - name: max_priority_fee_per_gas - description: "Maximum amount of gas to be included as a tip to the miner" - - name: base_fee_per_gas - description: "Market price for gas" - - name: nonce - description: "Number of confirmed transactions previously sent by this account" - - name: index - description: "Transaction index" - - &success - name: success - description: "Whether the transaction was completed successfully" - - &from - name: from - description: "Wallet address that initiated the transaction" - - &to - name: to - description: "Wallet address that received the transaction" - - &block_hash - name: block_hash - description: "Primary key of the block" - - name: data - description: "Any binary data payload" - - name: hash - description: "Primary key of the transaction" - tests: - - unique - - not_null - - name: type - description: "Transaction type" - - name: access_list - description: "Specifies a list of addresses and storage keys" - - - name: traces - loaded_at_field: block_time - description: "A Zora trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." - columns: - - *block_date - - *block_time - - *block_number - - *value - - name: gas - description: "Amount of gas consumed by the trace" - - name: gas_used - description: "Number of gas units used by the trace" - - *block_hash - - name: success - description: "Whether the trace was completed successfully" - - &tx_index - name: tx_index - description: "Transaction index" - - name: subtraces - description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" - - name: error - description: "Error log" - - name: tx_success - description: "Whether the transaction was completed sucessfully" - - &tx_hash - name: tx_hash - description: "Primary key of the transaction" - - name: from - description: "Wallet address that initiated the trace" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - name: type - description: "Type of trace (e.g., call, create, suicide)" - - name: address - description: "Address of the trace creator" - - name: code - description: "Raw EVM code for the trace" - - name: call_type - description: "Hexadecimal representations of the trace's call type" - - name: input - description: "Input data for the trace" - - name: output - description: "Output data for the trace" - - name: refund_address - description: "Refund Address" - - - name: traces_decoded - loaded_at_field: block_time - description: "A Zora trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI" - columns: - - *block_date - - *block_time - - *block_number - - name: contract_name - description: "Name of the Zora smart contract generating the log" - - name: function_name - description: "Name of the Zora smart contract function generating the log" - - name: namespace - description: "Namespace of the Zora smart contract generating the log" - - name: signature - description: "Signature of the event" - - name: to - description: "Wallet address that received the trace" - - name: trace_address - description: "All returned traces, gives the exact location in the call trace" - - *tx_hash - - - name: logs - loaded_at_field: block_time - description: "A Zora log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." - columns: - - *block_date - - *block_time - - *block_number - - *block_hash - - name: contract_address - description: "Address of the Zora smart contract generating the log" - - name: topic1 - description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." - - name: topic2 - description: "Second topic" - - name: topic3 - description: "Third topic" - - name: topic4 - description: "Fourth topic" - - name: data - description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." - - *tx_hash - - name: index - description: "Log index" - - *tx_index - - - name: logs_decoded - loaded_at_field: block_time - description: "A Zora log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable." - columns: - - *block_date - - *block_time - - *block_number - - name: index - description: "Log index" - - name: contract_address - description: "Address of the Zora smart contract generating the log" - - name: contract_name - description: "Name of the Zora smart contract generating the log" - - name: event_name - description: "Name of the Zora smart contract event generating the log" - - name: namespace - description: "Namespace of the Zora smart contract generating the log" - - name: signature - description: "Signature of the event" - - *tx_hash - - - name: blocks - freshness: - warn_after: { count: 1, period: day } - loaded_at_field: time - description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." - columns: - - name: base_fee_per_gas - - name: difficulty - - name: gas_limit - - name: gas_used - - name: hash - - name: miner - - name: nonce - - name: number - - name: parent_hash - - name: size - - name: time - - name: total_difficulty - - - name: contracts - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 3, period: day } - loaded_at_field: created_at - description: "A view keeping track of what contracts are decoded on Dune on Zora; contains information associated with the decoded contract such as namespace, name, address, ABI." - columns: - - name: abi - description: "ABI of the decoded contract" - - name: address - description: "Address of the decoded contract" - - name: from - description: "Address that created/deployed this contract" - - name: code - description: "Code for contract creation" - - name: name - description: "Name of the decoded contract" - - name: namespace - description: "Namesapce of the decoded contract" - - name: dynamic - description: "Boolean indicating whether the contract is dynamic or not" - - name: base - description: "Boolean indicating whether the contract is the base contract or not" - - name: factory - description: "Boolean indicating whether the contract is a factory contract or not" - - name: detection_source - description: "Detection source: 'factory', 'base', or 'dynamic'" - tests: - - accepted_values: - values: ["factory", "base", "dynamic"] - - name: created_at - description: "Timestamp for contract creation" - - - name: creation_traces - loaded_at_field: block_time - description: "Zora creation traces" - columns: - - *block_time - - *block_number - - *tx_hash - - name: address - description: "Contract address created" - - name: from - description: "Contract creator address" - - name: code - description: "Contract code" - - # ERC Transfer Tables - - name: erc20_zora - description: "Transfers events for ERC20 tokens on Zora." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC20 tokens on Zora." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - columns: - - name: contract_address - description: "ERC20 token contract address" - - &evt_tx_hash - name: evt_tx_hash - description: "Transaction hash of the event" - - &evt_index - name: evt_index - description: "Event index" - - &evt_block_time - name: evt_block_time - description: "Timestamp for block event time in UTC" - - &evt_block_number - name: evt_block_number - description: "Event block number" - - *from - - *to - - name: value - description: "Amount of ERC20 token transferred" - - &evt_tx_from - name: evt_tx_from - description: "transaction from address" - - &evt_tx_to - name: evt_tx_to - description: "transaction to address" - - &evt_tx_index - name: evt_tx_index - description: "transaction index" - - - name: evt_approval - loaded_at_field: evt_block_time - description: "Approval events for ERC20 tokens on Zora." - columns: - - name: contract_address - description: "ERC20 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - name: approved - description: "Approved" - - name: owner - description: "Owner" - - name: spender - description: "Spender" - - name: value - description: "Amount of ERC20 token transferred" - - - name: erc1155_zora - description: "Transfers events for ERC1155 tokens on Zora." - tables: - - name: evt_transfersingle - loaded_at_field: evt_block_time - description: "Single transfers events for ERC1155 tokens on Zora." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: id - description: "ERC1155 token ID" - - name: value - description: "Amount of ERC1155 token transferred" - - - name: evt_transferbatch - loaded_at_field: evt_block_time - description: "Batch transfers events for ERC1155 tokens on Zora." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - name: operator - description: "Addresses authorized (or approved) by a NFT owner to spend all of his token Ids." - - *from - - *to - - name: ids - description: "ERC1155 token IDs" - - name: values - description: "Amounts of ERC1155 token transferred" - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC1155 tokens on Zora." - columns: - - name: contract_address - description: "ERC1155 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - &approved - name: approved - description: "Is approved" - - &owner - name: owner - description: "Owner" - - name: account - description: "Account" - - &operator - name: operator - description: "Opperator" - - - name: erc721_zora - description: "Transfers events for ERC721 tokens on Zora." - tables: - - name: evt_transfer - loaded_at_field: evt_block_time - description: "Transfers events for ERC721 tokens on Zora." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *from - - *to - - name: tokenId - description: "ERC721 token ID." - - - name: evt_Approval - loaded_at_field: evt_block_time - description: "Approval events for ERC721 tokens on Zora." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *approved - - *owner - - name: tokenId - description: "ERC721 token ID." - - - name: evt_ApprovalForAll - loaded_at_field: evt_block_time - description: "Approval for all events for ERC721 tokens on Zora." - columns: - - name: contract_address - description: "ERC721 token contract address" - - *evt_tx_hash - - *evt_index - - *evt_block_time - - *evt_block_number - - *evt_tx_from - - *evt_tx_to - - *evt_tx_index - - *approved - - *owner - - *operator diff --git a/sources/_base_sources/dune_upload_sources.yml b/sources/_datasets/dune_upload_sources.yml similarity index 100% rename from sources/_base_sources/dune_upload_sources.yml rename to sources/_datasets/dune_upload_sources.yml diff --git a/sources/_datasets/labels/_sources.yml b/sources/_datasets/labels/_sources.yml index 6ee49e30f34..afcaa15c9e8 100644 --- a/sources/_datasets/labels/_sources.yml +++ b/sources/_datasets/labels/_sources.yml @@ -4,4 +4,10 @@ sources: - name: labels tables: - name: owner_addresses + description: "Verified owner labels of addresses" + meta: + docs_slug: /curated/labels/owners/owner-addresses - name: owner_details + description: "Verified owner labels of addresses" + meta: + docs_slug: /curated/labels/owners/owner-details diff --git a/sources/_base_sources/community_base_sources.yml b/sources/_datasets/reservoir/ethereum/community_base_sources.yml similarity index 95% rename from sources/_base_sources/community_base_sources.yml rename to sources/_datasets/reservoir/ethereum/community_base_sources.yml index db6da8fabc9..983e89be1b3 100644 --- a/sources/_base_sources/community_base_sources.yml +++ b/sources/_datasets/reservoir/ethereum/community_base_sources.yml @@ -7,7 +7,7 @@ sources: tables: - name: collections - name: collection_floor_ask_events - loaded_at_field: created_at + description: "todo: add reservoir table description!" columns: - name: created_at diff --git a/sources/_sector/attestation/eas/linea/_sources.yml b/sources/_sector/attestation/eas/linea/_sources.yml new file mode 100644 index 00000000000..3e6233d1b08 --- /dev/null +++ b/sources/_sector/attestation/eas/linea/_sources.yml @@ -0,0 +1,12 @@ +version: 2 + +sources: + - name: eas_linea + tables: + - name: SchemaRegistry_evt_Registered + - name: SchemaRegistry_call_register + - name: attestationstation_v1_linea + tables: + - name: EAS_evt_Attested + - name: EAS_call_attest + - name: EAS_evt_Revoked diff --git a/sources/_sector/attestation/eas/nova/_sources.yml b/sources/_sector/attestation/eas/nova/_sources.yml new file mode 100644 index 00000000000..fa2e804987f --- /dev/null +++ b/sources/_sector/attestation/eas/nova/_sources.yml @@ -0,0 +1,10 @@ +version: 2 + +sources: + - name: eas_nova + tables: + - name: SchemaRegistry_evt_Registered + - name: SchemaRegistry_call_register + - name: EAS_evt_Attested + - name: EAS_call_attest + - name: EAS_evt_Revoked diff --git a/sources/_sector/contracts/zksync/_sources.yml b/sources/_sector/contracts/zksync/_sources.yml index ba9af089a3b..b1b4f847c9c 100644 --- a/sources/_sector/contracts/zksync/_sources.yml +++ b/sources/_sector/contracts/zksync/_sources.yml @@ -4,11 +4,9 @@ sources: # Base Tables - name: zksync_era_zksync description: "zkSync contracts on zkSyns." - freshness: - warn_after: { count: 12, period: hour } tables: - name: ContractDeployer_evt_ContractDeployed - loaded_at_field: evt_block_time + description: "zkSync contract deployed events." columns: - &bytecodeHash diff --git a/sources/_sector/dex/trades/arbitrum/_sources.yml b/sources/_sector/dex/trades/arbitrum/_sources.yml index f74a61f6246..70ac7417282 100644 --- a/sources/_sector/dex/trades/arbitrum/_sources.yml +++ b/sources/_sector/dex/trades/arbitrum/_sources.yml @@ -22,12 +22,19 @@ sources: tables: - name: Pool_evt_Swap - name: Factory_evt_PoolCreated + - name: sushiswap_v3_pool_arbitrum + tables: + - name: UniswapV3Pool_evt_Swap - name: arbswap_arbitrum tables: - name: SwapPair_evt_Swap - name: SwapFactory_evt_PairCreated - name: ArbswapStableSwapTwoPool_evt_TokenExchange - name: ArbswapStableSwapFactory_evt_NewStableSwapPair + - name: trader_joe_v2_2_arbitrum + tables: + - name: LBPair_evt_Swap + - name: LBFactory_evt_LBPairCreated - name: trader_joe_v2_1_arbitrum - name: trader_joe_arbitrum - name: pancakeswap_v2_arbitrum @@ -150,3 +157,8 @@ sources: tables: - name: V2Pool_evt_PoolSwap - name: V2Factory_evt_PoolCreated + - name: valantis_arbitrum + tables: + - name: SovereignPool_evt_Swap + - name: ProtocolFactory_evt_SovereignPoolDeployed + - name: HOT_evt_HotSwap diff --git a/sources/_sector/dex/trades/avalanche_c/_sources.yml b/sources/_sector/dex/trades/avalanche_c/_sources.yml index b4f95faf69e..dee39b04e68 100644 --- a/sources/_sector/dex/trades/avalanche_c/_sources.yml +++ b/sources/_sector/dex/trades/avalanche_c/_sources.yml @@ -18,6 +18,10 @@ sources: tables: - name: FraxswapPair_evt_Swap - name: FraxswapFactory_evt_PairCreated + - name: trader_joe_v2_2_avalanche_c + tables: + - name: LBPair_evt_Swap + - name: LBFactory_evt_LBPairCreated - name: trader_joe_v2_1_avalanche_c - name: trader_joe_avalanche_c - name: balancer_v2_avalanche_c diff --git a/sources/_sector/dex/trades/base/_sources.yml b/sources/_sector/dex/trades/base/_sources.yml index 47f050775e9..3af9b110190 100644 --- a/sources/_sector/dex/trades/base/_sources.yml +++ b/sources/_sector/dex/trades/base/_sources.yml @@ -48,6 +48,10 @@ sources: tables: - name: PancakePair_evt_Swap - name: PancakeFactory_evt_PairCreated + - name: baseswap_v3_base + tables: + - name: UniswapV3Pool_evt_Swap + - name: UniswapV3Factory_evt_PoolCreated - name: scale_base tables: - name: Pair_evt_Swap @@ -177,4 +181,8 @@ sources: - name: ClipperPackedVerifiedExchange_evt_Swapped - name: swaap_v2_base tables: - - name: Vault_evt_Swap \ No newline at end of file + - name: Vault_evt_Swap + - name: xchange_base + tables: + - name: XchangePair_evt_Swap + - name: XchangeFactory_evt_PairCreated \ No newline at end of file diff --git a/sources/_sector/dex/trades/bnb/_sources.yml b/sources/_sector/dex/trades/bnb/_sources.yml index 1db430935ac..a557c381e72 100644 --- a/sources/_sector/dex/trades/bnb/_sources.yml +++ b/sources/_sector/dex/trades/bnb/_sources.yml @@ -114,3 +114,6 @@ sources: - name: WooPP_evt_WooSwap - name: WooRouter_evt_WooRouterSwap - name: WooRouterV2_evt_WooRouterSwap + - name: swaap_v2_bnb + tables: + - name: Vault_evt_Swap \ No newline at end of file diff --git a/sources/_sector/dex/trades/ethereum/_sources.yml b/sources/_sector/dex/trades/ethereum/_sources.yml index b92f4ff7857..c5811187634 100644 --- a/sources/_sector/dex/trades/ethereum/_sources.yml +++ b/sources/_sector/dex/trades/ethereum/_sources.yml @@ -28,6 +28,8 @@ sources: - name: PancakePair_evt_Swap - name: PancakeFactory_evt_PairCreated - name: PancakeSwapMMPool_evt_Swap + - name: PancakeStableSwapTwoPool_evt_TokenExchange + - name: PancakeStableSwapFactory_evt_NewStableSwapPair - name: pancakeswap_v3_ethereum tables: - name: PancakeV3Pool_evt_Swap @@ -118,3 +120,8 @@ sources: - name: swaap_v2_ethereum tables: - name: Vault_evt_Swap + - name: valantis_ethereum + tables: + - name: SovereignPool_evt_Swap + - name: ProtocolFactory_evt_SovereignPoolDeployed + - name: HOT_evt_HotSwap diff --git a/sources/_sector/dex/trades/linea/_sources.yml b/sources/_sector/dex/trades/linea/_sources.yml index 28f26d0f493..9eeea50f2d2 100644 --- a/sources/_sector/dex/trades/linea/_sources.yml +++ b/sources/_sector/dex/trades/linea/_sources.yml @@ -39,4 +39,6 @@ sources: tables: - name: UniswapV3Pool_evt_Swap - name: UniswapV3Factory_evt_PoolCreated - + - name: swaap_v2_linea + tables: + - name: Vault_evt_Swap \ No newline at end of file diff --git a/sources/_sector/dex/trades/mantle/_sources.yml b/sources/_sector/dex/trades/mantle/_sources.yml index 20007c2dc24..6f497b70e2e 100644 --- a/sources/_sector/dex/trades/mantle/_sources.yml +++ b/sources/_sector/dex/trades/mantle/_sources.yml @@ -7,7 +7,15 @@ sources: - name: fusionx_mantle tables: - name: FusionXV3Factory_evt_PoolCreated + - name: FusionXV3Pool_evt_Swap - name: merchant_moe_mantle tables: - name: MoeFactory_evt_PairCreated - name: MoePair_evt_Swap + - name: agni_mantle + tables: + - name: AgniPool_evt_Swap + - name: AgniPoolDeployer_call_deploy + - name: swaap_v2_mantle + tables: + - name: Vault_evt_Swap \ No newline at end of file diff --git a/sources/_sector/dex/trades/nova/_sources.yml b/sources/_sector/dex/trades/nova/_sources.yml new file mode 100644 index 00000000000..f2d1948d0c8 --- /dev/null +++ b/sources/_sector/dex/trades/nova/_sources.yml @@ -0,0 +1,11 @@ +version: 2 + +sources: + - name: sushi_nova + tables: + - name: uniswapv2pair_evt_swap + - name: uniswapv2factory_evt_paircreated + - name: rcpswap_nova + tables: + - name: swappair_evt_swap + - name: swapfactory_evt_paircreated diff --git a/sources/_sector/dex/trades/scroll/_sources.yml b/sources/_sector/dex/trades/scroll/_sources.yml index 3657b4551bf..ff3763b407c 100644 --- a/sources/_sector/dex/trades/scroll/_sources.yml +++ b/sources/_sector/dex/trades/scroll/_sources.yml @@ -38,4 +38,6 @@ sources: tables: - name: V2Pool_evt_PoolSwap - name: V2Factory_evt_PoolCreated - + - name: swaap_v2_scroll + tables: + - name: Vault_evt_Swap \ No newline at end of file diff --git a/sources/_sector/dex/trades/zkevm/_sources.yml b/sources/_sector/dex/trades/zkevm/_sources.yml index 8074dc4de11..940adb33996 100644 --- a/sources/_sector/dex/trades/zkevm/_sources.yml +++ b/sources/_sector/dex/trades/zkevm/_sources.yml @@ -8,4 +8,7 @@ sources: - name: pancakeswap_v3_zkevm tables: - name: PancakeV3Pool_evt_Swap - - name: PancakeV3Factory_evt_PoolCreated \ No newline at end of file + - name: PancakeV3Factory_evt_PoolCreated + - name: clipper_zkevm + tables: + - name: ClipperPackedOracleVerifiedExchange_evt_Swapped \ No newline at end of file diff --git a/sources/_sector/dex/trades/zksync/_sources.yml b/sources/_sector/dex/trades/zksync/_sources.yml index 1b80956f79c..76c083d868d 100644 --- a/sources/_sector/dex/trades/zksync/_sources.yml +++ b/sources/_sector/dex/trades/zksync/_sources.yml @@ -88,4 +88,4 @@ sources: - name: Pair_evt_Swap - name: velocore_v2_zksync tables: - - name: VaultStorage_evt_Swap + - name: VaultStorage_evt_Swap \ No newline at end of file diff --git a/sources/_sector/lending/borrow/base/_sources.yml b/sources/_sector/lending/borrow/base/_sources.yml index 7dec2e8dbf3..702ec368e87 100644 --- a/sources/_sector/lending/borrow/base/_sources.yml +++ b/sources/_sector/lending/borrow/base/_sources.yml @@ -11,12 +11,16 @@ sources: tables: - name: cUSDCv3_evt_Supply - name: cUSDbCv3Comet_evt_Supply + - name: cWETHv3_evt_Supply - name: cUSDCv3_evt_Withdraw - name: cUSDbCv3Comet_evt_Withdraw + - name: cWETHv3_evt_Withdraw - name: cUSDCv3_evt_Transfer - name: cUSDbCv3Comet_evt_Transfer + - name: cWETHv3_evt_Transfer - name: cUSDCv3_evt_AbsorbDebt - name: cUSDbCv3Comet_evt_AbsorbDebt + - name: cWETHv3_evt_AbsorbDebt - name: seamlessprotocol_base tables: diff --git a/sources/_sector/lending/borrow/ethereum/_sources.yml b/sources/_sector/lending/borrow/ethereum/_sources.yml index b4a2204eb00..6eb32dd9418 100644 --- a/sources/_sector/lending/borrow/ethereum/_sources.yml +++ b/sources/_sector/lending/borrow/ethereum/_sources.yml @@ -18,6 +18,15 @@ sources: - name: Pool_evt_Borrow - name: Pool_evt_Repay - name: Pool_evt_LiquidationCall + - name: LidoPool_evt_Borrow + - name: LidoPool_evt_Repay + - name: LidoPool_evt_LiquidationCall + + - name: aave_v3_etherfi_ethereum + tables: + - name: PoolInstance_evt_Borrow + - name: PoolInstance_evt_Repay + - name: PoolInstance_evt_LiquidationCall - name: compound_v1_ethereum tables: @@ -38,12 +47,16 @@ sources: tables: - name: cUSDCv3_evt_Supply - name: cWETHv3_evt_Supply + - name: cUSDTv3_evt_Supply - name: cUSDCv3_evt_Withdraw - name: cWETHv3_evt_Withdraw + - name: cUSDTv3_evt_Withdraw - name: cUSDCv3_evt_Transfer - name: cWETHv3_evt_Transfer + - name: cUSDTv3_evt_Transfer - name: cUSDCv3_evt_AbsorbDebt - name: cWETHv3_evt_AbsorbDebt + - name: cUSDTv3_evt_AbsorbDebt - name: radiant_capital_ethereum tables: diff --git a/sources/_sector/lending/flashloans/ethereum/_sources.yml b/sources/_sector/lending/flashloans/ethereum/_sources.yml index d21c7d1eaaf..1b7f38ab725 100644 --- a/sources/_sector/lending/flashloans/ethereum/_sources.yml +++ b/sources/_sector/lending/flashloans/ethereum/_sources.yml @@ -12,6 +12,11 @@ sources: - name: aave_v3_ethereum tables: - name: Pool_evt_FlashLoan + - name: LidoPool_evt_FlashLoan + + - name: aave_v3_etherfi_ethereum + tables: + - name: PoolInstance_evt_FlashLoan - name: radiant_capital_ethereum tables: diff --git a/sources/_sector/lending/supply/base/_sources.yml b/sources/_sector/lending/supply/base/_sources.yml index 511aaf87f34..93a23a0e7cb 100644 --- a/sources/_sector/lending/supply/base/_sources.yml +++ b/sources/_sector/lending/supply/base/_sources.yml @@ -11,10 +11,13 @@ sources: tables: - name: cUSDCv3_evt_SupplyCollateral - name: cUSDbCv3Comet_evt_SupplyCollateral + - name: cWETHv3_evt_SupplyCollateral - name: cUSDCv3_evt_WithdrawCollateral - name: cUSDbCv3Comet_evt_WithdrawCollateral + - name: cWETHv3_evt_WithdrawCollateral - name: cUSDCv3_evt_AbsorbCollateral - name: cUSDbCv3Comet_evt_AbsorbCollateral + - name: cWETHv3_evt_AbsorbCollateral - name: seamlessprotocol_base tables: diff --git a/sources/_sector/lending/supply/ethereum/_sources.yml b/sources/_sector/lending/supply/ethereum/_sources.yml index 0c8bc86aa22..bc4108ff420 100644 --- a/sources/_sector/lending/supply/ethereum/_sources.yml +++ b/sources/_sector/lending/supply/ethereum/_sources.yml @@ -17,6 +17,15 @@ sources: - name: Pool_evt_Supply - name: Pool_evt_Withdraw - name: Pool_evt_ReserveDataUpdated + - name: LidoPool_evt_Supply + - name: LidoPool_evt_Withdraw + - name: LidoPool_evt_ReserveDataUpdated + + - name: aave_v3_etherfi_ethereum + tables: + - name: PoolInstance_evt_Supply + - name: PoolInstance_evt_Withdraw + - name: PoolInstance_evt_ReserveDataUpdated - name: compound_v2_ethereum tables: @@ -29,10 +38,13 @@ sources: tables: - name: cUSDCv3_evt_SupplyCollateral - name: cWETHv3_evt_SupplyCollateral + - name: cUSDTv3_evt_SupplyCollateral - name: cUSDCv3_evt_WithdrawCollateral - name: cWETHv3_evt_WithdrawCollateral + - name: cUSDTv3_evt_WithdrawCollateral - name: cUSDCv3_evt_AbsorbCollateral - name: cWETHv3_evt_AbsorbCollateral + - name: cUSDTv3_evt_AbsorbCollateral - name: radiant_capital_ethereum tables: diff --git a/sources/_sector/nft/mints/platforms/_sources.yml b/sources/_sector/nft/mints/platforms/_sources.yml index 647402c33cd..83179aaa2a8 100644 --- a/sources/_sector/nft/mints/platforms/_sources.yml +++ b/sources/_sector/nft/mints/platforms/_sources.yml @@ -3,50 +3,31 @@ version: 2 sources: - name: zora_goerli description: "Goerli decoded tables related to Zora" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time + tables: - name: ERC721Drop_evt_Sale - name: ZoraCreator1155Impl_evt_Purchased - name: zora_base description: "Base decoded tables related to Zora" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time tables: - name: ERC721Drop_evt_Sale - name: ZoraCreator1155_evt_Purchased - name: zora_ethereum description: "Ethereum decoded tables related to Zora" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time tables: - name: ERC721Drop_evt_Sale - name: Zora1155_evt_Purchased - name: zora_optimism description: "Optimism decoded tables related to Zora" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time tables: - name: ERC721Drop_evt_Sale - name: ZoraCreator1155Impl_evt_Purchased - name: zora_zora description: "Zora network decoded tables related to Zora" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time tables: - name: ZoraNFTCreatorV1_evt_CreatedDrop - name: ZoraCreator1155_evt_SetupNewContract \ No newline at end of file diff --git a/sources/_sector/nft/trades/arbitrum_sources.yml b/sources/_sector/nft/trades/arbitrum_sources.yml index 414cdf8ae48..fa332361eeb 100644 --- a/sources/_sector/nft/trades/arbitrum_sources.yml +++ b/sources/_sector/nft/trades/arbitrum_sources.yml @@ -23,7 +23,6 @@ sources: - name: NFTransfersFeature_evt_ERC1155BuyOrderFilled - name: NFTransfersFeature_evt_ERC1155SellOrderFilled - name: sudoswap_v2_arbitrum - freshness: tables: - name: LSSVMPairFactory_call_createPairERC721ETH - name: LSSVMPairFactory_call_createPairERC1155ETH diff --git a/sources/_sector/nft/trades/base_sources.yml b/sources/_sector/nft/trades/base_sources.yml index 372e95dccdf..1a783aaaefe 100644 --- a/sources/_sector/nft/trades/base_sources.yml +++ b/sources/_sector/nft/trades/base_sources.yml @@ -11,12 +11,10 @@ sources: - name: ElementEx_evt_ERC1155SellOrderFilled - name: ElementEx_evt_ERC1155BuyOrderFilled - name: zonic_base - freshness: tables: - name: ZonicMarketplace_evt_ZonicBasicOrderFulfilled - name: sudoswap_v2_base - freshness: tables: - name: LSSVMPairFactory_call_createPairERC721ETH - name: LSSVMPairFactory_call_createPairERC1155ETH diff --git a/sources/_sector/nft/trades/ethereum_sources.yml b/sources/_sector/nft/trades/ethereum_sources.yml index 9dd15730715..7e09d3c14f0 100644 --- a/sources/_sector/nft/trades/ethereum_sources.yml +++ b/sources/_sector/nft/trades/ethereum_sources.yml @@ -75,6 +75,7 @@ sources: tables: - name: X2Y2_r1_evt_EvProfit - name: X2Y2_r1_evt_EvInventory + - name: X2Y2Drop_evt_Airdrop - name: zora_ethereum tables: diff --git a/sources/_sector/nft/trades/optimism_sources.yml b/sources/_sector/nft/trades/optimism_sources.yml index dec9d63e23b..4cd8a6634b0 100644 --- a/sources/_sector/nft/trades/optimism_sources.yml +++ b/sources/_sector/nft/trades/optimism_sources.yml @@ -7,38 +7,32 @@ sources: - name: MarketNG_evt_EvInventoryUpdate - name: zonic_optimism - freshness: tables: - name: ZonicMarketplace_evt_ZonicBasicOrderFulfilled - name: quixotic_v2_optimism - freshness: tables: - name: ExchangeV2_evt_BuyOrderFilled - name: ExchangeV2_evt_DutchAuctionFilled - name: ExchangeV2_evt_SellOrderFilled - name: quixotic_v3_optimism - freshness: tables: - name: ExchangeV3_evt_BuyOrderFilled - name: ExchangeV3_evt_DutchAuctionFilled - name: ExchangeV3_evt_SellOrderFilled - name: quixotic_v4_optimism - freshness: tables: - name: ExchangeV4_evt_BuyOrderFilled - name: ExchangeV4_evt_DutchAuctionFilled - name: ExchangeV4_evt_SellOrderFilled - name: quixotic_v5_optimism - freshness: tables: - name: ExchangeV5_evt_SellOrderFilled - name: element_ex_optimism - freshness: tables: - name: ElementEx_evt_ERC721BuyOrderFilled - name: ElementEx_evt_ERC721SellOrderFilled diff --git a/sources/_sector/nft/trades/scroll_sources.yml b/sources/_sector/nft/trades/scroll_sources.yml index 44b47aba070..2f037d0d9b2 100644 --- a/sources/_sector/nft/trades/scroll_sources.yml +++ b/sources/_sector/nft/trades/scroll_sources.yml @@ -9,7 +9,6 @@ sources: - name: ERC1155OrdersFeature_evt_ERC1155BuyOrderFilled - name: zonic_scroll - freshness: tables: - name: ZonicMarketplace_evt_ZonicBasicOrderFulfilled diff --git a/sources/_sector/social/arbitrum/_sources.yml b/sources/_sector/social/arbitrum/_sources.yml index 60e6e7b5b16..80c96380d96 100644 --- a/sources/_sector/social/arbitrum/_sources.yml +++ b/sources/_sector/social/arbitrum/_sources.yml @@ -5,9 +5,7 @@ sources: description: cipher base tables: - name: Cipher_evt_Trade - loaded_at_field: evt_block_time - name: post_tech_v1_arbitrum description: post.tech base tables: - - name: PostTechProfile_evt_Trade - loaded_at_field: evt_block_time \ No newline at end of file + - name: PostTechProfile_evt_Trade \ No newline at end of file diff --git a/sources/_sector/social/base/_sources.yml b/sources/_sector/social/base/_sources.yml index 48f4c61871a..59e0c6efe0e 100644 --- a/sources/_sector/social/base/_sources.yml +++ b/sources/_sector/social/base/_sources.yml @@ -5,4 +5,3 @@ sources: description: friend.tech base tables: - name: FriendtechSharesV1_evt_Trade - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/_sector/social/bnb/_sources.yml b/sources/_sector/social/bnb/_sources.yml index 1c385481e3b..6eddf025bab 100644 --- a/sources/_sector/social/bnb/_sources.yml +++ b/sources/_sector/social/bnb/_sources.yml @@ -5,4 +5,3 @@ sources: description: friend3 base tables: - name: Friend3V1_evt_Trade - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/_subprojects_outputs/dex/_sources.yml b/sources/_subprojects_outputs/dex/_sources.yml index fc198a87fd1..88751103645 100644 --- a/sources/_subprojects_outputs/dex/_sources.yml +++ b/sources/_subprojects_outputs/dex/_sources.yml @@ -56,6 +56,7 @@ sources: - name: balancer_v2_pools_optimism - name: balancer_v2_pools_polygon - name: balancer_v2_pools_zkevm + - name: balancer_cowswap_amm_pools - name: uniswap_v3_optimism tables: - name: ovm1_pool_mapping @@ -68,3 +69,9 @@ sources: - name: cow_protocol_arbitrum tables: - name: trades + - name: jelly_swap + tables: + - name: trades + - name: beethoven_x + tables: + - name: trades diff --git a/sources/_subprojects_outputs/hourly_spellbook/_sources.yml b/sources/_subprojects_outputs/hourly_spellbook/_sources.yml index 70226f5cdad..fc633083e38 100644 --- a/sources/_subprojects_outputs/hourly_spellbook/_sources.yml +++ b/sources/_subprojects_outputs/hourly_spellbook/_sources.yml @@ -41,4 +41,12 @@ sources: - name: perpetual tables: - - name: trades \ No newline at end of file + - name: trades + + - name: beethoven_x_fantom + tables: + - name: pools_metrics_daily + + - name: jelly_swap_sei + tables: + - name: pools_metrics_daily \ No newline at end of file diff --git a/sources/_subprojects_outputs/nft/_sources.yml b/sources/_subprojects_outputs/nft/_sources.yml index af3fea4ecc6..c8c7256ccab 100644 --- a/sources/_subprojects_outputs/nft/_sources.yml +++ b/sources/_subprojects_outputs/nft/_sources.yml @@ -12,6 +12,10 @@ sources: tables: - name: wash_trades + - name: nft_blast + tables: + - name: wash_trades + - name: nft_ethereum tables: - name: wallet_metrics diff --git a/sources/_subprojects_outputs/tokens/_sources.yml b/sources/_subprojects_outputs/tokens/_sources.yml index 307ada90bb2..d965c7cba6c 100644 --- a/sources/_subprojects_outputs/tokens/_sources.yml +++ b/sources/_subprojects_outputs/tokens/_sources.yml @@ -352,3 +352,7 @@ sources: tables: - name: trusted_tokens - name: tokens + + - name: prices_native + tables: + - name: tokens diff --git a/sources/_subprojects_outputs/tokens/balances.yml b/sources/_subprojects_outputs/tokens/balances.yml index fd1be50a09c..85a545e876f 100644 --- a/sources/_subprojects_outputs/tokens/balances.yml +++ b/sources/_subprojects_outputs/tokens/balances.yml @@ -2,4 +2,22 @@ version: 2 sources: - name: tokens_ethereum tables: - - name: balances_daily_agg \ No newline at end of file + - name: balances_daily_agg + - name: balances_daily_agg_base + - name: tokens_optimism + tables: + - name: balances_daily_agg + - name: balances_daily_agg_base + - name: tokens_polygon + tables: + - name: balances_daily_agg + - name: balances_daily_agg_base + - name: tokens_base + tables: + - name: balances_daily_agg + - name: balances_daily_agg_base + - name: tokens_arbitrum + tables: + - name: balances_daily_agg + - name: balances_daily_agg_base + diff --git a/sources/_subprojects_outputs/tokens/transfers.yml b/sources/_subprojects_outputs/tokens/transfers.yml index b3aa7e4efbb..59fe74d7e62 100644 --- a/sources/_subprojects_outputs/tokens/transfers.yml +++ b/sources/_subprojects_outputs/tokens/transfers.yml @@ -63,4 +63,8 @@ sources: tables: - name: transfers + - name: tokens_blast + tables: + - name: transfers + diff --git a/sources/aave/aave_sources.yml b/sources/aave/aave_sources.yml index 196b28ffd6b..79568a6656a 100644 --- a/sources/aave/aave_sources.yml +++ b/sources/aave/aave_sources.yml @@ -7,10 +7,6 @@ sources: tables: - name: AToken_evt_Initialized description: "aToken initialization events, supply tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - &contract_address name: contract_address @@ -42,10 +38,6 @@ sources: - name: StableDebtToken_evt_Initialized description: "aToken initialization events, stable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -65,10 +57,6 @@ sources: - name: VariableDebtToken_evt_Initialized description: "aToken initialization events, variable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -86,10 +74,6 @@ sources: tables: - name: AToken_evt_Initialized description: "aToken initialization events, supply tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -103,10 +87,6 @@ sources: - name: StableDebtToken_evt_Initialized description: "aToken initialization events, stable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -120,10 +100,6 @@ sources: - name: VariableDebtToken_evt_Initialized description: "aToken initialization events, variable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -140,10 +116,6 @@ sources: tables: - name: AToken_evt_Initialized description: "aToken initialization events, supply tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -157,10 +129,6 @@ sources: - name: StableDebtToken_evt_Initialized description: "aToken initialization events, stable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -174,10 +142,6 @@ sources: - name: VariableDebtToken_evt_Initialized description: "aToken initialization events, variable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -194,10 +158,6 @@ sources: tables: - name: AToken_evt_Initialized description: "aToken initialization events, supply tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -211,10 +171,6 @@ sources: - name: StableDebtToken_evt_Initialized description: "aToken initialization events, stable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -228,10 +184,6 @@ sources: - name: VariableDebtToken_evt_Initialized description: "aToken initialization events, variable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number diff --git a/sources/aave/ethereum/aave_ethereum_sources.yml b/sources/aave/ethereum/aave_ethereum_sources.yml index 3347a2e0e52..25e06170c4f 100644 --- a/sources/aave/ethereum/aave_ethereum_sources.yml +++ b/sources/aave/ethereum/aave_ethereum_sources.yml @@ -6,11 +6,7 @@ sources: tables: - name: LendingPool_evt_ReserveDataUpdated - loaded_at_field: evt_block_time description: "Provides the liqudity index, stable and variable borrow rates for aave v2 reserves." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - &contract_address name: contract_address @@ -47,7 +43,6 @@ sources: description: "Decoded contracts for Aave v1 on Ethereum" tables: - name: AaveGovernanceV2_evt_VoteEmitted - loaded_at_field: evt_block_time columns: - name: contract_address description: "DAO governor contract address" @@ -67,7 +62,6 @@ sources: name: votes - name: AaveGovernanceV2_evt_ProposalCreated - loaded_at_field: evt_block_time columns: - name: contract_address description: "DAO governor contract address" @@ -96,7 +90,6 @@ sources: name: values - name: AaveGovernanceV2_evt_ProposalCanceled - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -106,7 +99,6 @@ sources: - *id - name: AaveGovernanceV2_evt_ProposalExecuted - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -116,7 +108,6 @@ sources: - *id - name: AaveGovernanceV2_evt_ProposalQueued - loaded_at_field: evt_block_time columns: - *contract_address - &eta diff --git a/sources/aave/optimism/aave_optimism_sources.yml b/sources/aave/optimism/aave_optimism_sources.yml index 3a882ebe0e0..02dc303026d 100644 --- a/sources/aave/optimism/aave_optimism_sources.yml +++ b/sources/aave/optimism/aave_optimism_sources.yml @@ -6,11 +6,7 @@ sources: tables: - name: Pool_evt_ReserveDataUpdated - loaded_at_field: evt_block_time description: "Provides the liqudity index, stable and variable borrow rates for aave v3 reserves." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - &contract_address name: contract_address diff --git a/sources/abi/signatures_sources.yml b/sources/abi/signatures_sources.yml index 859f0ee2adb..cfab9f470a0 100644 --- a/sources/abi/signatures_sources.yml +++ b/sources/abi/signatures_sources.yml @@ -4,84 +4,66 @@ sources: - name: ethereum tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: polygon tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: optimism tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: arbitrum tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: gnosis tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: bnb tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: avalanche_c tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: fantom tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: celo tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: base tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: zksync tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at - name: scroll tables: - name: signatures - freshness: - warn_after: { count: 12, period: hour } description: "signatures from ABIs on this chain" - loaded_at_field: created_at + - name: nova + tables: + - name: signatures + - name: blast + tables: + - name: signatures + - name: linea + tables: + - name: signatures + - name: mantle + tables: + - name: signatures + - name: zkevm + tables: + - name: signatures + - name: sei + tables: + - name: signatures diff --git a/sources/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_sources.yml b/sources/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_sources.yml index 00ff897bcfa..05952d60418 100644 --- a/sources/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_sources.yml +++ b/sources/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_sources.yml @@ -4,36 +4,27 @@ sources: - name: erc4337_arbitrum description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_v0_5_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_5_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_5_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_sources.yml b/sources/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_sources.yml index 0e7986f4b56..5ee65c89d1b 100644 --- a/sources/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_sources.yml +++ b/sources/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_sources.yml @@ -4,36 +4,27 @@ sources: - name: erc4337_avalanche_c description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_v0_5_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_5_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_5_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/account_abstraction/erc4337/base/account_abstraction_erc4337_base_sources.yml b/sources/account_abstraction/erc4337/base/account_abstraction_erc4337_base_sources.yml index 8692e1940e2..1446c7c7465 100644 --- a/sources/account_abstraction/erc4337/base/account_abstraction_erc4337_base_sources.yml +++ b/sources/account_abstraction/erc4337/base/account_abstraction_erc4337_base_sources.yml @@ -4,38 +4,29 @@ sources: - name: erc4337_base description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_7_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.7. - loaded_at_field: evt_block_time - name: EntryPoint_v0_7_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.7. - loaded_at_field: evt_block_time - name: EntryPoint_v0_7_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.7. - loaded_at_field: evt_block_time diff --git a/sources/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_sources.yml b/sources/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_sources.yml index 00dad64f598..dc23eaa36fb 100644 --- a/sources/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_sources.yml +++ b/sources/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_sources.yml @@ -4,21 +4,15 @@ sources: - name: erc4337_bnb description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_sources.yml b/sources/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_sources.yml index cf7200ef543..5db812b09fe 100644 --- a/sources/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_sources.yml +++ b/sources/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_sources.yml @@ -4,21 +4,15 @@ sources: - name: erc4337_celo description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time diff --git a/sources/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_sources.yml b/sources/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_sources.yml index c8dedf8c2cb..70fbae7d450 100644 --- a/sources/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_sources.yml +++ b/sources/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_sources.yml @@ -4,36 +4,27 @@ sources: - name: erc4337_ethereum description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_sources.yml b/sources/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_sources.yml index fca7d32b738..ced067a2c7a 100644 --- a/sources/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_sources.yml +++ b/sources/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_sources.yml @@ -4,36 +4,27 @@ sources: - name: erc4337_gnosis description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_v0_5_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_5_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_5_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_sources.yml b/sources/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_sources.yml index ce02f628356..d30999d04a0 100644 --- a/sources/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_sources.yml +++ b/sources/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_sources.yml @@ -4,36 +4,27 @@ sources: - name: erc4337_optimism description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_sources.yml b/sources/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_sources.yml index 3623d95e19f..687d6981b69 100644 --- a/sources/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_sources.yml +++ b/sources/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_sources.yml @@ -4,36 +4,27 @@ sources: - name: erc4337_polygon description: > Decoded tables related to erc4337. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.5. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_sources.yml b/sources/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_sources.yml index e4d4b66d800..0bc8f2e3131 100644 --- a/sources/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_sources.yml +++ b/sources/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_sources.yml @@ -4,38 +4,29 @@ sources: - name: erc4337_zora description: > Decoded tables related to erc4337. - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: EntryPoint_v0_6_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_6_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.6. - loaded_at_field: evt_block_time - name: EntryPoint_v0_7_evt_UserOperationEvent description: > Decoded table related to the erc4337 user operation events version v0.7. - loaded_at_field: evt_block_time - name: EntryPoint_v0_7_call_handleOps description: > Decoded table related to the erc4337 handle operation calls, version v0.7. - loaded_at_field: evt_block_time - name: EntryPoint_v0_7_evt_AccountDeployed description: > Decoded table related to the erc4337 account deployed events, version v0.7. - loaded_at_field: evt_block_time diff --git a/sources/addresses_events/optimism/addresses_events_optimism_sources.yml b/sources/addresses_events/optimism/addresses_events_optimism_sources.yml index af8d82fa6ea..1e3bc140dad 100644 --- a/sources/addresses_events/optimism/addresses_events_optimism_sources.yml +++ b/sources/addresses_events/optimism/addresses_events_optimism_sources.yml @@ -6,4 +6,3 @@ sources: optimism legacy ovm1 transactions table tables: - name: transactions - loaded_at_field: block_time diff --git a/sources/aerodrome/base/aerodrome_base_sources.yml b/sources/aerodrome/base/aerodrome_base_sources.yml index fd28cf27b60..3ca24211c5d 100644 --- a/sources/aerodrome/base/aerodrome_base_sources.yml +++ b/sources/aerodrome/base/aerodrome_base_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: aerodrome_base description: "decoded events and function calls for aerodrome v2 on base" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Voter_evt_GaugeCreated - loaded_at_field: evt_block_time diff --git a/sources/alchemydao/ethereum/alchemydao_ethereum_sources.yml b/sources/alchemydao/ethereum/alchemydao_ethereum_sources.yml index 816324e1341..74da50be013 100644 --- a/sources/alchemydao/ethereum/alchemydao_ethereum_sources.yml +++ b/sources/alchemydao/ethereum/alchemydao_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: AlchemyDAO ethereum contracts tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/apecoin/ethereum/apecoin_ethereum_sources.yml b/sources/apecoin/ethereum/apecoin_ethereum_sources.yml index 739e00e2142..c9e965dfea9 100644 --- a/sources/apecoin/ethereum/apecoin_ethereum_sources.yml +++ b/sources/apecoin/ethereum/apecoin_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: ApeCoin ethereum contracts tables: - name: AirdropGrapesToken_evt_AirDrop - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/apeswap/bnb/apeswap_bnb_sources.yml b/sources/apeswap/bnb/apeswap_bnb_sources.yml index dff5897e814..2436f72f507 100644 --- a/sources/apeswap/bnb/apeswap_bnb_sources.yml +++ b/sources/apeswap/bnb/apeswap_bnb_sources.yml @@ -3,12 +3,8 @@ version: 2 sources: - name: apeswap_bnb description: "BNB decoded tables related to apeswap contract" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ApePair_evt_Swap - loaded_at_field: evt_block_time description: "apeswap swap events table on Bnb chain" columns: - &amount0In @@ -41,7 +37,6 @@ sources: - &to name: to - name: ApeFactory_evt_PairCreated - loaded_at_field: evt_block_time description: "apeswap pair created events table" columns: - &_0 diff --git a/sources/apeswap/ethereum/apeswap_ethereum_sources.yml b/sources/apeswap/ethereum/apeswap_ethereum_sources.yml index 9455ebfedb2..e22620bf812 100644 --- a/sources/apeswap/ethereum/apeswap_ethereum_sources.yml +++ b/sources/apeswap/ethereum/apeswap_ethereum_sources.yml @@ -3,12 +3,8 @@ version: 2 sources: - name: apeswap_ethereum description: "Ethereum decoded tables related to Apeswap contract" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ApePair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -41,7 +37,6 @@ sources: - &to name: to - name: ApeFactory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 diff --git a/sources/apeswap/polygon/apeswap_polygon_sources.yml b/sources/apeswap/polygon/apeswap_polygon_sources.yml index 6aa1da25ab6..c323de8aa35 100644 --- a/sources/apeswap/polygon/apeswap_polygon_sources.yml +++ b/sources/apeswap/polygon/apeswap_polygon_sources.yml @@ -3,12 +3,8 @@ version: 2 sources: - name: apeswap_polygon description: "Polygon decoded tables related to apeswap contract" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ApePair_evt_Swap - loaded_at_field: evt_block_time description: "apeswap swap events table on Polygon" columns: - &amount0In @@ -41,7 +37,6 @@ sources: - &to name: to - name: ApeFactory_evt_PairCreated - loaded_at_field: evt_block_time description: "apeswap Pool created events table" columns: - &_0 diff --git a/sources/aragon/ethereum/aragon_ethereum_sources.yml b/sources/aragon/ethereum/aragon_ethereum_sources.yml index 4926d88cf2f..d7e26bfb989 100644 --- a/sources/aragon/ethereum/aragon_ethereum_sources.yml +++ b/sources/aragon/ethereum/aragon_ethereum_sources.yml @@ -5,4 +5,3 @@ sources: description: "aragon dao deployed decoded event" tables: - name: DAOFactory_evt_DeployDAO - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/aragon/polygon/aragon_polygon_sources.yml b/sources/aragon/polygon/aragon_polygon_sources.yml index 8e9bbea0eca..1edb192cab0 100644 --- a/sources/aragon/polygon/aragon_polygon_sources.yml +++ b/sources/aragon/polygon/aragon_polygon_sources.yml @@ -5,9 +5,7 @@ sources: description: "aragon dao deployed decoded event" tables: - name: dao_factory_evt_DeployDAO - loaded_at_field: evt_block_time - name: aragon_app_polygon description: "aragon dao (app) deployed decoded event" tables: - name: DAORegistry_evt_DAORegistered - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/arbitrum/arbitrum/arbitrum_arbitrum_sources.yml b/sources/arbitrum/arbitrum/arbitrum_arbitrum_sources.yml index 2e6ae756981..78b0ce9d5f8 100644 --- a/sources/arbitrum/arbitrum/arbitrum_arbitrum_sources.yml +++ b/sources/arbitrum/arbitrum/arbitrum_arbitrum_sources.yml @@ -6,4 +6,3 @@ sources: Arbitrum contracts on Arbitrum tables: - name: TokenDistributor_evt_HasClaimed - loaded_at_field: evt_block_time diff --git a/sources/arkham/ethereum/arkham_ethereum_sources.yml b/sources/arkham/ethereum/arkham_ethereum_sources.yml index bd2c63e68af..a193762617e 100644 --- a/sources/arkham/ethereum/arkham_ethereum_sources.yml +++ b/sources/arkham/ethereum/arkham_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Arkham ethereum contracts tables: - name: Airdrop_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/arrakis/ethereum/arrakis_ethereum_sources.yml b/sources/arrakis/ethereum/arrakis_ethereum_sources.yml index cda0b361db1..524cf853e5e 100644 --- a/sources/arrakis/ethereum/arrakis_ethereum_sources.yml +++ b/sources/arrakis/ethereum/arrakis_ethereum_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: arrakis_finance_ethereum description: "Ethereum decoded tables related to Arrakis Finance contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: ArrakisV2Factory_evt_VaultCreated - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/arrakis/optimism/arrakis_optimism_sources.yml b/sources/arrakis/optimism/arrakis_optimism_sources.yml index be5c7085714..b96a2be8011 100644 --- a/sources/arrakis/optimism/arrakis_optimism_sources.yml +++ b/sources/arrakis/optimism/arrakis_optimism_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: arrakis_optimism description: "Optimism decoded tables related to Arrakis Finance contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: ArrakisFactoryV1_evt_PoolCreated - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/astaria/ethereum/astaria_ethereum_sources.yml b/sources/astaria/ethereum/astaria_ethereum_sources.yml index eb9c1245aad..9a6312f2df8 100644 --- a/sources/astaria/ethereum/astaria_ethereum_sources.yml +++ b/sources/astaria/ethereum/astaria_ethereum_sources.yml @@ -3,21 +3,11 @@ version: 2 sources: - name: astaria_v1_ethereum description: "astaria ethereum decoded events" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: LienToken_evt_NewLien - loaded_at_field: evt_block_time - name: LienToken_evt_Payment - loaded_at_field: evt_block_time - name: LienToken_call_makePayment - loaded_at_field: call_block_time - name: AstariaRouter_evt_Liquidation - loaded_at_field: evt_block_time - name: CollateralToken_evt_Deposit721 - loaded_at_field: evt_block_time - name: CollateralToken_evt_ReleaseTo - loaded_at_field: evt_block_time - name: LienToken_call_createLien - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/avt/optimism/avt_optimism_sources.yml b/sources/avt/optimism/avt_optimism_sources.yml index ce12f2a5dab..b4308c985e7 100644 --- a/sources/avt/optimism/avt_optimism_sources.yml +++ b/sources/avt/optimism/avt_optimism_sources.yml @@ -2,14 +2,10 @@ version: 2 sources: - name: avt_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for Perpetual trades on fxdx tables: - name: PositionRouter_evt_ExecuteDecreasePosition - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteIncreasePosition - loaded_at_field: evt_block_time diff --git a/sources/aztec/ethereum/aztec_ethereum_sources.yml b/sources/aztec/ethereum/aztec_ethereum_sources.yml index cc3af487bfe..0f63774bff1 100644 --- a/sources/aztec/ethereum/aztec_ethereum_sources.yml +++ b/sources/aztec/ethereum/aztec_ethereum_sources.yml @@ -2,12 +2,8 @@ version: 2 sources: - name: aztec_v2_ethereum - freshness: - warn_after: { count: 12, period: hour } description: > Aztec is a privacy-first zk-rollup on Ethereum bringing confidentiality and cost savings to the Ethereum ecosystem. tables: - name: RollupProcessor_evt_AssetAdded - loaded_at_field: evt_block_time - name: RollupProcessor_evt_BridgeAdded - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/balancer/arbitrum/balancer_arbitrum_sources.yml b/sources/balancer/arbitrum/balancer_arbitrum_sources.yml index fb9f5501f90..dd45a15e521 100644 --- a/sources/balancer/arbitrum/balancer_arbitrum_sources.yml +++ b/sources/balancer/arbitrum/balancer_arbitrum_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: WeightedPool2TokensFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -98,7 +95,6 @@ sources: - name: WeightedPoolV2Factory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -120,7 +116,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on Arbitrum. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -142,7 +137,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on Arbitrum. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -162,12 +156,10 @@ sources: description: 'Change in the amount of token cashed the vault' - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -181,7 +173,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' diff --git a/sources/balancer/avalanche_c/balancer_avalanche_c_sources.yml b/sources/balancer/avalanche_c/balancer_avalanche_c_sources.yml index 93285acf76a..2c92bd49fd9 100644 --- a/sources/balancer/avalanche_c/balancer_avalanche_c_sources.yml +++ b/sources/balancer/avalanche_c/balancer_avalanche_c_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on avalanche_c. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -99,7 +96,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on avalanche_c. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -119,12 +115,10 @@ sources: description: 'Change in the amount of token cashed the vault' - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -138,7 +132,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' diff --git a/sources/balancer/base/balancer_base_sources.yml b/sources/balancer/base/balancer_base_sources.yml index 7b20b9465b6..d4d39149ac0 100644 --- a/sources/balancer/base/balancer_base_sources.yml +++ b/sources/balancer/base/balancer_base_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on base. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -99,7 +96,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on base. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -119,12 +115,10 @@ sources: description: 'Change in the amount of token cashed the vault' - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -138,7 +132,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' diff --git a/sources/balancer/ethereum/balancer_ethereum_sources.yml b/sources/balancer/ethereum/balancer_ethereum_sources.yml index 3304a1fe1a6..bcfc738f352 100644 --- a/sources/balancer/ethereum/balancer_ethereum_sources.yml +++ b/sources/balancer/ethereum/balancer_ethereum_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: WeightedPool2TokensFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -98,7 +95,6 @@ sources: - name: WeightedPoolV2Factory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -120,7 +116,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on Ethereum. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -142,7 +137,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on Ethereum. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -164,7 +158,6 @@ sources: - name: LiquidityBootstrappingPool_evt_GradualWeightUpdateScheduled description: > Decoded table related to scheduled gradual weight updates on the Balancer LiquidityBootstrappingPool contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'LBP contract address' @@ -188,7 +181,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPool_evt_GradualWeightUpdateScheduled description: > Decoded table related to scheduled gradual weight updates on the Balancer NoProtocolFeeLiquidityBootstrappingPool contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'LBP contract address' @@ -202,12 +194,10 @@ sources: - *startWeights - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -221,7 +211,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -242,7 +231,6 @@ sources: - name: BFactory_evt_LOG_NEW_POOL description: > Decoded table related to the Balancer BFactory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v1 BFactory contract address' @@ -258,7 +246,6 @@ sources: - name: BPool_call_bind description: > Decoded table related to the Balancer BPool contract. - loaded_at_field: evt_block_time columns: - &balance name: balance @@ -280,7 +267,6 @@ sources: - name: BPool_call_rebind description: > Decoded table related to the Balancer BPool contract. - loaded_at_field: evt_block_time columns: - *balance - *call_block_number @@ -296,7 +282,6 @@ sources: - name: BPool_call_unbind description: > Decoded table related to the Balancer BPool contract. - loaded_at_field: evt_block_time columns: - *call_block_number - *call_block_time @@ -312,7 +297,6 @@ sources: Decoded tables related to Balancer, an automated portfolio manager and trading platform, on Ethereum. tables: - name: veBAL_call_create_lock - loaded_at_field: call_block_time description: "Function to create a veBAL lock" columns: - name: _unlock_time @@ -321,7 +305,6 @@ sources: description: "Amount to deposit" - name: veBAL_evt_Deposit - loaded_at_field: evt_block_time description: "Emitted when user deposits tokens in their lock or extends its unlock time" columns: - name: locktime @@ -343,7 +326,6 @@ sources: description: "Amount of base tokens added to the lock" - name: veBAL_evt_Withdraw - loaded_at_field: evt_block_time description: "Emitted when user withdraws tokens from their lock" columns: - name: provider @@ -354,7 +336,6 @@ sources: description: "Block timestamp" - name: GaugeController_evt_VoteForGauge - loaded_at_field: evt_block_time description: "Emitted when veBAL holder votes for a gauge" columns: - name: contract_address diff --git a/sources/balancer/gnosis/balancer_gnosis_sources.yml b/sources/balancer/gnosis/balancer_gnosis_sources.yml index dc5be6de73d..f640f31cb22 100644 --- a/sources/balancer/gnosis/balancer_gnosis_sources.yml +++ b/sources/balancer/gnosis/balancer_gnosis_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: WeightedPool2TokensFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -98,7 +95,6 @@ sources: - name: WeightedPoolV2Factory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -120,7 +116,6 @@ sources: - name: WeightedPoolV4Factory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -142,7 +137,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on gnosis. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -164,7 +158,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on gnosis. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -186,7 +179,6 @@ sources: - name: LiquidityBootstrappingPool_evt_GradualWeightUpdateScheduled description: > Decoded table related to scheduled gradual weight updates on the Balancer LiquidityBootstrappingPool contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'LBP contract address' @@ -210,7 +202,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPool_evt_GradualWeightUpdateScheduled description: > Decoded table related to scheduled gradual weight updates on the Balancer NoProtocolFeeLiquidityBootstrappingPool contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'LBP contract address' @@ -224,12 +215,10 @@ sources: - *startWeights - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -243,7 +232,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' diff --git a/sources/balancer/optimism/balancer_optimism_sources.yml b/sources/balancer/optimism/balancer_optimism_sources.yml index 335a38ee81b..3919cbf65d8 100644 --- a/sources/balancer/optimism/balancer_optimism_sources.yml +++ b/sources/balancer/optimism/balancer_optimism_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: WeightedPool2TokensFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -98,7 +95,6 @@ sources: - name: WeightedPoolV2Factory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -120,7 +116,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on Optimism. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -142,7 +137,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on Optimism. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -164,15 +158,12 @@ sources: - name: ChildChainLiquidityGaugeFactory_evt_RewardsOnlyGaugeCreated description: "Rewards gauges created on Balancer on Optimism" - loaded_at_field: evt_block_time - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -186,7 +177,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -207,4 +197,3 @@ sources: tables: - name: ChildChainLiquidityGaugeFactory_evt_RewardsOnlyGaugeCreated description: "Rewards gauges created on Balancer on Optimism" - loaded_at_field: evt_block_time diff --git a/sources/balancer/polygon/balancer_polygon_sources.yml b/sources/balancer/polygon/balancer_polygon_sources.yml index 45b432475c3..82c34167279 100644 --- a/sources/balancer/polygon/balancer_polygon_sources.yml +++ b/sources/balancer/polygon/balancer_polygon_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: WeightedPool2TokensFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -98,7 +95,6 @@ sources: - name: WeightedPoolV2Factory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -120,7 +116,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on Polygon. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -142,7 +137,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on Polygon. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -164,7 +158,6 @@ sources: - name: LiquidityBootstrappingPool_evt_GradualWeightUpdateScheduled description: > Decoded table related to scheduled gradual weight updates on the Balancer LiquidityBootstrappingPool contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'LBP contract address' @@ -188,7 +181,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPool_evt_GradualWeightUpdateScheduled description: > Decoded table related to scheduled gradual weight updates on the Balancer NoProtocolFeeLiquidityBootstrappingPool contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'LBP contract address' @@ -202,12 +194,10 @@ sources: - *startWeights - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -221,7 +211,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' diff --git a/sources/balancer/zkevm/balancer_zkevm_sources.yml b/sources/balancer/zkevm/balancer_zkevm_sources.yml index a025ded7366..bb44ac9dfb3 100644 --- a/sources/balancer/zkevm/balancer_zkevm_sources.yml +++ b/sources/balancer/zkevm/balancer_zkevm_sources.yml @@ -8,7 +8,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -34,7 +33,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -77,7 +75,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on zkevm. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -99,7 +96,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on zkevm. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -121,7 +117,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPool_evt_GradualWeightUpdateScheduled description: > Decoded table related to scheduled gradual weight updates on the Balancer NoProtocolFeeLiquidityBootstrappingPool contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'LBP contract address' @@ -135,12 +130,10 @@ sources: - name: startWeights - name: Vault_evt_FlashLoan - loaded_at_field: evt_block_time - name: ComposableStablePoolFactory_evt_PoolCreated description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' @@ -154,7 +147,6 @@ sources: - name: Vault_evt_TokensRegistered description: > Decoded table of tokens registered by pool with the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -169,7 +161,6 @@ sources: description: 'Address of the contract which managed the asset from the vault' - name: Vault_evt_Swap - loaded_at_field: evt_block_time description: "" columns: - name: amountIn diff --git a/sources/balancer_cowswap_amm/arbitrum/_sources.yml b/sources/balancer_cowswap_amm/arbitrum/_sources.yml new file mode 100644 index 00000000000..0c38effeeee --- /dev/null +++ b/sources/balancer_cowswap_amm/arbitrum/_sources.yml @@ -0,0 +1,9 @@ +version: 2 +sources: + - name: b_cow_amm_arbitrum + tables: + - name: BCoWFactory_evt_LOG_NEW_POOL + - name: BCoWFactory_evt_COWAMMPoolCreated + - name: BCoWFactory_call_logBCoWPool + - name: BCoWPool_call_bind + - name: BCoWPool_call_unbind \ No newline at end of file diff --git a/sources/bebop/arbitrum/bebop_arbitrum_sources.yml b/sources/bebop/arbitrum/bebop_arbitrum_sources.yml index 29fc16a6391..e3645be2065 100644 --- a/sources/bebop/arbitrum/bebop_arbitrum_sources.yml +++ b/sources/bebop/arbitrum/bebop_arbitrum_sources.yml @@ -3,69 +3,35 @@ version: 2 sources: - name: bebop_v3_arbitrum description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopAggregationContract_call_SettleAggregateOrder - loaded_at_field: call_block_time - name: BebopAggregationContract_evt_AggregateOrderExecuted - loaded_at_field: evt_block_time - name: bebop_v4_arbitrum description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_SettleAggregateOrder - loaded_at_field: call_block_time - name: BebopSettlement_call_SettleAggregateOrderWithTakerPermits - loaded_at_field: call_block_time - name: BebopSettlement_evt_AggregateOrderExecuted - loaded_at_field: evt_block_time - name: bebop_jam_arbitrum description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time - name: bebop_pmms_arbitrum description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_settleSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingleFromContract - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregate - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapAggregate - loaded_at_field: call_block_time - name: BebopSettlement_evt_BebopOrder - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bebop/base/bebop_base_sources.yml b/sources/bebop/base/bebop_base_sources.yml index d7a8c305808..a27ed49983c 100644 --- a/sources/bebop/base/bebop_base_sources.yml +++ b/sources/bebop/base/bebop_base_sources.yml @@ -3,47 +3,24 @@ version: 2 sources: - name: bebop_jam_base description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time - name: bebop_pmms_base description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_settleSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingleFromContract - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregate - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapAggregate - loaded_at_field: call_block_time - name: BebopSettlement_evt_BebopOrder - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bebop/bnb/bebop_bnb_sources.yml b/sources/bebop/bnb/bebop_bnb_sources.yml index 85ccc57311d..f7aa50b540b 100644 --- a/sources/bebop/bnb/bebop_bnb_sources.yml +++ b/sources/bebop/bnb/bebop_bnb_sources.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: bebop_jam_bnb description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bebop/ethereum/bebop_ethereum_sources.yml b/sources/bebop/ethereum/bebop_ethereum_sources.yml index 1654f0cb7f0..aa93a4250c2 100644 --- a/sources/bebop/ethereum/bebop_ethereum_sources.yml +++ b/sources/bebop/ethereum/bebop_ethereum_sources.yml @@ -3,69 +3,35 @@ version: 2 sources: - name: bebop_v3_ethereum description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopAggregationContract_call_SettleAggregateOrder - loaded_at_field: call_block_time - name: BebopAggregationContract_evt_AggregateOrderExecuted - loaded_at_field: evt_block_time - name: bebop_v4_ethereum description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_SettleAggregateOrder - loaded_at_field: call_block_time - name: BebopSettlement_call_SettleAggregateOrderWithTakerPermits - loaded_at_field: call_block_time - name: BebopSettlement_evt_AggregateOrderExecuted - loaded_at_field: evt_block_time - name: bebop_jam_ethereum description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time - name: bebop_pmms_ethereum description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_settleSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingleFromContract - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregate - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapAggregate - loaded_at_field: call_block_time - name: BebopSettlement_evt_BebopOrder - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bebop/optimism/bebop_optimism_sources.yml b/sources/bebop/optimism/bebop_optimism_sources.yml index a6aa3158915..250640ba63a 100644 --- a/sources/bebop/optimism/bebop_optimism_sources.yml +++ b/sources/bebop/optimism/bebop_optimism_sources.yml @@ -3,25 +3,13 @@ version: 2 sources: - name: bebop_v4_optimism description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_SettleAggregateOrder - loaded_at_field: call_block_time - name: BebopSettlement_call_SettleAggregateOrderWithTakerPermits - loaded_at_field: call_block_time - name: BebopSettlement_evt_AggregateOrderExecuted - loaded_at_field: evt_block_time - name: bebop_jam_optimism description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bebop/polygon/bebop_polygon_sources.yml b/sources/bebop/polygon/bebop_polygon_sources.yml index 917be58d89b..9053b4db81b 100644 --- a/sources/bebop/polygon/bebop_polygon_sources.yml +++ b/sources/bebop/polygon/bebop_polygon_sources.yml @@ -3,69 +3,35 @@ version: 2 sources: - name: bebop_v3_polygon description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopAggregationContract_call_SettleAggregateOrder - loaded_at_field: call_block_time - name: BebopAggregationContract_evt_AggregateOrderExecuted - loaded_at_field: evt_block_time - name: bebop_v4_polygon description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_SettleAggregateOrder - loaded_at_field: call_block_time - name: BebopSettlement_call_SettleAggregateOrderWithTakerPermits - loaded_at_field: call_block_time - name: BebopSettlement_evt_AggregateOrderExecuted - loaded_at_field: evt_block_time - name: bebop_jam_polygon description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time - name: bebop_pmms_polygon description: "Bebop decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BebopSettlement_call_settleSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleSingleAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingle - loaded_at_field: call_block_time - name: BebopSettlement_call_swapSingleFromContract - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleMultiAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapMulti - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregate - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit - loaded_at_field: call_block_time - name: BebopSettlement_call_settleAggregateAndSignPermit2 - loaded_at_field: call_block_time - name: BebopSettlement_call_swapAggregate - loaded_at_field: call_block_time - name: BebopSettlement_evt_BebopOrder - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bebop/scroll/bebop_scroll_sources.yml b/sources/bebop/scroll/bebop_scroll_sources.yml index 52f5af047c3..06f95a5ea55 100644 --- a/sources/bebop/scroll/bebop_scroll_sources.yml +++ b/sources/bebop/scroll/bebop_scroll_sources.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: bebop_jam_scroll description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bebop/zksync/bebop_zksync_sources.yml b/sources/bebop/zksync/bebop_zksync_sources.yml index 668bfb94e77..030892c64e6 100644 --- a/sources/bebop/zksync/bebop_zksync_sources.yml +++ b/sources/bebop/zksync/bebop_zksync_sources.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: bebop_jam_zksync description: "BebopJAM decoded tables related to Bebop" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: JamSettlement_call_settle - loaded_at_field: call_block_time - name: JamSettlement_call_settleWithPermitsSignatures - loaded_at_field: call_block_time - name: JamSettlement_evt_Settlement - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/beethoven_x/fantom/beethoven_x_fantom_sources.yml b/sources/beethoven_x/fantom/beethoven_x_fantom_sources.yml index 00584d36d85..b96debdc32c 100644 --- a/sources/beethoven_x/fantom/beethoven_x_fantom_sources.yml +++ b/sources/beethoven_x/fantom/beethoven_x_fantom_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: beethoven_x_fantom description: "fantom decoded tables related to beethoven x's contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Vault_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - name: amountIn @@ -28,7 +25,6 @@ sources: - name: Vault_evt_PoolRegistered description: > Decoded table of registered pools on the Balancer Vault contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -50,7 +46,6 @@ sources: - name: WeightedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPoolFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number description: 'Block number which processed the unique transaction hash' @@ -82,7 +77,6 @@ sources: - name: WeightedPoolFactoryV2_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number description: 'Block number which processed the unique transaction hash' @@ -114,7 +108,6 @@ sources: - name: WeightedPool2TokensFactory_call_create description: > Decoded table of registered pools on the Balancer WeightedPool2TokensFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number - name: call_block_time @@ -135,7 +128,6 @@ sources: - name: Vault_evt_PoolBalanceChanged description: > Decoded table of pool balances changes record on the Balancer Vault contract on Fantom. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -157,7 +149,6 @@ sources: - name: Vault_evt_PoolBalanceManaged description: > Decoded table of transactions performed by asset managers on the Balancer Vault contract on Fantom. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Vault contract address' @@ -179,7 +170,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of Composable Stable Pools created by the Composable Stable Pool Factory contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Balancer v2 Composable Stable Pool Factory contract address.' diff --git a/sources/bend_dao/ethereum/bend_dao_ethereum_sources.yml b/sources/bend_dao/ethereum/bend_dao_ethereum_sources.yml index 70b5bcaf0fb..da086334224 100644 --- a/sources/bend_dao/ethereum/bend_dao_ethereum_sources.yml +++ b/sources/bend_dao/ethereum/bend_dao_ethereum_sources.yml @@ -3,17 +3,11 @@ version: 2 sources: - name: bend_ethereum description: "bend ethereum decoded events" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: LendingPool_evt_Borrow - loaded_at_field: evt_block_time - name: LendingPool_evt_Repay - loaded_at_field: evt_block_time - name: benddao_ethereum description: "bend ethereum decoded events" tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/blur/ethereum/blur_ethereum_sources.yml b/sources/blur/ethereum/blur_ethereum_sources.yml index 0b66de50a69..6c79cc7181d 100644 --- a/sources/blur/ethereum/blur_ethereum_sources.yml +++ b/sources/blur/ethereum/blur_ethereum_sources.yml @@ -2,20 +2,11 @@ version: 2 sources: - name: blur_ethereum - freshness: - warn_after: { count: 12, period: hour } tables: - name: BlurAirdrop_evt_Claimed - loaded_at_field: evt_block_time - name: Blend_evt_LoanOfferTaken - loaded_at_field: evt_block_time - name: Blend_evt_Refinance - loaded_at_field: evt_block_time - name: Blend_evt_Seize - loaded_at_field: evt_block_time - name: Blend_evt_Repay - loaded_at_field: evt_block_time - name: Blend_evt_StartAuction - loaded_at_field: evt_block_time - name: Blend_evt_BuyLocked - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/botto/ethereum/botto_ethereum_sources.yml b/sources/botto/ethereum/botto_ethereum_sources.yml index 104bb1ca277..6648294611d 100644 --- a/sources/botto/ethereum/botto_ethereum_sources.yml +++ b/sources/botto/ethereum/botto_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Botto ethereum contracts tables: - name: BottoAirdrop_evt_AirdropTransfer - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/bridge/zksync/bridge_zksync_native_flows_sources.yml b/sources/bridge/zksync/bridge_zksync_native_flows_sources.yml index 4be2f0a561c..4f30c065d57 100644 --- a/sources/bridge/zksync/bridge_zksync_native_flows_sources.yml +++ b/sources/bridge/zksync/bridge_zksync_native_flows_sources.yml @@ -7,10 +7,6 @@ sources: tables: - name: DiamondProxy_evt_NewPriorityRequest description: Main zkSync Era rollup contract, L1 -> L2 event - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - &contract_address_bridge name: contract_address @@ -45,10 +41,6 @@ sources: - name: L1ERC20Bridge_evt_DepositInitiated description: ERC20 Deposit Events - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address_bridge - *evt_tx_hash @@ -77,10 +69,6 @@ sources: tables: - name: L2EthToken_evt_Withdrawal description: ETH withdrawal event from zkSync Era to Ethereum - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - &contract_address_token name: contract_address @@ -107,10 +95,6 @@ sources: - name: L2ERC20Bridge_evt_WithdrawalInitiated description: "aToken initialization events, stable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time columns: - *contract_address_bridge - *evt_tx_hash diff --git a/sources/chainlink/arbitrum/chainlink_arbitrum_sources.yml b/sources/chainlink/arbitrum/chainlink_arbitrum_sources.yml index 675775c440f..a1535ad5d13 100644 --- a/sources/chainlink/arbitrum/chainlink_arbitrum_sources.yml +++ b/sources/chainlink/arbitrum/chainlink_arbitrum_sources.yml @@ -5,7 +5,6 @@ sources: description: "Transfers events for ERC20 tokens on arbitrum." tables: - name: evt_Transfer - loaded_at_field: evt_block_time description: "Transfers events for ERC20 tokens on arbitrum." columns: - &contract_address diff --git a/sources/chainlink/avalanche_c/chainlink_avalanche_c_sources.yml b/sources/chainlink/avalanche_c/chainlink_avalanche_c_sources.yml index d4b0cd0ccc4..2ed0e768cce 100644 --- a/sources/chainlink/avalanche_c/chainlink_avalanche_c_sources.yml +++ b/sources/chainlink/avalanche_c/chainlink_avalanche_c_sources.yml @@ -5,7 +5,6 @@ sources: description: "Transfers events for ERC20 tokens on avalanche_c." tables: - name: evt_Transfer - loaded_at_field: evt_block_time description: "Transfers events for ERC20 tokens on avalanche_c." columns: - &contract_address diff --git a/sources/chainlink/fantom/chainlink_fantom_sources.yml b/sources/chainlink/fantom/chainlink_fantom_sources.yml index 05263f126dc..54abceba00f 100644 --- a/sources/chainlink/fantom/chainlink_fantom_sources.yml +++ b/sources/chainlink/fantom/chainlink_fantom_sources.yml @@ -5,7 +5,6 @@ sources: description: "Transfers events for ERC20 tokens on fantom." tables: - name: evt_Transfer - loaded_at_field: evt_block_time description: "Transfers events for ERC20 tokens on fantom." columns: - &contract_address diff --git a/sources/chainlink/gnosis/chainlink_gnosis_sources.yml b/sources/chainlink/gnosis/chainlink_gnosis_sources.yml index ade009a7b37..5fe6bef6c74 100644 --- a/sources/chainlink/gnosis/chainlink_gnosis_sources.yml +++ b/sources/chainlink/gnosis/chainlink_gnosis_sources.yml @@ -5,7 +5,6 @@ sources: description: "Transfers events for ERC20 tokens on gnosis." tables: - name: evt_Transfer - loaded_at_field: evt_block_time description: "Transfers events for ERC20 tokens on gnosis." columns: - &contract_address diff --git a/sources/chainlink/polygon/chainlink_polygon_sources.yml b/sources/chainlink/polygon/chainlink_polygon_sources.yml index ea7eba1f610..11f0046f52f 100644 --- a/sources/chainlink/polygon/chainlink_polygon_sources.yml +++ b/sources/chainlink/polygon/chainlink_polygon_sources.yml @@ -5,7 +5,6 @@ sources: description: "Transfers events for ERC20 tokens on polygon." tables: - name: evt_Transfer - loaded_at_field: evt_block_time description: "Transfers events for ERC20 tokens on polygon." columns: - &contract_address diff --git a/sources/component/ethereum/component_ethereum_sources.yml b/sources/component/ethereum/component_ethereum_sources.yml index dc2d905db7e..0444f717b67 100644 --- a/sources/component/ethereum/component_ethereum_sources.yml +++ b/sources/component/ethereum/component_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Component ethereum contracts tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/compound/ethereum/compound_ethereum_sources.yml b/sources/compound/ethereum/compound_ethereum_sources.yml index 432ad0d5285..f4fabeef207 100644 --- a/sources/compound/ethereum/compound_ethereum_sources.yml +++ b/sources/compound/ethereum/compound_ethereum_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: compound_v2_ethereum description: "Ethereum decoded tables related to Compound v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: GovernorBravoDelegate_evt_VoteCast - loaded_at_field: evt_block_time columns: - &contract_address name: contract_address @@ -33,7 +30,6 @@ sources: - &votes name: votes - name: GovernorBravoDelegate_evt_ProposalCreated - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -59,7 +55,6 @@ sources: - &values name: values - name: GovernorBravoDelegate_evt_ProposalCanceled - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -68,7 +63,6 @@ sources: - *evt_tx_hash - *id - name: GovernorBravoDelegate_evt_ProposalExecuted - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -77,7 +71,6 @@ sources: - *evt_tx_hash - *id - name: GovernorBravoDelegate_evt_ProposalQueued - loaded_at_field: evt_block_time columns: - *contract_address - &eta diff --git a/sources/cow_protocol/ethereum/cow_protocol_ethereum_sources.yml b/sources/cow_protocol/ethereum/cow_protocol_ethereum_sources.yml index 0ed231c8657..1e25c9777d9 100644 --- a/sources/cow_protocol/ethereum/cow_protocol_ethereum_sources.yml +++ b/sources/cow_protocol/ethereum/cow_protocol_ethereum_sources.yml @@ -170,4 +170,3 @@ sources: name: output_orderHash description: "ETH Flow Order Hash corresponds directly to a GPv2 Order Uid by concatenation with owner = contract_address and validTo = `ffffffff`" - name: CowProtocolVirtualToken_evt_Claimed - loaded_at_field: evt_block_time diff --git a/sources/cryptopunks/ethereum/cryptopunks_ethereum_sources.yml b/sources/cryptopunks/ethereum/cryptopunks_ethereum_sources.yml index 67aafa4d8ef..81f7c72303f 100644 --- a/sources/cryptopunks/ethereum/cryptopunks_ethereum_sources.yml +++ b/sources/cryptopunks/ethereum/cryptopunks_ethereum_sources.yml @@ -2,30 +2,15 @@ version: 2 sources: - name: cryptopunks_ethereum - freshness: - warn_after: { count: 48, period: hour } - error_after: { count: 96, period: hour } tables: - name: CryptoPunksMarket_evt_PunkBought - loaded_at_field: evt_block_time - name: CryptoPunksMarket_evt_PunkBidEntered - loaded_at_field: evt_block_time - name: CryptoPunksMarket_evt_PunkOffered - loaded_at_field: evt_block_time - name: CryptoPunksMarket_evt_PunkNoLongerForSale - loaded_at_field: evt_block_time - name: CryptoPunksMarket_evt_PunkTransfer - loaded_at_field: evt_block_time - name: CryptoPunksMarket_evt_PunkBidWithdrawn - loaded_at_field: evt_block_time - name: CryptoPunksMarket_evt_Transfer - loaded_at_field: evt_block_time - name: CryptoPunksMarket_evt_Assign - loaded_at_field: evt_block_time - name: rarible_v1_ethereum - freshness: - warn_after: { count: 48, period: hour } - error_after: { count: 96, period: hour } tables: - name: ERC721Sale_v2_evt_Buy - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/curvefi/celo/curvefi_celo_sources.yml b/sources/curvefi/celo/curvefi_celo_sources.yml index 95340be7e84..86d6a682347 100644 --- a/sources/curvefi/celo/curvefi_celo_sources.yml +++ b/sources/curvefi/celo/curvefi_celo_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: curvefi_celo description: "decoded events and function calls for curve.fi on Celo" - freshness: - warn_after: { count: 12, period: hour } tables: - name: StableSwap_call_coins - loaded_at_field: call_block_time diff --git a/sources/curvefi/ethereum/curvefi_ethereum_sources.yml b/sources/curvefi/ethereum/curvefi_ethereum_sources.yml index c0469b288e3..173a84175c0 100644 --- a/sources/curvefi/ethereum/curvefi_ethereum_sources.yml +++ b/sources/curvefi/ethereum/curvefi_ethereum_sources.yml @@ -3,101 +3,51 @@ version: 2 sources: - name: curvefi_ethereum description: "decoded events and function calls for curve.fi on ethereum" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: CurveFactory_call_deploy_plain_pool - loaded_at_field: call_block_time - name: CurveFactory_call_deploy_metapool - loaded_at_field: call_block_time - name: MetaPoolFactory_call_deploy_metapool - loaded_at_field: call_block_time - name: CurveFactory_call_deploy_gauge - loaded_at_field: call_block_time - name: CurveFactoryV2_evt_CryptoPoolDeployed - loaded_at_field: evt_block_time - name: CurveFactoryV2_call_deploy_pool - loaded_at_field: call_block_time - name: CurveFactory_evt_LiquidityGaugeDeployed - loaded_at_field: evt_block_time - name: CurveFactoryV2_evt_LiquidityGaugeDeployed - loaded_at_field: evt_block_time - name: susd_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: susd_swap_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: susd_evt_TokenExchange - loaded_at_field: evt_block_time - name: susd_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: compound_evt_TokenExchange - loaded_at_field: evt_block_time - name: compound_v2_evt_TokenExchange - loaded_at_field: evt_block_time - name: compound_v2_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: compound_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: compound_swap_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: usdt_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: usdt_swap_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: y_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: y_swap_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: busd_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: busd_swap_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: pax_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: pax_swap_evt_TokenExchangeUnderlying - loaded_at_field: evt_block_time - name: ren_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: sbtc_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: hbtc_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: threepool_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: steth_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: tricrypto_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: tricrypto2_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: rsr_frax_usdc_pool_evt_TokenExchange - loaded_at_field: evt_block_time - name: crvUSD_StableswapFactory_evt_PlainPoolDeployed - loaded_at_field: evt_block_time - name: crvUSD_StableswapFactory_call_deploy_plain_pool - loaded_at_field: call_block_time - name: crvUSD_StableswapFactory_call_deploy_metapool - loaded_at_field: evt_block_time - name: CurveStableswapFactoryNG_evt_PlainPoolDeployed - loaded_at_field: call_block_time - name: CurveStableswapFactoryNG_call_deploy_plain_pool - loaded_at_field: call_block_time - name: CurveTwocryptoFactory_evt_TwocryptoPoolDeployed - loaded_at_field: call_block_time - name: CurveTwocryptoFactory_call_deploy_pool - loaded_at_field: call_block_time - name: CurveTwocryptoFactory_evt_LiquidityGaugeDeployed - loaded_at_field: evt_block_time - name: curvefi_v2_ethereum description: "decoded events and function calls for curve.fi v2 on ethereum" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: CurveTricryptoFactory_evt_TricryptoPoolDeployed - loaded_at_field: evt_block_time - name: CurveTricryptoFactory_call_deploy_pool - loaded_at_field: call_block_time - name: CurveTricryptoFactory_evt_LiquidityGaugeDeployed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/curvefi/fantom/curvefi_fantom_sources.yml b/sources/curvefi/fantom/curvefi_fantom_sources.yml index 436d3321fa2..296cba9c5e5 100644 --- a/sources/curvefi/fantom/curvefi_fantom_sources.yml +++ b/sources/curvefi/fantom/curvefi_fantom_sources.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: curvefi_fantom description: "decoded events for curvefi on fantom" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: StableSwap_Factory_evt_BasePoolAdded - loaded_at_field: evt_block_time - name: StableSwap_Factory_call_deploy_plain_pool - loaded_at_field: call_block_time - name: StableSwap_Factory_call_deploy_metapool - loaded_at_field: call_block_time diff --git a/sources/curvefi/optimism/curvefi_optimism_sources.yml b/sources/curvefi/optimism/curvefi_optimism_sources.yml index 55463a547ab..ec34a591e37 100644 --- a/sources/curvefi/optimism/curvefi_optimism_sources.yml +++ b/sources/curvefi/optimism/curvefi_optimism_sources.yml @@ -3,18 +3,10 @@ version: 2 sources: - name: curvefi_optimism description: "decoded events and function calls for curve.fi on optimism" - freshness: - warn_after: { count: 12, period: hour } tables: - name: PoolFactory_call_deploy_plain_pool - loaded_at_field: call_block_time - name: PoolFactory_evt_MetaPoolDeployed - loaded_at_field: evt_block_time - name: StableSwap_call_coins - loaded_at_field: call_block_time - name: Vyper_contract_evt_DeployedGauge - loaded_at_field: evt_block_time - name: PoolFactory_evt_LiquidityGaugeDeployed - loaded_at_field: evt_block_time - name: CurveStableswapFactoryNG_call_deploy_plain_pool - loaded_at_field: call_block_time diff --git a/sources/dappradar/ethereum/dappradar_ethereum_sources.yml b/sources/dappradar/ethereum/dappradar_ethereum_sources.yml index 633729422f5..a16f870b2da 100644 --- a/sources/dappradar/ethereum/dappradar_ethereum_sources.yml +++ b/sources/dappradar/ethereum/dappradar_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: DappRadar ethereum contracts tables: - name: Airdrop_evt_TokenClaimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/decent/optimism/decent_optimism_edition_metadata_sources.yml b/sources/decent/optimism/decent_optimism_edition_metadata_sources.yml index f54e0549e1c..87d77b018b3 100644 --- a/sources/decent/optimism/decent_optimism_edition_metadata_sources.yml +++ b/sources/decent/optimism/decent_optimism_edition_metadata_sources.yml @@ -3,15 +3,8 @@ version: 2 sources: - name: decent_optimism description: "op mainnet decoded tables related to decent contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: DCNTSDK_call_deployDCNT721A - loaded_at_field: call_block_time - name: DCNTSDK_call_deployDCNT4907A - loaded_at_field: call_block_time - name: DCNTSDK_call_deployDCNTCrescendo - loaded_at_field: call_block_time - name: DCNTSDK_call_deployDCNTSeries - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/defiswap/ethereum/defiswap_ethereum_sources.yml b/sources/defiswap/ethereum/defiswap_ethereum_sources.yml index e6971c3babd..3275786018a 100644 --- a/sources/defiswap/ethereum/defiswap_ethereum_sources.yml +++ b/sources/defiswap/ethereum/defiswap_ethereum_sources.yml @@ -4,14 +4,10 @@ sources: - name: defiswap_ethereum description: > Decoded tables related to defiswap dex swap. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: CroDefiSwapPair_evt_Swap description: > Decoded table related to the defiswap swap events. - loaded_at_field: evt_block_time columns: - &amount0In name: amount0In @@ -45,14 +41,10 @@ sources: - name: crodefi_ethereum description: > Decoded tables related to defiswap dex pair creation. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: CroDefiSwapFactory_evt_PairCreated description: > Decoded table related to the defiswap pair creations. - loaded_at_field: evt_block_time columns: - &_0 name: _0 diff --git a/sources/dodo/arbitrum/dodo_arbitrum_sources.yml b/sources/dodo/arbitrum/dodo_arbitrum_sources.yml index ebd6090f5ec..6f94d349750 100644 --- a/sources/dodo/arbitrum/dodo_arbitrum_sources.yml +++ b/sources/dodo/arbitrum/dodo_arbitrum_sources.yml @@ -4,14 +4,10 @@ sources: - name: dodo_arbitrum description: > Decoded tables related to Dodo dex trades for Arbitrum - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: DODORouteProxy_evt_OrderHistory description: > V1 of Decoded table that shows Order History happening through a self_built_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Arbitrum address for the proxy contract used in transaction' @@ -25,7 +21,6 @@ sources: - name: DODOV2Proxy02_evt_OrderHistory description: > V2 of Decoded table that shows Order History happening through a router contract number 2. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Arbitrum address for the proxy contract used in transaction' @@ -39,7 +34,6 @@ sources: - name: DODOFeeRouteProxy_evt_OrderHistory description: > Decoded table that shows Order History happening through a fee_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Arbitrum address for the proxy contract used in transaction' diff --git a/sources/dodo/base/dodo_base_sources.yml b/sources/dodo/base/dodo_base_sources.yml index e7a0e9001ef..32436601559 100644 --- a/sources/dodo/base/dodo_base_sources.yml +++ b/sources/dodo/base/dodo_base_sources.yml @@ -4,14 +4,10 @@ sources: - name: dodo_base description: > Decoded tables related to Dodo dex trades for BASE - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: DODOFeeRouteProxy_evt_OrderHistory description: > Decoded table that shows Order History happening through a fee_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Base address for the proxy contract used in transaction' @@ -25,7 +21,6 @@ sources: - name: DODOFeeRouteProxy_widget_evt_OrderHistory description: > Decoded table that shows Order History happening through a route-widget contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Base address for the proxy contract used in transaction' diff --git a/sources/dodo/bnb/dodo_bnb_sources.yml b/sources/dodo/bnb/dodo_bnb_sources.yml index d1113d6239f..1104408656d 100644 --- a/sources/dodo/bnb/dodo_bnb_sources.yml +++ b/sources/dodo/bnb/dodo_bnb_sources.yml @@ -4,14 +4,10 @@ sources: - name: dodoex_bnb description: > Decoded tables related to Dodo dex trades for Binance Smart Chain - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: DODORouteProxy_evt_OrderHistory description: > V1 of Decoded table that shows Order History happening through a self_built_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Binance Smart Chain address for the proxy contract used in transaction' @@ -25,7 +21,6 @@ sources: - name: DODOV2Proxy01_evt_OrderHistory description: > V2 of Decoded table that shows Order History happening through a router contract number 01. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Binance Smart Chain address for the proxy contract used in transaction' @@ -39,7 +34,6 @@ sources: - name: DODOV2Proxy02_evt_OrderHistory description: > V2 of Decoded table that shows Order History happening through a router contract number 2. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Binance Smart Chain address for the proxy contract used in transaction' @@ -53,7 +47,6 @@ sources: - name: DODOFeeRouteProxy_evt_OrderHistory description: > Order History happening through a fee_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Binance Smart Chain address for the proxy contract used in transaction' diff --git a/sources/dodo/ethereum/dodo_ethereum_sources.yml b/sources/dodo/ethereum/dodo_ethereum_sources.yml index b61656d7896..2a16928339f 100644 --- a/sources/dodo/ethereum/dodo_ethereum_sources.yml +++ b/sources/dodo/ethereum/dodo_ethereum_sources.yml @@ -4,14 +4,10 @@ sources: - name: dodo_ethereum description: > Decoded tables related to Dodo dex trades. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: DODOV1Proxy01_evt_OrderHistory description: > Decoded table that shows Order History happening through a router contract number 1. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Ethereum address for the proxy contract used in transaction' @@ -25,7 +21,6 @@ sources: - name: DODOV1Proxy02_evt_OrderHistory description: > Decoded table that shows Order History happening through a router contract number 2. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Ethereum address for the proxy contract used in transaction' @@ -39,7 +34,6 @@ sources: - name: DODOV1Proxy03_evt_OrderHistory description: > Decoded table that shows Order History happening through a router contract number 3. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Ethereum address for the proxy contract used in transaction' @@ -53,7 +47,6 @@ sources: - name: DODOV1Proxy04_evt_OrderHistory description: > Decoded table that shows Order History happening through a router contract number 4. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Ethereum address for the proxy contract used in transaction' @@ -67,7 +60,6 @@ sources: - name: DODOV2Proxy02_evt_OrderHistory description: > Decoded table that shows Order History happening through a router contract number 5. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Ethereum address for the proxy contract used in transaction' @@ -81,7 +73,6 @@ sources: - name: DODORouteProxy_evt_OrderHistory description: > Decoded table that shows Order History happening through a self_built_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Ethereum address for the proxy contract used in transaction' @@ -95,7 +86,6 @@ sources: - name: DODOFeeRouteProxy_evt_OrderHistory description: > Decoded table that shows Order History happening through a fee_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Ethereum address for the proxy contract used in transaction' diff --git a/sources/dodo/optimism/dodo_optimism_sources.yml b/sources/dodo/optimism/dodo_optimism_sources.yml index 30a0d7c15ea..a28c74c483a 100644 --- a/sources/dodo/optimism/dodo_optimism_sources.yml +++ b/sources/dodo/optimism/dodo_optimism_sources.yml @@ -4,14 +4,10 @@ sources: - name: dodo_optimism description: > Decoded tables related to Dodo dex trades for Optimism - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: DODORouteProxy_evt_OrderHistory description: > Order History of trading happening through a self_built_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Address for the proxy contract used in transaction' @@ -26,7 +22,6 @@ sources: - name: DODOV2Proxy02_evt_OrderHistory description: > Order History of trading happening through a proxy router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Address for the proxy contract used in transaction' @@ -40,7 +35,6 @@ sources: - name: DODOFeeRouteProxy_evt_OrderHistory description: > Decoded table that shows Order History happening through a fee_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Optimism address for the proxy contract used in transaction' diff --git a/sources/dodo/polygon/dodo_polygon_sources.yml b/sources/dodo/polygon/dodo_polygon_sources.yml index 9490159c147..84d4272c4f1 100644 --- a/sources/dodo/polygon/dodo_polygon_sources.yml +++ b/sources/dodo/polygon/dodo_polygon_sources.yml @@ -4,14 +4,10 @@ sources: - name: dodo_v2_polygon description: > Decoded tables related to Dodo dex trades for Polygon - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: DODORouteProxy_evt_OrderHistory description: > Order History of trading happening through a self_built_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Address for the proxy contract used in transaction' @@ -26,7 +22,6 @@ sources: - name: DODOV2Proxy02_evt_OrderHistory description: > Order History of trading happening through a proxy router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Address for the proxy contract used in transaction' @@ -40,7 +35,6 @@ sources: - name: DODOFeeRouteProxy_evt_OrderHistory description: > Decoded table that shows Order History happening through a fee_router contract. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'Polygon address for the proxy contract used in transaction' diff --git a/sources/dydx/ethereum/dydx_ethereum_sources.yml b/sources/dydx/ethereum/dydx_ethereum_sources.yml index 34d65e90bf4..ef116327ec9 100644 --- a/sources/dydx/ethereum/dydx_ethereum_sources.yml +++ b/sources/dydx/ethereum/dydx_ethereum_sources.yml @@ -6,7 +6,6 @@ sources: tables: - name: DydxGovernor_evt_VoteEmitted - loaded_at_field: evt_block_time columns: - &contract_address name: contract_address @@ -32,7 +31,6 @@ sources: - &votes name: votes - name: DydxGovernor_evt_ProposalCreated - loaded_at_field: evt_block_time columns: - name: contract_address description: "DAO governor contract address" @@ -60,7 +58,6 @@ sources: - &values name: values - name: DydxGovernor_evt_ProposalCanceled - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -69,7 +66,6 @@ sources: - *evt_tx_hash - *id - name: DydxGovernor_evt_ProposalExecuted - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -78,7 +74,6 @@ sources: - *evt_tx_hash - *id - name: DydxGovernor_evt_ProposalQueued - loaded_at_field: evt_block_time columns: - *contract_address - &eta @@ -94,6 +89,4 @@ sources: tables: - name: SoloMargin_evt_LogDeposit - loaded_at_field: evt_block_time - name: SoloMargin_evt_LogWithdraw - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/ellipsis_finance/bnb/ellipsis_finance_bnb_sources.yml b/sources/ellipsis_finance/bnb/ellipsis_finance_bnb_sources.yml index 428ef410181..0fd970d1f2e 100644 --- a/sources/ellipsis_finance/bnb/ellipsis_finance_bnb_sources.yml +++ b/sources/ellipsis_finance/bnb/ellipsis_finance_bnb_sources.yml @@ -3,25 +3,13 @@ version: 2 sources: - name: ellipsis_finance_bnb description: "decoded events for ellipsis finance on bnb" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: FactoryPool_call_add_base_pool - loaded_at_field: call_block_time - name: FactoryPool_v2_call_add_base_pool - loaded_at_field: call_block_time - name: FactoryPool_evt_PlainPoolDeployed - loaded_at_field: evt_block_time - name: FactoryPool_v2_evt_PlainPoolDeployed - loaded_at_field: evt_block_time - name: FactoryPool_evt_MetaPoolDeployed - loaded_at_field: evt_block_time - name: FactoryPool_v2_evt_MetaPoolDeployed - loaded_at_field: evt_block_time - name: FactoryPool_v3_evt_CryptoPoolDeployed - loaded_at_field: evt_block_time - name: FactoryPool_v4_evt_CryptoPoolDeployed - loaded_at_field: evt_block_time - name: AirdropClaim_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/emdx/avalanche_c/emdx_avalanche_c_sources.yml b/sources/emdx/avalanche_c/emdx_avalanche_c_sources.yml index e81cc49a21b..215cca29c52 100644 --- a/sources/emdx/avalanche_c/emdx_avalanche_c_sources.yml +++ b/sources/emdx/avalanche_c/emdx_avalanche_c_sources.yml @@ -2,17 +2,10 @@ version: 2 sources: - name: emdx_avalanche_c - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } description: > Decoded event table for emdx margin trades tables: - name: ClearingHouse_evt_PositionChanged - loaded_at_field: evt_block_time - name: ClearingHouse_call_closePosition - loaded_at_field: call_block_time - name: ClearingHouse_call_openPosition - loaded_at_field: call_block_time - name: ClearingHouse_evt_PositionLiquidated - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/ens/ens_ethereum_sources.yml b/sources/ens/ens_ethereum_sources.yml index e146303e188..d342a951f26 100644 --- a/sources/ens/ens_ethereum_sources.yml +++ b/sources/ens/ens_ethereum_sources.yml @@ -4,32 +4,17 @@ sources: - name: ethereumnameservice_ethereum tables: - name: BaseRegistrarImplementation_evt_NameRegistered - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: BaseRegistrarImplementation_evt_NameRenewed - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: ETHRegistrarController_1_evt_NameRegistered - name: ETHRegistrarController_2_evt_NameRegistered - name: ETHRegistrarController_3_evt_NameRegistered - name: ETHRegistrarController_4_evt_NameRegistered - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: ENSRegistry_evt_NewOwner - name: ENSRegistryWithFallback_evt_NewOwner - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: ETHRegistrarController_1_evt_NameRenewed - name: ETHRegistrarController_2_evt_NameRenewed - name: ETHRegistrarController_3_evt_NameRenewed - name: ETHRegistrarController_4_evt_NameRenewed - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: DefaultReverseResolver_call_setName - name: PublicResolver_v2_call_setName - name: ReverseRegistrar_v2_call_setName @@ -38,17 +23,10 @@ sources: - name: ReverseRegistrar_v3_call_setName - name: BaseRegistrarImplementation_call_reclaim - name: PublicResolver_evt_AddrChanged - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: PublicResolver_v2_evt_AddrChanged - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: PublicResolver_evt_AddressChanged - name: OldBaseRegistrar_evt_NameRegistered - name: ENSGovernor_evt_VoteCast - loaded_at_field: evt_block_time columns: - &contract_address name: contract_address @@ -72,7 +50,6 @@ sources: - &votes name: votes - name: ENSGovernor_evt_ProposalCreated - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -98,7 +75,6 @@ sources: - &values name: values - name: ENSGovernor_evt_ProposalCanceled - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -107,7 +83,6 @@ sources: - *evt_tx_hash - *id - name: ENSGovernor_evt_ProposalExecuted - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -116,7 +91,6 @@ sources: - *evt_tx_hash - *id - name: ENSGovernor_evt_ProposalQueued - loaded_at_field: evt_block_time columns: - *contract_address - &eta diff --git a/sources/ens/ethereum/ens_ethereum_sources.yml b/sources/ens/ethereum/ens_ethereum_sources.yml index 1bfee4ffb8c..3a5545886cd 100644 --- a/sources/ens/ethereum/ens_ethereum_sources.yml +++ b/sources/ens/ethereum/ens_ethereum_sources.yml @@ -2,7 +2,5 @@ version: 2 sources: - name: ethereumnameservice_ethereum - freshness: tables: - - name: ENSToken_evt_Claim - loaded_at_field: evt_block_time \ No newline at end of file + - name: ENSToken_evt_Claim \ No newline at end of file diff --git a/sources/equalizer/bnb/equalizer_bnb_sources.yml b/sources/equalizer/bnb/equalizer_bnb_sources.yml index ed991bf7f02..1b7ab8d7a4f 100644 --- a/sources/equalizer/bnb/equalizer_bnb_sources.yml +++ b/sources/equalizer/bnb/equalizer_bnb_sources.yml @@ -6,4 +6,3 @@ sources: tables: - name: FlashLoanProvider_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/equalizer/ethereum/equalizer_ethereum_sources.yml b/sources/equalizer/ethereum/equalizer_ethereum_sources.yml index b93d119985b..78bdd5a8c77 100644 --- a/sources/equalizer/ethereum/equalizer_ethereum_sources.yml +++ b/sources/equalizer/ethereum/equalizer_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: tables: - name: FlashLoanProvider_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/equalizer/optimism/equalizer_optimism_sources.yml b/sources/equalizer/optimism/equalizer_optimism_sources.yml index 26bb98edfba..095cb09dc73 100644 --- a/sources/equalizer/optimism/equalizer_optimism_sources.yml +++ b/sources/equalizer/optimism/equalizer_optimism_sources.yml @@ -6,4 +6,3 @@ sources: tables: - name: FlashLoanProvider_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/equalizer/polygon/equalizer_polygon_sources.yml b/sources/equalizer/polygon/equalizer_polygon_sources.yml index 32ea5e25b20..e4bd342c08e 100644 --- a/sources/equalizer/polygon/equalizer_polygon_sources.yml +++ b/sources/equalizer/polygon/equalizer_polygon_sources.yml @@ -6,4 +6,3 @@ sources: tables: - name: FlashLoanProvider_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/etherfi/ethereum/etherfi_ethereum_sources.yml b/sources/etherfi/ethereum/etherfi_ethereum_sources.yml index 86654f8b715..1004dacd7ed 100644 --- a/sources/etherfi/ethereum/etherfi_ethereum_sources.yml +++ b/sources/etherfi/ethereum/etherfi_ethereum_sources.yml @@ -2,10 +2,7 @@ version: 2 sources: - name: ethfi_ethereum - freshness: - warn_after: { count: 12, period: hour } description: > Ether.Fi is a liquid restaking protocol on Ethereum. tables: - name: MerkleDistributorWithDeadline_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/euler/ethereum/euler_ethereum_sources.yml b/sources/euler/ethereum/euler_ethereum_sources.yml index 816839581b0..982d88796ab 100644 --- a/sources/euler/ethereum/euler_ethereum_sources.yml +++ b/sources/euler/ethereum/euler_ethereum_sources.yml @@ -6,6 +6,4 @@ sources: tables: - name: Euler_evt_Borrow - loaded_at_field: evt_block_time - name: Euler_evt_Repay - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/fantasy/blast/fantasy_blast_sources.yml b/sources/fantasy/blast/fantasy_blast_sources.yml new file mode 100644 index 00000000000..8e00afccaaa --- /dev/null +++ b/sources/fantasy/blast/fantasy_blast_sources.yml @@ -0,0 +1,11 @@ +version: 2 + +sources: + - name: fantasy_blast + description: "Decoded contracts for Fantasy on Blast" + + tables: + - name: Minter_evt_NewMintConfig + - name: Minter_evt_Mint + - name: Minter_evt_LevelUp + - name: Minter_evt_BurnToDraw diff --git a/sources/fiat_dao/ethereum/fiat_dao_ethereum_sources.yml b/sources/fiat_dao/ethereum/fiat_dao_ethereum_sources.yml index 6f3cd3bdbb5..e3556e30112 100644 --- a/sources/fiat_dao/ethereum/fiat_dao_ethereum_sources.yml +++ b/sources/fiat_dao/ethereum/fiat_dao_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: tables: - name: Flash_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/firebird_finance/optimism/firebird_finance_optimism_sources.yml b/sources/firebird_finance/optimism/firebird_finance_optimism_sources.yml index 3661d299161..952960d6785 100644 --- a/sources/firebird_finance/optimism/firebird_finance_optimism_sources.yml +++ b/sources/firebird_finance/optimism/firebird_finance_optimism_sources.yml @@ -2,10 +2,7 @@ version: 2 sources: - name: firebird_finance_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on firebird_finance tables: - name: FireBirdRouter_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/forefront/ethereum/forefront_ethereum_sources.yml b/sources/forefront/ethereum/forefront_ethereum_sources.yml index 266111d6d77..108af3abfc3 100644 --- a/sources/forefront/ethereum/forefront_ethereum_sources.yml +++ b/sources/forefront/ethereum/forefront_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Forefront ethereum contracts tables: - name: ForefrontMerkle_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/forta_network/ethereum/forta_network_ethereum_sources.yml b/sources/forta_network/ethereum/forta_network_ethereum_sources.yml index 99aaa75abd4..b1ea50c13e5 100644 --- a/sources/forta_network/ethereum/forta_network_ethereum_sources.yml +++ b/sources/forta_network/ethereum/forta_network_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Forta Network ethereum contracts tables: - name: Airdrop_evt_TokensReleased - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/fxdx/optimism/fxdx_optimism_sources.yml b/sources/fxdx/optimism/fxdx_optimism_sources.yml index 608b1cfe772..2f521316f54 100644 --- a/sources/fxdx/optimism/fxdx_optimism_sources.yml +++ b/sources/fxdx/optimism/fxdx_optimism_sources.yml @@ -2,23 +2,16 @@ version: 2 sources: - name: fxdxdex_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for Perpetual trades on fxdx tables: - name: Vault_evt_CollectPositionTradeFees - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteDecreasePosition - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteIncreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_IncreasePosition - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/galxe/ethereum/galxe_ethereum_sources.yml b/sources/galxe/ethereum/galxe_ethereum_sources.yml index 58aa045b8c1..2453591f615 100644 --- a/sources/galxe/ethereum/galxe_ethereum_sources.yml +++ b/sources/galxe/ethereum/galxe_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Galxe ethereum contracts tables: - name: MerkleDistributor_Airdrop_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/gas_dao/ethereum/gas_dao_ethereum_sources.yml b/sources/gas_dao/ethereum/gas_dao_ethereum_sources.yml index 27085944f34..6797d0e2910 100644 --- a/sources/gas_dao/ethereum/gas_dao_ethereum_sources.yml +++ b/sources/gas_dao/ethereum/gas_dao_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Gas DAO ethereum contracts tables: - name: GASToken_evt_Claim - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/gearbox/ethereum/gearbox_ethereum_sources.yml b/sources/gearbox/ethereum/gearbox_ethereum_sources.yml index 5a530d68a96..de7fcb6bce8 100644 --- a/sources/gearbox/ethereum/gearbox_ethereum_sources.yml +++ b/sources/gearbox/ethereum/gearbox_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Gearbox ethereum contracts tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/genie/ethereum/genie_ethereum_sources.yml b/sources/genie/ethereum/genie_ethereum_sources.yml index 062e922b72a..46e7aec41d5 100644 --- a/sources/genie/ethereum/genie_ethereum_sources.yml +++ b/sources/genie/ethereum/genie_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Genie ethereum contracts tables: - name: MerkleDistributorWithDeadline_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/gitcoin/ethereum/gitcoin_ethereum_sources.yml b/sources/gitcoin/ethereum/gitcoin_ethereum_sources.yml index ce68166b496..5f1b26c68b1 100644 --- a/sources/gitcoin/ethereum/gitcoin_ethereum_sources.yml +++ b/sources/gitcoin/ethereum/gitcoin_ethereum_sources.yml @@ -5,7 +5,6 @@ sources: description: "Ethereum decoded tables related to Gitcoin contract" tables: - name: GovernorAlpha_evt_VoteCast - loaded_at_field: evt_block_time columns: - &contract_address name: contract_address @@ -29,7 +28,6 @@ sources: - &votes name: votes - name: GovernorAlpha_evt_ProposalCreated - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -55,7 +53,6 @@ sources: - &values name: values - name: GovernorAlpha_evt_ProposalCanceled - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -64,7 +61,6 @@ sources: - *evt_tx_hash - *id - name: GovernorAlpha_evt_ProposalExecuted - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -73,7 +69,6 @@ sources: - *evt_tx_hash - *id - name: GovernorAlpha_evt_ProposalQueued - loaded_at_field: evt_block_time columns: - *contract_address - &eta @@ -85,4 +80,3 @@ sources: - *id - name: TokenDistributor_evt_Claimed - name: BulkCheckout_evt_DonationSent - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/gitcoin/polygon/gitcoin_polygon_sources.yml b/sources/gitcoin/polygon/gitcoin_polygon_sources.yml index 4b063a89a36..1c47abec647 100644 --- a/sources/gitcoin/polygon/gitcoin_polygon_sources.yml +++ b/sources/gitcoin/polygon/gitcoin_polygon_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: gitcoin_polygon description: "Polygon decoded tables related to Gitcoin contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: BulkCheckout_evt_DonationSent - loaded_at_field: evt_block_time diff --git a/sources/giveth/gnosis/giveth_gnosis_sources.yml b/sources/giveth/gnosis/giveth_gnosis_sources.yml index bfe69cd1b5a..6e9dcd1e05f 100644 --- a/sources/giveth/gnosis/giveth_gnosis_sources.yml +++ b/sources/giveth/gnosis/giveth_gnosis_sources.yml @@ -6,4 +6,3 @@ sources: Giveth gnosis contracts tables: - name: MerkleDistro_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/gmx/arbitrum/glp/gmx_arbitrum_glp_sources.yml b/sources/gmx/arbitrum/glp/gmx_arbitrum_glp_sources.yml index 82236d67fd9..ef18433bc9e 100644 --- a/sources/gmx/arbitrum/glp/gmx_arbitrum_glp_sources.yml +++ b/sources/gmx/arbitrum/glp/gmx_arbitrum_glp_sources.yml @@ -2,26 +2,15 @@ version: 2 sources: - name: gmx_arbitrum - freshness: - warn_after: { count: 12, period: hour } description: > Decoded tables related to GMX, a decentralized exchange. tables: - name: Vault_call_poolAmounts - loaded_at_field: call_block_time - name: Vault_call_reservedAmounts - loaded_at_field: call_block_time - name: Vault_call_guaranteedUsd - loaded_at_field: call_block_time - name: Vault_call_getMaxPrice - loaded_at_field: call_block_time - name: Vault_call_getMinPrice - loaded_at_field: call_block_time - name: Vault_call_globalShortAveragePrices - loaded_at_field: call_block_time - name: Vault_call_globalShortSizes - loaded_at_field: call_block_time - name: GlpManager_evt_AddLiquidity - loaded_at_field: evt_block_time - name: GlpManager_evt_RemoveLiquidity - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/gmx/arbitrum/gmx_arbitrum_sources.yml b/sources/gmx/arbitrum/gmx_arbitrum_sources.yml index e01d153d7c1..d2acbbc14ae 100644 --- a/sources/gmx/arbitrum/gmx_arbitrum_sources.yml +++ b/sources/gmx/arbitrum/gmx_arbitrum_sources.yml @@ -2,15 +2,15 @@ version: 2 sources: - name: gmx_arbitrum - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } description: > Decoded event table for swaps and margin trades on gmx arbitrum tables: - name: Vault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_IncreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_LiquidatePosition - loaded_at_field: evt_block_time \ No newline at end of file + + - name: gmx_v2_arbitrum + description: Tables with all decoded events for GMX v2 on the Arbitrum blockchain + tables: + - name: EventEmitter_evt_EventLog1 + - name: EventEmitter_evt_EventLog2 \ No newline at end of file diff --git a/sources/gmx/avalanche_c/glp/gmx_avalanche_c_glp_sources.yml b/sources/gmx/avalanche_c/glp/gmx_avalanche_c_glp_sources.yml index 629b264be06..ac405ec86d0 100644 --- a/sources/gmx/avalanche_c/glp/gmx_avalanche_c_glp_sources.yml +++ b/sources/gmx/avalanche_c/glp/gmx_avalanche_c_glp_sources.yml @@ -2,26 +2,15 @@ version: 2 sources: - name: gmx_avalanche_c - freshness: - warn_after: { count: 12, period: hour } description: > Decoded tables related to GMX, a decentralized exchange. tables: - name: Vault_call_poolAmounts - loaded_at_field: call_block_time - name: Vault_call_reservedAmounts - loaded_at_field: call_block_time - name: Vault_call_guaranteedUsd - loaded_at_field: call_block_time - name: Vault_call_getMaxPrice - loaded_at_field: call_block_time - name: Vault_call_getMinPrice - loaded_at_field: call_block_time - name: Vault_call_globalShortAveragePrices - loaded_at_field: call_block_time - name: Vault_call_globalShortSizes - loaded_at_field: call_block_time - name: GlpManager_evt_AddLiquidity - loaded_at_field: evt_block_time - name: GlpManager_evt_RemoveLiquidity - loaded_at_field: evt_block_time diff --git a/sources/gmx/avalanche_c/gmx_avalanche_c_sources.yml b/sources/gmx/avalanche_c/gmx_avalanche_c_sources.yml index 8309fc8fe56..28fccad2a65 100644 --- a/sources/gmx/avalanche_c/gmx_avalanche_c_sources.yml +++ b/sources/gmx/avalanche_c/gmx_avalanche_c_sources.yml @@ -2,15 +2,15 @@ version: 2 sources: - name: gmx_avalanche_c - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } description: > Decoded event table for swaps & margin trades on gmx avalanche_c tables: - name: Vault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_IncreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_LiquidatePosition - loaded_at_field: evt_block_time \ No newline at end of file + + - name: gmx_v2_avalanche_c + description: Tables with all decoded events for GMX v2 on the Avalanche blockchain + tables: + - name: EventEmitter_evt_EventLog1 + - name: EventEmitter_evt_EventLog2 \ No newline at end of file diff --git a/sources/goosefx/solana/_sources.yml b/sources/goosefx/solana/_sources.yml index 25ea68028aa..5f09d25458b 100644 --- a/sources/goosefx/solana/_sources.yml +++ b/sources/goosefx/solana/_sources.yml @@ -3,12 +3,7 @@ version: 2 sources: - name: goosefx_solana description: "goosefx_solana decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: gfx_ssl_v2_call_createPair - loaded_at_field: call_block_time - name: gfx_ssl_v2_call_swap - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/gyroscope/arbitrum/gyroscope_arbitrum_sources.yml b/sources/gyroscope/arbitrum/gyroscope_arbitrum_sources.yml index 158ccfc5452..d612b6f0d39 100644 --- a/sources/gyroscope/arbitrum/gyroscope_arbitrum_sources.yml +++ b/sources/gyroscope/arbitrum/gyroscope_arbitrum_sources.yml @@ -8,7 +8,6 @@ sources: - name: GyroECLPPoolFactory_evt_PoolCreated description: > Decoded table of gyroscope pool created - loaded_at_field: evt_block_time columns: - name: contract_address description: 'creator address' diff --git a/sources/gyroscope/ethereum/gyroscope_ethereum_sources.yml b/sources/gyroscope/ethereum/gyroscope_ethereum_sources.yml index b97798056f2..35e9baa2af0 100644 --- a/sources/gyroscope/ethereum/gyroscope_ethereum_sources.yml +++ b/sources/gyroscope/ethereum/gyroscope_ethereum_sources.yml @@ -8,7 +8,6 @@ sources: - name: GyroECLPPoolFactory_evt_PoolCreated description: > Decoded table of gyroscope pool created - loaded_at_field: evt_block_time columns: - name: contract_address description: 'creator address' diff --git a/sources/gyroscope/optimism/gyroscope_optimism_sources.yml b/sources/gyroscope/optimism/gyroscope_optimism_sources.yml index d72706a5fd9..7fb7d2098f6 100644 --- a/sources/gyroscope/optimism/gyroscope_optimism_sources.yml +++ b/sources/gyroscope/optimism/gyroscope_optimism_sources.yml @@ -8,7 +8,6 @@ sources: - name: GyroECLPPoolFactory_evt_PoolCreated description: > Decoded table of gyroscope pool created - loaded_at_field: evt_block_time columns: - name: contract_address description: 'creator address' diff --git a/sources/gyroscope/polygon/gyroscope_polygon_sources.yml b/sources/gyroscope/polygon/gyroscope_polygon_sources.yml index 997ce5213f0..d6cbc015b5f 100644 --- a/sources/gyroscope/polygon/gyroscope_polygon_sources.yml +++ b/sources/gyroscope/polygon/gyroscope_polygon_sources.yml @@ -8,7 +8,6 @@ sources: - name: GyroECLPPoolFactory_evt_PoolCreated description: > Decoded table of gyroscope pool created - loaded_at_field: evt_block_time columns: - name: contract_address description: 'creator address' diff --git a/sources/hashflow/avalanche_c/hashflow_avalanche_c_sources.yml b/sources/hashflow/avalanche_c/hashflow_avalanche_c_sources.yml index fe1d63f5b8c..84e6ea8d07e 100644 --- a/sources/hashflow/avalanche_c/hashflow_avalanche_c_sources.yml +++ b/sources/hashflow/avalanche_c/hashflow_avalanche_c_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: hashflow_avalanche_c description: "Avalanche (C-Chain) decoded tables related to Hashflow contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pool_evt_Trade - loaded_at_field: evt_block_time description: "Pool trades events table" columns: - &baseToken @@ -44,7 +41,6 @@ sources: name: txid - name: Pool_evt_LzTrade - loaded_at_field: evt_block_time description: "Pool layer zero trades events table" columns: - *evt_block_time @@ -69,7 +65,6 @@ sources: - *txid - name: Pool_evt_XChainTrade - loaded_at_field: evt_block_time description: "Pool XChain events table" columns: - *evt_block_time diff --git a/sources/hashflow/bnb/hashflow_bnb_sources.yml b/sources/hashflow/bnb/hashflow_bnb_sources.yml index 54a6e487ef0..46c7cd648c6 100644 --- a/sources/hashflow/bnb/hashflow_bnb_sources.yml +++ b/sources/hashflow/bnb/hashflow_bnb_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: hashflow_bnb description: "BNB decoded tables related to Hashflow contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pool_evt_Trade - loaded_at_field: evt_block_time description: "Pool trades events table" columns: - &baseToken @@ -44,7 +41,6 @@ sources: name: txid - name: Pool_evt_LzTrade - loaded_at_field: evt_block_time description: "Pool layer zero trade events table" columns: - *evt_block_time @@ -69,7 +65,6 @@ sources: - *txid - name: Pool_evt_XChainTrade - loaded_at_field: evt_block_time description: "Pool XChain events table" columns: - *evt_block_time diff --git a/sources/hashflow/ethereum/hashflow_ethereum_sources.yml b/sources/hashflow/ethereum/hashflow_ethereum_sources.yml index 0e546b2a6d2..1c445a7ae6a 100644 --- a/sources/hashflow/ethereum/hashflow_ethereum_sources.yml +++ b/sources/hashflow/ethereum/hashflow_ethereum_sources.yml @@ -3,14 +3,8 @@ version: 2 sources: - name: hashflow_ethereum description: "Hashflow non-decoded tables related to hashflow contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: pool_evt_trade - freshness: - warn_after: { count: 120, period: hour } - loaded_at_field: evt_block_time description: "" # to-do columns: - &baseToken @@ -55,7 +49,6 @@ sources: name: txid description: "Unique identifier of the quote" - name: router_call_tradesinglehop - loaded_at_field: call_block_time description: "Table containing details of tradeSingleHop calls made to the HashflowRouter contract" # to confirm columns: - *contract_address @@ -72,7 +65,6 @@ sources: - name: quote description: "json object containing details related to the specific quote executed" - name: Pool_evt_LzTrade - loaded_at_field: evt_block_time description: "Pool layer zero trade events table" columns: - *evt_block_time @@ -96,7 +88,6 @@ sources: - *trader - *txid - name: Pool_evt_XChainTrade - loaded_at_field: evt_block_time description: "Pool XChain events table" columns: - *evt_block_time diff --git a/sources/hashflow/optimism/hashflow_optimism_sources.yml b/sources/hashflow/optimism/hashflow_optimism_sources.yml index 7a649c86f25..cbc00e1b0cb 100644 --- a/sources/hashflow/optimism/hashflow_optimism_sources.yml +++ b/sources/hashflow/optimism/hashflow_optimism_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: hashflow_optimism description: "Optimism decoded tables related to Hashflow contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pool_evt_Trade - loaded_at_field: evt_block_time description: "Pool trades events table" columns: - &baseToken @@ -44,7 +41,6 @@ sources: name: txid - name: Pool_evt_LzTrade - loaded_at_field: evt_block_time description: "Pool layer zero trades events table" columns: - *evt_block_time @@ -69,7 +65,6 @@ sources: - *txid - name: Pool_evt_XChainTrade - loaded_at_field: evt_block_time description: "Pool XChain events table" columns: - *evt_block_time diff --git a/sources/hop_protocol/ethereum/hop_protocol_ethereum_sources.yml b/sources/hop_protocol/ethereum/hop_protocol_ethereum_sources.yml index d89aebdbccf..7a538e4938d 100644 --- a/sources/hop_protocol/ethereum/hop_protocol_ethereum_sources.yml +++ b/sources/hop_protocol/ethereum/hop_protocol_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: $HOP airdrop claims tables: - name: HOPToken_evt_Claim - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/hop_protocol/optimism/hop_protocol_optimism_sources.yml b/sources/hop_protocol/optimism/hop_protocol_optimism_sources.yml index af01c02d77c..1f87920f5c6 100644 --- a/sources/hop_protocol/optimism/hop_protocol_optimism_sources.yml +++ b/sources/hop_protocol/optimism/hop_protocol_optimism_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: hop_protocol_optimism description: "Optimism decoded tables related to Hop Protocol contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: L2_OptimismBridge_evt_TransferSent - loaded_at_field: evt_block_time description: "Event logs for bridge transfers away from Optimism" columns: - &contract_address @@ -42,7 +39,6 @@ sources: description: "Address receiving tokens when the bridge transfer is completed" - name: L2_OptimismBridge_evt_TransferFromL1Completed - loaded_at_field: evt_block_time description: "Event logs for bridge transfers to Optimism from L1 Ethereum" columns: - *contract_address @@ -56,7 +52,6 @@ sources: description: "Amount of tokens paid in fees to the relayer (raw)" - name: L2_OptimismBridge_evt_WithdrawalBonded - loaded_at_field: evt_block_time description: "Event logs for bridge transfers to Optimism from Non-L1 Ethereum Chains, when they are bonded (confirmed) on Optimism" columns: - *contract_address @@ -67,11 +62,8 @@ sources: - *amount - name: hop_protocol_arbitrum description: "Arbitrum decoded tables related to Hop Protocol contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: L2_ArbitrumBridge_evt_TransferSent - loaded_at_field: evt_block_time description: "Event logs for bridge transfers away from Arbitrum" columns: - *contract_address @@ -87,11 +79,8 @@ sources: - name: hop_protocol_polygon description: "Polygon decoded tables related to Hop Protocol contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: L2_PolygonBridge_evt_TransferSent - loaded_at_field: evt_block_time description: "Event logs for bridge transfers away from Polygon" columns: - *contract_address @@ -107,11 +96,8 @@ sources: - name: hop_protocol_gnosis description: "Gnosis decoded tables related to Hop Protocol contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: L2_xDaiBridge_evt_TransferSent - loaded_at_field: evt_block_time description: "Event logs for bridge transfers away from Gnosis Chain" columns: - *contract_address diff --git a/sources/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_sources.yml b/sources/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_sources.yml index 221cbc7544d..485b82e7c5f 100644 --- a/sources/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_sources.yml +++ b/sources/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_sources.yml @@ -3,17 +3,10 @@ version: 2 sources: - name: hubble_exchange_avalanche_c - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } description: > Decoded event table for hubble exchange margin trades tables: - name: ClearingHouse_evt_PositionModified - loaded_at_field: evt_block_time - name: ClearingHouse_call_closePosition - loaded_at_field: call_block_time - name: ClearingHouse_call_openPosition - loaded_at_field: call_block_time - name: ClearingHouse_evt_PositionLiquidated - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/ironbank/ethereum/ironbank_ethereum_sources.yml b/sources/ironbank/ethereum/ironbank_ethereum_sources.yml index 5ea7cf2ac80..a78f1b96524 100644 --- a/sources/ironbank/ethereum/ironbank_ethereum_sources.yml +++ b/sources/ironbank/ethereum/ironbank_ethereum_sources.yml @@ -5,7 +5,6 @@ sources: description: "decoded events and function calls for ironbank on ethereum" tables: - name: CErc20Delegator_evt_Borrow - loaded_at_field: evt_block_time description: "" # to-do columns: - &contract_address @@ -36,7 +35,6 @@ sources: name: totalBorrows description: "The total borrows with interest" - name: CErc20Delegator_evt_Mint - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -54,7 +52,6 @@ sources: name: mintTokens description: "the number of iTokens to be minted" - name: CErc20Delegator_evt_RepayBorrow - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -72,7 +69,6 @@ sources: - *accountBorrows - *totalBorrows - name: CErc20Delegator_evt_Redeem - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -90,7 +86,6 @@ sources: name: redeemTokens description: "The number of iTokens to redeem into underlying" - name: CErc20Delegator_evt_LiquidateBorrow - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address diff --git a/sources/ironbank/optimism/ironbank_optimism_sources.yml b/sources/ironbank/optimism/ironbank_optimism_sources.yml index 506b6cd603c..fa0d19637f7 100644 --- a/sources/ironbank/optimism/ironbank_optimism_sources.yml +++ b/sources/ironbank/optimism/ironbank_optimism_sources.yml @@ -5,7 +5,6 @@ sources: description: "decoded events and function calls for ironbank on optimism" tables: - name: CErc20Delegator_evt_Borrow - loaded_at_field: evt_block_time description: "" # to-do columns: - &contract_address @@ -36,7 +35,6 @@ sources: name: totalBorrows description: "The total borrows with interest" - name: CErc20Delegator_evt_Mint - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -54,7 +52,6 @@ sources: name: mintTokens description: "the number of iTokens to be minted" - name: CErc20Delegator_evt_RepayBorrow - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -72,7 +69,6 @@ sources: - *accountBorrows - *totalBorrows - name: CErc20Delegator_evt_Redeem - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -90,7 +86,6 @@ sources: name: redeemTokens description: "The number of iTokens to redeem into underlying" - name: CErc20Delegator_evt_LiquidateBorrow - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address diff --git a/sources/jarvis_network/polygon/jarvis_network_polygon_sources.yml b/sources/jarvis_network/polygon/jarvis_network_polygon_sources.yml index 27d35f15903..f49520067f1 100644 --- a/sources/jarvis_network/polygon/jarvis_network_polygon_sources.yml +++ b/sources/jarvis_network/polygon/jarvis_network_polygon_sources.yml @@ -5,7 +5,6 @@ sources: description: "Decoded events and function calls for Jarvis Network contracts (V1 and V2) On Polygon" tables: - name: SynthereumMultiLpLiquidityPool_evt_Minted - loaded_at_field: evt_block_time description: "Minting synthetic fiat currencies V2" columns: - &contract_address @@ -34,7 +33,6 @@ sources: description: "Address that received token" - name: SynthereumMultiLpLiquidityPool_evt_Redeemed - loaded_at_field: evt_block_time description: "Redemption of synthetic fiat currencies V2" columns: - *contract_address @@ -49,7 +47,6 @@ sources: - *recipient - name: SynthereumPoolOnChainPriceFeed_evt_Mint - loaded_at_field: evt_block_time description: "Minting synthetic fiat currencies V1" columns: - *contract_address @@ -75,7 +72,6 @@ sources: - *recipient - name: SynthereumPoolOnChainPriceFeed_evt_Redeem - loaded_at_field: evt_block_time description: "Redemption of synthetic fiat currencies V1" columns: - *contract_address @@ -94,7 +90,6 @@ sources: - *pool - name: SynthereumPoolOnChainPriceFeed_evt_Exchange - loaded_at_field: evt_block_time description: "Exchange of synthetic fiat currencies V1" columns: - *contract_address diff --git a/sources/king_of_destiny/king_of_destiny_nova_sources.yml b/sources/king_of_destiny/king_of_destiny_nova_sources.yml new file mode 100644 index 00000000000..ccb4d466516 --- /dev/null +++ b/sources/king_of_destiny/king_of_destiny_nova_sources.yml @@ -0,0 +1,8 @@ +version: 2 + +sources: + - name: king_of_destiny_nova + tables: + - name: MarketplaceV3_DirectListingsLogic_evt_NewSale + - name: MarketplaceV3_DirectListingsLogic_evt_NewListing + - name: MarketplaceV3_call_GetRoyalty diff --git a/sources/kyberswap/arbitrum/kyberswap_arbitrum_sources.yml b/sources/kyberswap/arbitrum/kyberswap_arbitrum_sources.yml index d27db1d9b4d..385d99062c1 100644 --- a/sources/kyberswap/arbitrum/kyberswap_arbitrum_sources.yml +++ b/sources/kyberswap/arbitrum/kyberswap_arbitrum_sources.yml @@ -3,9 +3,5 @@ version: 2 sources: - name: kyber_arbitrum description: "Arbitrum decoded tables related to Kyberswap contract (classic+elastic)" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: MetaAggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/kyberswap/avalanche_c/kyberswap_avalanche_c_sources.yml b/sources/kyberswap/avalanche_c/kyberswap_avalanche_c_sources.yml index 18f76993d51..beacc310566 100644 --- a/sources/kyberswap/avalanche_c/kyberswap_avalanche_c_sources.yml +++ b/sources/kyberswap/avalanche_c/kyberswap_avalanche_c_sources.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: kyber_avalanche_c description: "Avalanche (C-Chain) decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouter_evt_Swapped - loaded_at_field: evt_block_time - name: MetaAggregationRouter_evt_Swapped - loaded_at_field: evt_block_time - name: MetaAggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/kyberswap/base/kyberswap_base_sources.yml b/sources/kyberswap/base/kyberswap_base_sources.yml index 0a352302d8f..735bf58f5ec 100644 --- a/sources/kyberswap/base/kyberswap_base_sources.yml +++ b/sources/kyberswap/base/kyberswap_base_sources.yml @@ -3,9 +3,5 @@ version: 2 sources: - name: kyber_base description: "base decoded tables related to Kyberswap aggregator contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: MetaAggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/kyberswap/bnb/kyberswap_bnb_sources.yml b/sources/kyberswap/bnb/kyberswap_bnb_sources.yml index e1e5108e9c7..90a77e0de5b 100644 --- a/sources/kyberswap/bnb/kyberswap_bnb_sources.yml +++ b/sources/kyberswap/bnb/kyberswap_bnb_sources.yml @@ -3,9 +3,5 @@ version: 2 sources: - name: kyber_bnb description: "BSC decoded tables related to Kyberswap contract (classic+elastic)" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: MetaAggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/kyberswap/ethereum/kyberswap_ethereum_sources.yml b/sources/kyberswap/ethereum/kyberswap_ethereum_sources.yml index c53f4e445d5..70dab9098dd 100644 --- a/sources/kyberswap/ethereum/kyberswap_ethereum_sources.yml +++ b/sources/kyberswap/ethereum/kyberswap_ethereum_sources.yml @@ -3,9 +3,5 @@ version: 2 sources: - name: kyber_ethereum description: "Ethereum decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: MetaAggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/kyberswap/optimism/kyberswap_optimism_sources.yml b/sources/kyberswap/optimism/kyberswap_optimism_sources.yml index fa73ff283ff..d8088803110 100644 --- a/sources/kyberswap/optimism/kyberswap_optimism_sources.yml +++ b/sources/kyberswap/optimism/kyberswap_optimism_sources.yml @@ -3,26 +3,14 @@ version: 2 sources: - name: kyber_optimism description: "Optimism decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: MetaAggregationRouter_evt_Swapped - loaded_at_field: evt_block_time - name: MetaAggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time - name: MetaAggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time - name: kyberswap_optimism description: "Optimism decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: MetaAggregationRouter_evt_Swapped - loaded_at_field: evt_block_time - name: MetaAggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/kyberswap/polygon/kyberswap_polygon_sources.yml b/sources/kyberswap/polygon/kyberswap_polygon_sources.yml index e29e6cc9b04..cbef11ca438 100644 --- a/sources/kyberswap/polygon/kyberswap_polygon_sources.yml +++ b/sources/kyberswap/polygon/kyberswap_polygon_sources.yml @@ -3,9 +3,5 @@ version: 2 sources: - name: kyber_polygon description: "Polygon decoded tables related to Kyberswap contract (classic+elastic)" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: MetaAggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time diff --git a/sources/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_sources.yml b/sources/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_sources.yml index 6fcf756e0d5..7ddea4f1b7d 100644 --- a/sources/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_sources.yml +++ b/sources/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_sources.yml @@ -6,7 +6,6 @@ sources: - name: InvestmentPoolFactory_call_create description: > Decoded table of registered pools on the Balancer InvestmentPoolFactory contract. - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number @@ -55,7 +54,6 @@ sources: - name: StablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer StablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -78,7 +76,6 @@ sources: - name: MetaStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer MetaStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -108,7 +105,6 @@ sources: - name: LiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer LiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -130,7 +126,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -152,7 +147,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -180,7 +174,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -208,7 +201,6 @@ sources: - name: ERC4626LinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ERC4626LinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -247,7 +239,6 @@ sources: - name: InvestmentPoolFactory_call_create description: > Decoded table of registered pools on the Balancer InvestmentPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -269,7 +260,6 @@ sources: - name: StablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer StablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -290,7 +280,6 @@ sources: - name: MetaStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer MetaStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -314,7 +303,6 @@ sources: - name: LiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer LiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -336,7 +324,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -358,7 +345,6 @@ sources: - name: StablePhantomPoolFactory_call_create description: > Decoded table of registered pools on the Balancer StablePhantomPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -381,7 +367,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -405,7 +390,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -429,7 +413,6 @@ sources: - name: StablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer StablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -450,7 +433,6 @@ sources: - name: MetaStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer MetaStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -474,7 +456,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -496,7 +477,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -520,7 +500,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -544,7 +523,6 @@ sources: - name: InvestmentPoolFactory_call_create description: > Deco*ed table of registered pools on the Balancer InvestmentPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -567,7 +545,6 @@ sources: - name: StablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer StablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -588,7 +565,6 @@ sources: - name: MetaStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer MetaStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -612,7 +588,6 @@ sources: - name: LiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer LiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -634,7 +609,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -656,7 +630,6 @@ sources: - name: StablePhantomPoolFactory_call_create description: > Decoded table of registered pools on the Balancer StablePhantomPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -679,7 +652,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -703,7 +675,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -977,7 +948,6 @@ sources: - name: StablePoolV2Factory_call_create description: > Decoded table of registered pools on the Balancer StablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -998,7 +968,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1020,7 +989,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1044,7 +1012,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1066,7 +1033,6 @@ sources: - name: AaveLinearPoolV3Factory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1088,7 +1054,6 @@ sources: - name: ComposableStablePoolV2Factory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1112,7 +1077,6 @@ sources: - name: ManagedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ManagedPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1139,7 +1103,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1161,7 +1124,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1185,7 +1147,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1207,7 +1168,6 @@ sources: - name: ERC4626LinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1231,7 +1191,6 @@ sources: - name: ManagedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ManagedPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1258,7 +1217,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1280,7 +1238,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1304,7 +1261,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1326,7 +1282,6 @@ sources: - name: ERC4626LinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ERC4626LinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1350,7 +1305,6 @@ sources: - name: ManagedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ManagedPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1376,7 +1330,6 @@ sources: - name: GyroECLPPoolFactory_call_create description: > Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1402,7 +1355,6 @@ sources: - name: Gyro2CLPPoolFactory_call_create description: > Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1430,7 +1382,6 @@ sources: - name: GyroECLPPoolFactory_call_create description: > Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1458,7 +1409,6 @@ sources: - name: GyroECLPPoolFactory_call_create description: > Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1486,7 +1436,6 @@ sources: - name: GyroECLPPoolFactory_call_create description: > Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1646,7 +1595,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Balancer NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1668,7 +1616,6 @@ sources: - name: ManagedPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ManagedPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1692,7 +1639,6 @@ sources: - name: ComposableStablePoolFactory_call_create description: > Decoded table of registered pools on the Balancer ComposableStablePoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1716,7 +1662,6 @@ sources: - name: AaveLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer AaveLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1738,7 +1683,6 @@ sources: - name: ERC4626LinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer ERC4626LinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1762,7 +1706,6 @@ sources: - name: YearnLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer YearnLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1786,7 +1729,6 @@ sources: - name: GearboxLinearPoolFactory_call_create description: > Decoded table of registered pools on the Balancer GearboxLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1834,7 +1776,6 @@ sources: - name: GyroECLPPoolFactory_call_create description: > Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time @@ -1855,13 +1796,8 @@ sources: - *rateProviders - *symbol - *tokens - - - name: gyroscope_zkevm - tables: - name: Gyro2CLPPoolFactory_call_create - description: > - Decoded table of registered pools on the Gyroscope 2CLP contract. - loaded_at_field: call_block_time + description: "Decoded table of registered pools on the Gyroscope 2CLP contract." columns: - *call_block_number - *call_block_time @@ -1886,9 +1822,7 @@ sources: - name: gyroscope_gnosis tables: - name: GyroECLPPoolFactory_call_create - description: > - Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time + description: "Decoded table of registered pools on the Gyroscope ECLP contract." columns: - *call_block_number - *call_block_time @@ -1916,7 +1850,6 @@ sources: - name: GyroECLPPoolFactory_call_create description: > Decoded table of registered pools on the Gyroscope ECLP contract. - loaded_at_field: call_block_time columns: - *call_block_number - *call_block_time diff --git a/sources/labels/addresses/__single_category_labels__/beethoven_x/labels_beethoven_x_sources.yml b/sources/labels/addresses/__single_category_labels__/beethoven_x/labels_beethoven_x_sources.yml index 4dbdd0d92e5..7cb627f52a0 100644 --- a/sources/labels/addresses/__single_category_labels__/beethoven_x/labels_beethoven_x_sources.yml +++ b/sources/labels/addresses/__single_category_labels__/beethoven_x/labels_beethoven_x_sources.yml @@ -6,7 +6,6 @@ sources: - name: StablePoolFactory_call_create description: > Decoded table of registered pools on the Beethoven X StablePoolFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number - name: call_block_time @@ -28,7 +27,6 @@ sources: - name: MetaStablePoolFactory_call_create description: > Decoded table of registered pools on the Beethoven X MetaStablePoolFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number - name: call_block_time @@ -55,7 +53,6 @@ sources: - name: YearnLinearPoolFactory_call_create description: > Decoded table of registered pools on the Beethoven X YearnLinearPoolFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number - name: call_block_time @@ -77,7 +74,6 @@ sources: - name: NoProtocolFeeLiquidityBootstrappingPoolFactory_call_create description: > Decoded table of registered pools on the Beethoven X NoProtocolFeeLiquidityBootstrappingPoolFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number - name: call_block_time @@ -99,7 +95,6 @@ sources: - name: StablePhantomPoolFactory_call_create description: > Decoded table of registered pools on the Beethoven X StablePhantomPoolFactory contract. - loaded_at_field: call_block_time columns: - name: call_block_number - name: call_block_time diff --git a/sources/labels/addresses/__single_category_labels__/op_governance/labels_op_governance_sources.yml b/sources/labels/addresses/__single_category_labels__/op_governance/labels_op_governance_sources.yml index 800c20867a7..4e87641f0af 100644 --- a/sources/labels/addresses/__single_category_labels__/op_governance/labels_op_governance_sources.yml +++ b/sources/labels/addresses/__single_category_labels__/op_governance/labels_op_governance_sources.yml @@ -2,10 +2,7 @@ version: 2 sources: - name: optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded optimism event logs table tables: - name: decoded_logs - loaded_at_field: evt_block_time diff --git a/sources/labels/addresses/bridge/persona/labels_op_bridge_sources.yml b/sources/labels/addresses/bridge/persona/labels_op_bridge_sources.yml index 1a808c70eb8..b0de798bdbb 100644 --- a/sources/labels/addresses/bridge/persona/labels_op_bridge_sources.yml +++ b/sources/labels/addresses/bridge/persona/labels_op_bridge_sources.yml @@ -3,110 +3,74 @@ version: 2 sources: - name: celer_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for celer bridge transactions on Optimism tables: - name: Bridge_evt_Send - loaded_at_field: evt_block_time - name: synapse_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for synapse bridge transactions on Optimism tables: - name: SynapseBridge_evt_TokenMintAndSwap - loaded_at_field: evt_block_time - name: synapse_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for synapse bridge transactions on Optimism tables: - name: SynapseBridge_evt_TokenRedeem - loaded_at_field: evt_block_time - name: synapse_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for synapse bridge transactions on Optimism tables: - name: SynapseBridge_evt_TokenRedeemAndRemove - loaded_at_field: evt_block_time - name: synapse_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for synapse bridge transactions on Optimism tables: - name: SynapseBridge_evt_TokenRedeemAndSwap - loaded_at_field: evt_block_time - name: across_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for across bridge transactions on Optimism tables: - name: OVM_OETH_BridgeDepositBox_evt_FundsDeposited - loaded_at_field: evt_block_time - name: across_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for across bridge transactions on Optimism tables: - name: UBA_Optimism_SpokePool_evt_FundsDeposited - loaded_at_field: evt_block_time - name: across_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for across bridge transactions on Optimism tables: - name: UBA_Optimism_SpokePool_evt_OptimismTokensBridged - loaded_at_field: evt_block_time - name: across_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for across bridge transactions on Optimism tables: - name: UBA_Optimism_SpokePool_evt_TokensBridged - loaded_at_field: evt_block_time - name: across_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for across bridge transactions on Optimism tables: - name: Optimism_SpokePool_evt_OptimismTokensBridged - loaded_at_field: evt_block_time - name: across_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for across bridge transactions on Optimism tables: - name: Optimism_SpokePool_evt_TokensBridged - loaded_at_field: evt_block_time - name: across_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for across bridge transactions on Optimism tables: - name: Optimism_SpokePool_evt_FundsDeposited - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/labels/addresses/nft/persona/op_nft_minters/labels_op_nft_sources.yml b/sources/labels/addresses/nft/persona/op_nft_minters/labels_op_nft_sources.yml deleted file mode 100644 index 5ba62d20923..00000000000 --- a/sources/labels/addresses/nft/persona/op_nft_minters/labels_op_nft_sources.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 2 - -sources: - - name: erc721_optimism - freshness: - warn_after: { count: 12, period: hour } - description: > - Decoded event table for erc721 NFTs transfer on Optimism - tables: - - name: evt_Transfer - loaded_at_field: evt_block_time - - - name: erc1155_optimism - freshness: - warn_after: { count: 12, period: hour } - description: > - Decoded event table for erc1155 NFTs transfer on Optimism - tables: - - name: evt_TransferBatch - loaded_at_field: evt_block_time - - - name: erc1155_optimism - freshness: - warn_after: { count: 12, period: hour } - description: > - Decoded event table for erc1155 NFTs transfer on Optimism - tables: - - name: evt_TransferSingle - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/labels/addresses/social/usage/lens/poster_frequencies/labels_lens_poster_frequencies_sources.yml b/sources/labels/addresses/social/usage/lens/poster_frequencies/labels_lens_poster_frequencies_sources.yml index 6e13ebbc65a..512bb64076f 100644 --- a/sources/labels/addresses/social/usage/lens/poster_frequencies/labels_lens_poster_frequencies_sources.yml +++ b/sources/labels/addresses/social/usage/lens/poster_frequencies/labels_lens_poster_frequencies_sources.yml @@ -4,21 +4,16 @@ sources: - name: lens_polygon description: > Decoded tables related to lens protocol. The web3 social platform - freshness: - warn_after: { count: 12, period: hour } tables: - name: LensHub_evt_ProfileCreated description: > table related to the lens profiles created and the addresses associated with the profiles. - loaded_at_field: evt_block_time - name: LensHub_call_post description: > table related to addresses on lens profile that call the post function when they want to post content on lens profile. - loaded_at_field: call_block_time - name: LensHub_call_postWithSig description: > table related to addresses on lens profile that call the post function of behalf of other addresses when they want to post content on lens profile. - loaded_at_field: call_block_time diff --git a/sources/layerzero/arbitrum/layerzero_arbitrum_sources.yml b/sources/layerzero/arbitrum/layerzero_arbitrum_sources.yml index db93527db2a..e0019effc5e 100644 --- a/sources/layerzero/arbitrum/layerzero_arbitrum_sources.yml +++ b/sources/layerzero/arbitrum/layerzero_arbitrum_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_arbitrum - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/avalanche_c/layerzero_avalanche_c_sources.yml b/sources/layerzero/avalanche_c/layerzero_avalanche_c_sources.yml index 02f6b97293f..73da0003a7b 100644 --- a/sources/layerzero/avalanche_c/layerzero_avalanche_c_sources.yml +++ b/sources/layerzero/avalanche_c/layerzero_avalanche_c_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_avalanche_c - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/base/layerzero_base_sources.yml b/sources/layerzero/base/layerzero_base_sources.yml index 68f91a3cbf4..ad3947bfda0 100644 --- a/sources/layerzero/base/layerzero_base_sources.yml +++ b/sources/layerzero/base/layerzero_base_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_base - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/bnb/layerzero_bnb_sources.yml b/sources/layerzero/bnb/layerzero_bnb_sources.yml index fd224cea6f0..01b96b47aa3 100644 --- a/sources/layerzero/bnb/layerzero_bnb_sources.yml +++ b/sources/layerzero/bnb/layerzero_bnb_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_bnb - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/celo/layerzero_celo_sources.yml b/sources/layerzero/celo/layerzero_celo_sources.yml index 9f78d3a1ddf..3a917e94ce4 100644 --- a/sources/layerzero/celo/layerzero_celo_sources.yml +++ b/sources/layerzero/celo/layerzero_celo_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_celo - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/ethereum/layerzero_ethereum_sources.yml b/sources/layerzero/ethereum/layerzero_ethereum_sources.yml index 7ea491707e3..a210ccd9dc9 100644 --- a/sources/layerzero/ethereum/layerzero_ethereum_sources.yml +++ b/sources/layerzero/ethereum/layerzero_ethereum_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_ethereum - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/fantom/layerzero_fantom_sources.yml b/sources/layerzero/fantom/layerzero_fantom_sources.yml index 6a95ee7f24c..4cef42f62c0 100644 --- a/sources/layerzero/fantom/layerzero_fantom_sources.yml +++ b/sources/layerzero/fantom/layerzero_fantom_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_fantom_endpoint_fantom - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/gnosis/layerzero_gnosis_sources.yml b/sources/layerzero/gnosis/layerzero_gnosis_sources.yml index 359ff354d50..829506bf749 100644 --- a/sources/layerzero/gnosis/layerzero_gnosis_sources.yml +++ b/sources/layerzero/gnosis/layerzero_gnosis_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_gnosis - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: gnosisendpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/optimism/layerzero_optimism_sources.yml b/sources/layerzero/optimism/layerzero_optimism_sources.yml index 409a1b51a7c..aef7fd7d3b7 100644 --- a/sources/layerzero/optimism/layerzero_optimism_sources.yml +++ b/sources/layerzero/optimism/layerzero_optimism_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_optimism - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/layerzero/polygon/layerzero_polygon_sources.yml b/sources/layerzero/polygon/layerzero_polygon_sources.yml index 2b0222c7313..32dc78ac933 100644 --- a/sources/layerzero/polygon/layerzero_polygon_sources.yml +++ b/sources/layerzero/polygon/layerzero_polygon_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: layerzero_polygon - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Endpoint_call_send - loaded_at_field: call_block_time diff --git a/sources/lido/accounting/ethereum/lido_accounting_ethereum_sources.yml b/sources/lido/accounting/ethereum/lido_accounting_ethereum_sources.yml index 57666b7cdd4..336c3039151 100644 --- a/sources/lido/accounting/ethereum/lido_accounting_ethereum_sources.yml +++ b/sources/lido/accounting/ethereum/lido_accounting_ethereum_sources.yml @@ -3,10 +3,6 @@ version: 2 # Spells all have “version: 2” as that’s the version of our eng sources: - name: lido_ethereum description: "Decoded events for [LidoDAO](https://lido.fi/)." - loaded_at_field: evt_block_time - freshness: # default freshness - warn_after: { count: 1, period: day } - error_after: { count: 7, period: day } tables: - name: AllowedRecipientsRegistry_evt_RecipientAdded - name: AllowedRecipientsRegistry_evt_RecipientRemoved diff --git a/sources/lido/liquidity/arbitrum/lido_liquidity_arbitrum_sources.yml b/sources/lido/liquidity/arbitrum/lido_liquidity_arbitrum_sources.yml index 59100a71345..7a969902440 100644 --- a/sources/lido/liquidity/arbitrum/lido_liquidity_arbitrum_sources.yml +++ b/sources/lido/liquidity/arbitrum/lido_liquidity_arbitrum_sources.yml @@ -3,102 +3,56 @@ version: 2 sources: - name: kyber_arbitrum description: "Arbitrum decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Elastic_Pool_evt_Mint - loaded_at_field: evt_block_time - name: Elastic_Pool_evt_Burn - loaded_at_field: evt_block_time - name: Elastic_Pool_evt_BurnRTokens - loaded_at_field: evt_block_time - name: ElasticFactoryV2_evt_PoolCreated - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Swap - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Mint - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Burn - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_BurnRTokens - loaded_at_field: evt_block_time - name: camelot_arbitrum description: "Arbitrum decoded tables related to Camelot pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: CamelotPair_evt_Mint - loaded_at_field: evt_block_time - name: CamelotPair_evt_Burn - loaded_at_field: evt_block_time - name: uniswap_v3_arbitrum description: "Arbitrum decoded tables related to Uniswap v3 pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Pair_evt_Mint - loaded_at_field: evt_block_time - name: Pair_evt_Burn - loaded_at_field: evt_block_time - name: Pair_evt_Collect - loaded_at_field: evt_block_time - name: UniswapV3Factory_evt_PoolCreated - loaded_at_field: evt_block_time - name: curvefi_arbitrum description: "Arbitrum decoded tables related to Curve pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: wstETH_swap_evt_AddLiquidity - loaded_at_field: evt_block_time - name: wstETH_swap_evt_RemoveLiquidityOne - loaded_at_field: evt_block_time - name: wstETH_swap_evt_RemoveLiquidityImbalance - loaded_at_field: evt_block_time - name: wstETH_swap_evt_RemoveLiquidity - loaded_at_field: evt_block_time - name: wstETH_swap_evt_TokenExchange - loaded_at_field: evt_block_time - name: lido_arbitrum description: "Arbitrum decoded tables related to Lido contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: wstETH_evt_Transfer - loaded_at_field: evt_block_time - name: wombat_arbitrum description: "Arbitrum decoded tables related to Wombat exchange contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: wsteth_pool_evt_Swap - loaded_at_field: evt_block_time - name: wsteth_pool_evt_Deposit - loaded_at_field: evt_block_time - name: wsteth_pool_evt_Withdraw - loaded_at_field: evt_block_time - name: ramses_arbitrum description: "Arbitrum decoded tables related to Ramses DEX pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: RamsesV2Pool_evt_Mint - loaded_at_field: evt_block_time - name: RamsesV2Pool_evt_Collect - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/lido/liquidity/base/lido_liquidity_base_sources.yml b/sources/lido/liquidity/base/lido_liquidity_base_sources.yml index 3eadd717998..1423f79a684 100644 --- a/sources/lido/liquidity/base/lido_liquidity_base_sources.yml +++ b/sources/lido/liquidity/base/lido_liquidity_base_sources.yml @@ -3,61 +3,34 @@ version: 2 sources: - name: kyber_base description: "Base decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ElasticPool_evt_Mint - loaded_at_field: evt_block_time - name: ElasticPool_evt_Burn - loaded_at_field: evt_block_time - - name: ElasticPool_evt_BurnRTokens - loaded_at_field: evt_block_time + - name: ElasticPool_evt_BurnRTokens - name: Factory_evt_PoolCreated - loaded_at_field: evt_block_time - name: ElasticPool_evt_Swap - loaded_at_field: evt_block_time - name: aerodrome_base description: "Base decoded tables related to Aerodrome pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Pool_evt_Mint - loaded_at_field: evt_block_time - - name: Pool_evt_Burn - loaded_at_field: evt_block_time + - name: Pool_evt_Burn - name: PoolFactory_call_getFee - loaded_at_field: call_block_time - - name: Pool_evt_Fees - loaded_at_field: evt_block_time + - name: Pool_evt_Fees - name: CLPool_evt_Mint - loaded_at_field: evt_block_time - - name: CLPool_evt_Collect - loaded_at_field: evt_block_time + - name: CLPool_evt_Collect - name: CLFactory_call_getSwapFee - loaded_at_field: call_block_time - - name: CLFactory_evt_PoolCreated - loaded_at_field: evt_block_time - - name: CLPool_evt_Swap - loaded_at_field: evt_block_time - - name: CLPool_evt_CollectFees - loaded_at_field: evt_block_time + - name: CLFactory_evt_PoolCreated + - name: CLPool_evt_Swap + - name: CLPool_evt_CollectFees - name: uniswap_v3_base description: "Base decoded tables related to Uniswap v3 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: UniswapV3Pool_evt_Mint - loaded_at_field: evt_block_time - name: UniswapV3Pool_evt_Collect - loaded_at_field: evt_block_time - - name: UniswapV3Pool_evt_Burn - loaded_at_field: evt_block_time + - name: UniswapV3Pool_evt_Burn diff --git a/sources/lido/liquidity/ethereum/lido_liquidity_ethereum_sources.yml b/sources/lido/liquidity/ethereum/lido_liquidity_ethereum_sources.yml index 55e356557ab..e525e183b08 100644 --- a/sources/lido/liquidity/ethereum/lido_liquidity_ethereum_sources.yml +++ b/sources/lido/liquidity/ethereum/lido_liquidity_ethereum_sources.yml @@ -3,142 +3,75 @@ version: 2 sources: - name: kyber_ethereum description: "Ethereum decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Elastic_Pool_evt_Mint - loaded_at_field: evt_block_time - name: Elastic_Pool_evt_Burn - loaded_at_field: evt_block_time - name: Elastic_Pool_evt_BurnRTokens - loaded_at_field: evt_block_time - name: ElasticFactoryV2_evt_PoolCreated - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Swap - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Mint - loaded_at_field: evt_block_time - - name: ElasticPoolV2_evt_Burn - loaded_at_field: evt_block_time - - name: ElasticPoolV2_evt_BurnRTokens - loaded_at_field: evt_block_time + - name: ElasticPoolV2_evt_Burn + - name: ElasticPoolV2_evt_BurnRTokens - name: uniswap_v3_ethereum description: "Ethereum decoded tables related to Uniswap v3 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Pair_evt_Mint - loaded_at_field: evt_block_time - name: Pair_evt_Collect - loaded_at_field: evt_block_time - name: Pair_evt_Burn - loaded_at_field: evt_block_time - name: lido_ethereum description: "Ethereum decoded tables related to Lido contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: WstETH_call_unwrap - loaded_at_field: evt_block_time - name: WstETH_call_wrap - loaded_at_field: evt_block_time - name: erc20_ethereum description: "Ethereum decoded tables related to erc20 tokens" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: evt_Transfer - loaded_at_field: evt_block_time - name: maverick_v1_ethereum description: "Ethereum decoded tables related to Maverick DEX contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: pool_call_addLiquidity - loaded_at_field: call_block_time - name: pool_call_removeLiquidity - loaded_at_field: call_block_time - - name: frax_ethereum description: "Ethereum decoded tables related to Frax contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: sfrxETH_call_pricePerShare - loaded_at_field: call_block_time - - name: curvefi_ethereum description: "Ethereum decoded tables related to Curve contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: stETHconcentrated_evt_TokenExchange - loaded_at_field: evt_block_time - - name: stETHng_evt_TokenExchange - loaded_at_field: evt_block_time + - name: stETHng_evt_TokenExchange - name: frxeth_eth_pool_call_price_oracle - loaded_at_field: call_block_time - - name: frxETH_stETH_evt_TokenExchange - loaded_at_field: evt_block_time - - name: rETHwstETH_evt_TokenExchange - loaded_at_field: evt_block_time + - name: frxETH_stETH_evt_TokenExchange + - name: rETHwstETH_evt_TokenExchange - name: pancakeswap_v3_ethereum description: "Ethereum decoded tables related to Pancakeswap v3 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: PancakeV3Pool_evt_Mint - loaded_at_field: evt_block_time - name: PancakeV3Pool_evt_Collect - loaded_at_field: evt_block_time - name: PancakeV3Pool_evt_Burn - loaded_at_field: evt_block_time - name: uniswap_v2_ethereum description: "Ethereum decoded tables related to Uniswap v2 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Pair_evt_Mint - loaded_at_field: evt_block_time - name: Pair_evt_Burn - loaded_at_field: evt_block_time - name: mountain_ethereum description: "Ethereum decoded tables related to Mountain Protocol contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: USDM_evt_RewardMultiplier - loaded_at_field: evt_block_time - name: solidly_ethereum description: "Ethereum decoded tables related to Solidly contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SolidlyV3Factory_evt_PoolCreated - loaded_at_field: evt_block_time - - name: SolidlyV3Pool_evt_Swap - loaded_at_field: evt_block_time + - name: SolidlyV3Pool_evt_Swap - name: SolidlyV3Pool_evt_Mint - loaded_at_field: evt_block_time - - name: SolidlyV3Pool_evt_Collect - loaded_at_field: evt_block_time \ No newline at end of file + - name: SolidlyV3Pool_evt_Collect \ No newline at end of file diff --git a/sources/lido/liquidity/linea/lido_liquidity_linea_sources.yml b/sources/lido/liquidity/linea/lido_liquidity_linea_sources.yml index 6fefc90860e..6cc0828b7d1 100644 --- a/sources/lido/liquidity/linea/lido_liquidity_linea_sources.yml +++ b/sources/lido/liquidity/linea/lido_liquidity_linea_sources.yml @@ -3,16 +3,9 @@ version: 2 sources: - name: syncswap_linea description: "Linea decoded tables related to SyncSwap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SyncSwapClassicPoolFactory_evt_PoolCreated - loaded_at_field: evt_block_time - name: SyncSwapClassicPool_evt_Mint - loaded_at_field: evt_block_time - name: SyncSwapClassicPool_evt_Burn - loaded_at_field: evt_block_time - name: SyncSwapClassicPool_evt_Swap - loaded_at_field: evt_block_time diff --git a/sources/lido/liquidity/optimism/lido_liquidity_optimism_sources.yml b/sources/lido/liquidity/optimism/lido_liquidity_optimism_sources.yml index 42db1b0d392..8535e13dab9 100644 --- a/sources/lido/liquidity/optimism/lido_liquidity_optimism_sources.yml +++ b/sources/lido/liquidity/optimism/lido_liquidity_optimism_sources.yml @@ -3,108 +3,58 @@ version: 2 sources: - name: kyber_optimism description: "Optimism decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Elastic_Pool_evt_Mint - loaded_at_field: evt_block_time - name: Elastic_Pool_evt_Burn - loaded_at_field: evt_block_time - - name: Elastic_Pool_evt_BurnRTokens - loaded_at_field: evt_block_time + - name: Elastic_Pool_evt_BurnRTokens - name: ElasticFactoryV2_evt_PoolCreated - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Swap - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Mint - loaded_at_field: evt_block_time - - name: ElasticPoolV2_evt_Burn - loaded_at_field: evt_block_time - - name: ElasticPoolV2_evt_BurnRTokens - loaded_at_field: evt_block_time + - name: ElasticPoolV2_evt_Burn + - name: ElasticPoolV2_evt_BurnRTokens - name: uniswap_v3_optimism description: "Optimism decoded tables related to Uniswap v3 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Pair_evt_Mint - loaded_at_field: evt_block_time - name: Pair_evt_Collect - loaded_at_field: evt_block_time - - name: Pair_evt_Burn - loaded_at_field: evt_block_time - - name: Factory_evt_PoolCreated - loaded_at_field: evt_block_time + - name: Pair_evt_Burn + - name: Factory_evt_PoolCreated - name: curvefi_optimism description: "Optimism decoded tables related to Curve pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: wstETH_swap_evt_AddLiquidity - loaded_at_field: evt_block_time - - name: wstETH_swap_evt_RemoveLiquidityOne - loaded_at_field: evt_block_time - - name: wstETH_swap_evt_RemoveLiquidityImbalance - loaded_at_field: evt_block_time - - name: wstETH_swap_evt_RemoveLiquidity - loaded_at_field: evt_block_time + - name: wstETH_swap_evt_RemoveLiquidityOne + - name: wstETH_swap_evt_RemoveLiquidityImbalance + - name: wstETH_swap_evt_RemoveLiquidity - name: lido_optimism description: "Optimism decoded tables related to Lido contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - - name: wstETH_evt_Transfer - loaded_at_field: evt_block_time + - name: wstETH_evt_Transfer - name: velodrome_optimism description: "Optimism decoded tables related to Velodrome pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Pair_evt_Mint - loaded_at_field: evt_block_time - - name: Pair_evt_Burn - loaded_at_field: evt_block_time - - name: Pair_evt_Fees - loaded_at_field: evt_block_time + - name: Pair_evt_Burn + - name: Pair_evt_Fees - name: velodrome_v2_optimism description: "Optimism decoded tables related to Velodrome V2 pools contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Pool_evt_Mint - loaded_at_field: evt_block_time - - name: Pool_evt_Burn - loaded_at_field: evt_block_time - - name: Pool_evt_Fees - loaded_at_field: evt_block_time + - name: Pool_evt_Burn + - name: Pool_evt_Fees - name: PoolFactory_call_getFee - loaded_at_field: call_block_time - name: CLFactory_evt_PoolCreated - loaded_at_field: evt_block_time - name: CLPool_evt_Mint - loaded_at_field: evt_block_time - - name: CLPool_evt_Collect - loaded_at_field: evt_block_time - - name: CLPool_evt_Fees - loaded_at_field: evt_block_time + - name: CLPool_evt_Collect + - name: CLPool_evt_Fees - name: CLPoolFactory_call_getFee - loaded_at_field: call_block_time - name: CLFactory_call_getSwapFee - loaded_at_field: call_block_time - - name: CLPool_evt_Swap - loaded_at_field: evt_block_time - - name: CLPool_evt_CollectFees - loaded_at_field: evt_block_time + - name: CLPool_evt_Swap + - name: CLPool_evt_CollectFees \ No newline at end of file diff --git a/sources/lido/liquidity/polygon/lido_liquidity_polygon_sources.yml b/sources/lido/liquidity/polygon/lido_liquidity_polygon_sources.yml index 9ba28a1aca0..abf3f2d96e0 100644 --- a/sources/lido/liquidity/polygon/lido_liquidity_polygon_sources.yml +++ b/sources/lido/liquidity/polygon/lido_liquidity_polygon_sources.yml @@ -3,40 +3,22 @@ version: 2 sources: - name: balancer_v2_polygon description: "Polygon decoded tables related to Balancer contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: pools_fees - loaded_at_field: evt_block_time - name: uniswap_v3_polygon description: "Polygon decoded tables related to Uniswap v3 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: UniswapV3Pool_evt_Mint - loaded_at_field: evt_block_time - name: UniswapV3Pool_evt_Collect - loaded_at_field: evt_block_time - name: UniswapV3Pool_evt_Burn - loaded_at_field: evt_block_time - name: kyber_polygon description: "Polygon decoded tables related to Kyberswap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ElasticFactoryV2_evt_PoolCreated - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Swap - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Mint - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_Burn - loaded_at_field: evt_block_time - name: ElasticPoolV2_evt_BurnRTokens - loaded_at_field: evt_block_time diff --git a/sources/lido/liquidity/scroll/lido_liquidity_scroll_sources.yml b/sources/lido/liquidity/scroll/lido_liquidity_scroll_sources.yml index 3f8563c0460..9cc0aa1b821 100644 --- a/sources/lido/liquidity/scroll/lido_liquidity_scroll_sources.yml +++ b/sources/lido/liquidity/scroll/lido_liquidity_scroll_sources.yml @@ -3,22 +3,12 @@ version: 2 sources: - name: syncswap_scroll description: "Scroll decoded tables related to SyncSwap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SyncSwapClassicPool_evt_Mint - loaded_at_field: evt_block_time - name: SyncSwapClassicPool_evt_Burn - loaded_at_field: evt_block_time - name: zebra_scroll description: "Scroll decoded tables related to Zebra DEX contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ZebraV2Pool_evt_Mint - loaded_at_field: evt_block_time - name: ZebraV2Pool_evt_Burn - loaded_at_field: evt_block_time diff --git a/sources/lido/liquidity/zksync/lido_liquidity_zksync_sources.yml b/sources/lido/liquidity/zksync/lido_liquidity_zksync_sources.yml index 34a1f4ca019..a97224dd1e8 100644 --- a/sources/lido/liquidity/zksync/lido_liquidity_zksync_sources.yml +++ b/sources/lido/liquidity/zksync/lido_liquidity_zksync_sources.yml @@ -3,35 +3,20 @@ version: 2 sources: - name: syncswap_zksync description: "Zksync decoded tables related to SyncSwap contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SyncSwapClassicPool_evt_Mint - loaded_at_field: evt_block_time - name: SyncSwapClassicPool_evt_Burn - loaded_at_field: evt_block_time - name: syncswap_v2_zksync description: "Zksync decoded tables related to SyncSwap V2 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SyncSwapAquaPool_evt_Mint - loaded_at_field: evt_block_time - name: SyncSwapAquaPool_evt_Burn - loaded_at_field: evt_block_time - name: maverick_v1_zksync description: "Zksync decoded tables related to Maverick DEX contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: pool_call_addLiquidity - loaded_at_field: call_block_time - name: pool_call_removeLiquidity - loaded_at_field: call_block_time diff --git a/sources/lifi/fantom/lifi_fantom_sources.yml b/sources/lifi/fantom/lifi_fantom_sources.yml index 22d555eb84c..a99eeb6b7b6 100644 --- a/sources/lifi/fantom/lifi_fantom_sources.yml +++ b/sources/lifi/fantom/lifi_fantom_sources.yml @@ -2,12 +2,8 @@ version: 2 sources: - name: lifi_fantom - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on lifi tables: - name: LiFiDiamond_v2_evt_AssetSwapped - loaded_at_field: evt_block_time - name: LiFiDiamond_v2_evt_LiFiSwappedGeneric - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/lifi/optimism/lifi_optimism_sources.yml b/sources/lifi/optimism/lifi_optimism_sources.yml index e86c3fba4dd..d2f1f7e3140 100644 --- a/sources/lifi/optimism/lifi_optimism_sources.yml +++ b/sources/lifi/optimism/lifi_optimism_sources.yml @@ -2,12 +2,8 @@ version: 2 sources: - name: lifi_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on lifi tables: - name: LiFiDiamond_v2_evt_AssetSwapped - loaded_at_field: evt_block_time - name: LiFiDiamond_v2_evt_LiFiSwappedGeneric - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/looksrare/ethereum/looksrare_ethereum_sources.yml b/sources/looksrare/ethereum/looksrare_ethereum_sources.yml index 6f697676869..9ecafa86427 100644 --- a/sources/looksrare/ethereum/looksrare_ethereum_sources.yml +++ b/sources/looksrare/ethereum/looksrare_ethereum_sources.yml @@ -2,8 +2,5 @@ version: 2 sources: - name: looksrare_ethereum - freshness: - warn_after: { count: 12, period: hour } tables: - name: LooksRareAirdrop_evt_AirdropRewardsClaim - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/maker/ethereum/maker_ethereum_sources.yml b/sources/maker/ethereum/maker_ethereum_sources.yml index a63f7d99336..215e6e70b38 100644 --- a/sources/maker/ethereum/maker_ethereum_sources.yml +++ b/sources/maker/ethereum/maker_ethereum_sources.yml @@ -3,10 +3,6 @@ version: 2 # Spells all have “version: 2” as that’s the version of our eng sources: - name: maker_ethereum description: Decoded events for [MakerDAO](https://makerdao.com/en/). - loaded_at_field: call_block_time - freshness: # default freshness - warn_after: { count: 1, period: day } - error_after: { count: 7, period: day } tables: - name: dai_call_burn - name: dai_call_mint diff --git a/sources/mento/celo/mento_celo_sources.yml b/sources/mento/celo/mento_celo_sources.yml index 6d7a6682aad..f39951c96ab 100644 --- a/sources/mento/celo/mento_celo_sources.yml +++ b/sources/mento/celo/mento_celo_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: mento_celo description: "Celo decoded tables related to Mento Protocol contacts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Exchange_evt_StableTokenSet - loaded_at_field: evt_block_time description: "Mento v1 cUSD" columns: - &contract_address @@ -29,7 +26,6 @@ sources: description: "cUSD token address" - name: ExchangeEUR_evt_StableTokenSet - loaded_at_field: evt_block_time description: "Mento v1 cEUR" columns: - *contract_address @@ -41,7 +37,6 @@ sources: description: "cEUR token address" - name: ExchangeBRL_evt_StableTokenSet - loaded_at_field: evt_block_time description: "Mento v1 cREAL" columns: - *contract_address @@ -53,7 +48,6 @@ sources: description: "cREAL token address" - name: BiPoolManager_evt_ExchangeCreated - loaded_at_field: evt_block_time description: "Mento v2 BiPoolManager - exchange created event" columns: - &asset0 @@ -76,7 +70,6 @@ sources: description: "vAMM pricing module contract address" - name: BiPoolManager_evt_ExchangeDestroyed - loaded_at_field: evt_block_time description: "Mento v2 BiPoolManager - exchange destroyed event" columns: - *asset0 diff --git a/sources/meteora/solana/_sources.yml b/sources/meteora/solana/_sources.yml index 3ffba0e658a..d70b8ec566b 100644 --- a/sources/meteora/solana/_sources.yml +++ b/sources/meteora/solana/_sources.yml @@ -3,28 +3,15 @@ version: 2 sources: - name: meteora_pools_solana description: "meteora decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: amm_call_initialize - loaded_at_field: call_block_time - name: amm_call_swap - loaded_at_field: call_block_time - name: meteora_vault_solana description: "meteora vault decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: vault_call_deposit - loaded_at_field: call_block_time - name: meteora_solana description: "meteora lb_clmm decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: lb_clmm_call_swap - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/mirror/optimism/mirror_optimism_edition_metadata_sources.yml b/sources/mirror/optimism/mirror_optimism_edition_metadata_sources.yml index adb45651de2..3ba21b83e2d 100644 --- a/sources/mirror/optimism/mirror_optimism_edition_metadata_sources.yml +++ b/sources/mirror/optimism/mirror_optimism_edition_metadata_sources.yml @@ -3,11 +3,6 @@ version: 2 sources: - name: mirror_optimism description: "op mainnet decoded tables related to mirror contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SignatureDropDeployer_call_deploy - loaded_at_field: call_block_time - name: WritingEditionsFactory_call_createWithSignature - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/moola/celo/moola_celo_sources.yml b/sources/moola/celo/moola_celo_sources.yml index 9d279bc7688..1f2712e46d1 100644 --- a/sources/moola/celo/moola_celo_sources.yml +++ b/sources/moola/celo/moola_celo_sources.yml @@ -6,11 +6,7 @@ sources: tables: - name: LendingPool_evt_ReserveDataUpdated - loaded_at_field: evt_block_time description: "Provides the liqudity index, stable and variable borrow rates for Moola reserves." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - &contract_address name: contract_address diff --git a/sources/mummy_finance/optimism/mummy_finance_optimism_sources.yml b/sources/mummy_finance/optimism/mummy_finance_optimism_sources.yml index 49bc855c4d2..778ea090b16 100644 --- a/sources/mummy_finance/optimism/mummy_finance_optimism_sources.yml +++ b/sources/mummy_finance/optimism/mummy_finance_optimism_sources.yml @@ -2,25 +2,17 @@ version: 2 sources: - name: mummy_finance_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for DEX and Perpetual trades on mummy_finance tables: - name: Router_evt_Swap - loaded_at_field: evt_block_time - name: Vault_evt_CollectMarginFees - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteDecreasePosition - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteIncreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_IncreasePosition - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/mux_protocol/optimism/mux_protocol_optimism_sources.yml b/sources/mux_protocol/optimism/mux_protocol_optimism_sources.yml index b2315df759c..e1742a0c7a7 100644 --- a/sources/mux_protocol/optimism/mux_protocol_optimism_sources.yml +++ b/sources/mux_protocol/optimism/mux_protocol_optimism_sources.yml @@ -5,10 +5,6 @@ sources: description: "mux protocol optimism decoded events" tables: - name: LiquidityPoolHop1_evt_AddAsset - loaded_at_field: evt_block_time - name: LiquidityPoolHop1_evt_OpenPosition - loaded_at_field: evt_block_time - name: LiquidityPoolHop1_evt_ClosePosition - loaded_at_field: evt_block_time - name: LiquidityPoolHop1_evt_Liquidate - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/nether_fi/base/nether_fi_base_source.yml b/sources/nether_fi/base/nether_fi_base_source.yml index 52681bad832..9fa992e66b5 100644 --- a/sources/nether_fi/base/nether_fi_base_source.yml +++ b/sources/nether_fi/base/nether_fi_base_source.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: nether_fi_base description: Base decoded tables related to nether_fi protocol - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Vault_evt_IncreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_LiquidatePosition - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/nex/nex_optimism_sources.yml b/sources/nex/nex_optimism_sources.yml index b8077665ff7..361721571ae 100644 --- a/sources/nex/nex_optimism_sources.yml +++ b/sources/nex/nex_optimism_sources.yml @@ -2,23 +2,16 @@ version: 2 sources: - name: nex_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for Perpetual trades on nex tables: - name: Vault_evt_CollectMarginFees - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteDecreasePosition - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteIncreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_IncreasePosition - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/nexusmutual/ethereum/nexusmutual_ethereum_sources.yml b/sources/nexusmutual/ethereum/nexusmutual_ethereum_sources.yml index 9df4f2fc19e..81a219ed106 100644 --- a/sources/nexusmutual/ethereum/nexusmutual_ethereum_sources.yml +++ b/sources/nexusmutual/ethereum/nexusmutual_ethereum_sources.yml @@ -8,10 +8,13 @@ sources: - name: StakingPool_evt_DepositExtended - name: StakingPool_evt_Withdraw - name: StakingPool_evt_StakeBurned + - name: StakingPoolFactory_evt_StakingPoolCreated - name: Cover_call_createStakingPool + - name: StakingProducts_call_createStakingPool - name: StakingProducts_call_setProducts - name: TokenController_call_assignStakingPoolManager - name: TokenController2_call_assignStakingPoolManager + - name: TokenController3_call_assignStakingPoolManager - name: StakingProducts_evt_ProductUpdated - name: StakingPool_call_manager - name: StakingPool_evt_PoolFeeChanged @@ -22,6 +25,10 @@ sources: - name: Cover_call_setProductTypes - name: Cover_evt_ProductSet - name: Cover_call_setProducts + - name: CoverProducts_evt_ProductTypeSet + - name: CoverProducts_call_setProductTypes + - name: CoverProducts_evt_ProductSet + - name: CoverProducts_call_setProducts - name: Quotation_call_buyCoverWithMetadata - name: Quotation_call_makeCoverUsingNXMTokens - name: QuotationData_call_addCover diff --git a/sources/nomad/ethereum/nomad_ethereum_sources.yml b/sources/nomad/ethereum/nomad_ethereum_sources.yml index 72a445a2315..6e54d5c81f1 100644 --- a/sources/nomad/ethereum/nomad_ethereum_sources.yml +++ b/sources/nomad/ethereum/nomad_ethereum_sources.yml @@ -4,6 +4,4 @@ sources: - name: nomad_ethereum tables: - name: BridgeRouter_evt_Send - loaded_at_field: evt_block_time - name: BridgeRouter_evt_Receive - loaded_at_field: evt_block_time diff --git a/sources/notional/ethereum/notional_ethereum_sources.yml b/sources/notional/ethereum/notional_ethereum_sources.yml index d2a4b497eb4..62aafef8b87 100644 --- a/sources/notional/ethereum/notional_ethereum_sources.yml +++ b/sources/notional/ethereum/notional_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Notional ethereum contracts tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/odos/arbitrum/odos_arbitrum_sources.yml b/sources/odos/arbitrum/odos_arbitrum_sources.yml new file mode 100644 index 00000000000..ec3f4babed1 --- /dev/null +++ b/sources/odos/arbitrum/odos_arbitrum_sources.yml @@ -0,0 +1,14 @@ +version: 2 + +sources: + - name: odos_v1_arbitrum + description: > + Decoded event table for swaps on odos + tables: + - name: OdosRouter_evt_Swapped + + - name: odos_v2_arbitrum + description: > + Decoded event table for swaps on odos_v2 + tables: + - name: OdosRouterV2_evt_Swap diff --git a/sources/odos/avalanche_c/odos_avalanche_c_sources.yml b/sources/odos/avalanche_c/odos_avalanche_c_sources.yml index 6a2a0905c51..8fdd5b1aa9d 100644 --- a/sources/odos/avalanche_c/odos_avalanche_c_sources.yml +++ b/sources/odos/avalanche_c/odos_avalanche_c_sources.yml @@ -2,10 +2,7 @@ version: 2 sources: - name: odos_avalanche_c - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on odos tables: - name: OdosRouter_evt_Swapped - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/odos/base/odos_base_sources.yml b/sources/odos/base/odos_base_sources.yml index e161b1cbcfb..00743ac86b9 100644 --- a/sources/odos/base/odos_base_sources.yml +++ b/sources/odos/base/odos_base_sources.yml @@ -2,19 +2,13 @@ version: 2 sources: - name: odos_base - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on odos tables: - name: OdosRouter_evt_Swapped - loaded_at_field: evt_block_time - name: odos_v2_base - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on odos_v2 tables: - name: OdosRouterV2_evt_Swap - loaded_at_field: evt_block_time diff --git a/sources/odos/ethereum/odos_ethereum_sources.yml b/sources/odos/ethereum/odos_ethereum_sources.yml index 238424497aa..5a011cb86a5 100644 --- a/sources/odos/ethereum/odos_ethereum_sources.yml +++ b/sources/odos/ethereum/odos_ethereum_sources.yml @@ -2,10 +2,7 @@ version: 2 sources: - name: odos_v2_ethereum - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on odos_v2 tables: - name: OdosRouterV2_evt_Swap - loaded_at_field: evt_block_time diff --git a/sources/odos/optimism/odos_optimism_sources.yml b/sources/odos/optimism/odos_optimism_sources.yml index 543ef63bc1b..90ef0657603 100644 --- a/sources/odos/optimism/odos_optimism_sources.yml +++ b/sources/odos/optimism/odos_optimism_sources.yml @@ -2,19 +2,13 @@ version: 2 sources: - name: odos_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on odos tables: - name: OdosRouter_evt_Swapped - loaded_at_field: evt_block_time - name: odos_v2_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on odos_v2 tables: - name: OdosRouterV2_evt_Swap - loaded_at_field: evt_block_time diff --git a/sources/omen/gnosis/omen_gnosis_sources.yml b/sources/omen/gnosis/omen_gnosis_sources.yml index e359d53c78c..31895a00b5e 100644 --- a/sources/omen/gnosis/omen_gnosis_sources.yml +++ b/sources/omen/gnosis/omen_gnosis_sources.yml @@ -5,11 +5,7 @@ sources: description: "Decoded contracts for Gnosis" tables: - name: ConditionalTokens_evt_PositionSplit - loaded_at_field: evt_block_time description: "Gnosis Conditional Tokens - Position Split Events." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - &contract_address name: contract_address @@ -55,11 +51,7 @@ sources: description: "Stakeholder" - name: ConditionalTokens_evt_PositionsMerge - loaded_at_field: evt_block_time description: "Gnosis Conditional Tokens - Position Merge Events." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - *contract_address - *evt_tx_hash diff --git a/sources/oneinch/arbitrum/oneinch_arbitrum_sources.yml b/sources/oneinch/arbitrum/oneinch_arbitrum_sources.yml index a00a1996d95..6675acccf30 100644 --- a/sources/oneinch/arbitrum/oneinch_arbitrum_sources.yml +++ b/sources/oneinch/arbitrum/oneinch_arbitrum_sources.yml @@ -2,130 +2,67 @@ version: 2 sources: - name: oneinch_arbitrum - description: "decoded events and function calls for 1inch on arbitrum" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV3_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/avalanche_c/oneinch_avalanche_c_sources.yml b/sources/oneinch/avalanche_c/oneinch_avalanche_c_sources.yml index 838b7543ff7..f7c820a652b 100644 --- a/sources/oneinch/avalanche_c/oneinch_avalanche_c_sources.yml +++ b/sources/oneinch/avalanche_c/oneinch_avalanche_c_sources.yml @@ -2,116 +2,60 @@ version: 2 sources: - name: oneinch_avalanche_c - description: "decoded events and function calls for 1inch on avalanche_c" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/base/oneinch_base_sources.yml b/sources/oneinch/base/oneinch_base_sources.yml index 8e997ff53f9..22dd420bd43 100644 --- a/sources/oneinch/base/oneinch_base_sources.yml +++ b/sources/oneinch/base/oneinch_base_sources.yml @@ -2,80 +2,42 @@ version: 2 sources: - name: oneinch_base - description: "decoded events and function calls for 1inch on ethereum" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/bnb/oneinch_bnb_sources.yml b/sources/oneinch/bnb/oneinch_bnb_sources.yml index ac6b1de08f4..1b91847d046 100644 --- a/sources/oneinch/bnb/oneinch_bnb_sources.yml +++ b/sources/oneinch/bnb/oneinch_bnb_sources.yml @@ -2,138 +2,71 @@ version: 2 sources: - name: oneinch_bnb - description: "decoded events and function calls for 1inch on bnb" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV2_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV2_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV3_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/ethereum/oneinch_ethereum_sources.yml b/sources/oneinch/ethereum/oneinch_ethereum_sources.yml index 4ec9a4945dd..725749da6bc 100644 --- a/sources/oneinch/ethereum/oneinch_ethereum_sources.yml +++ b/sources/oneinch/ethereum/oneinch_ethereum_sources.yml @@ -2,190 +2,99 @@ version: 2 sources: - name: oneinch_ethereum - description: "decoded events and function calls for 1inch on ethereum" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ExchangeV1_call_aggregate - loaded_at_field: call_block_time - name: ExchangeV2_call_aggregate - loaded_at_field: call_block_time - name: ExchangeV3_call_aggregate - loaded_at_field: call_block_time - name: ExchangeV4_call_aggregate - loaded_at_field: call_block_time - name: ExchangeV5_call_aggregate - loaded_at_field: call_block_time - name: ExchangeV6_call_aggregate - loaded_at_field: call_block_time - name: ExchangeV7_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV1_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV2_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV2_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV2_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV3_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time - name: FusionWhitelistRegistryV1_evt_Registered - loaded_at_field: evt_block_time - name: FusionWhitelistRegistryV1_evt_Unregistered - loaded_at_field: evt_block_time - name: FusionWhitelistRegistryV1_evt_Promotion - loaded_at_field: evt_block_time - name: FusionWhitelistRegistryV2_evt_Registered - loaded_at_field: evt_block_time - name: FusionWhitelistRegistryV2_evt_Unregistered - loaded_at_field: evt_block_time - name: FusionWhitelistRegistryV2_evt_Promotion - loaded_at_field: evt_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar - name: onesplit_ethereum description: "decoded events and function calls for onesplit on ethereum" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: OneSplit_call_swap - loaded_at_field: call_block_time - name: OneSplit_call_goodSwap - loaded_at_field: call_block_time - name: oneproto_ethereum description: "decoded events and function calls for oneproto on ethereum" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: OneSplitAudit_evt_Swapped - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/oneinch/fantom/oneinch_fantom_sources.yml b/sources/oneinch/fantom/oneinch_fantom_sources.yml index a627a85a236..65306b4919c 100644 --- a/sources/oneinch/fantom/oneinch_fantom_sources.yml +++ b/sources/oneinch/fantom/oneinch_fantom_sources.yml @@ -2,116 +2,60 @@ version: 2 sources: - name: oneinch_fantom - description: "decoded events and function calls for 1inch on fantom" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/gnosis/oneinch_gnosis_sources.yml b/sources/oneinch/gnosis/oneinch_gnosis_sources.yml index b28ebda87e0..e62d7fc4ea9 100644 --- a/sources/oneinch/gnosis/oneinch_gnosis_sources.yml +++ b/sources/oneinch/gnosis/oneinch_gnosis_sources.yml @@ -2,116 +2,60 @@ version: 2 sources: - name: oneinch_gnosis - description: "decoded events and function calls for 1inch on gnosis" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/oneinch_sources.yml b/sources/oneinch/oneinch_sources.yml index 785156e53fb..c87000c6c59 100644 --- a/sources/oneinch/oneinch_sources.yml +++ b/sources/oneinch/oneinch_sources.yml @@ -5,5 +5,6 @@ sources: tables: - name: blockchains - name: lop + - name: ar - name: parsed_transfers_from_calls \ No newline at end of file diff --git a/sources/oneinch/optimism/oneinch_optimism_sources.yml b/sources/oneinch/optimism/oneinch_optimism_sources.yml index 374fa753e86..9f9f554174c 100644 --- a/sources/oneinch/optimism/oneinch_optimism_sources.yml +++ b/sources/oneinch/optimism/oneinch_optimism_sources.yml @@ -2,130 +2,67 @@ version: 2 sources: - name: oneinch_optimism - description: "decoded events and function calls for 1inch on optimism" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV3_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/polygon/oneinch_polygon_sources.yml b/sources/oneinch/polygon/oneinch_polygon_sources.yml index 5aa2c01f9e0..525dee8d1d4 100644 --- a/sources/oneinch/polygon/oneinch_polygon_sources.yml +++ b/sources/oneinch/polygon/oneinch_polygon_sources.yml @@ -2,132 +2,68 @@ version: 2 sources: - name: oneinch_polygon - description: "decoded events and function calls for 1inch on polygon" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV3_evt_Swapped - loaded_at_field: evt_block_time - name: AggregationRouterV3_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV3_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_unoswapWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_discountedSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV4_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV1_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrder - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQ - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: LimitOrderProtocolV2_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/oneinch/zksync/oneinch_zksync_sources.yml b/sources/oneinch/zksync/oneinch_zksync_sources.yml index 8141041e18f..e4a0d604b9e 100644 --- a/sources/oneinch/zksync/oneinch_zksync_sources.yml +++ b/sources/oneinch/zksync/oneinch_zksync_sources.yml @@ -2,80 +2,42 @@ version: 2 sources: - name: oneinch_zksync - description: "decoded events and function calls for 1inch on ethereum" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AggregationRouterV5_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_unoswapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3Swap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_uniswapV3SwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_clipperSwapToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQ - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQTo - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQToWithPermit - loaded_at_field: call_block_time - name: AggregationRouterV5_call_fillOrderRFQCompact - loaded_at_field: call_block_time - name: AggregationRouterV6_call_swap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_clipperSwapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_unoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswap3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo2 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_ethUnoswapTo3 - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillOrderArgs - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrder - loaded_at_field: call_block_time - name: AggregationRouterV6_call_fillContractOrderArgs - loaded_at_field: call_block_time + - name: lop + - name: ar \ No newline at end of file diff --git a/sources/op/governance/optimism/op_governance_optimism_sources.yml b/sources/op/governance/optimism/op_governance_optimism_sources.yml index 65ff12df365..9b8b9bd5a60 100644 --- a/sources/op/governance/optimism/op_governance_optimism_sources.yml +++ b/sources/op/governance/optimism/op_governance_optimism_sources.yml @@ -2,12 +2,8 @@ version: 2 sources: - name: op_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for Optimism token delegate transactions. tables: - name: GovernanceToken_evt_DelegateVotesChanged - loaded_at_field: evt_block_time - name: GovernanceToken_evt_DelegateChanged - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/op/optimism/airdrop_optimism_sources.yml b/sources/op/optimism/airdrop_optimism_sources.yml index 8582ca394e5..bc57ed24e3b 100644 --- a/sources/op/optimism/airdrop_optimism_sources.yml +++ b/sources/op/optimism/airdrop_optimism_sources.yml @@ -6,4 +6,3 @@ sources: $OP airdrop claims tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/op/token_distributions/optimism/op_token_distributions_sources.yml b/sources/op/token_distributions/optimism/op_token_distributions_sources.yml index c522b574f29..8639950c91a 100644 --- a/sources/op/token_distributions/optimism/op_token_distributions_sources.yml +++ b/sources/op/token_distributions/optimism/op_token_distributions_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: aave_v3_optimism description: "decoded events and function calls for aave on optimism" - freshness: - warn_after: { count: 12, period: hour } tables: - name: RewardsController_evt_RewardsClaimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/opensea/ethereum/opensea_ethereum_sources.yml b/sources/opensea/ethereum/opensea_ethereum_sources.yml index da55d60c900..346b79369a5 100644 --- a/sources/opensea/ethereum/opensea_ethereum_sources.yml +++ b/sources/opensea/ethereum/opensea_ethereum_sources.yml @@ -2,11 +2,6 @@ version: 2 sources: - name: opensea_ethereum - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: wyvernexchange_call_atomicmatch_ - loaded_at_field: call_block_time - name: wyvernexchange_evt_ordersmatched - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/opensea/polygon/opensea_polygon_sources.yml b/sources/opensea/polygon/opensea_polygon_sources.yml index 26841530295..57e3e681ba6 100644 --- a/sources/opensea/polygon/opensea_polygon_sources.yml +++ b/sources/opensea/polygon/opensea_polygon_sources.yml @@ -2,18 +2,10 @@ version: 2 sources: - name: opensea_polygon_v2_polygon - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ZeroExFeeWrapper_call_matchOrders - loaded_at_field: call_block_time - name: seaportv1_4polygon_polygon - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time diff --git a/sources/optimism_attestationstation/optimism/optimism_attestationstation_optimism_sources.yml b/sources/optimism_attestationstation/optimism/optimism_attestationstation_optimism_sources.yml index d70da2ff208..58f9b8465be 100644 --- a/sources/optimism_attestationstation/optimism/optimism_attestationstation_optimism_sources.yml +++ b/sources/optimism_attestationstation/optimism/optimism_attestationstation_optimism_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: attestationstation_optimism - freshness: - warn_after: { count: 12, period: hour } tables: - name: AttestationStation_evt_AttestationCreated - loaded_at_field: evt_block_time description: "Attestation created events on Optimism." columns: - &about diff --git a/sources/optimism_quests/optimism/optimism_quests_optimism_sources.yml b/sources/optimism_quests/optimism/optimism_quests_optimism_sources.yml index d994732269e..20f2e1f519c 100644 --- a/sources/optimism_quests/optimism/optimism_quests_optimism_sources.yml +++ b/sources/optimism_quests/optimism/optimism_quests_optimism_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: optimism_quest_optimism description: "decoded events and function calls for optimism quests on optimism" - freshness: - warn_after: { count: 12, period: hour } tables: - name: StarNFTV4_call_mint - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/opx_finance/optimism/opx_finance_optimism_sources.yml b/sources/opx_finance/optimism/opx_finance_optimism_sources.yml index a6e5c55cb9e..3816c74df59 100644 --- a/sources/opx_finance/optimism/opx_finance_optimism_sources.yml +++ b/sources/opx_finance/optimism/opx_finance_optimism_sources.yml @@ -2,22 +2,15 @@ version: 2 sources: - name: opx_finance_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on opx_finance tables: - name: Vault_evt_CollectMarginFees - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteDecreasePosition - loaded_at_field: evt_block_time - name: PositionRouter_evt_ExecuteIncreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: Vault_evt_IncreasePosition - loaded_at_field: evt_block_time diff --git a/sources/orca_whirlpool/orca_whirlpool_trades_sources.yml b/sources/orca_whirlpool/orca_whirlpool_trades_sources.yml index 1f571724131..9c0b7183c69 100644 --- a/sources/orca_whirlpool/orca_whirlpool_trades_sources.yml +++ b/sources/orca_whirlpool/orca_whirlpool_trades_sources.yml @@ -3,19 +3,10 @@ version: 2 sources: - name: whirlpool_solana description: "whirlpool decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: whirlpool_call_initializePool - loaded_at_field: call_block_time - name: whirlpool_call_setFeeRate - loaded_at_field: call_block_time - name: whirlpool_call_swap - loaded_at_field: call_block_time - name: whirlpool_call_twoHopSwap - loaded_at_field: call_block_time - name: whirlpool_call_initializeFeeTier - loaded_at_field: call_block_time - name: whirlpool_call_setDefaultFeeRate - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/ovm/optimism/ovm_optimism_sources.yml b/sources/ovm/optimism/ovm_optimism_sources.yml index 0490827549b..386d9b99f1e 100644 --- a/sources/ovm/optimism/ovm_optimism_sources.yml +++ b/sources/ovm/optimism/ovm_optimism_sources.yml @@ -5,11 +5,7 @@ sources: description: "Decoded contracts for Optimism precompiles and system contracts" tables: - name: L2StandardTokenFactory_call_createStandardL2Token - loaded_at_field: call_block_time description: "L2 Standard Token Factory - Creation Calls." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - &contract_address name: contract_address @@ -37,11 +33,7 @@ sources: description: "Name of the token" - name: L2StandardTokenFactory_evt_StandardL2TokenCreated - loaded_at_field: evt_block_time description: "L2 Standard Token Factory - Creation Events." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - *contract_address - &evt_block_number @@ -62,11 +54,7 @@ sources: - *_l1Token - name: OVM_L2StandardTokenFactory_call_createStandardL2Token - loaded_at_field: call_block_time description: "L2 Standard Token Factory - Creation Calls." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - *contract_address - *call_block_number @@ -78,11 +66,7 @@ sources: - *_name - name: OVM_L2StandardTokenFactory_evt_StandardL2TokenCreated - loaded_at_field: evt_block_time description: "L2 Standard Token Factory - Creation Events." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - *contract_address - *evt_block_number @@ -93,11 +77,7 @@ sources: - *_l1Token - name: L2CrossDomainMessenger_evt_SentMessage - loaded_at_field: evt_block_time description: "Event logs for messages sent from Optimism to L1" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - *evt_block_time - *evt_block_number @@ -112,11 +92,7 @@ sources: - *evt_index - name: L2CrossDomainMessenger_evt_RelayedMessage - loaded_at_field: evt_block_time description: "Event logs for messages relayed to Optimism from L1" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - *evt_block_time - *evt_block_number diff --git a/sources/paladin/ethereum/paladin_ethereum_sources.yml b/sources/paladin/ethereum/paladin_ethereum_sources.yml index a01d648c5e6..8e1169a752a 100644 --- a/sources/paladin/ethereum/paladin_ethereum_sources.yml +++ b/sources/paladin/ethereum/paladin_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: $PAL airdrop claims tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/pangolin/avalanche_c/pangolin_avalanche_c_sources.yml b/sources/pangolin/avalanche_c/pangolin_avalanche_c_sources.yml index 55bd81aed9d..5568b08c616 100644 --- a/sources/pangolin/avalanche_c/pangolin_avalanche_c_sources.yml +++ b/sources/pangolin/avalanche_c/pangolin_avalanche_c_sources.yml @@ -6,4 +6,3 @@ sources: Pangolin avalanche contracts tables: - name: Airdrop_evt_PngClaimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/paraswap/arbitrum/paraswap_arbitrum_sources.yml b/sources/paraswap/arbitrum/paraswap_arbitrum_sources.yml index 3d1a6994e48..a8fbc8a2746 100644 --- a/sources/paraswap/arbitrum/paraswap_arbitrum_sources.yml +++ b/sources/paraswap/arbitrum/paraswap_arbitrum_sources.yml @@ -2,58 +2,38 @@ version: 2 sources: - name: paraswap_arbitrum - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapper_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapper_evt_SwappedV3 - loaded_at_field: evt_block_time - name: AugustusSwapper_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/paraswap/avalanche_c/paraswap_avalanche_c_sources.yml b/sources/paraswap/avalanche_c/paraswap_avalanche_c_sources.yml index f631fca0279..7f52984d6af 100644 --- a/sources/paraswap/avalanche_c/paraswap_avalanche_c_sources.yml +++ b/sources/paraswap/avalanche_c/paraswap_avalanche_c_sources.yml @@ -2,67 +2,42 @@ version: 2 sources: - name: paraswap_avalanche_c - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapperV5_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 loaded_at_field: call_block_time - \ No newline at end of file + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/paraswap/base/paraswap_base_sources.yml b/sources/paraswap/base/paraswap_base_sources.yml index 59a84bb28bd..f5e972dd4a0 100644 --- a/sources/paraswap/base/paraswap_base_sources.yml +++ b/sources/paraswap/base/paraswap_base_sources.yml @@ -2,58 +2,38 @@ version: 2 sources: - name: paraswap_base - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapper_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapper_evt_SwappedV3 - loaded_at_field: evt_block_time - name: AugustusSwapper_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/paraswap/bnb/paraswap_bnb_sources.yml b/sources/paraswap/bnb/paraswap_bnb_sources.yml index 02094a796c8..0c7b1e15a3e 100644 --- a/sources/paraswap/bnb/paraswap_bnb_sources.yml +++ b/sources/paraswap/bnb/paraswap_bnb_sources.yml @@ -2,70 +2,44 @@ version: 2 sources: - name: paraswap_bnb - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapperV4_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapperV4_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/paraswap/ethereum/paraswap_ethereum_sources.yml b/sources/paraswap/ethereum/paraswap_ethereum_sources.yml index 450ba02e9ea..9b73c7f23f3 100644 --- a/sources/paraswap/ethereum/paraswap_ethereum_sources.yml +++ b/sources/paraswap/ethereum/paraswap_ethereum_sources.yml @@ -2,100 +2,59 @@ version: 2 sources: - name: paraswap_ethereum - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapper5_0_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapper5_0_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapper5_0_call_buyOnUniswap - loaded_at_field: call_block_time - name: AugustusSwapper5_0_call_buyOnUniswapFork - loaded_at_field: call_block_time - name: AugustusSwapper5_0_call_swapOnUniswap - loaded_at_field: call_block_time - name: AugustusSwapper5_0_call_swapOnUniswapFork - loaded_at_field: call_block_time - name: AugustusSwapper6_0_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapper6_0_evt_Bought2 - loaded_at_field: evt_block_time - name: AugustusSwapper6_0_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapper6_0_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapper6_0_evt_Swapped2 - loaded_at_field: evt_block_time - name: AugustusSwapper6_0_evt_SwappedV3 - loaded_at_field: evt_block_time - name: ParaSwapLiquiditySwapAdapter_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapper6_0_call_buyOnUniswap - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_buyOnUniswapFork - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_buyOnUniswapV2Fork - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_buyOnUniswapV2ForkWithPermit - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_swapOnUniswap - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_swapOnUniswapFork - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_swapOnUniswapV2Fork - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_swapOnUniswapV2ForkWithPermit - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_swapOnZeroXv4 - loaded_at_field: call_block_time - name: AugustusSwapper6_0_call_swapOnZeroXv4WithPermit - loaded_at_field: call_block_time - name: AugustusSwapper6_0_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time \ No newline at end of file + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/paraswap/fantom/paraswap_fantom_sources.yml b/sources/paraswap/fantom/paraswap_fantom_sources.yml index 2a72152b09c..06a03bb9d33 100644 --- a/sources/paraswap/fantom/paraswap_fantom_sources.yml +++ b/sources/paraswap/fantom/paraswap_fantom_sources.yml @@ -2,67 +2,42 @@ version: 2 sources: - name: paraswap_fantom - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapperV5_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 loaded_at_field: call_block_time - + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/paraswap/optimism/paraswap_optimism_sources.yml b/sources/paraswap/optimism/paraswap_optimism_sources.yml index 275b75b480c..081c92c8745 100644 --- a/sources/paraswap/optimism/paraswap_optimism_sources.yml +++ b/sources/paraswap/optimism/paraswap_optimism_sources.yml @@ -2,58 +2,37 @@ version: 2 sources: - name: paraswap_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapper_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapper_evt_SwappedV3 - loaded_at_field: evt_block_time - name: AugustusSwapper_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time - # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/paraswap/polygon/paraswap_polygon_sources.yml b/sources/paraswap/polygon/paraswap_polygon_sources.yml index 07ddb47853b..ce5ea329811 100644 --- a/sources/paraswap/polygon/paraswap_polygon_sources.yml +++ b/sources/paraswap/polygon/paraswap_polygon_sources.yml @@ -2,70 +2,44 @@ version: 2 sources: - name: paraswap_polygon - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event table for swaps on paraswap tables: - name: AugustusSwapperV4_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapperV4_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Bought2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_BoughtV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_Swapped2 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedV3 - loaded_at_field: evt_block_time - name: AugustusSwapperV5_evt_SwappedDirect - loaded_at_field: evt_block_time # v6 # v6.1 - name: AugustusV6_1_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_1_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time # v6.2 - name: AugustusV6_2_call_swapExactAmountIn - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV1 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnCurveV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountInOnBalancerV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOut - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV2 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnUniswapV3 - loaded_at_field: call_block_time - name: AugustusV6_2_call_swapExactAmountOutOnBalancerV2 - loaded_at_field: call_block_time \ No newline at end of file + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapOnAugustusRFQTryBatchFill + loaded_at_field: call_block_time + - name: AugustusV6_2_call_swapExactAmountInOutOnMakerPSM + loaded_at_field: call_block_time diff --git a/sources/perpetual_protocol/optimism/perpetual_protocol_optimism_sources.yml b/sources/perpetual_protocol/optimism/perpetual_protocol_optimism_sources.yml index 8af45766922..3cd037bb960 100644 --- a/sources/perpetual_protocol/optimism/perpetual_protocol_optimism_sources.yml +++ b/sources/perpetual_protocol/optimism/perpetual_protocol_optimism_sources.yml @@ -5,17 +5,8 @@ sources: description: Optimism decoded tables related to Perpetual v2 tables: - name: ClearingHouse_evt_PositionChanged - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time description: "Details the perpetuals trades/swaps" - name: Vault_call_getFreeCollateralByRatio - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: call_block_time description: "Stores information on the margins per trade" - name: MarketRegistry_evt_PoolAdded - loaded_at_field: evt_block_time description: "Details the asset markets" \ No newline at end of file diff --git a/sources/pika/optimism/pika_optimism_sources.yml b/sources/pika/optimism/pika_optimism_sources.yml index accee34c3ef..20d96da4402 100644 --- a/sources/pika/optimism/pika_optimism_sources.yml +++ b/sources/pika/optimism/pika_optimism_sources.yml @@ -5,31 +5,22 @@ sources: description: Optimism decoded tables related to Pika Protocol v1 tables: - name: PikaPerpV2_evt_NewPosition - loaded_at_field: evt_block_time description: "Details the new positions opened" - name: PikaPerpV2_evt_ClosePosition - loaded_at_field: evt_block_time description: "Details the swaps to close existing positions" - name: pika_perp_v2_optimism description: Optimism decoded tables related to Pika Protocol v2 tables: - name: PikaPerpV2_evt_NewPosition - loaded_at_field: evt_block_time description: "Details the new positions opened" - name: PikaPerpV2_evt_ClosePosition - loaded_at_field: evt_block_time description: "Details the swaps to close existing positions" - - name: pika_perp_v3_optimism # since this is latest pika contract, freshness test can remain + - name: pika_perp_v3_optimism # since this is latest pika contract description: Optimism decoded tables related to Pika Protocol v3 - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: PikaPerpV3_evt_NewPosition - loaded_at_field: evt_block_time description: "Details the new positions opened" - name: PikaPerpV3_evt_ClosePosition - loaded_at_field: evt_block_time description: "Details the swaps to close existing positions" \ No newline at end of file diff --git a/sources/pooltogether/ethereum/pooltogether_ethereum_sources.yml b/sources/pooltogether/ethereum/pooltogether_ethereum_sources.yml index d9d3959c974..3a1c4570c22 100644 --- a/sources/pooltogether/ethereum/pooltogether_ethereum_sources.yml +++ b/sources/pooltogether/ethereum/pooltogether_ethereum_sources.yml @@ -3,12 +3,8 @@ version: 2 sources: - name: pooltogether_v4_ethereum description: "Ethereum decoded tables related to Pooltogether v4 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: PrizeTierHistoryV2_call_getPrizeTier - loaded_at_field: call_block_time description: "Decoded function table that contains the prize structure for each drawId after DPR upgrade" columns: - &call_block_number @@ -38,9 +34,6 @@ sources: name: output_0 description: "Parameters that determine the prize structure (bitRangeSize, drawId, maxPickPerUser, expiryDuration, endTimestampOffset, dpr, prize, tiers)" - name: PrizeDistributionBuffer_evt_PrizeDistributionSet - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time description: "Decoded event table that contains the prize structure for each drawId (does not include dpr data)" columns: - *contract_address @@ -68,4 +61,3 @@ sources: PoolTogether ethereum contracts tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/prices/prices_sources.yml b/sources/prices/prices_sources.yml index 6ed515a8c8c..12389bf62fe 100644 --- a/sources/prices/prices_sources.yml +++ b/sources/prices/prices_sources.yml @@ -4,12 +4,11 @@ version: 2 sources: - name: prices description: "Prices tables across blockchains" - freshness: - warn_after: { count: 12, period: hour } tables: - name: usd - loaded_at_field: minute description: "USD prices across blockchains" + meta: + docs_slug: /curated/asset-tracking/prices/prices columns: - name: minute description: "UTC event block time truncated to the minute mark" diff --git a/sources/ribbon/ethereum/ribbon_ethereum_sources.yml b/sources/ribbon/ethereum/ribbon_ethereum_sources.yml index 3767f3b8abe..9f6e28f7961 100644 --- a/sources/ribbon/ethereum/ribbon_ethereum_sources.yml +++ b/sources/ribbon/ethereum/ribbon_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: $RBN airdrop claims tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/rollup_economics/ethereum/rollup_economics_ethereum_sources.yml b/sources/rollup_economics/ethereum/rollup_economics_ethereum_sources.yml index 5c737ff4ddc..ed6c8464f78 100644 --- a/sources/rollup_economics/ethereum/rollup_economics_ethereum_sources.yml +++ b/sources/rollup_economics/ethereum/rollup_economics_ethereum_sources.yml @@ -4,18 +4,11 @@ sources: - name: arbitrum_ethereum description: > Decoded tables related to arbitrum L2<>L1 transactions. - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SequencerInbox_evt_SequencerBatchDeliveredFromOrigin - loaded_at_field: evt_block_time - name: SequencerInbox_call_addSequencerL2BatchFromOrigin - loaded_at_field: call_block_time - name: SequencerInbox_call_addSequencerL2Batch - loaded_at_field: call_block_time - name: SequencerInbox_call_addSequencerL2BatchFromOriginWithGasRefunder - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/rubicon/arbitrum/rubicon_arbitrum_sources.yml b/sources/rubicon/arbitrum/rubicon_arbitrum_sources.yml index da37312daa6..1e3929a3c2f 100644 --- a/sources/rubicon/arbitrum/rubicon_arbitrum_sources.yml +++ b/sources/rubicon/arbitrum/rubicon_arbitrum_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: rubicon_arbitrum description: "Arbitrum decoded tables related to rubicon's implementation of OasisDEX" - freshness: - warn_after: { count: 12, period: hour } tables: - name: RubiconMarket_evt_emitOffer - loaded_at_field: evt_block_time description: "a table of events triggered when a maker creates an offer" columes: - &contract_address @@ -47,7 +44,6 @@ sources: description: "the amount of the token being bought" - name: RubiconMarket_evt_emitTake - loaded_at_field: evt_block_time description: "a table of events triggered when a taker fills an outstanding offer" columes: - *contract_address diff --git a/sources/rubicon/base/rubicon_base_sources.yml b/sources/rubicon/base/rubicon_base_sources.yml index 3d1429d3ca5..826afb768ac 100644 --- a/sources/rubicon/base/rubicon_base_sources.yml +++ b/sources/rubicon/base/rubicon_base_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: rubicon_base description: "Base decoded tables related to rubicon's implementation of OasisDEX" - freshness: - warn_after: { count: 12, period: hour } tables: - name: RubiconMarket_evt_emitOffer - loaded_at_field: evt_block_time description: "a table of events triggered when a maker creates an offer" columes: - &contract_address @@ -47,7 +44,6 @@ sources: description: "the amount of the token being bought" - name: RubiconMarket_evt_emitTake - loaded_at_field: evt_block_time description: "a table of events triggered when a taker fills an outstanding offer" columes: - *contract_address diff --git a/sources/rubicon/optimism/rubicon_optimism_sources.yml b/sources/rubicon/optimism/rubicon_optimism_sources.yml index 75e296a7abd..759bef80217 100644 --- a/sources/rubicon/optimism/rubicon_optimism_sources.yml +++ b/sources/rubicon/optimism/rubicon_optimism_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: rubicon_optimism description: "Optimism decoded tables related to rubicon's implementation of OasisDEX" - freshness: - warn_after: { count: 12, period: hour } tables: - name: RubiconMarket_evt_LogTake - loaded_at_field: evt_block_time description: "a table of events triggered when a taker fills an outstanding offer" columns: - &buy_gem @@ -52,7 +49,6 @@ sources: description: "the timestamp of the event creation" - name: RubiconMarket_evt_LogMake - loaded_at_field: evt_block_time description: "a table of events triggered when a maker creates an offer" columes: - *contract_address @@ -74,7 +70,6 @@ sources: - *timestamp - name: RubiconMarket_evt_emitOffer - loaded_at_field: evt_block_time description: "a table of events triggered when a maker creates an offer" columes: - *contract_address @@ -91,7 +86,6 @@ sources: - *buy_amt - name: RubiconMarket_evt_emitTake - loaded_at_field: evt_block_time description: "a table of events triggered when a taker fills an outstanding offer" columes: - *contract_address diff --git a/sources/safe/arbitrum/safe_arbitrum_sources.yml b/sources/safe/arbitrum/safe_arbitrum_sources.yml index 7e4a9ca2d96..a31a6a12316 100644 --- a/sources/safe/arbitrum/safe_arbitrum_sources.yml +++ b/sources/safe/arbitrum/safe_arbitrum_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_arbitrum - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address @@ -31,7 +28,6 @@ sources: name: singleton description: "Singleton" - name: SafeProxyFactory_v_1_4_1_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.4.1 factory ProxyCreation events" columns: - *contract_address diff --git a/sources/safe/avalanche_c/safe_avalanche_c_sources.yml b/sources/safe/avalanche_c/safe_avalanche_c_sources.yml index 996415d8390..ede1df1dfc6 100644 --- a/sources/safe/avalanche_c/safe_avalanche_c_sources.yml +++ b/sources/safe/avalanche_c/safe_avalanche_c_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_avalanche_c - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address diff --git a/sources/safe/base/safe_base_sources.yml b/sources/safe/base/safe_base_sources.yml index 3c0c1cbf4b5..d1cf2775bc3 100644 --- a/sources/safe/base/safe_base_sources.yml +++ b/sources/safe/base/safe_base_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_base - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactoryv_1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address @@ -32,7 +29,6 @@ sources: description: "Singleton" - name: SafeProxyFactory_v_1_4_1_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.4.1 factory ProxyCreation events" columns: - *contract_address diff --git a/sources/safe/bnb/safe_bnb_sources.yml b/sources/safe/bnb/safe_bnb_sources.yml index fab13b4a238..d19d79fc8c7 100644 --- a/sources/safe/bnb/safe_bnb_sources.yml +++ b/sources/safe/bnb/safe_bnb_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_bnb - freshness: - warn_after: { count: 12, period: hour } tables: - name: ProxyFactory_v1_1_1_call_createProxy - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxy calls" columns: - &call_block_number @@ -37,7 +34,6 @@ sources: name: output_proxy description: "Address of created Safe proxy" - name: ProxyFactory_v1_1_1_call_createProxyWithNonce - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithNonce calls" columns: - &_mastercopy @@ -57,7 +53,6 @@ sources: name: saltNonce description: "Salt nonce" - name: ProxyFactory_v1_1_1_call_createProxyWithCallback - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithCallback calls" columns: - *_mastercopy @@ -71,7 +66,6 @@ sources: - *output_proxy - *saltNonce - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - *contract_address diff --git a/sources/safe/celo/safe_celo_sources.yml b/sources/safe/celo/safe_celo_sources.yml index c68438fdda2..78952caafa6 100644 --- a/sources/safe/celo/safe_celo_sources.yml +++ b/sources/safe/celo/safe_celo_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_celo - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address diff --git a/sources/safe/ethereum/safe_ethereum_sources.yml b/sources/safe/ethereum/safe_ethereum_sources.yml index 88dcc4f3f12..08cd9cd92a6 100644 --- a/sources/safe/ethereum/safe_ethereum_sources.yml +++ b/sources/safe/ethereum/safe_ethereum_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_ethereum - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafev1_3_0_evt_SafeSetup - loaded_at_field: evt_block_time description: "Safe v1.3.0 setup events" columns: - &contract_address @@ -40,7 +37,6 @@ sources: name: threshold description: "Number of required confirmations for a Safe transaction" - name: ProxyFactoryv1_0_0_call_createProxy - loaded_at_field: call_block_time description: "Safe v1.0.0 factory createProxy calls" columns: - &call_block_number @@ -69,7 +65,6 @@ sources: name: output_proxy description: "Address of created Safe proxy" - name: ProxyFactoryv1_0_0_call_createProxyWithNonce - loaded_at_field: call_block_time description: "Safe v1.0.0 factory createProxyWithNonce calls" columns: - &_mastercopy @@ -87,7 +82,6 @@ sources: name: saltNonce description: "Salt nonce" - name: ProxyFactoryv1_1_0_call_createProxy - loaded_at_field: call_block_time description: "Safe v1.1.0 factory createProxy calls" columns: - *call_block_number @@ -100,7 +94,6 @@ sources: - *masterCopy - *output_proxy - name: ProxyFactoryv1_1_0_call_createProxyWithNonce - loaded_at_field: call_block_time description: "Safe v1.1.0 factory createProxyWithNonce calls" columns: - *_mastercopy @@ -114,7 +107,6 @@ sources: - *output_proxy - *saltNonce - name: ProxyFactoryv1_1_1_call_createProxy - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxy calls" columns: - *call_block_number @@ -127,7 +119,6 @@ sources: - *masterCopy - *output_proxy - name: ProxyFactoryv1_1_1_call_createProxyWithNonce - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithNonce calls" columns: - *_mastercopy @@ -141,7 +132,6 @@ sources: - *output_proxy - *saltNonce - name: ProxyFactoryv1_1_1_call_createProxyWithCallback - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithCallback calls" columns: - *_mastercopy @@ -155,7 +145,6 @@ sources: - *output_proxy - *saltNonce - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - *contract_address @@ -170,7 +159,6 @@ sources: name: singleton description: "Singleton" - name: SafeProxyFactory_v_1_4_1_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.4.1 factory ProxyCreation events" columns: - *contract_address @@ -183,7 +171,6 @@ sources: - name: singleton description: "Singleton" - name: Safev0_1_0_call_setup - loaded_at_field: call_block_time description: "Safe v0.1.0 setup events" columns: - &_owners @@ -203,7 +190,6 @@ sources: - *call_success - *call_trace_address - name: Safev0_1_0_evt_ChangedThreshold - loaded_at_field: call_block_time description: "Safe v0.1.0 changed threshold events" columns: - *call_block_number @@ -214,7 +200,6 @@ sources: - *contract_address - *_threshold - name: Safev1_0_0_call_setup - loaded_at_field: call_block_time description: "Safe v1.0.0 setup events" columns: - *_owners @@ -237,7 +222,6 @@ sources: - *call_success - *call_trace_address - name: Safev1_0_0_evt_ChangedThreshold - loaded_at_field: call_block_time description: "Safe v1.0.0 changed threshold events" columns: - *call_block_number @@ -248,7 +232,6 @@ sources: - *contract_address - *threshold - name: Safev1_1_0_call_setup - loaded_at_field: call_block_time description: "Safe v1.1.0 setup events" columns: - *_owners @@ -266,7 +249,6 @@ sources: - *call_success - *call_trace_address - name: Safev1_1_0_evt_ChangedThreshold - loaded_at_field: call_block_time description: "Safe v1.1.0 changed threshold events" columns: - *call_block_number @@ -277,7 +259,6 @@ sources: - *contract_address - *threshold - name: Safev1_1_1_call_setup - loaded_at_field: call_block_time description: "Safe v1.1.1 setup events" columns: - *_owners @@ -295,7 +276,6 @@ sources: - *call_success - *call_trace_address - name: Safev1_1_1_evt_ChangedThreshold - loaded_at_field: call_block_time description: "Safe v1.1.1 changed threshold events" columns: - *call_block_number @@ -306,7 +286,6 @@ sources: - *contract_address - *threshold - name: GnosisSafev1_3_0_evt_ChangedThreshold - loaded_at_field: call_block_time description: "Safe v1.3.0 changed threshold events" columns: - *contract_address diff --git a/sources/safe/fantom/safe_fantom_sources.yml b/sources/safe/fantom/safe_fantom_sources.yml index 5603a60514c..8d9866b2c04 100644 --- a/sources/safe/fantom/safe_fantom_sources.yml +++ b/sources/safe/fantom/safe_fantom_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_fantom - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address diff --git a/sources/safe/gnosis/safe_gnosis_sources.yml b/sources/safe/gnosis/safe_gnosis_sources.yml index 023136374e8..dbb3dd802f2 100644 --- a/sources/safe/gnosis/safe_gnosis_sources.yml +++ b/sources/safe/gnosis/safe_gnosis_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_gnosis - freshness: - warn_after: { count: 12, period: hour } tables: - name: ProxyFactory_v1_1_1_call_createProxy - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxy calls" columns: - &call_block_number @@ -37,7 +34,6 @@ sources: name: output_proxy description: "Address of created Safe proxy" - name: ProxyFactory_v1_1_1_call_createProxyWithNonce - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithNonce calls" columns: - &_mastercopy @@ -57,7 +53,6 @@ sources: name: saltNonce description: "Salt nonce" - name: ProxyFactory_v1_1_1_call_createProxyWithCallback - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithCallback calls" columns: - *_mastercopy @@ -71,7 +66,6 @@ sources: - *output_proxy - *saltNonce - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - *contract_address @@ -96,7 +90,6 @@ sources: - name: xdai_gnosis tables: - name: BlockRewardAuRa_evt_AddedReceiver - loaded_at_field: evt_block_time description: "Blockreward receptions" columns: - *contract_address diff --git a/sources/safe/goerli/safe_goerli_sources.yml b/sources/safe/goerli/safe_goerli_sources.yml index 4eb01b0df01..43cb9d39d57 100644 --- a/sources/safe/goerli/safe_goerli_sources.yml +++ b/sources/safe/goerli/safe_goerli_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_goerli - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address diff --git a/sources/safe/optimism/safe_optimism_sources.yml b/sources/safe/optimism/safe_optimism_sources.yml index 84f1c90b8b3..916f925f45d 100644 --- a/sources/safe/optimism/safe_optimism_sources.yml +++ b/sources/safe/optimism/safe_optimism_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_optimism - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeL2_v1_3_0_evt_SafeSetup - loaded_at_field: evt_block_time description: "Optimism Safe v1.3.0L2 setup events" columns: - &contract_address @@ -40,7 +37,6 @@ sources: name: threshold description: "Number of required confirmations for a Safe transaction" - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - *contract_address @@ -56,7 +52,6 @@ sources: description: "Singleton" - name: SafeProxyFactory_v_1_4_1_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.4.1 factory ProxyCreation events" columns: - *contract_address @@ -68,11 +63,8 @@ sources: - *singleton - name: erc20_optimism - freshness: - warn_after: { count: 12, period: hour } tables: - name: evt_Transfer - loaded_at_field: evt_block_time description: "ERC20 transfer events on Optimism" columns: - *contract_address diff --git a/sources/safe/polygon/safe_polygon_sources.yml b/sources/safe/polygon/safe_polygon_sources.yml index 1659c89279d..0a333b6bb47 100644 --- a/sources/safe/polygon/safe_polygon_sources.yml +++ b/sources/safe/polygon/safe_polygon_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_polygon - freshness: - warn_after: { count: 12, period: hour } tables: - name: ProxyFactory_v1_1_1_call_createProxy - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxy calls" columns: - &call_block_number @@ -37,7 +34,6 @@ sources: name: output_proxy description: "Address of created Safe proxy" - name: ProxyFactory_v1_1_1_call_createProxyWithNonce - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithNonce calls" columns: - &_mastercopy @@ -57,7 +53,6 @@ sources: name: saltNonce description: "Salt nonce" - name: ProxyFactory_v1_1_1_call_createProxyWithCallback - loaded_at_field: call_block_time description: "Safe v1.1.1 factory createProxyWithCallback calls" columns: - *_mastercopy @@ -71,7 +66,6 @@ sources: - *output_proxy - *saltNonce - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - *contract_address @@ -95,7 +89,6 @@ sources: description: "Singleton" - name: ProxyFactoryv_1_4_1_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.4.1 factory ProxyCreation events" columns: - *contract_address diff --git a/sources/safe/scroll/safe_scroll_sources.yml b/sources/safe/scroll/safe_scroll_sources.yml new file mode 100644 index 00000000000..97cdb11630b --- /dev/null +++ b/sources/safe/scroll/safe_scroll_sources.yml @@ -0,0 +1,45 @@ +version: 2 + +sources: + - name: gnosis_safe_scroll + freshness: + warn_after: { count: 12, period: hour } + tables: + - name: GnosisSafeProxyFactory_v1_3_0_evt_ProxyCreation + loaded_at_field: evt_block_time + description: "Safe v1.3.0 factory ProxyCreation events" + columns: + - &contract_address + name: contract_address + description: "Contract address" + - &evt_block_number + name: evt_block_number + description: "Event block number" + - &evt_block_time + name: evt_block_time + description: "Event block time" + - &evt_index + name: evt_index + description: "Event index" + - &evt_tx_hash + name: evt_tx_hash + description: "Event tx hash" + - &proxy + name: proxy + description: "Address of created Safe proxy" + - &singleton + name: singleton + description: "Singleton" + - name: SafeProxyFactory_v1_4_1_evt_ProxyCreation + loaded_at_field: evt_block_time + description: "Safe v1.4.1 factory ProxyCreation events" + columns: + - *contract_address + - *evt_block_number + - *evt_block_time + - *evt_index + - *evt_tx_hash + - name: proxy + description: "Address of created Safe proxy" + - name: singleton + description: "Singleton" \ No newline at end of file diff --git a/sources/safe/zkevm/safe_zkevm_sources.yml b/sources/safe/zkevm/safe_zkevm_sources.yml index f71e2103557..1b4100e8a4a 100644 --- a/sources/safe/zkevm/safe_zkevm_sources.yml +++ b/sources/safe/zkevm/safe_zkevm_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_zkevm - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactory_v_1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address @@ -31,7 +28,6 @@ sources: name: singleton description: "Singleton" - name: SafeProxyFactory_v_1_4_1_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.4.1 factory ProxyCreation events" columns: - *contract_address diff --git a/sources/safe/zksync/safe_zksync_sources.yml b/sources/safe/zksync/safe_zksync_sources.yml index 324653f262e..c54d893b609 100644 --- a/sources/safe/zksync/safe_zksync_sources.yml +++ b/sources/safe/zksync/safe_zksync_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: gnosis_safe_zksync - freshness: - warn_after: { count: 12, period: hour } tables: - name: GnosisSafeProxyFactoryv1_3_0_evt_ProxyCreation - loaded_at_field: evt_block_time description: "Safe v1.3.0 factory ProxyCreation events" columns: - &contract_address diff --git a/sources/seaport/arbitrum/seaport_arbitrum_sources.yml b/sources/seaport/seaport_arbitrum_sources.yml similarity index 52% rename from sources/seaport/arbitrum/seaport_arbitrum_sources.yml rename to sources/seaport/seaport_arbitrum_sources.yml index 10c73d5c701..9a87a432b66 100644 --- a/sources/seaport/arbitrum/seaport_arbitrum_sources.yml +++ b/sources/seaport/seaport_arbitrum_sources.yml @@ -2,24 +2,13 @@ version: 2 sources: - name: seaport_arbitrum - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time - name: Seaport_call_fulfillAvailableAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_fulfillOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillBasicOrder - loaded_at_field: call_block_time - name: Seaport_call_matchAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_fulfillAdvancedOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillAvailableOrders - loaded_at_field: call_block_time - name: Seaport_call_matchOrders - loaded_at_field: call_block_time diff --git a/sources/seaport/avalanche_c/seaport_avalanche_c_sources.yml b/sources/seaport/seaport_avalanche_c_sources.yml similarity index 73% rename from sources/seaport/avalanche_c/seaport_avalanche_c_sources.yml rename to sources/seaport/seaport_avalanche_c_sources.yml index 930c36e9678..11f87266f48 100644 --- a/sources/seaport/avalanche_c/seaport_avalanche_c_sources.yml +++ b/sources/seaport/seaport_avalanche_c_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: seaport_avalanche_c - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time description: "" # to-do columns: - name: consideration @@ -21,8 +18,5 @@ sources: - name: recipient - name: zone - name: Seaport_call_matchAdvancedOrders - loaded_at_field: evt_block_time - name: Seaport_call_matchOrders - loaded_at_field: evt_block_time - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/seaport/base/seaport_base_sources.yml b/sources/seaport/seaport_base_sources.yml similarity index 78% rename from sources/seaport/base/seaport_base_sources.yml rename to sources/seaport/seaport_base_sources.yml index afaee11d2ea..fdc38281272 100644 --- a/sources/seaport/base/seaport_base_sources.yml +++ b/sources/seaport/seaport_base_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: seaport_base - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time description: "" # to-do columns: - name: consideration @@ -21,4 +18,3 @@ sources: - name: recipient - name: zone - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time diff --git a/sources/seaport/blast/seaport_blast_sources.yml b/sources/seaport/seaport_blast_sources.yml similarity index 52% rename from sources/seaport/blast/seaport_blast_sources.yml rename to sources/seaport/seaport_blast_sources.yml index 8fda3f56598..3f0096b5048 100644 --- a/sources/seaport/blast/seaport_blast_sources.yml +++ b/sources/seaport/seaport_blast_sources.yml @@ -2,24 +2,13 @@ version: 2 sources: - name: seaport_blast - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time - name: Seaport_call_fulfillAvailableAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_fulfillOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillBasicOrder - loaded_at_field: call_block_time - name: Seaport_call_matchAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_fulfillAdvancedOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillAvailableOrders - loaded_at_field: call_block_time - name: Seaport_call_matchOrders - loaded_at_field: call_block_time diff --git a/sources/seaport/bnb/seaport_bnb_sources.yml b/sources/seaport/seaport_bnb_sources.yml similarity index 82% rename from sources/seaport/bnb/seaport_bnb_sources.yml rename to sources/seaport/seaport_bnb_sources.yml index 7390b8258d9..c8b68a0c80e 100644 --- a/sources/seaport/bnb/seaport_bnb_sources.yml +++ b/sources/seaport/seaport_bnb_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: seaport_bnb - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time description: "" # to-do columns: - name: consideration diff --git a/sources/seaport/ethereum/seaport_ethereum_sources.yml b/sources/seaport/seaport_ethereum_sources.yml similarity index 52% rename from sources/seaport/ethereum/seaport_ethereum_sources.yml rename to sources/seaport/seaport_ethereum_sources.yml index 081e4b5bceb..d4e4c7695fb 100644 --- a/sources/seaport/ethereum/seaport_ethereum_sources.yml +++ b/sources/seaport/seaport_ethereum_sources.yml @@ -2,25 +2,14 @@ version: 2 sources: - name: seaport_ethereum - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_call_fulfillAvailableAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time - name: Seaport_call_fulfillOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillBasicOrder - loaded_at_field: call_block_time - name: Seaport_call_matchAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_fulfillAdvancedOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillAvailableOrders - loaded_at_field: call_block_time - name: Seaport_call_matchOrders - loaded_at_field: call_block_time - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/seaport/seaport_nova_sources.yml b/sources/seaport/seaport_nova_sources.yml new file mode 100644 index 00000000000..d899732512b --- /dev/null +++ b/sources/seaport/seaport_nova_sources.yml @@ -0,0 +1,14 @@ +version: 2 + +sources: + - name: seaport_nova + tables: + - name: Seaport_evt_OrderFulfilled + - name: Seaport_evt_OrdersMatched + - name: Seaport_call_fulfillAvailableAdvancedOrders + - name: Seaport_call_fulfillOrder + - name: Seaport_call_fulfillBasicOrder + - name: Seaport_call_matchAdvancedOrders + - name: Seaport_call_fulfillAdvancedOrder + - name: Seaport_call_fulfillAvailableOrders + - name: Seaport_call_matchOrders diff --git a/sources/seaport/optimism/seaport_optimism_sources.yml b/sources/seaport/seaport_optimism_sources.yml similarity index 52% rename from sources/seaport/optimism/seaport_optimism_sources.yml rename to sources/seaport/seaport_optimism_sources.yml index dacb42db7cf..cc2d674ef60 100644 --- a/sources/seaport/optimism/seaport_optimism_sources.yml +++ b/sources/seaport/seaport_optimism_sources.yml @@ -2,24 +2,13 @@ version: 2 sources: - name: seaport_optimism - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time - name: Seaport_call_fulfillAvailableAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_fulfillOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillBasicOrder - loaded_at_field: call_block_time - name: Seaport_call_matchAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_fulfillAdvancedOrder - loaded_at_field: call_block_time - name: Seaport_call_fulfillAvailableOrders - loaded_at_field: call_block_time - name: Seaport_call_matchOrders - loaded_at_field: call_block_time diff --git a/sources/seaport/polygon/seaport_polygon_sources.yml b/sources/seaport/seaport_polygon_sources.yml similarity index 72% rename from sources/seaport/polygon/seaport_polygon_sources.yml rename to sources/seaport/seaport_polygon_sources.yml index c4310ede9b6..3d3ac678f38 100644 --- a/sources/seaport/polygon/seaport_polygon_sources.yml +++ b/sources/seaport/seaport_polygon_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: seaport_polygon - freshness: - warn_after: { count: 24, period: hour } tables: - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time description: "" # to-do columns: - name: consideration @@ -21,8 +18,5 @@ sources: - name: recipient - name: zone - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time - name: Seaport_call_matchAdvancedOrders - loaded_at_field: call_block_time - name: Seaport_call_matchOrders - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/seaport/seaport_zora_sources.yml b/sources/seaport/seaport_zora_sources.yml new file mode 100644 index 00000000000..d4eb0dc1fcb --- /dev/null +++ b/sources/seaport/seaport_zora_sources.yml @@ -0,0 +1,14 @@ +version: 2 + +sources: + - name: seaport_zora + tables: + - name: Seaport_evt_OrderFulfilled + - name: Seaport_evt_OrdersMatched + - name: Seaport_call_fulfillAvailableAdvancedOrders + - name: Seaport_call_fulfillOrder + - name: Seaport_call_fulfillBasicOrder + - name: Seaport_call_matchAdvancedOrders + - name: Seaport_call_fulfillAdvancedOrder + - name: Seaport_call_fulfillAvailableOrders + - name: Seaport_call_matchOrders \ No newline at end of file diff --git a/sources/seaport/zora/seaport_zora_sources.yml b/sources/seaport/zora/seaport_zora_sources.yml deleted file mode 100644 index 01ed043d1e5..00000000000 --- a/sources/seaport/zora/seaport_zora_sources.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 - -sources: - - name: seaport_zora - freshness: - warn_after: { count: 24, period: hour } - tables: - - name: Seaport_evt_OrderFulfilled - loaded_at_field: evt_block_time - - name: Seaport_evt_OrdersMatched - loaded_at_field: evt_block_time - - name: Seaport_call_fulfillAvailableAdvancedOrders - loaded_at_field: call_block_time - - name: Seaport_call_fulfillOrder - loaded_at_field: call_block_time - - name: Seaport_call_fulfillBasicOrder - loaded_at_field: call_block_time - - name: Seaport_call_matchAdvancedOrders - loaded_at_field: call_block_time - - name: Seaport_call_fulfillAdvancedOrder - loaded_at_field: call_block_time - - name: Seaport_call_fulfillAvailableOrders - loaded_at_field: call_block_time - - name: Seaport_call_matchOrders - loaded_at_field: call_block_time \ No newline at end of file diff --git a/sources/shapeshift/ethereum/shapeshift_ethereum_sources.yml b/sources/shapeshift/ethereum/shapeshift_ethereum_sources.yml index 9be8bd8976b..fa5dc97b3ad 100644 --- a/sources/shapeshift/ethereum/shapeshift_ethereum_sources.yml +++ b/sources/shapeshift/ethereum/shapeshift_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: ShapeShift ethereum contracts tables: - name: TokenDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/sharky/solana/sharky_solana_sources.yml b/sources/sharky/solana/sharky_solana_sources.yml index a1301863bcd..9e5c46fea95 100644 --- a/sources/sharky/solana/sharky_solana_sources.yml +++ b/sources/sharky/solana/sharky_solana_sources.yml @@ -3,41 +3,21 @@ version: 2 sources: - name: sharky_solana description: "sharky decoded tables" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: sharky_call_offerLoan - loaded_at_field: call_block_time - name: sharky_call_rescindLoan - loaded_at_field: call_block_time - name: sharky_call_takeLoan - loaded_at_field: call_block_time - name: sharky_call_takeLoanV3 - loaded_at_field: call_block_time - name: sharky_call_takeLoanV3Compressed - loaded_at_field: call_block_time - name: sharky_call_repayLoan - loaded_at_field: call_block_time - name: sharky_call_repayLoanEscrow - loaded_at_field: call_block_time - name: sharky_call_repayLoanV3 - loaded_at_field: call_block_time - name: sharky_call_repayLoanV3Compressed - loaded_at_field: call_block_time - name: sharky_call_forecloseLoan - loaded_at_field: call_block_time - name: sharky_call_forecloseLoanEscrow - loaded_at_field: call_block_time - name: sharky_call_forecloseLoanV3 - loaded_at_field: call_block_time - name: sharky_call_forecloseLoanV3Compressed - loaded_at_field: call_block_time - name: sharky_call_extendLoan - loaded_at_field: call_block_time - name: sharky_call_extendLoanEscrow - loaded_at_field: call_block_time - name: sharky_call_extendLoanV3 - loaded_at_field: call_block_time - - name: sharky_call_extendLoanV3Compressed - loaded_at_field: call_block_time \ No newline at end of file + - name: sharky_call_extendLoanV3Compressed \ No newline at end of file diff --git a/sources/snowswap/ethereum/snowswap_ethereum_sources.yml b/sources/snowswap/ethereum/snowswap_ethereum_sources.yml index aecbf9bc507..8e0abe3d76a 100644 --- a/sources/snowswap/ethereum/snowswap_ethereum_sources.yml +++ b/sources/snowswap/ethereum/snowswap_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Snowswap ethereum contracts tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/sound_xyz/optimism/sound_xyz_optimism_edition_metadata_sources.yml b/sources/sound_xyz/optimism/sound_xyz_optimism_edition_metadata_sources.yml index e21c394a011..0d8009b8bab 100644 --- a/sources/sound_xyz/optimism/sound_xyz_optimism_edition_metadata_sources.yml +++ b/sources/sound_xyz/optimism/sound_xyz_optimism_edition_metadata_sources.yml @@ -3,11 +3,6 @@ version: 2 sources: - name: sound_xyz_optimism description: "optimism decoded tables related to sound xyz contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: SoundCreatorV1_evt_SoundEditionCreated - loaded_at_field: evt_block_time - name: SoundEditionV1_2_evt_SoundEditionInitialized - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/spaceid/bnb/spaceid_bnb_sources.yml b/sources/spaceid/bnb/spaceid_bnb_sources.yml index 244793a4633..9d5f099be53 100644 --- a/sources/spaceid/bnb/spaceid_bnb_sources.yml +++ b/sources/spaceid/bnb/spaceid_bnb_sources.yml @@ -3,21 +3,11 @@ version: 2 sources: - name: spaceid_bnb description: "bnb decoded tables related to SpaceId contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: BNBRegistrarControllerV3_evt_NameRegistered - loaded_at_field: evt_block_time - name: BNBRegistrarControllerV4_evt_NameRegistered - loaded_at_field: evt_block_time - name: BNBRegistrarControllerV5_evt_NameRegistered - loaded_at_field: evt_block_time - name: BNBRegistrarControllerV6_evt_NameRegistered - loaded_at_field: evt_block_time - name: BNBRegistrarControllerV7_evt_NameRegistered - loaded_at_field: evt_block_time - name: BNBRegistrarControllerV8_evt_NameRegistered - loaded_at_field: evt_block_time - name: BNBRegistrarControllerV9_evt_NameRegistered - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/staking/ethereum/entities/entity_specific/staking_ethereum_entities_entity_specific_source.yml b/sources/staking/ethereum/entities/entity_specific/staking_ethereum_entities_entity_specific_source.yml index e47803ef177..d28ec9f6aee 100644 --- a/sources/staking/ethereum/entities/entity_specific/staking_ethereum_entities_entity_specific_source.yml +++ b/sources/staking/ethereum/entities/entity_specific/staking_ethereum_entities_entity_specific_source.yml @@ -4,4 +4,3 @@ sources: - name: stakewise_v3_ethereum tables: - name: VaultsRegistry_evt_VaultAdded - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/staking/ethereum/staking_ethereum_sources.yml b/sources/staking/ethereum/staking_ethereum_sources.yml index 9e861da6f0b..cd062136a11 100644 --- a/sources/staking/ethereum/staking_ethereum_sources.yml +++ b/sources/staking/ethereum/staking_ethereum_sources.yml @@ -2,9 +2,5 @@ version: 2 sources: - name: eth2_ethereum - freshness: - warn_after: { count: 72, period: hour } - error_after: { count: 120, period: hour } tables: - name: DepositContract_evt_DepositEvent - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/staking/solana/staking_solana_sources.yml b/sources/staking/solana/staking_solana_sources.yml index 902fb0a5048..a34bf10b7e0 100644 --- a/sources/staking/solana/staking_solana_sources.yml +++ b/sources/staking/solana/staking_solana_sources.yml @@ -2,19 +2,10 @@ version: 2 sources: - name: stake_program_solana - freshness: - warn_after: { count: 72, period: hour } - error_after: { count: 120, period: hour } tables: - name: stake_call_DelegateStake - loaded_at_field: evt_block_time - name: stake_call_Merge - loaded_at_field: evt_block_time - name: stake_call_Withdraw - loaded_at_field: evt_block_time - name: stake_call_Split - loaded_at_field: evt_block_time - name: stake_call_Initialize - loaded_at_field: evt_block_time - - name: stake_call_InitializeChecked - loaded_at_field: evt_block_time \ No newline at end of file + - name: stake_call_InitializeChecked \ No newline at end of file diff --git a/sources/sudoswap/ethereum/sudoswap_ethereum_sources.yml b/sources/sudoswap/ethereum/sudoswap_ethereum_sources.yml index 71c83c9db97..f12f3d3ee73 100644 --- a/sources/sudoswap/ethereum/sudoswap_ethereum_sources.yml +++ b/sources/sudoswap/ethereum/sudoswap_ethereum_sources.yml @@ -2,46 +2,21 @@ version: 2 sources: - name: sudo_amm_ethereum - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: LSSVMPairFactory_call_createPairETH - freshness: - warn_after: { count: 12, period: hour } description: "As of 8/9/22, only ETH pairs have been created. Will need ERC20 logic in the future." - loaded_at_field: call_block_time - name: LSSVMPair_general_call_swapNFTsForToken - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: call_block_time - name: LSSVMPair_general_call_swapTokenForAnyNFTs - loaded_at_field: call_block_time - name: LSSVMPair_general_call_swapTokenForSpecificNFTs - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: call_block_time - name: LSSVMPair_general_evt_FeeUpdate - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: LSSVMPair_general_evt_AssetRecipientChange - loaded_at_field: evt_block_time - name: LSSVMPairFactory_evt_ProtocolFeeMultiplierUpdate - loaded_at_field: evt_block_time - name: LSSVMPair_general_evt_DeltaUpdate - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: LSSVMPair_general_evt_SpotPriceUpdate - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time - name: sudoswap_ethereum description: > $SUDO airdrop claims tables: - name: Astrodrop_evt_Claimed - loaded_at_field: evt_block_time - name: base_trades diff --git a/sources/sushiswap/optimism/sushiswap_optimism_sources.yml b/sources/sushiswap/optimism/sushiswap_optimism_sources.yml index 018f8575fa3..fb0210364c3 100644 --- a/sources/sushiswap/optimism/sushiswap_optimism_sources.yml +++ b/sources/sushiswap/optimism/sushiswap_optimism_sources.yml @@ -3,16 +3,11 @@ version: 2 sources: - name: sushi_optimism description: "optimism decoded tables related to Sushiswap Trident contracts" - freshness: - warn_after: { count: 12, period: hour } tables: - name: MiniChefV2_evt_LogPoolAddition - loaded_at_field: evt_block_time - name: MiniChefV2_evt_LogSetPool - loaded_at_field: evt_block_time - name: MiniChefV2_evt_LogSushiPerSecond - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synapse/arbitrum/synapse_arbitrum_sources.yml b/sources/synapse/arbitrum/synapse_arbitrum_sources.yml index cc6bd1b44ab..a6f2ff7bf26 100644 --- a/sources/synapse/arbitrum/synapse_arbitrum_sources.yml +++ b/sources/synapse/arbitrum/synapse_arbitrum_sources.yml @@ -5,4 +5,3 @@ sources: description: Arbitrum decoded tables related to Synapse tables: - name: SwapFlashLoan_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synapse/avalanche_c/synapse_avalanche_c_sources.yml b/sources/synapse/avalanche_c/synapse_avalanche_c_sources.yml index 6848777b589..ca9128d8419 100644 --- a/sources/synapse/avalanche_c/synapse_avalanche_c_sources.yml +++ b/sources/synapse/avalanche_c/synapse_avalanche_c_sources.yml @@ -5,4 +5,3 @@ sources: description: Avalanche decoded tables related to Synapse tables: - name: SwapFlashLoan_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synapse/bnb/synapse_bnb_sources.yml b/sources/synapse/bnb/synapse_bnb_sources.yml index 7ada0f7cbbf..717a0afeb5c 100644 --- a/sources/synapse/bnb/synapse_bnb_sources.yml +++ b/sources/synapse/bnb/synapse_bnb_sources.yml @@ -5,4 +5,3 @@ sources: description: BNB decoded tables related to Synapse tables: - name: SwapFlashLoan_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synapse/ethereum/synapse_ethereum_sources.yml b/sources/synapse/ethereum/synapse_ethereum_sources.yml index 2f0d7df8458..9ced7e54652 100644 --- a/sources/synapse/ethereum/synapse_ethereum_sources.yml +++ b/sources/synapse/ethereum/synapse_ethereum_sources.yml @@ -5,4 +5,3 @@ sources: description: Ethereum decoded tables related to Synapse tables: - name: SwapFlashLoan_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synapse/fantom/synapse_fantom_sources.yml b/sources/synapse/fantom/synapse_fantom_sources.yml index a393c8d3551..4e9332921ce 100644 --- a/sources/synapse/fantom/synapse_fantom_sources.yml +++ b/sources/synapse/fantom/synapse_fantom_sources.yml @@ -5,4 +5,3 @@ sources: description: Fantom decoded tables related to Synapse tables: - name: SwapFlashLoan_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synapse/optimism/synapse_optimism_sources.yml b/sources/synapse/optimism/synapse_optimism_sources.yml index e75a3ea0d57..cae6c70396d 100644 --- a/sources/synapse/optimism/synapse_optimism_sources.yml +++ b/sources/synapse/optimism/synapse_optimism_sources.yml @@ -5,4 +5,3 @@ sources: description: Optimism decoded tables related to Synapse tables: - name: SwapFlashLoan_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synapse/polygon/synapse_polygon_sources.yml b/sources/synapse/polygon/synapse_polygon_sources.yml index 2ca8f6b56cb..9524a2894bc 100644 --- a/sources/synapse/polygon/synapse_polygon_sources.yml +++ b/sources/synapse/polygon/synapse_polygon_sources.yml @@ -5,4 +5,3 @@ sources: description: Polygon decoded tables related to Synapse tables: - name: SwapFlashLoan_evt_FlashLoan - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/syndicate/ethereum/syndicate_ethereum_dao_addresses_sources.yml b/sources/syndicate/ethereum/syndicate_ethereum_dao_addresses_sources.yml index dcc48a87e86..9dd8e1454b0 100644 --- a/sources/syndicate/ethereum/syndicate_ethereum_dao_addresses_sources.yml +++ b/sources/syndicate/ethereum/syndicate_ethereum_dao_addresses_sources.yml @@ -5,4 +5,3 @@ sources: description: "syndicate dao deployed event" tables: - name: ERC20ClubFactory_evt_ERC20ClubCreated - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/syndicate/polygon/syndicate_polygon_sources.yml b/sources/syndicate/polygon/syndicate_polygon_sources.yml index 4ecf9f88703..52ca5d17fc6 100644 --- a/sources/syndicate/polygon/syndicate_polygon_sources.yml +++ b/sources/syndicate/polygon/syndicate_polygon_sources.yml @@ -5,8 +5,5 @@ sources: description: "syndicate club created event" tables: - name: ERC20ClubFactory_evt_ERC20ClubCreated - loaded_at_field: evt_block_time - name: PolygonClubFactoryMATIC_evt_ERC20ClubCreated - loaded_at_field: evt_block_time - name: PolygonERC20ClubFactory_evt_ERC20ClubCreated - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synthetix/base/synthetix_base_sources.yml b/sources/synthetix/base/synthetix_base_sources.yml index 2fac1c8bf40..f1cb43016cd 100644 --- a/sources/synthetix/base/synthetix_base_sources.yml +++ b/sources/synthetix/base/synthetix_base_sources.yml @@ -5,10 +5,6 @@ sources: description: "Synthetix V3 Base Decoded Events" tables: - name: PerpsMarket_evt_AccountCreated - loaded_at_field: evt_block_time - name: PerpsMarket_evt_MarketCreated - loaded_at_field: evt_block_time - name: PerpsMarket_evt_MarketUpdated - loaded_at_field: evt_block_time - name: PerpsMarket_evt_OrderSettled - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/synthetix/optimism/synthetix_optimism_sources.yml b/sources/synthetix/optimism/synthetix_optimism_sources.yml index 08a21d57f53..5b812516230 100644 --- a/sources/synthetix/optimism/synthetix_optimism_sources.yml +++ b/sources/synthetix/optimism/synthetix_optimism_sources.yml @@ -5,26 +5,15 @@ sources: description: Optimism decoded tables related to Synthetix tables: - name: FuturesMarket_evt_PositionModified - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 7, period: day } - loaded_at_field: evt_block_time description: "Details the perpetuals trades/swaps on PerpsV1" - name: FuturesMarketManager_evt_MarketAdded - loaded_at_field: evt_block_time description: "Details the asset markets" - name: FuturesMarket_evt_FuturesTracking - loaded_at_field: evt_block_time description: "Provides details on the app or protocol where the trade was executed" - name: synthetix_futuresmarket_optimism description: Optimism decoded tables related to Synthetix PerpsV2 tables: - name: ProxyPerpsV2_evt_PositionModified - freshness: - warn_after: { count: 1, period: day } - error_after: { count: 7, period: day } - loaded_at_field: evt_block_time description: "Details the perpetuals trades/swaps on PerpsV2" - name: ProxyPerpsV2_evt_PerpsTracking - loaded_at_field: evt_block_time description: "Provides details on the app or protocol where the trade was executed" \ No newline at end of file diff --git a/sources/thales/ethereum/thales_ethereum_sources.yml b/sources/thales/ethereum/thales_ethereum_sources.yml index 42d13f23fca..dae8c48d73b 100644 --- a/sources/thales/ethereum/thales_ethereum_sources.yml +++ b/sources/thales/ethereum/thales_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Thales ethereum contracts tables: - name: Airdrop_evt_Claim - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/the_granary/optimism/the_granary_optimism_sources.yml b/sources/the_granary/optimism/the_granary_optimism_sources.yml index edb25b77985..f2f6ef926e6 100644 --- a/sources/the_granary/optimism/the_granary_optimism_sources.yml +++ b/sources/the_granary/optimism/the_granary_optimism_sources.yml @@ -6,11 +6,7 @@ sources: tables: - name: AToken_evt_Initialized - loaded_at_field: evt_block_time description: "aToken initialization events, supply tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - &contract_address name: contract_address @@ -41,11 +37,7 @@ sources: description: "Name of the aToken" - name: DebtToken_evt_Initialized - loaded_at_field: evt_block_time description: "aToken initialization events, stable debt tokens." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } columns: - *contract_address - *evt_block_number diff --git a/sources/tigris/arbitrum/events/tigris_arbitrum_events_sources.yml b/sources/tigris/arbitrum/events/tigris_arbitrum_events_sources.yml index d42dd405ee1..2f70c2b5806 100644 --- a/sources/tigris/arbitrum/events/tigris_arbitrum_events_sources.yml +++ b/sources/tigris/arbitrum/events/tigris_arbitrum_events_sources.yml @@ -5,250 +5,128 @@ sources: description: "tigris trade arbitrum decoded events" tables: - name: PairsContract_evt_AssetAdded - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV2_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV3_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV4_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV5_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV2_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV3_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV4_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV5_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV2_call_addToPosition - loaded_at_field: call_block_time - name: TradingV3_call_addToPosition - loaded_at_field: call_block_time - name: TradingV4_call_addToPosition - loaded_at_field: call_block_time - name: TradingV5_call_addToPosition - loaded_at_field: call_block_time - name: TradingV2_call_addMargin - loaded_at_field: call_block_time - name: TradingV2_call_removeMargin - loaded_at_field: call_block_time - name: TradingV3_call_addMargin - loaded_at_field: call_block_time - name: TradingV3_call_removeMargin - loaded_at_field: call_block_time - name: TradingV4_call_addMargin - loaded_at_field: call_block_time - name: TradingV4_call_removeMargin - loaded_at_field: call_block_time - name: TradingV5_call_addMargin - loaded_at_field: call_block_time - name: TradingV5_call_removeMargin - loaded_at_field: call_block_time - name: TradingV2_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: limit_order_trading_evt - loaded_at_field: evt_block_time - name: TradingV2_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV4_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV5_evt_FeesDistributed - loaded_at_field: evt_block_time - name: tigristrade_v2_arbitrum description: "tigris trade arbitrum decoded events & calls on v2" tables: - name: Trading_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV2_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV3_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV4_evt_AddToPosition - loaded_at_field: evt_block_time - name: Trading_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionClosed - loaded_at_field: evt_block_time - name: Trading_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV2_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: Trading_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: Trading_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV2_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV3_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV4_evt_MarginModified - loaded_at_field: evt_block_time - name: Trading_call_addMargin - loaded_at_field: call_block_time - name: TradingV2_call_addMargin - loaded_at_field: call_block_time - name: TradingV3_call_addMargin - loaded_at_field: call_block_time - name: TradingV4_call_addMargin - loaded_at_field: call_block_time - name: Trading_call_removeMargin - loaded_at_field: call_block_time - name: TradingV2_call_removeMargin - loaded_at_field: call_block_time - name: TradingV3_call_removeMargin - loaded_at_field: call_block_time - name: TradingV4_call_removeMargin - loaded_at_field: call_block_time - name: Trading_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionOpened - loaded_at_field: evt_block_time - name: limit_order_trading_evt - loaded_at_field: evt_block_time - name: PairsContract_evt_AssetAdded - loaded_at_field: evt_block_time - name: PairsContract_v2_evt_AssetAdded - loaded_at_field: evt_block_time - name: Trading_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV2_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitCancelled - loaded_at_field: evt_block_time - name: options_evt_TradeOpened - loaded_at_field: evt_block_time - name: options_evt_OptionsLimitOrderExecuted - loaded_at_field: evt_block_time - name: options_evt_TradeClosed - loaded_at_field: evt_block_time - name: options_evt_OptionsLimitCancelled - loaded_at_field: evt_block_time - name: Trading_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV2_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV3_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV4_evt_FeesDistributed - loaded_at_field: evt_block_time - name: options_evt_OptionsFeesDistributed - loaded_at_field: evt_block_time - name: TradingV5_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV5_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV5_call_addMargin - loaded_at_field: call_block_time - name: TradingV5_call_removeMargin - loaded_at_field: call_block_time - name: TradingV5_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV5_evt_FeesDistributed - loaded_at_field: evt_block_time - name: Options_V2_evt_TradeClosed - loaded_at_field: evt_block_time - name: Options_V2_evt_OptionsFeesDistributed - loaded_at_field: evt_block_time - name: Options_V2_evt_OptionsLimitCancelled - loaded_at_field: evt_block_time - name: Options_V2_evt_OptionsLimitOrderExecuted - loaded_at_field: evt_block_time - name: Options_V2_evt_TradeOpened - loaded_at_field: evt_block_time - name: TradingV6_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV6_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV6_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV6_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV6_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV6_call_addMargin - loaded_at_field: call_block_time - name: TradingV6_call_removeMargin - loaded_at_field: call_block_time - name: TradingV6_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV6_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV6_evt_FeesDistributed - loaded_at_field: evt_block_time - name: Options_V3_evt_TradeClosed - loaded_at_field: evt_block_time - name: Options_V3_evt_OptionsFeesDistributed - loaded_at_field: evt_block_time - name: Options_V3_evt_OptionsLimitCancelled - loaded_at_field: evt_block_time - name: Options_V3_evt_OptionsLimitOrderExecuted - loaded_at_field: evt_block_time - name: Options_V3_evt_TradeOpened - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/tigris/polygon/events/tigris_polygon_events_sources.yml b/sources/tigris/polygon/events/tigris_polygon_events_sources.yml index 3c3e354ce55..30ee9de3ba0 100644 --- a/sources/tigris/polygon/events/tigris_polygon_events_sources.yml +++ b/sources/tigris/polygon/events/tigris_polygon_events_sources.yml @@ -5,290 +5,148 @@ sources: description: "tigris trade polygon decoded events" tables: - name: PairsContract_evt_AssetAdded - loaded_at_field: evt_block_time - name: Tradingv1_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV6_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV7_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV8_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV5_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV6_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV7_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV8_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV5_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV6_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV7_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV8_evt_MarginModified - loaded_at_field: evt_block_time - name: Tradingv1_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV6_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV7_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV8_evt_PositionClosed - loaded_at_field: evt_block_time - name: Tradingv1_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV6_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV7_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV8_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV5_call_addToPosition - loaded_at_field: call_block_time - name: TradingV6_call_addToPosition - loaded_at_field: call_block_time - name: TradingV7_call_addToPosition - loaded_at_field: call_block_time - name: TradingV8_call_addToPosition - loaded_at_field: call_block_time - name: TradingV5_call_addMargin - loaded_at_field: call_block_time - name: TradingV5_call_removeMargin - loaded_at_field: call_block_time - name: TradingV6_call_addMargin - loaded_at_field: call_block_time - name: TradingV6_call_removeMargin - loaded_at_field: call_block_time - name: TradingV7_call_addMargin - loaded_at_field: call_block_time - name: TradingV7_call_removeMargin - loaded_at_field: call_block_time - name: TradingV8_call_addMargin - loaded_at_field: call_block_time - name: TradingV8_call_removeMargin - loaded_at_field: call_block_time - name: Tradingv1_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV2_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV6_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV7_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV8_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: limit_order_trading_evt - loaded_at_field: evt_block_time - name: Tradingv1_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV2_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV6_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV7_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV8_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV7_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV8_evt_FeesDistributed - loaded_at_field: evt_block_time - name: tigristrade_v2_polygon description: "tigris trade polygon decoded events & calls on v2" tables: - name: Trading_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV2_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV3_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV4_evt_AddToPosition - loaded_at_field: evt_block_time - name: Trading_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionClosed - loaded_at_field: evt_block_time - name: Trading_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV2_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: Trading_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: Trading_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV2_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV3_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV4_evt_MarginModified - loaded_at_field: evt_block_time - name: Trading_call_addMargin - loaded_at_field: call_block_time - name: TradingV2_call_addMargin - loaded_at_field: call_block_time - name: TradingV3_call_addMargin - loaded_at_field: call_block_time - name: TradingV4_call_addMargin - loaded_at_field: call_block_time - name: Trading_call_removeMargin - loaded_at_field: call_block_time - name: TradingV2_call_removeMargin - loaded_at_field: call_block_time - name: TradingV3_call_removeMargin - loaded_at_field: call_block_time - name: TradingV4_call_removeMargin - loaded_at_field: call_block_time - name: Trading_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV2_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV3_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV4_evt_PositionOpened - loaded_at_field: evt_block_time - name: limit_order_trading_evt - loaded_at_field: evt_block_time - name: PairsContract_evt_AssetAdded - loaded_at_field: evt_block_time - name: PairsContract_v2_evt_AssetAdded - loaded_at_field: evt_block_time - name: Trading_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV2_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV3_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV4_evt_LimitCancelled - loaded_at_field: evt_block_time - name: options_evt_TradeOpened - loaded_at_field: evt_block_time - name: options_evt_OptionsLimitOrderExecuted - loaded_at_field: evt_block_time - name: options_evt_TradeClosed - loaded_at_field: evt_block_time - name: options_evt_OptionsLimitCancelled - loaded_at_field: evt_block_time - name: Trading_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV2_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV3_evt_FeesDistributed - loaded_at_field: evt_block_time - name: TradingV4_evt_FeesDistributed - loaded_at_field: evt_block_time - name: options_evt_OptionsFeesDistributed - loaded_at_field: evt_block_time - name: TradingV5_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV5_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV5_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV5_call_addMargin - loaded_at_field: call_block_time - name: TradingV5_call_removeMargin - loaded_at_field: call_block_time - name: TradingV5_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV5_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV5_evt_FeesDistributed - loaded_at_field: evt_block_time - name: Options_V2_evt_TradeClosed - loaded_at_field: evt_block_time - name: Options_V2_evt_OptionsFeesDistributed - loaded_at_field: evt_block_time - name: Options_V2_evt_OptionsLimitCancelled - loaded_at_field: evt_block_time - name: Options_V2_evt_OptionsLimitOrderExecuted - loaded_at_field: evt_block_time - name: Options_V2_evt_TradeOpened - loaded_at_field: evt_block_time - name: TradingV6_evt_AddToPosition - loaded_at_field: evt_block_time - name: TradingV6_evt_PositionClosed - loaded_at_field: evt_block_time - name: TradingV6_evt_LimitOrderExecuted - loaded_at_field: evt_block_time - name: TradingV6_evt_PositionLiquidated - loaded_at_field: evt_block_time - name: TradingV6_evt_MarginModified - loaded_at_field: evt_block_time - name: TradingV6_call_addMargin - loaded_at_field: call_block_time - name: TradingV6_call_removeMargin - loaded_at_field: call_block_time - name: TradingV6_evt_PositionOpened - loaded_at_field: evt_block_time - name: TradingV6_evt_LimitCancelled - loaded_at_field: evt_block_time - name: TradingV6_evt_FeesDistributed - loaded_at_field: evt_block_time - name: Options_V3_evt_TradeClosed - loaded_at_field: evt_block_time - name: Options_V3_evt_OptionsFeesDistributed - loaded_at_field: evt_block_time - name: Options_V3_evt_OptionsLimitCancelled - loaded_at_field: evt_block_time - name: Options_V3_evt_OptionsLimitOrderExecuted - loaded_at_field: evt_block_time - name: Options_V3_evt_TradeOpened - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/tokenfy/ethereum/tokenfy_ethereum_sources.yml b/sources/tokenfy/ethereum/tokenfy_ethereum_sources.yml index 037f8e5c3e2..755e3176e01 100644 --- a/sources/tokenfy/ethereum/tokenfy_ethereum_sources.yml +++ b/sources/tokenfy/ethereum/tokenfy_ethereum_sources.yml @@ -5,5 +5,4 @@ sources: description: > Tokenfy ethereum contracts tables: - - name: Tokenfy_call_claim - loaded_at_field: call_block_time \ No newline at end of file + - name: Tokenfy_call_claim \ No newline at end of file diff --git a/sources/tokenlon/ethereum/tokenlon_ethereum_sources.yml b/sources/tokenlon/ethereum/tokenlon_ethereum_sources.yml index 44d00a57e0d..cfed61dbfaa 100644 --- a/sources/tokenlon/ethereum/tokenlon_ethereum_sources.yml +++ b/sources/tokenlon/ethereum/tokenlon_ethereum_sources.yml @@ -3,26 +3,18 @@ version: 2 sources: - name: tokenlon_v5_ethereum description: 'decoded events and function calls for tokenlon v5 on ethereum' - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: AMMWrapper_evt_Swapped - loaded_at_field: evt_block_time description: 'Tokenlon V5 AMM V1 Swapped Event' - name: AMMWrapperWithPath_evt_Swapped - loaded_at_field: evt_block_time description: 'Tokenlon V5 AMM V2 swapped event' - name: PMM_evt_FillOrder - loaded_at_field: evt_block_time description: 'Tokenlon V5 PMM V5 swapped Event' - name: RFQv1_evt_FillOrder - loaded_at_field: evt_block_time description: 'Tokenlon V5 RFQv1 swapped Event' - name: RFQv2_evt_FilledRFQ - loaded_at_field: evt_block_time description: 'Tokenlon V5 RFQv2 swapped Event' diff --git a/sources/tokens/optimism/tokens_optimism_source.yml b/sources/tokens/optimism/tokens_optimism_source.yml index c52a5e235e2..a2b97492310 100644 --- a/sources/tokens/optimism/tokens_optimism_source.yml +++ b/sources/tokens/optimism/tokens_optimism_source.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: optimism_ethereum description: "Optimism decoded tables related to bridges and sequencer" - freshness: - warn_after: { count: 12, period: hour } tables: - name: L1ERC721Bridge_evt_ERC721BridgeInitiated - loaded_at_field: evt_block_time description: "Optimism NFT bridge transactions initiated from L1 to L2" columns: - &contract_address @@ -40,18 +37,13 @@ sources: description: "NFT token id" - name: L1StandardBridge_evt_ERC20DepositInitiated - loaded_at_field: evt_block_time description: "Optimism ERC20 bridge transactions initiated from L1 to L2" - name: OVM_L1StandardBridge_evt_ERC20DepositInitiated - loaded_at_field: evt_block_time description: "Optimism ERC20 bridge transactions initiated from L1 to L2" - name: ovm_optimism description: "Optimism decoded tables related to bridges and sequencer on optimism" - freshness: - warn_after: { count: 12, period: hour } tables: - name: L2ERC721Bridge_evt_ERC721BridgeFinalized - loaded_at_field: evt_block_time description: "Optimism NFT bridge transactions finalized on L2" diff --git a/sources/tornado_cash/arbitrum/tornado_cash_arbitrum_sources.yml b/sources/tornado_cash/arbitrum/tornado_cash_arbitrum_sources.yml index 3081dbc55ea..cac15373d3c 100644 --- a/sources/tornado_cash/arbitrum/tornado_cash_arbitrum_sources.yml +++ b/sources/tornado_cash/arbitrum/tornado_cash_arbitrum_sources.yml @@ -4,7 +4,6 @@ sources: - name: tornado_cash_arbitrum tables: - name: ETHTornado_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -15,7 +14,6 @@ sources: - name: leafIndex - name: timestamp - name: ETHTornado_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash diff --git a/sources/tornado_cash/avalanche_c/tornado_cash_avalanche_c_sources.yml b/sources/tornado_cash/avalanche_c/tornado_cash_avalanche_c_sources.yml index c689cb1b8c1..91b6a411cc5 100644 --- a/sources/tornado_cash/avalanche_c/tornado_cash_avalanche_c_sources.yml +++ b/sources/tornado_cash/avalanche_c/tornado_cash_avalanche_c_sources.yml @@ -4,7 +4,6 @@ sources: - name: tornado_cash_avalanche_c tables: - name: ETHTornado_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -15,7 +14,6 @@ sources: - name: leafIndex - name: timestamp - name: ETHTornado_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash diff --git a/sources/tornado_cash/bnb/tornado_cash_bnb_sources.yml b/sources/tornado_cash/bnb/tornado_cash_bnb_sources.yml index 21f975aab12..6369d77d7b5 100644 --- a/sources/tornado_cash/bnb/tornado_cash_bnb_sources.yml +++ b/sources/tornado_cash/bnb/tornado_cash_bnb_sources.yml @@ -4,7 +4,6 @@ sources: - name: tornado_cash_bnb tables: - name: TornadoCashBNB_evt_Deposit - loaded_at_field: evt_block_time columns: - name: evt_tx_hash - name: evt_index @@ -14,7 +13,6 @@ sources: - name: leafIndex - name: timestamp - name: TornadoCashBNB_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash diff --git a/sources/tornado_cash/ethereum/tornado_cash_ethereum_sources.yml b/sources/tornado_cash/ethereum/tornado_cash_ethereum_sources.yml index 3ce8f0935e0..6baad6b8784 100644 --- a/sources/tornado_cash/ethereum/tornado_cash_ethereum_sources.yml +++ b/sources/tornado_cash/ethereum/tornado_cash_ethereum_sources.yml @@ -4,7 +4,6 @@ sources: - name: tornado_cash_ethereum tables: - name: erc20_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -13,7 +12,6 @@ sources: - name: evt_block_number - name: commitment - name: eth_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -22,7 +20,6 @@ sources: - name: evt_block_number - name: commitment - name: erc20_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -34,7 +31,6 @@ sources: - name: relayer - name: to - name: eth_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -46,7 +42,6 @@ sources: - name: relayer - name: to - name: ERC20Tornado_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -58,7 +53,6 @@ sources: - name: relayer - name: to - name: ERC20Tornado_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash diff --git a/sources/tornado_cash/gnosis/tornado_cash_gnosis_sources.yml b/sources/tornado_cash/gnosis/tornado_cash_gnosis_sources.yml index 5c2bb51107e..cb02daf43a7 100644 --- a/sources/tornado_cash/gnosis/tornado_cash_gnosis_sources.yml +++ b/sources/tornado_cash/gnosis/tornado_cash_gnosis_sources.yml @@ -4,7 +4,6 @@ sources: - name: tornado_cash_gnosis tables: - name: eth_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -13,7 +12,6 @@ sources: - name: evt_block_number - name: commitment - name: eth_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash diff --git a/sources/tornado_cash/optimism/tornado_cash_optimism_sources.yml b/sources/tornado_cash/optimism/tornado_cash_optimism_sources.yml index fac652384fa..68f127f9762 100644 --- a/sources/tornado_cash/optimism/tornado_cash_optimism_sources.yml +++ b/sources/tornado_cash/optimism/tornado_cash_optimism_sources.yml @@ -4,7 +4,6 @@ sources: - name: tornado_cash_optimism tables: - name: ETHTornado_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -15,7 +14,6 @@ sources: - name: leafIndex - name: timestamp - name: ETHTornado_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash diff --git a/sources/tornado_cash/polygon/tornado_cash_polygon_sources.yml b/sources/tornado_cash/polygon/tornado_cash_polygon_sources.yml index 9919131198e..0ae80d15451 100644 --- a/sources/tornado_cash/polygon/tornado_cash_polygon_sources.yml +++ b/sources/tornado_cash/polygon/tornado_cash_polygon_sources.yml @@ -4,7 +4,6 @@ sources: - name: tornado_cash_polygon tables: - name: TornadoCashMatic_evt_Deposit - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash @@ -15,7 +14,6 @@ sources: - name: leafIndex - name: timestamp - name: TornadoCashMatic_evt_Withdrawal - loaded_at_field: evt_block_time columns: - name: contract_address - name: evt_tx_hash diff --git a/sources/trader_joe/arbitrum/trader_joe_arbitrum_sources.yml b/sources/trader_joe/arbitrum/trader_joe_arbitrum_sources.yml index b7d336e0af3..4ccaa85728d 100644 --- a/sources/trader_joe/arbitrum/trader_joe_arbitrum_sources.yml +++ b/sources/trader_joe/arbitrum/trader_joe_arbitrum_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: trader_joe_arbitrum description: "Arbitrum chain decoded tables related to Trader Joe contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: LBPair_evt_Swap - loaded_at_field: evt_block_time description: "Liquidity book Pair swap event decoded table" columns: - &amountIn @@ -51,7 +48,6 @@ sources: description: "volatilityAccumulated" - name: LBFactory_evt_LBPairCreated - loaded_at_field: evt_block_time description: "Liquidity Book Factory pair create decoded table" columns: - &LBPair @@ -77,15 +73,11 @@ sources: - name: trader_joe_v2_1_arbitrum description: "Arbitrum chain decoded tables related to Trader Joe contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: LBPair_evt_Swap - loaded_at_field: evt_block_time description: "Liquidity book Pair swap event decoded table" - name: LBFactory_evt_LBPairCreated - loaded_at_field: evt_block_time description: "Liquidity Book Factory pair create decoded table" diff --git a/sources/trader_joe/avalanche_c/trader_joe_avalanche_c_sources.yml b/sources/trader_joe/avalanche_c/trader_joe_avalanche_c_sources.yml index 4b72f09d9c1..43c01ffcd2e 100644 --- a/sources/trader_joe/avalanche_c/trader_joe_avalanche_c_sources.yml +++ b/sources/trader_joe/avalanche_c/trader_joe_avalanche_c_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: trader_joe_avalanche_c description: "Avalanche decoded tables related to Trader Joe contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: JoePair_evt_Swap - loaded_at_field: evt_block_time description: "Pair swap event decoded table" columns: - &amount0In @@ -46,7 +43,6 @@ sources: name: to description: "Recipient" - name: JoeFactory_evt_PairCreated - loaded_at_field: evt_block_time description: "Factory pair create decoded table" columns: - &_0 @@ -67,7 +63,6 @@ sources: name: token1 description: "token 1" - name: LBPair_evt_Swap - loaded_at_field: evt_block_time description: "Liquidity book Pair swap event decoded table" columns: - &amountIn @@ -98,7 +93,6 @@ sources: name: volatilityAccumulated description: "volatilityAccumulated" - name: LBFactory_evt_LBPairCreated - loaded_at_field: evt_block_time description: "Liquidity Book Factory pair create decoded table" columns: - &LBPair @@ -124,13 +118,9 @@ sources: - name: trader_joe_v2_1_avalanche_c description: "avalanche_c chain decoded tables related to Trader Joe contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: LBPair_evt_Swap - loaded_at_field: evt_block_time description: "Liquidity book Pair swap event decoded table" - name: LBFactory_evt_LBPairCreated - loaded_at_field: evt_block_time description: "Liquidity Book Factory pair create decoded table" \ No newline at end of file diff --git a/sources/trader_joe/bnb/trader_joe_bnb_sources.yml b/sources/trader_joe/bnb/trader_joe_bnb_sources.yml index cd032b5f74a..7120ebaa4f2 100644 --- a/sources/trader_joe/bnb/trader_joe_bnb_sources.yml +++ b/sources/trader_joe/bnb/trader_joe_bnb_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: trader_joe_v2_bnb description: "BNB chain decoded tables related to Trader Joe contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: LBPair_evt_Swap - loaded_at_field: evt_block_time description: "Liquidity book Pair swap event decoded table" columns: - &amountIn @@ -51,7 +48,6 @@ sources: description: "volatilityAccumulated" - name: LBFactory_evt_LBPairCreated - loaded_at_field: evt_block_time description: "Liquidity Book Factory pair create decoded table" columns: - &LBPair @@ -77,15 +73,11 @@ sources: - name: trader_joe_v2_1_bnb description: "BNB chain decoded tables related to Trader Joe contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: LBPair_evt_Swap - loaded_at_field: evt_block_time description: "Liquidity book Pair swap event decoded table" - name: LBFactory_evt_LBPairCreated - loaded_at_field: evt_block_time description: "Liquidity Book Factory pair create decoded table" diff --git a/sources/transfers/avalanche_c/erc20/transfers_avalanche_c_sources.yml b/sources/transfers/avalanche_c/erc20/transfers_avalanche_c_sources.yml index 21c3fba0d69..6243715c281 100644 --- a/sources/transfers/avalanche_c/erc20/transfers_avalanche_c_sources.yml +++ b/sources/transfers/avalanche_c/erc20/transfers_avalanche_c_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: wavax_avalanche_c - freshness: - warn_after: { count: 12, period: hour } tables: - name: wavax_evt_deposit - loaded_at_field: evt_block_time description: "wavax deposits" columns: - &contract_address @@ -32,7 +29,6 @@ sources: description: "Raw amount of wavax" - name: wavax_evt_withdrawal - loaded_at_field: evt_block_time description: "wavax withdrawals" columns: - *contract_address diff --git a/sources/transfers/bnb/bep20/transfers_bnb_bep20_sources.yml b/sources/transfers/bnb/bep20/transfers_bnb_bep20_sources.yml index 6a1914c067a..116f2977ab1 100644 --- a/sources/transfers/bnb/bep20/transfers_bnb_bep20_sources.yml +++ b/sources/transfers/bnb/bep20/transfers_bnb_bep20_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: erc20_bnb - freshness: - warn_after: { count: 12, period: hour } tables: - name: evt_Transfer - loaded_at_field: evt_block_time description: "WBNB deposits" columns: - &contract_address @@ -35,11 +32,8 @@ sources: description: "Raw amount of BEP20 token" - name: bnb_bnb - freshness: - warn_after: { count: 12, period: hour } tables: - name: WBNB_evt_Deposit - loaded_at_field: evt_block_time description: "WBNB deposits" columns: - *contract_address @@ -55,7 +49,6 @@ sources: description: "Raw amount of WBNB" - name: WBNB_evt_Withdrawal - loaded_at_field: evt_block_time description: "WBNB withdrawals" columns: - *contract_address diff --git a/sources/transfers/ethereum/transfers_ethereum_sources.yml b/sources/transfers/ethereum/transfers_ethereum_sources.yml index 1a3a7c5fec9..5fc165d67af 100644 --- a/sources/transfers/ethereum/transfers_ethereum_sources.yml +++ b/sources/transfers/ethereum/transfers_ethereum_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: zeroex_ethereum - freshness: - warn_after: { count: 12, period: hour } tables: - name: weth9_evt_deposit - loaded_at_field: evt_block_time description: "WETH deposits" columns: - &contract_address @@ -32,7 +29,6 @@ sources: description: "Raw amount of WETH" - name: weth9_evt_withdrawal - loaded_at_field: evt_block_time description: "WETH withdrawals" columns: - *contract_address diff --git a/sources/transfers/gnosis/transfers_gnosis_erc20_sources.yml b/sources/transfers/gnosis/transfers_gnosis_erc20_sources.yml new file mode 100644 index 00000000000..6e24a785abc --- /dev/null +++ b/sources/transfers/gnosis/transfers_gnosis_erc20_sources.yml @@ -0,0 +1,98 @@ +version: 2 + +sources: + - name: wxdai_gnosis + freshness: + warn_after: { count: 12, period: hour } + tables: + - name: WXDAI_evt_Deposit + loaded_at_field: evt_block_time + description: "WXDAI deposits" + columns: + - &contract_address + name: contract_address + description: "Contract address for token" + - &dst + name: dst + description: "Wallet address for WXDAI deposits" + - &evt_block_number + name: evt_block_number + description: "Block event number" + - &evt_block_time + name: evt_block_time + description: "Timestamp for block event time in UTC" + - &evt_index + name: evt_index + description: "Event index" + - &evt_tx_hash + name: evt_tx_hash + description: "Event transaction hash" + - &wad + name: wad + description: "Raw amount of WXDAI" + + - name: WXDAI_evt_Withdrawal + loaded_at_field: evt_block_time + description: "WXDAI withdrawals" + columns: + - *contract_address + - &src + name: src + description: "Wallet address for WXDAI withdrawals" + - *evt_block_number + - *evt_block_time + - *evt_index + - *evt_tx_hash + - *wad + + - name: xdai_bridge_gnosis + freshness: + warn_after: { count: 12, period: hour } + tables: + - name: HomeBridgeErcToNative_evt_UserRequestForSignature + loaded_at_field: evt_block_time + description: "HomeBridgeErcToNative" + columns: + - *contract_address + - *evt_block_number + - *evt_block_time + - *evt_index + - *evt_tx_hash + - &evt_tx_from + name: evt_tx_from + description: "Address of sender of transaction" + - &evt_tx_to + name: evt_tx_to + description: "Address of transaction receiver" + - &recipient + name: recipient + description: "Recipient" + - &value + name: value + description: "value" + + - name: xdai_gnosis + freshness: + warn_after: { count: 12, period: hour } + tables: + - name: RewardByBlock_evt_AddedReceiver + loaded_at_field: evt_block_time + description: "HomeBridgeErcToNative" + columns: + - *contract_address + - *evt_block_number + - *evt_block_time + - *evt_index + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - &receiver + name: receiver + description: "Receiver" + - &bridge + name: bridge + description: "Bridge" + - &amount + name: amount + description: "amount" + diff --git a/sources/transfers/optimism/transfers_optimism_sources.yml b/sources/transfers/optimism/transfers_optimism_sources.yml index 115d2f7b2b3..99561454e3f 100644 --- a/sources/transfers/optimism/transfers_optimism_sources.yml +++ b/sources/transfers/optimism/transfers_optimism_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: weth_optimism - freshness: - warn_after: { count: 12, period: hour } tables: - name: weth9_evt_deposit - loaded_at_field: evt_block_time description: "WETH deposits" columns: - &contract_address @@ -32,7 +29,6 @@ sources: description: "Raw amount of WETH" - name: weth9_evt_withdrawal - loaded_at_field: evt_block_time description: "WETH withdrawals" columns: - *contract_address diff --git a/sources/transfers/polygon/erc20/transfers_polygon_erc20_sources.yml b/sources/transfers/polygon/erc20/transfers_polygon_erc20_sources.yml index 16a3141d40e..10e56c7f83e 100644 --- a/sources/transfers/polygon/erc20/transfers_polygon_erc20_sources.yml +++ b/sources/transfers/polygon/erc20/transfers_polygon_erc20_sources.yml @@ -2,11 +2,8 @@ version: 2 sources: - name: mahadao_polygon - freshness: - warn_after: { count: 12, period: hour } tables: - name: wmatic_evt_deposit - loaded_at_field: evt_block_time description: "wmatic deposits" columns: - &contract_address @@ -32,7 +29,6 @@ sources: description: "Raw amount of wmatic" - name: wmatic_evt_withdrawal - loaded_at_field: evt_block_time description: "wmatic withdrawals" columns: - *contract_address diff --git a/sources/unidex/optimism/unidex_optimism_sources.yml b/sources/unidex/optimism/unidex_optimism_sources.yml index c047b03f609..330971a491f 100644 --- a/sources/unidex/optimism/unidex_optimism_sources.yml +++ b/sources/unidex/optimism/unidex_optimism_sources.yml @@ -2,30 +2,21 @@ version: 2 sources: - name: unidex_optimism - freshness: - warn_after: { count: 12, period: hour } description: > Optimism decoded tables related to Unidex Protocol tables: - name: metaaggregator_settlement_evt_Trade - loaded_at_field: evt_block_time - name: trading_evt_NewOrder - loaded_at_field: evt_block_time description: "Details the new positions opened in V1" - name: trading_evt_ClosePosition - loaded_at_field: evt_block_time description: "Details the swaps to close existing positions in V1" - name: tradingv2_evt_NewOrder - loaded_at_field: evt_block_time description: "Details the new positions opened in V2" - name: tradingv2_evt_ClosePosition - loaded_at_field: evt_block_time description: "Details the swaps to close existing positions in V2" - name: tradingv3_evt_NewOrder - loaded_at_field: evt_block_time description: "Details the new positions opened in V3" - name: tradingv3_evt_ClosePosition - loaded_at_field: evt_block_time description: "Details the swaps to close existing positions in V3" diff --git a/sources/uniswap/arbitrum/uniswap_arbitrum_sources.yml b/sources/uniswap/arbitrum/uniswap_arbitrum_sources.yml index 92d63c72470..e8365699c8c 100644 --- a/sources/uniswap/arbitrum/uniswap_arbitrum_sources.yml +++ b/sources/uniswap/arbitrum/uniswap_arbitrum_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: uniswap_v3_arbitrum description: "Arbitrum decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount1 @@ -50,7 +47,6 @@ sources: description: the log base 1.0001 of price of the pool after the swap" - name: Factory_evt_PoolCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - name: contract_address @@ -76,16 +72,12 @@ sources: description: "The second of the two tokens in the pool" - name: Pair_evt_Flash - loaded_at_field: evt_block_time - name: uniswap_v2_arbitrum description: "arbitrum decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV2Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -106,7 +98,6 @@ sources: name: to - name: UniswapV2Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 diff --git a/sources/uniswap/avalanche_c/uniswap_avalanche_c_sources.yml b/sources/uniswap/avalanche_c/uniswap_avalanche_c_sources.yml index d4ebbf7e688..3f96e7a7d5c 100644 --- a/sources/uniswap/avalanche_c/uniswap_avalanche_c_sources.yml +++ b/sources/uniswap/avalanche_c/uniswap_avalanche_c_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: uniswap_v3_avalanche_c description: "Avalanche_c decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount1 @@ -36,7 +33,6 @@ sources: name: tick - name: UniswapV3Factory_evt_PoolCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -57,11 +53,8 @@ sources: - name: uniswap_v2_avalanche_c description: "avalanche_c decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV2Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -82,7 +75,6 @@ sources: name: to - name: UniswapV2Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 diff --git a/sources/uniswap/base/uniswap_base_sources.yml b/sources/uniswap/base/uniswap_base_sources.yml index 4b0d6d5208a..b3228b11436 100644 --- a/sources/uniswap/base/uniswap_base_sources.yml +++ b/sources/uniswap/base/uniswap_base_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: uniswap_v3_base description: "Base decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV3Pool_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount1 @@ -36,7 +33,6 @@ sources: name: tick - name: UniswapV3Factory_evt_PoolCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -57,11 +53,8 @@ sources: - name: uniswap_v2_base description: "base decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV2Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -82,7 +75,6 @@ sources: name: to - name: UniswapV2Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 diff --git a/sources/uniswap/bnb/uniswap_bnb_sources.yml b/sources/uniswap/bnb/uniswap_bnb_sources.yml index 8965041b968..5c126a7558e 100644 --- a/sources/uniswap/bnb/uniswap_bnb_sources.yml +++ b/sources/uniswap/bnb/uniswap_bnb_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: uniswap_v3_bnb description: "BNB chain decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pair_evt_Swap - loaded_at_field: evt_block_time description: "Uniswap v3 pair swap events table" columns: - &amount1 @@ -50,7 +47,6 @@ sources: description: the log base 1.0001 of price of the pool after the swap" - name: Factory_evt_PoolCreated - loaded_at_field: evt_block_time description: "Uniswap v3 Factory PoolCreated events table" columns: - name: contract_address @@ -76,15 +72,11 @@ sources: description: "The second of the two tokens in the pool" - name: Pair_evt_Flash - loaded_at_field: evt_block_time - name: uniswap_v2_bnb description: "bnb decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV2Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -105,7 +97,6 @@ sources: name: to - name: UniswapV2Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 diff --git a/sources/uniswap/celo/uniswap_celo_sources.yml b/sources/uniswap/celo/uniswap_celo_sources.yml index 53ca412b702..2cc181c07e0 100644 --- a/sources/uniswap/celo/uniswap_celo_sources.yml +++ b/sources/uniswap/celo/uniswap_celo_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: uniswap_v3_celo description: "Celo decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount1 @@ -49,7 +46,6 @@ sources: description: the log base 1.0001 of price of the pool after the swap" - name: UniswapV3Factory_evt_PoolCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - name: contract_address @@ -75,4 +71,3 @@ sources: description: "The second of the two tokens in the pool" - name: Pair_evt_Flash - loaded_at_field: evt_block_time diff --git a/sources/uniswap/ethereum/uniswap_ethereum_sources.yml b/sources/uniswap/ethereum/uniswap_ethereum_sources.yml index b54b69da10a..e6beda327a1 100644 --- a/sources/uniswap/ethereum/uniswap_ethereum_sources.yml +++ b/sources/uniswap/ethereum/uniswap_ethereum_sources.yml @@ -3,14 +3,8 @@ version: 2 sources: - name: uniswap_ethereum description: "Ethereum decoded tables related to Uniswap v1 contract" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: Exchange_evt_TokenPurchase - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time description: "" # to-do columns: - &buyer @@ -41,9 +35,6 @@ sources: description: "Raw amount of tokens bought during transaction with the contract" - name: Factory_evt_NewExchange - loaded_at_field: evt_block_time - freshness: # default freshness - warn_after: { count: 84, period: hour } description: "" # to-do columns: - name: contract_address # appears to be used differently here than the exchange event tables in uniswap v1 @@ -60,7 +51,6 @@ sources: description: "Token bought contract address" - name: Exchange_evt_EthPurchase - loaded_at_field: evt_block_time description: "" # to-do columns: - *buyer @@ -76,15 +66,11 @@ sources: name: tokens_sold description: "Raw amount of tokens sold during transaction with the contract" - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time - name: uniswap_v2_ethereum description: "Ethereum decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -106,7 +92,6 @@ sources: name: to - name: Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 @@ -125,11 +110,8 @@ sources: - name: uniswap_v3_ethereum description: "Ethereum decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount1 @@ -152,7 +134,6 @@ sources: name: tick - name: Factory_evt_PoolCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -170,7 +151,6 @@ sources: - *token1 - name: GovernorBravoDelegate_evt_VoteCast - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -187,7 +167,6 @@ sources: name: votes - name: GovernorBravoDelegate_evt_ProposalCreated - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -214,7 +193,6 @@ sources: name: values - name: GovernorBravoDelegate_evt_ProposalCanceled - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -224,7 +202,6 @@ sources: - *id - name: GovernorBravoDelegate_evt_ProposalExecuted - loaded_at_field: evt_block_time columns: - *contract_address - *evt_block_number @@ -234,7 +211,6 @@ sources: - *id - name: GovernorBravoDelegate_evt_ProposalQueued - loaded_at_field: evt_block_time columns: - *contract_address - &eta @@ -245,5 +221,4 @@ sources: - *evt_tx_hash - *id - - name: Pair_evt_Flash - loaded_at_field: evt_block_time \ No newline at end of file + - name: Pair_evt_Flash \ No newline at end of file diff --git a/sources/uniswap/optimism/uniswap_optimism_sources.yml b/sources/uniswap/optimism/uniswap_optimism_sources.yml index 53437be224b..e00014179ee 100644 --- a/sources/uniswap/optimism/uniswap_optimism_sources.yml +++ b/sources/uniswap/optimism/uniswap_optimism_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: uniswap_v3_optimism description: "Optimism decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount1 @@ -40,7 +37,6 @@ sources: name: tick - name: factory_evt_poolcreated - loaded_at_field: evt_block_time description: "" # to-do columns: - *contract_address @@ -60,15 +56,11 @@ sources: name: token1 - name: Pair_evt_Flash - loaded_at_field: evt_block_time - name: uniswap_v2_optimism description: "optimism decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV2Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -89,7 +81,6 @@ sources: name: to - name: UniswapV2Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 diff --git a/sources/uniswap/polygon/uniswap_polygon_sources.yml b/sources/uniswap/polygon/uniswap_polygon_sources.yml index 49fd30c64ee..4077afcbd63 100644 --- a/sources/uniswap/polygon/uniswap_polygon_sources.yml +++ b/sources/uniswap/polygon/uniswap_polygon_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: uniswap_v3_polygon description: "Polygon decoded tables related to Uniswap v3 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV3Pool_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount1 @@ -50,7 +47,6 @@ sources: description: the log polygon 1.0001 of price of the pool after the swap" - name: Factory_evt_PoolCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - name: contract_address @@ -76,15 +72,11 @@ sources: description: "The second of the two tokens in the pool" - name: UniswapV3Pool_evt_Flash - loaded_at_field: evt_block_time - name: uniswap_v2_polygon description: "polygon decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV2Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do columns: - &amount0In @@ -105,7 +97,6 @@ sources: name: to - name: UniswapV2Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do columns: - &_0 diff --git a/sources/uniswap/zora/uniswap_zora_sources.yml b/sources/uniswap/zora/uniswap_zora_sources.yml index 9ecda59d944..22053a721ba 100644 --- a/sources/uniswap/zora/uniswap_zora_sources.yml +++ b/sources/uniswap/zora/uniswap_zora_sources.yml @@ -3,13 +3,9 @@ version: 2 sources: - name: uniswap_v2_zora description: "zora decoded tables related to Uniswap v2 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: UniswapV2Pair_evt_Swap - loaded_at_field: evt_block_time description: "" # to-do - name: UniswapV2Factory_evt_PairCreated - loaded_at_field: evt_block_time description: "" # to-do diff --git a/sources/value_defi/ethereum/value_defi_ethereum_sources.yml b/sources/value_defi/ethereum/value_defi_ethereum_sources.yml index f6ba448a01e..c33478cd0ae 100644 --- a/sources/value_defi/ethereum/value_defi_ethereum_sources.yml +++ b/sources/value_defi/ethereum/value_defi_ethereum_sources.yml @@ -6,4 +6,3 @@ sources: Value DeFi ethereum contracts tables: - name: MerkleDistributor_evt_Claimed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/vela_exchange/arbitrum/vela_exchange_arbitrum_sources.yml b/sources/vela_exchange/arbitrum/vela_exchange_arbitrum_sources.yml index ea36f65f11c..de6693d0e19 100644 --- a/sources/vela_exchange/arbitrum/vela_exchange_arbitrum_sources.yml +++ b/sources/vela_exchange/arbitrum/vela_exchange_arbitrum_sources.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: vela_arbitrum description: arbitrum decoded tables related to Vela Exchange Protocol - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: VaultUtils_evt_IncreasePosition - loaded_at_field: evt_block_time - name: VaultUtils_evt_DecreasePosition - loaded_at_field: evt_block_time - name: VaultUtils_evt_LiquidatePosition - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/vela_exchange/base/vela_exchange_base_sources.yml b/sources/vela_exchange/base/vela_exchange_base_sources.yml index 56be8366ce3..b972f0456d9 100644 --- a/sources/vela_exchange/base/vela_exchange_base_sources.yml +++ b/sources/vela_exchange/base/vela_exchange_base_sources.yml @@ -3,14 +3,8 @@ version: 2 sources: - name: vela_exchange_base description: Base decoded tables related to Vela Exchange Protocol - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: PositionVault_evt_IncreasePosition - loaded_at_field: evt_block_time - name: PositionVault_evt_DecreasePosition - loaded_at_field: evt_block_time - name: LiquidateVault_evt_LiquidatePosition - loaded_at_field: evt_block_time diff --git a/sources/velodrome/optimism/velodrome_optimism_sources.yml b/sources/velodrome/optimism/velodrome_optimism_sources.yml index f6536ca0faf..399a6ec7027 100644 --- a/sources/velodrome/optimism/velodrome_optimism_sources.yml +++ b/sources/velodrome/optimism/velodrome_optimism_sources.yml @@ -3,24 +3,14 @@ version: 2 sources: - name: velodrome_optimism description: "decoded events and function calls for velodrome on optimism" - freshness: - warn_after: { count: 12, period: hour } tables: - name: MerkleClaim_evt_Claim - loaded_at_field: evt_block_time - name: BribeFactory_call_createExternalBribe - loaded_at_field: call_block_time - name: GaugeFactory_call_createGauge - loaded_at_field: call_block_time - name: BribeFactory_call_createInternalBribe - loaded_at_field: call_block_time - name: WrappedExternalBribeFactory_call_createBribe - loaded_at_field: call_block_time - name: velodrome_v2_optimism description: "decoded events and function calls for velodrome v2 on optimism" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Voter_evt_GaugeCreated - loaded_at_field: evt_block_time diff --git a/sources/woofi/optimism/woofi_optimism_sources.yml b/sources/woofi/optimism/woofi_optimism_sources.yml index 7b9863e6ef0..fe3a950d23f 100644 --- a/sources/woofi/optimism/woofi_optimism_sources.yml +++ b/sources/woofi/optimism/woofi_optimism_sources.yml @@ -4,14 +4,10 @@ sources: - name: woofi_optimism description: > Decoded tables related to woofi dex trades for optimism. - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: WooPPV2_evt_WooSwap description: > Main decoded table related to the swap events happening in woofi dex trades. - loaded_at_field: evt_block_time columns: - name: contract_address description: 'optimism address for the basic contract that handles the logic operation of the DEX' @@ -25,7 +21,6 @@ sources: - name: WooRouterV2_evt_WooRouterSwap description: > 'Decoded table related to swap events from the router contract that routes to 3rd party DEXs incase there is less liquidity in liquidity reserves' - loaded_at_field: evt_block_time columns: - name: contract_address description: 'optimism address for the router contract' diff --git a/sources/yearn/optimism/yearn_optimism_sources.yml b/sources/yearn/optimism/yearn_optimism_sources.yml index 4157a727f09..ff06124e87a 100644 --- a/sources/yearn/optimism/yearn_optimism_sources.yml +++ b/sources/yearn/optimism/yearn_optimism_sources.yml @@ -7,10 +7,6 @@ sources: tables: - name: ReleaseRegistry_call_newVault description: "Yearn New Vault Function Calls." - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: call_block_time columns: - &call_block_number name: call_block_number diff --git a/sources/yield_yak/arbitrum/yield_yak_arbitrum_sources.yml b/sources/yield_yak/arbitrum/yield_yak_arbitrum_sources.yml index 3e6428ed586..c536814b31f 100644 --- a/sources/yield_yak/arbitrum/yield_yak_arbitrum_sources.yml +++ b/sources/yield_yak/arbitrum/yield_yak_arbitrum_sources.yml @@ -2,169 +2,87 @@ version: 2 sources: - name: yield_yak_arbitrum - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for swaps, deposits, withdraws, reinvests and transfers on yield yak tables: - name: YakRouter_evt_YakSwap - loaded_at_field: evt_block_time - name: YakRouter_call_swapNoSplitFromAVAX - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitToAVAXWithPermit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitWithPermit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitToAVAX - loaded_at_field: call_block_time # Now the strategies - name: AutoPoolStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: AutoPoolStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: AutoPoolStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: AutoPoolStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: BoostedPendleStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: BoostedPendleStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: BoostedPendleStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: BoostedPendleStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: BoostedStargateV2NativeStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: BoostedStargateV2NativeStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: BoostedStargateV2NativeStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: BoostedStargateV2NativeStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: BoostedStargateV2Strategy_evt_Deposit - loaded_at_field: evt_block_time - name: BoostedStargateV2Strategy_evt_Withdraw - loaded_at_field: evt_block_time - name: BoostedStargateV2Strategy_evt_Reinvest - loaded_at_field: evt_block_time - name: BoostedStargateV2Strategy_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Transfer - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: GmxStrategyForGLPArbitrum_evt_Deposit - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_WTransfer - loaded_at_field: evt_block_time - name: GmxStrategyForGLPArbitrum_evt_Withdraw - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_RTransfer - loaded_at_field: evt_block_time - name: GmxStrategyForGLPArbitrum_evt_Reinvest - loaded_at_field: evt_block_time - name: GmxStrategyForGLPArbitrum_evt_Transfer - loaded_at_field: evt_block_time - name: LevelStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: LevelStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: LevelStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: LevelStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: PendleStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: PendleStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: PendleStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: PendleStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: SiloStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: SiloStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: SiloStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: SiloStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Deposit - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Withdraw - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Reinvest - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Transfer - loaded_at_field: evt_block_time - name: SushiStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: SushiStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: SushiStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: SushiStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: SynapseStrategyV2_evt_Deposit - loaded_at_field: evt_block_time - name: SynapseStrategyV2_evt_Withdraw - loaded_at_field: evt_block_time - name: SynapseStrategyV2_evt_Reinvest - loaded_at_field: evt_block_time - name: SynapseStrategyV2_evt_Transfer - loaded_at_field: evt_block_time - name: WombexStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: WombexStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: WombexStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: WombexStrategy_evt_Transfer - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/yield_yak/avalanche_c/yield_yak_avalanche_c_sources.yml b/sources/yield_yak/avalanche_c/yield_yak_avalanche_c_sources.yml index 078e9f4891a..360b00d059a 100644 --- a/sources/yield_yak/avalanche_c/yield_yak_avalanche_c_sources.yml +++ b/sources/yield_yak/avalanche_c/yield_yak_avalanche_c_sources.yml @@ -2,1001 +2,503 @@ version: 2 sources: - name: yield_yak_avalanche_c - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for swaps, deposits, withdraws, reinvests and transfers on yield yak tables: - name: YakRouter_evt_YakSwap - loaded_at_field: evt_block_time - name: YakRouter_call_swapNoSplitFromAVAX - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitToAVAXWithPermit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitWithPermit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitToAVAX - loaded_at_field: call_block_time # Now the strategies - name: AaveStrategyAvaxV1_evt_Deposit - loaded_at_field: evt_block_time - name: AaveStrategyAvaxV1_evt_Withdraw - loaded_at_field: evt_block_time - name: AaveStrategyAvaxV1_evt_Reinvest - loaded_at_field: evt_block_time - name: AaveStrategyAvaxV1_evt_Transfer - loaded_at_field: evt_block_time - name: AaveStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: AaveStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: AaveStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: AaveStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: AaveV3StrategyAvaxV1_evt_Deposit - loaded_at_field: evt_block_time - name: AaveV3StrategyAvaxV1_evt_Withdraw - loaded_at_field: evt_block_time - name: AaveV3StrategyAvaxV1_evt_Reinvest - loaded_at_field: evt_block_time - name: AaveV3StrategyAvaxV1_evt_Transfer - loaded_at_field: evt_block_time - name: AaveV3StrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: AaveV3StrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: AaveV3StrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: AaveV3StrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: AbracadabraStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: AbracadabraStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: AbracadabraStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: AbracadabraStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: AnkrAvaxPlatypusStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: AnkrAvaxPlatypusStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: AnkrAvaxPlatypusStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: AnkrAvaxPlatypusStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: AutoPoolStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: AutoPoolStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: AutoPoolStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: AutoPoolStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: AvaiStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: AvaiStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: AvaiStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: AvaiStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: AxialStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: AxialStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: AxialStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: AxialStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: AxialStrategyForMetapoolLP_evt_Deposit - loaded_at_field: evt_block_time - name: AxialStrategyForMetapoolLP_evt_Withdraw - loaded_at_field: evt_block_time - name: AxialStrategyForMetapoolLP_evt_Reinvest - loaded_at_field: evt_block_time - name: AxialStrategyForMetapoolLP_evt_Transfer - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: BalancerDirectJoinStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: BambooStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: BambooStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: BambooStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: BambooStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: BenqiStrategyAvaxV1_evt_Deposit - loaded_at_field: evt_block_time - name: BenqiStrategyAvaxV1_evt_Withdraw - loaded_at_field: evt_block_time - name: BenqiStrategyAvaxV1_evt_Reinvest - loaded_at_field: evt_block_time - name: BenqiStrategyAvaxV1_evt_Transfer - loaded_at_field: evt_block_time - name: BenqiStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: BenqiStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: BenqiStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: BenqiStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: BenqiStrategyQiV1_evt_Deposit - loaded_at_field: evt_block_time - name: BenqiStrategyQiV1_evt_Withdraw - loaded_at_field: evt_block_time - name: BenqiStrategyQiV1_evt_Reinvest - loaded_at_field: evt_block_time - name: BenqiStrategyQiV1_evt_Transfer - loaded_at_field: evt_block_time - name: BenqiStrategyQiV2_evt_Deposit - loaded_at_field: evt_block_time - name: BenqiStrategyQiV2_evt_Withdraw - loaded_at_field: evt_block_time - name: BenqiStrategyQiV2_evt_Reinvest - loaded_at_field: evt_block_time - name: BenqiStrategyQiV2_evt_Transfer - loaded_at_field: evt_block_time - name: BenqiStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: BenqiStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: BenqiStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: BenqiStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: BenqiStrategyV2_evt_Deposit - loaded_at_field: evt_block_time - name: BenqiStrategyV2_evt_Withdraw - loaded_at_field: evt_block_time - name: BenqiStrategyV2_evt_Reinvest - loaded_at_field: evt_block_time - name: BenqiStrategyV2_evt_Transfer - loaded_at_field: evt_block_time - name: BenqiStrategyV3_evt_Deposit - loaded_at_field: evt_block_time - name: BenqiStrategyV3_evt_Withdraw - loaded_at_field: evt_block_time - name: BenqiStrategyV3_evt_Reinvest - loaded_at_field: evt_block_time - name: BenqiStrategyV3_evt_Transfer - loaded_at_field: evt_block_time - name: BirdyStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: BirdyStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: BirdyStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: BirdyStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: BlizzStrategyAvaxV1_evt_Deposit - loaded_at_field: evt_block_time - name: BlizzStrategyAvaxV1_evt_Withdraw - loaded_at_field: evt_block_time - name: BlizzStrategyAvaxV1_evt_Reinvest - loaded_at_field: evt_block_time - name: BlizzStrategyAvaxV1_evt_Transfer - loaded_at_field: evt_block_time - name: BlizzStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: BlizzStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: BlizzStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: BlizzStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: BoostedJoeStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: BoostedJoeStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: BoostedJoeStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: BoostedJoeStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingBamboo_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingBamboo_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingBamboo_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingBamboo_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingBets_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingBlp_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingBlp_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingBlp_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingBlp_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingGondola_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingGondola_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingGondola_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingGondola_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingJoe_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingJoeV2_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingJoeV2_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingJoeV2_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingJoeV2_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingJoeV3_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingJoeV3_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingJoeV3_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingJoeV3_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingXava_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingXava_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingXava_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingXava_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Transfer - loaded_at_field: evt_block_time - name: CurveStrategyForLPV1_evt_Deposit - loaded_at_field: evt_block_time - name: CurveStrategyForLPV1_evt_Withdraw - loaded_at_field: evt_block_time - name: CurveStrategyForLPV1_evt_Reinvest - loaded_at_field: evt_block_time - name: CurveStrategyForLPV1_evt_Transfer - loaded_at_field: evt_block_time - name: CycleStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: CycleStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: CycleStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: CycleStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyAVAXWithSwapV2_evt_Deposit - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_WTransfer - loaded_at_field: evt_block_time - name: DexStrategyAVAXWithSwapV2_evt_Withdraw - loaded_at_field: evt_block_time - name: DeltaPrimeDepositorStrategy_evt_RTransfer - loaded_at_field: evt_block_time - name: DexStrategyAVAXWithSwapV2_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyAVAXWithSwapV2_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategySA_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategySA_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategySA_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategySA_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategySAWithSwap_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategySAWithSwap_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategySAWithSwap_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategySAWithSwap_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategySAWithSwapV2_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategySAWithSwapV2_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategySAWithSwapV2_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategySAWithSwapV2_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV2_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV2_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV2_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV2_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV3_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV3_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV3_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV3_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV4_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV4_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV4_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV4_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV5_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV5_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV5_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV5_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV5Reflection_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV5Reflection_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV5Reflection_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV5Reflection_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV5ReflectionV2_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV5ReflectionV2_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV5ReflectionV2_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV5ReflectionV2_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV6_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV6_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV6_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV6_evt_Transfer - loaded_at_field: evt_block_time - name: DexStrategyV6a_evt_Deposit - loaded_at_field: evt_block_time - name: DexStrategyV6a_evt_Withdraw - loaded_at_field: evt_block_time - name: DexStrategyV6a_evt_Reinvest - loaded_at_field: evt_block_time - name: DexStrategyV6a_evt_Transfer - loaded_at_field: evt_block_time - name: EchidnaStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: EchidnaStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: EchidnaStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: EchidnaStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: EchidnaStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: EchidnaStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: EchidnaStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: EchidnaStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: ElevenStrategyForLPV1_evt_Deposit - loaded_at_field: evt_block_time - name: ElevenStrategyForLPV1_evt_Withdraw - loaded_at_field: evt_block_time - name: ElevenStrategyForLPV1_evt_Reinvest - loaded_at_field: evt_block_time - name: ElevenStrategyForLPV1_evt_Transfer - loaded_at_field: evt_block_time - name: ElkStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: ElkStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: ElkStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: ElkStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: FrostStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: FrostStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: FrostStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: FrostStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: FrostStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: FrostStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: FrostStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: FrostStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time - name: GlacierStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: GlacierStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: GlacierStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: GlacierStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: GmxStrategyForGLP_evt_Deposit - loaded_at_field: evt_block_time - name: GmxStrategyForGLP_evt_Withdraw - loaded_at_field: evt_block_time - name: GmxStrategyForGLP_evt_Reinvest - loaded_at_field: evt_block_time - name: GmxStrategyForGLP_evt_Transfer - loaded_at_field: evt_block_time - name: GmxStrategyForGMX_evt_Deposit - loaded_at_field: evt_block_time - name: GmxStrategyForGMX_evt_Withdraw - loaded_at_field: evt_block_time - name: GmxStrategyForGMX_evt_Reinvest - loaded_at_field: evt_block_time - name: GmxStrategyForGMX_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForLPV2_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForLPV2_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForLPV2_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForLPV2_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolBTC_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolBTC_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolBTC_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolBTC_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAI_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAI_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAI_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAI_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAIeUSDTe_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAIeUSDTe_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAIeUSDTe_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolDAIeUSDTe_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolETH_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolETH_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolETH_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolETH_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolUSDT_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolUSDT_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolUSDT_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolUSDT_evt_Transfer - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolV2_evt_Deposit - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolV2_evt_Withdraw - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolV2_evt_Reinvest - loaded_at_field: evt_block_time - name: GondolaStrategyForPoolV2_evt_Transfer - loaded_at_field: evt_block_time - name: HakuStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: HakuStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: HakuStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: HakuStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: IceQueenStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: IceQueenStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: IceQueenStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: IceQueenStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: IceQueenStrategyV2_evt_Deposit - loaded_at_field: evt_block_time - name: IceQueenStrategyV2_evt_Withdraw - loaded_at_field: evt_block_time - name: IceQueenStrategyV2_evt_Reinvest - loaded_at_field: evt_block_time - name: IceQueenStrategyV2_evt_Transfer - loaded_at_field: evt_block_time - name: IceQueenStrategyV2b_evt_Deposit - loaded_at_field: evt_block_time - name: IceQueenStrategyV2b_evt_Withdraw - loaded_at_field: evt_block_time - name: IceQueenStrategyV2b_evt_Reinvest - loaded_at_field: evt_block_time - name: IceQueenStrategyV2b_evt_Transfer - loaded_at_field: evt_block_time - name: JoeLendingStrategyAvaxV1_evt_Deposit - loaded_at_field: evt_block_time - name: JoeLendingStrategyAvaxV1_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeLendingStrategyAvaxV1_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeLendingStrategyAvaxV1_evt_Transfer - loaded_at_field: evt_block_time - name: JoeLendingStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: JoeLendingStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeLendingStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeLendingStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: JoeLendingStrategyV2_evt_Deposit - loaded_at_field: evt_block_time - name: JoeLendingStrategyV2_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeLendingStrategyV2_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeLendingStrategyV2_evt_Transfer - loaded_at_field: evt_block_time - name: JoeStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: JoeStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: JoeStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: JoeStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: JoeStrategyV2_evt_Deposit - loaded_at_field: evt_block_time - name: JoeStrategyV2_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeStrategyV2_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeStrategyV2_evt_Transfer - loaded_at_field: evt_block_time - name: JoeStrategyV3_evt_Deposit - loaded_at_field: evt_block_time - name: JoeStrategyV3_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeStrategyV3_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeStrategyV3_evt_Transfer - loaded_at_field: evt_block_time - name: JoeStrategyV4_evt_Deposit - loaded_at_field: evt_block_time - name: JoeStrategyV4_evt_Withdraw - loaded_at_field: evt_block_time - name: JoeStrategyV4_evt_Reinvest - loaded_at_field: evt_block_time - name: JoeStrategyV4_evt_Transfer - loaded_at_field: evt_block_time - name: KassandraIndexStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: KassandraIndexStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: KassandraIndexStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: KassandraIndexStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: KassandraIndexStrategyK3C_evt_Deposit - loaded_at_field: evt_block_time - name: KassandraIndexStrategyK3C_evt_Withdraw - loaded_at_field: evt_block_time - name: KassandraIndexStrategyK3C_evt_Reinvest - loaded_at_field: evt_block_time - name: KassandraIndexStrategyK3C_evt_Transfer - loaded_at_field: evt_block_time - name: KassandraStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: KassandraStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: KassandraStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: KassandraStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: KassandraStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: KassandraStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: KassandraStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: KassandraStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time - name: LydiaStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: LydiaStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: LydiaStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: LydiaStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: LydiaStrategyForLPa_evt_Deposit - loaded_at_field: evt_block_time - name: LydiaStrategyForLPa_evt_Withdraw - loaded_at_field: evt_block_time - name: LydiaStrategyForLPa_evt_Reinvest - loaded_at_field: evt_block_time - name: LydiaStrategyForLPa_evt_Transfer - loaded_at_field: evt_block_time - name: LydiaStrategyForLPb_evt_Deposit - loaded_at_field: evt_block_time - name: LydiaStrategyForLPb_evt_Withdraw - loaded_at_field: evt_block_time - name: LydiaStrategyForLPb_evt_Reinvest - loaded_at_field: evt_block_time - name: LydiaStrategyForLPb_evt_Transfer - loaded_at_field: evt_block_time - name: MarginswapStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: MarginswapStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: MarginswapStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: MarginswapStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: MasterYakStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: MasterYakStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: MasterYakStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: MasterYakStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: MasterYakStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: MasterYakStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: MasterYakStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: MasterYakStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time - name: MemeRushStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: MemeRushStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: MemeRushStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: MemeRushStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: MoreMoneyStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: MoreMoneyStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: MoreMoneyStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: MoreMoneyStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: OliveStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: OliveStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: OliveStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: OliveStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: OliveStrategyForLPa_evt_Deposit - loaded_at_field: evt_block_time - name: OliveStrategyForLPa_evt_Withdraw - loaded_at_field: evt_block_time - name: OliveStrategyForLPa_evt_Reinvest - loaded_at_field: evt_block_time - name: OliveStrategyForLPa_evt_Transfer - loaded_at_field: evt_block_time - name: OliveStrategyForLPb_evt_Deposit - loaded_at_field: evt_block_time - name: OliveStrategyForLPb_evt_Withdraw - loaded_at_field: evt_block_time - name: OliveStrategyForLPb_evt_Reinvest - loaded_at_field: evt_block_time - name: OliveStrategyForLPb_evt_Transfer - loaded_at_field: evt_block_time - name: OliveStrategyForLPc_evt_Deposit - loaded_at_field: evt_block_time - name: OliveStrategyForLPc_evt_Withdraw - loaded_at_field: evt_block_time - name: OliveStrategyForLPc_evt_Reinvest - loaded_at_field: evt_block_time - name: OliveStrategyForLPc_evt_Transfer - loaded_at_field: evt_block_time - name: OliveStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: OliveStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: OliveStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: OliveStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time - name: PangolinV2StrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: PangolinV2StrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: PangolinV2StrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: PangolinV2StrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: PangolinV2VariableRewardsStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: PangolinV2VariableRewardsStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: PangolinV2VariableRewardsStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: PangolinV2VariableRewardsStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: PenguinStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: PenguinStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: PenguinStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: PenguinStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: PenguinStrategyForLPb_evt_Deposit - loaded_at_field: evt_block_time - name: PenguinStrategyForLPb_evt_Withdraw - loaded_at_field: evt_block_time - name: PenguinStrategyForLPb_evt_Reinvest - loaded_at_field: evt_block_time - name: PenguinStrategyForLPb_evt_Transfer - loaded_at_field: evt_block_time - name: PlatypusStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: PlatypusStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: PlatypusStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: PlatypusStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: SonicStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: SonicStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: SonicStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: SonicStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3D_evt_Deposit - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3D_evt_Withdraw - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3D_evt_Reinvest - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3D_evt_Transfer - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3F_evt_Deposit - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3F_evt_Withdraw - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3F_evt_Reinvest - loaded_at_field: evt_block_time - name: StableVaultStrategyForS3F_evt_Transfer - loaded_at_field: evt_block_time - name: StargateStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: StargateStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: StargateStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: StargateStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Deposit - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Withdraw - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Reinvest - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Transfer - loaded_at_field: evt_block_time - name: StormStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: StormStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: StormStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: StormStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: StormStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: StormStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: StormStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: StormStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time - name: SuStrategyV2_evt_Deposit - loaded_at_field: evt_block_time - name: SuStrategyV2_evt_Withdraw - loaded_at_field: evt_block_time - name: SuStrategyV2_evt_Reinvest - loaded_at_field: evt_block_time - name: SuStrategyV2_evt_Transfer - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: SynapseStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: UnipoolStrategyV1_evt_Deposit - loaded_at_field: evt_block_time - name: UnipoolStrategyV1_evt_Withdraw - loaded_at_field: evt_block_time - name: UnipoolStrategyV1_evt_Reinvest - loaded_at_field: evt_block_time - name: UnipoolStrategyV1_evt_Transfer - loaded_at_field: evt_block_time - name: UspPlatypusStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: UspPlatypusStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: UspPlatypusStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: UspPlatypusStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: Vault_evt_Deposit - loaded_at_field: evt_block_time - name: Vault_evt_Withdraw - loaded_at_field: evt_block_time - name: Vault_evt_Reinvest - loaded_at_field: evt_block_time - name: Vault_evt_Transfer - loaded_at_field: evt_block_time - name: VectorStrategyForDexLP_evt_Deposit - loaded_at_field: evt_block_time - name: VectorStrategyForDexLP_evt_Withdraw - loaded_at_field: evt_block_time - name: VectorStrategyForDexLP_evt_Reinvest - loaded_at_field: evt_block_time - name: VectorStrategyForDexLP_evt_Transfer - loaded_at_field: evt_block_time - name: VectorStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: VectorStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: VectorStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: VectorStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time - name: VectorStrategyForSAV2_evt_Deposit - loaded_at_field: evt_block_time - name: VectorStrategyForSAV2_evt_Withdraw - loaded_at_field: evt_block_time - name: VectorStrategyForSAV2_evt_Reinvest - loaded_at_field: evt_block_time - name: VectorStrategyForSAV2_evt_Transfer - loaded_at_field: evt_block_time - name: WombatStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: WombatStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: WombatStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: WombatStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: WoofiSuperchargerStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: WoofiSuperchargerStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: WoofiSuperchargerStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: WoofiSuperchargerStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: XavaStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: XavaStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: XavaStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: XavaStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: YYAvaxJoeStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: YYAvaxJoeStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: YYAvaxJoeStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: YYAvaxJoeStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: YYAvaxPlatypusStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: YYAvaxPlatypusStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: YYAvaxPlatypusStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: YYAvaxPlatypusStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: YetiStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: YetiStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: YetiStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: YetiStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: ZabuStrategyForLP_evt_Deposit - loaded_at_field: evt_block_time - name: ZabuStrategyForLP_evt_Withdraw - loaded_at_field: evt_block_time - name: ZabuStrategyForLP_evt_Reinvest - loaded_at_field: evt_block_time - name: ZabuStrategyForLP_evt_Transfer - loaded_at_field: evt_block_time - name: ZabuStrategyForSA_evt_Deposit - loaded_at_field: evt_block_time - name: ZabuStrategyForSA_evt_Withdraw - loaded_at_field: evt_block_time - name: ZabuStrategyForSA_evt_Reinvest - loaded_at_field: evt_block_time - name: ZabuStrategyForSA_evt_Transfer - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/yield_yak/mantle/yield_yak_mantle_sources.yml b/sources/yield_yak/mantle/yield_yak_mantle_sources.yml index 9e761493733..75c05366854 100644 --- a/sources/yield_yak/mantle/yield_yak_mantle_sources.yml +++ b/sources/yield_yak/mantle/yield_yak_mantle_sources.yml @@ -2,69 +2,37 @@ version: 2 sources: - name: yield_yak_mantle - freshness: - warn_after: { count: 12, period: hour } description: > Decoded event tables for swaps, deposits, withdraws, reinvests and transfers on yield yak tables: - name: YakRouter_evt_YakSwap - loaded_at_field: evt_block_time - name: YakRouter_call_swapNoSplitFromAVAX - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitToAVAXWithPermit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitWithPermit - loaded_at_field: call_block_time - name: YakRouter_call_swapNoSplitToAVAX - loaded_at_field: call_block_time # Now the strategies - name: CompoundingJoeMantle_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingJoeMantle_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingJoeMantle_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingJoeMantle_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingMoe_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingMoe_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingMoe_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingMoe_evt_Transfer - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Deposit - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Withdraw - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Reinvest - loaded_at_field: evt_block_time - name: CompoundingYYStaking_evt_Transfer - loaded_at_field: evt_block_time - name: LendleStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: LendleStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: LendleStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: LendleStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: MoeStrategy_evt_Deposit - loaded_at_field: evt_block_time - name: MoeStrategy_evt_Withdraw - loaded_at_field: evt_block_time - name: MoeStrategy_evt_Reinvest - loaded_at_field: evt_block_time - name: MoeStrategy_evt_Transfer - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Deposit - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Withdraw - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Reinvest - loaded_at_field: evt_block_time - name: StargateV2Strategy_evt_Transfer - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zerion/arbitrum/zerion_arbitrum_sources.yml b/sources/zerion/arbitrum/zerion_arbitrum_sources.yml index d88c60450f7..b102b1b8857 100644 --- a/sources/zerion/arbitrum/zerion_arbitrum_sources.yml +++ b/sources/zerion/arbitrum/zerion_arbitrum_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: zerion_arbitrum description: "Zerion contracts on Arbitrum" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Router_evt_Executed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zerion/avalanche_c/zerion_avalanche_c_sources.yml b/sources/zerion/avalanche_c/zerion_avalanche_c_sources.yml index 4cc27d3ae59..812a8733105 100644 --- a/sources/zerion/avalanche_c/zerion_avalanche_c_sources.yml +++ b/sources/zerion/avalanche_c/zerion_avalanche_c_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: zerion_avalanche_c description: "Zerion contracts on Avalanche" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Router_evt_Executed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zerion/bnb/zerion_bnb_sources.yml b/sources/zerion/bnb/zerion_bnb_sources.yml index 692eeb7fec7..92e6d5d6832 100644 --- a/sources/zerion/bnb/zerion_bnb_sources.yml +++ b/sources/zerion/bnb/zerion_bnb_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: zerion_bnb description: "Zerion contracts on Ethereum" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Router_evt_Executed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zerion/fantom/zerion_fantom_sources.yml b/sources/zerion/fantom/zerion_fantom_sources.yml index b777c86ed72..b22a70765d2 100644 --- a/sources/zerion/fantom/zerion_fantom_sources.yml +++ b/sources/zerion/fantom/zerion_fantom_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: zerion_fantom description: "Zerion contracts on Fantom" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Router_evt_Executed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zerion/gnosis/zerion_gnosis_sources.yml b/sources/zerion/gnosis/zerion_gnosis_sources.yml index 39bbece3e8e..ee3fce46391 100644 --- a/sources/zerion/gnosis/zerion_gnosis_sources.yml +++ b/sources/zerion/gnosis/zerion_gnosis_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: zerion_gnosis description: "Zerion contracts on Gnosis" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Router_evt_Executed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zerion/optimism/zerion_optimism_sources.yml b/sources/zerion/optimism/zerion_optimism_sources.yml index 18870364c6f..fa9ea9415b2 100644 --- a/sources/zerion/optimism/zerion_optimism_sources.yml +++ b/sources/zerion/optimism/zerion_optimism_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: zerion_optimism description: "Zerion contracts on Optimism" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Router_evt_Executed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zerion/polygon/zerion_polygon_sources.yml b/sources/zerion/polygon/zerion_polygon_sources.yml index c70d0410f0b..e0e8aa08831 100644 --- a/sources/zerion/polygon/zerion_polygon_sources.yml +++ b/sources/zerion/polygon/zerion_polygon_sources.yml @@ -3,8 +3,5 @@ version: 2 sources: - name: zerion_polygon description: "Zerion contracts on Polygon" - freshness: - warn_after: { count: 12, period: hour } tables: - name: Router_evt_Executed - loaded_at_field: evt_block_time \ No newline at end of file diff --git a/sources/zeroex/arbitrum/zeroex_arbitrum_sources.yml b/sources/zeroex/arbitrum/zeroex_arbitrum_sources.yml index 030490628d9..5d27b722d66 100644 --- a/sources/zeroex/arbitrum/zeroex_arbitrum_sources.yml +++ b/sources/zeroex/arbitrum/zeroex_arbitrum_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_arbitrum description: "arbitrum decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_LimitOrderFilled @@ -17,6 +14,5 @@ sources: # for native orders on v3 - name: zeroex_v3_arbitrum description: "arbitrum decoded tables related to 0x v3 Exchange Contract" - loaded_at_field: evt_block_time tables: - name: Exchange_evt_Fill \ No newline at end of file diff --git a/sources/zeroex/avalanche_c/zeroex_avalanche_c_sources.yml b/sources/zeroex/avalanche_c/zeroex_avalanche_c_sources.yml index 539e9899a7a..04c5f0583db 100644 --- a/sources/zeroex/avalanche_c/zeroex_avalanche_c_sources.yml +++ b/sources/zeroex/avalanche_c/zeroex_avalanche_c_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_avalanche_c description: "avalanche decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_LimitOrderFilled @@ -17,6 +14,5 @@ sources: # for native orders on v3 - name: zeroex_v3_avalanche description: "avalanche decoded tables related to 0x v3 Exchange Contract" - loaded_at_field: evt_block_time tables: - name: Exchange_evt_Fill \ No newline at end of file diff --git a/sources/zeroex/base/zeroex_base_sources.yml b/sources/zeroex/base/zeroex_base_sources.yml index 9a7da3f7330..e4d112afb18 100644 --- a/sources/zeroex/base/zeroex_base_sources.yml +++ b/sources/zeroex/base/zeroex_base_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_base description: "base decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_TransformedERC20 \ No newline at end of file diff --git a/sources/zeroex/bnb/zeroex_bnb_sources.yml b/sources/zeroex/bnb/zeroex_bnb_sources.yml index 469102d0aae..28d05e2396d 100644 --- a/sources/zeroex/bnb/zeroex_bnb_sources.yml +++ b/sources/zeroex/bnb/zeroex_bnb_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_bnb description: "bnb decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_LimitOrderFilled @@ -17,7 +14,6 @@ sources: # for native orders on v2 - name: zeroex_v2_bnb description: "bnb decoded tables related to 0x v3 Exchange Contract" - loaded_at_field: evt_block_time tables: - name: Exchange_evt_Fill diff --git a/sources/zeroex/celo/zeroex_celo_sources.yml b/sources/zeroex/celo/zeroex_celo_sources.yml index 5488a50c1d3..6219702cec3 100644 --- a/sources/zeroex/celo/zeroex_celo_sources.yml +++ b/sources/zeroex/celo/zeroex_celo_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_celo description: "celo decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_LimitOrderFilled @@ -17,6 +14,5 @@ sources: # for native orders on v3 - name: zeroex_v3_celo description: "celo decoded tables related to 0x v3 Exchange Contract" - loaded_at_field: evt_block_time tables: - name: Exchange_evt_Fill \ No newline at end of file diff --git a/sources/zeroex/ethereum/zeroex_ethereum_sources.yml b/sources/zeroex/ethereum/zeroex_ethereum_sources.yml index 9b6a5ea7f90..3b7b2d6b1fa 100644 --- a/sources/zeroex/ethereum/zeroex_ethereum_sources.yml +++ b/sources/zeroex/ethereum/zeroex_ethereum_sources.yml @@ -4,11 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_ethereum description: "Ethereum decoded tables related to 0x Exchange Proxy (v4)" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time - tables: - name: ExchangeProxy_evt_LimitOrderFilled - name: ExchangeProxy_evt_OtcOrderFilled @@ -20,25 +15,13 @@ sources: # for native orders on v2 - name: zeroex_v2_ethereum description: "Ethereum decoded tables related to 0x Exchange Proxy (v2)" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time - tables: - name: Exchange2_0_evt_Fill - loaded_at_field: evt_block_time - name: Exchange2_1_evt_Fill - loaded_at_field: evt_block_time # for native orders on v3 - name: zeroex_v3_ethereum description: "Ethereum decoded tables related to 0x v3 Exchange Contract" - freshness: - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } - loaded_at_field: evt_block_time - tables: - name: Exchange_evt_Fill @@ -51,20 +34,12 @@ sources: # - name: Factory_evt_PairCreated # - name: sushi_ethereum - # freshness: - # warn_after: { count: 12, period: hour } - # loaded_at_field: evt_block_time - - # tables: + # # tables: # - name: Pair_evt_Swap # - name: Factory_evt_PairCreated # - name: uniswap_v3_ethereum - # freshness: - # warn_after: { count: 12, period: hour } - # loaded_at_field: evt_block_time - - # tables: + # # tables: # - name: Pair_evt_Swap # - name: Factory_evt_PoolCreated ### already defined ### diff --git a/sources/zeroex/fantom/zeroex_fantom_sources.yml b/sources/zeroex/fantom/zeroex_fantom_sources.yml index 1e6a06ce70c..c3ff4ce2796 100644 --- a/sources/zeroex/fantom/zeroex_fantom_sources.yml +++ b/sources/zeroex/fantom/zeroex_fantom_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_fantom description: "fantom decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_LimitOrderFilled @@ -17,6 +14,5 @@ sources: # for native orders on v3 - name: zeroex_v3_fantom description: "fantom decoded tables related to 0x v3 Exchange Contract" - loaded_at_field: evt_block_time tables: - name: Exchange_evt_Fill \ No newline at end of file diff --git a/sources/zeroex/optimism/zeroex_optimism_sources.yml b/sources/zeroex/optimism/zeroex_optimism_sources.yml index 324293b0023..47ac917f2cb 100644 --- a/sources/zeroex/optimism/zeroex_optimism_sources.yml +++ b/sources/zeroex/optimism/zeroex_optimism_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_optimism description: "Optimism decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_LimitOrderFilled @@ -17,6 +14,5 @@ sources: # for native orders on v3 - name: zeroex_v3_optimism description: "Optimism decoded tables related to 0x v3 Exchange Contract" - loaded_at_field: evt_block_time tables: - name: Exchange_evt_Fill \ No newline at end of file diff --git a/sources/zeroex/polygon/zeroex_polygon_sources.yml b/sources/zeroex/polygon/zeroex_polygon_sources.yml index 4b1d13d39eb..055b0d2867e 100644 --- a/sources/zeroex/polygon/zeroex_polygon_sources.yml +++ b/sources/zeroex/polygon/zeroex_polygon_sources.yml @@ -4,9 +4,6 @@ sources: # for native orders on v4 + PLP VIP - name: zeroex_polygon description: "Polygon decoded tables related to 0x Exchange Proxy (v4)" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: ExchangeProxy_evt_LimitOrderFilled @@ -27,9 +24,6 @@ sources: # for native orders on v3 - name: zeroex_v3_polygon description: "Polygon decoded tables related to 0x v3 Exchange Contract" - freshness: - warn_after: { count: 12, period: hour } - loaded_at_field: evt_block_time tables: - name: Exchange_evt_Fill diff --git a/sources/zigzag/arbitrum/zigzag_arbitrum_sources.yml b/sources/zigzag/arbitrum/zigzag_arbitrum_sources.yml index c4bcf8d1431..86242b809ae 100644 --- a/sources/zigzag/arbitrum/zigzag_arbitrum_sources.yml +++ b/sources/zigzag/arbitrum/zigzag_arbitrum_sources.yml @@ -3,11 +3,8 @@ version: 2 sources: - name: zigzag_test_v6_arbitrum description: "Arbitrum decoded tables related to Zigzag v1 contract" - freshness: - warn_after: { count: 12, period: hour } tables: - name: zigzag_settelment_call_matchOrders - loaded_at_field: call_block_time description: "" # to-do columns: - &call_block_number diff --git a/sources/zora/optimism/zora_optimism_edition_metadata_sources.yml b/sources/zora/optimism/zora_optimism_edition_metadata_sources.yml index f5975aeacd3..9c824fbaad5 100644 --- a/sources/zora/optimism/zora_optimism_edition_metadata_sources.yml +++ b/sources/zora/optimism/zora_optimism_edition_metadata_sources.yml @@ -3,13 +3,7 @@ version: 2 sources: - name: zora_optimism description: "op mainnet decoded tables related to zora contracts" - freshness: # default freshness - warn_after: { count: 12, period: hour } - error_after: { count: 24, period: hour } tables: - name: ZoraNFTCreatorProxy_call_createDrop - loaded_at_field: call_block_time - name: ZoraNFTCreatorProxy_call_createEdition - loaded_at_field: call_block_time - - name: ZoraCreator1155Factory_call_createContract - loaded_at_field: call_block_time \ No newline at end of file + - name: ZoraCreator1155Factory_call_createContract \ No newline at end of file