cypherTerra2 dash - supply - staking rewards
Updated 2023-03-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
›
⌄
with price as (
select
date_trunc('day', recorded_hour) as date,
(avg(open) + avg(close)) / 2 as price
from crosschain.core.fact_hourly_prices
where id = 'terra-luna-2'
group by 1
),
rewards as (select
date_trunc('day', block_timestamp) as date,
sum(amount::number/1e6) as total_reward
from terra.core.ez_transfers
where
tx_succeeded = 'TRUE' and
currency = 'uluna' and
message_type = '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward'
group by date),
final as (select * from rewards
left join price using (date))
select *, total_reward*price as reward_usd
from final
Run a query to Download Data