ArioAvalanche Swaps vs Transfers (Redux) - Distribution - swap vs Transfer
    Updated 2022-12-08
    select
    'Swap' as type,
    case
    when (event_inputs:value/pow(10,6)) < 100 then 'Tier 1: Less than $100'
    when (event_inputs:value/pow(10,6)) >= 100 and (event_inputs:value/pow(10,6)) < 1000 then 'Tier 2: $100-$1K'
    when (event_inputs:value/pow(10,6)) >= 1000 and (event_inputs:value/pow(10,6)) < 10000 then 'Tier 3: $1K-$10K'
    when (event_inputs:value/pow(10,6)) >= 10000 and (event_inputs:value/pow(10,6)) < 100000 then 'Tier 4: $10K-$100K'
    when (event_inputs:value/pow(10,6)) >= 100000 and (event_inputs:value/pow(10,6)) < 1000000 then 'Tier 5: $100K-$1M'
    else 'Tier 6: More than $1M'
    end as status,
    count(distinct tx_hash) as "# TXs"
    from
    avalanche.core.fact_event_logs
    where 1=1
    and
    tx_hash in (select distinct tx_hash from avalanche.core.fact_event_logs where event_name = 'Swap')
    and
    block_timestamp >= '2022-07-01'
    and
    contract_address = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
    and
    tx_status = 'SUCCESS'
    and
    event_inputs:value/pow(10,6) < pow(10,9)
    and
    event_inputs:value is not null
    group by 1,2

    union ALL

    select
    'Transfer' as Status,
    case
    when (event_inputs:value/pow(10,6)) < 100 then 'Tier 1: Less than $100'
    when (event_inputs:value/pow(10,6)) >= 100 and (event_inputs:value/pow(10,6)) < 1000 then 'Tier 2: $100-$1K'
    when (event_inputs:value/pow(10,6)) >= 1000 and (event_inputs:value/pow(10,6)) < 10000 then 'Tier 3: $1K-$10K'
    Run a query to Download Data