Skip to content

Commit

Permalink
Update dex.trades with Elkfinance (#7289)
Browse files Browse the repository at this point in the history
* Update _schema.yml

* Update dex_gnosis_base_trades.sql

* Create elk_finance_gnosis_base_trades.sql

* Update _schema.yml

* Create elk_finance_gnosis_base_trades_seed.csv

* Update _sources.yml

---------

Co-authored-by: Huang Geyang <[email protected]>
  • Loading branch information
blanchemaria6 and Hosuke authored Dec 10, 2024
1 parent 7b4dbe5 commit cd9372c
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 1 deletion.
18 changes: 18 additions & 0 deletions dbt_subprojects/dex/models/trades/gnosis/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,21 @@ models:
seed_file: ref('honeyswap_gnosis_base_trades_seed')
filter:
version: 2

- name: elk_finance_gnosis_base_trades
meta:
blockchain: gnosis
sector: dex
project: elk_finance
contributors: blanchemaria6
config:
tags: ['gnosis', 'dex', 'trades', 'elk_finance']
description: "elk finance gnosis 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('elk_finance_gnosis_base_trades_seed')

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
, ref('sushiswap_v2_gnosis_base_trades')
, ref('balancer_v2_gnosis_base_trades')
, ref('honeyswap_v2_gnosis_base_trades')
, ref('elk_finance_gnosis_base_trades')
] %}

WITH base_union AS (
Expand Down Expand Up @@ -48,4 +49,4 @@ WITH base_union AS (
, blockchain = 'gnosis'
, columns = ['from', 'to', 'index']
)
}}
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'elk_finance_gnosis',
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 = 'gnosis',
project = 'elk_finance',
version = '1',
Pair_evt_Swap = source('elk_finance_gnosis', 'ElkPair_evt_Swap'),
Factory_evt_PairCreated = source('elk_finance_gnosis', 'ElkFactory_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 @@ -4514,3 +4514,18 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: elk_finance_gnosis_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
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
gnosis,elk_finance,1,2024-12-10,0xbed63f2d1d8fa78c1f6d03570b91e9f34cad5f053c1a9d3543f8677e4558e4be,101,0xe91d153e0b41518a2ce8dd3d7944fa863463a97d,0x9c58bacc331c9aa871afd802db6379a98e80cedb,37454567,87123664537934436,324953295387159
4 changes: 4 additions & 0 deletions sources/_sector/dex/trades/gnosis/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ sources:
tables:
- name: UniswapV2Pair_evt_Swap
- name: UniswapV2Factory_evt_PairCreated
- name: elk_finance_gnosis
tables:
- name: ElkPair_evt_Swap
- name: ElkFactory_evt_PairCreated

0 comments on commit cd9372c

Please sign in to comment.