Skip to content
Stove Website

Market Data Push ​

Overview ​

Market data push uses WebSocket V2 subscription endpoint, supporting real-time market data push including orderbook, K-line, and quote statistics.

Connection Information ​

Connection Endpoint: wss://{host}/ws/v2/stream

Description: WebSocket V2 subscription endpoint, supporting multiple data type subscriptions

Authentication: Institution credentials (API Key + Signature), passed via api_key, timestamp, and signature fields in each message. See WebSocket Authentication

Subscription Request ​

To subscribe to market data, send a JSON message in the following format:

json
{
	"id": "550e8400-e29b-41d4-a716-446655440000",
	"method": "market",
	"action": "subscribe",
	"params": {
		"type": "orderbooks",
		"tickers": ["AAPLs@usex"]
	},
	"api_key": "<your-api-key>",
	"timestamp": "1703123456789",
	"signature": "<computed-signature>"
}

Note: Each message must carry api_key, timestamp, and signature for authentication. For signature calculation details, see WebSocket Authentication.

Parameter Description ​

ParameterTypeRequiredDescription
idstringYesRequest unique identifier, recommended to use UUID
methodstringYesFixed value market
actionstringYessubscribe or unsubscribe
paramsobjectYesSubscription parameters
params.typestringYesData type: orderbooks, kline, quote
params.tickersarrayYesList of tickers to subscribe
api_keystringYesInstitution API key
timestampstringYesUnix timestamp in milliseconds
signaturestringYesRequest signature. Set as empty string placeholder during signature calculation

Supported Data Types ​

TypeDescription
orderbooksReal-time orderbook data
klineReal-time K-line (1 minute)
quoteReal-time quote statistics

The chain-denominated types (router_quote, router_price) belong to the Instant Swap API — see Market Data Push (Instant Swap API).

Tickers Format ​

  • Format: symbol@market
  • Market: Market code. See Market enum type description
  • Example: AAPLs@usex

Server Response ​

Each subscription or unsubscription request receives a corresponding response:

Success Response:

json
{
	"id": "550e8400-e29b-41d4-a716-446655440000",
	"success": true
}

Error Response:

json
{
	"id": "550e8400-e29b-41d4-a716-446655440000",
	"success": false,
	"message": "Invalid params for method: market"
}
FieldTypeDescription
idUUID / nullCorresponding request ID, may be null on parse failure
successbooleanWhether the request succeeded
messagestringError description when failed, absent on success

Data Push ​

Orderbook Data Push ​

When subscribing to orderbooks type, you will receive orderbook data push in the following format:

json
{
	"type": "orderbook",
	"data": {
		"symbol": "AAPLs",
		"market": "usex",
		"time": "2025-09-25 10:10:23.394",
		"ask": [
			{ "price": 710, "volume": 100 },
			{ "price": 711, "volume": 200 }
		],
		"bid": [
			{ "price": 709.99, "volume": 110 },
			{ "price": 708.5, "volume": 50 }
		]
	}
}
FieldTypeDescription
typestringFixed as "orderbook"
dataobjectOrderbook data
data.symbolstringTicker code
data.marketstringMarket code. See Market enum type description
data.timestringOrderbook data time
data.askobject[]Ask list, sorted by price in ascending order
data.ask[].pricedecimalAsk price
data.ask[].volumedecimalAsk volume
data.bidobject[]Bid list, sorted by price in descending order
data.bid[].pricedecimalBid price
data.bid[].volumedecimalBid volume

K-line Data Push ​

When subscribing to kline type, you will receive K-line data push in the following format:

json
{
	"type": "kline",
	"data": {
		"symbol": "AAPLs",
		"time": "2025-05-30 15:50:00",
		"open": 498.6,
		"high": 598.6,
		"low": 398.6,
		"close": 498.6,
		"volume": 125,
		"turnover": 56873.25
	}
}
FieldTypeDescription
typestringMessage type, fixed value kline
dataobjectK-line data
data.symbolstringTicker code
data.timestringK-line time (start time of the minute)
data.opendecimalOpening price
data.highdecimalHighest price
data.lowdecimalLowest price
data.closedecimalClosing price
data.volumedecimalTrading volume
data.turnoverdecimalTrading turnover

Push Frequency: Pushed once per minute, at the end of each minute, sending the complete K-line data for that minute.

Quote Statistics Data Push ​

When subscribing to quote type, you will receive quote statistics data push in the following format:

json
{
	"type": "quote",
	"data": {
		"symbol": "AAPLs",
		"time": "2025-05-30 15:58:17",
		"session": "trading",
		"open": 506,
		"high": 606.5,
		"low": 396,
		"close": 498.4,
		"volume": 125,
		"turnover": 708234.56
	}
}
FieldTypeDescription
typestringMessage type, fixed value quote
dataobjectQuote statistics data
data.symbolstringTicker code
data.timestringCurrent market data time
data.sessionstringTrading session (trading, pre_market, after_market, etc.)
data.opendecimalOpening price
data.highdecimalHighest price
data.lowdecimalLowest price
data.closedecimalClosing price
data.volumedecimalTrading volume
data.turnoverdecimalTrading turnover

Push Frequency: Real-time push, immediately when quote changes.

Unsubscription ​

To unsubscribe from market data, send a JSON message in the following format:

json
{
	"id": "550e8400-e29b-41d4-a716-446655440001",
	"method": "market",
	"action": "unsubscribe",
	"params": {
		"type": "orderbooks",
		"tickers": ["AAPLs@usex"]
	},
	"api_key": "<your-api-key>",
	"timestamp": "1703123456789",
	"signature": "<computed-signature>"
}

Heartbeat Mechanism ​

The server sends heartbeat messages every 30 seconds:

json
{
	"type": "heartbeat",
	"timestamp": 1703123456789
}

Error Handling ​

Common Errors ​

Error MessageCauseSolution
Invalid JSON formatJSON format errorCheck JSON syntax
Invalid request methodInvalid method valueUse supported method
Missing paramsMissing required parametersProvide params field
Invalid paramsParameter format errorCheck parameter structure
Invalid or missing authentication header(s)Institution credential authentication failedCheck api_key, timestamp, and signature
Subscription limit reachedThrottling limitReduce connection count

Error Response Example ​

json
{
	"id": "550e8400-e29b-41d4-a716-446655440000",
	"success": false,
	"message": "Invalid params for method: market"
}

Notes ​

  • Multiple subscription messages can be sent on the same connection, each incrementally adding subscriptions
  • All subscriptions are automatically cleaned up when the connection drops
  • Tickers with invalid format or unrecognized market are silently skipped