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

> Cancels one order and conditionally submits a replacement. Cancellation and replacement have independent outcomes.

Cancel one order and submit its replacement in one request. The two actions are **not atomic**: cancellation and replacement have independent outcomes, and a successful cancellation does not guarantee a successful replacement.

## Request

| Field         | Type     | Description                                                                                                                                |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `cancel`      | `object` | Identifies the order to cancel. Provide exactly one of `orderId` or `clientOrderId`.                                                       |
| `replacement` | `object` | A standard signed order request. It accepts the same fields as [`POST /orders`](/api-reference/trading/create-order), except `onBehalfOf`. |
| `mode`        | `string` | `STOP_ON_FAILURE` or `ALLOW_FAILURE`. Controls whether replacement is attempted after cancellation fails.                                  |
| `onBehalfOf`  | `number` | Optional profile ID for an authorized partner sub-account. Applies to both cancellation and replacement.                                   |

`replacement.ownerId` must own the order being canceled. Put `onBehalfOf` only at the operation level, not inside `replacement`.

### Failure modes

| Mode              | Cancellation fails       | Replacement result                                                                  |
| ----------------- | ------------------------ | ----------------------------------------------------------------------------------- |
| `STOP_ON_FAILURE` | Stops this operation     | `NOT_ATTEMPTED`                                                                     |
| `ALLOW_FAILURE`   | Continues this operation | Placement is attempted and reports `SUCCESS`, `FAILURE`, or `UNKNOWN` independently |

## Authentication and signing

Authentication matches [`POST /orders/cancel`](/api-reference/trading/cancel): HMAC (`apiToken`), Privy, and session authentication are accepted. Programmatic integrations should use a scoped API token with the `trading` scope and HMAC-sign the exact request body and path `/orders/cancel-replace`; see [Authentication](/developers/authentication#hmac-request-signing).

The cancellation itself is not EIP-712 signed. For a direct request, the replacement is a normal order and must contain an [EIP-712 signature](/developers/eip712-signing). The authenticated profile must be a valid signer of the order being canceled.

For an authorized partner sub-account, set the operation-level `onBehalfOf` to the sub-account profile ID and set `replacement.ownerId` to the same ID. This path requires `delegated_signing` in addition to `trading`. If the replacement omits its order signature, the server signs it only for a managed server-wallet sub-account under the existing [delegated signing](/developers/authentication#delegated-signing) rules.

## Example: stop after cancellation failure

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

```json theme={null}
{
  "cancel": {
    "clientOrderId": "old-order-001"
  },
  "replacement": {
    "ownerId": 12345,
    "orderType": "GTC",
    "marketSlug": "btc-100k",
    "clientOrderId": "replacement-001",
    "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"
}
```

If the request passes replacement preflight but `old-order-001` is not found, the response is `409 Conflict`:

```json theme={null}
{
  "cancel": {
    "status": "FAILURE",
    "error": {
      "code": "ORDER_NOT_FOUND",
      "message": "Order not found"
    }
  },
  "replacement": {
    "status": "NOT_ATTEMPTED"
  }
}
```

## Example: allow replacement after cancellation failure

Changing `mode` to `ALLOW_FAILURE` attempts the same replacement even if cancellation fails. A failed cancellation with an accepted replacement still returns `409 Conflict` because the complete cancel-and-replace operation did not succeed:

```json theme={null}
{
  "cancel": {
    "status": "FAILURE",
    "error": {
      "code": "ORDER_NOT_FOUND",
      "message": "Order not found"
    }
  },
  "replacement": {
    "status": "SUCCESS",
    "data": {
      "order": {
        "id": "9e31c452-8a2b-42d1-b327-65f18d07dc96"
      },
      "makerMatches": [],
      "execution": {
        "matched": false,
        "settlementStatus": "UNMATCHED",
        "clientOrderId": "replacement-001",
        "feeRateBps": 0,
        "effectiveFeeBps": 0,
        "totalsRaw": {
          "contractsGross": "0",
          "contractsFee": "0",
          "contractsNet": "0",
          "usdGross": "0",
          "usdFee": "0",
          "usdNet": "0"
        }
      }
    }
  }
}
```

## Response semantics

`cancel.status` can be `SUCCESS`, `FAILURE`, or `UNKNOWN`. `replacement.status` can be `SUCCESS`, `FAILURE`, `UNKNOWN`, or `NOT_ATTEMPTED`.

| Outcome                                                                    | HTTP status    |
| -------------------------------------------------------------------------- | -------------- |
| Cancellation and replacement are both `SUCCESS`                            | `200 OK`       |
| Cancellation fails under `STOP_ON_FAILURE`; replacement is `NOT_ATTEMPTED` | `409 Conflict` |
| Cancellation fails under `ALLOW_FAILURE`; replacement is `SUCCESS`         | `409 Conflict` |
| The service returns any other non-success top-level result                 | `409 Conflict` |

Request-level errors are separate from these operation results. Authentication, authorization, scope, body validation, replacement preflight, receive-window, and unexpected server errors return their ordinary HTTP error status instead of a cancel/replace result.

<Warning>
  `replacement.status: "SUCCESS"` means the order matching engine accepted the placement. It does not guarantee on-chain settlement. A matched replacement remains top-level `SUCCESS` when `replacement.data.execution.settlementStatus` is `FAILED`; the settlement failure and `reason` remain nested under `execution`. There is no top-level `SETTLEMENT_FAILED` replacement status.
</Warning>


## OpenAPI

````yaml POST /orders/cancel-replace
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:
    post:
      tags:
        - Trading
      summary: Cancel an order and place a replacement non-atomically
      description: >-
        Cancels one order and conditionally submits a replacement. Cancellation
        and replacement have independent outcomes.
      operationId: OrderController_cancelReplace
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelReplaceDto'
      responses:
        '200':
          description: Cancellation and replacement both succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelReplaceResponseDto'
              example:
                cancel:
                  status: SUCCESS
                  orderId: 6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203
                  clientOrderId: old-order-001
                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-001
                      feeRateBps: 0
                      effectiveFeeBps: 0
                      totalsRaw:
                        contractsGross: '0'
                        contractsFee: '0'
                        contractsNet: '0'
                        usdGross: '0'
                        usdFee: '0'
                        usdNet: '0'
        '400':
          description: Invalid request or replacement preflight failed
        '401':
          description: >-
            Authentication failed or caller is not authorized to cancel the
            order
        '403':
          description: Required scope or delegated-owner authorization is missing
        '404':
          description: A required preflight resource was not found
        '409':
          description: Cancellation or replacement did not succeed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelReplaceResponseDto'
              examples:
                stopOnFailure:
                  summary: Cancellation failed and replacement was not attempted
                  value:
                    cancel:
                      status: FAILURE
                      error:
                        code: ORDER_NOT_FOUND
                        message: Order not found
                    replacement:
                      status: NOT_ATTEMPTED
                allowFailure:
                  summary: Cancellation failed but replacement was accepted
                  value:
                    cancel:
                      status: FAILURE
                      error:
                        code: ORDER_NOT_FOUND
                        message: Order not found
                    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-001
                          feeRateBps: 0
                          effectiveFeeBps: 0
                          totalsRaw:
                            contractsGross: '0'
                            contractsFee: '0'
                            contractsNet: '0'
                            usdGross: '0'
                            usdFee: '0'
                            usdNet: '0'
        '425':
          description: >-
            Replacement receive-window check failed or trading mode blocks the
            replacement
        '500':
          description: Unexpected server error
      security:
        - HmacAuth: []
components:
  schemas:
    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.

````