binhachonUntitled Query
Updated 2022-02-03
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
›
⌄
with Anchor_earn_deposit as (
select
block_timestamp,
event_attributes:to::string as sender,
event_attributes:amount::float/1e6 as amount
from terra.msg_events
where tx_status = 'SUCCEEDED'
and event_type = 'from_contract'
and event_attributes:"0_action"::string = 'deposit_stable'
and event_attributes:"0_contract_address"::string = 'terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s'
),
Anchor_earn_withdraw as (
select
block_timestamp,
event_attributes:"0_from"::string as sender,
event_attributes:"0_amount"::float/1e6 as amount
from
terra.msg_events
where event_type = 'from_contract'
and tx_status = 'SUCCEEDED'
and event_attributes:"1_action"::string = 'redeem_stable'
and event_attributes:to::string = 'terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s'
),
Anchor_earn as (
select
block_timestamp,
sender as address,
amount
from Anchor_earn_deposit
union all
select
block_timestamp,
sender as address,
-amount as amount
from Anchor_earn_withdraw
),
Run a query to Download Data