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

Add gridex on polygon to dex.trades #6143

Merged
merged 6 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
20 changes: 20 additions & 0 deletions dex/models/trades/polygon/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,23 @@ models:
seed_file: ref('uniswap_polygon_base_trades_seed')
filter:
version: 2

- name: gridex_polygon_base_trades
meta:
blockchain: polygon
sector: dex
project: gridex
contributors: blanchemaria6
config:
tags: [ 'polygon', 'dex', 'trades', 'gridex' ]
description: "gridex polygon base trades"
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('gridex_polygon_base_trades_seed')
filter:
version: 1

1 change: 1 addition & 0 deletions dex/models/trades/polygon/dex_polygon_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
, ref('xchange_polygon_base_trades')
, ref('dooar_polygon_base_trades')
, ref('uniswap_v2_polygon_base_trades')
, ref('gridex_polygon_base_trades')
] %}

WITH base_union AS (
Expand Down
25 changes: 25 additions & 0 deletions dex/models/trades/polygon/platforms/gridex_polygon_base_trades.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{
config(
schema = 'gridex_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_v3_trades(
blockchain = 'polygon',
project = 'gridex',
version = '1',
Pair_evt_Swap = source('gridex_polygon', 'GridPair_evt_Swap'),
Factory_evt_PoolCreated = source('gridex_polygon', 'GridFactory_evt_GridCreated'),
taker_column_name = 'sender',
maker_column_name = 'recipient',
optional_columns = null,
pair_column_name = 'grid'
)
}}
15 changes: 15 additions & 0 deletions dex/seeds/trades/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3600,3 +3600,18 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: gridex_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
2 changes: 2 additions & 0 deletions dex/seeds/trades/gridex_polygon_base_trades_seed.csv
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,gridex,1,2023-09-05,0x66c372a49c17f07337b331fe5e76ceda9b968e6cf22170c88281632637e53276,120,0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0x924442a46eac25646b520da8d78218ae8ff437c2,47167864,72079513,30000000000000000000000
5 changes: 5 additions & 0 deletions sources/_sector/dex/trades/polygon/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ sources:
tables:
- name: DooarSwapV2Pair_evt_Swap
- name: DooarSwapV2Factory_evt_PairCreated
- name: gridex_polygon
tables:
- name: GridFactory_evt_GridCreated
- name: GridPair_evt_Swap

Loading