Yousefi_1994Ultimate On-Chain Exchange - Top ALGO balance per Exchange
    Updated 2023-01-03
    with fix_parameter as (
    select
    case
    when '{{Days}}' = 'All time' then 2000
    when '{{Days}}' = 'Last 60 days' then 60
    when '{{Days}}' = 'Last 90 days' then 90
    when '{{Days}}' = 'Last 180 days' then 180
    when '{{Days}}' = 'Last 360 days' then 360
    else 2000
    end as time_frame,
    case
    when '{{Exchange}}' = 'All Exchanges' then 'tinyman,algofi,pactfi,wagmiswap,humbleswap,fxdx'
    when '{{Exchange}}' = 'Tinyman vs. Algofi' then 'tinyman,algofi'
    when '{{Exchange}}' = 'Tinyman vs. Pactfi' then 'tinyman,pactfi'
    when '{{Exchange}}' = 'Tinyman vs. Wagmi Swap' then 'tinyman,wagmiswap'
    when '{{Exchange}}' = 'Tinyman vs. Humble Swap' then 'tinyman,humbleswap'
    when '{{Exchange}}' = 'Tinyman vs. FXDX' then 'tinyman,fxdx'
    when '{{Exchange}}' = 'Algofi vs. Pactfi' then 'algofi,pactfi'
    when '{{Exchange}}' = 'Algofi vs. Wagmi Swap' then 'algofi,wagmiswap'
    when '{{Exchange}}' = 'Algofi vs. Humble Swap' then 'algofi,humbleswap'
    when '{{Exchange}}' = 'Algofi vs. FXDX' then 'algofi,fxdx'
    when '{{Exchange}}' = 'Pactfi vs. Wagmi Swap' then 'pactfi,wagmiswap'
    when '{{Exchange}}' = 'Pactfi vs. Humble Swap' then 'pactfi,humbleswap'
    when '{{Exchange}}' = 'Pactfi vs. FXDX' then 'pactfi,fxdx'
    when '{{Exchange}}' = 'Wagmi Swap vs. Humble Swap' then 'wagmiswap,humbleswap'
    when '{{Exchange}}' = 'Wagmi Swap vs. FXDX' then 'wagmiswap,fxdx'
    when '{{Exchange}}' = 'Humble Swap vs. FXDX' then 'humbleswap,fxdx'
    when '{{Exchange}}' = 'Tinyman' then 'tinyman'
    when '{{Exchange}}' = 'Algofi' then 'algofi'
    when '{{Exchange}}' = 'Pactfi' then 'pactfi'
    when '{{Exchange}}' = 'Wagmi Swap' then 'wagmiswap'
    when '{{Exchange}}' = 'Humble Swap' then 'humbleswap'
    when '{{Exchange}}' = 'FXDX' then 'fxdx'
    else 'tinyman,algofi,pactfi,wagmiswap,humbleswap,fxdx'
    end as exchanges,
    split(exchanges, ',') as exchanges_array
    Run a query to Download Data