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

feat: add katana v3 dex ronin #7354

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
31 changes: 26 additions & 5 deletions dbt_subprojects/dex/models/trades/ronin/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,40 @@ models:
data_tests:
- check_dex_info_relationship

- name: katana_ronin_base_trades
- name: katana_v2_ronin_base_trades
meta:
blockchain: ronin
sector: dex
project: katana
contributors: jeff-dude
contributors: jeff-dude, cxheng315
config:
tags: [ 'ronin', 'dex', 'trades', 'katana' ]
description: "Katana ronin base trades"
tags: ["ronin", "dex", "trades", "katana"]
description: "Katana v2 ronin 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('katana_ronin_base_trades_seed')
seed_file: ref('katana_ronin_base_trades_seed')
filter:
version: 2

- name: katana_v3_ronin_base_trades
meta:
blockchain: ronin
sector: dex
project: katana
contributors: cxheng315
config:
tags: ["ronin", "dex", "trades", "katana"]
description: "Katana v3 ronin 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('katana_ronin_base_trades_seed')
filter:
version: 3
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
}}

{% set base_models = [
ref('katana_ronin_base_trades')
ref('katana_v2_ronin_base_trades')
, ref('katana_v3_ronin_base_trades')
] %}

WITH base_union AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ config(
schema = 'katana_ronin'
schema = 'katana_v2_ronin'
, alias = 'base_trades'
, materialized = 'incremental'
, file_format = 'delta'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'katana_v3_ronin'
, 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 = 'ronin'
, project = 'katana'
, version = '3'
, Pair_evt_Swap = source('katana_dex_ronin', 'KatanaV3Pool_evt_Swap')
, Factory_evt_PoolCreated = source('katana_dex_ronin', 'KatanaV3Factory_evt_PoolCreated')
)
}}
12 changes: 6 additions & 6 deletions dbt_subprojects/dex/seeds/trades/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4454,7 +4454,7 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: infusion_base_base_trades_seed
config:
column_types:
Expand Down Expand Up @@ -4514,7 +4514,7 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: akronswap_base_base_trades_seed
config:
column_types:
Expand All @@ -4529,7 +4529,7 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: katana_ronin_base_trades_seed
config:
column_types:
Expand Down Expand Up @@ -4559,7 +4559,7 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: elk_finance_gnosis_base_trades_seed
config:
column_types:
Expand All @@ -4574,7 +4574,7 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: levinswap_gnosis_base_trades_seed
config:
column_types:
Expand Down Expand Up @@ -4604,7 +4604,7 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: fluid_ethereum_base_trades_seed
config:
column_types:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
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
ronin,katana,2,2024-01-17,0xca2c3b5d6aec890d5bfe1fb8616036a01b702948107fdb4a243453cfe5a6d86a,10,0x1b918543b518e34902e1e8dd76052bee43c762ff,0xe514d9deb7966c8be0ca922de8a064264ea6bcd4,31230074,12492104858888467232497,5109345881300390132
ronin,katana,2,2023-03-01,0xcab674e07e3c5b0b6dd53b52971edabc929a2fd907b85d781f70bac74767c6e3,10,0xc99a6a985ed2cac1ef41640596c5a5f9f4e19ef5,0xe514d9deb7966c8be0ca922de8a064264ea6bcd4,22465731,1700000000000000,3070678253641756888
ronin,katana,2,2023-03-01,0xcab674e07e3c5b0b6dd53b52971edabc929a2fd907b85d781f70bac74767c6e3,10,0xc99a6a985ed2cac1ef41640596c5a5f9f4e19ef5,0xe514d9deb7966c8be0ca922de8a064264ea6bcd4,22465731,1700000000000000,3070678253641756888
ronin,katana,3,2024-12-19,0x92f922acbb1a4a80b2ad56d8b6ce2cc587f2851fac7b3e37582f7578db55ee4d,160,0xc6046fa4b8961b0e9d823bb3f2dde8fe161d547d,0xe514d9deb7966c8be0ca922de8a064264ea6bcd4,40907478,234401580938417717096,26553212520000000000
ronin,katana,3,2024-12-19,0x340763e80131db74ce992733518944ad35d1290aaae53f5eeacaeb994057f49e,39,0xe514d9deb7966c8be0ca922de8a064264ea6bcd4,0x0b7007c13325c48911f73a2dad5fa5dcbf808adc,40908371,141505036347788395809,300000000
6 changes: 5 additions & 1 deletion sources/_sector/dex/trades/ronin/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ sources:
- name: katana_dex_ronin
tables:
- name: KatanaPair_evt_Swap
- name: KatanaFactory_evt_PairCreated
- name: KatanaFactory_evt_PairCreated
- name: katana_dex_ronin
tables:
- name: KatanaV3Pool_evt_Swap
- name: KatanaV3Factory_evt_PoolCreated
Loading