Skip to content

Commit

Permalink
Merge branch 'main' into stablecoin_transfer_macro
Browse files Browse the repository at this point in the history
  • Loading branch information
thetroyharris committed Jun 19, 2024
2 parents 61ac247 + 4e0f67e commit e107d3d
Show file tree
Hide file tree
Showing 140 changed files with 812 additions and 230 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commit_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: [ self-hosted, linux, spellbook-trino-ci ]
strategy:
matrix:
project: [ 'tokens', 'spellbook', 'daily_spellbook', 'nft', 'dex']
project: [ 'tokens', 'spellbook', 'daily_spellbook', 'nft', 'dex', 'solana']
max-parallel: 1

steps:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/solana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: DBT Solana sector run

on:
workflow_dispatch:
pull_request:
paths:
- solana/**
- .github/workflows/solana.yml
- .github/workflows/dbt_run.yml

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
dbt-run:
uses: ./.github/workflows/dbt_run.yml
with:
project: 'solana'
1 change: 1 addition & 0 deletions .github/workflows/spellbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'tokens/**'
- 'daily_spellbook/**'
- 'nft/**'
- 'solana/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
8 changes: 0 additions & 8 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ models:
ethereum:
+schema: addresses_ethereum

tokens:
+schema: tokens
+materialized: table
+file_format: delta

solana_utils:
+schema: solana_utils

transfers:
+schema: transfers
ethereum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash']
unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address', 'order_hash', 'call_trade']
)
}}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{ config(
schema = 'uniswap_v2_ethereum',
alias = 'trades',
materialized = 'view'
)
}}


SELECT
dex.blockchain
, dex.project
, dex.version
, dex.block_month
, dex.block_date
, dex.block_time
, dex.block_number
, dex.token_bought_symbol
, dex.token_sold_symbol
, dex.token_pair
, dex.token_bought_amount
, dex.token_sold_amount
, dex.token_bought_amount_raw
, dex.token_sold_amount_raw
, dex.amount_usd
, dex.token_bought_address
, dex.token_sold_address
, dex.taker
, dex.maker
, dex.project_contract_address
, dex.tx_hash
, dex.tx_from
, dex.tx_to
, dex.evt_index
FROM
{{ ref('dex_trades') }} as dex
WHERE
dex.project = 'uniswap'
AND dex.version = '2'
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{ config(
schema = 'uniswap_v3_ethereum',
alias = 'trades',
materialized = 'view'
)
}}


SELECT
dex.blockchain
, dex.project
, dex.version
, dex.block_month
, dex.block_date
, dex.block_time
, dex.block_number
, dex.token_bought_symbol
, dex.token_sold_symbol
, dex.token_pair
, dex.token_bought_amount
, dex.token_sold_amount
, dex.token_bought_amount_raw
, dex.token_sold_amount_raw
, dex.amount_usd
, dex.token_bought_address
, dex.token_sold_address
, dex.taker
, dex.maker
, dex.project_contract_address
, f.fee
, dex.tx_hash
, dex.tx_from
, dex.tx_to
, dex.evt_index
FROM
{{ ref('dex_trades') }} as dex
INNER JOIN
{{ source('uniswap_v3_ethereum', 'Factory_evt_PoolCreated') }} as f
ON f.pool = dex.project_contract_address
WHERE
dex.project = 'uniswap'
AND dex.version = '3'
1 change: 1 addition & 0 deletions dex/models/dex_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ FROM (VALUES
, ('nile', 'Nile', 'Direct', 'Nile')
, ('nuri', 'Nuri', 'Direct', 'nuriexchange')
, ('icecreamswap', 'IceCreamSwap', 'Direct', 'icecream_swap')
, ('thruster', 'Thruster Finance', 'Direct', 'ThrusterFi')
) AS temp_table (project, name, marketplace_type, x_username)
22 changes: 21 additions & 1 deletion dex/models/trades/avalanche_c/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,24 @@ models:
- check_dex_base_trades_seed:
seed_file: ref('uniswap_avalanche_c_base_trades_seed')
filter:
version: 2
version: 2

- name: elk_finance_avalanche_c_base_trades
meta:
blockchain: avalanche_c
sector: dex
project: elk_finance
contributors: blanchemaria6
config:
tags: [ 'avalanche_c', 'dex', 'trades', 'elk_finance' ]
description: "elk_finance avalanche_c base trades"
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('elk_finance_avalanche_c_base_trades_seed')
filter:
version: 1

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
, ref('curvefi_avalanche_c_base_trades')
, ref('hashflow_avalanche_c_base_trades')
, ref('uniswap_v2_avalanche_c_base_trades')
, ref('elk_finance_avalanche_c_base_trades')
] %}

WITH base_union AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'elk_finance_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_v2_trades(
blockchain = 'avalanche_c',
project = 'elk_finance',
version = '1',
Pair_evt_Swap = source('elk_finance_avalanche_c', 'ElkPair_evt_Swap'),
Factory_evt_PairCreated = source('elk_finance_avalanche_c', 'ElkFactory_evt_PairCreated')
)
}}
17 changes: 17 additions & 0 deletions dex/models/trades/blast/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,20 @@ models:
seed_file: ref('uniswap_blast_base_trades_seed')
filter:
version: 2

- name: thruster_blast_base_trades
meta:
blockchain: blast
sector: dex
project: thruster
contributors: Henrystats
config:
tags: [ 'blast', 'dex', 'trades', 'thruster' ]
description: "Thruster 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('thruster_blast_base_trades_seed')
1 change: 1 addition & 0 deletions dex/models/trades/blast/dex_blast_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{% set base_models = [
ref('uniswap_v3_blast_base_trades')
, ref('uniswap_v2_blast_base_trades')
, ref('thruster_blast_base_trades')
] %}

WITH base_union AS (
Expand Down
Loading

0 comments on commit e107d3d

Please sign in to comment.