boomer77luna burn past 30 days
    Updated 2022-02-28
    with raw as (select date_trunc('day', block_timestamp) as dt, sum(offer_amount) as luna_burn
    from terra.swaps
    where offer_currency = 'LUNA' and block_timestamp >= CURRENT_DATE - 30 and tx_status = 'SUCCEEDED'
    group by 1),

    ust as (select date, sum(balance) as total
    from terra.daily_balances
    where currency = 'UST' and address not in ('terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8')
    group by 1)

    select a.dt, a.luna_burn, b.total as ust_supply
    from raw a
    left join ust b on a.dt = b.date
    Run a query to Download Data