adriaparcerisasSushiswap proportion DEX volume
    Updated 2022-02-14
    WITH
    sushiswap_v as (
    select
    trunc(block_timestamp,'day') as date,
    sum(amount_usd) as volume
    from ethereum.dex_swaps
    where platform='sushiswap' and block_timestamp >= CURRENT_DATE - 60 and amount_usd <10000000000
    GROUP BY 1
    order by 1 asc
    ),
    others_v as (
    select
    trunc(block_timestamp,'day') as date,
    sum(amount_usd) as volume
    from ethereum.dex_swaps
    where block_timestamp >= CURRENT_DATE - 60 and amount_usd <10000000000
    GROUP BY 1
    order by 1 asc
    )
    SELECT
    x.date,
    x.volume/y.volume as sushiswap_proportion,
    1-sushiswap_proportion as other_dex_proportion
    from sushiswap_v x, others_v y where x.date = y.date
    order by 1 asc

    Run a query to Download Data