Flipside Community3a) Trade volume among new users
    Updated 2024-05-29
    -- forked from 2b @ https://flipsidecrypto.xyz/edit/queries/956394e3-fe4f-4801-b8b3-68e508994b63
    with arbitrum as
    (
    with addresses as
    (
    select from_address, min(block_timestamp) as first_transaction_sent
    from arbitrum.core.fact_transactions
    group by from_address
    having first_transaction_sent >= '{{Start_date}}'
    ),
    volume_traded as
    (
    (
    select origin_from_address as from_address,amount_in_usd as amount_usd from arbitrum.defi.ez_dex_swaps
    where block_timestamp >= '{{Start_date}}'
    and origin_from_address in ( select from_address from addresses)
    )
    union
    (
    select seller_address,price_usd as amount_usd from arbitrum.nft.ez_nft_sales
    where block_timestamp >= '{{Start_date}}'
    and seller_address in ( select from_address from addresses)
    )
    )

    select 'arbitrum' as chain, sum(amount_usd) as trade_volume from volume_traded
    ),

    ethereum as
    (
    with addresses as
    (
    select from_address, min(block_timestamp) as first_transaction_sent
    from ethereum.core.fact_transactions
    group by from_address
    having first_transaction_sent >= '{{Start_date}}'
    QueryRunArchived: QueryRun has been archived