> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raze.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Token trades

> Latest trades, newest first. One transaction can produce several rows, also for one wallet:
on Solana two wallets that sign it are two rows; a multi-hop swap through the token can be a
sell and a buy of the same wallet, and a swap routed through several pools several rows on
the same side; on EVM chains a row is one swap log. Rows have no id: if a list needs a key,
use `signature` + `wallet` + `side` + `amount`, never `signature` alone.

Page back with `next` until it is `null`: a page can hold fewer rows than `limit` and still
carry `next`. A Solana page may also hold more than `limit` rows, when one transaction alone
has more, and the first page may leave out the last half second of trades, which the
`trades` channel carries.


Newest first. Page back with the `next` of the previous page as `cursor`; `next` is `null` on the last page. `wallet=` keeps one wallet's trades.

* A row is one wallet's side of a swap. One transaction can give several rows, also for one wallet: on Solana two wallets that sign it are two rows; a multi-hop swap through the token can be a sell and a buy of the same wallet, and a swap routed through several pools several rows on the same side; on EVM chains a row is one swap log.
* Rows have no id, and the pages of one walk do not repeat a row. If a list needs a key, use `signature` + `wallet` + `side` + `amount`; never `signature` alone, or `signature` + `wallet`.
* `side` is the side of the token: `buy` means the wallet received it.
* `quoteAmount` and `quoteSymbol` are the other side of the swap (SOL, USDC, WETH, BNB, …), in whole units.
* `pool` and `dex` can be `null`: history rows often lack them, and EVM live rows have no `dex`. `volumeUsd`, `priceUsd`, `quoteAmount` and `quoteSymbol` can be `null` on a history row too.
* The row count does not end the walk: a page can hold fewer rows than `limit`, even none, and still carry `next`. A Solana page may also hold more than `limit` rows, when one transaction alone has more, and the first page may leave out the last half second of trades, which the live channel carries.
* A Solana page may answer **503** with `Retry-After`: it cannot be served right now. Ask again after it, with the same cursor.

