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.
- Loading branch information
Showing
88 changed files
with
3,324 additions
and
1,121 deletions.
There are no files selected for viewing
151 changes: 0 additions & 151 deletions
151
macros/models/_project/oneinch/oneinch_ar_calls_transfers_macro.sql
This file was deleted.
Oops, something went wrong.
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: uniswap_v3_avalanche_c_base_trades | ||
meta: | ||
blockchain: avalanche_c | ||
sector: dex | ||
project: uniswap | ||
contributors: jeff-dude, masquot, soispoke, mtitus6 | ||
config: | ||
tags: [ 'avalanche_c', 'dex', 'trades', 'uniswap', 'v3' ] | ||
description: "uniswap avalanche_c v3 base trades" | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- evt_index | ||
- check_dex_seed: | ||
blockchain: avalanche_c | ||
project: uniswap | ||
version: 3 | ||
|
||
- name: dex_avalanche_c_base_trades |
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 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: uniswap_v3_avalanche_c |
48 changes: 48 additions & 0 deletions
48
models/_sector/dex/trades/avalanche_c/dex_avalanche_c_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_avalanche_c' | ||
, alias = 'base_trades' | ||
, materialized = 'view' | ||
) | ||
}} | ||
|
||
{% set base_models = [ | ||
ref('uniswap_v3_avalanche_c_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 = 'avalanche_c' | ||
, columns = ['from', 'to', 'index'] | ||
) | ||
}} |
20 changes: 20 additions & 0 deletions
20
models/_sector/dex/trades/avalanche_c/platforms/uniswap_v3_avalanche_c_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_avalanche_c' | ||
, 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 = 'avalanche_c' | ||
, project = 'uniswap' | ||
, version = '3' | ||
, Pair_evt_Swap = source('uniswap_v3_avalanche_c', 'Pair_evt_Swap') | ||
, Factory_evt_PoolCreated = source('uniswap_v3_avalanche_c', 'UniswapV3Factory_evt_PoolCreated') | ||
) | ||
}} |
Oops, something went wrong.