diff --git a/dbt_subprojects/dex/models/dex_info.sql b/dbt_subprojects/dex/models/dex_info.sql index 678dbf2100d..227b69ce997 100644 --- a/dbt_subprojects/dex/models/dex_info.sql +++ b/dbt_subprojects/dex/models/dex_info.sql @@ -192,5 +192,6 @@ FROM (VALUES , ('katana', 'Katana', 'Direct', 'AxieInfinity') , ('jetswap', 'JetSwap', 'Direct', 'Jetfuelfinance') , ('levinswap', 'Levinswap', 'Direct', 'levinswap') + , ('gravity_finance', 'GravityFinance', 'Direct', 'Gravity_Finance') , ('fluid', 'Fluid DEX', 'Direct', '0xfluid') ) AS temp_table (project, name, marketplace_type, x_username) diff --git a/dbt_subprojects/dex/models/trades/polygon/_schema.yml b/dbt_subprojects/dex/models/trades/polygon/_schema.yml index ede80f4ae2f..f96740412f2 100644 --- a/dbt_subprojects/dex/models/trades/polygon/_schema.yml +++ b/dbt_subprojects/dex/models/trades/polygon/_schema.yml @@ -413,4 +413,20 @@ models: - evt_index - check_dex_base_trades_seed: seed_file: ref('jetswap_polygon_base_trades_seed') - + + - name: gravity_finance_polygon_base_trades + meta: + blockchain: polygon + sector: dex + project: gravity_finance + contributors: blanchemaria6 + config: + tags: [ 'polygon', 'dex', 'trades', 'gravity_finance' ] + description: "gravity_finance polygon 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('gravity_finance_polygon_base_trades_seed') diff --git a/dbt_subprojects/dex/models/trades/polygon/dex_polygon_base_trades.sql b/dbt_subprojects/dex/models/trades/polygon/dex_polygon_base_trades.sql index 2a324993760..dfd6b528df3 100644 --- a/dbt_subprojects/dex/models/trades/polygon/dex_polygon_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/polygon/dex_polygon_base_trades.sql @@ -27,6 +27,7 @@ , ref('swaap_v2_polygon_base_trades') , ref('dfyn_polygon_base_trades') , ref('jetswap_polygon_base_trades') + , ref('gravity_finance_polygon_base_trades') ] %} WITH base_union AS ( diff --git a/dbt_subprojects/dex/models/trades/polygon/platforms/gravity_finance_polygon_base_trades.sql b/dbt_subprojects/dex/models/trades/polygon/platforms/gravity_finance_polygon_base_trades.sql new file mode 100644 index 00000000000..618310ae78d --- /dev/null +++ b/dbt_subprojects/dex/models/trades/polygon/platforms/gravity_finance_polygon_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'gravity_finance_polygon', + 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 = 'polygon', + project = 'gravity_finance', + version = '1', + Pair_evt_Swap = source('gravity_finance_polygon', 'UniswapV2Pair_evt_Swap'), + Factory_evt_PairCreated = source('gravity_finance_polygon', 'UniswapV2Factory_evt_PairCreated') + ) +}} diff --git a/dbt_subprojects/dex/seeds/trades/_schema.yml b/dbt_subprojects/dex/seeds/trades/_schema.yml index 1bc3dd58d97..49f1c1e84a1 100644 --- a/dbt_subprojects/dex/seeds/trades/_schema.yml +++ b/dbt_subprojects/dex/seeds/trades/_schema.yml @@ -4574,6 +4574,21 @@ seeds: token_bought_amount_raw: uint256 token_sold_amount_raw: uint256 block_date: timestamp + + - name: gravity_finance_polygon_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: fluid_ethereum_base_trades_seed config: diff --git a/dbt_subprojects/dex/seeds/trades/gravity_finance_polygon_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/gravity_finance_polygon_base_trades_seed.csv new file mode 100644 index 00000000000..56ffaf7b480 --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/gravity_finance_polygon_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 +polygon,gravity_finance,1,2024-11-17,0x83a1ea6fefce0f22da8a3afb07268ef334d32a46c32040c9f67882b781749057,587,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,0x03b54a6e9a984069379fae1a4fc4dbae93b3bccd,64393636,881,216474154607113 diff --git a/sources/_sector/dex/trades/polygon/_sources.yml b/sources/_sector/dex/trades/polygon/_sources.yml index 1c1a1ddd394..0f1a0e5624e 100644 --- a/sources/_sector/dex/trades/polygon/_sources.yml +++ b/sources/_sector/dex/trades/polygon/_sources.yml @@ -79,3 +79,7 @@ sources: tables: - name: JetswapPair_evt_Swap - name: JetswapFactory_evt_PairCreated + - name: gravity_finance_polygon + tables: + - name: UniswapV2Pair_evt_Swap + - name: UniswapV2Factory_evt_PairCreated