Skip to content

Commit

Permalink
Update dex.trades with Gravity finance (#7324)
Browse files Browse the repository at this point in the history
* Update dex_info.sql

* Update _schema.yml

* Update dex_polygon_base_trades.sql

* Create gravity_finance_polygon_base_trades.sql

* Update _schema.yml

* Create gravity_finance_polygon_base_trades_seed.csv

* Update _sources.yml

* Update gravity_finance_polygon_base_trades_seed.csv

* Update gravity_finance_polygon_base_trades_seed.csv

* Update dbt_subprojects/dex/models/trades/polygon/_schema.yml

Co-authored-by: jeff-dude <[email protected]>

---------

Co-authored-by: jeff-dude <[email protected]>
Co-authored-by: 0xRob <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2024
1 parent 9c81e91 commit b272595
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 1 deletion.
1 change: 1 addition & 0 deletions dbt_subprojects/dex/models/dex_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 17 additions & 1 deletion dbt_subprojects/dex/models/trades/polygon/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
@@ -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')
)
}}
15 changes: 15 additions & 0 deletions dbt_subprojects/dex/seeds/trades/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions sources/_sector/dex/trades/polygon/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b272595

Please sign in to comment.