KaskoazulOlympusDAO - 1. Staked vs unstaked OHM
    Updated 2022-04-15
    with OHM as (
    select balance_date as fecha,
    sum(balance) as unstaked
    from ethereum.erc20_balances
    where contract_address = lower('0x64aa3364F17a4D01c6f1751Fd97C2BD3D7e7f1D5') --OHM v2
    group by 1
    order by 1
    ),

    sOHM as (
    select balance_date as fecha,
    sum(balance) as staked
    from ethereum.erc20_balances
    where contract_address = lower('0x04906695D6D12CF5459975d7C3C03356E4Ccd460') --sOHM v2
    group by 1
    order by 1
    ),

    OHM_price as (
    select date_trunc('day', hour) as fecha,
    avg(price) as price
    from ethereum.token_prices_hourly
    where token_address = lower('0x64aa3364F17a4D01c6f1751Fd97C2BD3D7e7f1D5') --OHM v2
    group by 1
    order by 1

    ),

    sOHM_price as (
    select date_trunc('day', hour) as fecha,
    avg(price) as price
    from ethereum.token_prices_hourly
    where token_address = lower('0x04906695D6D12CF5459975d7C3C03356E4Ccd460') --sOHM v2
    group by 1
    order by 1
    ),
    Run a query to Download Data