KaskoazulLUNA Market Cap pre-2021
    Updated 2022-05-09
    with PRICE as (
    select date_trunc ('week', block_timestamp) as fecha,
    min(price_usd) as min_price,
    avg(price_usd) as avg_price,
    max(price_usd) as max_price
    from terra.oracle_prices
    where fecha < '2021-01-01'
    and currency = 'uluna'
    group by 1
    order by 1 desc
    ),

    CIRC_SUPPLY_DAILY as (
    select sum (balance) as circ_supply,
    date
    from terra.daily_balances
    where date < '2021-01-01'
    and currency = 'LUNA'
    and address != 'terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw' -- LFG
    and address != 'terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6' -- TFL
    and address != 'terra1wqmfu6w725sal3nvr0ggy49mmtwqgc6tyf4anp' -- A: Luna Incentives Distribution
    and address != 'terra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f' -- CM: Oracle Rewards
    and address != 'terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh' -- CM: Bonded Luna
    and address != 'terra1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8pm7utl' -- CM: Account Distribution
    and address != 'terra1tygms3xhhs3yv487phx3dw4a95jn7t7l8l07dr' -- CM: Not Bonded Tokens Pool
    group by 2
    ),

    CIR_SUPPLY_WEEKLY as (
    select date_trunc ('week', date) as fecha,
    avg (circ_supply) as weekly_circ_supply
    from CIRC_SUPPLY_DAILY
    group by 1
    order by 1 desc
    )

    Run a query to Download Data