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

# Stream real-time swap transactions for a single pool or token

> Establishes an SSE stream for swap transactions on a specific pool or token using query string parameters.
**Supported Channel Events:** - `pool`: Swap transactions for a pool. Schema matches `TransactionResponse`. - `token`: Swap transactions involving a token. Schema matches `TransactionResponse`. - `ping`: Infrastructure keep-alive payload (`PingEvent`). - `warning`: System warning notifications (`WarningEvent`). - `error`: Stream-level operational exceptions (`ErrorEvent`).




## OpenAPI

````yaml /streaming/api-streaming.yml get /sse/transactions
openapi: 3.1.0
info:
  title: DexPaprika Streaming API
  version: 1.0.1
  license:
    name: UNLICENSED
    identifier: UNLICENSED
  description: >
    The DexPaprika Streaming API delivers real-time updates for token prices,
    swap transactions,

    and pool reserves over Server-Sent Events (SSE).


    ## Rate Limits


    - **Concurrent SSE streams per IP:** 10. Excess returns `429` with
    `{"message": "ip stream limit exceeded"}`.

    - **Assets per `POST /sse/prices`:** 25. Excess returns `400` with
    `{"message": "too many assets, max 25 allowed"}`.

    - **Request body on `POST /sse/prices`:** 256 KB. Excess returns `413
    Payload Too Large`.

    - **Request rate (per IP x path x method):** 60 req / 60 s. Excess returns
    `429` with `{"message": "you have reached maximum request limit"}`.


    ## HTTP Response Codes


    - `200` — SSE connection established.

    - `400` — Invalid request (bad params, unknown chain, unknown asset, or
    asset cap exceeded).

    - `413` — Request body exceeds the route limit.

    - `429` — Per-IP stream limit, per-route rate limit, or global stream slot
    pool exhausted.

    - `503` — Service saturated (concurrent in-flight cap reached).


    ## SSE Event Format


    Events conform to the W3C SSE specification. Non-system events on
    multiplexed streams include

    an optional `request_id` line for correlating events to subscriptions:


    ```

    event: [event_name]

    request_id: [request_id]

    data: [json_payload]

    ```


    ## Event Types


    - `token_price` (`PriceResponse`) — Real-time price update.

    - `ping` (`PingEvent`) — Heartbeat sent every 15 s. Treat absence for >30 s
    as a potential connection problem.

    - `warning` (`WarningEvent`) — Non-fatal notice (e.g. partial subscription
    accepted).

    - `error` (`ErrorEvent`) — Terminal stream-level error sent before
    connection close.


    ## Error Message Catalog


    400 errors:

    - `at least one asset is required`

    - `invalid method`

    - `unsupported chain`

    - `asset not found`

    - `too many assets, max 25 allowed`


    429 errors:

    - `ip stream limit exceeded`

    - `Cannot create new subscriptions, global stream limit exceeded`

    - `you have reached maximum request limit`


    503 errors:

    - `Too many concurrent requests`


    ## Deprecation


    The `/stream` path is deprecated and scheduled for decommissioning — migrate
    to `/sse/prices`.

    See the deprecated `/stream` operations below for migration guidance.
servers:
  - url: https://streaming.dexpaprika.com
    description: Production Streaming Gateway
