andurilDaily Active Swappers Solana
    Updated 2022-10-04
    select date_trunc(week,block_timestamp) as week,
    'Stepn DEX' as swap_program,
    count (distinct t.signers[0]) as daily_swapper_count,
    count (distinct t.tx_id) as txs
    from
    solana.core.fact_transactions t
    inner join solana.core.fact_events e
    on e.tx_id = t.tx_id
    where
    date(t.block_timestamp) between '2022-06-01' and current_date()-1 and
    e.succeeded = 'TRUE' and
    e.program_id = 'Dooar9JkhdZ7J3LHN3A7YCuoGRUggXhQaG4kijfLGU2j' and
    log_messages::string like '%Program log: Instruction: Swap%'
    group by date

    union

    select
    date(block_timestamp) as date,
    case when swap_program = 'jupiter aggregator v2' then 'Jupiter' when swap_program = 'orca' then 'Orca' when swap_program = 'raydium v4' then 'Raydium' else swap_program end as swap_program,
    count(distinct swapper) daily_swapper_count
    from solana.fact_swaps
    where
    date between '2022-06-01' and CURRENT_DATE()-1 and
    succeeded = 'TRUE'
    group by date,swap_program



    Run a query to Download Data