Skip to content

Commit

Permalink
Add Mute to dex.trades for zkSync Era (#5587)
Browse files Browse the repository at this point in the history
* init

* update seed

* re-add SyncSwap to dex.info

---------

Co-authored-by: Huang Geyang <Sukebeta@outlook.com>
  • Loading branch information
tomfutago and Hosuke authored Mar 14, 2024
1 parent f36b86c commit 5202dd4
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 0 deletions.
17 changes: 17 additions & 0 deletions models/_sector/dex/trades/zksync/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,20 @@ models:
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('syncswap_zksync_base_trades_seed')

- name: mute_zksync_base_trades
meta:
blockchain: zksync
sector: dex
project: mute
contributors: tomfutago
config:
tags: [ 'zksync', 'dex', 'trades', 'mute' ]
description: "Mute zksync base trades"
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('mute_zksync_base_trades_seed')
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
, ref('pancakeswap_v2_zksync_base_trades')
, ref('syncswap_zksync_base_trades')
, ref('uniswap_v3_zksync_base_trades')
, ref('mute_zksync_base_trades')
] %}

WITH base_union AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'mute_zksync',
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 = 'zksync',
project = 'mute',
version = '1',
Pair_evt_Swap = source('mute_zksync', 'MuteSwitchPairDynamic_evt_Swap'),
Factory_evt_PairCreated = source('mute_zksync', 'MuteSwitchFactoryDynamic_evt_PairCreated')
)
}}
1 change: 1 addition & 0 deletions models/dex/dex_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,5 @@ FROM (VALUES
, ('crescentswap', 'CrescentSwap', 'Direct', 'CrescentSwap')
, ('syncswap', 'SyncSwap', 'Direct', 'SyncSwap')
, ('SyncSwap', 'SyncSwap', 'Direct', 'SyncSwap')
, ('mute', 'Mute', 'Direct', 'Mute')
) AS temp_table (project, name, marketplace_type, x_username)
15 changes: 15 additions & 0 deletions seeds/_sector/dex/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3151,3 +3151,18 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: mute_zksync_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
4 changes: 4 additions & 0 deletions seeds/_sector/dex/mute_zksync_base_trades_seed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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
zksync,mute,1,2024-03-13,0x17e1869176958bdc32d03873b75e47d08983db1825c7f082bbe84a234f22a725,28,0x493257fd37edb34451f62edf8d2a0c418852ba4c,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,28854174,210350472,52207157501431450
zksync,mute,1,2024-03-13,0xad810be8dadf8946348634211a607a105fa279b0f621a17828215890dd5f496f,67,0x493257fd37edb34451f62edf8d2a0c418852ba4c,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,28854167,171686303,42525311714350932
zksync,mute,1,2024-03-13,0x1b72538e0d9e27956e66a23acad14af2c44005c8cfc666ad6924bd2804024d05,36,0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4,0x5aea5775959fbc2557cc8789bc1bf90a239d9a91,28854167,4025604996,1000000000000000000
4 changes: 4 additions & 0 deletions sources/_sector/dex/trades/zksync/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ sources:
tables:
- name: SyncSwapClassicPoolFactory_evt_PoolCreated
- name: SyncSwapStablePoolFactory_evt_PoolCreated
- name: mute_zksync
tables:
- name: MuteSwitchFactoryDynamic_evt_PairCreated
- name: MuteSwitchPairDynamic_evt_Swap

0 comments on commit 5202dd4

Please sign in to comment.