maybeyonassushi_staking
Updated 2022-01-02
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
34
35
36
›
⌄
with
sushi_price as (
select
hour,
price
from ethereum.token_prices_hourly
where symbol = 'SUSHI'
and hour > current_date - interval '30 days'
),
staking as (
select
date_trunc('hour',block_timestamp) as hour,
count(distinct tx_id) as stake_txs,
count(distinct origin_address) as total_depositors,
sum(amount) as token_amt,
sum(amount_usd) as amount_usd,
median(amount_usd) as median_amount
-- 'stake sushi' as event
from ethereum.udm_events
where to_address = lower('0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272') -- xsushi
and amount_usd < pow(10,8)
and amount_usd > 0
and block_timestamp > current_date - interval '30 days'
group by 1
),
unstaking as (
select
date_trunc('hour',block_timestamp) as hour,
count(distinct tx_id) as unstake_txs,
count(distinct origin_address) as total_removers,
sum(amount) as token_amt,
sum(amount_usd) as amount_usd,
median(amount_usd) as median_amount
-- 'stake sushi' as event
from ethereum.udm_events
where from_address = lower('0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272') -- xsushi
Run a query to Download Data