SocioCryptoAVAX Stake on BenQi - depositors
Updated 2025-02-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
›
⌄
-- forked from 715555ba-e9d4-4383-911b-e75e8aaefea3
with avax_price as (
select
date_trunc('day', hour) as date,
median(price) as avax_price
from
avalanche.price.ez_prices_hourly
where
symbol = 'WAVAX'
group by 1
)
SELECT event_name,
count(DISTINCT origin_from_address) as n_stakers,
sum(decoded_log:avaxAmount) / pow(10, 18) as vol_stake,
sum(decoded_log:avaxAmount * avax_price)/pow(10,18) as vol_stake_usd
FROM
avalanche.core.ez_decoded_event_logs a
LEFT JOIN avax_price b
ON date_trunc('day', a.block_timestamp) = b.date
WHERE
event_name in ('Submitted','Redeem')
AND tx_status = 'SUCCESS'
AND contract_name = 'Staked AVAX'
and date_trunc('day', a.block_timestamp) >= current_date - {{last_N_days}}
GROUP by 1
QueryRunArchived: QueryRun has been archived