MuzeBot Swaps

    -- this query is courtesy of Marqu

    with activity as (

    select

    block_timestamp,
    tx_id,
    signers[0] as wallet_address
    from solana.core.fact_events a
    where program_id in (
    'JUP4Fb2cqiRUcaTHdrPC8h2gNsA2ETXiPDD33WcGuJB',
    'JUP3c2Uh3WA4Ng34tw6kPd2G4C5BB21Xo36Je1s32Ph',
    'JUP2jxvXaqu7NQY1GmNF4m1vodw12LVXYxbFL2uJvfo'
    )
    and a.block_timestamp >= '{{Start_Date}}'
    and a.block_timestamp <= '{{End_Date}}'
    and succeeded
    ),

    aggregated as (

    select

    date_trunc('{{Date_Trunc}}', block_timestamp) as date,
    wallet_address,
    count(distinct tx_id) as txs,
    iff(txs < 200, 'Human','Bots') as label

    from activity
    group by 1,2
    ),

    dates as (
    Run a query to Download Data