drone-mostafaThe effect of burning Luna on Luna price change
    Updated 2022-04-23
    with luna_burning as(
    select date_trunc('day', block_timestamp) as day,
    sum(token_0_amount) as luna_burn
    from terra.swaps
    where offer_currency = 'LUNA'
    and to_date(block_timestamp) >= dateadd(day, -180, current_date())
    and tx_status = 'SUCCEEDED'
    group by 1),
    lunaprice as(
    select date_trunc('day', block_timestamp) as day,
    symbol,
    avg(price_usd) as Price_Luna
    from terra.oracle_prices
    where symbol = 'LUNA'
    and block_timestamp > current_date - 180
    group by 1,2
    order by 1 DESC
    )
    select day,luna_burn,symbol,Price_Luna
    from luna_burning join lunaprice using(day)
    Run a query to Download Data