binhachonLUNA & Drawdowns - Overall charts
Updated 2022-04-11
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
›
⌄
with avg_price as (
select
date_trunc('day', block_timestamp) as time,
avg(price_usd) as avg_price
from terra.oracle_prices
where symbol = 'LUNA'
group by 1
),
Anchor_liquidation as (
select
date_trunc('day', block_timestamp) as time,
sum(liquidated_amount) as liquidated_amount,
sum(liquidated_amount_usd) as liquidated_amount_usd
from anchor.liquidations
where liquidated_currency = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
group by 1
)
select
Anchor_liquidation.*,
avg_price,
liquidated_amount_usd/liquidated_amount as avg_liquidated_price
from Anchor_liquidation
left join avg_price on (avg_price.time = Anchor_liquidation.time)
Run a query to Download Data