RamaharTOP $NEKO staking reward receiver
Updated 2023-02-04
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
›
⌄
/* obtain all transactions with NEKO tokens */
With tx_table as (select
tx_hash,
tx_signer,
block_timestamp,
tx_status,
tx:actions[0]:FunctionCall:method_name as actions
from near.core.fact_transactions
where tx_receiver = 'ftv2.nekotoken.near' AND tx_signer NOT ILIKE '%nekotoken%'),
--tx_hash = 'EPL1a4siqwxULRDkdnpcbUdAxK9GHW1JJLnwuZ38Gcgi' --sample stake NEKO tx
/* find out those which interact with cookie staking contract */
filter_staking as (select
a.tx_hash,
tx_signer,
b.block_timestamp
from near.core.fact_receipts a
join tx_table b ON a.tx_hash= b.tx_hash
where receiver_id = 'cookie.nekotoken.near' and tx_status = 'Success'),
/*obtain the staking amount for $NEKO */
staking_table as (select
DATE(b.block_timestamp) AS date,
b.tx_hash,
tx_signer,
--action_name,
args:amount::float / POW(10, 24) as stake_amount
from near.core.fact_actions_events_function_call a
join filter_staking b ON a.tx_hash = b.tx_hash
where method_name = 'ft_resolve_transfer'),
filter_claim as (select
tx_hash,
block_timestamp,
tx_signer,
Run a query to Download Data