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

# WS /v1/prices/stream

> Subscribe to live Ostium price updates directly through the Builder API WebSocket feed.

Connect to:

```text theme={null}
wss://builder.prod.bedrock.ostium.io/v1/prices/stream
```

Subscribe:

```json theme={null}
{
  "type": "subscribe",
  "pairs": ["BTC-USD", "ETH-USD"]
}
```

SDK equivalent:

```ts theme={null}
const stream = client.streamPrices([0, 1]);
```

## Message schemas

Subscribe:

```ts theme={null}
interface SubscribeMessage {
  type: 'subscribe';
  pairs: string[];
}
```

Unsubscribe:

```ts theme={null}
interface UnsubscribeMessage {
  type: 'unsubscribe';
  pairs: string[];
}
```

Snapshot:

```ts theme={null}
interface SnapshotMessage {
  type: 'snapshot';
  data: PriceTick[];
}
```

Tick:

```ts theme={null}
interface TickMessage {
  type: 'tick';
  data: PriceTick;
}

interface PairSchedule {
  id: number;
  alwaysOpen?: boolean;
  timezone?: string;
  openingHours?: string[];
}

interface PriceTick {
  feed_id: string;
  pair: string;
  from: string;
  to: string;
  bid: number;
  mid: number;
  ask: number;
  isMarketOpen: boolean;
  isDayTradingClosed: boolean;
  secondsToToggleIsDayTradingClosed: number;
  timestampSeconds: number;
  schedule?: PairSchedule;
}
```
