Subscribe request
Subscribe Message
SubscribeRequest
Subscribe to a price stream of bids and asks, in the requested pair, with respect to the requested settlement quantity, which may be in base or terms as specified in currency
.
Request
Field | Req'd | Type | Description |
---|---|---|---|
messageType | Y | String | subscribe |
instrument | Y | String | currency-pair |
tag | N | String | For future use |
quantity | Y | String | Quantity (in 'Currency') |
currency | Y | String | Currency the price stream is quoted in. Should be either the base or quote currency |
accountGrpUuid | N | String | Account group ref to use (SeeAccount Groups Message. If left blank will use default account. |
tenor | N | String | The settlement date of the stream: - SP: Spot. For immediate settlement - TOD: Today. For settlement today (or next available settlement date) - TOM: Tomorrow. For settlement T+1 (or next available after T+1) Defaults to SP if not specified |
Request Example:
{
"messageType": "subscribe",
"instrument": "USDC.AED",
"tag": "For future use",
"quantity": 100000,
"currency": "AED",
"accountGrpUuid": "",
"tenor": "TOD"
}
Response
Indicates if the subscription is successful and if not, message
field will indicate reason.
Field | Req'd | Type | Description |
---|---|---|---|
timestamp | Y | Long | Unix time in milliseconds |
messageType | Y | String | subscribe |
success | Y | bool | Indicates if subscribeRequest is successful true |
message | Y | String | Confirmation is successful subscribed |
subscriptionId | Y | String | Stream subscription ID |
tag | N | String | For future use |
instrument | Y | String | Currency-pair |
quantity | Y | String | Quantity of the currency to be delivered |
code | N | String | Error code |
tenor | N | String | The tenor that was requested in the subscription |
settleDate | N | String | Blank field |
Response Example:
{
"timestamp": 1718110925811,
"messageType": "subscribe",
"success": true,
"message": "Subscribed",
"subscriptionId": "13f07bc9-055f-4054-bb78-73fe9f325ee6",
"tag": "test-tag",
"instrument": "USDC.AED",
"quantity": "100000.000000",
"code": "",
"tenor": "TOD",
"settleDate": ""
}
Unsubscribe
Unsubscribe from a previously requested price stream by sending the subscriptionId
of the desired quote/price stream to terminate.
Request
Field | Req'd | Type | Description |
---|---|---|---|
messageType | Y | String | unsubscribe |
subscriptionId | Y | String | Subscription ID of the priceStream to be unsubscribed |
Request Example:
{
"messageType": "unsubscribe",
"subscriptionId": "13f07bc9-055f-4054-bb78-73fe9f325ee6"
}
Response
Indicates if the unsubscription is successful and if not, message
field will indicate reason.
Field | Req'd | Type | Description |
---|---|---|---|
timestamp | Y | Long | Unix time in milliseconds |
messageType | Y | String | unsubscribe |
success | Y | bool | Indicates if unsubscribe is successful true or false |
subscriptionId | Y | String | The Subscription ID specified in the request |
message | Y | String | Conformation description |
instrument | Y | String | Currency-pair |
quantity | Y | Double | Requested Quantity |
tenor | Y | String | Tenor that was subscribed for |
Response Example:
{
"timestamp": 1718111157195,
"messageType": "unsubscribe",
"success": true,
"subscriptionId": "2ffc8d0c-21f5-4364-b2a6-4007218e57ee",
"message": "Cancelled subscription 2ffc8d0c-21f5-4364-b2a6-4007218e57ee, client session 8c17bf72-b7f4-4a1c-86f1-5fb28d21e433, userUuid 7687282f-1073-441b-9ff4-694e6b49effe for USDC for 100000 AED",
"instrument": "USDC.AED",
"quantity": "100000.000000",
"tenor": "TOD"
}
Price Stream
Response
The response contains a two way price (bid and offer) with respective quantities available for trading (partial fills are not available). The full order book is not sent at every tick rather, an updated quote for the subscribed quantity is sent. New prices will automatically replace the previous prices.
In the event the connection is lost users can download their transactions for reconciliation.
Heartbeats are not supported.
Field | Req'd | Type | Description |
---|---|---|---|
timestamp | Y | Long | Unix time in milliseconds |
messageType | Y | String | priceStream |
instrument | Y | String | Currency-pair |
quoteId | Y | String | Unique Quote ID |
tag | N | String | For future use |
offer | Y | Offer | |
↳ price | Y | String | Quote Offer Price |
↳ quantity | Y | String | Quote Offer Quantity |
bid | Y | Bid | |
↳ price | Y | String | Quote Bid Price |
↳ quantity | Y | String | Quote Bid Quantity |
tenor | N | String | The settlement date of the stream: - SP: Spot. For immediate settlement - TOD: Today. For settlement today (or next available settlement date) - TOM: Tomorrow. For settlement T+1 (or next available after T+1) Defaults to SP if not specified |
settleDate | N | String | The actual settlement date of the quote YYYMMDD |
{
"timestamp": 1718111156238,
"messageType": "pricestream",
"instrument": "USDC.AED",
"quoteId": "MZ0KaK9qbSP2Fx0umsA6iUDBaUGF/OSWqEE/6TcFVq4GcrcnHl299L7QzkANoiUDbZetOSVaXTIZcD8gW+1dISMFNxYJFTAWdnhqECVvfWg1dgcEXd4ZMjZMFUiVzxtCTUu9xAXfJhI3FiUbJK2h76ydkbom7CnqAMCoTgmBLSmbv1zFDwo9PQVOcSw6JDkvS0NhOhIZFBUldGA2MHE+PgEVQjEefTovGmwpKwoBATwhL1NWDgEdDXoKExEdYAQzPHgSIAsrBFMlPzcwaDsyGBQcOQE6IzYSHn1eNTwJMiwNEik2MCsvDDoJAhczBzoIegoPKTVtJSUlASwCIytUAxEGJi4=",
"tag": "test-tag",
"offer": {
"price": "1.199000",
"quantity": "83402.83569641"
},
"bid": {
"price": "0.910000",
"quantity": "109890.10989010"
},
"tenor": "TOD",
"settleDate": "20240912"
}