jackguyGMX Traders
    Updated 2023-10-27
    with tab1 as (
    SELECT DISTINCT tx_hash
    FROM arbitrum.core.fact_event_logs
    --WHERE tx_hash LIKE '0x9ccb6b35a6e1dd1438caca2189c3030d05bef0b829ce399cc30d6b08db3ea031'
    WHERE contract_address LIKE lower('0xa906f338cb21815cbc4bc87ace9e68c87ef8d8f1')
    AND ORIGIN_FUNCTION_SIGNATURE LIKE '0x30b70002'
    -- LIMIT 100
    )

    SELECT
    date_trunc('day', block_timestamp) as day,
    COUNT(DISTINCT tx_hash) as events,
    COUNT(DISTINCT origin_from_address) as users,
    sum(AMOUNT_USD) as volume,
    avg(AMOUNT_USD) as avg_volume
    FROM arbitrum.core.ez_eth_transfers
    WHERE tx_hash in (SELECT * FROM tab1)
    AND eth_to_address = ORIGIN_FROM_ADDRESS
    GROUP BY 1
    Run a query to Download Data