From 0da3de49236c4a0c0e1729235dd2a84c275b8025 Mon Sep 17 00:00:00 2001 From: 0xdatawolf001 <0xdatawolf@gmail.com> Date: Sat, 26 Oct 2024 15:47:26 +0800 Subject: [PATCH 1/4] add optimism velodrome v2 concentrated liquidity pool --- .../velodrome_optimism_base_trades.sql | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql index 99e79dcf5ab..11541aa455b 100644 --- a/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql @@ -35,6 +35,18 @@ dexs_v2 AS ( pair_column_name = 'pool' ) }} +), + +dexs_v2_cl AS ( + {{ + uniswap_compatible_v3_trades( + blockchain = 'optimism', + project = 'velodrome', + version = '2', + Pair_evt_Swap = source('velodrome_v2_optimism', 'CLPool_evt_Swap'), + Factory_evt_PoolCreated = source('velodrome_v2_optimism', 'CLFactory_evt_PoolCreated') + ) + }} ) SELECT @@ -74,3 +86,22 @@ SELECT dexs_v2.tx_hash, dexs_v2.evt_index FROM dexs_v2 +UNION ALL +SELECT + dexs_v2_cl.blockchain, + dexs_v2_cl.project, + dexs_v2_cl.version, + dexs_v2_cl.block_month, + dexs_v2_cl.block_date, + dexs_v2_cl.block_time, + dexs_v2_cl.block_number, + dexs_v2_cl.token_bought_amount_raw, + dexs_v2_cl.token_sold_amount_raw, + dexs_v2_cl.token_bought_address, + dexs_v2_cl.token_sold_address, + dexs_v2_cl.taker, + dexs_v2_cl.maker, + dexs_v2_cl.project_contract_address, + dexs_v2_cl.tx_hash, + dexs_v2_cl.evt_index +FROM dexs_v2_cl From c4d01fa7dd471d8542c0b8b8b3714c3ceaa618a5 Mon Sep 17 00:00:00 2001 From: 0xdatawolf001 <0xdatawolf@gmail.com> Date: Sat, 26 Oct 2024 16:25:47 +0800 Subject: [PATCH 2/4] add optional columns parameter --- .../optimism/platforms/velodrome_optimism_base_trades.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql index 11541aa455b..8c54b0ba601 100644 --- a/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql @@ -44,7 +44,8 @@ dexs_v2_cl AS ( project = 'velodrome', version = '2', Pair_evt_Swap = source('velodrome_v2_optimism', 'CLPool_evt_Swap'), - Factory_evt_PoolCreated = source('velodrome_v2_optimism', 'CLFactory_evt_PoolCreated') + Factory_evt_PoolCreated = source('velodrome_v2_optimism', 'CLFactory_evt_PoolCreated'), + optional_columns = [] ) }} ) From 7f5802b1e34f2d95907b0009781160efc9b8f3df Mon Sep 17 00:00:00 2001 From: 0xdatawolf001 <0xdatawolf@gmail.com> Date: Sat, 2 Nov 2024 14:46:00 +0800 Subject: [PATCH 3/4] Change version from 2 to 2_cl --- .../optimism/platforms/velodrome_optimism_base_trades.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql index 8c54b0ba601..5d1892499c3 100644 --- a/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/platforms/velodrome_optimism_base_trades.sql @@ -42,7 +42,7 @@ dexs_v2_cl AS ( uniswap_compatible_v3_trades( blockchain = 'optimism', project = 'velodrome', - version = '2', + version = '2_cl', Pair_evt_Swap = source('velodrome_v2_optimism', 'CLPool_evt_Swap'), Factory_evt_PoolCreated = source('velodrome_v2_optimism', 'CLFactory_evt_PoolCreated'), optional_columns = [] From f662aa15b3bfdfc03df7de53efbc40baa9c99e59 Mon Sep 17 00:00:00 2001 From: 0xdatawolf001 <0xdatawolf@gmail.com> Date: Sat, 2 Nov 2024 15:10:02 +0800 Subject: [PATCH 4/4] Updated velodrome op seed file --- .../dex/seeds/trades/velodrome_optimism_base_trades_seed.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/dbt_subprojects/dex/seeds/trades/velodrome_optimism_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/velodrome_optimism_base_trades_seed.csv index f01ea5b7d49..b307799c535 100644 --- a/dbt_subprojects/dex/seeds/trades/velodrome_optimism_base_trades_seed.csv +++ b/dbt_subprojects/dex/seeds/trades/velodrome_optimism_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 optimism,velodrome,1,2022-12-02,0x8c4641cbf23a94be095e73660510f7e265d76601b414ea6f838f651609741c87,7,0x7f5c764cbc14f9669b88837ca1490cca17c31607,0x4200000000000000000000000000000000000042,44680205,338699889,311000000000000000000 optimism,velodrome,1,2022-12-02,0x52e9f5710d07923e189104e31b1c98f569a9fa038b41b67043e9b991fcf7a95f,5,0x7f5c764cbc14f9669b88837ca1490cca17c31607,0x4200000000000000000000000000000000000042,44680219,896242313,823875076815262169601 +optimism,velodrome,2_cl,2024-11-02,0x51640a4ccd7d75ef0a220f98c2d8933bec9aaf999500915978e9946b291f360b,51,0x4200000000000000000000000000000000000042,0x4200000000000000000000000000000000000006,127465980,100818951495215196673,60129070969035172 \ No newline at end of file