SyndicaDEX Activity
    Updated 2025-04-11
    with

    aptos as (
    select
    'aptos' as blockchain
    , date_trunc('month', block_timestamp) as month
    , sum(
    case
    when amount_in_usd is not null and amount_out_usd is not null then least(amount_in_usd, amount_out_usd)
    when amount_in_usd is null and amount_out_usd is null then
    case
    when p1.price * sw.amount_in is not null and p2.price * sw.amount_out is not null then
    least(p1.price * sw.amount_in, p2.price * sw.amount_out)
    else coalesce(p1.price * sw.amount_in, p2.price * sw.amount_out)
    end
    else coalesce(amount_in_usd, amount_out_usd)
    end
    ) as "USD Volume"
    , count(distinct tx_hash) as "Trades"
    , count(distinct swapper) as "Traders"
    from aptos.defi.ez_dex_swaps sw left join aptos.price.ez_prices_hourly p1
    on sw.token_in = p1.token_address
    and date_trunc('hour', sw.block_timestamp) = p1.hour
    left join aptos.price.ez_prices_hourly p2
    on sw.token_out = p2.token_address
    and date_trunc('hour', sw.block_timestamp) = p2.hour
    where block_timestamp >= '2025-02-01' and block_timestamp < '2025-04-01'
    group by 1,2
    )

    , dune_sonic AS (
    SELECT
    livequery.live.udf_api(
    'https://api.dune.com/api/v1/query/4822144/results?api_key={DuneAPIKeyRain}',
    'DuneAPI'
    ) :data:result:rows AS response
    Last run: 18 days ago
    BLOCKCHAIN
    MONTH
    USD Volume
    Trades
    Traders
    1
    aptos2025-02-01 00:00:00.000348704546.253664172282071486
    2
    arbitrum2025-02-01 00:00:00.00021749878789.88691642258416351632
    3
    avalanche_c2025-02-01 00:00:00.0004055352341.8383922049382204938
    4
    base2025-02-01 00:00:00.00033739767735.95324419264610464936
    5
    berachain2025-02-01 00:00:00.0001825927821.6910267266806726680
    6
    bsc2025-02-01 00:00:00.00077410999954.0633299543312029997
    7
    ethereum2025-02-01 00:00:00.00055069426388.19165397594897230
    8
    optimism2025-02-01 00:00:00.0002767528756.5204843417984341798
    9
    polygon2025-02-01 00:00:00.0003103637480.4263985783158578315
    10
    sei2025-02-01 00:00:00.000116319821.42792510534631053463
    11
    sei2025-02-01 00:00:00.000407363392.9765558921539081
    12
    solana2025-02-01 00:00:00.000199504267147.61866279598050420514
    13
    sonic2025-02-01 00:00:00.0003398427258.0942281076966564
    14
    aptos2025-03-01 00:00:00.000265521968.907274226278799466
    15
    arbitrum2025-03-01 00:00:00.00018389320217.3161710839617101492
    16
    avalanche_c2025-03-01 00:00:00.0003704810671.2015421680432168043
    17
    base2025-03-01 00:00:00.00025989294837.76684993605812722132
    18
    berachain2025-03-01 00:00:00.0002520233932.4261192737779273777
    19
    bsc2025-03-01 00:00:00.00042654922474.3795345718192393149
    20
    ethereum2025-03-01 00:00:00.00039350584069.75595324711715748
    26
    2KB
    49s