> ## 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, pool reserves and swap transactions over Server-Sent Events (SSE). Prices stream with no API key on 35 showcase assets; a free key opens prices and reserves on any token; transactions and candles are paid-plan feeds.

> [!NOTE]
>
> **Looking for the full API spec?** Jump to the [Streaming Reference](https://docs.dexpaprika.com/streaming/stream-real-time-data-for-a-single-asset.md) tab for every endpoint, parameter, response schema, and a live API playground.

> **[See the Streaming API in action](https://dexpaprika.com/streaming/solana)**
>
> **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)

## Overview

DexPaprika's Streaming API delivers four real-time feeds via Server-Sent Events (SSE): live token prices, live pool reserve updates, live swap transactions and sealed token candles. Updates are pushed the moment a swap settles on-chain, with no polling.

Prices stream **without an API key** on the [35 showcase assets](https://docs.dexpaprika.com/streaming/showcase-streams.md), one flagship token per chain, except Arc. Reserves need a key, and a [free one](https://console.dexpaprika.com) opens prices and reserves on every token we index. Swap transactions and token candles are paid-plan feeds (Dev, Pro, Enterprise) on `streaming-pro.dexpaprika.com`; see [transactions streaming](https://docs.dexpaprika.com/streaming/transactions-streaming.md) and [OHLCV streaming](https://docs.dexpaprika.com/streaming/ohlcv-streaming.md). Registration takes a minute and needs no card.

> [!NOTE]
>
> Every example on this page uses `streaming.dexpaprika.com`, the keyless and free-key host.
> Paid plans connect to `https://streaming-pro.dexpaprika.com` with the key in the
> `Authorization` header. Swap the base URL the same way you swap the REST one; see
> [upgrading to Pro](https://docs.dexpaprika.com/api-pro/upgrading.md).

> **Prices, with no key**
>
> Stream prices on the 35 showcase assets with no signup. A [free key](https://console.dexpaprika.com) opens prices on any token and the reserves feed, and raises the allowance to 100,000 credits. Transactions and candles need a paid plan.

> **Pushed on price moves**
>
> A price event is pushed when a swap moves the price, so the rate tracks trading activity. Reserve events land for each block in which a subscribed pool's reserves changed.

> **SSE Protocol**
>
> Standard Server-Sent Events for easy integration with any modern platform.

> **Multi-Chain Support**
>
> Stream tokens and pools from Ethereum, Solana, BSC, Arbitrum, Base, and more networks.

### Four feeds, one transport

> **Token Prices (/sse/prices)**
>
> USD price updates per token, pushed when a swap moves the price. Measured rates run from about 1 to about 52 updates a minute depending on the asset; see [plan your credit usage](https://docs.dexpaprika.com/knowledge-base/credit-usage.md). Use this for tickers, portfolios, price-alert systems, and dashboards.

> **[Pool Reserves (/sse/reserves)](https://docs.dexpaprika.com/streaming/reserves-streaming.md)**
>
> 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 →](https://docs.dexpaprika.com/streaming/reserves-streaming.md)**

> **[Transactions (/sse/transactions)](https://docs.dexpaprika.com/streaming/transactions-streaming.md)**
>
> Individual swaps on one pool, or on every pool a token sits in, pushed as they settle. Use this for trade feeds, whale alerts and per-venue analytics. Dev, Pro and Enterprise plans. **[Learn more →](https://docs.dexpaprika.com/streaming/transactions-streaming.md)**

> **[Token OHLCV (/sse/ohlcv)](https://docs.dexpaprika.com/streaming/ohlcv-streaming.md)**
>
> Sealed token candles at 1s, 5s or 60s, resumable with `Last-Event-ID`. Paid plans only. Use this for charts and signal engines without building candles from swaps. **[Learn more →](https://docs.dexpaprika.com/streaming/ohlcv-streaming.md)**

***

## Why use streaming?

### Streaming vs traditional polling

**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
* Nothing to poll, so no per-minute request limit to manage. Each update delivered still costs one credit, so budget for the update rate of what you subscribe to. See [rate limits](https://docs.dexpaprika.com/knowledge-base/rate-limits.md) and [plan your credit usage](https://docs.dexpaprika.com/knowledge-base/credit-usage.md) for measured rates and worked costs.

**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

***

## Use cases

### What you can build

> **[Trading Dashboards](https://dexpaprika.com/streaming/solana)**
>
> Display live prices, volume, and market metrics with sub-second latency. **[See live example →](https://dexpaprika.com/streaming/solana)**

> **Portfolio Trackers**
>
> Show real-time portfolio values and P\&L as prices fluctuate.

> **Price Alert Systems**
>
> Trigger instant notifications when prices hit target levels.

> **DEX Aggregators**
>
> Compare prices across chains for arbitrage opportunities.

> **Market Tickers**
>
> Create live price tickers and widgets for websites.

> **Analytics Platforms**
>
> Stream data into time-series databases for real-time analytics.

***

## Available endpoints

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

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

> **[GET /sse/prices](https://docs.dexpaprika.com/streaming/stream-real-time-data-for-a-single-asset.md)**
>
> Stream one token's price per connection. Pass `method`, `chain`, and `address` as query params.

> **[POST /sse/prices](https://docs.dexpaprika.com/streaming/subscribe-to-multiple-assets-streaming.md)**
>
> Stream multiple tokens (up to 25 per connection) by posting a JSON array of `{chain, address, method}` entries.

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

> **[GET /sse/reserves](https://docs.dexpaprika.com/streaming/stream-real-time-reserves-for-a-single-asset.md)**
>
> Stream reserve updates for a single pool (`method=pool_reserves`) or a single token across every pool it sits in (`method=token_reserves`).

> **[POST /sse/reserves](https://docs.dexpaprika.com/streaming/subscribe-to-multiple-reserves-streaming.md)**
>
> Subscribe to up to 25 pools or tokens in one connection. Mix `pool_reserves` and `token_reserves` entries freely.

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

**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"
```

**Multiple Assets (Advanced)**

Stream SOL and WETH 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": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "method": "token_price"}
  ]'
```

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

```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);
});
```

***

## 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 | **10** keyless (per IP) or on a free key, **30** on Dev, **100** on Pro | Exceeding returns `429 Too Many Requests` with `"error":"rate_limited"` and a message starting `Concurrent stream limit reached` |
| 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 |
| Credit cost | **1 credit per update delivered** | Connections are free. Only delivered events are charged, against 10,000 credits per rolling 30 days keyless, 100,000 with a free key, or 5M on [Pro](https://dexpaprika.com/api/pricing). See [plan your credit usage](https://docs.dexpaprika.com/knowledge-base/credit-usage.md) |

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

***

## Best practices

> **Connection Management**
>
> * Implement automatic reconnection with exponential backoff
> * Handle both network errors and SSE error events
> * Monitor connection health with heartbeat timeouts

> **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

> **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

> **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

***

## Supported networks

Stream tokens from multiple blockchain networks. Use the [Networks API](https://docs.dexpaprika.com/api-reference/networks/get-a-list-of-available-blockchain-networks.md) 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](https://docs.dexpaprika.com/api-reference/networks/get-a-list-of-available-blockchain-networks.md).

***

## 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](https://docs.dexpaprika.com/api-reference/search/search-for-tokens-pools-and-dexes.md) to find tokens by name or symbol:

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

### Find a token's pools

List pools for a specific token using [pool search](https://docs.dexpaprika.com/tutorials/pool-filtering.md) with the `token_address` filter (per-network search only; the cross-network `/pools/search` ignores it):

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

### Validate before streaming

Use the [Token Prices API](https://docs.dexpaprika.com/api-reference/tokens/get-batched-prices-for-multiple-tokens-on-a-network.md) 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.

> [!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.

***

## Next steps

> **[Reserves Streaming](https://docs.dexpaprika.com/streaming/reserves-streaming.md)**
>
> The deep dive on `/sse/reserves`: what gets pushed when reserves move, the two subscription methods, annotated wire example, use cases for LPs, MEV builders, and analytics teams.

> **[Quick Start Tutorial](https://docs.dexpaprika.com/streaming/tutorials/quick-start.md)**
>
> Build your first streaming application in 5 minutes. Covers both prices and reserves.

> **[Live dashboard demo](https://dexpaprika.com/streaming/solana)**
>
> Interactive streaming demo. Pick a chain, pick tokens, watch the SSE events flow in real time.

> **[React Integration](https://docs.dexpaprika.com/streaming/guides/react-integration.md)**
>
> Build streaming components for React and Next.js applications.

***

## Get support

> **[Discord Community](https://discord.gg/DhJge5TUGM)**
>
> Join our Discord for real-time support and discussions.

> **[Email Support](mailto:support@coinpaprika.com)**
>
> Contact our team for technical assistance.


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