Afonso_DiazTotal
Updated 2025-01-20
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
36
›
⌄
with
pricet as (
select
hour::date as date,
avg(price) as token_price_usd
from
near.price.ez_prices_hourly
where
token_address = 'token.burrow.near'
group by 1
),
main as (
select
tx_hash,
block_timestamp,
signer_id as user,
iff(method_name = 'account_stake_booster', 'Stake', 'Unstake') as method_name,
nvl(args:amount, try_parse_json(replace(logs[0], 'EVENT_JSON:', '')):data[0]:total_booster_amount)::bigint / 1e18 as amount,
amount * token_price_usd as amount_usd
from
near.core.fact_actions_events_function_call
left join
pricet on block_timestamp::date = date
where
method_name in ('account_stake_booster', 'account_unstake_booster')
and receiver_id = 'contract.main.burrow.near'
and receipt_succeeded
)
select
count(distinct tx_hash) as transactions,
count(distinct user) as users,
transactions / count(distinct block_timestamp::date) as daily_average_transactions,
users / count(distinct block_timestamp::date) as daily_average_users
QueryRunArchived: QueryRun has been archived