maybeyonassushi_poly_stable
    Updated 2021-12-08
    with eth_lps as (
    select * from (
    select
    pool_name,
    count(tx_id) as swaps,
    sum(amount_usd) as swap_usd_vol
    from ethereum.dex_swaps
    where platform = 'sushiswap'
    -- and tx_id = '0x248127092c1a6274e0749f043cb6adbc73290ef78e832231b1d5de4f18d72255'
    and direction = 'IN'
    group by 1
    )
    where swap_usd_vol is not null
    order by swap_usd_vol desc
    ),
    poly_lps as (
    select * from (
    select
    from_address_name as pool_name,
    count(tx_id) as swaps,
    sum(amount_usd) as swap_usd_vol
    from polygon.udm_events
    where split(from_address_name,' ')[0]::string = 'SushiSwap'
    -- and tx_id = '0x048d8e1f43f5a4235565112f9759f382046f1a1834d3aba5ddcb405db61373aa' --0x048d8e1f43f5a4235565112f9759f382046f1a1834d3aba5ddcb405db61373aa
    group by 1
    )
    where swap_usd_vol is not null
    order by swap_usd_vol desc
    )

    select *, 'Polygon' as network from (
    select * from poly_lps
    where
    split(split(pool_name,' ')[1]::string,'/')[0]::string in (
    'USDT','USDC','DAI','FRAX','UST','TUSD','PAX','BUSD','LUSD'
    )
    Run a query to Download Data