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

# Cancel and Replace Orders (Batch)

> After request-wide preflight, processes cancel-and-replace operations with independent results and preserves their input indexes.

Submit multiple cancel-and-replace operations in one request. Each executed operation has the same non-atomic behavior as [`POST /orders/cancel-replace`](/api-reference/trading/cancel-replace), and one operation result does not stop later operations.

## Request

Send `operations` as an array of 1 to 4 cancel-and-replace operations. Each item contains `cancel`, `replacement`, `mode`, and optional `onBehalfOf` fields as described in the [single-operation reference](/api-reference/trading/cancel-replace#request).

Authentication and order signing also match the single endpoint. HMAC-sign the exact JSON body with the path `/orders/cancel-replace/batch`. Each signed replacement remains a normal EIP-712 order; delegated `onBehalfOf` operations follow the same authorized-owner and delegated-signing rules.

<Warning>
  The API validates and prepares the whole request before executing any cancellation. A request-level validation, authorization, market, signature, or receive-window error rejects the batch without a `results` array. Duplicate cancellation targets and duplicate replacement `clientOrderId` values also reject the entire request. The independent-result behavior applies after the batch passes this preflight.
</Warning>

The order values below illustrate the request shape. Generate each `order.signature` from its complete replacement payload instead of copying the placeholder signatures.

```json theme={null}
{
  "operations": [
    {
      "cancel": {
        "orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203"
      },
      "replacement": {
        "ownerId": 12345,
        "orderType": "GTC",
        "marketSlug": "btc-100k",
        "clientOrderId": "replacement-101",
        "order": {
          "salt": "1778155025318314496",
          "maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
          "signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
          "taker": "0x0000000000000000000000000000000000000000",
          "tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
          "makerAmount": 5000000,
          "takerAmount": 10000000,
          "expiration": "0",
          "nonce": 0,
          "price": 0.5,
          "feeRateBps": 0,
          "side": 0,
          "signature": "0x1234",
          "signatureType": 0
        }
      },
      "mode": "STOP_ON_FAILURE"
    },
    {
      "cancel": {
        "clientOrderId": "missing-order-102"
      },
      "replacement": {
        "ownerId": 12345,
        "orderType": "GTC",
        "marketSlug": "btc-100k",
        "clientOrderId": "replacement-102",
        "order": {
          "salt": "1778155025318314497",
          "maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
          "signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
          "taker": "0x0000000000000000000000000000000000000000",
          "tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
          "makerAmount": 5500000,
          "takerAmount": 10000000,
          "expiration": "0",
          "nonce": 0,
          "price": 0.55,
          "feeRateBps": 0,
          "side": 0,
          "signature": "0x5678",
          "signatureType": 0
        }
      },
      "mode": "ALLOW_FAILURE"
    }
  ]
}
```

## Ordering and partial failures

After request-wide preflight succeeds, the response preserves request order: every result has the zero-based `index` of its input operation. Executed operations produce independent outcomes, so inspect both `cancel` and `replacement` for every index rather than treating the HTTP status as an item-level result.

If all items have top-level `cancel.status: "SUCCESS"` and `replacement.status: "SUCCESS"`, the endpoint returns `200 OK`. If any item has another top-level status, it returns `207 Multi-Status` with every result, including successful items.

```json theme={null}
{
  "results": [
    {
      "index": 0,
      "cancel": {
        "status": "SUCCESS",
        "orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203"
      },
      "replacement": {
        "status": "SUCCESS",
        "data": {
          "order": {
            "id": "9e31c452-8a2b-42d1-b327-65f18d07dc96"
          },
          "makerMatches": [],
          "execution": {
            "matched": false,
            "settlementStatus": "UNMATCHED",
            "clientOrderId": "replacement-101",
            "feeRateBps": 0,
            "effectiveFeeBps": 0,
            "totalsRaw": {
              "contractsGross": "0",
              "contractsFee": "0",
              "contractsNet": "0",
              "usdGross": "0",
              "usdFee": "0",
              "usdNet": "0"
            }
          }
        }
      }
    },
    {
      "index": 1,
      "cancel": {
        "status": "FAILURE",
        "error": {
          "code": "ORDER_NOT_FOUND",
          "message": "Order not found"
        }
      },
      "replacement": {
        "status": "FAILURE",
        "error": {
          "code": "400",
          "message": "Insufficient balance"
        }
      }
    }
  ]
}
```

`STOP_ON_FAILURE` produces `NOT_ATTEMPTED` only for the affected operation. `ALLOW_FAILURE` still attempts that operation's replacement. Public cancellation and replacement outcomes can also be `UNKNOWN` when the final result cannot be determined.

Request-level errors use their ordinary HTTP status instead of `207 Multi-Status`. A `207` is returned only after preflight succeeds and at least one executed operation has a non-success top-level result.

<Warning>
  HTTP `200` versus `207` follows the top-level cancellation and placement statuses. A replacement accepted by the matching engine stays top-level `SUCCESS` even if its nested `execution.settlementStatus` is `FAILED`; the nested `reason` carries the settlement failure.
</Warning>


## OpenAPI

````yaml POST /orders/cancel-replace/batch
openapi: 3.0.0
info:
  title: Limitless Exchange API
  description: >-
    Production-ready REST API for prediction market trading, portfolio
    management, and market data on Limitless Exchange (Base L2).
  version: '1.0'
  contact:
    name: API Support
    url: https://limitless.exchange
    email: help@limitless.network
servers:
  - url: https://api.limitless.exchange
    description: Production API
security: []
tags:
  - name: Authentication
    description: User authentication and session management
  - name: Markets
    description: Browse, search, and analyze prediction markets
  - name: Market Navigation
    description: Navigation tree, market pages, and property filters
  - name: Trading
    description: Create, manage, and cancel orders
  - name: Portfolio
    description: Position tracking, trade history, and performance
  - name: API Tokens
    description: Scoped API token management for partner integrations
  - name: Partner Accounts
    description: Sub-account creation and allowance recovery for partner integrations
  - name: System
    description: Public API state and availability information
  - name: Referral
    description: Referral program earnings, referred users, and leaderboards
  - name: Leaderboard
    description: >-
      Live Unrealized PnL leaderboards for open markets and biggest open
      positions
paths:
  /orders/cancel-replace/batch:
    post:
      tags:
        - Trading
      summary: Cancel and replace orders sequentially and non-atomically
      description: >-
        After request-wide preflight, processes cancel-and-replace operations
        with independent results and preserves their input indexes.
      operationId: OrderController_cancelReplaceBatch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelReplaceBatchDto'
      responses:
        '200':
          description: Every operation has successful cancellation and replacement statuses
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelReplaceBatchResponseDto'
              example:
                results:
                  - index: 0
                    cancel:
                      status: SUCCESS
                      orderId: 6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203
                    replacement:
                      status: SUCCESS
                      data:
                        order:
                          id: 9e31c452-8a2b-42d1-b327-65f18d07dc96
                          salt: '1778155025318314496'
                          maker: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                          signer: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                          taker: '0x0000000000000000000000000000000000000000'
                          tokenId: >-
                            19633204485790857949828516737993423758628930235371629943999544859324645414627
                          makerAmount: '5000000'
                          takerAmount: '10000000'
                          expiration: '0'
                          signatureType: 0
                          nonce: '0'
                          feeRateBps: 0
                          signature: '0x1234'
                          orderType: GTC
                          price: '0.5'
                          side: 0
                          marketId: '7348'
                          ownerId: 12345
                          createdAt: '2026-08-05T12:00:00.000Z'
                          updatedAt: '2026-08-05T12:00:00.000Z'
                          market:
                            id: 7348
                            slug: btc-100k
                            title: Will Bitcoin reach $100k?
                            status: FUNDED
                            yesPositionId: >-
                              19633204485790857949828516737993423758628930235371629943999544859324645414627
                            noPositionId: >-
                              34633204485790857949828516737993423758628930235371629943999544859324645414627
                        makerMatches: []
                        execution:
                          matched: false
                          settlementStatus: UNMATCHED
                          clientOrderId: replacement-101
                          feeRateBps: 0
                          effectiveFeeBps: 0
                          totalsRaw:
                            contractsGross: '0'
                            contractsFee: '0'
                            contractsNet: '0'
                            usdGross: '0'
                            usdFee: '0'
                            usdNet: '0'
        '207':
          description: >-
            At least one operation has a non-success cancellation or replacement
            status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelReplaceBatchResponseDto'
              example:
                results:
                  - index: 0
                    cancel:
                      status: SUCCESS
                      orderId: 6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203
                    replacement:
                      status: SUCCESS
                      data:
                        order:
                          id: 9e31c452-8a2b-42d1-b327-65f18d07dc96
                          salt: '1778155025318314496'
                          maker: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                          signer: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                          taker: '0x0000000000000000000000000000000000000000'
                          tokenId: >-
                            19633204485790857949828516737993423758628930235371629943999544859324645414627
                          makerAmount: '5000000'
                          takerAmount: '10000000'
                          expiration: '0'
                          signatureType: 0
                          nonce: '0'
                          feeRateBps: 0
                          signature: '0x1234'
                          orderType: GTC
                          price: '0.5'
                          side: 0
                          marketId: '7348'
                          ownerId: 12345
                          createdAt: '2026-08-05T12:00:00.000Z'
                          updatedAt: '2026-08-05T12:00:00.000Z'
                          market:
                            id: 7348
                            slug: btc-100k
                            title: Will Bitcoin reach $100k?
                            status: FUNDED
                            yesPositionId: >-
                              19633204485790857949828516737993423758628930235371629943999544859324645414627
                            noPositionId: >-
                              34633204485790857949828516737993423758628930235371629943999544859324645414627
                        makerMatches: []
                        execution:
                          matched: false
                          settlementStatus: UNMATCHED
                          clientOrderId: replacement-101
                          feeRateBps: 0
                          effectiveFeeBps: 0
                          totalsRaw:
                            contractsGross: '0'
                            contractsFee: '0'
                            contractsNet: '0'
                            usdGross: '0'
                            usdFee: '0'
                            usdNet: '0'
                  - index: 1
                    cancel:
                      status: FAILURE
                      error:
                        code: ORDER_NOT_FOUND
                        message: Order not found
                    replacement:
                      status: FAILURE
                      error:
                        code: '400'
                        message: Insufficient balance
        '400':
          description: >-
            Invalid batch, duplicate target or replacement clientOrderId, or
            replacement preflight failed
        '401':
          description: Authentication failed or caller is not authorized to cancel an order
        '403':
          description: Required scope or delegated-owner authorization is missing
        '404':
          description: A required preflight resource was not found
        '425':
          description: >-
            A replacement receive-window check failed or trading mode blocks a
            replacement
        '500':
          description: Unexpected server error
      security:
        - HmacAuth: []
components:
  schemas:
    CancelReplaceBatchDto:
      type: object
      properties:
        operations:
          type: array
          description: Independent cancel-and-replace operations
          minItems: 1
          maxItems: 4
          items:
            $ref: '#/components/schemas/CancelReplaceDto'
      required:
        - operations
    CancelReplaceBatchResponseDto:
      type: object
      properties:
        results:
          type: array
          description: >-
            Outcomes in input order. Each item includes its zero-based input
            index.
          items:
            allOf:
              - $ref: '#/components/schemas/CancelReplaceResponseDto'
              - type: object
                properties:
                  index:
                    type: integer
                    minimum: 0
                    description: Zero-based input operation index
                required:
                  - index
      required:
        - results
    CancelReplaceDto:
      type: object
      properties:
        cancel:
          description: Order to cancel; provide exactly one identifier
          allOf:
            - $ref: '#/components/schemas/CancelOrderCombinedDto'
        replacement:
          $ref: '#/components/schemas/CancelReplaceOrderDto'
        mode:
          type: string
          description: >-
            Whether to stop this operation or attempt replacement after
            cancellation failure
          enum:
            - ALLOW_FAILURE
            - STOP_ON_FAILURE
          example: STOP_ON_FAILURE
        onBehalfOf:
          type: integer
          minimum: 1
          description: >-
            Authorized partner sub-account profile ID. Applies to both
            cancellation and replacement.
          example: 12345
      required:
        - cancel
        - replacement
        - mode
    CancelReplaceResponseDto:
      type: object
      description: Independent cancellation and replacement outcomes.
      properties:
        cancel:
          $ref: '#/components/schemas/CancelReplaceCancelResult'
        replacement:
          $ref: '#/components/schemas/CancelReplacePlacementResult'
      required:
        - cancel
        - replacement
    CancelOrderCombinedDto:
      type: object
      properties:
        orderId:
          type: string
          format: uuid
          description: Internal order ID. Provide exactly one of orderId or clientOrderId.
          example: 6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203
        clientOrderId:
          type: string
          maxLength: 128
          description: >-
            Client-provided order ID from order creation. Provide exactly one of
            orderId or clientOrderId.
          example: partner-order-001
      oneOf:
        - required:
            - orderId
        - required:
            - clientOrderId
    CancelReplaceOrderDto:
      type: object
      description: >-
        Replacement order fields. This is the POST /orders request shape without
        onBehalfOf; delegation is set on the enclosing cancel-replace operation.
      properties:
        order:
          description: Order details including signature and amounts
          allOf:
            - $ref: '#/components/schemas/Order'
        ownerId:
          type: number
          description: Profile ID that owns both the canceled order and its replacement
          example: 12345
        orderType:
          type: string
          description: Replacement order type
          enum:
            - FAK
            - FOK
            - GTC
          example: GTC
        marketSlug:
          type: string
          description: Market identifier slug
          example: btc-100k
        postOnly:
          type: boolean
          description: >-
            Reject the replacement if it would match immediately. Supported only
            for GTC orders.
          example: true
        clientOrderId:
          type: string
          description: Client-provided idempotency key for the replacement
          example: replacement-order-001
          maxLength: 128
        timestamp:
          type: number
          description: >-
            Optional client-stamped replacement creation time as Unix
            milliseconds
          example: 1735689600000
          minimum: 0
        recvWindow:
          type: number
          description: Optional maximum accepted replacement age in milliseconds
          example: 1500
          minimum: 1
          maximum: 10000
        stpPolicy:
          type: string
          description: Self-trade prevention policy for the replacement
          enum:
            - cancel_both
            - cancel_maker
            - cancel_taker
          example: cancel_maker
      required:
        - order
        - ownerId
        - orderType
        - marketSlug
    CancelReplaceCancelResult:
      oneOf:
        - $ref: '#/components/schemas/CancelReplaceCancelSuccess'
        - $ref: '#/components/schemas/CancelReplaceCancelError'
    CancelReplacePlacementResult:
      oneOf:
        - $ref: '#/components/schemas/CancelReplacePlacementSuccess'
        - $ref: '#/components/schemas/CancelReplacePlacementError'
        - $ref: '#/components/schemas/CancelReplacePlacementNotAttempted'
    Order:
      type: object
      properties:
        salt:
          description: >-
            Unique random value for signature uniqueness. Send unsafe integers
            as decimal strings to preserve EIP-712 bytes.
          oneOf:
            - type: string
              pattern: ^\d+$
              example: '1778155025318314496'
            - type: number
              example: 1234567890
        maker:
          type: string
          description: Ethereum address of the maker (order creator)
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
          pattern: ^0x[a-fA-F0-9]{40}$
        signer:
          type: string
          description: Address that signed the order
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
          pattern: ^0x[a-fA-F0-9]{40}$
        taker:
          type: string
          description: Specific taker address (optional for open orders)
          example: '0x0000000000000000000000000000000000000000'
          pattern: ^0x[a-fA-F0-9]{40}$
        tokenId:
          type: string
          description: Token ID being traded (YES or NO position ID from conditional token)
          example: >-
            19633204485790857949828516737993423758628930235371629943999544859324645414627
        makerAmount:
          type: number
          description: >-
            Amount the maker is offering, scaled by 1e6. For GTC orders: price *
            size * 1e6 (BUY) or size * 1e6 (SELL). For FOK orders: USDC to spend
            * 1e6 (BUY) or shares to sell * 1e6 (SELL).
          example: 5000000
          minimum: 0
        takerAmount:
          type: number
          description: >-
            Amount the maker wants in return, scaled by 1e6. For GTC orders:
            size * 1e6 (BUY) or price * size * 1e6 (SELL). For FOK orders:
            always 1.
          example: 10000000
          minimum: 0
        expiration:
          type: string
          description: >-
            Order expiration. Must be "0". Non-zero expiration is not currently
            supported and orders signed with a non-zero value are rejected.
          example: '0'
        nonce:
          type: number
          description: >-
            Must be 0. Non-zero nonce is not currently supported and is
            rejected.
          example: 0
        price:
          type: number
          description: >-
            Order price as decimal (0.01-0.99, required for limit-like GTC/FAK
            orders)
          example: 0.75
          minimum: 0.01
          maximum: 0.99
        feeRateBps:
          type: number
          description: Fee rate in basis points (1% = 100)
          example: 0
        side:
          type: number
          description: 'Order side: 0 = BUY, 1 = SELL'
          enum:
            - 0
            - 1
          example: 0
        signature:
          type: string
          description: >-
            EIP-712 signature of order details as a 0x-prefixed hex string with
            full-byte (even) length. Optional when using delegated signing.
          pattern: ^0x([a-fA-F0-9]{2})*$
          example: >-
            0x123abc456def789ghi0123abc456def789ghi0123abc456def789ghi0123456789012345678901
        signatureType:
          type: number
          description: Signature type (0-3). Optional when using delegated signing.
          enum:
            - 0
            - 1
            - 2
            - 3
          example: 2
      required:
        - salt
        - maker
        - signer
        - tokenId
        - makerAmount
        - takerAmount
        - feeRateBps
        - side
        - signature
        - signatureType
    CancelReplaceCancelSuccess:
      type: object
      properties:
        status:
          type: string
          enum:
            - SUCCESS
        orderId:
          type: string
          format: uuid
        clientOrderId:
          type: string
      required:
        - status
        - orderId
    CancelReplaceCancelError:
      type: object
      properties:
        status:
          type: string
          enum:
            - FAILURE
            - UNKNOWN
        error:
          $ref: '#/components/schemas/CancelReplaceError'
      required:
        - status
        - error
    CancelReplacePlacementSuccess:
      type: object
      properties:
        status:
          type: string
          enum:
            - SUCCESS
        data:
          $ref: '#/components/schemas/OrderResponseDto'
      required:
        - status
        - data
    CancelReplacePlacementError:
      type: object
      properties:
        status:
          type: string
          enum:
            - FAILURE
            - UNKNOWN
        error:
          $ref: '#/components/schemas/CancelReplaceError'
      required:
        - status
        - error
    CancelReplacePlacementNotAttempted:
      type: object
      properties:
        status:
          type: string
          enum:
            - NOT_ATTEMPTED
      required:
        - status
    CancelReplaceError:
      type: object
      properties:
        code:
          type: string
          example: ORDER_NOT_FOUND
        message:
          type: string
          example: Order not found
      required:
        - code
        - message
    OrderResponseDto:
      type: object
      properties:
        order:
          $ref: '#/components/schemas/CreatedOrderDto'
          description: Order details including slim market and owner
        makerMatches:
          description: Maker matches if order was matched immediately
          type: array
          items:
            $ref: '#/components/schemas/MakerMatch'
        execution:
          $ref: '#/components/schemas/OrderExecutionDto'
          description: Execution and settlement summary
      required:
        - order
        - execution
    CreatedOrderDto:
      type: object
      description: >-
        Created order as returned by the API. Large numeric fields (`salt`,
        `makerAmount`, `takerAmount`, `nonce`, `price`) are serialized as
        decimal strings to preserve precision.
      properties:
        id:
          type: string
          format: uuid
          description: Internal order ID
        salt:
          type: string
          description: Order salt as decimal string
          example: '1778155025318314496'
        maker:
          type: string
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
        signer:
          type: string
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
        taker:
          type: string
          nullable: true
          example: '0x0000000000000000000000000000000000000000'
        tokenId:
          type: string
          example: >-
            19633204485790857949828516737993423758628930235371629943999544859324645414627
        makerAmount:
          type: string
          description: Maker amount as decimal string (scaled by 1e6)
          example: '5000000'
        takerAmount:
          type: string
          description: Taker amount as decimal string (scaled by 1e6)
          example: '10000000'
        expiration:
          type: string
          nullable: true
          description: Always "0". Non-zero expiration is not currently supported.
          example: '0'
        signatureType:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
          example: 2
        nonce:
          type: string
          nullable: true
          description: Always "0". Non-zero nonce is not currently supported.
          example: '0'
        feeRateBps:
          type: integer
          nullable: true
          example: 0
        signature:
          type: string
          pattern: ^0x([a-fA-F0-9]{2})*$
        orderType:
          type: string
          enum:
            - GTC
            - FAK
            - FOK
          example: GTC
        price:
          type: string
          nullable: true
          description: Order price as decimal string (0.01-0.99)
          example: '0.75'
        side:
          type: integer
          enum:
            - 0
            - 1
          description: 0 = BUY, 1 = SELL
          example: 0
        marketId:
          type: string
          description: Internal market identifier
        ownerId:
          type: integer
          description: Profile ID of the order owner
          example: 12345
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        market:
          type: object
          description: Slim market info
          properties:
            id:
              type: integer
              example: 7348
            slug:
              type: string
              example: btc-up-or-down-1-hour
            title:
              type: string
              example: BTC Up or Down - Hourly
            status:
              type: string
              enum:
                - FUNDED
                - RESOLVED
                - LOCKED
                - DRAFT
                - FUNDED_FLAGGED
            yesPositionId:
              type: string
              nullable: true
            noPositionId:
              type: string
              nullable: true
            group:
              type: object
              nullable: true
              properties:
                id:
                  type: integer
                slug:
                  type: string
                title:
                  type: string
        owner:
          type: object
          nullable: true
          description: Public profile of the order owner
          properties:
            id:
              type: integer
            account:
              type: string
              description: Checksummed wallet address
            displayName:
              type: string
              nullable: true
            username:
              type: string
              nullable: true
            imageURI:
              type: string
              nullable: true
      required:
        - id
        - salt
        - maker
        - signer
        - tokenId
        - makerAmount
        - takerAmount
        - signatureType
        - signature
        - orderType
        - side
        - marketId
        - ownerId
        - createdAt
        - market
    MakerMatch:
      type: object
      properties: {}
    OrderExecutionDto:
      type: object
      description: Execution and settlement summary for a created order
      properties:
        matched:
          type: boolean
          description: Whether the order was matched immediately
          example: true
        settlementStatus:
          type: string
          description: >-
            Current settlement status of the order. DELAYED means the order was
            accepted but is held by a per-market taker delay before being
            released to the matching engine. CANCELED with reason
            STP_TAKER_REJECTED means self-trade prevention (cancel_taker /
            cancel_both) rejected the incoming order.
          enum:
            - UNMATCHED
            - MATCHED
            - MINED
            - CONFIRMED
            - RETRYING
            - FAILED
            - DELAYED
            - CANCELED
          example: MINED
        reason:
          type: string
          nullable: true
          description: >-
            Reason the order was canceled. STP_TAKER_REJECTED when self-trade
            prevention rejected the incoming order. Present only when
            settlementStatus is CANCELED.
          enum:
            - STP_TAKER_REJECTED
          example: STP_TAKER_REJECTED
        eligibleAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO-8601 time a delayed (taker-delay) order is released to the
            matching engine. Present only when settlementStatus is DELAYED.
          example: '2026-06-08T10:15:30.000Z'
        tradeEventId:
          type: string
          description: Trade event ID (present when matched)
          example: 4aa706dd-6c57-4f3c-945a-99818dfd95f1
        txHash:
          type: string
          description: On-chain transaction hash (present when mined)
          example: '0xabc123'
          nullable: true
        clientOrderId:
          type: string
          description: Echo of client-provided idempotency key
          example: client-order-001
        stpMakerCancels:
          type: array
          description: >-
            Resting order IDs canceled by self-trade prevention (cancel_maker /
            cancel_both)
          items:
            type: string
          example:
            - 4aa706dd-6c57-4f3c-945a-99818dfd95f1
        feeRateBps:
          type: number
          description: Fee rate in basis points applied to this order
          example: 25
        effectiveFeeBps:
          type: number
          description: Effective fee rate in basis points after any rebates
          example: 26
        totalsRaw:
          $ref: '#/components/schemas/OrderExecutionTotalsRawDto'
      required:
        - matched
        - settlementStatus
        - feeRateBps
        - effectiveFeeBps
        - totalsRaw
    OrderExecutionTotalsRawDto:
      type: object
      description: Raw execution totals in contract units (strings to preserve precision)
      properties:
        contractsGross:
          type: string
          example: '1000000'
        contractsFee:
          type: string
          example: '1000'
        contractsNet:
          type: string
          example: '999000'
        usdGross:
          type: string
          example: '500000'
        usdFee:
          type: string
          example: '500'
        usdNet:
          type: string
          example: '499500'
      required:
        - contractsGross
        - contractsFee
        - contractsNet
        - usdGross
        - usdFee
        - usdNet
  securitySchemes:
    HmacAuth:
      type: apiKey
      in: header
      name: lmts-api-key
      description: >-
        Scoped API token with HMAC-SHA256 signing. Requires three headers:
        lmts-api-key (token ID), lmts-timestamp (ISO-8601), lmts-signature
        (Base64-encoded HMAC). See Authentication docs for details.

````