Skip to main content
The DEXTrades Cube contains per-trade DEX swap events — the most granular trading data available. Use it to query individual trades, analyze wallet activity, track token prices, and find top traders.
All examples below use network: sol (Solana). Replace with eth, bsc, or polygon for other supported chains.

How do I get the latest DEX trades?

Fetch the 10 most recent DEX trades on Solana, including block info, transaction hash, buy/sell details, and the DEX protocol.
query {
  DEXTrades(
    network: sol
    limit: {count: 10}
    orderBy: Block_Time_DESC
  ) {
    Block { Time, Slot }
    Transaction { Hash }
    Trade {
      Buy {
        Currency { MintAddress }
        Amount
        PriceInUSD
        Account { Owner }
      }
      Sell {
        Currency { MintAddress }
        Amount
        Account { Owner }
      }
      Dex { ProgramAddress, ProtocolName }
    }
    Pool { Address }
  }
}
Open in GraphQL IDE — paste the query above to run it interactively with auto-complete and schema exploration.
FieldDescription
Block.TimeBlock timestamp (ISO 8601)
Block.SlotSolana slot number (Solana-specific)
Transaction.HashOn-chain transaction hash — use this to look up the tx on an explorer
Trade.Buy.Currency.MintAddressToken address of the bought asset
Trade.Buy.PriceInUSDUSD price of the bought token at trade time
Trade.Buy.Account.OwnerBuyer wallet address
Trade.Dex.ProtocolNameDEX name (e.g. Raydium, Orca, Jupiter)
Pool.AddressLiquidity pool address where the trade executed
  • Switch chain: Replace network: sol with network: eth, network: bsc, or network: polygon
  • Increase results: Change count: 10 to up to 10000
  • Add time filter: Add where: {Block: {Time: {after: "2025-03-01T00:00:00Z"}}} to scope to a time range
  • Filter by DEX: Add where: {Trade: {Dex: {ProtocolName: {is: "Raydium"}}}} to limit to a specific protocol

How do I get trades for a specific token?

Get trades for a specific token by passing its address via the tokenAddress selector.
query {
  DEXTrades(
    network: sol
    limit: {count: 10}
    tokenAddress: {is: "TOKEN_ADDRESS"}
    orderBy: Block_Time_DESC
  ) {
    Block { Time }
    Trade {
      Buy { Amount, PriceInUSD, Account { Owner } }
      Sell { Currency { MintAddress }, Amount }
      Dex { ProtocolName }
    }
    Pool { Address }
  }
}
Replace TOKEN_ADDRESS with the actual token mint address (e.g. EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v for USDC on Solana). See token metadata to look up addresses by name.
FieldDescription
Trade.Buy.AmountQuantity of tokens bought
Trade.Buy.PriceInUSDPrice per token at trade time
Trade.Buy.Account.OwnerWallet that executed the buy
Trade.Sell.Currency.MintAddressToken address of the sold asset (the other side of the pair)
Trade.Dex.ProtocolNameDEX protocol name
  • Filter by minimum amount: Add where: {Trade: {Buy: {Amount: {gt: 1000}}}} to only see large trades
  • Filter by price range: Add where: {Trade: {Buy: {PriceInUSD: {gte: 0.001, lte: 1.0}}}} to scope to a price band
  • Exclude suspect trades: The IsSuspect = false filter is applied by default — bot/MEV trades are already excluded

How do I get all trades by a wallet?

Get all trades by a specific wallet address.
query {
  DEXTrades(
    network: sol
    limit: {count: 20}
    walletAddress: {is: "WALLET_ADDRESS"}
    orderBy: Block_Time_DESC
  ) {
    Block { Time }
    Trade {
      Buy { Currency { MintAddress }, Amount, PriceInUSD }
      Sell { Currency { MintAddress }, Amount }
      Dex { ProtocolName }
    }
    Transaction { Hash, FeeInNative }
  }
}
The walletAddress selector matches trades where the given wallet is either the buyer or the seller.
FieldDescription
Trade.Buy.Currency.MintAddressToken bought
Trade.Sell.Currency.MintAddressToken sold
Transaction.FeeInNativeGas fee in native token (SOL on Solana)
  • Filter to a single token: Combine with tokenAddress: {is: "TOKEN_ADDRESS"} to see only trades for a specific token by this wallet
  • Add time window: Add where: {Block: {Time: {after: "2025-03-01T00:00:00Z"}}} to limit to recent trades
  • Increase limit: Set count: 100 to retrieve more history (max 10,000)

How do I get a token’s current price?

Get the latest price for a token from its most recent non-suspect trade.
query {
  DEXTrades(
    network: sol
    limit: {count: 1}
    tokenAddress: {is: "TOKEN_ADDRESS"}
    where: {IsSuspect: {eq: false}}
    orderBy: Block_Time_DESC
  ) {
    Trade {
      Buy { PriceInUSD, PriceInNative }
    }
    Block { Time }
  }
}
FieldDescription
Trade.Buy.PriceInUSDUSD price from the most recent trade
Trade.Buy.PriceInNativePrice denominated in the chain’s native token (SOL, ETH, BNB)
Block.TimeTimestamp of the trade — indicates how recent the price is
  • Multiple prices: Increase count to get a series of recent prices for averaging
  • Cross-chain: Use network: eth to get the same token’s price on Ethereum (if it exists on that chain)
For reliable token price data over time, consider using the Pairs Cube instead — it provides pre-computed candlestick data with open/high/low/close prices per minute.

How do I find the top traders for a token?

Find the top traders for a token using aggregation. This query groups trades by buyer wallet and returns the total buy count and volume.
query {
  DEXTrades(
    network: sol
    limit: {count: 100}
    tokenAddress: {is: "TOKEN_ADDRESS"}
    where: {IsSuspect: {eq: false}}
  ) {
    Trade {
      Buy {
        Account { Owner }
        Amount
        PriceInUSD
      }
    }
    count
    sum(of: Trade_Buy_Amount)
  }
}
FieldDescription
Trade.Buy.Account.OwnerWallet address (grouping key)
countNumber of trades by this wallet
sum(of: Trade_Buy_Amount)Total tokens bought by this wallet
  • Sort by volume: The results are grouped by the dimension fields — select fewer dimensions for higher-level aggregation
  • Time-scoped leaderboard: Add where: {Block: {Time: {after: "2025-03-01T00:00:00Z"}}} to limit to a specific period
  • Exclude small trades: Add Trade: {Buy: {Amount: {gt: 100}}} to the where clause
When you include metric fields (count, sum) alongside dimension fields, the API automatically groups results by the selected dimensions. See Metrics & Aggregation for full details.

Multi-Chain Examples

The same queries work across all supported chains — just change the network parameter.
query {
  DEXTrades(
    network: sol
    limit: {count: 5}
    orderBy: Block_Time_DESC
  ) {
    Block { Time, Slot }
    Trade {
      Buy { Currency { MintAddress }, PriceInUSD }
      Dex { ProtocolName }
    }
  }
}

Next Steps

Transfers

Query on-chain token transfer data.

Balances & Holders

Look up wallet balances, balance history, and top holders.

Pools & Liquidity

Explore DEX pools and liquidity data.

OHLC & Statistics

Fetch candlestick data, trade stats, market cap, and token metadata.