---
title: "private/rfq_get_best_quote"
method: POST
path: "/private/rfq_get_best_quote"
tags: ["RFQ"]
---

# private/rfq_get_best_quote

`POST /private/rfq_get_best_quote`

## Request

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

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.

## Request body

- RfqGetBestQuoteRequest
  - `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[]
    - `amount` 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
    - `direction` 'buy' | 'sell', required
    - `instrument_name` string, required
  - `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 `200`

Success

- RfqGetBestQuoteResponse
  - `best_quote` PublicQuote, nullable
    - `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
    - `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
    - `last_update_timestamp` integer, required
    - `legs` PricedLegParamsAndResponse[], required
      - `amount` 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
      - `direction` 'buy' | 'sell', required
      - `instrument_name` string, required
      - `price` 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
    - `legs_hash` string, required
    - `liquidity_role` 'maker' | 'taker', required
    - `quote_id` string, uuid, required: UUID v4 string
    - `rfq_id` string, uuid, required: UUID v4 string
    - `status` 'open' | 'filled' | 'cancelled' | 'expired', required
    - `subaccount_id` integer, required
    - `wallet` string, required: 20-byte Ethereum address as a 0x-prefixed lowercase hex string.
  - `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

## Other responses

- `default`: JSON-RPC error (see Error Codes)

## Changes

- **2026-10-20** `0c500202be49`: 2 info
  - the endpoint scheme security `DeriveWallet AND DeriveTimestamp AND DeriveSignature` was added to the API
  - added the media type `application/json` for the response with the status `default`

[Operation history](https://skmtc.dev/lyra/apis/derive-v3-api/changes/private/rfq_get_best_quote/post.md)

---

[API](https://skmtc.dev/lyra/apis/derive-v3-api.md) - [All operations](https://skmtc.dev/lyra/apis/derive-v3-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lyra/apis/derive-v3-api/revisions/415f8a73b10c?raw)
