HomeDocumentationAPI Reference
Log In
API Reference

(Subaccount Id) Best Quotes

Channel Name Schema

{subaccount_id}.best.quotes

Subscribe to best quote state for a given subaccount ID.
This will notify the user about the best quote available for the RFQ they have sent.

Channel Parameters

subaccount_idintegerrequired
Subaccount ID to get best quote state updates for

Notification Data

channelstringrequired
Subscribed channel name
dataarray of objectsrequired
data[].rfq_idstringrequired
RFQ ID for which the best quote is being published
data[].errorobject or null
Error if the the rfq_get_best_quote RPC call failed
data[].error.codeintegerrequired
data[].error.messagestringrequired
data[].error.datastring or null
data[].resultobject or null
Best quote result for the RFQ, if not an error
data[].result.best_quoteobject or nullrequired
Best quote for the RFQ (or null if RFQ is not created yet or quotes do not exist). This object should be used to sign a taker quote and call into execute_quote RPC.
data[].result.best_quote.cancel_reasonstringrequired
Cancel reason, if any
enum user_requestinsufficient_marginsigned_max_fee_too_lowmmp_triggercancel_on_disconnectsession_key_deregisteredsubaccount_withdrawnrfq_no_longer_opencompliance
data[].result.best_quote.creation_timestampintegerrequired
Creation timestamp in ms since Unix epoch
data[].result.best_quote.directionstringrequired
Quote direction
enum buysell
data[].result.best_quote.fill_pctstringrequired
Percentage of the RFQ that this quote would fill, from 0 to 1.
data[].result.best_quote.last_update_timestampintegerrequired
Last update timestamp in ms since Unix epoch
data[].result.best_quote.legs_hashstringrequired
Hash of the legs of the best quote to be signed by the taker.
data[].result.best_quote.liquidity_rolestringrequired
Liquidity role
enum makertaker
data[].result.best_quote.quote_idstringrequired
Quote ID
data[].result.best_quote.rfq_idstringrequired
RFQ ID
data[].result.best_quote.statusstringrequired
Status
enum openfilledcancelledexpired
data[].result.best_quote.subaccount_idintegerrequired
Subaccount ID
data[].result.best_quote.tx_hashstring or nullrequired
Blockchain transaction hash (only for executed quotes)
data[].result.best_quote.tx_statusstring or nullrequired
Blockchain transaction status (only for executed quotes)
enum requestedpendingsettledrevertedignoredtimed_out
data[].result.best_quote.walletstringrequired
Wallet address of the quote sender
data[].result.best_quote.legsarray of objectsrequired
Quote legs
data[].result.best_quote.legs[].amountstringrequired
Amount in units of the base
data[].result.best_quote.legs[].directionstringrequired
Leg direction
enum buysell
data[].result.best_quote.legs[].instrument_namestringrequired
Instrument name
data[].result.best_quote.legs[].pricestringrequired
Leg price
data[].result.directionstringrequired
RFQ direction.
enum buysell
data[].result.down_liquidation_pricestring or nullrequired
Liquidation price if the trade were to be filled and the market moves down.
data[].result.estimated_feestringrequired
An estimate for how much the user will pay in fees ($ for the whole trade).
data[].result.estimated_realized_pnlstringrequired
An estimate for the realized PnL of the trade.
data[].result.estimated_realized_pnl_excl_feesstringrequired
An estimate for the realized PnL of the trade. with cost basis calculated without considering fees.
data[].result.estimated_total_coststringrequired
An estimate for the total $ cost of the trade.
data[].result.filled_pctstringrequired
Percentage of the RFQ that has already been filled, from 0 to 1.
data[].result.invalid_reasonstring or nullrequired
Reason for the RFQ being invalid, if any.
enum Account is currently under maintenance margin requirements, trading is frozen.This order would cause account to fall under maintenance margin requirements.Insufficient buying power, only a single risk-reducing open order is allowed.Insufficient buying power, consider reducing order size.Insufficient buying power, consider reducing order size or canceling other orders.Consider canceling other limit orders or using IOC, FOK, or market orders. This order is risk-reducing, but if filled with other open orders, buying power might be insufficient.Insufficient buying power.
data[].result.is_validbooleanrequired
True if RFQ is expected to pass margin requirements.
data[].result.orderbook_total_coststring or nullrequired
Total cost of the RFQ if it were to be filled at current orderbook prices (same direction as the RFQ). If lower than estimated_total_cost, the user may want to use the orderbook instead of RFQs for this order. Will return null if any of the legs do not have orderbook data or enough liquidity for the full fill.
data[].result.post_initial_marginstringrequired
User's hypothetical margin balance if the trade were to get executed.
data[].result.post_liquidation_pricestring or nullrequired
Liquidation price if the trade were to be filled. If both upside and downside liquidation prices exist, returns the closest one to the current index price.
data[].result.pre_initial_marginstringrequired
User's initial margin balance before the trade.
data[].result.suggested_max_feestringrequired
Recommended value for max_fee of the trade.
data[].result.up_liquidation_pricestring or nullrequired
Liquidation price if the trade were to be filled and the market moves up.

Example

Subscriptions are only available via websockets.

{request_example_javascript}
{request_example_python}

Notification messages on this channel will look like this:

{response_example_json}