API documentation
Sign in

Price channel

Subscribing to a two-way price stream, reading a quote, and unsubscribing.

Prices are streamed, not polled. You subscribe for a specific size of a specific pair at a specific tenor, and the gateway pushes a two-way quote for that size until you unsubscribe or it stops streaming.

The size matters: a subscription is priced for the quantity you asked for, so 1 BTC and 10 BTC are separate subscriptions with separate quotes. Asking for a size no available price band covers is rejected outright rather than answered with an approximate price.

Every price update carries a fresh quoteId. That is the token you place an order with — see order sessions and recovery. Updates arrive roughly twice a second per subscription, and each one supersedes the last, so hold the most recent and re-read rather than caching.

Subscriptions do not survive a reconnect. They are bound to the connection, not to your session, and the gateway drops all of them when the socket closes. Re-subscribe after every reconnect, even under the same sessionId — unlike a subscribed order, nothing is replayed for you.

Subscribe request

Sent as messageType: "subscribe". Answered by exactly one subscribe response.

beneficiaryDetails and senderDetails cannot both be sent. A request carrying both is rejected, and because a top-level beneficiaryId is converted into beneficiaryDetails first, sending beneficiaryId alongside senderDetails is rejected on the same grounds.

FieldTypeRequiredNotes
messageTypestringRequiredAlways subscribe on this message. It is how the gateway picks the message type
instrumentstringRequiredThe pair, as TRADED.SETTLEMENT — for example BTC.USD. Rejected if blank, or if it is not exactly two parts separated by a dot
tagstringYour own label for this subscription, echoed on the subscribe response and on every price update. Never validated — use it to route updates when you hold several subscriptions on one connection
quantitystringRequiredThe size you want priced, as a decimal string. Must parse as a number and be greater than zero. It is part of what identifies the subscription
currencystringRequiredWhich side of the pair quantity is expressed in. Must be one of the two currencies in instrument
accountGrpUuidstringConditionalThe account group to price for. Sending it blank is rejected, and it becomes required when you supply beneficiaryDetails
tenorstringRequiredThe settlement tenor. Rejected only if blank — the gateway does not check the value, so an unrecognised tenor is accepted here and then fails to match any price. See the tenors below
beneficiaryIdstringThe flat form of a beneficiary subscription: the beneficiary and its network sent at this level instead of in a beneficiaryDetails block. Send it and the gateway builds beneficiaryDetails from these two fields, discarding anything you sent in that field. There is no flat form for a sender
networkIdstringConditionalThe delivery network, sent here rather than inside beneficiaryDetails. Read only alongside a top-level beneficiaryId, and required there, because the flat form carries no payoutCurrency
beneficiaryDetailsBeneficiaryDetailsThird-party delivery destination, for a trade settling to a party other than you. Mutually exclusive with senderDetails
senderDetailsSenderDetailsThird-party collection source, for a trade funded by a party other than you. Mutually exclusive with beneficiaryDetails
chanIdstringSet by the gateway to your connection identifier. Anything you send is discarded
authUserUUIDstringSet by the gateway from your credential. Anything you send is discarded

BeneficiaryDetails

Supply at least one of networkId and payoutCurrency; a beneficiary block with neither is rejected. Requires accountGrpUuid on the request.

FieldTypeRequiredNotes
beneficiaryIdstringRequiredThe beneficiary to deliver to, from your settlement parties. Omit it and no beneficiary is resolved — you are priced for your own settlement rather than told anything is wrong
networkIdstringConditionalThe delivery network. Left empty for a crypto payout, your default transfer network is used. If you do supply one for a fiat payout it must agree with the network resolved for that beneficiary, or the request is rejected
payoutCurrencystringConditionalThe currency the beneficiary is paid in, when that is what determines the network rather than an explicit networkId

SenderDetails

FieldTypeRequiredNotes
senderIdstringRequiredThe registered sender funding the trade, from your settlement parties. Omit it and no sender is resolved — you are priced for your own funding rather than told anything is wrong
networkIdstringThe collection network. Left empty, your default sender network is used. It must be a sender-type network, or the request is rejected
payinCurrencystringThe currency the sender delivers in. Must be a digital asset

Subscribe response

Sent as messageType: "subscribe", once per subscribe request, whether it succeeded or not.

Read success — a subscriptionId is present either way. The gateway allocates the identifier before it validates, so its presence tells you nothing about whether you are subscribed.

FieldTypeNotes
messageTypestringAlways subscribe
successbooleanWhether you are now subscribed. The only reliable signal on this message
messagestringHuman-readable detail accompanying code
subscriptionIdstringThe identifier for this subscription, and what you unsubscribe with. Allocated by the gateway on every request, including one that failed
tagstringYour own label, echoed back
instrumentstringThe pair subscribed to
quantitystringThe size subscribed for
codestringSet when success is false; see trade error codes
tenorstringThe settlement tenor subscribed to
settleDatestringThe settlement date resolved for that tenor
networkIdstringThe network the gateway resolved for a third-party trade, which may differ from the one you asked for. Absent when neither beneficiary nor sender details were supplied
chanIdstringThe connection the message was delivered on
timestampintegerWhen the gateway produced this message, in milliseconds

