# Introduction

**Version:** 0.10.7 • **Status:** Production • **Public URL:** `wss://ws.gemini.com`

Our WebSocket API provides low latency access to real-time market data and order execution for professional traders and institutions. Built from the ground up for performance, our WebSocket API delivers fastest latency on AWS with enterprise-grade reliability.

:::tip
[**Try It Now** with our interactive documentation](/prediction-markets/websocket/playground#method-subscribe)
:::

### Key Features

- **Low Latency** - Sub-10ms market data updates for competitive advantage
- **Real-Time Trading** - Place, modify, and cancel orders via WebSocket
- **Multiple Streams** - Subscribe to multiple markets simultaneously

### Performance Tiers

| Tier | Target | Description |
|------|---------------------|-------------|
| **Tier 2** _(Public Internet)_ | p99~15ms | Public offering connecting to **AWS us-east-1 over the public internet**. Provides good **baseline performance** with minimal setup complexity. |
| **Tier 1** _(In Region)_ | p99~10ms | **Direct connection** to us-east-1 feed. Provides **improved performance** a step above the public offering but requires onboarding to peer to our infrastructure. |
| **Tier 0** _(Local Zone)_ | p99~5ms | **Best performance** outside of NY5, physically closest to our data center. Requires onboarding similar to us-east-1. |

:::info
Please email api@gemini.com to onboard to our WebSocket high performance tiers.
:::

### Connection Parameters

Connection-level query parameters can be passed in the WebSocket URL to customize behavior:

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `snapshot` | integer | `0` | Controls initial orderbook snapshot delivery when subscribing to differential depth streams |
| `cancelOnDisconnect` | boolean | `false` | Automatically cancel all open orders when the WebSocket session disconnects |

#### Snapshot Parameter

The `snapshot` parameter controls whether an initial orderbook snapshot is sent when subscribing to [differential depth streams](/prediction-markets/websocket/streams#l2-differential-depth-streams) (`{symbol}@depth`, `{symbol}@depth@100ms`).

**Connection URL example:**
```
wss://ws.gemini.com?snapshot=-1
```

| `snapshot` Value | Behavior |
|------------------|----------|
| Not specified / `0` | No snapshot — only incremental updates (default) |
| `-1` (or any negative) | Full orderbook snapshot sent immediately on subscribe |
| Positive integer (e.g., `100`) | Top N levels snapshot sent on subscribe |

:::tip
Use `snapshot=-1` to receive a full orderbook snapshot immediately when subscribing to differential depth streams. This is useful for initializing your local orderbook state without needing a separate REST API call.
:::

#### Cancel On Disconnect Parameter

The `cancelOnDisconnect` parameter enables automatic cancellation of all your open orders when the WebSocket session disconnects. This is a safety feature that helps prevent unwanted exposure from stale orders if your connection drops unexpectedly.

**Connection URL example:**
```
wss://ws.gemini.com?cancelOnDisconnect=true
```

| `cancelOnDisconnect` Value | Behavior |
|----------------------------|----------|
| Not specified / `false` | Orders remain active after disconnect (default) |
| `true` | All open orders are automatically cancelled on disconnect |

:::warning
When `cancelOnDisconnect=true` is enabled, **all** open orders placed via the WebSocket session will be cancelled upon disconnection, including orders that may have been intentionally left open. Ensure your trading strategy accounts for this behavior.
:::

:::tip
Combine multiple connection parameters using `&`: `wss://ws.gemini.com?snapshot=-1&cancelOnDisconnect=true`
:::