Live: the [`trades` channel](/streaming/channels#trades) sends the last 100 trades, then every new one.


## OpenAPI

````yaml GET /v1/tokens/{chain}/{address}/trades
openapi: 3.1.0
info:
  title: Raze Market Data API
  version: 1.0.0
  description: >
    Multichain market data for tokens, trades, charts, holders, launchpads and
    wallets on

    Solana, Ethereum, BNB Chain, Base and Robinhood Chain, as REST snapshots and
    live streams.


    **Conventions, everywhere:**

    - Chains: `sol`, `eth`, `bsc`, `base`, `robinhood` (aliases `solana`,
    `ethereum`, `bnb`, `hood` and network ids work too).

    - EVM addresses are answered lowercase; Solana addresses are case-sensitive.

    - Amounts in USD end in `Usd`; percents are 0–100 and end in `Percent`;
    times are Unix **milliseconds**.

    - A value nobody knows is `null`, never `0`.

    - Success: `{"data": …}`, plus `"next"` on paged lists (pass it back as
    `cursor`, as given). A
      page can hold fewer rows than `limit`, even none, and still carry `next`: a list ends only
      where `next` is `null`.
    - Failure: `{"error": {"code", "message"}}` with status 400 (`bad_request`),
    401 (`unauthorized`),
      404 (`not_found`), 429 (`rate_limited`), 502 (`upstream_unavailable`), or 503 with a
      `Retry-After` header (`upstream_unavailable` on a page to ask for again, `server_busy` on a
      new live connection).
    - A Solana address that does not decode to a 32-byte key is a 400 wherever
    one token or wallet
      is named. Lists (`/v1/tokens?ids=`, `/v1/prices?tokens=`) leave out an id that looks like a
      Solana address (32 to 44 base58 characters) but is not a 32-byte key; an id that does not look
      like an address still fails the whole list with 400.

    **Auth:** send your key as `x-api-key`, `Authorization: Bearer <key>`, or
    `?apiKey=` (for

    WebSocket and EventSource, which cannot set headers). `/health` and
    `/v1/openapi.yaml` need no

    key.


    **Live:** one WebSocket at `/v1/ws` carries any number of channels (also at

    `wss://ws.raze.bot`); the same channels are available one per connection as
    Server-Sent Events

    at `/v1/stream/{channel}`. Every channel sends a `snapshot` frame first,
    then changes.
servers:
  - url: https://api.raze.bot
    description: Production
security:
  - ApiKeyHeader: []
  - Bearer: []
  - ApiKeyQuery: []
tags:
  - name: catalog
    description: Health, chains and token search
  - name: tokens
    description: Token snapshot, trades, candles, holders, top traders, image
  - name: discovery
    description: Trending, screener and launchpad boards
  - name: wallets
    description: Wallet leaderboard, stats, holdings, PnL and swaps
  - name: prices
    description: Native coin prices and token prices
  - name: live
    description: WebSocket and Server-Sent Events
paths:
  /v1/tokens/{chain}/{address}/trades:
    get:
      tags:
        - tokens
      summary: Token trades
      description: >
        Latest trades, newest first. One transaction can produce several rows,
        also for one wallet:

        on Solana two wallets that sign it are two rows; a multi-hop swap
        through the token can be a

        sell and a buy of the same wallet, and a swap routed through several
        pools several rows on

        the same side; on EVM chains a row is one swap log. Rows have no id: if
        a list needs a key,

        use `signature` + `wallet` + `side` + `amount`, never `signature` alone.


        Page back with `next` until it is `null`: a page can hold fewer rows
        than `limit` and still

        carry `next`. A Solana page may also hold more than `limit` rows, when
        one transaction alone

        has more, and the first page may leave out the last half second of
        trades, which the

        `trades` channel carries.
      operationId: getTokenTrades
      parameters:
        - $ref: '#/components/parameters/chain'
        - $ref: '#/components/parameters/address'
        - name: limit
          in: query
          description: >-
            Rows per page; a Solana page may hold more when one transaction
            alone has more
          schema:
            type: integer
            default: 50
            maximum: 200
        - $ref: '#/components/parameters/cursor'
        - name: wallet
          in: query
          description: Only this wallet's trades (on Solana, a 32-byte key)
          schema:
            type: string
      responses:
        '200':
          description: A page of trades
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Trade'
                  next:
                    type:
                      - string
                      - 'null'
              example:
                data:
                  - chain: sol
                    token: DvNcJZTiSMD1RBCtZ2J31mh7s42CVCwrzGapv1Lypump
                    signature: >-
                      658yeJAmHj2x7oKzi25nhtk62i1FLpkmLNK7zY7xDFT6AskMXpxnQQhofofmBjDRqVP4wUk1L9uVbMFP3RdwuTBT
                    time: 1790813482436
                    side: buy
                    wallet: 87fH6QMogK5xk9mDHTUPRoVGcZF6ecDp9UTMUVxTQTvR
                    amount: 31100.17
                    volumeUsd: 20
                    priceUsd: 0.000643083
                    quoteAmount: 20
                    quoteSymbol: USDC
                    pool: mnnen34cBuJJ7Pvfdb2PN7WHgRvCMzcTej4bAgUiXob
                    dex: Pumpswap
                    tags:
                      - bundle
                next: NDUyMTIxNzc2MDExODkwNzI=
        '400':
          $ref: '#/components/responses/BadRequest'
        '503':
          $ref: '#/components/responses/RetrySoon'
components:
  parameters:
    chain:
      name: chain
      in: path
      required: true
      description: '`sol`, `eth`, `bsc`, `base` or `robinhood` (or an alias or network id)'
      schema:
        type: string
        example: sol
    address:
      name: address
      in: path
      required: true
      description: Token address (mint or contract)
      schema:
        type: string
        example: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
    cursor:
      name: cursor
      in: query
      description: >-
        The `next` of the previous page, as given (URL-encoded). Opaque, and its
        format may change; one the server can no longer honour is a `400`: start
        again from the first page. A cursor that keeps failing while the first
        page loads: start again from the first page too.
      schema:
        type: string
  schemas:
    Trade:
      type: object
      description: >
        One wallet's side of a swap, seen from the token. Rows have no id: one
        transaction can hold

        several rows, also for one wallet and on the same side (a swap routed
        through several pools;

        on EVM chains, one row per swap log). Never key rows on `signature`
        alone, or on `signature` +

        `wallet`.
      properties:
        chain:
          type: string
        token:
          type: string
        signature:
          type: string
          description: Transaction signature or hash
        time:
          type: integer
          description: ms
        side:
          type: string
          enum:
            - buy
            - sell
          description: Of the token
        wallet:
          type: string
        amount:
          type: number
          description: Whole tokens
        volumeUsd:
          $ref: '#/components/schemas/num'
        priceUsd:
          $ref: '#/components/schemas/num'
        quoteAmount:
          $ref: '#/components/schemas/num'
          description: Size in the quote token
        quoteSymbol:
          $ref: '#/components/schemas/str'
          description: 'The quote token: SOL, USDC, WETH, BNB, …'
        pool:
          $ref: '#/components/schemas/str'
          description: Can be null (history rows often lack it)
        dex:
          $ref: '#/components/schemas/str'
          description: Can be null (history rows often lack it; EVM live rows have none)
        tags:
          type: array
          description: Labels of the trade or its wallet; empty when none is known
          items:
            type: string
            enum:
              - bundle
              - sniper
              - mev
              - pro
              - dev
              - insider
              - smart
              - kol
              - whale
              - fresh
              - washtrade
              - sandwich
    num:
      type:
        - number
        - 'null'
    str:
      type:
        - string
        - 'null'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unauthorized
                - not_found
                - rate_limited
                - upstream_unavailable
                - server_busy
            message:
              type: string
  responses:
    BadRequest:
      description: A parameter is missing or wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: bad_request
              message: 'unknown chain ''xyz'', use one of: sol, eth, bsc, base, robinhood'
    RetrySoon:
      description: >-
        Cannot be served right now. Send the same request again (same
        parameters, same cursor if any) after `Retry-After` seconds
      headers:
        Retry-After:
          schema:
            type: integer
            example: 2
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    Bearer:
      type: http
      scheme: bearer
    ApiKeyQuery:
      type: apiKey
      in: query
      name: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.