Skip to content

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 TypeDescription
SUBSCRIBEDThe 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.
ERRORThere was an unknown error subscribing to the stream.
MAX_STREAMS_REACHEDReturned 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_PERMSIf 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.