From 497bad36a699c09471d4d12ea93c667e54ee0163 Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 28 Nov 2024 14:15:56 +0530 Subject: [PATCH] Added infusion dex on base chain --- .../dex/models/trades/base/_schema.yml | 17 ++++++++++++++++ .../trades/base/dex_base_base_trades.sql | 1 + .../platforms/infusion_base_base_trades.sql | 20 +++++++++++++++++++ dbt_subprojects/dex/seeds/trades/_schema.yml | 15 ++++++++++++++ .../trades/infusion_base_base_trades_seed.csv | 2 ++ 5 files changed, 55 insertions(+) create mode 100644 dbt_subprojects/dex/models/trades/base/platforms/infusion_base_base_trades.sql create mode 100644 dbt_subprojects/dex/seeds/trades/infusion_base_base_trades_seed.csv diff --git a/dbt_subprojects/dex/models/trades/base/_schema.yml b/dbt_subprojects/dex/models/trades/base/_schema.yml index a8010396e2a..7153589969b 100644 --- a/dbt_subprojects/dex/models/trades/base/_schema.yml +++ b/dbt_subprojects/dex/models/trades/base/_schema.yml @@ -996,3 +996,20 @@ models: - evt_index - check_dex_base_trades_seed: seed_file: ref('xchange_base_base_trades_seed') + + - name: infusion_base_base_trades + meta: + blockchain: base + sector: dex + project: infusion + contributors: jason + config: + tags: [ 'base', 'dex', 'trades', 'infusion' ] + description: "infusion base base trades" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('infusion_base_base_trades_seed') diff --git a/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql index 742449afaea..5db778b14b5 100644 --- a/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql @@ -50,6 +50,7 @@ , ref('solidly_v3_base_base_trades') , ref('swaap_v2_base_base_trades') , ref('xchange_base_base_trades') + , ref('infusion_base_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/base/platforms/infusion_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/platforms/infusion_base_base_trades.sql new file mode 100644 index 00000000000..88daf247f8c --- /dev/null +++ b/dbt_subprojects/dex/models/trades/base/platforms/infusion_base_base_trades.sql @@ -0,0 +1,20 @@ +{{ config( + schema = 'infusion_base' + , alias = 'base_trades' + , materialized = 'infusion' + , 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 = 'base' + , project = 'infusion' + , version = '1' + , Pair_evt_Swap = source('infusion_base', 'Pair_evt_Swap') + , Factory_evt_PairCreated = source('infusion_base', 'PairFactory_evt_PairCreated') + ) +}} \ No newline at end of file diff --git a/dbt_subprojects/dex/seeds/trades/_schema.yml b/dbt_subprojects/dex/seeds/trades/_schema.yml index 7186b07390a..5476ee43de1 100644 --- a/dbt_subprojects/dex/seeds/trades/_schema.yml +++ b/dbt_subprojects/dex/seeds/trades/_schema.yml @@ -4455,3 +4455,18 @@ seeds: token_bought_amount_raw: uint256 token_sold_amount_raw: uint256 block_date: timestamp + + - name: infusion_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 diff --git a/dbt_subprojects/dex/seeds/trades/infusion_base_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/infusion_base_base_trades_seed.csv new file mode 100644 index 00000000000..9026a315cd2 --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/infusion_base_base_trades_seed.csv @@ -0,0 +1,2 @@ +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,infusion,1,2024-11-28,0x7d88692c8f071f5cc7c08451d7f2cc493f745949cbc05e6579e73d292df47eb1,77,0x4200000000000000000000000000000000000006,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913,22989322,10575964385728786,38099604 \ No newline at end of file