forked from duneanalytics/spellbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'duneanalytics:main' into main
- Loading branch information
Showing
36 changed files
with
399 additions
and
26 deletions.
There are no files selected for viewing
File renamed without changes.
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
File renamed without changes.
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
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
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
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,23 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: dex_mantle_base_trades | ||
tests: | ||
- check_dex_info_relationship | ||
|
||
- name: merchant_moe_mantle_base_trades | ||
meta: | ||
blockchain: mantle | ||
sector: dex | ||
project: merchant_moe | ||
contributors: hosuke | ||
config: | ||
tags: [ 'mantle', 'dex', 'trades', 'merchant_moe' ] | ||
description: "merchant_moe mantle base trades" | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- evt_index | ||
- check_dex_base_trades_seed: | ||
seed_file: ref('merchant_moe_mantle_base_trades_seed') |
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_mantle' | ||
, alias = 'base_trades' | ||
, materialized = 'view' | ||
) | ||
}} | ||
|
||
{% set base_models = [ | ||
ref('merchant_moe_mantle_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 = 'mantle' | ||
, columns = ['from', 'to', 'index'] | ||
) | ||
}} |
21 changes: 21 additions & 0 deletions
21
dex/models/trades/mantle/platforms/merchant_moe_mantle_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 = 'merchant_moe_mantle', | ||
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 = 'mantle', | ||
project = 'merchant_moe', | ||
version = '1', | ||
Pair_evt_Swap = source('merchant_moe_mantle', 'MoePair_evt_Swap'), | ||
Factory_evt_PairCreated = source('merchant_moe_mantle', 'MoeFactory_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 |
---|---|---|
@@ -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 | ||
mantle,merchant_moe,1,2024-07-18,0x89e0bdd2ca4f6e761e8bd4ac47662329e3a1f68dd212efe67f9bcb6cb8883207,11,0x201eba5cc46d216ce6dc03f6a759e8e766e956ae,0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111,66589887,394988,114000000000000 | ||
mantle,merchant_moe,1,2024-07-18,0x54360fca25f09983ff88e25e890bf36e7fc82273444a05d3b779891bcda9eba1,8,0x201eba5cc46d216ce6dc03f6a759e8e766e956ae,0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111,66589884,904316,261000000000000 | ||
mantle,merchant_moe,1,2024-07-18,0x7a0ff2aea98ef80e496ae5cc30b3dc0e72cf32f685156dc8ce3561e25e977411,17,0x201eba5cc46d216ce6dc03f6a759e8e766e956ae,0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111,66589886,566496,163500000000000 |
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
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
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,13 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: butter_mantle | ||
tables: | ||
- name: ButterFactory_evt_PoolCreated | ||
- name: fusionx_mantle | ||
tables: | ||
- name: FusionXV3Factory_evt_PoolCreated | ||
- name: merchant_moe_mantle | ||
tables: | ||
- name: MoeFactory_evt_PairCreated | ||
- name: MoePair_evt_Swap |
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
Oops, something went wrong.