RFQ

private/rfq_get_best_quote

Changed on

Taker-side dry run that evaluates a prospective RFQ (its legs and intended direction) without creating anything. Returns the best available maker quote if one exists. It returns no quote when the best quote breaks the RFQ's max_total_cost or min_total_cost. The response also includes the expected fee, validity, projected liquidation prices, and realized-PnL estimate for taking it.

post/private/rfq_get_best_quote

Request

  • Base URL
    https://api.derive.xyz/v3
  • Auth
    API key in header X-DeriveWallet and API key in header X-DeriveTimestamp and API key in header X-DeriveSignature

Request body

RfqGetBestQuoteRequest required
client, string
direction, 'buy' | 'sell'
extra_fee, string decimal

Non-negative decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

legs, LegUnpricedParams[]
rfq_id, string uuid nullable

RFQ ID to get best quote for.

If not provided, will return estimates based on mark prices.

subaccount_id, integer required

Response

Success

RfqGetBestQuoteResponse required
best_quote, PublicQuote nullable
direction, 'buy' | 'sell' required
down_liquidation_price, string decimal nullable required

Optional decimal string of the human value (e.g. "1.5"), up to 12 fractional digits, or null; a string or JSON number is accepted

estimated_fee, string decimal required

Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

estimated_realized_pnl, string decimal required

Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

estimated_realized_pnl_excl_fees, string decimal required

Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

estimated_total_cost, string decimal required

Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

filled_pct, string decimal required

Non-negative decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

invalid_reason, string nullable
is_valid, boolean required
orderbook_total_cost, string decimal nullable required

Optional decimal string of the human value (e.g. "1.5"), up to 12 fractional digits, or null; a string or JSON number is accepted

post_initial_margin, string decimal required

Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

post_liquidation_price, string decimal nullable required

Optional decimal string of the human value (e.g. "1.5"), up to 12 fractional digits, or null; a string or JSON number is accepted

pre_initial_margin, string decimal required

Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

suggested_max_fee, string decimal required

Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted

up_liquidation_price, string decimal nullable required

Optional decimal string of the human value (e.g. "1.5"), up to 12 fractional digits, or null; a string or JSON number is accepted

Changes

    • info

      the endpoint scheme security DeriveWallet AND DeriveTimestamp AND DeriveSignature was added to the API

    • info

      added the media type application/json for the response with the status