RFQ

private/send_rfq

Changed on

Taker-side call that opens a new RFQ for a multi-leg structure on a subaccount, inviting makers to quote it. You supply the legs (instrument, amount, and direction per leg) plus optional min/max total cost limits that filter only the best quote, a partial-fill step, a label, and a list of specific counterparties to restrict who can see it. Returns the created RFQ including its assigned id and validity window. Requires trade scope for every instrument in the legs.

post/private/send_rfq

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

SendRfqRequest required
client, string
counterparties, string[] nullable
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

label, string
legs, LegUnpricedParams[] required
max_total_cost, string decimal nullable

Highest total cost you accept when you execute as buyer (direction: buy). Optional decimal string (e.g. "500") or JSON number.

Total cost is in USD for the full RFQ size, from your side of the trade. A positive cost means you pay. A negative cost means you receive.

private/rfq_get_best_quote and the {subaccount_id}.best.quotes channel skip quotes above this value. This is a quote filter only. private/execute_quote does not check it, and private/poll_quotes returns all quotes. Makers do not see this value.

min_total_cost, string decimal nullable

Highest total cost you accept when you execute as seller (direction: sell). Optional decimal string (e.g. "-180") or JSON number.

It uses the same sign as max_total_cost, so a sale that pays you has a negative cost. To set the smallest amount you will receive, send that amount as a negative number. For example, -180 skips quotes that pay you less than 180. A positive value such as 180 skips only quotes that cost you more than 180.

It applies in the same places as max_total_cost. private/execute_quote does not check it. Makers do not see this value.

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

referral_code, string
subaccount_id, integer required

Response

Success

Rfq required
ask_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

bid_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

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
counterparties, Address[] nullable
creation_timestamp, integer required
filled_direction, 'buy' | 'sell' nullable
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

label, string required
last_update_timestamp, integer required
legs, LegUnpricedParams[] required
mark_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

max_total_cost, string decimal nullable required

The max_total_cost sent with the RFQ, as a decimal string, or null. It filters the best quote only. See private/send_rfq.

min_total_cost, string decimal nullable required

The min_total_cost sent with the RFQ, as a decimal string, or null. It filters the best quote only. See private/send_rfq.

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

rfq_id, string uuid required

UUID v4 string

status, 'open' | 'filled' | 'cancelled' | 'expired' required
subaccount_id, integer required
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

valid_until, integer required
wallet, string required

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

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