mariyaNet deposit of Luna on Mars protocol
Updated 2022-04-09
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
›
⌄
with dep as(
SELECT --*
date_trunc('day', block_timestamp) AS dt1,
sum(EVENT_ATTRIBUTES:"0_amount")/1e6 as daily_deposit
FROM terra.msg_events
where EVENT_ATTRIBUTES:"0_action"='deposit'
and EVENT_ATTRIBUTES:asset='uluna'
and EVENT_ATTRIBUTES:"0_contract_address"='terra19dtgj9j5j7kyf3pmejqv8vzfpxtejaypgzkz5u'
and tx_status = 'SUCCEEDED'
group by 1),
witd as(
SELECT
date_trunc('day', block_timestamp) AS dt2,
sum(EVENT_ATTRIBUTES:"0_amount")/1e6 as daily_withdraw
FROM terra.msg_events
where EVENT_ATTRIBUTES:"0_action"='withdraw'
and EVENT_ATTRIBUTES:asset='uluna'
and EVENT_ATTRIBUTES:"0_contract_address"='terra19dtgj9j5j7kyf3pmejqv8vzfpxtejaypgzkz5u'
and tx_status = 'SUCCEEDED'
group by 1)
select dep.dt1 as dt,
daily_deposit,
daily_withdraw,
(daily_deposit-daily_withdraw) as net_deposit
from dep
inner join witd on dep.dt1=witd.dt2
Run a query to Download Data