security: []
paths:
  /sse/transactions:
    get:
      summary: Stream real-time swap transactions for a single pool or token
      description: >
        Establishes an SSE stream for swap transactions on a specific pool or
        token using query string parameters.

        **Supported Channel Events:** - `pool`: Swap transactions for a pool.
        Schema matches `TransactionResponse`. - `token`: Swap transactions
        involving a token. Schema matches `TransactionResponse`. - `ping`:
        Infrastructure keep-alive payload (`PingEvent`). - `warning`: System
        warning notifications (`WarningEvent`). - `error`: Stream-level
        operational exceptions (`ErrorEvent`).
      operationId: streamSingleAssetTransactions
      parameters:
        - name: method
          in: query
          required: true
          schema:
            type: string
            enum:
              - pool
              - token
          description: >-
            Subscription target type — `pool` for pool-level transactions,
            `token` for token-level.
        - name: address
          in: query
          required: true
          schema:
            type: string
          description: Target pool or token smart contract address.
        - name: chain
          in: query
          required: true
          schema:
            type: string
          description: Target blockchain network identifier (e.g., `ethereum`, `solana`).
        - name: request_id
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 4294967295
          description: Optional identifier for tracking the request in the SSE stream.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: Maximum event count before server-initiated connection teardown.
      responses:
        '200':
          description: SSE stream successfully established.
          content:
            text/event-stream:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/TransactionResponse'
                  - $ref: '#/components/schemas/PingEvent'
                  - $ref: '#/components/schemas/WarningEvent'
                  - $ref: '#/components/schemas/ErrorEvent'
        4XX:
          description: >-
            Client error (e.g., invalid parameters, asset not found, or stream
            limit exceeded).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
components:
  schemas:
    TransactionResponse:
      type: object
      description: >-
        Swap transaction event payload. Emitted on the `pool` or `token` event
        channel.
      properties:
        chain:
          type: string
          description: Blockchain network identifier.
          example: ethereum
        pool_id:
          type: string
          description: Pool smart contract address.
          example: '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'
        block_number:
          type: string
          description: >-
            Block number in which the swap was confirmed (string-encoded
            integer).
          example: '19000000'
        block_timestamp:
          type: string
          format: date-time
          description: Block timestamp in RFC 3339 format.
        tx_hash:
          type: string
          description: Transaction hash.
          example: 0xabc123...
        sender:
          type: string
          description: Address that initiated the swap.
          example: '0xd3cda913deb6f0967b991b2d0a373199c2f7c90c'
        recipient:
          type: string
          description: Address that received the output tokens.
          example: '0xd3cda913deb6f0967b991b2d0a373199c2f7c90c'
        token_0:
          type: string
          description: Address of the first token in the pool.
          example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        token_1:
          type: string
          description: Address of the second token in the pool.
          example: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
        amount_0:
          type: number
          description: >-
            Raw token0 amount from the chain (not decimal-normalised). Negative
            means tokens left the user's wallet.
          example: -1000
        amount_1:
          type: number
          description: >-
            Raw token1 amount from the chain (not decimal-normalised). Positive
            means tokens entered the user's wallet.
          example: 500000000
        amount_0_usd:
          type: number
          description: >-
            USD value of token0 amount (decimal-normalised volume × price).
            Preserves sign from the underlying volume.
          example: -1000.5
        amount_1_usd:
          type: number
          description: >-
            USD value of token1 amount (decimal-normalised volume × price).
            Preserves sign from the underlying volume.
          example: 998.75
        price_0_usd:
          type: number
          description: USD price per one unit of token0 (after decimal normalisation).
          example: 1.0005
        price_1_usd:
          type: number
          description: USD price per one unit of token1 (after decimal normalisation).
          example: 1997.5
        volume_usd:
          type: number
          description: Estimated USD volume of the swap.
          example: 999.625
    PingEvent:
      type: object
      description: Heartbeat sent every 15 s to keep the connection alive.
      properties:
        time:
          type: integer
          description: Unix epoch seconds at the time of the ping.
          example: 1715162400
    WarningEvent:
      type: object
      description: >-
        Non-fatal notice sent over the stream without closing it (e.g. a partial
        subscription was accepted).
      properties:
        message:
          type: string
          description: Human-readable warning description.
          example: stream is deprecated, move to /sse/prices instead
    ErrorEvent:
      type: object
      description: >-
        Terminal error sent before the server closes the stream. Also used as
        the body for 4XX/5XX HTTP error responses.
      properties:
        message:
          type: string
          description: >-
            Human-readable error description. See the Error Message Catalog in
            the overview for the full list of stable values.
          example: asset not found

````