banbannardMarinade Chef NFT 2
Updated 2023-11-07Copy Reference Fork
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
›
⌄
with base as (select block_timestamp::date as day,
sum(amount) as sum_locked
from solana.core.fact_gov_actions
where mint = 'MNDEFzGvMt87ueuHvVU9VcTqsAP5b3fTGPsHuuPA5ey'
and program_name = 'marinade'
and action in ('MINT LOCK', 'UPDATE LOCK')
and succeeded = 'TRUE'
group by 1),
base3 as (select block_timestamp::date as day,
sum(amount) as sum_burned
from solana.core.fact_gov_actions
where mint = 'MNDEFzGvMt87ueuHvVU9VcTqsAP5b3fTGPsHuuPA5ey'
and program_name = 'marinade'
and action = 'EXIT'
and succeeded = 'TRUE'
group by 1),
base4 as (select ifnull(a.day, b.day) as days,
ifnull(sum_locked, 0) as sum_lockedz,
ifnull(sum_burned,0) as sum_burnedz
from base a
full outer join base3 b
on a.day = b.day )
select days,
sum(sum_lockedz) over (order by days) as cumulative_sum_locked,
sum(sum_burnedz) over (order by days) as cumulative_sum_burned,
cumulative_sum_locked - cumulative_sum_burned as net_mnde_locked
from base4
order by 1 desc
Run a query to Download Data