SocioAnalyticaMetaPool - Daily Stake/Unstake
Updated 2024-03-27
999
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
›
⌄
-- forked from Yousefi_1994 / MetaPool - Daily Stake/Unstake @ https://flipsidecrypto.xyz/Yousefi_1994/q/tCX5GuTt6e5K/metapool-daily-stake-unstake
with
metapool_stake_v1 as (
select
receipts.block_timestamp,
receipts.tx_hash,
receipts.actions:predecessor_id as user_address,
(
receipts.actions:receipt:Action:actions[0]:FunctionCall:deposit
) * pow(10, -24) as amount
from
near.core.fact_receipts receipts
join near.core.fact_transactions transactions using (tx_hash)
where
receipts.receiver_id = 'meta-pool.near'
and receipts.actions:receipt:Action:actions[0]:FunctionCall:method_name in ('deposit_and_stake')
and receipts.status_value:Failure is null
and transactions.tx_status = 'Success'
),
metapool_unstake_v1 as (
select
receipts.block_timestamp,
receipts.tx_hash,
receipts.actions:predecessor_id as user_address,
(
replace(
(
split(split(array_to_string(logs, ','), ':') [3], ',') [0]
),
'\"',
''
)::float
) * pow(10, -24) as amount
from
near.core.fact_receipts receipts
QueryRunArchived: QueryRun has been archived