maybeyonascel_sushi_powah_wallet
    Updated 2022-07-12
    with
    cel_wallets as (
    select
    address
    from crosschain.address_labels
    where address_name = 'celsius wallet'
    ),
    sushi_prices as (
    select distinct price as SUSHI_price
    from ethereum.erc20_balances
    where contract_address in (
    lower('0x6b3595068778dd592e39a122f4f5a5cf09c90fe2') -- SUSHI
    )
    and balance_date in (select balance_date from ethereum.erc20_balances order by balance_date desc limit 1)
    ),
    xsushi_prices as (
    select distinct price as xSUSHI_price
    from ethereum.erc20_balances
    where contract_address in (
    lower('0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272') -- xSUSHI
    )
    and balance_date in (select balance_date from ethereum.erc20_balances order by balance_date desc limit 1)
    ),
    powah as (
    select
    1 as sushi_conv,
    xsushi_price/sushi_price as xsushi_conv,
    xsushi_conv*100000 as meowshi_conv
    from sushi_prices join xsushi_prices
    ),
    sushi_bals as (
    select
    user_address,
    contract_address,
    case contract_address
    when lower('0x650F44eD6F1FE0E1417cb4b3115d52494B4D9b6D') then 'MEOWSHI'
    Run a query to Download Data