Skip to content

Commit

Permalink
Add yaka sei trade (#7010)
Browse files Browse the repository at this point in the history
* add sei yaka base trades

* fix:up

* fix:update data tests syntax

* fix:add test seeds

---------

Co-authored-by: Huang Geyang <[email protected]>
Co-authored-by: jeff-dude <[email protected]>
  • Loading branch information
3 people authored Oct 28, 2024
1 parent 5b645e3 commit 1a2a1ad
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 2 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 @@ -179,4 +179,5 @@ FROM (VALUES
, ('yoshiexchange', 'Yoshi Exchange', 'Direct', 'YoshiExchange')
, ('dyorswap', 'DyorSwap', 'Direct', 'DYORSWAP')
, ('punkswap', 'PunkSwap', 'Direct', 'PunkSwapDEX')
, ('yaka', 'yaka', 'Direct', 'YakaFinance')
) AS temp_table (project, name, marketplace_type, x_username)
17 changes: 17 additions & 0 deletions dbt_subprojects/dex/models/trades/sei/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,20 @@ models:
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('carbon_defi_sei_base_trades_seed')

- name: yaka_sei_base_trades
meta:
blockchain: sei
sector: dex
project: yaka
contributors: john
config:
tags: [ 'sei', 'dex', 'trades', 'yaka_finance' ]
description: "Yaka Finance 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('yaka_sei_base_trades_seed')
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
, ref('dragon_swap_sei_base_trades')
, ref('xei_finance_sei_base_trades')
, ref('carbon_defi_sei_base_trades')
, ref('yaka_sei_base_trades')
] %}

WITH base_union AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'yaka_sei',
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 = 'sei',
project = 'yaka',
version = '1',
Pair_evt_Swap = source('yaka_sei', 'Pair_evt_Swap'),
Factory_evt_PairCreated = source('yaka_sei', 'PairFactory_evt_PairCreated')
)
}}
17 changes: 16 additions & 1 deletion dbt_subprojects/dex/seeds/trades/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4365,6 +4365,21 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: yaka_sei_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: dragon_swap_kaia_base_trades_seed
config:
Expand All @@ -4379,4 +4394,4 @@ seeds:
token_sold_address: varbinary
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp
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
sei,yaka,1,2024-10-24,0x59bc7cdeba0bbf27a8872674c01d7bbf19a59f421eb1037762abe973bc9cf057,6,0xb75d0b03c06a926e488e2659df1a861f860bd3d1,0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7,110614737,42135639,100000000000000000000
6 changes: 5 additions & 1 deletion sources/_sector/dex/trades/sei/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ sources:
- name: XeiV3Pool_evt_Swap
- name: carbon_defi_sei
tables:
- name: CarbonController_evt_TokensTraded
- name: CarbonController_evt_TokensTraded
- name: yaka_sei
tables:
- name: Pair_evt_Swap
- name: PairFactory_evt_PairCreated

0 comments on commit 1a2a1ad

Please sign in to comment.