Updated 2024-04-13
    with edge_trades as (
    select
    *
    from arbitrum.vertex.ez_perp_trades
    where trader = '0x0000000000000000000000000000000000000000'
    )

    select
    date_trunc('day', a.block_timestamp) as date,
    sum(a.amount_usd) as volume,
    sum(volume) over (order by date) as cum_volume
    from blast.blitz.ez_perp_trades a
    join edge_trades b
    on a.block_timestamp = b.block_timestamp
    and a.trader = b.trader
    and a.subaccount = b.subaccount
    and a.symbol = b.symbol
    and a.trade_type != b.trade_type
    where a.is_taker = TRUE
    group by 1




    -- 121 m

    -- with edge_trades as (
    -- select
    -- *
    -- from blast.blitz.ez_perp_trades
    -- where trader = '0x0000000000000000000000000000000000000000'
    -- )

    -- select
    -- date_trunc('day', a.block_timestamp) as date,
    -- sum(a.amount_usd) as volume,
    QueryRunArchived: QueryRun has been archived