winnie-fsUniswap Multichain copy
    Updated 2023-07-17
    -- forked from deecy / Uniswap Multichain @ https://flipsidecrypto.xyz/deecy/q/6jKVcnC0rv31/uniswap-multichain

    With
    uniswap as (
    select
    address as pool_address,
    address_name as pool_name
    from crosschain.core.address_labels
    where project_name = 'uniswap'
    and address_name like 'uniswap v3 %'
    and label_subtype = 'pool'
    ),

    uniflow as (
    select
    block_timestamp::date as date,
    tx_hash,
    amount_in_usd as usd_in,
    symbol_in as token_in,
    amount_out_usd as for_usd,
    symbol_out as for_token,
    origin_from_address as wallet_address,
    case
    when usd_in <= 1000 then 'Shrimp'
    when usd_in > 1000 and usd_in <= 10000 then 'Crab'
    when usd_in > 10000 and usd_in <= 100000 then 'Turtle'
    when usd_in > 100000 and usd_in <= 1000000 then 'Shark'
    when usd_in > 1000000 then 'Whale'
    end as user_category
    from {{chain}}.core.ez_dex_swaps as deposit
    left join uniswap
    on deposit.contract_address = uniswap.pool_address
    where block_timestamp between '{{start_date}}' and '{{end_date}}'
    and usd_in >= '{{usd_amount}}'
    and event_name = 'Swap'
    and for_token not in ('WETH', 'USDC', 'WBTC', 'USDT', 'DAI', 'WMATIC', 'WBNB')
    Run a query to Download Data