CoinConverseVelodrome Health (Redux) histrogram rewards
Updated 2022-11-16
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
›
⌄
-- I would like to thank you to #h4wk for his source code
with total_claimed as (select origin_from_address,
sum(claimed_amount_usd) as total_claim
from optimism.velodrome.ez_claimed_rewards where claimed_amount_usd is not null
group by 1
)
select
-- https://count.co/sql-resources/snowflake/histograms
count(distinct origin_from_address) as user_count,
floor(total_claim / 10) * 10 as bin_start,
floor(total_claim / 10) * 10 + 10 as bin_end,
concat(
cast(floor(total_claim / 10) * 10 as STRING),
' - ',
cast(floor(total_claim / 10) * 10 + 10 as STRING)
) as bin_range
from
total_claimed
group by
bin_start,
bin_end,
bin_range
having bin_start < 1500
order by
bin_start
limit 250
Run a query to Download Data