-
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 Uniswap Blast (V2 & V3) - Ready for review (#6177)
* Add Uniswap Blast (V2 & V3) * fix seed naming * push * Update tests * trigger rerun * smol fix
- Loading branch information
1 parent
e69946b
commit 571ed0d
Showing
9 changed files
with
168 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: dex_blast_base_trades | ||
tests: | ||
- check_dex_info_relationship | ||
|
||
- name: uniswap_v3_blast_base_trades | ||
meta: | ||
blockchain: blast | ||
sector: dex | ||
project: uniswap | ||
contributors: Henrystats | ||
config: | ||
tags: [ 'blast', 'dex', 'trades', 'uniswap', 'v3' ] | ||
description: "uniswap blast v3 base trades" | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- evt_index | ||
- check_dex_base_trades_seed: | ||
seed_file: ref('uniswap_blast_base_trades_seed') | ||
filter: | ||
version: 3 | ||
|
||
- name: uniswap_v2_blast_base_trades | ||
meta: | ||
blockchain: blast | ||
sector: dex | ||
project: uniswap | ||
contributors: Henrystats | ||
config: | ||
tags: [ 'blast', 'dex', 'trades', 'uniswap', 'v2' ] | ||
description: "uniswap blast v2 base trades" | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- evt_index | ||
- check_dex_base_trades_seed: | ||
seed_file: ref('uniswap_blast_base_trades_seed') | ||
filter: | ||
version: 2 |
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,49 @@ | ||
{{ config( | ||
schema = 'dex_blast' | ||
, alias = 'base_trades' | ||
, materialized = 'view' | ||
) | ||
}} | ||
|
||
{% set base_models = [ | ||
ref('uniswap_v3_blast_base_trades') | ||
, ref('uniswap_v2_blast_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 = 'blast' | ||
, columns = ['from', 'to', 'index'] | ||
) | ||
}} |
21 changes: 21 additions & 0 deletions
21
dex/models/trades/blast/platforms/uniswap_v2_blast_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 = 'uniswap_v2_blast', | ||
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 = 'blast', | ||
project = 'uniswap', | ||
version = '2', | ||
Pair_evt_Swap = source('uniswap_v2_blast', 'Pair_evt_Swap'), | ||
Factory_evt_PairCreated = source('uniswap_v2_blast', 'UniswapV2Factory_evt_PairCreated') | ||
) | ||
}} |
20 changes: 20 additions & 0 deletions
20
dex/models/trades/blast/platforms/uniswap_v3_blast_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,20 @@ | ||
{{ config( | ||
schema = 'uniswap_v3_blast' | ||
, 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_v3_trades( | ||
blockchain = 'blast' | ||
, project = 'uniswap' | ||
, version = '3' | ||
, Pair_evt_Swap = source('uniswap_v3_blast', 'UniswapV3Pool_evt_Swap') | ||
, Factory_evt_PoolCreated = source('uniswap_v3_blast', 'UniswapV3Factory_evt_PoolCreated') | ||
) | ||
}} |
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,5 @@ | ||
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 | ||
blast,uniswap,3,2024-05-23,0x551d4e0f41354ae704d4741dcf4cc04545e8d57244970f82aa555e1133b7540d,46,0x4300000000000000000000000000000000000003,0x4300000000000000000000000000000000000004,3838988,1493638757736905160844,398348972910668948 | ||
blast,uniswap,3,2024-04-16,0x179f36ba037f73bba13287344a8500eb1d2afbc0d431397cd53a01dc3f7b4526,7,0x4300000000000000000000000000000000000004,0x2416092f143378750bb29b79ed961ab195cceea5,2246306,2105445002466536,2057258487654622 | ||
blast,uniswap,2,2024-06-07,0x1719c8d79cc064f4863417c7fae613857ef1c3b6a30f0071d9e416b4bb8385ec,23,0x4300000000000000000000000000000000000003,0x4300000000000000000000000000000000000004,4471336,1135362542678049275,298977031258286 | ||
blast,uniswap,2,2024-04-16,0x5057cf71829bebf2b9c9c19255355125906ec48123743fbdfbec6b6aa5c363a5,8,0x4300000000000000000000000000000000000003,0x4300000000000000000000000000000000000004,2215230,30824068867802868,10000000000000 |
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,11 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: uniswap_v3_blast | ||
tables: | ||
- name: UniswapV3Pool_evt_Swap | ||
- name: UniswapV3Factory_evt_PoolCreated | ||
- name: uniswap_v2_blast | ||
tables: | ||
- name: Pair_evt_Swap | ||
- name: UniswapV2Factory_evt_PairCreated |