From 40a879db483ebd4f077439c944437521a4d7e8e4 Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:47:41 +0700 Subject: [PATCH 01/10] Update dex_info.sql --- dbt_subprojects/dex/models/dex_info.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/dbt_subprojects/dex/models/dex_info.sql b/dbt_subprojects/dex/models/dex_info.sql index 2de3399cc3c..ddd40dbe468 100644 --- a/dbt_subprojects/dex/models/dex_info.sql +++ b/dbt_subprojects/dex/models/dex_info.sql @@ -192,4 +192,5 @@ FROM (VALUES , ('katana', 'Katana', 'Direct', 'AxieInfinity') , ('jetswap', 'JetSwap', 'Direct', 'Jetfuelfinance') , ('levinswap', 'Levinswap', 'Direct', 'levinswap') + , ('gravity_finance', 'GravityFinance', 'Direct', 'Gravity_Finance') ) AS temp_table (project, name, marketplace_type, x_username) From f25d397be3e0ebe9ccf775de9d5271d003fc66e6 Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:48:44 +0700 Subject: [PATCH 02/10] Update _schema.yml --- .../dex/models/trades/polygon/_schema.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dbt_subprojects/dex/models/trades/polygon/_schema.yml b/dbt_subprojects/dex/models/trades/polygon/_schema.yml index ede80f4ae2f..82d4e809b4d 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: jetswap + 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') From 705ab968d050e9bcfaa430610ec7119d1890dcd8 Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:49:08 +0700 Subject: [PATCH 03/10] Update dex_polygon_base_trades.sql --- .../dex/models/trades/polygon/dex_polygon_base_trades.sql | 1 + 1 file changed, 1 insertion(+) 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 ( From 76509da1afbc8cd2885700b0353e39b6947bc8bc Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:50:33 +0700 Subject: [PATCH 04/10] Create gravity_finance_polygon_base_trades.sql --- .../gravity_finance_polygon_base_trades.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 dbt_subprojects/dex/models/trades/polygon/platforms/gravity_finance_polygon_base_trades.sql 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') + ) +}} From 23ddfbbc9b950f90b3c3da53374942062763a0b3 Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:51:18 +0700 Subject: [PATCH 05/10] Update _schema.yml --- dbt_subprojects/dex/seeds/trades/_schema.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dbt_subprojects/dex/seeds/trades/_schema.yml b/dbt_subprojects/dex/seeds/trades/_schema.yml index 548192dab81..dab8d67b9c0 100644 --- a/dbt_subprojects/dex/seeds/trades/_schema.yml +++ b/dbt_subprojects/dex/seeds/trades/_schema.yml @@ -4574,3 +4574,18 @@ 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 From e080aadb77b23d64a2aa8a78f751d132672ef073 Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:54:19 +0700 Subject: [PATCH 06/10] Create gravity_finance_polygon_base_trades_seed.csv --- .../seeds/trades/gravity_finance_polygon_base_trades_seed.csv | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 dbt_subprojects/dex/seeds/trades/gravity_finance_polygon_base_trades_seed.csv 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..b19483eeafc --- /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-12-13,0x20e3bbec9ec77c34f1b26780f83983d472d386341df2bdedf2f215c217a6ae0f,280,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,0x03b54a6e9a984069379fae1a4fc4dbae93b3bccd,65415781,712,153150772747672 From 453e1d2cf66f6506f102ec0053bf0d5ee37eaf7e Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:55:02 +0700 Subject: [PATCH 07/10] Update _sources.yml --- sources/_sector/dex/trades/polygon/_sources.yml | 4 ++++ 1 file changed, 4 insertions(+) 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 From 3861bdd5e2fe153efe80744252c153cda6eb5cca Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:22:14 +0700 Subject: [PATCH 08/10] Update gravity_finance_polygon_base_trades_seed.csv --- .../seeds/trades/gravity_finance_polygon_base_trades_seed.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index b19483eeafc..b25535c910e 100644 --- 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 @@ -1,2 +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-12-13,0x20e3bbec9ec77c34f1b26780f83983d472d386341df2bdedf2f215c217a6ae0f,280,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,0x03b54a6e9a984069379fae1a4fc4dbae93b3bccd,65415781,712,153150772747672 +polygon,gravity_finance,1,2024-11-17,0x83a1ea6fefce0f22da8a3afb07268ef334d32a46c32040c9f67882b781749057,587,0x03b54a6e9a984069379fae1a4fc4dbae93b3bccd,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,64393636,216474154607113,881 From 67791c4b4d3d6af60747f7f51f9d9f6b0cdd3397 Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:35:42 +0700 Subject: [PATCH 09/10] Update gravity_finance_polygon_base_trades_seed.csv --- .../seeds/trades/gravity_finance_polygon_base_trades_seed.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index b25535c910e..56ffaf7b480 100644 --- 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 @@ -1,2 +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,0x03b54a6e9a984069379fae1a4fc4dbae93b3bccd,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,64393636,216474154607113,881 +polygon,gravity_finance,1,2024-11-17,0x83a1ea6fefce0f22da8a3afb07268ef334d32a46c32040c9f67882b781749057,587,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,0x03b54a6e9a984069379fae1a4fc4dbae93b3bccd,64393636,881,216474154607113 From 434b46e473b3c98c3308ecc95b80de894e70b7fd Mon Sep 17 00:00:00 2001 From: blanchemaria6 <130497866+blanchemaria6@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:13:50 +0700 Subject: [PATCH 10/10] Update dbt_subprojects/dex/models/trades/polygon/_schema.yml Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com> --- dbt_subprojects/dex/models/trades/polygon/_schema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt_subprojects/dex/models/trades/polygon/_schema.yml b/dbt_subprojects/dex/models/trades/polygon/_schema.yml index 82d4e809b4d..f96740412f2 100644 --- a/dbt_subprojects/dex/models/trades/polygon/_schema.yml +++ b/dbt_subprojects/dex/models/trades/polygon/_schema.yml @@ -418,7 +418,7 @@ models: meta: blockchain: polygon sector: dex - project: jetswap + project: gravity_finance contributors: blanchemaria6 config: tags: [ 'polygon', 'dex', 'trades', 'gravity_finance' ]