Orderbook

private/order_quote

Changed on

Dry-run pricing helper that estimates the outcome of a prospective order without placing it, returning projected fill price and amount, fees, pre/post initial margin, realized PnL, resulting order status and (where relevant) liquidation price and max tradable amount. All monetary values are returned as decimal strings. The private variant requires account-level authentication.

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

OrderQuoteRequest required

Parameters for public/order_quote and private/order_quote.

amount, string decimal required

Order amount in units of the base, as a decimal string (e.g. "1.5") or a JSON number.

client, string
direction, 'buy' | 'sell' required

Order direction

extra_fee, string decimal nullable

Optional builder fee for the whole order, in USDC, as a decimal string or JSON number. Each fill pays its pro-rata share. Defaults to zero.

instrument_name, string required

Instrument name

is_atomic_signing, boolean
label, string
limit_price, string decimal required

Limit price in quote currency, as a decimal string or a JSON number.

max_fee, string decimal required

Max fee per unit of volume in quote currency, as a decimal string or a JSON number.

mmp, boolean
nonce, string required

Nonce.

order_type, 'limit' | 'market'
reduce_only, boolean
referral_code, string
reject_post_only, boolean
reject_timestamp, integer
signature, string required

Ethereum signature of the order.

signature_expiry_sec, integer required

Signature expiry (unix seconds).

signer, string required

Owner wallet or session key that signed the order.

subaccount_id, integer required

Subaccount ID

time_in_force, 'gtc' | 'post_only' | 'fok' | 'ioc'
trigger_price, string decimal nullable

Trigger price as a decimal string or JSON number; omit for non-trigger orders.

trigger_price_type, 'mark' | 'index' nullable
trigger_type, 'stoploss' | 'takeprofit' nullable

Response

Success

OrderQuoteResponse required

Estimated fill price, fees, and resulting margin for a proposed order — a non-binding dry-run. All price, fee, and margin fields are decimal strings.

estimated_fee, string required
estimated_fill_amount, string required
estimated_fill_price, string required
estimated_order_status, 'open' | 'filled' | 'rejected' | 'cancelled' | 'expired' | 'untriggered' | 'algo_active' required
estimated_realized_pnl, string required
estimated_realized_pnl_excl_fees, string required
invalid_reason, string nullable
is_valid, boolean required
max_amount, string nullable
post_initial_margin, string required
post_liquidation_price, string nullable
pre_initial_margin, string required
suggested_max_fee, string 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