nasdfajskljcheck top traders + funder
    Updated 2024-09-13
    with data as (
    select
    swapper
    ,swap_to_mint as token
    ,swap_from_amount_usd as usd
    ,block_timestamp
    ,'buy' as buysell
    ,tx_id
    from solana.defi.ez_dex_swaps
    where 1=1 and swap_to_mint = 'GevMhaMtYtvv44pnkaoyBewrTuAK9x532xo55MTjpump'
    UNION ALL
    select
    swapper
    ,swap_from_mint as token
    ,swap_to_amount_usd as usd
    ,block_timestamp
    ,'sell' as buysell
    ,tx_id
    from solana.defi.ez_dex_swaps
    where 1=1 and swap_from_mint = 'GevMhaMtYtvv44pnkaoyBewrTuAK9x532xo55MTjpump'

    )
    , stats1 as (
    select
    swapper
    ,sum(usd) as vol
    ,sum(case when buysell='buy' then usd else 0 end) as buyvol
    ,sum(sum(usd)) over() as total_vol
    from data
    group by swapper
    order by vol desc
    )

    , joined as (
    select
    b.*
    QueryRunArchived: QueryRun has been archived