Skip to content

Commit

Permalink
Add Jetswap on polygon to dex.trades (#7287)
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 jetswap_polygon_base_trades.sql

* Update _schema.yml

* Create jetswap_polygon_base_trades_seed

* Update _sources.yml

* Delete dbt_subprojects/dex/seeds/trades/jetswap_polygon_base_trades_seed

* Create jetswap_polygon_base_trades_seed.csv

* Update jetswap_polygon_base_trades.sql

---------

Co-authored-by: Huang Geyang <Sukebeta@outlook.com>
Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 10, 2024
1 parent cd9372c commit 1516bdd
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 0 deletions.
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 @@ -189,4 +189,5 @@ FROM (VALUES
, ('stablebase', 'StableBase', 'Direct', 'stablebasefi')
, ('flashliquidity', 'Flashliquidity', 'Direct', 'flashliquidity')
, ('akronswap', 'Akronswap', 'Direct', 'AkronFinance')
, ('jetswap', 'JetSwap', 'Direct', 'Jetfuelfinance')
) AS temp_table (project, name, marketplace_type, x_username)
18 changes: 18 additions & 0 deletions dbt_subprojects/dex/models/trades/polygon/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,21 @@ models:
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('dfyn_polygon_base_trades_seed')

- name: jetswap_polygon_base_trades
meta:
blockchain: polygon
sector: dex
project: jetswap
contributors: intensodefi
config:
tags: [ 'polygon', 'dex', 'trades', 'jetswap' ]
description: "jetswap 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('jetswap_polygon_base_trades_seed')

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
, ref('gridex_polygon_base_trades')
, ref('swaap_v2_polygon_base_trades')
, ref('dfyn_polygon_base_trades')
, ref('jetswap_polygon_base_trades')
] %}

WITH base_union AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ config(
schema = 'jetswap_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 = 'jetswap',
version = '1',
Pair_evt_Swap = source('jetswap_polygon', 'JetswapPair_evt_Swap'),
Factory_evt_PairCreated = source('jetswap_polygon', 'JetswapFactory_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 @@ -4515,6 +4515,21 @@ seeds:
token_sold_amount_raw: uint256
block_date: timestamp

- name: jetswap_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: elk_finance_gnosis_base_trades_seed
config:
column_types:
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,jetswap,1,2024-12-05,0x0aa7125eef5aefd2ca7df0e8e9161bea1c33f61b62cd3974d7be6a3726fcebba,365,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,0xe188edda9acc0166dd7030023bd33a8c6be7a0ff,65113490,175557149854780174,573564828367
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 @@ -75,3 +75,7 @@ sources:
tables:
- name: UniswapV2Pair_evt_Swap
- name: UniswapV2Factory_evt_PairCreated
- name: jetswap_polygon
tables:
- name: JetswapPair_evt_Swap
- name: JetswapFactory_evt_PairCreated

0 comments on commit 1516bdd

Please sign in to comment.