commanderjoseph-761gwXTOKEN Total Staking Reward Bsc
Updated 2024-10-28
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
›
⌄
with
total
AS
(
SELECT
block_timestamp,
origin_from_address AS claimer,
utils.udf_hex_to_int(SUBSTR(data, 67, 64))/POW(10, 9) AS reward_amount,
utils.udf_hex_to_int(SUBSTR(data, 3, 64)) AS stake_number,
tx_hash
FROM
bsc.core.fact_event_logs
WHERE
origin_to_address = lower('0x1E7866B5A5A4F09EfD235D28d49568c2Fe2F7EcD') --TOKENFI STAKING
AND
topics[0] = '0xd6f2c8500df5b44f11e9e48b91ff9f1b9d81bc496d55570c2b1b75bf65243f51' --REWARD PAID
AND
tx_status = 'SUCCESS'
)
SELECT
COUNT(DISTINCT claimer) AS total_claimer,
--COUNT(DISTINCT user) AS total_user,
COUNT(DISTINCT stake_number) AS total_stake_number ,
COUNT(DISTINCT tx_hash) AS total_claims ,
SUM(reward_amount) AS total_reward_claimed
FROM
total
QueryRunArchived: QueryRun has been archived