CryptoLionMIR staking rewards grouped by date
Updated 2021-11-10
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
›
⌄
SELECT
date_trunc('day',m.block_timestamp) as day,
-- m.tx_id,
-- m.msg_value:sender::string as u_address,
sum(event_attributes:"1_amount"::float/POW(10,6)) as amount,
sum(amount) over (order by day) as aggregate_amount
-- event_attributes:"0_action"::string as action
FROM terra.msgs m
INNER JOIN terra.msg_events me on m.tx_id = me.tx_id
WHERE
-- m.tx_id = '1DB3395685CF54199E299AF306A06B89578D422BF1E3657002DFFD7BFE3DC4A4' --reward claim tx
msg_value:contract::string = 'terra17f7zu97865jmknk7p2glqvxzhduk78772ezac5' --MIR staking address
AND msg_value:execute_msg:withdraw = '{}' --claim
AND event_attributes:"0_action" LIKE 'withdra%'
AND event_index = 1
-- AND m.block_timestamp >= getdate() - interval '1 month'
AND event_attributes:"1_amount"::float/POW(10,6) <> 0
GROUP BY 1
ORDER BY 1 DESC
-- -- msg_events table
-- SELECT *,
-- msg_value:execute_msg:withdraw
-- FROM terra.msgs
-- WHERE tx_id = '1DB3395685CF54199E299AF306A06B89578D422BF1E3657002DFFD7BFE3DC4A4' --reward claim tx
Run a query to Download Data