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

# Batch Actions

> Submit batch actions actions through signed POST /order.

Submit multiple trading actions with one nonce and signature. A batch does not provide a general rollback guarantee. Result rows correspond to execution events, not action-array positions; correlate using order IDs and status tags.

Use the current SDK to sign the complete transaction with a fresh nonce. See
[Transaction Signing](https://docs.bulk.trade/api-reference/signing.md) and the shared
[submission guide](https://docs.bulk.trade/api-reference/placeOrder.md#transaction-envelope). The request
example contains placeholder credentials and an illustrative nonce.

Inspect every [response status](https://docs.bulk.trade/api-reference/placeOrder.md#response-format),
including errors returned with HTTP 200. Later order and fill changes arrive
on the [account stream](https://docs.bulk.trade/api-reference/ws-account.md).

```json Signed request body theme={null}
{
  "actions": [
    {
      "cx": {
        "c": "BTC-USD",
        "oid": "old_order_id_base58"
      }
    },
    {
      "l": {
        "c": "BTC-USD",
        "b": true,
        "px": 99900,
        "sz": 0.05,
        "tif": "GTC",
        "r": false,
        "i": false
      }
    },
    {
      "l": {
        "c": "BTC-USD",
        "b": false,
        "px": 100100,
        "sz": 0.05,
        "tif": "GTC",
        "r": false,
        "i": false
      }
    }
  ],
  "nonce": "1704067200000000000",
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7s...base58..."
}
```


## OpenAPI

````yaml api-reference/trading/openapi-batch-actions.yaml POST /order
openapi: 3.0.3
info:
  title: Bulk Trading — Batch Actions
  version: 1.0.0
servers:
  - url: https://mainnet-api1.bulk.trade/api/v1
    description: Mainnet (Primary)
  - url: https://exchange-api.bulk.trade/api/v1
    description: Testnet
security: []
paths:
  /order:
    post:
      tags:
        - Trading (Signed)
      summary: Batch Actions
      description: >-
        Submit a signed transaction to the shared POST /order endpoint. Use the
        SDK and canonical signing guide; illustrative signatures and nonces are
        not executable.
      operationId: submitBatchActions
      parameters:
        - in: header
          name: x-bulk-sig-mode
          required: false
          description: >
            Signature-mode hint. Raw tries only raw; omission tries raw then
            base58. Offchain and base58 hints try that mode first, then the
            other supported modes.

            Omit to use the default raw canonical-binary verification path. Set
            to `offchain` when the

            transaction was signed using the [v0 Solana offchain
            envelope](/api-reference/signing#offchain-signing-mode).
          schema:
            type: string
            enum:
              - raw
              - offchain
              - base58
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FocusedTransaction'
            example:
              actions:
                - cx:
                    c: BTC-USD
                    oid: old_order_id_base58
                - l:
                    c: BTC-USD
                    b: true
                    px: 99900
                    sz: 0.05
                    tif: GTC
                    r: false
                    i: false
                - l:
                    c: BTC-USD
                    b: false
                    px: 100100
                    sz: 0.05
                    tif: GTC
                    r: false
                    i: false
              nonce: '1704067200000000000'
              account: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
              signer: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
              signature: 5j7s...base58...
      responses:
        '200':
          description: >-
            Execution results. HTTP 200 alone is not success; inspect status and
            each statuses entry.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - response
                description: >-
                  Signed transaction result. Status rows describe execution
                  events, not action-array positions.
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                      - error
                    description: >-
                      Top-level status (ok when request was accepted; check each
                      item in statuses for per-action result)
                  response:
                    type: object
                    required:
                      - type
                      - data
                    properties:
                      type:
                        type: string
                        description: Always "order"
                      data:
                        type: object
                        required:
                          - statuses
                        properties:
                          statuses:
                            type: array
                            description: One status object per execution event
                            items:
                              oneOf:
                                - title: resting
                                  type: object
                                  description: >-
                                    Order placed and resting on book
                                    (non-terminal)
                                  properties:
                                    resting:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: working
                                  type: object
                                  description: >-
                                    Order resting with partial fills
                                    (non-terminal)
                                  properties:
                                    working:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        filledSz:
                                          type: number
                                          description: >-
                                            Filled size so far (signed; negative for
                                            sell-side)
                                        remainingSz:
                                          type: number
                                          description: >-
                                            Remaining size (signed; negative for
                                            sell-side)
                                        vwap:
                                          type: number
                                          description: Volume-weighted average price
                                - title: filled
                                  type: object
                                  description: Order fully filled (terminal)
                                  properties:
                                    filled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        totalSz:
                                          type: number
                                          description: >-
                                            Total filled size (signed; negative for
                                            sell-side)
                                        avgPx:
                                          type: number
                                          description: Average fill price (VWAP)
                                - title: partiallyFilled
                                  type: object
                                  description: Order partially filled and terminal
                                  properties:
                                    partiallyFilled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        totalSz:
                                          type: number
                                          description: >-
                                            Total filled size (signed; negative for
                                            sell-side)
                                        avgPx:
                                          type: number
                                          description: Average fill price (VWAP)
                                - title: cancelled
                                  type: object
                                  description: Order cancelled by user
                                  properties:
                                    cancelled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: cancelledRiskLimit
                                  type: object
                                  description: Cancelled due to risk limit violation
                                  properties:
                                    cancelledRiskLimit:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: cancelledSelfCrossing
                                  type: object
                                  description: Cancelled due to self-crossing (STP)
                                  properties:
                                    cancelledSelfCrossing:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: cancelledReduceOnly
                                  type: object
                                  description: Cancelled - would not reduce position
                                  properties:
                                    cancelledReduceOnly:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: cancelledIoc
                                  type: object
                                  description: IOC expired without full fill
                                  properties:
                                    cancelledIoc:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        filledSz:
                                          type: number
                                          description: >-
                                            Size filled before expiry (signed;
                                            negative for sell-side)
                                - title: rejectedCrossing
                                  type: object
                                  description: Post-only rejected for crossing
                                  properties:
                                    rejectedCrossing:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: rejectedDuplicate
                                  type: object
                                  description: Duplicate order ID
                                  properties:
                                    rejectedDuplicate:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: rejectedRiskLimit
                                  type: object
                                  description: Rejected due to risk limit on submission
                                  properties:
                                    rejectedRiskLimit:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: rejectedInvalid
                                  type: object
                                  description: Invalid order parameters
                                  properties:
                                    rejectedInvalid:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: deposit
                                  type: object
                                  description: Faucet deposit succeeded
                                  properties:
                                    deposit:
                                      type: object
                                      properties:
                                        amount:
                                          type: number
                                - title: depositFailed
                                  type: object
                                  description: Faucet deposit failed
                                  properties:
                                    depositFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: agentWallet
                                  type: object
                                  description: Agent wallet registered
                                  properties:
                                    agentWallet:
                                      type: object
                                      properties:
                                        agent_wallet:
                                          type: string
                                - title: agentWalletFailed
                                  type: object
                                  description: Agent wallet operation failed
                                  properties:
                                    agentWalletFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: cancelOneRejected
                                  type: object
                                  description: Single cancel rejected
                                  properties:
                                    cancelOneRejected:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                        reason:
                                          type: string
                                - title: cancelAllRejected
                                  type: object
                                  description: Cancel-all rejected
                                  properties:
                                    cancelAllRejected:
                                      type: object
                                      properties:
                                        reason:
                                          type: string
                                - title: triggered
                                  type: object
                                  description: Conditional root fired (non-terminal)
                                  properties:
                                    triggered:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: siblingCancelled
                                  type: object
                                  description: OCO sibling auto-cancelled
                                  properties:
                                    siblingCancelled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: triggerFailed
                                  type: object
                                  description: Trigger execution failed
                                  properties:
                                    triggerFailed:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: transfer
                                  type: object
                                  description: Margin transfer succeeded
                                  properties:
                                    transfer:
                                      type: object
                                      properties:
                                        from:
                                          type: string
                                          description: Source account pubkey (base58)
                                        to:
                                          type: string
                                          description: Destination account pubkey (base58)
                                        symbol:
                                          type: string
                                          description: Margin asset symbol
                                        amount:
                                          type: number
                                - title: transferFailed
                                  type: object
                                  description: Margin transfer failed
                                  properties:
                                    transferFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: createSubAccount
                                  type: object
                                  description: Sub-account creation succeeded
                                  properties:
                                    createSubAccount:
                                      type: object
                                      properties:
                                        master:
                                          type: string
                                          description: Owning master account pubkey (base58)
                                        sub:
                                          type: string
                                          description: >-
                                            Newly created sub-account pubkey
                                            (base58)
                                        name:
                                          type: string
                                          description: Display name
                                        margin:
                                          type: number
                                          description: >-
                                            Initial margin transferred from master
                                            at creation (0 when none requested)
                                - title: createSubAccountFailed
                                  type: object
                                  description: Sub-account creation failed
                                  properties:
                                    createSubAccountFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: removeSubAccount
                                  type: object
                                  description: >-
                                    Sub-account removal succeeded; remaining
                                    margin is swept back to master
                                  properties:
                                    removeSubAccount:
                                      type: object
                                      properties:
                                        account:
                                          type: string
                                          description: Removed sub-account pubkey (base58)
                                        marginMoved:
                                          type: number
                                          description: >-
                                            Margin amount returned to the master
                                            account
                                - title: removeSubAccountFailed
                                  type: object
                                  description: Sub-account removal failed
                                  properties:
                                    removeSubAccountFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: renameSubAccount
                                  type: object
                                  description: Sub-account rename succeeded
                                  properties:
                                    renameSubAccount:
                                      type: object
                                      properties:
                                        master:
                                          type: string
                                          description: Owning master account pubkey (base58)
                                        account:
                                          type: string
                                          description: >-
                                            Sub-account pubkey that was renamed
                                            (base58)
                                        name:
                                          type: string
                                          description: New display name
                                - title: renameSubAccountFailed
                                  type: object
                                  description: Sub-account rename failed
                                  properties:
                                    renameSubAccountFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: error
                                  type: object
                                  description: Generic error
                                  properties:
                                    error:
                                      type: object
                                      properties:
                                        message:
                                          type: string
              examples:
                executionResult:
                  summary: Illustrative execution result
                  value:
                    status: ok
                    response:
                      type: order
                      data:
                        statuses:
                          - cancelled:
                              oid: old_order_id_base58
                          - resting:
                              oid: Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F
                authBadSignature:
                  summary: 'Authentication failure: bad signature (HTTP 200)'
                  value:
                    status: error
                    response:
                      type: order
                      data:
                        statuses:
                          - error:
                              message: bad signature
                authUnauthorizedSigner:
                  summary: 'Authentication failure: unauthorized signer (HTTP 200)'
                  value:
                    status: error
                    response:
                      type: order
                      data:
                        statuses:
                          - error:
                              message: unauthorized signer
        '408':
          description: >-
            Response timeout (60 seconds for orders, 5 seconds for current-state
            snapshot requests). An order may still execute; reconcile before
            submitting a replacement.
        '429':
          description: >-
            Request or action rate limit reached. Back off before retrying; the
            body may be plain text or empty.
        '500':
          description: Internal endpoint error - Database or channel error
        '503':
          description: >-
            API disabled or required data/service unavailable. API_LOCKED uses
            the JSON example; other unavailable responses may be empty.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  error:
                    type: string
              example:
                code: API_LOCKED
                error: api disabled until an admin enables it
components:
  schemas:
    FocusedTransaction:
      type: object
      required:
        - actions
        - nonce
        - account
        - signer
        - signature
      properties:
        actions:
          type: array
          description: Trading actions submitted together; inspect every returned status.
          items:
            oneOf:
              - title: Limit order (l)
                type: object
                description: Place a resting limit order
                required:
                  - l
                properties:
                  l:
                    type: object
                    required:
                      - c
                      - b
                      - px
                      - sz
                      - tif
                      - r
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      b:
                        type: boolean
                        description: true = buy, false = sell
                      px:
                        allOf:
                          - description: >-
                              Decimal quantity or price; canonical binary
                              encoding rounds value × 1e8 to an unsigned 64-bit
                              integer
                            oneOf:
                              - type: number
                              - type: string
                        description: Limit price
                        example: 100000
                      sz:
                        allOf:
                          - 07f11e26-e2dc-4f68-9a73-567de0f0f3fa
                        description: Size / quantity
                        example: 0.1
                      tif:
                        type: string
                        enum:
                          - GTC
                          - IOC
                          - ALO
                          - ALO_SLIDE
                          - ALO_JOIN
                        description: >-
                          GTC may rest; IOC cancels the unfilled remainder; ALO
                          rejects crossing; ALO_SLIDE reprices crossing orders
                          to a non-crossing tick; ALO_JOIN joins the same-side
                          best quote, falling back to Slide
                      r:
                        type: boolean
                        description: Reduce only
                      i:
                        type: boolean
                        description: >
                          Optional, defaults to `false`. `true` routes the order
                          into the per-instrument isolated account under the
                          signing account; `false` keeps base-account routing.

                          The boolean value is included in the signing bytes,
                          including the default `false` when omitted from JSON.
                      builderCode:
                        type: object
                        description: >
                          Optional builder-code fee payload on market, limit,
                          stop, take-profit, range, or trailing orders,
                          including nested orders.

                          The fee is in basis points and must be pre-approved by
                          the account owner.

                          Omit the field when absent; null is rejected. A
                          builder fee anywhere in the action tree selects V3
                          signing for the whole transaction.
                        required:
                          - to
                          - fee
                        properties:
                          to:
                            type: string
                            description: Builder-code recipient public key (base58)
                          fee:
                            type: integer
                            format: int32
                            minimum: 1
                            maximum: 15
                            description: Builder-code fee in basis points
              - title: Market order (m)
                type: object
                description: Execute at market price immediately
                required:
                  - m
                properties:
                  m:
                    type: object
                    required:
                      - c
                      - b
                      - sz
                      - r
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      b:
                        type: boolean
                        description: true = buy, false = sell
                      sz:
                        allOf:
                          - 07f11e26-e2dc-4f68-9a73-567de0f0f3fa
                        description: Size / quantity
                        example: 0.1
                      r:
                        type: boolean
                        description: Reduce only
                      i:
                        type: boolean
                        description: >
                          Optional, defaults to `false`. `true` routes the order
                          into the per-instrument isolated account under the
                          signing account; `false` keeps base-account routing.

                          The boolean value is included in the signing bytes,
                          including the default `false` when omitted from JSON.
                      builderCode: 2bdb6fc7-3414-494e-a4bb-2e6e43da52a6
                      slippage:
                        description: >-
                          Optional adverse execution bound from fair price in
                          basis points; uses the market's configured default
                          when omitted or null. Explicit values require
                          versioned signing.
                        allOf:
                          - 03ae51ab-3194-4fec-82d9-ed0818b049e4
              - title: Modify order (mod)
                type: object
                description: Modify the size of an existing resting order
                required:
                  - mod
                properties:
                  mod:
                    type: object
                    required:
                      - oid
                      - c
                      - sz
                    properties:
                      oid:
                        type: string
                        description: Order ID (base58 hash)
                        example: Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      sz:
                        allOf:
                          - 4faf9422-6be7-43f8-8c01-034cc9296ee2
                        description: New order size
                        example: 0.05
              - title: Cancel order (cx)
                type: object
                description: Cancel a specific order by ID
                required:
                  - cx
                properties:
                  cx:
                    type: object
                    required:
                      - c
                      - oid
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      oid:
                        type: string
                        description: Order ID (base58 hash)
                        example: Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F
              - title: Cancel all (cxa)
                type: object
                description: Cancel all orders (optionally filtered by symbol)
                required:
                  - cxa
                properties:
                  cxa:
                    type: object
                    required:
                      - c
                    properties:
                      c:
                        type: array
                        description: >-
                          Symbols to cancel. Empty array `[]` cancels all
                          symbols.
                        items:
                          type: string
                        example:
                          - BTC-USD
              - title: Stop (st)
                type: object
                description: Place a conditional stop order
                required:
                  - st
                properties:
                  st:
                    type: object
                    required:
                      - c
                      - d
                      - sz
                      - tr
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      d:
                        type: boolean
                        description: >-
                          Trigger direction (`true` = trigger above/equal
                          threshold, `false` = below/equal)
                      sz:
                        allOf:
                          - ce3ca4be-e105-4a5a-bf04-e9a0eda951a1
                        description: Size to execute on trigger
                        example: 0.25
                      tr:
                        allOf:
                          - bfe3f6c4-701f-4119-a858-2dfc6578719e
                        description: Trigger threshold
                        example: 98000
                      lim:
                        allOf:
                          - oneOf:
                              - type: number
                                nullable: true
                              - type: string
                        description: >-
                          Optional triggered limit price. Omit for market-style
                          trigger
                        example: 97950
                      i:
                        type: boolean
                        description: >
                          Optional, defaults to `false`. `true` routes the
                          triggered order into the per-instrument isolated
                          account under the signing account; `false` keeps
                          base-account routing.

                          The boolean value is included in the signing bytes,
                          including the default `false` when omitted from JSON.
                      builderCode: 143d0175-4c40-4967-a820-46630dc5c096
                      slippage:
                        type: number
                        nullable: true
                        description: >-
                          Optional slippage override in basis points for
                          market-style trigger execution
              - title: Take profit (tp)
                type: object
                description: Place a conditional take-profit order
                required:
                  - tp
                properties:
                  tp:
                    type: object
                    required:
                      - c
                      - d
                      - sz
                      - tr
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      d:
                        type: boolean
                        description: >-
                          Trigger direction (`true` = trigger above/equal
                          threshold, `false` = below/equal)
                      sz:
                        allOf:
                          - ce3ca4be-e105-4a5a-bf04-e9a0eda951a1
                        description: Size to execute on trigger
                        example: 0.25
                      tr:
                        allOf:
                          - 62df9d3b-72e3-4925-91e9-ac0e39c9b8d1
                        description: Trigger threshold
                        example: 104000
                      lim:
                        allOf:
                          - 16cdabd8-e938-47d1-bad4-ee7adfae50f5
                        description: >-
                          Optional triggered limit price. Omit for market-style
                          trigger
                        example: 103950
                      i:
                        type: boolean
                        description: >
                          Optional, defaults to `false`. `true` routes the
                          triggered order into the per-instrument isolated
                          account under the signing account; `false` keeps
                          base-account routing.

                          The boolean value is included in the signing bytes,
                          including the default `false` when omitted from JSON.
                      builderCode: 9a4f9ce3-8f69-4383-ac06-60c40df9fb7e
                      slippage:
                        type: number
                        nullable: true
                        description: >-
                          Optional slippage override in basis points for
                          market-style trigger execution
              - title: Range / OCO (rng)
                type: object
                description: Place a range collar (OCO) conditional order
                required:
                  - rng
                properties:
                  rng:
                    type: object
                    required:
                      - c
                      - d
                      - sz
                      - pmin
                      - pmax
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      d:
                        type: boolean
                        description: >-
                          Position direction (`true` = buy/long collar, `false`
                          = sell/short collar)
                      sz:
                        allOf:
                          - f755bcf9-e3d3-41fb-8125-e26d076d44b0
                        description: Size to protect/exit
                        example: 0.5
                      pmin:
                        allOf:
                          - 520a018e-61d9-4608-b4cf-897668a234dc
                        description: Lower trigger threshold
                        example: 96000
                      pmax:
                        allOf:
                          - e021165f-7663-4220-9e9a-2be137fd66f9
                        description: Upper trigger threshold
                        example: 106000
                      lmin:
                        allOf:
                          - a9ff643a-066b-40a8-b3b0-8f0f9a6e8a36
                        description: Optional limit for the lower-trigger leg
                        example: 95950
                      lmax:
                        allOf:
                          - d22c2d40-0f3e-469d-97a9-661deb6d6b5d
                        description: Optional limit for the upper-trigger leg
                        example: 105950
                      i:
                        type: boolean
                        description: >
                          Optional, defaults to `false`. `true` routes the
                          triggered legs into the per-instrument isolated
                          account under the signing account; `false` keeps
                          base-account routing.

                          The boolean value is included in the signing bytes,
                          including the default `false` when omitted from JSON.
                      builderCode: 9aa2eb44-883f-4054-82ba-d453e78d5cb1
                      slSlippage:
                        type: number
                        nullable: true
                        description: >-
                          Optional stop-loss leg market-execution slippage in
                          basis points
                      tpSlippage:
                        type: number
                        nullable: true
                        description: >-
                          Optional take-profit leg market-execution slippage in
                          basis points
              - title: Trigger basket (trig)
                type: object
                description: >-
                  Place a trigger basket order that executes nested actions when
                  threshold is crossed
                required:
                  - trig
                properties:
                  trig:
                    type: object
                    required:
                      - c
                      - d
                      - tr
                      - actions
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      d:
                        type: boolean
                        description: >-
                          Trigger direction (`true` = trigger above/equal
                          threshold, `false` = below/equal)
                      tr:
                        allOf:
                          - 4dec04b0-39f1-4027-ad17-709c88d70051
                        description: Trigger threshold
                        example: 105000
                      actions:
                        type: array
                        description: >
                          Nested actions executed when trigger fires.

                          Allowed today: `m`, `l`, `mod`, `cx`, `cxa`, `st`,
                          `tp`, `rng`, `trl`.
                        items:
                          type: object
                          description: >-
                            Nested action object using the same compact action
                            tags as top-level actions
              - title: Trailing stop (trl)
                type: object
                description: Place a trailing-stop conditional root
                required:
                  - trl
                properties:
                  trl:
                    type: object
                    required:
                      - c
                      - b
                      - sz
                      - trb
                      - stb
                    properties:
                      c:
                        type: string
                        description: Symbol
                        example: BTC-USD
                      b:
                        type: boolean
                        description: >-
                          Protected position direction (`true` = long
                          protection, `false` = short protection)
                      sz:
                        allOf:
                          - 990d1720-c2e8-44b6-9876-c12a9df460ad
                        description: Size to protect/exit
                        example: 0.25
                      trb:
                        type: integer
                        format: int32
                        description: Trailing distance in bps
                        example: 100
                      stb:
                        type: integer
                        format: int32
                        description: Favorable reset step in bps
                        example: 10
                      lim:
                        allOf:
                          - 90640991-0d40-4618-98a1-283ec13eccf6
                        description: >-
                          Optional triggered limit price. Omit for market-style
                          trigger
                        example: null
                      i:
                        type: boolean
                        description: >
                          Optional, defaults to `false`. `true` routes trailing
                          execution into the per-instrument isolated account
                          under the signing account; `false` keeps base-account
                          routing.

                          The boolean value is included in the signing bytes,
                          including the default `false` when omitted from JSON.
                      builderCode: 3fa6271a-47c8-4cd3-aa6c-b340d0be64e0
                      slippage:
                        type: number
                        nullable: true
                        description: >-
                          Optional slippage override in basis points for
                          market-style trigger execution
              - title: On-fill (of)
                type: object
                description: >-
                  Place an embedded market or limit order and register one-shot
                  consequents for its first fill
                required:
                  - of
                properties:
                  of:
                    type: object
                    required:
                      - trigger
                      - actions
                    properties:
                      trigger:
                        type: object
                        description: >
                          Embedded trigger action. Must contain exactly one `m`
                          or `l` action.

                          Nested market and limit orders use their normal `i`
                          and optional `builderCode` fields.
                      actions:
                        type: array
                        description: >
                          One-shot consequents executed on the trigger action's
                          first fill.

                          Allowed today: `m`, `l`, `mod`, `cx`, `cxa`, `st`,
                          `tp`, `rng`, `trig`, `trl`.
                        items:
                          type: object
                          description: >-
                            Nested action object using the same compact action
                            tags as top-level actions
        nonce:
          description: >-
            Fresh Unix nanosecond nonce; use a decimal string to preserve 64-bit
            precision
          oneOf:
            - type: string
              pattern: ^[0-9]+$
            - type: integer
              minimum: 0
        account:
          type: string
          description: >
            Account public key (base58) whose account is being acted on. Must be
            a master pubkey or a sub-account pubkey. Per-instrument isolated
            accounts are managed implicitly via the `i` flag on order actions
            and are never set as `account`.
          example: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
        signer:
          type: string
          description: >
            Signer public key (base58); who is signing. One of:

            - the `account` itself;

            - when `account` is a sub-account: the parent master, or an [agent
            wallet](/api-reference/manageAgentWallet) registered on the parent
            master (automatically authorized for its sub-accounts);

            - an agent wallet registered directly on `account`.
          example: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
        signature:
          type: string
          description: >-
            Base58 Ed25519 signature over canonical version-selected action
            bytes, nonce, account, and network domain. See Transaction Signing
            for raw, base58, and offchain modes.
          example: 5j7sVt3k2YxPqH4w...

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.