LTirrellstake_debug
Updated 2023-05-25
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
›
-- with
-- fact_stake as (
-- select
-- tx_id as f_tx_id,
-- index as f_index,
-- event_type as f_event_type,
-- instruction
-- from
-- solana.core.fact_staking_lp_actions
-- ),
-- latest_stake_vol as (
-- select
-- *,
-- signers[0] as fee_payer,
-- case
-- -- when event_type = 'withdraw'
-- -- and stake_authority is null
-- -- and fee_payer = withdraw_destination then fee_payer
-- -- when event_type = 'withdraw'
-- -- and stake_authority is null
-- -- and fee_payer != withdraw_destination then fact_stake.instruction:parsed:info:withdrawAuthority
-- when stake_authority is null
-- and event_type = 'authorizeChecked' then fact_stake.instruction:parsed:info:newAuthority
-- when stake_authority is null
-- and event_type = 'withdraw' then fact_stake.instruction:parsed:info:withdrawAuthority
-- else stake_authority
-- end as staker,
-- post_tx_staked_balance / pow(10, 9) as net_stake,
-- row_number() over (
-- partition by
-- stake_account
-- order by
-- block_timestamp desc,
-- index desc
-- ) as rn
-- from
Run a query to Download Data