> ## 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.

# Cancel and resubmit a maker quote atomically

> Maker-side call that atomically cancels an existing quote and submits a new signed quote for the same RFQ in one operation. You provide the new priced legs, direction, max fee, and EIP-712 signature, plus the quote to cancel (by quote_id or nonce_to_cancel). Returns the cancellation result together with the newly created quote. Requires trade scope for every instrument quoted.



## OpenAPI

````yaml /openapi.json post /private/replace_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:
  /private/replace_quote:
    post:
      tags:
        - RFQ
      summary: Cancel and resubmit a maker quote atomically
      description: >-
        Maker-side call that atomically cancels an existing quote and submits a
        new signed quote for the same RFQ in one operation. You provide the new
        priced legs, direction, max fee, and EIP-712 signature, plus the quote
        to cancel (by quote_id or nonce_to_cancel). Returns the cancellation
        result together with the newly created quote. Requires trade scope for
        every instrument quoted.
      operationId: private_replace_quote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceQuoteRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteReplaceResponse'
        default:
          description: JSON-RPC error (see Error Codes)
components:
  schemas:
    ReplaceQuoteRequest:
      type: object
      required:
        - direction
        - legs
        - max_fee
        - nonce
        - rfq_id
        - signature
        - signature_expiry_sec
        - signer
        - subaccount_id
      properties:
        client:
          default: ''
          type: string
        direction: true
        extra_fee:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          default: '0'
          type: string
          format: decimal
        label:
          default: ''
          type: string
        legs: true
        max_fee:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        mmp:
          default: false
          type: boolean
        nonce: true
        nonce_to_cancel:
          default: null
        quote_id_to_cancel:
          description: Optional UUID v4 string
          default: null
          type:
            - string
            - 'null'
          format: uuid
        referral_code:
          default: ''
          type: string
        rfq_id:
          description: UUID v4 string
          type: string
          format: uuid
        signature: true
        signature_expiry_sec: true
        signer: true
        subaccount_id:
          type: integer
          format: uint64
          minimum: 0
    QuoteReplaceResponse:
      type: object
      required:
        - cancelled_quote
      properties:
        cancelled_quote:
          $ref: '#/components/schemas/Quote'
        create_quote_error:
          anyOf:
            - $ref: '#/components/schemas/RPCError'
            - type: 'null'
        quote:
          anyOf:
            - $ref: '#/components/schemas/Quote'
            - type: 'null'
    Quote:
      type: object
      required:
        - cancel_reason
        - creation_timestamp
        - direction
        - extra_fee
        - fee
        - fill_pct
        - is_transfer
        - label
        - last_update_timestamp
        - legs
        - legs_hash
        - liquidity_role
        - max_fee
        - mmp
        - nonce
        - quote_id
        - rfq_id
        - signature_expiry_sec
        - status
        - subaccount_id
      properties:
        cancel_reason:
          $ref: '#/components/schemas/RFQCancelReason'
        creation_timestamp:
          type: integer
          format: int64
        direction:
          $ref: '#/components/schemas/Direction'
        extra_fee:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        fee:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        fill_pct:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        is_transfer:
          type: boolean
        label:
          type: string
        last_update_timestamp:
          type: integer
          format: int64
        legs:
          type: array
          items:
            $ref: '#/components/schemas/PricedLegParamsAndResponse'
        legs_hash:
          type: string
        liquidity_role:
          $ref: '#/components/schemas/LiquidityRole'
        max_fee:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        mmp:
          type: boolean
        nonce:
          type: string
        quote_id:
          description: UUID v4 string
          type: string
          format: uuid
        rfq_id:
          description: UUID v4 string
          type: string
          format: uuid
        signature_expiry_sec:
          type: integer
          format: int64
        status:
          $ref: '#/components/schemas/RFQStatus'
        subaccount_id:
          type: integer
          format: int64
        tx_hash:
          description: Blockchain transaction hash (only for executed quotes).
          type:
            - string
            - 'null'
        tx_status:
          description: Blockchain transaction status (only for executed quotes).
          anyOf:
            - $ref: '#/components/schemas/TxStatus'
            - type: 'null'
    RPCError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int64
        data:
          type:
            - string
            - 'null'
        message:
          type: string
    RFQCancelReason:
      type: string
      enum:
        - ''
        - user_request
        - insufficient_margin
        - signed_max_fee_too_low
        - mmp_trigger
        - cancel_on_disconnect
        - session_key_deregistered
        - subaccount_withdrawn
        - rfq_no_longer_open
        - compliance
    Direction:
      type: string
      enum:
        - buy
        - sell
    PricedLegParamsAndResponse:
      type: object
      required:
        - amount
        - direction
        - instrument_name
        - price
      properties:
        amount:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        direction:
          $ref: '#/components/schemas/Direction'
        instrument_name:
          type: string
        price:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
    LiquidityRole:
      type: string
      enum:
        - maker
        - taker
    RFQStatus:
      type: string
      enum:
        - open
        - filled
        - cancelled
        - expired
    TxStatus:
      oneOf:
        - type: string
          enum:
            - requested
            - pending
            - settled
            - reverted
            - ignored
            - timed_out
        - description: Applied off-chain; not yet included in an on-chain settlement batch.
          type: string
          enum:
            - applied
        - description: Included in a settlement batch and executing.
          type: string
          enum:
            - in_batch
        - description: Settlement proof in progress.
          type: string
          enum:
            - proving
        - description: Settlement transaction broadcast on-chain; awaiting confirmation.
          type: string
          enum:
            - submitted

````

## Related topics

- [Cancel a single maker quote by id](/api-reference/rfq/cancel-a-single-maker-quote-by-id.md)
- [Cancel multiple maker quotes by filter](/api-reference/rfq/cancel-multiple-maker-quotes-by-filter.md)
- [RFQ Trading](/trading/rfq.md)
