> ## 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.

# Real-time DEX streaming API: live token prices via SSE

> Stream live DEX token prices and block-level pool reserve changes over Server-Sent Events (SSE). Real-time crypto data with no API key and no WebSocket plumbing.

<Info>
  **Looking for the full API spec?** Jump to the [Streaming Reference](/streaming/stream-real-time-data-for-a-single-asset) tab for every endpoint, parameter, response schema, and a live API playground.
</Info>

<Card title="🎬 See Streaming API in Action" icon="desktop" href="https://dexpaprika.com/streaming/solana" color="#10B981">
  **Live Demo:** Watch our interactive dashboard stream real-time prices for 6 cryptocurrencies across Ethereum, Solana, and BSC. See connection status, latency metrics, and live updates in action. [Open Live Dashboard →](https://dexpaprika.com/streaming/solana)
</Card>

## Overview

DexPaprika's Streaming API delivers two real-time feeds via Server-Sent Events (SSE): live token prices and live pool reserve updates. Build responsive applications with sub-second data, no polling, and no API key required.

<CardGroup cols={2}>
  <Card title="No Authentication" icon="unlock">
    Public endpoints with no API keys needed. Start streaming immediately.
  </Card>

  <Card title="Real-Time Updates" icon="bolt">
    Receive price updates approximately every second; reserve updates land block-by-block as swaps and liquidity changes settle on-chain.
  </Card>

  <Card title="SSE Protocol" icon="signal-stream">
    Standard Server-Sent Events for easy integration with any modern platform.
  </Card>

  <Card title="Multi-Chain Support" icon="link">
    Stream tokens and pools from Ethereum, Solana, BSC, Arbitrum, Base, and more networks.
  </Card>
</CardGroup>

### Two feeds, one transport

<CardGroup cols={2}>
  <Card title="Token Prices (/sse/prices)" icon="dollar-sign">
    USD price updates per token, pushed roughly every second per asset. Use this for tickers, portfolios, price-alert systems, and dashboards.
  </Card>

  <Card title="Pool Reserves (/sse/reserves)" icon="droplet" href="/streaming/reserves-streaming">
    Block-level pool reserve deltas, USD-denominated, for any DEX pool or any token. Use this for liquidity monitoring, TVL dashboards, slippage estimation, and MEV/arbitrage detection. **[Learn more →](/streaming/reserves-streaming)**
  </Card>
</CardGroup>

***

## Why Use Streaming?

### Streaming vs Traditional Polling

<Tabs>
  <Tab title="SSE Streaming (Recommended)">
    ```javascript theme={null}
    // Efficient: Server pushes updates only when prices change
    const url = 'https://streaming.dexpaprika.com/sse/prices?method=token_price&chain=ethereum&address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';
    const eventSource = new EventSource(url);

    eventSource.addEventListener('token_price', (event) => {
      const data = JSON.parse(event.data);
      updatePrice(data.price);
    });
    ```

    **Benefits:**

    * Single persistent connection
    * Updates pushed immediately when available
    * Minimal bandwidth usage
    * No rate limiting concerns
  </Tab>

  <Tab title="Polling (Not Recommended)">
    ```javascript theme={null}
    // Inefficient: Constant requests even when prices don't change
    setInterval(async () => {
      const response = await fetch('https://api.dexpaprika.com/networks/ethereum/tokens/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2');
      const data = await response.json();
      updatePrice(data.summary.price_usd);
    }, 1000); // 86,400 requests per day per asset!
    ```

    **Drawbacks:**

    * High server load from repeated requests
    * Wasted bandwidth when prices don't change
    * Potential rate limiting issues
    * Higher latency for updates
  </Tab>
</Tabs>

***

## Use Cases

### What You Can Build

<CardGroup cols={2}>
  <Card title="Trading Dashboards" icon="chart-line" href="https://dexpaprika.com/streaming/solana">
    Display live prices, volume, and market metrics with sub-second latency. **[See live example →](https://dexpaprika.com/streaming/solana)**
  </Card>

  <Card title="Portfolio Trackers" icon="wallet">
    Show real-time portfolio values and P\&L as prices fluctuate.
  </Card>

  <Card title="Price Alert Systems" icon="bell">
    Trigger instant notifications when prices hit target levels.
  </Card>

  <Card title="DEX Aggregators" icon="arrows-rotate">
    Compare prices across chains for arbitrage opportunities.
  </Card>

  <Card title="Market Tickers" icon="display">
    Create live price tickers and widgets for websites.
  </Card>

  <Card title="Analytics Platforms" icon="chart-mixed">
    Stream data into time-series databases for real-time analytics.
  </Card>
</CardGroup>

***

## Available Endpoints

Each feed has a single-asset GET form and a multi-asset POST form:

### Token price streams (`/sse/prices`)

<CardGroup cols={2}>
  <Card title="GET /sse/prices" icon="signal" href="/streaming/stream-real-time-data-for-a-single-asset">
    Stream one token's price per connection. Pass `method`, `chain`, and `address` as query params.
  </Card>

  <Card title="POST /sse/prices" icon="signal-stream" href="/streaming/subscribe-to-multiple-assets-streaming">
    Stream multiple tokens (up to 25 per connection) by posting a JSON array of `{chain, address, method}` entries.
  </Card>
</CardGroup>

### Pool reserve streams (`/sse/reserves`)

<CardGroup cols={2}>
  <Card title="GET /sse/reserves" icon="droplet" href="/streaming/stream-real-time-reserves-for-a-single-asset">
    Stream reserve updates for a single pool (`method=pool_reserves`) or a single token across every pool it sits in (`method=token_reserves`).
  </Card>

  <Card title="POST /sse/reserves" icon="layer-group" href="/streaming/subscribe-to-multiple-reserves-streaming">
    Subscribe to up to 25 pools or tokens in one connection. Mix `pool_reserves` and `token_reserves` entries freely.
  </Card>
</CardGroup>

<Note>
  The legacy `/stream` path is still accepted but **deprecated**. It now emits a `warning` event on connect (`"stream is deprecated, move to /sse/prices instead"`) and will be removed in a future release. The legacy `/reserves/stream` path has already been retired; use `/sse/reserves`.
</Note>

### Quick Comparison

| Feature                       | GET (Single)                   | POST (Multi)                                  |
| ----------------------------- | ------------------------------ | --------------------------------------------- |
| **Subscriptions per request** | 1                              | Up to 25                                      |
| **Best for**                  | Individual asset/pool tracking | Portfolios, dashboards, multi-pool monitoring |
| **Setup complexity**          | Minimal                        | Moderate                                      |
| **Load distribution**         | Per connection                 | Automatic balancing                           |

For workloads larger than 25 subscriptions, open multiple parallel POST streams.

***

## Quick Start

### 1. Choose Your Method

<Tabs>
  <Tab title="Single Asset (Simple)">
    Stream Ethereum WETH price:

    ```bash theme={null}
    curl -N "https://streaming.dexpaprika.com/sse/prices?method=token_price&chain=ethereum&address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
    ```
  </Tab>

  <Tab title="Multiple Assets (Advanced)">
    Stream SOL and USDC prices:

    ```bash theme={null}
    curl -X POST "https://streaming.dexpaprika.com/sse/prices" \
      -H "Accept: text/event-stream" \
      -H "Content-Type: application/json" \
      -d '[
        {"chain": "solana", "address": "So11111111111111111111111111111111111111112", "method": "token_price"},
        {"chain": "ethereum", "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "method": "token_price"}
      ]'
    ```
  </Tab>
</Tabs>

### 2. Parse the Response

Each price update arrives as a JSON event. The default method `token_price` returns full field names:

```json theme={null}
{
  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "chain": "ethereum",
  "price": "2257.973351845954",
  "timestamp": 1778846475,
  "timestamp_price": 1778846474,
  "token_price": 1778846474
}
```

The legacy `t_p` method emits a compact shape with single-letter keys (`a`, `c`, `p`, `t`, `t_p`). It is **deprecated** and kept only for backward compatibility.

### 3. Handle in Your Application

<CodeGroup>
  ```javascript Browser theme={null}
  const eventSource = new EventSource(url);

  eventSource.addEventListener('token_price', (event) => {
    const price = JSON.parse(event.data);
    console.log(`${price.chain} ${price.address}: $${price.price}`);
  });

  // Optional: surface deprecation notices the server may push
  eventSource.addEventListener('warning', (event) => {
    const { message } = JSON.parse(event.data);
    console.warn('[stream warning]', message);
  });

  eventSource.onerror = () => {
    // Reconnect logic
    eventSource.close();
    setTimeout(connectStream, 1000);
  };
  ```

  ```python Python theme={null}
  import requests
  import json

  response = requests.get(url, stream=True)

  # Buffer lines per SSE message (separated by blank lines), then dispatch.
  # Both `event:`/`data:` orderings are valid SSE and the server has emitted
  # either during rollout. A line-by-line parser that assumes one order will
  # silently mis-dispatch. Always group first.
  msg_lines = []
  for line in response.iter_lines(decode_unicode=True):
      if line:
          msg_lines.append(line)
          continue

      event_type = "message"
      data_str = None
      for ml in msg_lines:
          if ml.startswith("event:"):
              event_type = ml.split(":", 1)[1].strip()
          elif ml.startswith("data:"):
              data_str = ml[5:].lstrip()
      msg_lines = []

      if event_type == "token_price" and data_str is not None:
          data = json.loads(data_str)
          print(f"{data['chain']} {data['address']}: ${data['price']}")
  ```

  ```typescript TypeScript theme={null}
  interface PriceEvent {
    address: string;
    chain: string;
    price: string;
    timestamp: number;
    timestamp_price: number;
  }

  const stream = new EventSource(url);

  stream.addEventListener('token_price', (event: MessageEvent) => {
    const price: PriceEvent = JSON.parse(event.data);
    updatePrice(price);
  });
  ```
</CodeGroup>

***

## Architecture Overview

```mermaid theme={null}
graph LR
    A[Your App] -->|SSE Connection| B[Streaming API]
    B --> C[Load Balancer]
    C --> D1[Server 1]
    C --> D2[Server 2]
    C --> D3[Server N]
    D1 --> E[Price Feeds]
    D2 --> E
    D3 --> E
    E --> F[Blockchain RPCs]
```

### Key Features

* **Automatic Load Balancing**: Requests distributed across multiple servers
* **Persistent Connections**: Single connection maintained for entire session
* **Efficient Updates**: Only sends data when prices actually change
* **Global Infrastructure**: Low-latency servers in multiple regions

***

## Limits & Quotas

Service limits enforced by the streaming gateway:

| Limit                             | Value          | Notes                                                                                                                                                     |
| --------------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Concurrent SSE streams per IP     | **10**         | Exceeding returns `429 Too Many Requests` with body `{"message": "ip stream limit exceeded"}`                                                             |
| Subscriptions per POST connection | **25**         | `POST /sse/prices` rejects with `{"message":"too many assets, max 25 allowed"}`. `POST /sse/reserves` rejects with `{"message":"too many subscriptions"}` |
| Ping interval                     | **15 seconds** | A `ping` event is pushed periodically to keep the connection open                                                                                         |

### Event types you may receive

| Event            | When                                                                                         | Payload                                                                                   |
| ---------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `token_price`    | New price observation for a subscribed token                                                 | `{address, chain, price, timestamp, timestamp_price}`                                     |
| `pool_reserves`  | Pool reserves changed on the latest indexed block                                            | `{chain, pool_id, block, previous_block, tokens[], total_reserve_usd, total_delta_usd}`   |
| `token_reserves` | A token's aggregate reserves changed (across all its pools)                                  | `{chain, token_id, reserve, delta, block, price_usd, reserve_usd, delta_usd, updated_at}` |
| `ping`           | Every \~15s while idle                                                                       | `{"time": <unix>}`                                                                        |
| `warning`        | Deprecation notices or other non-fatal signals                                               | `{"message": "..."}`                                                                      |
| `error`          | Stream-terminating error (e.g. invalid asset)                                                | `{"message": "..."}`                                                                      |
| `t_p`            | **Deprecated.** Legacy compact price shape (`{a, c, p, t, t_p}`). Use `token_price` instead. |                                                                                           |

<Tip>
  Parsers should skip events whose `event:` field is not in the allow-list they care about. The set may grow over time (e.g. new `warning` event was added in May 2026), so an unrecognised event must never crash your handler.
</Tip>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Connection Management">
    * Implement automatic reconnection with exponential backoff
    * Handle both network errors and SSE error events
    * Monitor connection health with heartbeat timeouts
  </Accordion>

  <Accordion title="Error Handling">
    * Validate all assets before streaming (invalid assets cancel entire stream)
    * Parse both HTTP errors and SSE error events
    * Log errors for debugging but don't expose sensitive data
  </Accordion>

  <Accordion title="Performance Optimization">
    * Use POST method for multiple assets (better than multiple GETs)
    * Split large requests across multiple smaller streams
    * Parse price strings carefully to maintain precision
  </Accordion>

  <Accordion title="Production Deployment">
    * Implement proper logging and monitoring
    * Set up alerts for connection drops
    * Use connection pooling for multiple streams
    * Consider WebSocket bridges for incompatible clients
  </Accordion>
</AccordionGroup>

***

## Supported Networks

Stream tokens from multiple blockchain networks. Use the [Networks API](/api-reference/networks/get-a-list-of-available-blockchain-networks) to get the full list of supported networks:

```bash theme={null}
curl https://api.dexpaprika.com/networks
```

Popular networks include:

* Ethereum (`ethereum`)
* Solana (`solana`)
* Binance Smart Chain (`bsc`)
* Arbitrum (`arbitrum`)
* Polygon (`polygon`)
* Base (`base`)
* Avalanche (`avalanche`)

<Note>
  The `chain` parameter in streaming requests must use the exact `id` value from the [Networks endpoint](/api-reference/networks/get-a-list-of-available-blockchain-networks).
</Note>

***

## Finding Token Addresses

Before streaming prices, you need the correct token address for your chosen network. Use these REST API endpoints:

### Search for Tokens

Use the [Search API](/api-reference/search/search-for-tokens-pools-and-dexes) to find tokens by name or symbol:

```bash theme={null}
curl "https://api.dexpaprika.com/search?query=USDC"
```

### Get Token Details

Find all pools for a specific token using the [Token Pools API](/api-reference/tokens/get-top-x-pools-for-a-token):

```bash theme={null}
curl "https://api.dexpaprika.com/networks/ethereum/tokens/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/pools"
```

### Validate Before Streaming

Use the [Token Prices API](/api-reference/tokens/get-batched-token-prices-on-a-network) to verify your token exists before streaming:

```bash theme={null}
curl "https://api.dexpaprika.com/networks/ethereum/multi/prices?tokens=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
```

<Tip>
  Always verify the token address matches the network you're streaming from. The same token may have different addresses on different chains.
</Tip>

<Warning>
  The streaming API will return a `400 Asset not found` error if the token doesn't exist on the specified network. Validate tokens using the REST API first to avoid stream failures.
</Warning>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Reserves Streaming" icon="droplet" href="/streaming/reserves-streaming" color="#10B981">
    The deep dive on `/sse/reserves`: what gets pushed every block, the two subscription methods, annotated wire example, use cases for LPs, MEV builders, and analytics teams.
  </Card>

  <Card title="Quick Start Tutorial" icon="rocket" href="/streaming/tutorials/quick-start">
    Build your first streaming application in 5 minutes. Covers both prices and reserves.
  </Card>

  <Card title="🚀 Live Dashboard Demo" icon="desktop" href="https://dexpaprika.com/streaming/solana">
    Interactive streaming demo. Pick a chain, pick tokens, watch the SSE events flow in real time.
  </Card>

  <Card title="React Integration" icon="react" href="/streaming/guides/react-integration">
    Build streaming components for React and Next.js applications.
  </Card>
</CardGroup>

***

## Get Support

<CardGroup cols={2}>
  <Card title="Discord Community" icon="discord" href="https://discord.gg/DhJge5TUGM">
    Join our Discord for real-time support and discussions.
  </Card>

  <Card title="Email Support" icon="envelope" href="mailto:support@coinpaprika.com">
    Contact our team for technical assistance.
  </Card>
</CardGroup>
