Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dex.trades with Gravity finance #7324

Merged
merged 14 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,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)
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: jetswap
blanchemaria6 marked this conversation as resolved.
Show resolved Hide resolved
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,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
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
Loading