diff --git a/dbt_subprojects/dex/models/trades/viction/_schema.yml b/dbt_subprojects/dex/models/trades/viction/_schema.yml index 10064db89a8..e04f036acab 100644 --- a/dbt_subprojects/dex/models/trades/viction/_schema.yml +++ b/dbt_subprojects/dex/models/trades/viction/_schema.yml @@ -5,21 +5,6 @@ models: data_tests: - check_dex_info_relationship - - name: victionswap_viction_base_trades - meta: - blockchain: viction - sector: dex - project: victionswap - contributors: hosuke - config: - tags: [ 'viction', 'dex', 'trades', 'victionswap', 'v2' ] - description: "VictionSwap base trades" - data_tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - tx_hash - - evt_index - - name: baryon_viction_base_trades meta: blockchain: viction diff --git a/dbt_subprojects/dex/models/trades/viction/dex_viction_base_trades.sql b/dbt_subprojects/dex/models/trades/viction/dex_viction_base_trades.sql index 38338250ff5..a13de9fd61b 100644 --- a/dbt_subprojects/dex/models/trades/viction/dex_viction_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/viction/dex_viction_base_trades.sql @@ -6,10 +6,11 @@ }} {% set base_models = [ - ref('victionswap_viction_base_trades') - , ref('baryon_viction_base_trades') - , ref('rabbitswap_viction_base_trades') - , ref('mori_viction_base_trades') + -- Pending for Swap event tables + ref('baryon_viction_base_trades'), + ref('rabbitswap_viction_base_trades') + -- Pending for contract deployment and event tables + -- ref('mori_viction_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/viction/platforms/baryon_viction_base_trades.sql b/dbt_subprojects/dex/models/trades/viction/platforms/baryon_viction_base_trades.sql index 293063deb4d..40a7077e5be 100644 --- a/dbt_subprojects/dex/models/trades/viction/platforms/baryon_viction_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/viction/platforms/baryon_viction_base_trades.sql @@ -1,3 +1,8 @@ +/* + TODO: This model is pending for Swap event table + Currently only PairCreated event is available +*/ + {{ config( schema = 'baryon_viction', @@ -10,12 +15,34 @@ ) }} +/* Uncomment when Swap event table is available {{ uniswap_compatible_v2_trades( blockchain = 'viction', project = 'baryon', version = '2', - Pair_evt_Swap = source('baryon_viction', 'UniswapV2Pair_evt_Swap'), - Factory_evt_PairCreated = source('baryon_viction', 'UniswapV2Factory_evt_PairCreated') + Pair_evt_Swap = source('baryon_viction', 'CONTRACT_PAIR_evt_Swap'), + Factory_evt_PairCreated = source('baryon_viction', 'CONTRACT_FACTORY_evt_PairCreated') ) }} +*/ + +-- Return empty result set for now +SELECT + 'viction' as blockchain, + 'baryon' as project, + '2' as version, + CAST(NULL as timestamp) as block_month, + CAST(NULL as date) as block_date, + CAST(NULL as timestamp) as block_time, + CAST(NULL as bigint) as block_number, + CAST(NULL as double) as token_bought_amount_raw, + CAST(NULL as double) as token_sold_amount_raw, + CAST(NULL as string) as token_bought_address, + CAST(NULL as string) as token_sold_address, + CAST(NULL as string) as taker, + CAST(NULL as string) as maker, + CAST(NULL as string) as project_contract_address, + CAST(NULL as string) as tx_hash, + CAST(NULL as integer) as evt_index +WHERE 1=0 diff --git a/dbt_subprojects/dex/models/trades/viction/platforms/rabbitswap_viction_base_trades.sql b/dbt_subprojects/dex/models/trades/viction/platforms/rabbitswap_viction_base_trades.sql index 651e30d3fab..ed8fbf9b5f2 100644 --- a/dbt_subprojects/dex/models/trades/viction/platforms/rabbitswap_viction_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/viction/platforms/rabbitswap_viction_base_trades.sql @@ -1,6 +1,11 @@ +/* + TODO: This model is pending for Swap event table + Currently only PoolCreated event is available +*/ + {{ config( - schema = 'rabbitswap_viction', + schema = 'rabbitswap_xyz_viction', alias = 'base_trades', materialized = 'incremental', file_format = 'delta', @@ -10,12 +15,34 @@ ) }} +/* Uncomment when Swap event table is available {{ uniswap_compatible_v3_trades( blockchain = 'viction', project = 'rabbitswap', version = '3', - Pair_evt_Swap = source('rabbitswap_viction', 'UniswapV3Pool_evt_Swap'), - Factory_evt_PoolCreated = source('rabbitswap_viction', 'UniswapV3Factory_evt_PoolCreated') + Pair_evt_Swap = source('rabbitswap_xyz_viction', 'RabbitSwapV3Pool_evt_Swap'), + Factory_evt_PoolCreated = source('rabbitswap_xyz_viction', 'RabbitSwapV3Factory_evt_PoolCreated') ) }} +*/ + +-- Return empty result set for now +SELECT + 'viction' as blockchain, + 'rabbitswap' as project, + '3' as version, + CAST(NULL as timestamp) as block_month, + CAST(NULL as date) as block_date, + CAST(NULL as timestamp) as block_time, + CAST(NULL as bigint) as block_number, + CAST(NULL as double) as token_bought_amount_raw, + CAST(NULL as double) as token_sold_amount_raw, + CAST(NULL as string) as token_bought_address, + CAST(NULL as string) as token_sold_address, + CAST(NULL as string) as taker, + CAST(NULL as string) as maker, + CAST(NULL as string) as project_contract_address, + CAST(NULL as string) as tx_hash, + CAST(NULL as integer) as evt_index +WHERE 1=0 diff --git a/dbt_subprojects/dex/models/trades/viction/platforms/victionswap_viction_base_trades.sql b/dbt_subprojects/dex/models/trades/viction/platforms/victionswap_viction_base_trades.sql deleted file mode 100644 index a2f226a6611..00000000000 --- a/dbt_subprojects/dex/models/trades/viction/platforms/victionswap_viction_base_trades.sql +++ /dev/null @@ -1,21 +0,0 @@ -{{ - config( - schema = 'victionswap_viction', - alias = 'base_trades', - materialized = 'incremental', - file_format = 'delta', - incremental_strategy = 'merge', - unique_key = ['tx_hash', 'evt_index'], - incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] - ) -}} - -{{ - uniswap_compatible_v2_trades( - blockchain = 'viction', - project = 'victionswap', - version = '2', - Pair_evt_Swap = source('victionswap_viction', 'UniswapV2Pair_evt_Swap'), - Factory_evt_PairCreated = source('victionswap_viction', 'UniswapV2Factory_evt_PairCreated') - ) -}} diff --git a/sources/_sector/dex/trades/viction/_sources.yml b/sources/_sector/dex/trades/viction/_sources.yml new file mode 100644 index 00000000000..988f3b51037 --- /dev/null +++ b/sources/_sector/dex/trades/viction/_sources.yml @@ -0,0 +1,20 @@ +version: 2 + +sources: + - name: baryon_viction + tables: + - name: CONTRACT_FACTORY_evt_PairCreated + # Pending for Swap event table + # - name: CONTRACT_PAIR_evt_Swap + + - name: rabbitswap_xyz_viction + tables: + - name: RabbitSwapV3Factory_evt_PoolCreated + # Pending for Swap event table + # - name: RabbitSwapV3Pool_evt_Swap + + # Pending for contract deployment and event tables + # - name: mori_viction + # tables: + # - name: UniswapV3Pool_evt_Swap + # - name: UniswapV3Factory_evt_PoolCreated