diff --git a/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_interest_rates.sql b/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_interest_rates.sql new file mode 100644 index 00000000000..236a5883414 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_interest_rates.sql @@ -0,0 +1,26 @@ +{{ config( + schema = 'aave_base' + , alias = 'interest_rates' + , post_hook='{{ expose_spells(blockchains = \'["base"]\', + spell_type = "project", + spell_name = "aave", + contributors = \'["mikeghen1","batwayne", "chuxin"]\') }}' + ) +}} + +SELECT * +FROM +( + SELECT + reserve, + symbol, + hour, + deposit_apy, + stable_borrow_apy, + variable_borrow_apy + FROM {{ ref('aave_v3_base_interest_rates') }} + /* + UNION ALL + < add new version as needed + */ +) diff --git a/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_schema.yml b/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_schema.yml index d08a831c95d..4b7197c5e8b 100644 --- a/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/aave/base/aave_base_schema.yml @@ -54,3 +54,59 @@ models: - &evt_index name: evt_index description: "Event index" + + - name: aave_v3_base_interest_rates + meta: + blockchain: base + sector: lending + project: aave_v3 + contributors: mikeghen1, batwayne, chuxin + config: + tags: ['base', 'aave_v3', 'interest', 'aave', 'lending'] + description: "Hourly aave interest rates on base" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - reserve + - symbol + - hour + columns: + - &reserve + name: reserve + description: "Aave reserve contract address" + - *symbol + - &hour + name: hour + description: "Block timestamp truncated to hours" + - &deposit_apy + name: deposit_apy + description: "Hourly deposit interest rate value of the reserve" + - &stable_borrow_apy + name: stable_borrow_apy + description: "Hourly stable borrow interest rate value of the reserve" + - &variable_borrow_apy + name: variable_borrow_apy + description: "Hourly variable borrow interest rate value of the reserve" + + - name: aave_base_interest_rates + meta: + blockchain: base + sector: lending + project: aave + contributors: mikeghen1, batwayne, chuxin + config: + tags: ['base', 'aave_v3', 'interest', 'aave', 'lending'] + description: "Hourly aave interest rates on base" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - reserve + - symbol + - hour + columns: + - *reserve + - *symbol + - *hour + - *deposit_apy + - *stable_borrow_apy + - *variable_borrow_apy diff --git a/dbt_subprojects/daily_spellbook/models/aave/base/aave_v3_base_interest_rates.sql b/dbt_subprojects/daily_spellbook/models/aave/base/aave_v3_base_interest_rates.sql new file mode 100644 index 00000000000..195450220e4 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/aave/base/aave_v3_base_interest_rates.sql @@ -0,0 +1,28 @@ +{{ config( + schema = 'aave_v3_base' + , alias = 'interest_rates' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['reserve', 'symbol', 'hour'] + , post_hook='{{ expose_spells(blockchains = \'["base"]\', + spell_type = "project", + spell_name = "aave_v3", + contributors = \'["mikeghen1","batwayne", "chuxin"]\') }}' + ) +}} + +select + a.reserve, + t.symbol, + date_trunc('hour',a.evt_block_time) as hour, + avg(CAST(a.liquidityRate AS DOUBLE)) / 1e27 as deposit_apy, + avg(CAST(a.stableBorrowRate AS DOUBLE)) / 1e27 as stable_borrow_apy, + avg(CAST(a.variableBorrowRate AS DOUBLE)) / 1e27 as variable_borrow_apy +from {{ source('aave_v3_base', 'L2Pool_evt_ReserveDataUpdated') }} a +left join {{ source('tokens', 'erc20') }} t +on a.reserve = t.contract_address and t.blockchain = 'base' +{% if is_incremental() %} + WHERE {{ incremental_predicate('evt_block_time') }} +{% endif %} +group by 1,2,3 diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql index 9a2a98639a3..51475264c80 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql @@ -22,6 +22,7 @@ , "ronin" , "scroll" , "sei" + , "sonic" , "viction" , "worldchain" , "zksync" @@ -95,4 +96,5 @@ FROM ( , (2020, 'ronin', 'Ronin', 'Layer 1', null, 'RON', 0xe514d9deb7966c8be0ca922de8a064264ea6bcd4, 'https://app.roninchain.com/', timestamp '2021-01-25 10:49', NULL, NULL, NULL, true) , (14, 'flare', 'Flare', 'Layer 1', NULL, 'FLR', NULL, 'https://flare-explorer.flare.network/', timestamp '2022-07-13 15:32', NULL, NULL, NULL, true) , (88, 'viction', 'Viction', 'Layer 1', NULL, 'VIC', 0xC054751BdBD24Ae713BA3Dc9Bd9434aBe2abc1ce, 'https://vicscan.xyz/', timestamp '2018-12-14 07:50:20', NULL, NULL, NULL, true) + , (146, 'sonic', 'Sonic', 'Layer 1', NULL, 'SONIC', NULL, 'https://sonicscan.org/', timestamp '2024-12-01 00:00', NULL, NULL, NULL, true) ) AS temp_table (chain_id, blockchain, name, chain_type, rollup_type, native_token_symbol, wrapped_native_token_address, explorer_link, first_block_time, codebase, data_availability, settlement, is_on_dune) diff --git a/dbt_subprojects/daily_spellbook/tests/aave/base/aave_base_interests_test.sql b/dbt_subprojects/daily_spellbook/tests/aave/base/aave_base_interests_test.sql new file mode 100644 index 00000000000..829be379215 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/tests/aave/base/aave_base_interests_test.sql @@ -0,0 +1,25 @@ +with unit_test1 + as (select case + when abs(variable_borrow_apy - 0.10808360395679557) / 0.10808360395679557 < 0.001 + then true + else false + end as test + from {{ ref('aave_v3_base_interest_rates' )}} + where reserve = 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 -- USDC + and hour = TIMESTAMP '2025-01-02 20:00'), + unit_test2 + as (select case + when abs(deposit_apy - 0.015712521763084) / 0.015712521763084 < 0.001 + then true + else false + end as test + from {{ ref('aave_v3_base_interest_rates' )}} + where symbol = 'WETH' -- 0x4200000000000000000000000000000000000006 + and hour = TIMESTAMP '2024-08-21 03:00') +select * +from (select * + from unit_test1 + union + select * + from unit_test2) +where test = false \ 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 fde1b6d7532..9648dedd6a4 100644 --- a/dbt_subprojects/dex/models/trades/base/_schema.yml +++ b/dbt_subprojects/dex/models/trades/base/_schema.yml @@ -46,7 +46,7 @@ models: blockchain: base sector: dex project: stablebase - contributors: principatel + contributors: principatel, hosuke config: tags: ["base", "dex", "trades", "stablebase"] description: stablebase base trades diff --git a/dbt_subprojects/dex/models/trades/base/platforms/stablebase_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/platforms/stablebase_base_base_trades.sql index f2c2df02aef..99adc687c28 100644 --- a/dbt_subprojects/dex/models/trades/base/platforms/stablebase_base_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/base/platforms/stablebase_base_base_trades.sql @@ -8,6 +8,11 @@ unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index'] ) }} +-- Id mapping: +-- 0 USDbC https://basescan.org/token/0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca +-- 1 DAI https://basescan.org/token/0x50c5725949a6f0c72e6c4a641f24049a917db0cb +-- 2 axlUSDC https://basescan.org/token/0xeb466342c4d449bc9f53a865d5cb90586f405215 + WITH token_swaps AS ( SELECT evt_block_number AS block_number, @@ -16,8 +21,16 @@ WITH token_swaps AS ( evt_tx_to AS taker, tokensSold AS token_sold_amount_raw, tokensBought AS token_bought_amount_raw, - CAST(soldId AS varbinary) AS token_sold_address, - CAST(boughtId AS varbinary) AS token_bought_address, + CASE soldId + WHEN 0 THEN 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca + WHEN 1 THEN 0x50c5725949a6f0c72e6c4a641f24049a917db0cb + WHEN 2 THEN 0xeb466342c4d449bc9f53a865d5cb90586f405215 + END AS token_sold_address, + CASE boughtId + WHEN 0 THEN 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca + WHEN 1 THEN 0x50c5725949a6f0c72e6c4a641f24049a917db0cb + WHEN 2 THEN 0xeb466342c4d449bc9f53a865d5cb90586f405215 + END AS token_bought_address, contract_address AS project_contract_address, evt_tx_hash AS tx_hash, evt_index AS evt_index diff --git a/dbt_subprojects/dex/models/trades/ethereum/_schema.yml b/dbt_subprojects/dex/models/trades/ethereum/_schema.yml index 5b33a0992c0..a88f3145e99 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/_schema.yml +++ b/dbt_subprojects/dex/models/trades/ethereum/_schema.yml @@ -188,6 +188,7 @@ models: version: - 2 - mmpool + - pcsx - name: shibaswap_v1_ethereum_base_trades meta: 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 7ab786f47ad..c06b00933e9 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,6 +25,44 @@ dexs_macro AS ( }} ), +transfer as ( + select * from {{ source('tokens', 'transfers') }} + where blockchain = 'ethereum' + and block_date >= date '2024-09-20' + and tx_hash in (select evt_tx_hash from {{ source('pancakeswap_ethereum', 'ExclusiveDutchOrderReactor_evt_Fill') }}) + {% if is_incremental() %} + and {{ incremental_predicate('block_time') }} + {% endif %} +), + +dexs_pcsx AS ( + -- PancakeSwapX + SELECT + 'pcsx' AS version, + a.evt_block_number AS block_number, + a.evt_block_time AS block_time, + a.swapper AS taker, + a.filler AS maker, + receive.amount_raw AS token_bought_amount_raw, + send.amount_raw AS token_sold_amount_raw, + receive.contract_address AS token_bought_address, + send.contract_address AS token_sold_address, + a.contract_address AS project_contract_address, + a.evt_tx_hash AS tx_hash, + a.evt_index + + FROM {{ source('pancakeswap_ethereum', 'ExclusiveDutchOrderReactor_evt_Fill') }} a + + LEFT JOIN transfer AS send + ON a.evt_tx_hash = send.tx_hash AND a.swapper = send."from" + + LEFT JOIN transfer AS receive + on a.evt_tx_hash = receive.tx_hash AND a.swapper = receive."to" + {% if is_incremental() %} + WHERE {{ incremental_predicate('a.evt_block_time') }} + {% endif %} +), + dexs_mm AS ( -- PancakeSwap v2 MMPool SELECT @@ -129,3 +167,24 @@ SELECT dexs_ss.tx_hash, dexs_ss.evt_index FROM dexs_ss +UNION ALL +SELECT + 'ethereum' AS blockchain, + 'pancakeswap' AS project, + dexs_pcsx.version, + CAST(date_trunc('month', dexs_pcsx.block_time) AS date) AS block_month, + CAST(date_trunc('day', dexs_pcsx.block_time) AS date) AS block_date, + dexs_pcsx.block_time, + dexs_pcsx.block_number, + dexs_pcsx.token_bought_amount_raw, + dexs_pcsx.token_sold_amount_raw, + dexs_pcsx.token_bought_address, + dexs_pcsx.token_sold_address, + dexs_pcsx.taker, + dexs_pcsx.maker, + dexs_pcsx.project_contract_address, + dexs_pcsx.tx_hash, + dexs_pcsx.evt_index +FROM dexs_pcsx +WHERE token_sold_amount_raw > 0 +AND token_bought_amount_raw > 0 \ No newline at end of file diff --git a/dbt_subprojects/dex/models/trades/optimism/_schema.yml b/dbt_subprojects/dex/models/trades/optimism/_schema.yml index de83c8b4136..5257ac7bbeb 100644 --- a/dbt_subprojects/dex/models/trades/optimism/_schema.yml +++ b/dbt_subprojects/dex/models/trades/optimism/_schema.yml @@ -574,7 +574,7 @@ models: blockchain: optimism sector: dex project: saddle_finance - contributors: princi + contributors: princi, hosuke config: tags: [ 'optimism', 'dex', 'trades', 'saddle_finance'] description: "saddle finance optimism base trades" 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 65342178024..bbe037b8a6c 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 @@ -5,6 +5,8 @@ ) }} +--exclude, until resolved at model level: , ref('saddle_finance_optimism_base_trades') + {% set base_models = [ ref('uniswap_v3_optimism_base_trades') , ref('woofi_optimism_base_trades') @@ -35,7 +37,6 @@ , ref('elk_finance_optimism_base_trades') , ref('fraxswap_optimism_base_trades') , ref('swaap_v2_optimism_base_trades') - , ref('saddle_finance_optimism_base_trades') , ref('bridgers_optimism_base_trades') ] %} diff --git a/dbt_subprojects/dex/models/trades/optimism/platforms/saddle_finance_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/platforms/saddle_finance_optimism_base_trades.sql index dda9f17a17e..5d9d6bcf3aa 100644 --- a/dbt_subprojects/dex/models/trades/optimism/platforms/saddle_finance_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/platforms/saddle_finance_optimism_base_trades.sql @@ -1,4 +1,5 @@ {{ config( + tags=['prod_exclude'], schema = 'saddle_finance_optimism', alias = 'base_trades', partition_by = ['block_month'], @@ -8,6 +9,11 @@ unique_key = ['tx_hash', 'evt_index'] ) }} +-- Id mapping: +-- 0 DAI https://optimistic.etherscan.io/token/0xda10009cbd5d07dd0cecc66161fc93d7c9000da1 +-- 1 USDC.e https://optimistic.etherscan.io/token/0x7f5c764cbc14f9669b88837ca1490cca17c31607 +-- 2 USDT https://optimistic.etherscan.io/token/0x94b008aa00579c1307b0ef2c499ad98a8ce58e58 + WITH token_swaps AS ( SELECT evt_block_number AS block_number, @@ -16,8 +22,16 @@ WITH token_swaps AS ( evt_tx_to AS taker, tokensSold AS token_sold_amount_raw, tokensBought AS token_bought_amount_raw, - CAST(soldId AS varbinary) AS token_sold_address, - CAST(boughtId AS varbinary) AS token_bought_address, + CASE soldId + WHEN 0 THEN 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1 + WHEN 1 THEN 0x7f5c764cbc14f9669b88837ca1490cca17c31607 + WHEN 2 THEN 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58 + END AS token_sold_address, + CASE boughtId + WHEN 0 THEN 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1 + WHEN 1 THEN 0x7f5c764cbc14f9669b88837ca1490cca17c31607 + WHEN 2 THEN 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58 + END AS token_bought_address, contract_address AS project_contract_address, evt_tx_hash AS tx_hash, evt_index AS evt_index 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 ecdeabecc12..518176521fa 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 @@ -14,3 +14,6 @@ ethereum,pancakeswap,3,2023-04-01,0x942d7e8064aa1925e484ad9e38b25b0eea8620aa2b85 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 +ethereum,pancakeswap,pcsx,2024-12-12,0xa9f85566c718fa84dfe82dfc9638e8383271856e1c61f2ba11d3c4d23be6c8fc,226,0xdac17f958d2ee523a2206206994597c13d831ec7,0x2260fac5e5542a773aa44fbcfedf7c193bc2c599,21386209,20000000000,20072678 +ethereum,pancakeswap,pcsx,2024-12-12,0xdd63f84eca7f3b7cdfc174ae93b80d1fded3bc145be5a63479eb30c525e07f51,430,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce,21386418,1610345878716657319,220881632899203791230293346 +ethereum,pancakeswap,pcsx,2024-12-12,0x96a89245d9f67ae8f23bdb4c54879e805b727403bbef6214d08fdcc771aa3f51,447,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9,21386687,553168032,1521057740000000000 diff --git a/dbt_subprojects/dex/seeds/trades/saddle_finance_optimism_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/saddle_finance_optimism_base_trades_seed.csv index a459ed8b479..8263a217152 100644 --- a/dbt_subprojects/dex/seeds/trades/saddle_finance_optimism_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/saddle_finance_optimism_base_trades_seed.csv @@ -1,2 +1,2 @@ blockchain,project,version,block_month,block_date,block_time,block_number,token_sold_amount_raw,token_bought_amount_raw,token_sold_address,token_bought_address,maker,taker,project_contract_address,tx_hash,evt_index -optimism,saddle_finance,1,2022-08-01 00:00,2022-08-05 00:00,2022-08-05 19:11,17943155,74907384,74857799085655995549,0x0000000000000000000000000000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000000000000000000000000001,0xd131f1bcdd547e067af447dd3c36c99d6be9fdeb,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xbccdcd4ab61e5ad3384eb173156c3c0507d3bb3f2d2f5a406379e74aafbec38d,3 \ No newline at end of file +optimism,saddle_finance,1,2022-08-01 00:00,2022-08-05 00:00,2022-08-05 19:11,17943155,74907384,74857799085655995549,0xda10009cbd5d07dd0cecc66161fc93d7c9000da1,0x7f5c764cbc14f9669b88837ca1490cca17c31607,0xd131f1bcdd547e067af447dd3c36c99d6be9fdeb,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xbccdcd4ab61e5ad3384eb173156c3c0507d3bb3f2d2f5a406379e74aafbec38d,3 \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/stablebase_base_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/stablebase_base_base_trades_seed.csv index 998c8e33f1b..e3cfc2f90b7 100644 --- a/dbt_subprojects/dex/seeds/trades/stablebase_base_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/stablebase_base_base_trades_seed.csv @@ -1,2 +1,2 @@ blockchain,project,version,block_month,block_date,block_time,block_number,token_sold_amount_raw,token_bought_amount_raw,token_sold_address,token_bought_address,maker,taker,project_contract_address,tx_hash,evt_index -base,stablebase,1,2023-08-01,2023-08-28,2023-08-28 19:18:00.000,3230470,129976172599579374396,135180385,0x0000000000000000000000000000000000000000000000000000000000000001,0x0000000000000000000000000000000000000000000000000000000000000000,0x19fbc29d72476365a62151ffdbf4764e54774a81,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0xc2dec669877f4edfcb7debd2eb23288a0fba8cd57d6f3fb3e45e8b15a6458d43,31 +base,stablebase,1,2023-08-01,2023-08-28,2023-08-28 19:18:00.000,3230470,129976172599579374396,135180385,0x50c5725949a6f0c72e6c4a641f24049a917db0cb,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x19fbc29d72476365a62151ffdbf4764e54774a81,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0xc2dec669877f4edfcb7debd2eb23288a0fba8cd57d6f3fb3e45e8b15a6458d43,31 diff --git a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/base/cow_protocol_base_solvers.sql b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/base/cow_protocol_base_solvers.sql index a3eb28bc6f6..7303d194e47 100644 --- a/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/base/cow_protocol_base_solvers.sql +++ b/dbt_subprojects/hourly_spellbook/models/_project/cow_protocol/base/cow_protocol_base_solvers.sql @@ -47,6 +47,8 @@ known_solver_metadata (address, environment, name) as ( (0x0AC9287C83C2386A6a0bb27F847Ce59a0034183C, 'barn', 'Laita'), (0x172FaCC5d970df43462b0f3aDe670d8cB86DC816, 'barn', 'ApeOut_1Inch'), (0xBB765c920f86e2A2654c4B82deB5BC2E092fF93b, 'barn', 'Portus'), + (0xDF580073E21fFd7968F317B5359B934Eb6d58804, 'barn', 'Barter'), + (0x36Fd8A0C24B08F7bb4af8d6eaA6245C3884fC682, 'prod', 'Barter'), (0x1a72876ebE781E42aB2Ee4278B539688D8B80E2D, 'prod', 'ApeOut_1Inch'), (0x6bf97aFe2D2C790999cDEd2a8523009eB8a0823f, 'prod', 'Portus'), (0x69d7F96dFD091652f317D0734A5F2B492ACcbE07, 'prod', 'Baseline'), diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_addresses.sql b/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_addresses.sql index ecddc2099a3..20fd964b031 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_addresses.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_addresses.sql @@ -793,5 +793,7 @@ FROM (VALUES , ('bitcoin', '3CjxgnmNsu3kaFadzVea2FgECuHN7y2ENz', 'Bitcoin Suisse', 'Bitcoin Suisse 7', 'hildobby', date '2024-05-27') , ('bitcoin', 'bc1qu2dq8w8lv8v3l7lr2c5tvx3yltv22r3nhkx7w0', 'eXch.sc', 'eXch.sc 1', 'hildobby', date '2024-09-06') + + , ('bitcoin', 'bc1qlnkyrrupehgw5evu43erlgkhhagv0uj3yyhacvc65n3ud6qeas0sa958ps', 'Arkham', 'Arkham 1', 'hildobby', date '2024-12-13') ) AS x (blockchain, address, cex_name, distinct_name, added_by, added_date) 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 18acb039b82..9be8fcb6109 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 @@ -923,6 +923,9 @@ FROM (VALUES , (0xf6230e7e98d2bbebf96d14888020e9c3e8c27d69, 'Korbit', 'Korbit 10', 'hildobby', date '2024-05-04') , (0x223674cc4433a50caddf13c65f92151d75996e41, 'Korbit', 'Korbit 11', 'hildobby', date '2024-05-27') , (0x8e2040ab7a6af6bba67e6d9b280c6fea7f930c87, 'Korbit', 'Korbit 12', 'hildobby', date '2024-10-06') + , (0x3a70c2528265f0624e7ac8495b212a367b5b61b2, 'Korbit', 'Korbit 13', 'hildobby', date '2024-12-12') + , (0x5bd811987ee931ac85ed0eda8871282f9c5c88a4, 'Korbit', 'Korbit 14', 'hildobby', date '2024-12-12') + , (0x455ae9f6d25fd49ed7be9f3d8dd1cf58a79a5958, 'Korbit', 'Korbit 15', 'hildobby', date '2024-12-12') , (0xd17e26529e5fca53901f65f1a914317877cab08a, 'Korbit', 'Korbit Gas Supplier 1', 'hildobby', date '2024-10-06') , (0xd77f7f8868f20835fdfc8c7e851f6f23ce9f651d, 'Korbit', 'Korbit Gas Supplier 2', 'hildobby', date '2024-10-06') -- KuCoin @@ -1286,6 +1289,7 @@ FROM (VALUES , (0xee7c0bf91f9ac8117b490c8e028714acbcb41364, 'Bitstamp', 'Bitstamp 44', 'hildobby', date '2024-04-20') , (0xc3b7336d5a5158215599572012cedd4403a81629, 'Bitstamp', 'Bitstamp 45', 'hildobby', date '2024-05-04') , (0x3d9256ad37128e9f47b34a82e06e981719477c18, 'Bitstamp', 'Bitstamp 46', 'hildobby', date '2024-10-06') + , (0x1f69d824c3b4f906ac3fc8826e2391bcb9330e02, 'Bitstamp', 'Bitstamp 47', 'hildobby', date '2024-12-12') , (0xfca70e67b3f93f679992cd36323eeb5a5370c8e4, 'Bitstamp', 'Bitstamp Old Address 1', 'hildobby', date '2022-08-28') , (0x964771f6df31eea2d927fa71d7bd78e81bcdce05, 'Bitstamp', 'Bitstamp Contract 1', 'hildobby', date '2023-08-31') , (0x538d72ded42a76a30f730292da939e0577f22f57, 'Bitstamp', 'Bitstamp Deployer', 'hildobby', date '2023-08-31') @@ -2525,6 +2529,7 @@ FROM (VALUES , (0xc97a4ed29f03fd549c4ae79086673523122d2bc5, 'ZB.com', 'ZB.com 5', 'hildobby', date '2024-05-04') , (0x38b78904a6b44f63eb81d98937fc6614870cfbb9, 'ZB.com', 'ZB.com 6', 'hildobby', date '2024-05-04') , (0xf0d9fcb4fefdbd3e7929374b4632f8ad511bd7e3, 'ZB.com', 'ZB.com 7', 'hildobby', date '2024-10-06') + , (0xcb45822dfa8a65b97bc854a1a61b674153a42967, 'ZB.com', 'ZB.com 8', 'hildobby', date '2024-12-12') , (0x734ac651dd95a339c633cded410228515f97faff, 'ZB.com', 'ZB.com Gas Supplier 1', 'hildobby', date '2023-11-23') , (0xdb7248d26ea60170a4fdc2ea44dc839c9e8c9ee4, 'ZB.com', 'ZB.com Gas Supplier 2', 'hildobby', date '2024-05-04') , (0x5e91e8ccae2dd2c6db87f677e161ed1e07d6ccc8, 'ZB.com', 'ZB.com Gas Supplier 3', 'hildobby', date '2024-10-06') @@ -2689,6 +2694,7 @@ FROM (VALUES , (0xe2933566f172d08f8c90144fed5ae28e9d54b1ec, 'Woo X', 'Woo X Team', 'hildobby', date '2024-01-04') , (0x15271e572267def474366bb683719cc59489efbe, 'Woo X', 'Woo X Treasury 1', 'hildobby', date '2024-01-04') , (0xd7d8bcae65537cb5079a4fb249b9fbb4526e4084, 'Woo X', 'Woo X Treasury 2', 'hildobby', date '2024-06-03') + , (0xfa2d1f15557170f6c4a4c5249e77f534184cdb79, 'Woo X', 'Woo X Treasury 3', 'hildobby', date '2024-12-12') , (0xe64eb20471491956338eedc0f98242bc3ad0c91b, 'Woo X', 'Woo X Deployer 1', 'hildobby', date '2024-06-03') -- FastEx , (0x85e1de87a7575c6581f7930f857a3813b66a14d8, 'FastEx', 'FastEx 1', 'hildobby', date '2023-11-23') @@ -2773,6 +2779,7 @@ FROM (VALUES -- OPNX , (0x610887f0ae329557d1ae067f6b7697ff07032116, 'OPNX', 'OPNX 1', 'hildobby', date '2024-01-04') , (0xe5241ac645cad844e94a2e7486283ed6398fb3aa, 'OPNX', 'OPNX 2', 'hildobby', date '2024-01-04') + , (0x05d618a67786e4d078c0fbc8e601ad9765787c5d, 'OPNX', 'OPNX Safe 1', 'hildobby', date '2024-12-12') , (0xcd5f17b1fe981ba260c40c67e740b7290b50ea50, 'OPNX', 'OPNX Contract 1', 'hildobby', date '2024-01-04') , (0x78a0a62fba6fb21a83fe8a3433d44c73a4017a6f, 'OPNX', 'OPNX OX Token', 'hildobby', date '2024-01-04') , (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87, 'OPNX', 'OPNX veOX Token', 'hildobby', date '2024-01-04') @@ -3173,4 +3180,9 @@ FROM (VALUES , (0x8f3ab2c3b651382b07a76653d2be9eb4b87e1630, 'YOOBTC', 'YOOBTC 1', 'hildobby', date '2024-05-25') -- Mbcbit , (0x5e6ad578fe3a2da7bbd0255f04179e1e77317d1a, 'Mbcbit', 'Mbcbit 1', 'hildobby', date '2024-07-05') + -- Arkham Exchange + , (0x679fb19dec9d66c34450a8563ffdfd29c04e615a, 'Arkham', 'Arkham 1', 'hildobby', date '2024-12-13') + , (0x0323718324218dcbff7c9f89ba5a5954f61a6c74, 'Arkham', 'Arkham 2', 'hildobby', date '2024-12-13') + , (0x34407900475cef87ace1597670a9a42f31961d02, 'Arkham', 'Arkham 3', 'hildobby', date '2024-12-13') + , (0xdc2822d0685c0cceab07b35d6de4ac9280fb9cff, 'Arkham', 'Arkham 4', 'hildobby', date '2024-12-13') ) 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/dune/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/dune/_schema.yml new file mode 100644 index 00000000000..6c6e4f12e11 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/dune/_schema.yml @@ -0,0 +1,24 @@ +version: 2 + +models: + - name: dune_blockchains + meta: + sector: dune + contributors: 0xRob + description: > + Core table listing blockchains on Dune with meta info + columns: + - name: name + description: "The namespaces of the blockchain as used on Dune" + - name: chain_id + description: "The chain ID (only for EVM)" + - name: display_name + description: "Nicely formatted name" + - name: protocol + description: "evm or non_evm" + - name: token_address + description: "The token address used on Dune to represent the native token" + - name: token_symbol + description: "The token symbol of the native token" + - name: token_decimals + description: "The token decimals of the native token" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/dune/dune_blockchains.sql b/dbt_subprojects/hourly_spellbook/models/_sector/dune/dune_blockchains.sql new file mode 100644 index 00000000000..739b358e3c7 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/dune/dune_blockchains.sql @@ -0,0 +1,15 @@ +{{ config( + schema='dune', + alias = 'blockchains', + materialized = 'view', + post_hook='{{ expose_spells(\'["dune"]\', + "sector", + "dune", + \'["0xRob"]\') }}') +}} + +-- because the graphql endpoint often returns http error 403 when querying through http_get(), +-- we store the results in a matview instead and expose that one here with a view on top. +-- matview: https://dune.com/queries/4467416 +select * from +{{ source("dune", "result_blockchains", database="dune") }} 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 index cb3eb9a7ef9..98f6fbaef49 100644 --- 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 @@ -126,9 +126,12 @@ from (VALUES , ('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') + , ('THE RABBLE 1/1', 'Unique', 'Async Art', 1, 'Ethereum', 'erc721', 0xb6dAe651468E9593E4581705a09c10A76AC1e0c8, 432, 432, '', 'https://xcopy.art/works/the-rabble','2020-01-01') + , ('BANKSTA 1/1', 'Unique', 'Async Art', 1, 'Ethereum', 'erc721', 0x6c424C25e9F1ffF9642cB5B7750b0Db7312c29ad, 28, 28, '', 'https://xcopy.art/works/banksta','2020-01-01') + , ('DOOM PARTY 1/1', 'Unique', 'Async Art', 1, 'Ethereum', 'erc721', 0xb6dAe651468E9593E4581705a09c10A76AC1e0c8, 199, 199, '', 'https://xcopy.art/works/doom-party','2020-01-01') + , ('THE RABBLE', 'Layer', 'Async Art', 43, 'Ethereum', 'erc721', 0xb6dAe651468E9593E4581705a09c10A76AC1e0c8, 433, 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') + , ('DOOM PARTY', 'Layer', 'Async Art', 11, 'Ethereum', 'erc721', 0xb6dAe651468E9593E4581705a09c10A76AC1e0c8, 200, 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') diff --git a/dbt_subprojects/tokens/dbt_project.yml b/dbt_subprojects/tokens/dbt_project.yml index 4ab163deb41..582d4218748 100644 --- a/dbt_subprojects/tokens/dbt_project.yml +++ b/dbt_subprojects/tokens/dbt_project.yml @@ -23,6 +23,12 @@ vars: DBT_ENV_INCREMENTAL_TIME_UNIT: "{{ env_var('DBT_ENV_INCREMENTAL_TIME_UNIT', 'day') }}" ETH_ERC20_ADDRESS: '0x0000000000000000000000000000000000000000' +# Configuring tests +# Full documentation: https://docs.getdbt.com/reference/test-configs +data_tests: + tokens: + +store_failures: true # store failures for all tests + # These configurations specify where dbt should look for different types of files. # You don't need to change these! model-paths: ["models", "../../sources"] diff --git a/dbt_subprojects/tokens/models/prices/prices_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_tokens.sql index 0f38cb25f82..2028a51ff25 100644 --- a/dbt_subprojects/tokens/models/prices/prices_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_tokens.sql @@ -27,6 +27,7 @@ , "scroll" , "sei" , "solana" + , "sonic" , "viction" , "worldchain" , "zksync" @@ -70,6 +71,7 @@ ref('prices_native_tokens') ,ref('prices_ronin_tokens') ,ref('prices_boba_tokens') ,ref('prices_viction_tokens') +,ref('prices_sonic_tokens') ] %} diff --git a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql index cb20a76eda0..9f82777c454 100644 --- a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql @@ -143,6 +143,10 @@ WITH trusted_tokens AS ( , ('solana', from_base58('mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So')) , ('solana', from_base58('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')) , ('solana', from_base58('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v')) + , ('sonic', 0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38) + , ('sonic', 0x29219dd400f2Bf60E5a23d13Be72B486D4038894) + , ('sonic', 0x50c42dEAcD8Fc9773493ED674b675bE577f2634b) + , ('sonic', 0xe715cba7b5ccb33790cebff1436809d36cb17e57) , ('worldchain', 0x2cFc85d8E48F8EAB294be644d9E25C3030863003) , ('worldchain', 0x79A02482A880bCE3F13e09Da970dC34db4CD24d1) , ('worldchain', 0x03C7054BCB39f7b2e5B2c7AcB37583e32D70Cfa3) diff --git a/dbt_subprojects/tokens/models/prices/sonic/_schema.yml b/dbt_subprojects/tokens/models/prices/sonic/_schema.yml new file mode 100644 index 00000000000..de77489ffeb --- /dev/null +++ b/dbt_subprojects/tokens/models/prices/sonic/_schema.yml @@ -0,0 +1,24 @@ +version: 2 + +models: + - name: prices_sonic_tokens + meta: + blockchain: sonic + sector: tokens + contributors: hosuke + config: + tags: ['tokens', 'sonic', 'prices'] + description: "Token prices and metadata on Sonic" + columns: + - name: token_id + description: "Unique identifier for the token" + - name: blockchain + description: "Blockchain where the token is deployed" + - name: symbol + description: "Token symbol" + - name: contract_address + description: "Contract address of the token" + data_tests: + - unique + - name: decimals + description: "Number of decimal places for the token" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/prices/sonic/prices_sonic_tokens.sql b/dbt_subprojects/tokens/models/prices/sonic/prices_sonic_tokens.sql new file mode 100644 index 00000000000..d85572439b4 --- /dev/null +++ b/dbt_subprojects/tokens/models/prices/sonic/prices_sonic_tokens.sql @@ -0,0 +1,26 @@ +{% set blockchain = 'sonic' %} + +{{ config( + schema = 'prices_' + blockchain, + alias = 'tokens', + materialized = 'table', + file_format = 'delta', + tags = ['static'] + ) +}} + +SELECT + token_id + , '{{ blockchain }}' as blockchain + , symbol + , contract_address + , decimals +FROM +( + VALUES + ('ftm-fantom', 'wS', 0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38, 18) -- looks like FTM <--> S token are same price and 1:1 upgrade according to docs + , ('usdc-usd-coin', 'USDC.e', 0x29219dd400f2Bf60E5a23d13Be72B486D4038894, 6) + , ('weth-weth', 'WETH', 0x50c42dEAcD8Fc9773493ED674b675bE577f2634b, 18) + , ('euroc-euro-coin', 'EURC.e', 0xe715cba7b5ccb33790cebff1436809d36cb17e57, 6) + , ('beets-beethoven-x', 'BEETS', 0x2d0e0814e62d80056181f5cd932274405966e4f0, 18) +) as temp (token_id, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_nft_curated.sql b/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_nft_curated.sql index 46a751ad005..1fa443c8bea 100644 --- a/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_nft_curated.sql +++ b/dbt_subprojects/tokens/models/tokens/avalanche_c/tokens_avalanche_c_nft_curated.sql @@ -9,6 +9,7 @@ SELECT contract_address, name, symbol FROM (VALUES + (0xaaaea1fb9f3de3f70e89f37b69ab11b47eb9ce6f, 'Voting Escrow Pharaoh', 'vePHAR'), (0x2b9328d83becd4f04de05f129ba56781fa191e67, 'Cattopya', 'CAT'), (0x34b4da1a0b06cfb09cb0efb46f02e667330e17db, 'Humping Unicorns', 'HUMP'), (0x47d42b18d54ee0b94b59c3e41dcac3260e995e48, 'Doggerinos Accessories', 'DOGACC'), diff --git a/dbt_subprojects/tokens/models/tokens/sonic/tokens_sonic_erc20.sql b/dbt_subprojects/tokens/models/tokens/sonic/tokens_sonic_erc20.sql index 7b2fd6541a5..b5124c6b826 100644 --- a/dbt_subprojects/tokens/models/tokens/sonic/tokens_sonic_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/sonic/tokens_sonic_erc20.sql @@ -12,8 +12,8 @@ SELECT , symbol , decimals FROM (VALUES - (0x309C92261178fA0CF748A855e90Ae73FDb79EBc7, 'WETH', 18) - , (0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38, 'WS', 18) + (0x50c42dEAcD8Fc9773493ED674b675bE577f2634b, 'WETH', 18) + , (0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38, 'wS', 18) , (0x29219dd400f2Bf60E5a23d13Be72B486D4038894, 'USDC.e', 6) , (0xe715cba7b5ccb33790cebff1436809d36cb17e57, 'EURC.e', 6) , (0xf2f9f482a395b4dd5b5b92173b7d62f3aff92884, 'DOG', 18) @@ -23,5 +23,5 @@ FROM (VALUES , (0x2030170901a9d87f6bd0ca9b8ad130119c7e1173, 'BABYSONIC', 9) , (0xe5da20f15420ad15de0fa650600afc998bbe3955, 'stS', 18) , (0xd4a5c68a1ed1fc2bb06cba2d90d6adeee7503671, 'HOOPS', 18) - + , (0x2d0e0814e62d80056181f5cd932274405966e4f0, 'BEETS', 18) ) as temp (contract_address, symbol, decimals) diff --git a/sources/_base_sources/evm/sonic_base_sources.yml b/sources/_base_sources/evm/sonic_base_sources.yml new file mode 100644 index 00000000000..12bed27cb57 --- /dev/null +++ b/sources/_base_sources/evm/sonic_base_sources.yml @@ -0,0 +1,605 @@ +version: 2 + +sources: + - name: sonic + description: "Raw tables for the Sonic blockchain" + tables: + - name: transactions + meta: + docs_slug: "/evm/sonic/raw/transactions" + short_description: "The `sonic.transactions` table contains all transactions on the Sonic blockchain." + description: '{{ doc("sonic_transactions_doc") }}' + columns: + - name: block_time + description: "The exact UTC timestamp when this transaction was included" + data_type: timestamp + - name: block_number + description: "The sequential number of the block containing this transaction" + data_type: bigint + - name: value + description: "Amount of native tokens transferred in this transaction" + data_type: uint256 + - name: gas_limit + description: "Maximum amount of gas that can be used by this transaction" + data_type: bigint + - name: gas_price + description: "Price per unit of gas specified by the sender" + data_type: uint256 + - name: gas_used + description: "Amount of gas used by this transaction" + data_type: bigint + - name: max_fee_per_gas + description: "Maximum total fee per unit of gas (EIP-1559)" + data_type: bigint + - name: max_priority_fee_per_gas + description: "Maximum priority fee per unit of gas (EIP-1559)" + data_type: bigint + - name: priority_fee_per_gas + description: "Actual priority fee per unit of gas (EIP-1559)" + data_type: bigint + - name: nonce + description: "Number of transactions sent by the sender prior to this one" + data_type: bigint + - name: index + description: "Index of this transaction within the block" + data_type: bigint + - name: success + description: "Whether the transaction was successful" + data_type: boolean + - name: from + description: "Address that sent the transaction" + data_type: varbinary + - name: to + description: "Address that received the transaction" + data_type: varbinary + - name: block_hash + description: "Hash of the block containing this transaction" + data_type: varbinary + - name: data + description: "Data payload of the transaction" + data_type: varbinary + - name: hash + description: "Unique identifier (hash) of this transaction" + data_type: varbinary + - name: type + description: "Transaction type (0 = legacy, 1 = access list, 2 = EIP-1559)" + data_type: varchar + - name: access_list + description: "List of addresses and storage keys that the transaction plans to access" + data_type: array(row(address varbinary,storageKeys array(varbinary))) + - name: chain_id + description: "Chain ID of the network where this transaction was executed" + data_type: bigint + - name: block_date + description: "UTC date of the block containing this transaction" + data_type: date + + - name: traces + meta: + docs_slug: "/evm/sonic/raw/traces" + short_description: "The `sonic.traces` table contains all transaction traces on the Sonic blockchain." + description: '{{ doc("sonic_traces_doc") }}' + columns: + - name: block_time + description: "The exact UTC timestamp when this trace was created" + data_type: timestamp + - name: block_number + description: "The sequential number of the block containing this trace" + data_type: bigint + - name: value + description: "Amount of native tokens transferred in this trace" + data_type: uint256 + - name: gas + description: "Gas limit for this trace" + data_type: bigint + - name: gas_used + description: "Amount of gas used by this trace" + data_type: bigint + - name: block_hash + description: "Hash of the block containing this trace" + data_type: varbinary + - name: success + description: "Whether this trace was successful" + data_type: boolean + - name: tx_index + description: "Index of the transaction within the block" + data_type: integer + - name: tx_from + description: "Address that sent the transaction" + data_type: varbinary + - name: tx_to + description: "Address that received the transaction" + data_type: varbinary + - name: sub_traces + description: "Number of sub-traces" + data_type: bigint + - name: error + description: "Error message if the trace failed" + data_type: varchar + - name: tx_success + description: "Whether the parent transaction was successful" + data_type: boolean + - name: tx_hash + description: "Hash of the transaction" + data_type: varbinary + - name: from + description: "Address initiating this trace" + data_type: varbinary + - name: to + description: "Address receiving this trace" + data_type: varbinary + - name: trace_address + description: "Array indicating the position in the call trace tree" + data_type: array(bigint) + - name: type + description: "Type of the trace (call, create, suicide, reward)" + data_type: varchar + - name: address + description: "Address of the contract if this is a create trace" + data_type: varbinary + - name: code + description: "Contract code for create traces" + data_type: varbinary + - name: call_type + description: "Type of call (call, delegatecall, staticcall)" + data_type: varchar + - name: input + description: "Input data for the trace" + data_type: varbinary + - name: output + description: "Output data from the trace" + data_type: varbinary + - name: refund_address + description: "Address receiving refund for self-destruct" + data_type: varbinary + - name: revert_reason + description: "Reason for revert if the trace failed" + data_type: varchar + - name: block_date + description: "UTC date of the block containing this trace" + data_type: date + + - name: traces_decoded + meta: + docs_slug: "/evm/sonic/raw/traces_decoded" + short_description: "The `sonic.traces_decoded` table contains decoded traces from known contracts on the Sonic blockchain." + description: '{{ doc("sonic_traces_decoded_doc") }}' + columns: + - name: block_date + description: "UTC date of the block containing this trace" + data_type: date + - name: block_time + description: "The exact UTC timestamp when this trace was created" + data_type: timestamp + - name: block_number + description: "The sequential number of the block containing this trace" + data_type: bigint + - name: namespace + description: "Project namespace for the contract" + data_type: varchar + - name: contract_name + description: "Name of the contract" + data_type: varchar + - name: to + description: "Address receiving this trace" + data_type: varbinary + - name: trace_address + description: "Array indicating the position in the call trace tree" + data_type: array(bigint) + - name: tx_hash + description: "Hash of the transaction" + data_type: varbinary + - name: tx_from + description: "Address that sent the transaction" + data_type: varbinary + - name: tx_to + description: "Address that received the transaction" + data_type: varbinary + - name: signature + description: "Function signature hash" + data_type: varbinary + - name: function_name + description: "Name of the called function" + data_type: varchar + + - name: creation_traces + meta: + docs_slug: "/evm/sonic/raw/creation_traces" + short_description: "The `sonic.creation_traces` table contains information about contract creation events." + description: '{{ doc("sonic_creation_traces_doc") }}' + columns: + - name: block_time + description: "The exact UTC timestamp when the block containing this creation was added to the chain" + data_type: timestamp + - name: block_number + description: "The sequential number of the block containing this creation" + data_type: bigint + - name: tx_hash + description: "Unique 256-bit identifier (hash) of the transaction" + data_type: varbinary + - name: address + description: "Address of the deployed contract" + data_type: varbinary + - name: from + description: "Address of the account that created the contract" + data_type: varbinary + - name: code + description: "Bytecode of the deployed contract" + data_type: varbinary + - name: block_month + description: "The month of the block date" + data_type: date + + - name: logs + meta: + docs_slug: "/evm/sonic/raw/logs" + short_description: "The `sonic.logs` table contains all event logs emitted by contracts on the Sonic blockchain." + description: '{{ doc("sonic_logs_doc") }}' + columns: + - name: block_time + description: "The exact UTC timestamp when this log was emitted" + data_type: timestamp + - name: block_number + description: "The sequential number of the block containing this log" + data_type: bigint + - name: block_hash + description: "Hash of the block containing this log" + data_type: varbinary + - name: contract_address + description: "Address of the contract that emitted this log" + data_type: varbinary + - name: topic0 + description: "First topic of the log (typically the event signature)" + data_type: varbinary + - name: topic1 + description: "Second topic of the log" + data_type: varbinary + - name: topic2 + description: "Third topic of the log" + data_type: varbinary + - name: topic3 + description: "Fourth topic of the log" + data_type: varbinary + - name: data + description: "Additional data included in the log" + data_type: varbinary + - name: tx_hash + description: "Hash of the transaction that generated this log" + data_type: varbinary + - name: index + description: "Index of this log within the transaction" + data_type: integer + - name: tx_index + description: "Index of the transaction within the block" + data_type: integer + - name: block_date + description: "UTC date of the block containing this log" + data_type: date + - name: tx_from + description: "Address that sent the transaction" + data_type: varbinary + - name: tx_to + description: "Address that received the transaction" + data_type: varbinary + + - name: logs_decoded + meta: + docs_slug: "/evm/sonic/raw/logs_decoded" + short_description: "The `sonic.logs_decoded` table contains decoded event logs from known contracts on the Sonic blockchain." + description: '{{ doc("sonic_logs_decoded_doc") }}' + columns: + - name: block_date + description: "UTC date of the block containing this log" + data_type: date + - name: block_time + description: "The exact UTC timestamp when this log was emitted" + data_type: timestamp + - name: block_number + description: "The sequential number of the block containing this log" + data_type: bigint + - name: namespace + description: "Project namespace for the contract" + data_type: varchar + - name: contract_name + description: "Name of the contract that emitted this event" + data_type: varchar + - name: contract_address + description: "Address of the contract that emitted this event" + data_type: varbinary + - name: tx_hash + description: "Hash of the transaction that generated this event" + data_type: varbinary + - name: tx_from + description: "Address that sent the transaction" + data_type: varbinary + - name: tx_to + description: "Address that received the transaction" + data_type: varbinary + - name: index + description: "Index of this event within the transaction" + data_type: integer + - name: signature + description: "Event signature hash" + data_type: varbinary + - name: event_name + description: "Name of the emitted event" + data_type: varchar + + - name: blocks + meta: + docs_slug: "/evm/sonic/raw/blocks" + short_description: "The `sonic.blocks` table contains information about blocks on the Sonic blockchain." + description: '{{ doc("sonic_blocks_doc") }}' + columns: + - name: time + description: "The exact UTC timestamp when this block was added to the chain" + data_type: timestamp + - name: number + description: "The sequential number of this block in the chain" + data_type: bigint + - name: gas_limit + description: "Maximum amount of gas that could be used by all transactions in this block" + data_type: decimal(38,0) + - name: gas_used + description: "Actual amount of gas used by all transactions in this block" + data_type: decimal(38,0) + - name: difficulty + description: "Numerical value indicating the computational effort required to mine this block" + data_type: bigint + - name: total_difficulty + description: "Sum of block difficulties up to this block" + data_type: decimal(38,0) + - name: size + description: "Size of this block in bytes" + data_type: bigint + - name: base_fee_per_gas + description: "Base fee per gas in the block (post-EIP-1559)" + data_type: bigint + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + data_type: varbinary + - name: parent_hash + description: "Hash of the previous block in the chain" + data_type: varbinary + - name: miner + description: "Address of the validator that produced this block" + data_type: varbinary + - name: nonce + description: "Value used to demonstrate proof of work for this block" + data_type: varbinary + - name: state_root + description: "Root hash of the state trie" + data_type: varbinary + - name: transactions_root + description: "Root hash of the transactions trie" + data_type: varbinary + - name: receipts_root + description: "Root hash of the receipts trie" + data_type: varbinary + - name: date + description: "The UTC date when this block was added to the chain" + data_type: date + - name: blob_gas_used + description: "Amount of blob gas used in this block" + data_type: bigint + - name: excess_blob_gas + description: "Excess blob gas in this block" + data_type: bigint + - name: parent_beacon_block_root + description: "Root hash of the parent beacon block" + data_type: varbinary + + - name: erc20_sonic + description: "Transfer events for ERC20 tokens on Sonic blockchain" + tables: + - name: evt_transfer + meta: + docs_slug: "/evm/sonic/decoded/interfaces/erc20/evt_transfer" + short_description: "This table contains individual transfer events for ERC20 tokens on the Sonic blockchain. Each row represents a single token transfer event." + description: '{{ doc("erc20_sonic_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: from + description: "Address that sent the transaction" + data_type: varbinary + - name: to + description: "Address that received the transaction" + data_type: varbinary + - name: value + description: "Amount of ERC20 tokens transferred, in the token's Sonic unit" + + - name: evt_approval + meta: + docs_slug: "/evm/sonic/decoded/interfaces/erc20/evt_approval" + short_description: "The `sonic.evt_approval` table contains approval events for ERC20 tokens on Sonic, allowing an address to spend tokens on behalf of the owner." + description: '{{ doc("erc20_sonic_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: owner + description: "Address of the token owner granting approval" + data_type: varbinary + - name: spender + description: "Address being granted permission to spend tokens" + data_type: varbinary + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_sonic + description: "Events related to ERC1155 tokens on Sonic blockchain" + tables: + - name: evt_transfersingle + meta: + docs_slug: "/evm/sonic/decoded/interfaces/erc1155/evt_transfersingle" + short_description: "This table contains single transfer events for ERC1155 tokens on the network." + description: '{{ doc("erc1155_sonic_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC1155 token contract" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: operator + description: "The address that is authorized to execute the transfer on behalf of the owner" + data_type: varbinary + - name: from + description: "Address that sent the transaction" + data_type: varbinary + - name: to + description: "Address that received the transaction" + data_type: varbinary + - 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/sonic/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" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + data_type: varbinary + - name: from + description: "Address that sent the transaction" + data_type: varbinary + - name: to + description: "Address that received the transaction" + data_type: varbinary + - 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/sonic/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: "Sonic address of the ERC1155 token contract" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - name: owner + description: "Sonic address of the token owner granting or revoking approval" + data_type: varbinary + - name: operator + description: "Sonic address being granted or revoked permission to operate all tokens" + data_type: varbinary + + - name: erc721_sonic + description: '{{ doc("erc721_sonic_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" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: from + description: "Address that sent the transaction" + data_type: varbinary + - name: to + description: "Address that received the transaction" + data_type: varbinary + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + + - name: evt_Approval + meta: + docs_slug: "/evm/sonic/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" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - name: owner + description: "Address of the token owner granting or revoking approval" + data_type: varbinary + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + + - name: evt_ApprovalForAll + meta: + docs_slug: "/evm/sonic/decoded/interfaces/erc721/evt_ApprovalForAll" + short_description: "The `sonic.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the Sonic blockchain." + description: '{{ doc("erc721_ethereum_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - name: evt_tx_hash + description: "Hash of the transaction containing this event" + - name: evt_index + description: "Index position of this event within the transaction" + - name: evt_block_time + description: "Timestamp of the block containing this event" + - name: evt_block_number + description: "The block number containing this event" + - name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - name: owner + description: "Address of the token owner granting or revoking approval" + data_type: varbinary + - name: operator + description: "The address being granted or revoked permission to operate all tokens" + data_type: varbinary diff --git a/sources/_base_sources/evm/sonic_docs_block.md b/sources/_base_sources/evm/sonic_docs_block.md new file mode 100644 index 00000000000..0cddb0102b1 --- /dev/null +++ b/sources/_base_sources/evm/sonic_docs_block.md @@ -0,0 +1,254 @@ +{% docs sonic_transactions_doc %} + +The `sonic.transactions` table contains detailed information about transactions on the Sonic blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used, max_fee_per_gas, priority_fee_per_gas +- Status: success or failure +- Input data for contract interactions +- Nonce and chain_id +- Transaction type and access list + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on Sonic. + +{% enddocs %} + +{% docs sonic_traces_doc %} + +The `sonic.traces` table contains records of execution steps for transactions on the Sonic blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash and block information +- From and to addresses +- Value transferred +- Gas metrics (gas, gas_used) +- Input and output data +- Call type (e.g., CALL, DELEGATECALL, CREATE) +- Error information and revert reasons +- Trace address for nested calls + +This table is essential for: +- Analyzing internal transactions +- Debugging smart contract interactions +- Tracking value flows through complex transactions +- Understanding contract creation and deployment +- Monitoring protocol operations +- Analyzing cross-chain operations + +{% enddocs %} + +{% docs sonic_traces_decoded_doc %} + +The `sonic.traces_decoded` table contains a subset of decoded traces from the Sonic blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- Block information and transaction details +- Contract name and namespace +- Decoded function names and signatures +- Trace address for execution path tracking +- Transaction origin and destination +- Function parameters (when available) + +This table is used for high level analysis of smart contract interactions and protocol operations. For fully decoded function calls and parameters, refer to protocol-specific decoded tables. + +{% enddocs %} + +{% docs sonic_logs_doc %} + +The `sonic.logs` table contains event logs emitted by smart contracts on the Sonic blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, index, from, to +- Contract address (emitting the event) +- Topic0 (event signature) +- Additional topics (indexed parameters) +- Data field (non-indexed parameters) +- Log index and transaction index + +This table is crucial for: +- Tracking on-chain events +- Monitoring contract activity +- Analyzing token transfers +- Following protocol-specific events +- Tracking cross-chain operations +- Monitoring protocol state changes + +{% enddocs %} + +{% docs sonic_logs_decoded_doc %} + +The `sonic.logs_decoded` table contains a subset of decoded logs from the Sonic blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- Block and transaction information +- Contract details (name, namespace, address) +- Decoded event names and signatures +- Transaction origin and destination +- Event parameters (when available) + +This table is used for high level analysis of smart contract events, particularly useful for monitoring protocol activities. For fully decoded events and parameters, refer to protocol-specific decoded tables. + +{% enddocs %} + +{% docs sonic_blocks_doc %} + +The `sonic.blocks` table contains information about Sonic blocks. It provides essential data about each block in the Sonic blockchain, including: + +- Block identifiers and timestamps +- Gas metrics and size +- Consensus information (difficulty, nonce) +- State roots and receipts +- Parent block information +- Base fee per gas +- Blob gas metrics +- Parent beacon block root + +This table is fundamental for: +- Analyzing block production and timing +- Monitoring network performance +- Tracking gas usage patterns +- Understanding network upgrades +- Analyzing consensus metrics +- Studying blockchain structure + +{% enddocs %} + +{% docs sonic_creation_traces_doc %} + +The `sonic.creation_traces` table contains information about contract deployments on the Sonic blockchain. It includes: + +- Block information and timestamps +- Transaction details +- Contract addresses +- Creator addresses +- Contract bytecode + +This table is essential for: +- Tracking smart contract deployments +- Analyzing contract creation patterns +- Monitoring new protocol deployments +- Auditing contract creation history +- Understanding contract deployment costs + +{% enddocs %} + +{% docs erc20_sonic_evt_transfer_doc %} + +The `erc20_sonic.evt_transfer` table contains ERC20 token transfer events on the Sonic blockchain. Each record represents a token transfer and includes: + +- Block information and timestamps +- Transaction details +- Token contract address +- Sender and receiver addresses +- Transfer amount +- Event index and transaction index + +This table is essential for: +- Tracking token transfers and flows +- Analyzing token holder behavior +- Monitoring token activity +- Understanding token economics +- Tracking cross-chain token movements + +{% enddocs %} + +{% docs erc721_sonic_evt_transfer_doc %} + +The `erc721_sonic.evt_transfer` table contains ERC721 (NFT) transfer events on the Sonic blockchain. Each record represents an NFT transfer and includes: + +- Block information and timestamps +- Transaction details +- NFT contract address +- Sender and receiver addresses +- Token ID +- Event index and transaction index + +This table is crucial for: +- Tracking NFT ownership changes +- Analyzing NFT trading patterns +- Monitoring NFT market activity +- Understanding NFT collections +- Tracking cross-chain NFT movements + +{% enddocs %} + +{% docs erc1155_sonic_evt_transfer_doc %} + +The `erc1155_sonic.evt_transfer` table contains ERC1155 multi-token transfer events on the Sonic blockchain. Each record represents a token transfer and includes: + +- Block information and timestamps +- Transaction details +- Token contract address +- Sender and receiver addresses +- Token ID and amount +- Event index and transaction index + +This table is used for: +- Tracking multi-token transfers +- Analyzing token usage patterns +- Monitoring protocol activity +- Understanding multi-token operations +- Tracking DeFi integrations + +{% enddocs %} + +{% docs erc20_sonic_evt_approval_doc %} + +The `erc20_sonic.evt_approval` table contains approval events for ERC20 tokens on the Sonic blockchain. Each record represents a token approval and includes: + +- Block information and timestamps +- Transaction details +- Token contract address +- Owner address +- Spender address +- Approved amount +- Event index and transaction index + +This table is essential for: +- Tracking token approvals +- Monitoring DeFi allowances +- Analyzing smart contract permissions +- Understanding protocol integrations +- Tracking liquidity provisions + +{% enddocs %} + +{% docs erc1155_sonic_evt_transfersingle_doc %} + +The `erc1155_sonic.evt_transfersingle` table contains single transfer events for ERC1155 tokens on the Sonic blockchain. Each record represents a single token transfer and includes: + +- Block information and timestamps +- Transaction details +- Token contract address +- Operator address +- Sender and receiver addresses +- Token ID and amount +- Event index and transaction index + +This table is used for: +- Tracking individual token transfers +- Analyzing token usage patterns +- Monitoring protocol activity +- Understanding multi-token operations +- Tracking DeFi integrations + +{% enddocs %} + +{% docs erc1155_sonic_evt_transferbatch_doc %} + +The `erc1155_sonic.evt_transferbatch` table contains batch transfer events for ERC1155 tokens on the Sonic blockchain. Each record represents a batch token transfer and includes: + +- Block information and timestamps +- Transaction details +- Token contract address +- Operator address +- Sender and receiver addresses +- Array of token IDs and amounts +- Event index and transaction index + +This table is crucial for: +- Tracking bulk token transfers +- Analyzing batch operations +- Monitoring large-scale movements +- Understanding protocol migrations +- Tracking multi-token operations + +{% enddocs %} diff --git a/sources/_datasets/dune/sources.yml b/sources/_datasets/dune/sources.yml new file mode 100644 index 00000000000..adc99858345 --- /dev/null +++ b/sources/_datasets/dune/sources.yml @@ -0,0 +1,6 @@ +version: 2 + +sources: + - name: dune + tables: + - name: result_blockchains diff --git a/sources/_sector/dex/trades/ethereum/_sources.yml b/sources/_sector/dex/trades/ethereum/_sources.yml index 5c63d9043bc..4a582b28ca8 100644 --- a/sources/_sector/dex/trades/ethereum/_sources.yml +++ b/sources/_sector/dex/trades/ethereum/_sources.yml @@ -132,3 +132,6 @@ sources: - name: fluid_ethereum tables: - name: FluidDexT1_evt_Swap + - name: pancakeswap_ethereum + tables: + - name: ExclusiveDutchOrderReactor_evt_Fill diff --git a/sources/aave/base/aave_base_sources.yml b/sources/aave/base/aave_base_sources.yml new file mode 100644 index 00000000000..e3348a3f85f --- /dev/null +++ b/sources/aave/base/aave_base_sources.yml @@ -0,0 +1,61 @@ +version: 2 + +sources: + - name: aave_v3_base + description: "Decoded contracts for aave v3 on Base" + + tables: + - name: L2Pool_evt_ReserveDataUpdated + description: "Provides the liquidity index, stable and variable borrow rates for aave v3 reserves." + columns: + - name: contract_address + description: "Aave token contract address" + type: varbinary + + - name: evt_tx_hash + description: "Transaction hash of the event" + type: varbinary + + - name: evt_tx_from + description: "Address that initiated the transaction" + type: varbinary + + - name: evt_tx_to + description: "Address that received the transaction" + type: varbinary + + - name: evt_index + description: "Event index" + type: bigint + + - name: evt_block_time + description: "Timestamp for block event time in UTC" + type: timestamp + + - name: evt_block_number + description: "Event block number" + type: bigint + + - name: reserve + description: "Aave reserve contract address" + type: varbinary + + - name: liquidityRate + description: "Liquidity rate value of the reserve" + type: uint256 + + - name: stableBorrowRate + description: "Stable borrow rate value of the reserve" + type: uint256 + + - name: variableBorrowRate + description: "Variable borrow rate value of the reserve" + type: uint256 + + - name: liquidityIndex + description: "Liquidity index value of the reserve" + type: uint256 + + - name: variableBorrowIndex + description: "Variable borrow index value of the reserve" + type: uint256 \ No newline at end of file