From b59c08c9f34a516d74d73ed42b2037153225dec7 Mon Sep 17 00:00:00 2001 From: Bilbo Baggins Date: Sun, 9 Jun 2024 20:09:02 +0200 Subject: [PATCH] Add missing spells for Solidly V3 Now it should be available in dex.trades --- .../_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 | 18 ++++++ .../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 ++++++++++++++++++- .../_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 +- 16 files changed, 220 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 diff --git a/models/_sector/dex/trades/arbitrum/_schema.yml b/models/_sector/dex/trades/arbitrum/_schema.yml index 5cb626fbaa7..1f30caedf27 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_arbitrum_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..694342687d3 100644 --- a/models/_sector/dex/trades/base/_schema.yml +++ b/models/_sector/dex/trades/base/_schema.yml @@ -919,3 +919,21 @@ models: filter: version: - 1 + + - name: solidly_v3_base_base_trades + meta: + blockchain: base + sector: dex + project: solidly + contributors: SolidlyLabs + config: + tags: [ 'base', 'dex', 'trades', 'solidly' ] + description: "solidly v3 base base trades" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('solidly_v3_base_base_trades_seed') + 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..04b32442838 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_ethereum_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..8b2710a3818 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_fantom_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/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