maybeyonasliq_stake
Updated 2022-09-30
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
liq_stake_txs as (
select
t.block_timestamp,
t.tx_hash,
method_name,
tx_signer,
tx_receiver,
deposit
from near.core.fact_transactions t
join near.core.fact_actions_events_function_call f on t.tx_hash = f.tx_hash
where t.tx_status = 'Success'
and method_name in ('deposit_and_stake','unstake','unstake_all','withdraw_all','withdraw')
and tx_receiver in ('meta-pool.near','linear-protocol.near','v2-nearx.stader-labs.near')
),
metapool_stake_receipts as (
select
block_timestamp,
tx_hash,
parse_json(replace(logs[1],'EVENT_JSON:','')) as log_json,
log_json:account::string as user,
log_json:amount::integer/pow(10,24) as amt
from near.core.fact_receipts
where array_size(logs) > 0
and tx_hash in (
select tx_hash from liq_stake_txs
where method_name = 'deposit_and_stake'
and tx_receiver = 'meta-pool.near'
)
),
linear_stake_receipts as (
select
block_timestamp,
tx_hash,
parse_json(replace(logs[0],'EVENT_JSON:','')) as log_json,
log_json:data[0]:account_id::string as user,
Run a query to Download Data