maybeyonasluna_arb_prices
Updated 2022-03-16
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,
-- tx_id,
event_attributes:to::string as user,
event_attributes:ask_asset as token_contract,
case event_attributes:ask_asset
when 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' then 'bluna'
when 'terra13zaagrrrxj47qjwczsczujlvnnntde7fdt0mau' then 'cluna'
when 'terra17y9qkl8dfkeg4py7n0g5407emqnemc3yqk5rup' then 'lunax'
when 'terra1yg3j2s986nyp5z7r2lvt0hx3r0lnd7kwvwwtsc' then 'stluna'
end as token,
event_attributes:return_amount/pow(10,6) as token_amt,
event_attributes:offer_amount/pow(10,6) as ust_amt,
event_attributes:offer_amount/event_attributes:return_amount as price
from terra.msg_events
where tx_status='SUCCEEDED'
and event_type = 'from_contract'
and event_attributes:ask_asset in (
'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp', -- 'bluna'
'terra13zaagrrrxj47qjwczsczujlvnnntde7fdt0mau', -- 'cluna'
'terra17y9qkl8dfkeg4py7n0g5407emqnemc3yqk5rup', -- 'lunax'
'terra1yg3j2s986nyp5z7r2lvt0hx3r0lnd7kwvwwtsc' -- 'stluna'
)
and event_attributes:offer_asset = 'uluna'
and event_attributes:return_amount > 0
),
-- ALL SELL TRANSACTIONS OF AIRDROP TOKEN
sell as (
select
block_timestamp,
event_attributes:from::string as user,
event_attributes:offer_asset as token_contract,
case event_attributes:offer_asset
when 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' then 'bluna'
Run a query to Download Data