Skip to content

Commit 7ebd6c6

Browse files
authored
dex_solana.trades: simplify block slot cutoff (#9058)
* simplify block slot cutoff * force short run time * add filter for performance * Revert "force short run time" This reverts commit 388b53c.
1 parent 79c6513 commit 7ebd6c6

File tree

3 files changed

+19
-36
lines changed

3 files changed

+19
-36
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{
2+
config(
3+
schema = 'dex_solana'
4+
, alias = 'stg_max_block_slot'
5+
, materialized = 'table'
6+
)
7+
}}
8+
-- depends_on: {{ ref('dex_solana_base_trades') }}
9+
10+
select
11+
max(block_date) as block_date_filter
12+
, max(block_time) as block_time_filter
13+
, max(block_slot) as block_slot_filter
14+
from
15+
{{ source('tokens_solana', 'transfers') }}
16+
where
17+
-- to prevent full scan, give short timeframe filter with some buffer
18+
block_date >= now() - interval '3' day

dbt_subprojects/solana/models/_sector/dex/dex_solana_stg_min_max_block_slot.sql

Lines changed: 0 additions & 35 deletions
This file was deleted.

dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ with base_trades as (
2929
, block_time_filter
3030
, block_slot_filter
3131
FROM
32-
{{ ref('dex_solana_stg_min_max_block_slot') }}
32+
{{ ref('dex_solana_stg_max_block_slot') }}
3333
)
3434
SELECT bt.blockchain
3535
, bt.project

0 commit comments

Comments
 (0)