ZookDaily Staked Sushi vs Unstaked Sushi, Last 30 Days.
Updated 2022-11-28Copy 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
34
35
›
⌄
with staked_sushi as (
Select
block_timestamp::date as date,
count(tx_id),
round(sum(amount_usd),2) as staked_sushi_usd
From ethereum.udm_events
where origin_function_signature = '0xa59f3e0c'
and symbol = 'SUSHI'
and date < CURRENT_DATE
and amount_usd < 150000000 -- filtering out any potentially inacurate data
group by 1
order by 1 DESC
limit 30),
unstaked_sushi as (
Select
block_timestamp::date as date,
round(sum(amount_usd),2) as xsushi_burned_usd -- aka unstaked_sushi
From ethereum.udm_events
where ORIGIN_FUNCTION_SIGNATURE = '0x67dfd4c9'
and symbol = 'SUSHI'
and block_timestamp > '2022-04-01' -- reducing the search depth to make the query faster
and block_timestamp < CURRENT_DATE
and amount_usd < 150000000
group by 1
order by 1 DESC
limit 30)
Select
staked_sushi.date,
staked_sushi.staked_sushi_usd,
unstaked_sushi.xsushi_burned_usd
from staked_sushi left join unstaked_sushi
on staked_sushi.date = unstaked_sushi.date
order by 1 desc
Run a query to Download Data