SocioAnalyticaBlitz Correlation Analysis
    Updated 2024-12-13
    with data as (
    select
    case when b.block_timestamp is not null then 'Blitz through Edge' else 'Blitz' end as type,
    a.*
    from blast.blitz.ez_perp_trades a
    left outer join blast.blitz.ez_edge_trades b ON
    a.tx_hash = b.tx_hash and
    a.event_index = b.edge_event_index and
    a.block_timestamp = b.block_timestamp

    )

    select
    date_trunc('hour', block_timestamp) as date,
    type,
    count(DISTINCT tx_hash) as n_orders,
    sum(amount_usd) as volume
    from data
    where is_taker = 'TRUE'
    and block_timestamp::date >= dateadd(day, -7, current_date)
    group by 1 , 2




    QueryRunArchived: QueryRun has been archived