0xaimanWhen UST > USD
    Updated 2022-04-11

    select d as day, up as UST_price, 1000*up as swap_ust_to_USD, swap_ust_to_USD-1000 as profit_in_usd
    from
    (select date_trunc('day',block_timestamp) as d , avg(price_usd) as UP, avg(luna_exchange_rate) as LP
    from terra.oracle_prices
    where symbol = 'UST' --and UP>1
    and block_timestamp>='2022-01-01'
    group by 1
    order by 1 )
    where day='2022-01-26'
    order by 4 desc
    Run a query to Download Data