flyingfishETHENA Daily Breakdown
Updated 2024-04-09
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
›
⌄
with claim_txs as (
select
block_timestamp
, tx_hash
, decoded_log:to as claimer
, decoded_log:value / pow(10, 18) as amount
, price
from ethereum.core.ez_decoded_event_logs
left join crosschain.price.ez_hourly_token_prices
on token_address = '0x57e114b691db790c35207b2e685d4a43181e6061'
and hour = date_trunc(hour, block_timestamp)
where 1 = 1
and tx_status = 'SUCCESS'
and block_timestamp > '2024-04-02'
and contract_address = '0x57e114b691db790c35207b2e685d4a43181e6061'
and origin_function_signature = '0x8132b321'
)
select
'Ethereum' as chain
, 'Ethena' as protocol
, date_trunc(hour, block_timestamp) as date
, sum(amount) as claimed_amount
, sum(claimed_amount) over (ORDER BY date) as total_amount
, 100 * total_amount / 750000000 as perc_claimed
, avg(price) as avg_price
, claimed_amount * avg_price as usd_claimed
, sum(usd_claimed) over (order by date) as usd_total_claimed
, total_amount * avg_price as current_usd_total_value
from claim_txs
group by 1, 2, 3
order by date desc
QueryRunArchived: QueryRun has been archived