From ef888745ba0a8506a5eaa2bb89edfbd571a74d7c Mon Sep 17 00:00:00 2001 From: Boxer Date: Thu, 7 Nov 2024 14:53:58 +0100 Subject: [PATCH 1/8] limit range and time --- .../models/_sector/dex/dex_solana_base_trades.sql | 11 ++++++++--- .../solana/models/_sector/dex/dex_solana_trades.sql | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql index 3816731b919..5885ba06ccc 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql @@ -11,8 +11,7 @@ ) }} -{% set solana_dexes = [ - ref('orca_whirlpool_base_trades') +/* ref('orca_whirlpool_base_trades') , ref('orca_whirlpool_v2_base_trades') , ref('raydium_v3_base_trades') , ref('raydium_v4_base_trades') @@ -22,7 +21,10 @@ , ref('meteora_v1_solana_base_trades') , ref('meteora_v2_solana_base_trades') , ref('goosefx_ssl_v2_solana_base_trades') - , ref('pumpdotfun_solana_base_trades') + , ref('pumpdotfun_solana_base_trades') */ + +{% set solana_dexes = [ + ] %} {% for dex in solana_dexes %} @@ -54,6 +56,9 @@ FROM WHERE {{incremental_predicate('block_time')}} {% endif %} +{% if not is_incremental() %} +WHERE block_time >= now() -interval '5' day +{% endif %} {% if not loop.last %} UNION ALL {% endif %} diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql index 058814deff8..f47f96bd671 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql @@ -22,6 +22,9 @@ with base_trades as ( {% if is_incremental() %} WHERE {{incremental_predicate('block_time')}} + {% else %} + WHERE + block_time >= now() - interval '7' day {% endif %} ) @@ -86,6 +89,8 @@ LEFT JOIN AND bt.token_bought_mint_address = toBase58(p_bought.contract_address) {% if is_incremental() %} AND {{incremental_predicate('p_bought.minute')}} + {% else %} + AND p_bought.minute >= now() - interval '7' day {% endif %} LEFT JOIN {{ source('prices', 'usd') }} p_sold @@ -94,6 +99,8 @@ LEFT JOIN AND bt.token_sold_mint_address = toBase58(p_sold.contract_address) {% if is_incremental() %} AND {{incremental_predicate('p_sold.minute')}} + {% else %} + AND p_sold.minute >= now() - interval '7' day {% endif %} -- if bought token is trusted, prefer that price, else default to sold token then bought token. LEFT JOIN From 9e6fe876b021aec16e2a0d9c2795f8452e651f0f Mon Sep 17 00:00:00 2001 From: Boxer Date: Thu, 7 Nov 2024 15:58:35 +0100 Subject: [PATCH 2/8] fix --- .../macros/_sector/transfers/solana_sol_transfers_macro.sql | 3 ++- .../solana/models/_sector/dex/dex_solana_base_trades.sql | 4 ++-- .../solana/models/_sector/dex/dex_solana_trades.sql | 6 +++--- .../sol_transfers/tokens_solana_sol_transfers_current.sql | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dbt_subprojects/solana/macros/_sector/transfers/solana_sol_transfers_macro.sql b/dbt_subprojects/solana/macros/_sector/transfers/solana_sol_transfers_macro.sql index 7f864640a2d..4dfb6420e1f 100644 --- a/dbt_subprojects/solana/macros/_sector/transfers/solana_sol_transfers_macro.sql +++ b/dbt_subprojects/solana/macros/_sector/transfers/solana_sol_transfers_macro.sql @@ -60,7 +60,8 @@ SELECT , t.block_slot , t.tx_id , t.tx_index - , coalesce(t.inner_instruction_index, 0) as inner_instruction_index + , t.inner_instruction_index + , coalesce(t.inner_instruction_index, 0) as key_inner_instruction_index , t.outer_instruction_index , t.tx_signer , cast(null as varchar) as from_token_account diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql index 5885ba06ccc..9306e2cece6 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql @@ -24,7 +24,7 @@ , ref('pumpdotfun_solana_base_trades') */ {% set solana_dexes = [ - + ref('raydium_v3_base_trades') ] %} {% for dex in solana_dexes %} @@ -57,7 +57,7 @@ WHERE {{incremental_predicate('block_time')}} {% endif %} {% if not is_incremental() %} -WHERE block_time >= now() -interval '5' day +WHERE block_time >= now() - interval '2' day {% endif %} {% if not loop.last %} UNION ALL diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql index f47f96bd671..77db469b372 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql @@ -24,7 +24,7 @@ with base_trades as ( {{incremental_predicate('block_time')}} {% else %} WHERE - block_time >= now() - interval '7' day + block_time >= now() - interval '2' day {% endif %} ) @@ -90,7 +90,7 @@ LEFT JOIN {% if is_incremental() %} AND {{incremental_predicate('p_bought.minute')}} {% else %} - AND p_bought.minute >= now() - interval '7' day + AND p_bought.minute >= now() - interval '2' day {% endif %} LEFT JOIN {{ source('prices', 'usd') }} p_sold @@ -100,7 +100,7 @@ LEFT JOIN {% if is_incremental() %} AND {{incremental_predicate('p_sold.minute')}} {% else %} - AND p_sold.minute >= now() - interval '7' day + AND p_sold.minute >= now() - interval '2' day {% endif %} -- if bought token is trusted, prefer that price, else default to sold token then bought token. LEFT JOIN diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_current.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_current.sql index 6c46d5666a1..c7a9e68848d 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_current.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_current.sql @@ -5,7 +5,7 @@ materialized = 'incremental', file_format = 'delta', incremental_strategy = 'delete+insert', - unique_key = ['block_date', 'tx_id', 'outer_instruction_index', 'inner_instruction_index', 'block_slot'] + unique_key = ['block_date', 'tx_id', 'outer_instruction_index', 'key_inner_instruction_index', 'block_slot'] ) }} {{ solana_sol_transfers_macro( From 77147c61ee5893611b1ae6ede3fd0c2541b47364 Mon Sep 17 00:00:00 2001 From: Boxer Date: Thu, 7 Nov 2024 18:05:04 +0100 Subject: [PATCH 3/8] also change upstream radium models --- .../solana/models/_sector/dex/dex_solana_base_trades.sql | 3 ++- .../solana/models/_sector/dex/dex_solana_trades.sql | 6 +++--- .../models/_sector/dex/raydium/raydium_v3_base_trades.sql | 6 +++--- .../models/_sector/dex/raydium/raydium_v4_base_trades.sql | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql index 9306e2cece6..69ac98793d2 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql @@ -25,6 +25,7 @@ {% set solana_dexes = [ ref('raydium_v3_base_trades') + , ref('raydium_v4_base_trades') ] %} {% for dex in solana_dexes %} @@ -57,7 +58,7 @@ WHERE {{incremental_predicate('block_time')}} {% endif %} {% if not is_incremental() %} -WHERE block_time >= now() - interval '2' day +WHERE block_time >= now() - interval '7' day {% endif %} {% if not loop.last %} UNION ALL diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql index 77db469b372..f47f96bd671 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql @@ -24,7 +24,7 @@ with base_trades as ( {{incremental_predicate('block_time')}} {% else %} WHERE - block_time >= now() - interval '2' day + block_time >= now() - interval '7' day {% endif %} ) @@ -90,7 +90,7 @@ LEFT JOIN {% if is_incremental() %} AND {{incremental_predicate('p_bought.minute')}} {% else %} - AND p_bought.minute >= now() - interval '2' day + AND p_bought.minute >= now() - interval '7' day {% endif %} LEFT JOIN {{ source('prices', 'usd') }} p_sold @@ -100,7 +100,7 @@ LEFT JOIN {% if is_incremental() %} AND {{incremental_predicate('p_sold.minute')}} {% else %} - AND p_sold.minute >= now() - interval '2' day + AND p_sold.minute >= now() - interval '7' day {% endif %} -- if bought token is trusted, prefer that price, else default to sold token then bought token. LEFT JOIN diff --git a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql index 25339af39e7..519d1792402 100644 --- a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql @@ -84,7 +84,7 @@ AND {{incremental_predicate('tr_1.block_time')}} {% else %} AND tr_1.block_time >= TIMESTAMP '{{project_start_date}}' - -- AND tr_1.block_time >= now() - interval '7' day + AND tr_1.block_time >= now() - interval '7' day {% endif %} INNER JOIN {{ ref('tokens_solana_transfers') }} tr_2 ON tr_2.tx_id = sp.call_tx_id @@ -95,14 +95,14 @@ AND {{incremental_predicate('tr_2.block_time')}} {% else %} AND tr_2.block_time >= TIMESTAMP '{{project_start_date}}' - -- AND tr_2.block_time >= now() - interval '7' day + AND tr_2.block_time >= now() - interval '7' day {% endif %} WHERE 1=1 {% if is_incremental() %} AND {{incremental_predicate('call_block_time')}} {% else %} AND call_block_time >= TIMESTAMP '{{project_start_date}}' - -- AND call_block_time >= now() - interval '7' day + AND call_block_time >= now() - interval '7' day {% endif %} ) diff --git a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql index 3d7fafd2a03..a12ab789241 100644 --- a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql @@ -58,7 +58,7 @@ AND {{incremental_predicate('trs_1.block_time')}} {% else %} AND trs_1.block_time >= TIMESTAMP '{{project_start_date}}' - -- AND trs_1.block_time >= now() - interval '7' day + AND trs_1.block_time >= now() - interval '7' day {% endif %} INNER JOIN {{ ref('tokens_solana_transfers') }} trs_2 ON trs_2.tx_id = sp.call_tx_id @@ -72,7 +72,7 @@ AND {{incremental_predicate('trs_2.block_time')}} {% else %} AND trs_2.block_time >= TIMESTAMP '{{project_start_date}}' - -- AND trs_2.block_time >= now() - interval '7' day + AND trs_2.block_time >= now() - interval '7' day {% endif %} LEFT JOIN {{ ref('solana_utils_token_accounts') }} tk_2 ON tk_2.address = trs_2.from_token_account AND tk_2.account_type = 'fungible' @@ -83,7 +83,7 @@ AND {{incremental_predicate('sp.call_block_time')}} {% else %} AND sp.call_block_time >= TIMESTAMP '{{project_start_date}}' - -- AND sp.call_block_time >= now() - interval '7' day --qa + AND sp.call_block_time >= now() - interval '7' day --qa {% endif %} --force ) From 20c1479db32652198572336dba35fc301ae8b026 Mon Sep 17 00:00:00 2001 From: Boxer Date: Thu, 7 Nov 2024 18:18:24 +0100 Subject: [PATCH 4/8] prod exclude old transfer models --- .../hourly_spellbook/models/_sector/gas/fees/gas_fees.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2020_q4.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2021_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2021_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2021_q3.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2021_q4.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q3.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q4.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q3.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q4.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2024_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2024_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2024_q3.sql | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql index 68da93059b2..7f5a13a1fc4 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql @@ -25,7 +25,7 @@ ]\', "sector", "gas", - \'["soispoke", "ilemi", "0xRob", "jeff-dude"]\' + \'["soispoke", "ilemi", "0xRob", "jeff-dude", "0xBoxe"]\' ) }}' ) diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql index c5015172052..6577a2d68cd 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2020_q4', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql index ac5b8e7486a..7f1e8f6dfd7 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q1', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql index 7716fd2ea42..f4c9a6a167f 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q2', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql index 71626e1ab06..22450e8ca6d 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q3', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql index 2e3cebe2a9f..1b6053eff22 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q4', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql index 083fa6b6778..b4f6c3728ba 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q1', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql index 0636a07e359..df900f085ac 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q2', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql index b1d63be0503..5128a267c2b 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q3', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql index 9397b3ca30d..8dfa2b9678a 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q4', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql index 713cdc32b95..928a2e3a1c1 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q1', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql index 642c7cdd8ed..5cb5f319772 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q2', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql index 3b24a67607a..d1c5eb8e418 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q3', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql index d9ba05b82f0..7478ff13d4d 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q4', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql index ae665ff05e1..106da246a64 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2024_q1', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql index c6eddd7fbc7..4218a1fbfe8 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2024_q2', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql index 202fa3b668f..cffc647ed3a 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2024_q3', - tags = ['static'], + tags = ['prod_exclude'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' From 9e675610653489dcdf2676acbd255016a1091f6e Mon Sep 17 00:00:00 2001 From: Boxer Date: Thu, 7 Nov 2024 18:50:37 +0100 Subject: [PATCH 5/8] remove accidental change --- .../hourly_spellbook/models/_sector/gas/fees/gas_fees.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql index 7f5a13a1fc4..68da93059b2 100644 --- a/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql +++ b/dbt_subprojects/hourly_spellbook/models/_sector/gas/fees/gas_fees.sql @@ -25,7 +25,7 @@ ]\', "sector", "gas", - \'["soispoke", "ilemi", "0xRob", "jeff-dude", "0xBoxe"]\' + \'["soispoke", "ilemi", "0xRob", "jeff-dude"]\' ) }}' ) From 8266662e119899d0224a350857b7f8d81e7e22ca Mon Sep 17 00:00:00 2001 From: Boxer Date: Thu, 7 Nov 2024 22:41:57 +0100 Subject: [PATCH 6/8] reverse prod_exclude tags --- .../sol_transfers/tokens_solana_sol_transfers_2021_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2021_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2021_q3.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2021_q4.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q3.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2022_q4.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q3.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2023_q4.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2024_q1.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2024_q2.sql | 2 +- .../sol_transfers/tokens_solana_sol_transfers_2024_q3.sql | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql index 7f1e8f6dfd7..ac5b8e7486a 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q1', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql index f4c9a6a167f..7716fd2ea42 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q2', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql index 22450e8ca6d..71626e1ab06 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q3', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql index 1b6053eff22..2e3cebe2a9f 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2021_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2021_q4', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql index b4f6c3728ba..083fa6b6778 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q1', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql index df900f085ac..0636a07e359 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q2', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql index 5128a267c2b..b1d63be0503 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q3', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql index 8dfa2b9678a..9397b3ca30d 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2022_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2022_q4', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql index 928a2e3a1c1..713cdc32b95 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q1', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql index 5cb5f319772..642c7cdd8ed 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q2', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql index d1c5eb8e418..3b24a67607a 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q3', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql index 7478ff13d4d..d9ba05b82f0 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2023_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2023_q4', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql index 106da246a64..ae665ff05e1 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q1.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2024_q1', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql index 4218a1fbfe8..c6eddd7fbc7 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q2.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2024_q2', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql index cffc647ed3a..202fa3b668f 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2024_q3.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2024_q3', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta' From 4088cd37918647ee69a72e2270dff9aae853fe26 Mon Sep 17 00:00:00 2001 From: Boxer Date: Thu, 7 Nov 2024 22:50:09 +0100 Subject: [PATCH 7/8] reverse date_filters --- .../_sector/dex/dex_solana_base_trades.sql | 29 +++++++++---------- .../models/_sector/dex/dex_solana_trades.sql | 7 ----- .../dex/raydium/raydium_v3_base_trades.sql | 6 ++-- .../dex/raydium/raydium_v4_base_trades.sql | 6 ++-- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql index 69ac98793d2..a945f9d3443 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql @@ -11,21 +11,23 @@ ) }} -/* ref('orca_whirlpool_base_trades') - , ref('orca_whirlpool_v2_base_trades') - , ref('raydium_v3_base_trades') - , ref('raydium_v4_base_trades') - , ref('phoenix_v1_base_trades') - , ref('lifinity_v1_base_trades') - , ref('lifinity_v2_base_trades') - , ref('meteora_v1_solana_base_trades') - , ref('meteora_v2_solana_base_trades') - , ref('goosefx_ssl_v2_solana_base_trades') - , ref('pumpdotfun_solana_base_trades') */ +/* + */ {% set solana_dexes = [ - ref('raydium_v3_base_trades') + ref('raydium_v3_base_trades') , ref('raydium_v4_base_trades') + , ref('orca_whirlpool_base_trades') + , ref('orca_whirlpool_v2_base_trades') + , ref('raydium_v3_base_trades') + , ref('raydium_v4_base_trades') + , ref('phoenix_v1_base_trades') + , ref('lifinity_v1_base_trades') + , ref('lifinity_v2_base_trades') + , ref('meteora_v1_solana_base_trades') + , ref('meteora_v2_solana_base_trades') + , ref('goosefx_ssl_v2_solana_base_trades') + , ref('pumpdotfun_solana_base_trades') ] %} {% for dex in solana_dexes %} @@ -57,9 +59,6 @@ FROM WHERE {{incremental_predicate('block_time')}} {% endif %} -{% if not is_incremental() %} -WHERE block_time >= now() - interval '7' day -{% endif %} {% if not loop.last %} UNION ALL {% endif %} diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql index f47f96bd671..058814deff8 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql @@ -22,9 +22,6 @@ with base_trades as ( {% if is_incremental() %} WHERE {{incremental_predicate('block_time')}} - {% else %} - WHERE - block_time >= now() - interval '7' day {% endif %} ) @@ -89,8 +86,6 @@ LEFT JOIN AND bt.token_bought_mint_address = toBase58(p_bought.contract_address) {% if is_incremental() %} AND {{incremental_predicate('p_bought.minute')}} - {% else %} - AND p_bought.minute >= now() - interval '7' day {% endif %} LEFT JOIN {{ source('prices', 'usd') }} p_sold @@ -99,8 +94,6 @@ LEFT JOIN AND bt.token_sold_mint_address = toBase58(p_sold.contract_address) {% if is_incremental() %} AND {{incremental_predicate('p_sold.minute')}} - {% else %} - AND p_sold.minute >= now() - interval '7' day {% endif %} -- if bought token is trusted, prefer that price, else default to sold token then bought token. LEFT JOIN diff --git a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql index 519d1792402..20797fe60b8 100644 --- a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql @@ -84,7 +84,7 @@ AND {{incremental_predicate('tr_1.block_time')}} {% else %} AND tr_1.block_time >= TIMESTAMP '{{project_start_date}}' - AND tr_1.block_time >= now() - interval '7' day + --AND tr_1.block_time >= now() - interval '7' day {% endif %} INNER JOIN {{ ref('tokens_solana_transfers') }} tr_2 ON tr_2.tx_id = sp.call_tx_id @@ -95,14 +95,14 @@ AND {{incremental_predicate('tr_2.block_time')}} {% else %} AND tr_2.block_time >= TIMESTAMP '{{project_start_date}}' - AND tr_2.block_time >= now() - interval '7' day + --AND tr_2.block_time >= now() - interval '7' day {% endif %} WHERE 1=1 {% if is_incremental() %} AND {{incremental_predicate('call_block_time')}} {% else %} AND call_block_time >= TIMESTAMP '{{project_start_date}}' - AND call_block_time >= now() - interval '7' day + --AND call_block_time >= now() - interval '7' day {% endif %} ) diff --git a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql index a12ab789241..e870ec506d1 100644 --- a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql @@ -58,7 +58,7 @@ AND {{incremental_predicate('trs_1.block_time')}} {% else %} AND trs_1.block_time >= TIMESTAMP '{{project_start_date}}' - AND trs_1.block_time >= now() - interval '7' day + --AND trs_1.block_time >= now() - interval '7' day {% endif %} INNER JOIN {{ ref('tokens_solana_transfers') }} trs_2 ON trs_2.tx_id = sp.call_tx_id @@ -72,7 +72,7 @@ AND {{incremental_predicate('trs_2.block_time')}} {% else %} AND trs_2.block_time >= TIMESTAMP '{{project_start_date}}' - AND trs_2.block_time >= now() - interval '7' day + --AND trs_2.block_time >= now() - interval '7' day {% endif %} LEFT JOIN {{ ref('solana_utils_token_accounts') }} tk_2 ON tk_2.address = trs_2.from_token_account AND tk_2.account_type = 'fungible' @@ -83,7 +83,7 @@ AND {{incremental_predicate('sp.call_block_time')}} {% else %} AND sp.call_block_time >= TIMESTAMP '{{project_start_date}}' - AND sp.call_block_time >= now() - interval '7' day --qa + -- AND sp.call_block_time >= now() - interval '7' day --qa {% endif %} --force ) From bd0898362712bbe47b539f896a710f69cec17e93 Mon Sep 17 00:00:00 2001 From: jeff-dude Date: Fri, 8 Nov 2024 12:00:51 +0700 Subject: [PATCH 8/8] cleanup comments, remove dupes in base trades list, include 2020 q4 again --- .../solana/models/_sector/dex/dex_solana_base_trades.sql | 5 ----- .../models/_sector/dex/raydium/raydium_v3_base_trades.sql | 3 --- .../models/_sector/dex/raydium/raydium_v4_base_trades.sql | 4 ---- .../sol_transfers/tokens_solana_sol_transfers_2020_q4.sql | 2 +- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql index a945f9d3443..41a99ad235b 100644 --- a/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/dex_solana_base_trades.sql @@ -11,16 +11,11 @@ ) }} -/* - */ - {% set solana_dexes = [ ref('raydium_v3_base_trades') , ref('raydium_v4_base_trades') , ref('orca_whirlpool_base_trades') , ref('orca_whirlpool_v2_base_trades') - , ref('raydium_v3_base_trades') - , ref('raydium_v4_base_trades') , ref('phoenix_v1_base_trades') , ref('lifinity_v1_base_trades') , ref('lifinity_v2_base_trades') diff --git a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql index 20797fe60b8..bf954d6d42a 100644 --- a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v3_base_trades.sql @@ -84,7 +84,6 @@ AND {{incremental_predicate('tr_1.block_time')}} {% else %} AND tr_1.block_time >= TIMESTAMP '{{project_start_date}}' - --AND tr_1.block_time >= now() - interval '7' day {% endif %} INNER JOIN {{ ref('tokens_solana_transfers') }} tr_2 ON tr_2.tx_id = sp.call_tx_id @@ -95,14 +94,12 @@ AND {{incremental_predicate('tr_2.block_time')}} {% else %} AND tr_2.block_time >= TIMESTAMP '{{project_start_date}}' - --AND tr_2.block_time >= now() - interval '7' day {% endif %} WHERE 1=1 {% if is_incremental() %} AND {{incremental_predicate('call_block_time')}} {% else %} AND call_block_time >= TIMESTAMP '{{project_start_date}}' - --AND call_block_time >= now() - interval '7' day {% endif %} ) diff --git a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql index e870ec506d1..35ce3259ce6 100644 --- a/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql +++ b/dbt_subprojects/solana/models/_sector/dex/raydium/raydium_v4_base_trades.sql @@ -58,7 +58,6 @@ AND {{incremental_predicate('trs_1.block_time')}} {% else %} AND trs_1.block_time >= TIMESTAMP '{{project_start_date}}' - --AND trs_1.block_time >= now() - interval '7' day {% endif %} INNER JOIN {{ ref('tokens_solana_transfers') }} trs_2 ON trs_2.tx_id = sp.call_tx_id @@ -72,7 +71,6 @@ AND {{incremental_predicate('trs_2.block_time')}} {% else %} AND trs_2.block_time >= TIMESTAMP '{{project_start_date}}' - --AND trs_2.block_time >= now() - interval '7' day {% endif %} LEFT JOIN {{ ref('solana_utils_token_accounts') }} tk_2 ON tk_2.address = trs_2.from_token_account AND tk_2.account_type = 'fungible' @@ -83,9 +81,7 @@ AND {{incremental_predicate('sp.call_block_time')}} {% else %} AND sp.call_block_time >= TIMESTAMP '{{project_start_date}}' - -- AND sp.call_block_time >= now() - interval '7' day --qa {% endif %} - --force ) SELECT diff --git a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql index 6577a2d68cd..c5015172052 100644 --- a/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql +++ b/dbt_subprojects/solana/models/_sector/transfers/backfills/sol_transfers/tokens_solana_sol_transfers_2020_q4.sql @@ -1,7 +1,7 @@ {{ config( schema = 'tokens_solana', alias = 'sol_transfers_2020_q4', - tags = ['prod_exclude'], + tags = ['static'], partition_by = ['block_date'], materialized = 'table', file_format = 'delta'