maybeyonasnearx_stake_unstake_weekly_vol
Updated 2023-04-13
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
flat_logs as (
select
block_timestamp,
tx_hash,
receiver_id,
value as log,
try_parse_json(replace(log,'EVENT_JSON:','')) as log_json
from near.core.fact_receipts r,
lateral flatten(input => r.logs)
),
stader_logs as (
select
block_timestamp,
tx_hash,
receiver_id,
log_json:event as event,
log_json:data[0]:account_id as user,
case
when log_json:event='unstake'
then log_json:data[0]:unstaked_amount /pow(10,24)
else log_json:data[0]:amount /pow(10,24)
end as amt
from flat_logs
where true
and receiver_id in (
'v2-nearx.stader-labs.near',
'nearx.stader-labs.near'
)
and log_json:standard = 'nearx'
and log_json:event in (
'deposit_and_stake',
'unstake',
'withdraw'
/*
@notice nearx token functions
Run a query to Download Data