Afonso_Diaz2023-02-19 02:48 AM
Updated 2023-02-18
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
t1 as (
select
block_timestamp,
tx_signer as user_address,
-1 * deposit / pow(10, 24) as amount_near
from near.core.fact_transfers
where status = 1
and deposit > 0
),
t2 as (
select
block_timestamp,
tx_receiver as user_address,
deposit / pow(10, 24) as amount_near
from near.core.fact_transfers
where status = 1
and deposit > 0
),
t3 as (
select
block_timestamp,
tx_signer as user_address,
case
when method_name = 'unstake' then try_parse_json(args):min_expected_near / pow(10, 24)
when method_name = 'instant_unstake' then try_parse_json(args):min_Amount_out / pow(10, 24)
when method_name in ('stake', 'deposit_and_stake') then (-1 * deposit) / pow(10, 24)
end as amount_near
from near.core.fact_actions_events_function_call
join near.core.fact_transactions
using(tx_hash)
where method_name in ('unstake', 'liquid_unstake', 'instant_unstake', 'stake', 'deposit_and_stake')
and amount_near > 0
),
Run a query to Download Data