-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IceCreamSwap trades on Boba network (#7440)
* feat: add IceCreamSwap trades on Boba network - Add IceCreamSwap DEX trades implementation using uniswap_compatible_v2_trades macro - Add Boba network to dex_trades and dex_base_trades - Add source definition for IceCreamSwap events * feat: add IceCreamSwap to dex_info and enable boba network - Add IceCreamSwap to dex_info table - Add boba network to expose_spells * feat: add icecreamswap_boba_base_trades_seed - Add seed data for IceCreamSwap on Boba network - Add schema configuration for the new seed * feat: add check_dex_base_trades_seed test for icecreamswap_boba_base_trades * Add boba
- Loading branch information
Showing
10 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: dex_boba_base_trades | ||
data_tests: | ||
- check_dex_info_relationship | ||
|
||
- name: icecreamswap_boba_base_trades | ||
meta: | ||
blockchain: boba | ||
sector: dex | ||
project: icecreamswap | ||
contributors: hosuke | ||
config: | ||
tags: ["boba", "dex", "trades", "icecreamswap"] | ||
description: "IceCreamSwap boba 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('icecreamswap_boba_base_trades_seed') | ||
filter: | ||
version: 1 |
48 changes: 48 additions & 0 deletions
48
dbt_subprojects/dex/models/trades/boba/dex_boba_base_trades.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{{ config( | ||
schema = 'dex_boba' | ||
, alias = 'base_trades' | ||
, materialized = 'view' | ||
) | ||
}} | ||
|
||
{% set base_models = [ | ||
ref('icecreamswap_boba_base_trades') | ||
] %} | ||
|
||
WITH base_union AS ( | ||
SELECT * | ||
FROM ( | ||
{% for base_model in base_models %} | ||
SELECT | ||
blockchain | ||
, project | ||
, version | ||
, block_month | ||
, block_date | ||
, block_time | ||
, block_number | ||
, token_bought_amount_raw | ||
, token_sold_amount_raw | ||
, token_bought_address | ||
, token_sold_address | ||
, taker | ||
, maker | ||
, project_contract_address | ||
, tx_hash | ||
, evt_index | ||
FROM | ||
{{ base_model }} | ||
{% if not loop.last %} | ||
UNION ALL | ||
{% endif %} | ||
{% endfor %} | ||
) | ||
) | ||
|
||
{{ | ||
add_tx_columns( | ||
model_cte = 'base_union' | ||
, blockchain = 'boba' | ||
, columns = ['from', 'to', 'index'] | ||
) | ||
}} |
21 changes: 21 additions & 0 deletions
21
dbt_subprojects/dex/models/trades/boba/platforms/icecreamswap_boba_base_trades.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{ | ||
config( | ||
schema = 'icecreamswap_boba', | ||
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 = 'boba', | ||
project = 'icecreamswap', | ||
version = '1', | ||
Pair_evt_Swap = source('icecreamswap_boba', 'IceCreamSwapV2Pair_evt_Swap'), | ||
Factory_evt_PairCreated = source('icecreamswap_boba', 'IceCreamSwapV2Factory_evt_PairCreated') | ||
) | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
, "base" | ||
, "blast" | ||
, "bnb" | ||
, "boba" | ||
, "celo" | ||
, "ethereum" | ||
, "fantom" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
dbt_subprojects/dex/seeds/trades/icecreamswap_boba_base_trades_seed.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
blockchain,project,version,block_month,block_date,block_time,block_number,token_bought_amount_raw,token_sold_amount_raw,token_bought_address,token_sold_address,taker,maker,project_contract_address,tx_hash,evt_index | ||
boba,icecreamswap,1,2024-11-01 00:00,2024-11-24 00:00,2024-11-24 14:15,10726459,65183603501016643,300000000000000000,0x7d5a56742c082fcdfc240cd7d1775f00e059771f,0xa18bf3994c0cc6e3b63ac420308e5383f53120d7,0x85767bcbb2b5e95bddb3523406419d1aa7efdcf2,0x46d172bfdd9b03575229614bcf46da014d8ac8b1,0x46d172bfdd9b03575229614bcf46da014d8ac8b1,0x2a59b0f2abc8c29029c4dee209b0b82f2f1c89b825bca663a3d1c2b4deeb58b1,9 | ||
boba,icecreamswap,1,2024-07-01 00:00,2024-07-19 00:00,2024-07-19 16:57,5201714,661356424536501999965,169150000000000000000,0xa18bf3994c0cc6e3b63ac420308e5383f53120d7,0x7d5a56742c082fcdfc240cd7d1775f00e059771f,0x0604e652a188931e245717d45feb26f583b92908,0x46d172bfdd9b03575229614bcf46da014d8ac8b1,0x46d172bfdd9b03575229614bcf46da014d8ac8b1,0x01f3b8af8421fa428fca4cf2dc85498614d94b637bc5887c29e50abc7897c2b3,3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: icecreamswap_boba | ||
tables: | ||
- name: IceCreamSwapV2Pair_evt_Swap | ||
- name: IceCreamSwapV2Factory_evt_PairCreated |