-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add IceCreamSwap trades on Boba network #7440
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7177e51
feat: add IceCreamSwap trades on Boba network
Hosuke e1d275d
feat: add IceCreamSwap to dex_info and enable boba network
Hosuke 9a284d3
feat: add icecreamswap_boba_base_trades_seed
Hosuke 5781738
feat: add check_dex_base_trades_seed test for icecreamswap_boba_base_…
Hosuke 6baa8ff
Add boba
Hosuke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icecreamswap_boba.base_trades preview