From 4a1a4476611f47cffb66f67f7d4dfbc5ee8c353d Mon Sep 17 00:00:00 2001 From: Bilbo Baggins Date: Sun, 9 Jun 2024 20:09:02 +0200 Subject: [PATCH] Add Solidly V3 to dex.trades Only Optimism was available. Added missing chains: 1. Arbitrum 2. Base 3. Ethereum 4. Fantom --- .../_sector/dex/trades/arbitrum/_schema.yml | 18 ++++++ .../arbitrum/dex_arbitrum_base_trades.sql | 1 + .../solidly_v3_arbitrum_base_trades.sql | 21 +++++++ models/_sector/dex/trades/base/_schema.yml | 1 + .../dex/trades/base/dex_base_base_trades.sql | 3 +- .../_sector/dex/trades/ethereum/_schema.yml | 18 ++++++ .../ethereum/dex_ethereum_base_trades.sql | 3 +- .../solidly_v3_ethereum_base_trades.sql | 21 +++++++ models/_sector/dex/trades/fantom/_schema.yml | 18 ++++++ .../trades/fantom/dex_fantom_base_trades.sql | 3 +- .../solidly_v3_fantom_base_trades.sql | 21 +++++++ seeds/_sector/dex/_schema.yml | 62 ++++++++++++++++++- .../solidly_v3_arbitrum_base_trades_seed.csv | 4 ++ .../dex/solidly_v3_base_base_trades_seed.csv | 4 ++ .../solidly_v3_ethereum_base_trades_seed.csv | 4 ++ .../solidly_v3_fantom_base_trades_seed.csv | 4 ++ .../_sector/dex/trades/arbitrum/_sources.yml | 7 ++- .../_sector/dex/trades/ethereum/_sources.yml | 5 ++ .../_sector/dex/trades/fantom/_sources.yml | 5 ++ .../_sector/dex/trades/optimism/_sources.yml | 2 +- 20 files changed, 219 insertions(+), 6 deletions(-) create mode 100644 models/_sector/dex/trades/arbitrum/platforms/solidly_v3_arbitrum_base_trades.sql create mode 100644 models/_sector/dex/trades/ethereum/platforms/solidly_v3_ethereum_base_trades.sql create mode 100644 models/_sector/dex/trades/fantom/platforms/solidly_v3_fantom_base_trades.sql create mode 100644 seeds/_sector/dex/solidly_v3_arbitrum_base_trades_seed.csv create mode 100644 seeds/_sector/dex/solidly_v3_base_base_trades_seed.csv create mode 100644 seeds/_sector/dex/solidly_v3_ethereum_base_trades_seed.csv create mode 100644 seeds/_sector/dex/solidly_v3_fantom_base_trades_seed.csv diff --git a/models/_sector/dex/trades/arbitrum/_schema.yml b/models/_sector/dex/trades/arbitrum/_schema.yml index 5cb626fbaa7..4c9e3f89d73 100644 --- a/models/_sector/dex/trades/arbitrum/_schema.yml +++ b/models/_sector/dex/trades/arbitrum/_schema.yml @@ -680,3 +680,21 @@ models: - evt_index - check_dex_base_trades_seed: seed_file: ref('wombat_exchange_arbitrum_base_trades_seed') + + - name: solidly_v3_arbitrum_base_trades + meta: + blockchain: arbitrum + sector: dex + project: solidly + contributors: SolidlyLabs + config: + tags: [ 'arbitrum', 'dex', 'trades', 'solidly' ] + description: "solidly v3 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('solidly_v3_arbitrum_base_trades_seed') + diff --git a/models/_sector/dex/trades/arbitrum/dex_arbitrum_base_trades.sql b/models/_sector/dex/trades/arbitrum/dex_arbitrum_base_trades.sql index ae013b11123..f64e73dc37f 100644 --- a/models/_sector/dex/trades/arbitrum/dex_arbitrum_base_trades.sql +++ b/models/_sector/dex/trades/arbitrum/dex_arbitrum_base_trades.sql @@ -42,6 +42,7 @@ , ref('uniswap_v2_arbitrum_base_trades') , ref('auragi_arbitrum_base_trades') , ref('wombat_exchange_arbitrum_base_trades') + , ref('solidly_v3_arbitrum_base_trades') ] %} WITH base_union AS ( diff --git a/models/_sector/dex/trades/arbitrum/platforms/solidly_v3_arbitrum_base_trades.sql b/models/_sector/dex/trades/arbitrum/platforms/solidly_v3_arbitrum_base_trades.sql new file mode 100644 index 00000000000..a4bc03ada4e --- /dev/null +++ b/models/_sector/dex/trades/arbitrum/platforms/solidly_v3_arbitrum_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'solidly_v3_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')] + ) +}} + +{{ + uniswap_compatible_v3_trades( + blockchain = 'arbitrum', + project = 'solidly', + version = '3', + Pair_evt_Swap = source('solidly_v3_arbitrum', 'SolidlyV3Pool_evt_Swap'), + Factory_evt_PoolCreated = source('solidly_v3_arbitrum', 'SolidlyV3Factory_evt_PoolCreated') + ) +}} diff --git a/models/_sector/dex/trades/base/_schema.yml b/models/_sector/dex/trades/base/_schema.yml index ff2a1facc90..d4f9a7483eb 100644 --- a/models/_sector/dex/trades/base/_schema.yml +++ b/models/_sector/dex/trades/base/_schema.yml @@ -919,3 +919,4 @@ models: filter: version: - 1 + diff --git a/models/_sector/dex/trades/base/dex_base_base_trades.sql b/models/_sector/dex/trades/base/dex_base_base_trades.sql index e54d5a1d8f5..f4c6151640b 100644 --- a/models/_sector/dex/trades/base/dex_base_base_trades.sql +++ b/models/_sector/dex/trades/base/dex_base_base_trades.sql @@ -45,6 +45,7 @@ , ref('alienbase_base_base_trades') , ref('swapbased_base_base_trades') , ref('clipper_base_base_trades') + , ref('solidly_v3_base_base_trades') ] %} WITH base_union AS ( @@ -83,4 +84,4 @@ WITH base_union AS ( , blockchain = 'base' , columns = ['from', 'to', 'index'] ) -}} \ No newline at end of file +}} diff --git a/models/_sector/dex/trades/ethereum/_schema.yml b/models/_sector/dex/trades/ethereum/_schema.yml index 1e022c331a2..6f0d942e074 100644 --- a/models/_sector/dex/trades/ethereum/_schema.yml +++ b/models/_sector/dex/trades/ethereum/_schema.yml @@ -543,3 +543,21 @@ models: - Factory V2 - Factory V2 updated - Regular + + - name: solidly_v3_ethereum_base_trades + meta: + blockchain: ethereum + sector: dex + project: solidly + contributors: SolidlyLabs + config: + tags: [ 'ethereum', 'dex', 'trades', 'solidly' ] + description: "solidly v3 ethereum base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('solidly_v3_ethereum_base_trades_seed') + diff --git a/models/_sector/dex/trades/ethereum/dex_ethereum_base_trades.sql b/models/_sector/dex/trades/ethereum/dex_ethereum_base_trades.sql index 20b466dbe0e..914ccc9914c 100644 --- a/models/_sector/dex/trades/ethereum/dex_ethereum_base_trades.sql +++ b/models/_sector/dex/trades/ethereum/dex_ethereum_base_trades.sql @@ -34,6 +34,7 @@ , ref('mstable_ethereum_base_trades') , ref('xchange_ethereum_base_trades') , ref('curvefi_ethereum_base_trades') + , ref('solidly_v3_ethereum_base_trades') ] %} WITH base_union AS ( @@ -72,4 +73,4 @@ WITH base_union AS ( , blockchain = 'ethereum' , columns = ['from', 'to', 'index'] ) -}} \ No newline at end of file +}} diff --git a/models/_sector/dex/trades/ethereum/platforms/solidly_v3_ethereum_base_trades.sql b/models/_sector/dex/trades/ethereum/platforms/solidly_v3_ethereum_base_trades.sql new file mode 100644 index 00000000000..0d583563c50 --- /dev/null +++ b/models/_sector/dex/trades/ethereum/platforms/solidly_v3_ethereum_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'solidly_v3_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')] + ) +}} + +{{ + uniswap_compatible_v3_trades( + blockchain = 'ethereum', + project = 'solidly', + version = '3', + Pair_evt_Swap = source('solidly_ethereum', 'SolidlyV3Pool_evt_Swap'), + Factory_evt_PoolCreated = source('solidly_v3_ethereum', 'SolidlyV3Factory_evt_PoolCreated') + ) +}} diff --git a/models/_sector/dex/trades/fantom/_schema.yml b/models/_sector/dex/trades/fantom/_schema.yml index 33a411d0161..49d0f491023 100644 --- a/models/_sector/dex/trades/fantom/_schema.yml +++ b/models/_sector/dex/trades/fantom/_schema.yml @@ -186,3 +186,21 @@ models: - evt_index - check_dex_base_trades_seed: seed_file: ref('curvefi_fantom_base_trades_seed') + + - name: solidly_v3_fantom_base_trades + meta: + blockchain: fantom + sector: dex + project: solidly + contributors: SolidlyLabs + config: + tags: [ 'fantom', 'dex', 'trades', 'solidly' ] + description: "solidly v3 fantom base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('solidly_v3_fantom_base_trades_seed') + diff --git a/models/_sector/dex/trades/fantom/dex_fantom_base_trades.sql b/models/_sector/dex/trades/fantom/dex_fantom_base_trades.sql index ad1106b6295..fbb56f4c046 100644 --- a/models/_sector/dex/trades/fantom/dex_fantom_base_trades.sql +++ b/models/_sector/dex/trades/fantom/dex_fantom_base_trades.sql @@ -16,6 +16,7 @@ , ref('openocean_fantom_base_trades') , ref('beethoven_x_fantom_base_trades') , ref('curvefi_fantom_base_trades') + , ref('solidly_v3_fantom_base_trades') ] %} WITH base_union AS ( @@ -54,4 +55,4 @@ WITH base_union AS ( , blockchain = 'fantom' , columns = ['from', 'to', 'index'] ) -}} \ No newline at end of file +}} diff --git a/models/_sector/dex/trades/fantom/platforms/solidly_v3_fantom_base_trades.sql b/models/_sector/dex/trades/fantom/platforms/solidly_v3_fantom_base_trades.sql new file mode 100644 index 00000000000..91ee0a2c56d --- /dev/null +++ b/models/_sector/dex/trades/fantom/platforms/solidly_v3_fantom_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'solidly_v3_fantom', + 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 = 'fantom', + project = 'solidly', + version = '3', + Pair_evt_Swap = source('solidly_v3_fantom', 'SolidlyV3Pool_evt_Swap'), + Factory_evt_PoolCreated = source('solidly_v3_fantom', 'SolidlyV3Factory_evt_PoolCreated') + ) +}} diff --git a/seeds/_sector/dex/_schema.yml b/seeds/_sector/dex/_schema.yml index 2c6c8156c2e..8a638f8977b 100644 --- a/seeds/_sector/dex/_schema.yml +++ b/seeds/_sector/dex/_schema.yml @@ -2641,6 +2641,67 @@ seeds: token_sold_amount_raw: uint256 block_date: timestamp + - name: solidly_v3_arbitrum_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: solidly_v3_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: solidly_v3_ethereum_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: solidly_v3_fantom_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: solidly_v3_optimism_base_trades_seed config: column_types: @@ -2655,7 +2716,6 @@ seeds: token_bought_amount_raw: uint256 token_sold_amount_raw: uint256 block_date: timestamp - - name: throne_exchange_v2_base_base_trades_seed config: diff --git a/seeds/_sector/dex/solidly_v3_arbitrum_base_trades_seed.csv b/seeds/_sector/dex/solidly_v3_arbitrum_base_trades_seed.csv new file mode 100644 index 00000000000..e51feaabe50 --- /dev/null +++ b/seeds/_sector/dex/solidly_v3_arbitrum_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 +arbitrum,solidly,3,2024-02-03 00:00,0x52c606cf45d6ed8fc2a4da3f60c03689f600304583fdd1785d72ec1fce91867a,0,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0x777cf5ba9c291a1a8f57ff14836f6f9dc5c0f9dd,176909487,36416857171863695,59387847732386017794 +arbitrum,solidly,3,2024-02-20 00:00,0xa13d2c0ac281d50be8df4d2e3de66b29d05cade284713e8c187e15859dad8773,3,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0x777cf5ba9c291a1a8f57ff14836f6f9dc5c0f9dd,182782312,22492992787274686,81464201443220691722 +arbitrum,solidly,3,2024-02-20 00:00,0x106440bdc160cbcc6399b52ba3eea82d189e241efe972872c2f82ed5a64789f8,1,0x82af49447d8a07e3bd95bd0d56f35241523fbab1,0x777cf5ba9c291a1a8f57ff14836f6f9dc5c0f9dd,182822978,6534900983689228,22422394504796743842 diff --git a/seeds/_sector/dex/solidly_v3_base_base_trades_seed.csv b/seeds/_sector/dex/solidly_v3_base_base_trades_seed.csv new file mode 100644 index 00000000000..19a55ab1cd3 --- /dev/null +++ b/seeds/_sector/dex/solidly_v3_base_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 +base,solidly,3,2024-06-10 00:00,0x706e92a6f8a93d017b4fdf60fc5a584bfea18a8638ec451c020d3df7573de64c,778,0x4200000000000000000000000000000000000006,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,15609599,22040269642169822,80932998 +base,solidly,3,2024-06-10 00:00,0x2c3e8953eef8bb916a0790f09c18b6a138224f23bc85a530261b71e759deab7e,97,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913,0x4200000000000000000000000000000000000006,15607737,24639725,6716121101724876 +base,solidly,3,2024-06-10 00:00,0x2c3e8953eef8bb916a0790f09c18b6a138224f23bc85a530261b71e759deab7e,73,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x4200000000000000000000000000000000000006,15607737,43407460,11830085711227632 diff --git a/seeds/_sector/dex/solidly_v3_ethereum_base_trades_seed.csv b/seeds/_sector/dex/solidly_v3_ethereum_base_trades_seed.csv new file mode 100644 index 00000000000..3f625b227d0 --- /dev/null +++ b/seeds/_sector/dex/solidly_v3_ethereum_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 +ethereum,solidly,3,2024-06-10 00:00,0x20fa27abd1fe594fc8a5ce9bcd5570eb60aba66096edc6c91ef5c0a99a73fa6c,13,0xdac17f958d2ee523a2206206994597c13d831ec7,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,20060409,3000185944,3000000000 +ethereum,solidly,3,2024-06-10 00:00,0xcc56cb586f080bf4373a8bcc155eb196207371b1883afa79bfdf4c677ebfe322,184,0xdac17f958d2ee523a2206206994597c13d831ec7,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,20060404,416368244,113284585282640407 +ethereum,solidly,3,2024-06-10 00:00,0x0515f6832b29bc2a4bbc8783cd73d9de21b5c18fac995f4fd74227308c0e83a8,387,0x514910771af9ca656af840dff83e8264ecf986ca,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,20060407,8734073046064652081,37947785482442443 diff --git a/seeds/_sector/dex/solidly_v3_fantom_base_trades_seed.csv b/seeds/_sector/dex/solidly_v3_fantom_base_trades_seed.csv new file mode 100644 index 00000000000..596d3f9eceb --- /dev/null +++ b/seeds/_sector/dex/solidly_v3_fantom_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 +fantom,solidly,3,2024-06-07 00:00,0x462dc78dbf5a2b4ce5b6995d6a38d56531d3301b25a24b76de8f76f3c450fbe2,0,0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83,0x777cf5ba9c291a1a8f57ff14836f6f9dc5c0f9dd,82468153,11044657622844009042,21850742643724726685 +fantom,solidly,3,2024-06-08 00:00,0x85c64e4ae23bcb6480f4fac1981bbae30a7181a5f3509b5cd87314582f0ca1d9,0,0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83,0x777cf5ba9c291a1a8f57ff14836f6f9dc5c0f9dd,82468593,43457629613780119432,86051119761832979402 +fantom,solidly,3,2024-06-08 00:00,0xfeaa63121d70b7ac3a4dd50b7b11eaee7d40eb618f3a6b6e58ca6a7a0d9d0bb5,5,0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83,0x777cf5ba9c291a1a8f57ff14836f6f9dc5c0f9dd,82468732,47097938059274277077,93393856598932340439 diff --git a/sources/_sector/dex/trades/arbitrum/_sources.yml b/sources/_sector/dex/trades/arbitrum/_sources.yml index 168a3438634..79ebffec9fc 100644 --- a/sources/_sector/dex/trades/arbitrum/_sources.yml +++ b/sources/_sector/dex/trades/arbitrum/_sources.yml @@ -133,4 +133,9 @@ sources: - name: PairFactory_evt_PairCreated - name: wombatexchange_arbitrum tables: - - name: CrossChainPool_evt_SwapV2 \ No newline at end of file + - name: CrossChainPool_evt_SwapV2 + - name: solidly_v3_arbitrum + tables: + - name: SolidlyV3Factory_evt_PoolCreated + - name: SolidlyV3Pool_evt_Swap + diff --git a/sources/_sector/dex/trades/ethereum/_sources.yml b/sources/_sector/dex/trades/ethereum/_sources.yml index 8e70e8f27a2..05709d757ad 100644 --- a/sources/_sector/dex/trades/ethereum/_sources.yml +++ b/sources/_sector/dex/trades/ethereum/_sources.yml @@ -107,3 +107,8 @@ sources: tables: - name: XchangePair_evt_Swap - name: XchangeFactory_evt_PairCreated + - name: solidly_v3_ethereum + tables: + - name: SolidlyV3Factory_evt_PoolCreated + - name: SolidlyV3Pool_evt_Swap + diff --git a/sources/_sector/dex/trades/fantom/_sources.yml b/sources/_sector/dex/trades/fantom/_sources.yml index 961a891be23..108677ae04a 100644 --- a/sources/_sector/dex/trades/fantom/_sources.yml +++ b/sources/_sector/dex/trades/fantom/_sources.yml @@ -36,3 +36,8 @@ sources: tables: - name: StableSwap_evt_TokenExchange - name: StableSwap_evt_TokenExchangeUnderlying + - name: solidly_v3_fantom + tables: + - name: SolidlyV3Factory_evt_PoolCreated + - name: SolidlyV3Pool_evt_Swap + diff --git a/sources/_sector/dex/trades/optimism/_sources.yml b/sources/_sector/dex/trades/optimism/_sources.yml index 413ef76e6cb..765fc08abd4 100644 --- a/sources/_sector/dex/trades/optimism/_sources.yml +++ b/sources/_sector/dex/trades/optimism/_sources.yml @@ -91,4 +91,4 @@ sources: - name: fraxswap_optimism tables: - name: FraxswapPair_evt_Swap - - name: FraxswapFactory_evt_PairCreated \ No newline at end of file + - name: FraxswapFactory_evt_PairCreated