maybeyonassteth_pool
    Updated 2022-02-09
    with er20balance as(
    select
    balance_date,
    contract_address,
    symbol,
    sum(balance) as lp_tokens
    from ethereum.erc20_balances
    group by balance_date,symbol,contract_address
    ),
    crv_liq as(
    select * from er20balance
    where contract_address = lower('0x06325440D014e39736583c165C2963BA99fAf14E')
    limit 100
    ),
    steth_liq as(
    select
    balance_date,
    sum(balance) as total_steth
    from ethereum.erc20_balances
    where
    contract_address=lower('0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
    and user_address=lower('0xDC24316b9AE028F1497c275EB9192a3Ea0f67022')
    group by 1
    ),
    proper_liq as(
    select
    s.balance_date,
    lp_tokens,
    total_steth,
    lp_tokens-total_steth as total_eth
    from crv_liq c join steth_liq s on c.balance_date=s.balance_date

    )

    select * from proper_liq

    Run a query to Download Data