lagandispenserNew and Active Vertex Users copy
    Updated 2024-03-16
    -- forked from 0xHaM-d / New and Active Vertex Users @ https://flipsidecrypto.xyz/0xHaM-d/q/HJauPBO5aQTl/new-and-active-vertex-users

    -- forked from New and Active Aptos Users @ https://flipsidecrypto.xyz/edit/queries/74bb5ee4-96ae-44c9-b11b-5137eb21d0e0

    with txs as (
    SELECT DISTINCT
    block_timestamp,
    tx_hash,
    contract_address,
    symbol,
    trader,
    amount_usd,
    fee_amount,
    is_taker,
    'perp' AS label
    FROM arbitrum.vertex.ez_perp_trades

    UNION ALL

    SELECT DISTINCT
    block_timestamp,
    tx_hash,
    contract_address,
    symbol,
    trader,
    amount_usd,
    fee_amount,
    is_taker,
    'spot' AS label
    FROM arbitrum.vertex.ez_spot_trades
    )
    , wallet_age AS (
    SELECT
    trader as address,
    count(distinct TX_HASH) as tx_counts,
    count(distinct date(block_timestamp)) as days_active,
    QueryRunArchived: QueryRun has been archived