hessUsers Breakdown based on total swaps on Arbitrum
    Updated 2022-10-16
    with tx as ( select *
    from polygon.core.fact_event_logs
    where event_name = 'Swap'
    and block_timestamp::date >= CURRENT_DATE - 180)
    ,
    label as (
    select ADDRESS as token, PROJECT_NAME
    from polygon.core.dim_labels
    where label_type = 'dex' and project_name ilike '%uniswap%'
    )
    ,
    swaps as ( select date(BLOCK_TIMESTAMP) as date , tx_hash as tx , origin_from_address as swapper, PROJECT_NAME as project
    from polygon.core.fact_event_logs a join label b on a.ORIGIN_TO_ADDRESS = b.token
    where tx_hash in ( select tx_hash from tx) and origin_from_address = EVENT_INPUTS:from
    UNION
    select date(block_timestamp) as date, tx_hash as tx , origin_from_address as swapper, 'Sushiswap' as project
    from polygon.sushi.ez_swaps
    where block_timestamp::date >= CURRENT_DATE - 180
    )
    ,
    arbi_tx as ( select *
    from arbitrum.core.fact_event_logs
    where event_name = 'Swap'
    and block_timestamp::date >= CURRENT_DATE - 180)
    ,
    arbi_label as (
    select ADDRESS as token, PROJECT_NAME
    from arbitrum.core.dim_labels
    where label_type = 'dex' and project_name ilike '%uniswap%'
    )
    ,
    arbi_swaps as ( select date(BLOCK_TIMESTAMP) as date , tx_hash as tx , origin_from_address as swapper, PROJECT_NAME as project
    from arbitrum.core.fact_event_logs a join arbi_label b on a.ORIGIN_TO_ADDRESS = b.token
    where tx_hash in ( select tx_hash from arbi_tx) and origin_from_address = EVENT_INPUTS:from
    UNION
    select date(block_timestamp) as date, tx_hash as tx , origin_from_address as swapper, 'Sushiswap' as project
    Run a query to Download Data