RFQ

private/execute_quote

Changed on

Taker-side call that accepts a specific maker quote and settles the trade atomically. You reference the rfq_id and quote_id and supply the taker's priced legs, direction, max fee, and EIP-712 signature (signer, signature, nonce, expiry), with an optional taker-protection flag. It does not check the RFQ's max_total_cost or min_total_cost. The signature is verified and the taker fill, maker quote, and RFQ are updated together in one atomic step. Requires trade scope for every instrument in the legs.

post/private/execute_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

ExecuteQuoteRequest required
client, string
direction, 'buy' | 'sell' required
enable_taker_protection, boolean

If true, reject the execution with QuoteTakerCostTooHigh when the orderbook fills the same legs at a lower total cost. The check is skipped when the orderbook cannot fill every leg in full. The RFQ's max_total_cost and min_total_cost are not checked here.

label, string
legs, PricedLegParamsAndResponse[] required
max_fee, 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

nonce, string required
quote_id, string uuid required

UUID v4 string

referral_code, string
rfq_id, string uuid required

UUID v4 string

signature, string required
signature_expiry_sec, integer required
signer, string required

20-byte Ethereum address as a 0x-prefixed lowercase hex string.

subaccount_id, integer required

Response

Success

QuoteExecuteResponse required
cancel_reason, '' | 'user_request' | 'insufficient_margin' | 'signed_max_fee_too_low' | 'mmp_trigger' | 'cancel_on_disconnect' | 'session_key_deregistered' | 'subaccount_withdrawn' | 'rfq_no_longer_open' | 'compliance' | 'validation_failed' required
creation_timestamp, integer required
direction, 'buy' | 'sell' required
extra_fee, 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

fee, 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

fill_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

is_transfer, boolean required
label, string required
last_update_timestamp, integer required
legs, PricedLegParamsAndResponse[] required
legs_hash, string required
liquidity_role, 'maker' | 'taker' required
max_fee, 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

mmp, boolean required
nonce, string required
quote_id, string uuid required

UUID v4 string

rfq_filled_pct, string decimal required

Cumulative fraction of the RFQ filled after this execution, as a decimal string (e.g. "0.5" = 50% filled).

rfq_id, string uuid required

UUID v4 string

signature_expiry_sec, integer required
status, 'open' | 'filled' | 'cancelled' | 'expired' required
subaccount_id, integer required

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