cypherETH staked over time with Lido
Updated 2022-09-01
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
›
⌄
-- select * from ethereum.core.fact_event_logs
-- where block_timestamp >= current_date() - 180
-- and
with staked as (select
date_trunc('day', block_timestamp) as date,
sum(event_inputs:ethAmount/1e18) as eth_staked
from ethereum.core.fact_event_logs
where contract_address = '0xae78736cd615f374d3085123a210448e74fc6393'
and event_name = 'TokensMinted'
group by date),
unstaked as (select
date_trunc('day', block_timestamp) as date,
sum(event_inputs:ethAmount/1e18) as eth_unstaked
from ethereum.core.fact_event_logs
where contract_address = '0xae78736cd615f374d3085123a210448e74fc6393'
and event_name = 'TokensBurned'
group by date)
select
s.date,
s.eth_staked,
u.eth_unstaked,
s.eth_staked - u.eth_unstaked as net_staked,
sum(net_staked) over (order by s.date asc rows between unbounded preceding and current row) as cumulative_staked
from staked s, unstaked u
where s.date = u.date
Run a query to Download Data