CryptoIcicleThor-93.$THOR Staking Reward + APY - Daily
Updated 2022-05-25
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
›
⌄
-- $THOR Staking Reward + APY
-- Payout 49.67 RUNE
-- Grand Prize 149.01 RUNE
-- Level Intermediate
-- Q93. Since vTHOR and THOR Staking 2.0 was released in May, we’re interested in finding out more about how the community has embraced the staking rewards.
-- Show the daily / weekly staking rewards and calculate the daily / weekly APR for $THOR stakers. How has it progressed since staking was introduced?
WITH a AS (
SELECT DISTINCT tx_id
FROM ethereum.events_emitted
WHERE block_timestamp >= '2022-05-04'
AND contract_address = LOWER('0xa5f2211B9b8170F694421f2046281775E8468044')
), b AS (
SELECT DISTINCT e.tx_id
FROM ethereum.events_emitted e
JOIN a ON a.tx_id = e.tx_id
WHERE block_timestamp >= '2022-05-04'
AND tx_to_address = LOWER('0x815c23eca83261b6ec689b60cc4a58b54bc24d8d')
AND event_name = 'Deposit'
), c AS (
SELECT DISTINCT e.tx_id
FROM ethereum.events_emitted e
JOIN b ON b.tx_id = e.tx_id
WHERE block_timestamp >= '2022-05-04'
AND tx_to_address = LOWER('0x815c23eca83261b6ec689b60cc4a58b54bc24d8d')
AND event_name = 'DelegateVotesChanged'
),
staking_txns as (
SELECT block_timestamp::date AS date
, CASE WHEN e.event_name = 'Transfer'
AND contract_address = '0xa5f2211b9b8170f694421f2046281775e8468044'
AND LENGTH(event_inputs:value::string) <= 25
THEN CAST(event_inputs:value::string AS INT) * POWER(10, -18)
ELSE 0 END AS thor_amt
, *
Run a query to Download Data