Price update

Sent as messageType: "pricestream", roughly every 500 ms per live subscription for as long as a tradeable price exists.

Each update replaces the previous one. quoteId changes on every message, and only a recent one is accepted on an order.

Price updates are delivered on a lossy channel: a client that reads slower than the stream produces silently misses ticks rather than falling behind. You will not be told, and nothing is replayed. Treat every update as the current price, not as one of a complete sequence.

FieldTypeNotes
instrumentstringThe pair being priced
tenorstringThe settlement tenor
messageTypestringAlways pricestream
quoteIdstringThe token you place an order against. It carries the whole quote — price, size, tenor, settlement date and who it was issued to — so it is long, opaque and not a handle you can look up. It is yours alone: an order placed with someone else's is rejected
tagstringYour own label from the subscribe request, echoed on every update. Use it to match an update to a subscription when you hold several
offerQuoteSideThe price you buy the traded currency at
bidQuoteSideThe price you sell the traded currency at
settleDatestringThe settlement date this price settles on
chanIdstringThe connection the message was delivered on
timestampintegerWhen the gateway produced this message, in milliseconds

QuoteSide

One side of the two-way price, carried on offer and on bid.

FieldTypeNotes
pricestringThe rate, in settlement currency per unit of the traded currency
quantitystringThe size this rate is good for, which is the size you subscribed at
quoteAmountstringThe other side of the same trade — what quantity at price comes to in the opposite currency

Unsubscribe request

Sent as messageType: "unsubscribe". Stops the stream for one subscription.

An unknown subscriptionId is answered with silence. There is no error frame for one that does not exist or belongs to another connection — you simply receive no response. Do not block waiting for one.

FieldTypeRequiredNotes
messageTypestringRequiredAlways unsubscribe on this message
subscriptionIdstringRequiredThe subscription to stop, from the subscribe response. It must be one of yours on this connection
chanIdstringSet by the gateway to your connection identifier. Anything you send is discarded
authUserUUIDstringSet by the gateway from your credential. Anything you send is discarded

Unsubscribe response

Sent as messageType: "unsubscribe", and only when the subscription was found.

FieldTypeNotes
messageTypestringAlways unsubscribe
successbooleanAlways true on this message. A failed unsubscribe produces no message at all
subscriptionIdstringThe subscription that was stopped
messagestringHuman-readable detail
instrumentstringThe pair that was being priced
quantitystringThe size that was being priced
tenorstringThe settlement tenor that was being priced
chanIdstringThe connection the message was delivered on
timestampintegerWhen the gateway produced this message, in milliseconds

Stream stop

Sent as messageType: "streamStop" when a live subscription has no tradeable price. It means "nothing to quote right now", not "your subscription is gone".

The subscription stays live and this message repeats. It is re-sent on every broadcast tick for as long as the condition holds, so deduplicate on subscriptionId rather than treating each one as a new event. If the condition clears, prices resume on the same subscription with no action from you. If it does not, the stream simply goes quiet.

FieldTypeNotes
messageTypestringAlways streamStop
tagstringYour own label from the subscribe request
codestringWhy the stream stopped; see the reasons below
messagestringHuman-readable detail. It is deliberately the same wording for every reason — read code, not this
instrumentstringThe pair that has stopped streaming
tenorstringThe settlement tenor that has stopped streaming
chanIdstringThe connection the message was delivered on
timestampintegerWhen the gateway produced this message, in milliseconds

StreamStopReason

ValueMeaning
CUT_OFF_TIME_REACHEDThe cut-off for same-day settlement has passed, so this tenor can no longer be traded today. Applies to TOD. Subscribe at a later tenor, or at T, which rolls to the next available one on your behalf
VENUE_DISABLEDThe venue behind the price is not trading. Handle it exactly as STREAM_UNAVAILABLE — the gateway reports venue unavailability under that reason
STREAM_UNAVAILABLENo tradeable price is available for this subscription. Either the instrument is not enabled for your account, or the liquidity behind it is not trading. If it does not clear, contact your desk

Tenors

The gateway accepts any non-blank tenor and does not check the value, so a tenor that is merely misspelled is not rejected at subscribe. It fails later, as a price-level error, because nothing in the stream matches it. If a subscription is refused for a size you believe is available, check the tenor first.

  • TOD — today. Unavailable after the daily cut-off, which is when you receive CUT_OFF_TIME_REACHED.
  • TOM — the next business day.
  • SP — spot.
  • T — the nearest tenor still available: TOD before the cut-off, otherwise TOM or SP. Use this to avoid handling the cut-off yourself.
  • T1 — the next tenor after T.

settleDate is resolved by us from the tenor and returned on the subscribe response and every price update. You cannot request a settlement date directly.

We use cookies to improve your experience and analyse site traffic. Cookie policy