> ## Documentation Index
> Fetch the complete documentation index at: https://v3.docs.derive.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate order cost and margin without authentication

> Public dry-run variant of order_quote that estimates fill price, fees, margin impact, projected order status and realized PnL for a prospective order without placing it, returning all values as decimal strings. Unlike private/order_quote it bypasses session scope checks, so it can be used to preview costs without account authentication.



## OpenAPI

````yaml /openapi.json post /public/order_quote
openapi: 3.1.0
info:
  title: Derive v3 API
  version: 0.2.0
  description: JSON-RPC 2.0 methods, served over WebSocket and HTTP POST.
servers:
  - url: https://api.derive.xyz/v3
    description: Production (HTTP POST base)
  - url: https://testnet.api.derive.xyz/v3
    description: Testnet (HTTP POST base)
security: []
tags:
  - name: Subaccounts
    description: >-
      List, inspect, and label subaccounts, portfolios, positions, and
      collateral.
  - name: Session Keys
    description: Register, edit, and list delegated signing keys.
  - name: Account
    description: Wallet-level account information and settings.
  - name: Orderbook
    description: Place, replace, cancel, and query orders, trigger orders, and algos.
  - name: RFQ
    description: 'Request-for-quote: send RFQs, quote, and execute block trades.'
  - name: Vault Shareholders
    description: >-
      Deposit into and withdraw from vaults, and track shares, requests, and
      performance.
  - name: Vault Curators
    description: >-
      Create and operate curated vaults: settle deposit and withdrawal requests,
      and manage vault metadata.
  - name: History
    description: >-
      Per-account historical records: orders, trades, transfers, and
      settlements.
  - name: Market Maker Protection
    description: Configure, read, and reset market-maker protection.
  - name: Transfers & Withdrawals
    description: Move collateral between subaccounts, to other wallets, and on-chain.
  - name: System
    description: Rate limits and transaction lookups.
  - name: Market Data
    description: Instruments, currencies, tickers, and market-wide feeds.
  - name: Referrals
    description: Referral codes and program performance.
  - name: Other
    description: Uncategorized.
paths:
  /public/order_quote:
    post:
      tags:
        - Orderbook
      summary: Estimate order cost and margin without authentication
      description: >-
        Public dry-run variant of order_quote that estimates fill price, fees,
        margin impact, projected order status and realized PnL for a prospective
        order without placing it, returning all values as decimal strings.
        Unlike private/order_quote it bypasses session scope checks, so it can
        be used to preview costs without account authentication.
      operationId: public_order_quote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderQuoteRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderQuoteResponse'
        default:
          description: JSON-RPC error (see Error Codes)
components:
  schemas:
    OrderQuoteRequest:
      description: Parameters for `public/order_quote` and `private/order_quote`.
      type: object
      required:
        - amount
        - direction
        - instrument_name
        - limit_price
        - max_fee
        - nonce
        - signature
        - signature_expiry_sec
        - signer
        - subaccount_id
      properties:
        amount:
          description: >-
            Order amount in units of the base, as a decimal string (e.g.
            `"1.5"`) or a JSON number.
          type: string
          format: decimal
        client:
          default: ''
          type: string
        direction:
          $ref: '#/components/schemas/Direction'
          description: Order direction
        extra_fee:
          description: >-
            Optional extra fee per unit of volume, as a decimal string or JSON
            number. Defaults to zero.
          default: null
          type:
            - string
            - 'null'
          format: decimal
        instrument_name:
          description: Instrument name
          type: string
        is_atomic_signing:
          default: false
          type: boolean
        label:
          default: ''
          type: string
        limit_price:
          description: Limit price in quote currency, as a decimal string or a JSON number.
          type: string
          format: decimal
        max_fee:
          description: >-
            Max fee per unit of volume in quote currency, as a decimal string or
            a JSON number.
          type: string
          format: decimal
        mmp:
          default: false
          type: boolean
        nonce:
          description: Nonce.
          type: string
        order_type:
          $ref: '#/components/schemas/OrderType'
          default: limit
        reduce_only:
          default: false
          type: boolean
        referral_code:
          default: ''
          type: string
        reject_post_only:
          default: true
          type: boolean
        reject_timestamp:
          default: 9223372036854776000
          type: integer
          format: int64
        signature:
          description: Ethereum signature of the order.
          type: string
        signature_expiry_sec:
          description: Signature expiry (unix seconds).
          type: integer
          format: int64
        signer:
          description: Owner wallet or session key that signed the order.
          type: string
        subaccount_id:
          description: Subaccount ID
          type: integer
          format: int64
        time_in_force:
          $ref: '#/components/schemas/TimeInForce'
          default: gtc
        trigger_price:
          description: >-
            Trigger price as a decimal string or JSON number; omit for
            non-trigger orders.
          default: null
          type:
            - string
            - 'null'
          format: decimal
        trigger_price_type:
          anyOf:
            - $ref: '#/components/schemas/TriggerPriceType'
            - type: 'null'
        trigger_type:
          anyOf:
            - $ref: '#/components/schemas/TriggerType'
            - type: 'null'
    OrderQuoteResponse:
      description: >-
        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.
      type: object
      required:
        - estimated_fee
        - estimated_fill_amount
        - estimated_fill_price
        - estimated_order_status
        - estimated_realized_pnl
        - estimated_realized_pnl_excl_fees
        - is_valid
        - post_initial_margin
        - pre_initial_margin
        - suggested_max_fee
      properties:
        estimated_fee:
          type: string
        estimated_fill_amount:
          type: string
        estimated_fill_price:
          type: string
        estimated_order_status:
          $ref: '#/components/schemas/OrderStatus'
        estimated_realized_pnl:
          type: string
        estimated_realized_pnl_excl_fees:
          type: string
        invalid_reason:
          type:
            - string
            - 'null'
        is_valid:
          type: boolean
        max_amount:
          type:
            - string
            - 'null'
        post_initial_margin:
          type: string
        post_liquidation_price:
          type:
            - string
            - 'null'
        pre_initial_margin:
          type: string
        suggested_max_fee:
          type: string
    Direction:
      type: string
      enum:
        - buy
        - sell
    OrderType:
      type: string
      enum:
        - limit
        - market
    TimeInForce:
      type: string
      enum:
        - gtc
        - post_only
        - fok
        - ioc
    TriggerPriceType:
      type: string
      enum:
        - mark
        - index
    TriggerType:
      type: string
      enum:
        - stoploss
        - takeprofit
    OrderStatus:
      type: string
      enum:
        - open
        - filled
        - rejected
        - cancelled
        - expired
        - untriggered
        - algo_active

````

## Related topics

- [Estimate the cost and margin impact of an order](/api-reference/orderbook/estimate-the-cost-and-margin-impact-of-an-order.md)
- [Preview the best quote for an RFQ](/api-reference/rfq/preview-the-best-quote-for-an-rfq.md)
- [Cancel orders matching a label](/api-reference/orderbook/cancel-orders-matching-a-label.md)
