PapasotLuna burn
    Updated 2022-07-07
    -- adapted SQL code from https://app.flipsidecrypto.com/dashboard/pleasure-to-burn-1xFfCo
    -- credits to the original author, potmo

    -- WITH BURNED AS(
    SELECT TO_DATE(block_timestamp) AS date,
    CAST(SUM (token_0_amount) AS INTEGER) AS "Luna burned",
    CAST(SUM (token_0_amount_usd) AS INTEGER) AS "Luna burned_USD volume"
    FROM terra.swaps
    WHERE TO_DATE(block_timestamp) >= dateadd(day, -180, current_date())
    AND offer_currency = 'LUNA'
    AND tx_status = 'SUCCEEDED'
    GROUP BY 1
    ORDER BY 1 -- )

    --SELECT * FROM BURNED
    --WHERE "burned Luna" > 2.7e6

    -- This gets the total supply from the balance table.
    -- select
    -- DATE,
    -- sum(balance) as daily_supply
    -- from terra.daily_balances
    -- where date(date) >= current_date() - 60
    -- and currency = 'UST'
    -- and balance > 0
    -- group by date
    -- order by date
    Run a query to Download Data