KaskoazulLUNA Staking and Trends (30,60,90 days)
    Updated 2022-09-24
    with cte_liquid_luna as (
    select balance as liquid_balance, address as wallet_address_liquid, date as date_liquid
    from terra.daily_balances
    where date_liquid >= DATEADD(DAY, -{{Days}}, GETDATE()) and date_liquid < CURRENT_DATE -1
    and currency = 'LUNA'
    and balance_type = 'liquid'
    and wallet_address_liquid != 'terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw' -- LFG
    and wallet_address_liquid != 'terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6' -- TFL
    and wallet_address_liquid != 'terra1wqmfu6w725sal3nvr0ggy49mmtwqgc6tyf4anp' -- A: Luna Incentives Distribution
    and wallet_address_liquid != 'terra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f' -- CM: Oracle Rewards
    and wallet_address_liquid != 'terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh' -- CM: Bonded Luna
    --and wallet_address_liquid != 'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts' -- C: BLuna Hub
    and wallet_address_liquid != 'terra1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8pm7utl' -- CM: Account Distribution
    and wallet_address_liquid != 'terra1tygms3xhhs3yv487phx3dw4a95jn7t7l8l07dr' -- CM: Not Bonded Tokens Pool
    ),
    cte_staked_luna as (
    select balance as staked_balance, address as wallet_address_staked, date as date_staked
    from terra.daily_balances
    where date_staked >= DATEADD(DAY, -{{Days}}, GETDATE()) and date_staked < CURRENT_DATE -1
    and currency = 'LUNA'
    and balance_type = 'staked'
    and wallet_address_staked != 'terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw' -- LFG
    and wallet_address_staked != 'terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6' -- TFL
    and wallet_address_staked != 'terra1wqmfu6w725sal3nvr0ggy49mmtwqgc6tyf4anp' -- A: Luna Incentives Distribution
    and wallet_address_staked != 'terra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f' -- CM: Oracle Rewards
    and wallet_address_staked != 'terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh' -- CM: Bonded Luna
    --and wallet_address_staked != 'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts' -- C: BLuna Hub
    and wallet_address_staked != 'terra1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8pm7utl' -- CM: Account Distribution
    and wallet_address_staked != 'terra1tygms3xhhs3yv487phx3dw4a95jn7t7l8l07dr' -- CM: Not Bonded Tokens Pool
    ),

    staked as (
    select SUM(staked_balance) as staked, date_staked
    from cte_staked_luna
    group by date_staked
    Run a query to Download Data