maybeyonassushi_lp_bals
    Updated 2022-01-25
    -- with
    -- pools as (
    -- select * from (
    -- select
    -- pool_name,
    -- pool_address
    -- from ethereum.dex_swaps
    -- where platform = 'sushiswap'
    -- and direction = 'IN'
    -- )
    -- ),
    -- pool_bals as (
    -- select
    -- -- balance_date,
    -- address_name,
    -- user_address,
    -- sum(amount_usd) as tvl
    -- from ethereum.erc20_balances
    -- where user_address in (select pool_address from pools)
    -- and balance_date in (select balance_date from ethereum.erc20_balances order by balance_date desc limit 1)
    -- and amount_usd is not null
    -- and address_name is not null
    -- group by 1,2,3
    -- )

    -- select * from pool_bals
    -- order by tvl desc
    -- -- where rank <= 10
    -- limit 10

    with
    move_into as (
    select
    contract_address,
    case contract_address
    when '0x795065dcc9f64b5614c407a6efdc400da6221fb0' then 'SLP'
    Run a query to Download Data