Afonso_Diaz2023-08-30 03:31 PM
Updated 2023-08-30
999
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
›
⌄
-- forked from https://flipsidecrypto.xyz/panda/q/JfOaHFMw9pHA/sanctum-instant-unstake-total-unstake-unstakers---for-last-3-months
-- thanks to panda❤️
with
t1 as (
select
tx_id,
inner_instruction,
block_timestamp,
signers[0] as user,
program_id
from solana.core.fact_events
where succeeded = 1
and array_contains('3rBnnH9TTgd3xwu48rnzGsaQkSr1hR64nY71DrDt6VrQ'::variant, instruction:accounts)
and array_contains('5Pcu8WeQa3VbBz2vdBT49Rj4gbS4hsnfzuL1LmuRaKFY'::variant, instruction:accounts)
and block_timestamp::date >= current_date - 90
),
t2 as (
select
tx_id,
value
from t1
join lateral flatten (input => inner_instruction:instructions)
),
t3 as (
select
tx_id,
value:parsed:info:mint as unstaked_mint,
value:parsed:info:amount/1e9 as unstaked_mint_amount
from t2
where value:parsed:type = 'burn'
),
Run a query to Download Data