CryptoIcicleAvalanche Swaps vs Transfers (Redux) - Swap vs Transfers- Hourly
    Updated 2022-12-05
    -- Pay by Quality Your score determines your final payout.
    -- Grand Prize 112.5 USDC (A score of 11 or 12 earns you a Grand Prize title)
    -- Payout 75 USDC
    -- Score Multiplier0-7 : 0% 8 : 50% 9 : 75% 10 : 100% 11 : 125% 12 : 150%
    -- Payout Network Ethereum
    -- Level Intermediate
    -- Difficulty Hard
    -- Examine Avalanche USDC(0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E- https://snowtrace.io/token/0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e) swaps vs transfers and
    -- mints vs burns using the new fact_event_logs data and avalanche.core.fact_traces data.

    -- Lets look at volume of USDC swaps vs transfer by hour since 7/1.
    -- What is the average amount of USDC transferred vs swapped?
    -- Show number of unique swapper addresses vs transfer addresses by day for USDC

    -- Next lets look at mints and burns of pairs involving
    -- Lets look at the volume of USDC mints and burns by hour since 7/1
    -- How many unique wallets are minting and burning USDC by day
    -- What is the average mint vs burn for USDC by day
    -- Note anything else interesting about USDC transactions

    -- SQL Credit: https://app.flipsidecrypto.com/velocity/queries/aa4328ba-ba94-487f-9861-1b216457dea4

    with swaptx as (
    select distinct tx_hash
    from avalanche.core.fact_event_logs
    where event_name = 'Swap')

    select 'Swap' as action_type,
    date_trunc('{{date_range}}',block_timestamp) as date,
    count (distinct tx_hash) as TX_Count,
    count (distinct origin_from_address) as Users_Count,
    sum (event_inputs:value/1e6) as Total_Volume,
    avg (event_inputs:value/1e6) as Average_Volume,
    median (event_inputs:value/1e6) as Median_Volume,
    sum (tx_count) over (order by date) as Cumulative_TX_Count,
    sum (total_volume) over (order by date) as Cumulative_Volume
    Run a query to Download Data