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_id  integer required
Subaccount ID to get best quote state updates for

Notification Data

channel  string required
Subscribed channel name

data  array of objects required

data[]. rfq_id  string required
RFQ ID for which the best quote is being published

data[]. error  object or null
Error if the the rfq_get_best_quote RPC call failed

data[].error. code  integer required

data[].error. message  string required

data[].error. data  string or null

data[]. result  object or null
Best quote result for the RFQ, if not an error

data[].result. best_quote  object or null required
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_reason  string required
Cancel reason, if any
enum user_request insufficient_margin signed_max_fee_too_low mmp_trigger cancel_on_disconnect session_key_deregistered subaccount_withdrawn rfq_no_longer_open compliance

data[].result.best_quote. creation_timestamp  integer required
Creation timestamp in ms since Unix epoch

data[].result.best_quote. direction  string required
Quote direction
enum buy sell

data[].result.best_quote. fill_pct  string required
Percentage of the RFQ that this quote would fill, from 0 to 1.

data[].result.best_quote. last_update_timestamp  integer required
Last update timestamp in ms since Unix epoch

data[].result.best_quote. legs_hash  string required
Hash of the legs of the best quote to be signed by the taker.

data[].result.best_quote. liquidity_role  string required
Liquidity role
enum maker taker

data[].result.best_quote. quote_id  string required
Quote ID

data[].result.best_quote. rfq_id  string required
RFQ ID

data[].result.best_quote. status  string required
Status
enum open filled cancelled expired

data[].result.best_quote. subaccount_id  integer required
Subaccount ID

data[].result.best_quote. tx_hash  string or null required
Blockchain transaction hash (only for executed quotes)

data[].result.best_quote. tx_status  string or null required
Blockchain transaction status (only for executed quotes)
enum requested pending settled reverted ignored timed_out

data[].result.best_quote. wallet  string required
Wallet address of the quote sender

data[].result.best_quote. legs  array of objects required
Quote legs

data[].result.best_quote.legs[]. amount  string required
Amount in units of the base

data[].result.best_quote.legs[]. direction  string required
Leg direction
enum buy sell

data[].result.best_quote.legs[]. instrument_name  string required
Instrument name

data[].result.best_quote.legs[]. price  string required
Leg price

data[].result. direction  string required
RFQ direction.
enum buy sell

data[].result. down_liquidation_price  string or null required
Liquidation price if the trade were to be filled and the market moves down.

data[].result. estimated_fee  string required
An estimate for how much the user will pay in fees ($ for the whole trade).

data[].result. estimated_realized_pnl  string required
An estimate for the realized PnL of the trade.

data[].result. estimated_realized_pnl_excl_fees  string required
An estimate for the realized PnL of the trade. with cost basis calculated without considering fees.

data[].result. estimated_total_cost  string required
An estimate for the total $ cost of the trade.

data[].result. filled_pct  string required
Percentage of the RFQ that has already been filled, from 0 to 1.

data[].result. invalid_reason  string or null required
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_valid  boolean required
True if RFQ is expected to pass margin requirements.

data[].result. orderbook_total_cost  string or null required
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_margin  string required
User's hypothetical margin balance if the trade were to get executed.

data[].result. post_liquidation_price  string or null required
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_margin  string required
User's initial margin balance before the trade.

data[].result. suggested_max_fee  string required
Recommended value for max_fee of the trade.

data[].result. up_liquidation_price  string or null required
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}