> ## 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 prices for multiple assets (Deprecated)

> **Deprecated - scheduled for removal in 2027. Use [`POST /sse/prices`](#operation/streamBatchAssetPrices) with `method: token_price` instead.**
Establishes a multiplexed SSE stream for up to 25 token price subscriptions using the legacy `t_p` event channel. The path `/stream` is an alias for `/sse/prices` with identical parameters.
### Migration Guide
In each request body item, replace `"method": "t_p"` with `"method": "token_price"` and update your event handler to read `PriceResponse` fields instead of `PriceLegacyResponse` fields:
| Legacy field (`t_p` event) | Current field (`token_price` event) | |---|---| | `a` | `address` | | `c` | `chain` | | `p` | `price` | | `t` | `timestamp` | | `t_p` | `timestamp_price` |
**Emitted events:** `t_p` · `token_price` · `ping` · `warning` · `error`




## OpenAPI

````yaml post /stream
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.

    - `pool_reserves` (`PoolReservesResponse`) — Per-block reserve update for a
    subscribed pool.

    - `token_reserves` (`TokenReservesResponse`) — Aggregated reserve update for
    a subscribed token.

    - `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:
  /stream:
    post:
      summary: Stream real-time prices for multiple assets (Deprecated)
      description: >
        **Deprecated - scheduled for removal in 2027. Use [`POST
        /sse/prices`](#operation/streamBatchAssetPrices) with `method:
        token_price` instead.**

        Establishes a multiplexed SSE stream for up to 25 token price
        subscriptions using the legacy `t_p` event channel. The path `/stream`
        is an alias for `/sse/prices` with identical parameters.

        ### Migration Guide

        In each request body item, replace `"method": "t_p"` with `"method":
        "token_price"` and update your event handler to read `PriceResponse`
        fields instead of `PriceLegacyResponse` fields:

        | Legacy field (`t_p` event) | Current field (`token_price` event) |
        |---|---| | `a` | `address` | | `c` | `chain` | | `p` | `price` | | `t`
        | `timestamp` | | `t_p` | `timestamp_price` |

        **Emitted events:** `t_p` · `token_price` · `ping` · `warning` · `error`
      operationId: streamBatchAssetPricesLegacy
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: >-
            Close the stream after this many total events. Omit for an
            indefinite stream.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              maxItems: 25
              description: List of assets to subscribe to. Maximum 25 items.
              items:
                $ref: '#/components/schemas/AssetDataRequest'
      responses:
        '200':
          description: Multiplexed SSE stream established.
          content:
            text/event-stream:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/PriceLegacyResponse'
                  - $ref: '#/components/schemas/PriceResponse'
                  - $ref: '#/components/schemas/PingEvent'
                  - $ref: '#/components/schemas/WarningEvent'
                  - $ref: '#/components/schemas/ErrorEvent'
        '400':
          description: >-
            Invalid request (unknown chain, unknown asset, invalid method, or
            too many assets).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
        '413':
          description: Request body exceeds the 256 KB route limit.
        '429':
          description: Per-IP stream limit or rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
        '503':
          description: Service saturated — too many concurrent streams.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
      deprecated: true
components:
  schemas:
    AssetDataRequest:
      type: object
      required:
        - chain
        - address
        - method
      description: >-
        Subscription item for the deprecated `POST /stream`. Use
        `AssetPriceRequest` for `/sse/prices`.
      properties:
        chain:
          type: string
          description: Blockchain network identifier.
          example: ethereum
        address:
          type: string
          example: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'
          description: Token smart contract address.
        method:
          type: string
          enum:
            - token_price
            - t_p
          description: >-
            `t_p` is deprecated and scheduled for removal in 2027. Use
            `token_price`.
        request_id:
          type: integer
          minimum: 0
          maximum: 4294967295
          description: >-
            Optional identifier echoed on each event for this subscription.
            Defaults to the array index if omitted.
        filter:
          type: object
    PriceLegacyResponse:
      type: object
      deprecated: true
      description: >
        **Deprecated** - delivered on the `t_p` event channel. Scheduled for
        removal in 2027. Use `PriceResponse` (event: `token_price`) instead.
      properties:
        a:
          type: string
          description: >-
            Token smart contract address (equivalent to `address` in
            `PriceResponse`).
        c:
          type: string
          description: >-
            Blockchain network identifier (equivalent to `chain` in
            `PriceResponse`).
        p:
          type: string
          description: Token price in USD (equivalent to `price` in `PriceResponse`).
        t:
          type: string
          description: >-
            Server ingestion timestamp (equivalent to `timestamp` in
            `PriceResponse`).
        t_p:
          type: string
          description: >-
            Price timestamp (equivalent to `timestamp_price` in
            `PriceResponse`).
    PriceResponse:
      type: object
      description: Price update payload. Delivered on the `token_price` event channel.
      properties:
        address:
          type: string
          description: Token smart contract address.
          example: '0x7a250d5630b4cf539739df2c5dacb4c659f2488d'
        chain:
          type: string
          description: Blockchain network identifier.
          example: ethereum
        price:
          type: string
          description: Token price in USD.
          example: '3456.78'
        timestamp:
          type: string
          description: Server ingestion timestamp (ISO 8601).
          example: '2024-05-08T10:00:00Z'
        timestamp_price:
          type: string
          description: On-chain or oracle price timestamp (ISO 8601).
          example: '2024-05-08T09:59:58Z'
        token_price:
          type: string
          description: Alias for `timestamp_price`.
          example: '2024-05-08T09:59:58Z'
    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

````