RamaharLIDO staking freq vs staking value
Updated 2022-09-05Copy 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
33
›
⌄
with price as (select
hour::date as dayz,
avg (price) as eth_price
from ethereum.core.fact_hourly_token_prices
where symbol ='WETH' group by 1),
platform_staking as (
select
'LIDO' as platform,
block_timestamp::date as dt, tx_hash, text_signature as signature, origin_function_signature,
origin_from_address,
amount,
amount_usd as usd_price
from ethereum.core.ez_eth_transfers l
left join ethereum.core.dim_function_signatures s ON l.origin_function_signature = s.BYTES_SIGNATURE
where eth_to_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'
),
staking_seq as (select
origin_from_address AS staker,
usd_price,
ROW_NUMBER() OVER (partition by origin_from_address ORDER BY dt ASC ) row_num
from platform_staking )
select
row_num,
AVG(usd_price) AS staking_value
from staking_seq
group by 1
having row_num <= 1000 --only sampling within 1k staking freq , for illustration of higher freq staking value
Run a query to Download Data