maybeyonasbluna_arb_apr
Updated 2021-12-13
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
›
⌄
with
buy as (
select
block_timestamp,
-- tx_id,
event_attributes:to::string as user,
event_attributes:return_amount/pow(10,6) as bluna_amt,
event_attributes:offer_amount/pow(10,6) as luna_amt,
1/(bluna_amt/luna_amt) as bluna_price,
'buy' as event
from terra.msg_events
where tx_status='SUCCEEDED'
and event_type = 'from_contract'
and event_attributes:ask_asset = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
),
sell as (
select
block_timestamp,
-- tx_id,
event_attributes:from::string as user,
event_attributes:offer_amount/pow(10,6) as bluna_amt,
event_attributes:return_amount/pow(10,6) as luna_amt,
1/(bluna_amt/luna_amt) as bluna_price,
'sell' as event
from terra.msg_events
where tx_status='SUCCEEDED'
and event_type = 'from_contract'
and event_attributes:offer_asset = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
),
events as (
select * from buy
union all
select * from sell
),
data1 as (
select *,
Run a query to Download Data