mariyaLUNA Circulating Supply / Price /Market Cap in Past 30 Days
    Updated 2022-05-17
    with luna_price as (
    select block_timestamp::date as date, avg(price_usd) as price
    from terra.oracle_prices
    where symbol = 'LUNA'
    and block_timestamp::date > current_date - 30
    group by 1
    ),
    luna_circulating_supply as (
    select date as day, sum(balance) as supply
    from terra.daily_balances
    where currency = 'LUNA'
    and date >= current_date - 30
    and address not in (
    'terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw',
    'terra1wqmfu6w725sal3nvr0ggy49mmtwqgc6tyf4anp',
    'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts',
    'terra1tygms3xhhs3yv487phx3dw4a95jn7t7l8l07dr',
    'terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6',
    'terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh',
    'terra1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8pm7utl',
    'terra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f'
    )
    group by 1
    )
    select p.date as date, p.price as luna_price, s.supply as luna_supply, s.supply * p.price as market_cap
    from luna_price p
    join luna_circulating_supply s on p.date = s.day
    order by 1

    Run a query to Download Data