CryptoIcicleArbitrum Free Square Question - USDC Swap Metrics
    Updated 2023-06-04
    -- Payout 125 USDC
    -- Grand Prize 2000 USDC
    -- Level Advanced

    -- Show us what you can do with this new Arbitrum data!
    -- SQL Credit: https://app.flipsidecrypto.com/velocity/queries/863e3649-6497-4616-b12e-c6c5094365e0

    SELECT
    date_trunc('day',block_timestamp) as date,
    sum(event_inputs:value) as raw_token_amount,
    raw_token_amount/1e6 as token_amount,
    count(DISTINCT tx_hash) as swaps,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as swappers
    FROM arbitrum.core.fact_event_logs
    LEFT outer JOIN flipside_prod_db.crosschain.address_labels
    ON contract_address = address and contract_address = '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8'
    WHERE tx_hash IN (
    SELECT DISTINCT tx_hash
    FROM arbitrum.core.fact_event_logs
    WHERE event_name LIKE 'Swap'
    )
    AND event_name LIKE 'Transfer'
    AND not address_name is NULL
    AND event_inputs:value is not NULL
    GROUP by date


    Run a query to Download Data