maybeyonasastro_buy_sell_pressure
Updated 2022-02-06
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
buy as (
select
block_timestamp,
event_attributes:ask_asset as token_contract,
event_attributes:return_amount/pow(10,6) as amt,
'buy' as event
from terra.msg_events
where tx_status='SUCCEEDED'
and event_type = 'from_contract'
and event_attributes:ask_asset in (
'terra1xj49zyqrwpv5k928jwfpfy2ha668nwdgkwlrg3'
)
),
sell as (
select
block_timestamp,
event_attributes:offer_asset as token_contract,
event_attributes:offer_amount/pow(10,6) as amt,
'sell' as event
from terra.msg_events
where tx_status='SUCCEEDED'
and event_type = 'from_contract'
and event_attributes:offer_asset in (
'terra1xj49zyqrwpv5k928jwfpfy2ha668nwdgkwlrg3'
)
)
select
date(block_timestamp) as date,
event,
sum(amt) as amount
from (
select * from buy
union all
select * from sell
Run a query to Download Data