MLDZMNin4
Updated 2023-08-29
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- select
-- *
-- from solana.core.fact_transfers
-- where tx_id='5F1VnsqArhRc1hWZmBowmFZvSYqcxKoUmGg6dm1pR1eF591EXCBZucLS4gVGo2QhifxYDpxkNZMojjVEaRf1bJh6'
-- --where tx_id='5emceBhM3yahT7oSmKp3JoAm3kiGjPsNfhmAmf2dNM2u8DyeFmPw7CcTYoibWoE1bX7kjDsQ2rQugECYdpMdnZgc'
-- --and EVENT_TYPE='transfer'
-- and BLOCK_TIMESTAMP>=current_date-30
-- forked from sp1 @ https://flipsidecrypto.xyz/edit/queries/c57a42bc-4af4-4d9e-af9d-1be9232e7472
with price_tab as (SELECT
recorded_hour::date as day,
avg(close) as token_price
FROM solana.core.ez_token_prices_hourly
WHERE token_address = 'So11111111111111111111111111111111111111112'
and day>=current_date-{{Days_back}}
group by 1
),
r_tab as (select *
from solana.core.fact_events
where succeeded = True
and program_id = 'stkitrT1Uoy18Dk1fTrgPw8W6MVzoCfYoAFT4MLsmhq'
and BLOCK_TIMESTAMP>=current_date-{{Days_back}}
),
t_tab as (select
*
from solana.core.fact_transfers
where tx_id in (select tx_id from r_tab)
and BLOCK_TIMESTAMP>=current_date-{{Days_back}}
),
t_tab1 as (select
tx_id,
min(index) as min_index,
Run a query to Download Data