WebSocket
WebSocket Playground
WebSocket
WebSocket Playground
WSS
wss://ws.pfex.io
/
v4
/
ws
Messages
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>"
}
{
"channel": "<string>",
"id": "<string>",
"order": {
"action": "<string>",
"marketId": "<string>",
"side": "<string>",
"type": "<string>",
"timeInForce": "<string>",
"size": "<string>",
"price": "<string>"
}
}
{
"channel": "<string>",
"id": "<string>",
"order": {
"action": "<string>",
"orderId": "<string>",
"marketId": "<string>"
}
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-9cbb14859b00",
"message_id": 1,
"id": null,
"channel": "v4_bbo",
"contents": {
"bbo": [
{
"MSFT-USD": {
"symbol": "MSFT-USD",
"bidPrice": "437.45",
"bidSize": "2.741",
"askPrice": "439.05",
"askSize": "2.731"
}
}
]
}
}
{
"type": "subscribed",
"connection_id": "bfbbeb78-c95d-43c4-8a0f-833fab5a3f39",
"message_id": 1,
"id": "SP500-USD",
"channel": "v4_orderbook",
"contents": {
"bids": [
{
"price": "564.1",
"size": "2.126"
},
{
"price": "560.3",
"size": "0.001"
}
],
"asks": [
{
"price": "566.2",
"size": "2.118"
}
]
}
}
{
"type": "subscribed",
"connection_id": "bfbbeb78-c95d-43c4-8a0f-833fab5a3f39",
"message_id": 1,
"id": "SP500-USD",
"channel": "v4_trades",
"contents": [
{
"price": "564.1",
"size": "2.126",
"side": "BUY",
"createdAt": "2025-05-08T20:52:48.000Z"
}
]
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-012314859b00",
"message_id": 1,
"id": "AAPL-USD/1MIN",
"channel": "v4_candles",
"contents": [
{
"startedAt": "2025-05-08T19:00:00Z",
"ticker": "AAPL-USD",
"resolution": "1MIN",
"open": "173.00",
"high": "174.00",
"low": "172.50",
"close": "173.50",
"usdVolume": "100000"
}
]
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-012314859b00",
"message_id": 1,
"id": "3ab267fd-7c83-49c6-b42e-65bb94682b41",
"channel": "v4_balances",
"contents": [
{
"id": "2cb208e3-6e54-48c4-82e9-641e64bf185d",
"user_id": "0f5208e3-6e54-48c4-82e9-641e64bf185d",
"deposit": 1000,
"realised_pnl": -898.65735,
"unrealised_pnl": 0,
"order_margin": 0,
"position_margin": 0,
"net_funding": -1.5354636,
"available_balance": 99.80721
}
]
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-012314859b00",
"message_id": 1,
"id": "3ab267fd-7c83-49c6-b42e-65bb94682b41",
"channel": "v4_positions",
"contents": [
{
"id": "PLTR-USD",
"symbol": "PLTR-USD",
"user_id": "0f5208e3-6e54-48c4-82e9-641e64bf185d",
"position": 0,
"margin_alloc": 0,
"realised_pnl": 1.327875,
"unrealised_pnl": 0,
"net_funding": 0.00000482,
"open_orders": 1,
"open_quantity": 10,
"leverage": 20,
"initial_margin": 0,
"maintenance_margin": 0,
"average_price": 0,
"timestamp": "2025-05-09T03:47:20.505934+00:00"
}
]
}
v4_orderbook
type:object
Subscribe to order book
v4_trades
type:object
Subscribe to public trades
v4_candles
type:object
Subscribe to candles
v4_positions
type:object
Subscribe to user positions
v4_balances
type:object
Subscribe to user balance
v4_orders
type:object
Subscribe to user orders
v4_markets
type:object
Subscribe to product reference data
v4_orders/Add Order
type:object
Add order. Ensure you have subscribed to the v4_orders channel first
v4_orders/Cancel Order
type:object
Cancel order. Ensure you have subscribed to the v4_orders channel first
v4_bbo
Best bid and offer updates
v4_orderbook
Changes in the L2 order book
v4_trades
Public trades
v4_candles
Candle updates over various intervals
v4_balances
User balance updates
v4_positions
User position updates
Messages
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>",
"id": "<string>"
}
{
"type": "<string>",
"channel": "<string>"
}
{
"channel": "<string>",
"id": "<string>",
"order": {
"action": "<string>",
"marketId": "<string>",
"side": "<string>",
"type": "<string>",
"timeInForce": "<string>",
"size": "<string>",
"price": "<string>"
}
}
{
"channel": "<string>",
"id": "<string>",
"order": {
"action": "<string>",
"orderId": "<string>",
"marketId": "<string>"
}
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-9cbb14859b00",
"message_id": 1,
"id": null,
"channel": "v4_bbo",
"contents": {
"bbo": [
{
"MSFT-USD": {
"symbol": "MSFT-USD",
"bidPrice": "437.45",
"bidSize": "2.741",
"askPrice": "439.05",
"askSize": "2.731"
}
}
]
}
}
{
"type": "subscribed",
"connection_id": "bfbbeb78-c95d-43c4-8a0f-833fab5a3f39",
"message_id": 1,
"id": "SP500-USD",
"channel": "v4_orderbook",
"contents": {
"bids": [
{
"price": "564.1",
"size": "2.126"
},
{
"price": "560.3",
"size": "0.001"
}
],
"asks": [
{
"price": "566.2",
"size": "2.118"
}
]
}
}
{
"type": "subscribed",
"connection_id": "bfbbeb78-c95d-43c4-8a0f-833fab5a3f39",
"message_id": 1,
"id": "SP500-USD",
"channel": "v4_trades",
"contents": [
{
"price": "564.1",
"size": "2.126",
"side": "BUY",
"createdAt": "2025-05-08T20:52:48.000Z"
}
]
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-012314859b00",
"message_id": 1,
"id": "AAPL-USD/1MIN",
"channel": "v4_candles",
"contents": [
{
"startedAt": "2025-05-08T19:00:00Z",
"ticker": "AAPL-USD",
"resolution": "1MIN",
"open": "173.00",
"high": "174.00",
"low": "172.50",
"close": "173.50",
"usdVolume": "100000"
}
]
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-012314859b00",
"message_id": 1,
"id": "3ab267fd-7c83-49c6-b42e-65bb94682b41",
"channel": "v4_balances",
"contents": [
{
"id": "2cb208e3-6e54-48c4-82e9-641e64bf185d",
"user_id": "0f5208e3-6e54-48c4-82e9-641e64bf185d",
"deposit": 1000,
"realised_pnl": -898.65735,
"unrealised_pnl": 0,
"order_margin": 0,
"position_margin": 0,
"net_funding": -1.5354636,
"available_balance": 99.80721
}
]
}
{
"type": "subscribed",
"connection_id": "ee987ddf-822c-4356-b0d1-012314859b00",
"message_id": 1,
"id": "3ab267fd-7c83-49c6-b42e-65bb94682b41",
"channel": "v4_positions",
"contents": [
{
"id": "PLTR-USD",
"symbol": "PLTR-USD",
"user_id": "0f5208e3-6e54-48c4-82e9-641e64bf185d",
"position": 0,
"margin_alloc": 0,
"realised_pnl": 1.327875,
"unrealised_pnl": 0,
"net_funding": 0.00000482,
"open_orders": 1,
"open_quantity": 10,
"leverage": 20,
"initial_margin": 0,
"maintenance_margin": 0,
"average_price": 0,
"timestamp": "2025-05-09T03:47:20.505934+00:00"
}
]
}