Theta Terminal v1.6.0 or higher is required to utilize this behavior. You can grab the latest terminal build here
Verify Stream Requests
The request ID
Every stream request you make to Thetadata should include The id
field, which should be incremented for each new stream request made. This ID is returned in a later message to verify that the request to stream data was successful. This ID does not have any representation of contracts or unqiue streams. It only represents a way of tracking streaming requests made.
Behavior
The type
field in the message header will be set to REQ_RESPONSE
and the id
will be set to the id of the stream request made by the client. Below is a sample response of a stream request that was sent with an id of zero that was successful.
json
{
"header": {
"type": "REQ_RESPONSE",
"status": "CONNECTED",
"response": "SUBSCRIBED",
"req_id": 0
}
}
Response Types
Request Response Type | Description |
---|---|
SUBSCRIBED | The request to subscribe to a stream was successful. This doesn't guarantee that the contract exists. It only means that if this contract exists, you will receive data for it. |
ERROR | There was an unknown error subscribing to the stream. |
MAX_STREAMS_REACHED | Returned when you are streaming too many contracts. You can unsubscribe from some of your streams, upgrade your Thetadata subscription, and or stop all streams. |
INVALID_PERMS | If you do not have permissions for the stream request. You might need to upgrade your Thetadata subscription for the security type you are attempting to stream. |