barbodStake and unstake ETH with Lido
Updated 2022-06-15
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
›
⌄
with stake as(select
date_trunc(day,block_timestamp) as dt1,
symbol,
count(distinct origin_address) as stake_wallets,
sum(amount_usd) as stake_USD,
sum(amount) as stake_ETH
from ethereum.udm_events
where to_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' and event_name = 'transfer' and dt1>= CURRENT_DATE-90
group by 1,2),
unstake as (select
date_trunc(day,block_timestamp) as dt2,
symbol,
count(distinct origin_address) as unstake_wallets,
sum(amount_usd) as unstake_USD,
sum(amount) as unstake_ETH
from ethereum.udm_events
where from_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' and event_name = 'transfer' and dt2>= CURRENT_DATE-90
group by 1,2)
select
stake.dt1 as dt,
stake_ETH,
unstake_ETH,
stake_ETH-unstake_ETH as net_stake,
stake_wallets,
unstake_wallets
from stake
full outer join unstake on stake.dt1=unstake.dt2
Run a query to Download Data