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

# Update Order Book

> Modify configuration or status of an existing order book

Updates the configuration of an on-chain order book. Use this to pause or resume trading, adjust the fee structure, modify order size constraints, change the matching mode, or reconfigure the price reference layer.

## Authentication

Requires an instance API key with the `trading` service enabled.

## Path Parameters

<ParamField path="orderBookId" type="string" required>
  The order book identifier. Max 100 characters.
</ParamField>

## Request Body

All fields are optional. Only include fields you want to change.

<ParamField body="status" type="string">
  Order book status. One of `ACTIVE`, `PAUSED`, or `CLOSED`. Setting to `PAUSED` stops new order submissions. `CLOSED` permanently deactivates the book.
</ParamField>

<ParamField body="minOrderSize" type="string">
  Updated minimum order size in base units (wei).
</ParamField>

<ParamField body="maxOrderSize" type="string | null">
  Updated maximum order size. Set to `null` to remove the upper limit.
</ParamField>

<ParamField body="tickSize" type="string">
  Updated minimum price increment.
</ParamField>

<ParamField body="makerFeeBps" type="integer">
  Updated maker fee in basis points. 0-1000.
</ParamField>

<ParamField body="takerFeeBps" type="integer">
  Updated taker fee in basis points. 0-1000.
</ParamField>

<ParamField body="allowImport" type="boolean">
  Whether other instances can import this order book.
</ParamField>

### Trading Mode (Hybrid Order Books)

<ParamField body="tradingMode" type="string">
  Matching engine mode. One of `CONTINUOUS`, `PERIODIC_AUCTION`, or `HYBRID`.
</ParamField>

<ParamField body="auctionIntervalSeconds" type="integer">
  Auction clearing interval in seconds. Applies to `PERIODIC_AUCTION` and `HYBRID`. 30-3600. Nullable.
</ParamField>

<ParamField body="hybridSwitchSpreadBps" type="integer">
  Spread threshold in basis points that switches a `HYBRID` book between continuous matching and auction batching. 1-10000. Nullable.
</ParamField>

<ParamField body="auctionRollUnmatched" type="boolean">
  Whether orders left unmatched at the end of an auction roll forward into the next auction.
</ParamField>

<ParamField body="mmMakerRebateBps" type="integer">
  Maker rebate paid to registered market makers, in basis points. -1000 to 1000. Nullable.
</ParamField>

### Price Reference

<ParamField body="priceRefEnabled" type="boolean">
  Enable or disable price reference enforcement.
</ParamField>

<ParamField body="priceRefMode" type="string">
  Source of the reference price. One of `MANUAL`, `STOCK_FEED`, or `EXTERNAL_FEED`.
</ParamField>

<ParamField body="priceRefFeedUrl" type="string">
  Feed endpoint for `EXTERNAL_FEED`. Max 2048 characters. Nullable.
</ParamField>

<ParamField body="priceRefFeedHeaders" type="string">
  Serialized headers sent with the feed request. Max 4096 characters. Nullable.
</ParamField>

<ParamField body="priceRefFeedPath" type="string">
  Path used to extract the price from the feed response. Max 256 characters. Nullable.
</ParamField>

<ParamField body="priceRefEnforcement" type="string">
  Refresh and enforcement cadence. One of `EVERY_TRADE`, `1MIN`, `5MIN`, `10MIN`, `30MIN`, `1HOUR`, `6HOUR`, `12HOUR`, `1DAY`.
</ParamField>

<ParamField body="priceRefSpreadBps" type="integer">
  Allowed band around the reference price, in basis points. 1-10000. Nullable.
</ParamField>

<ParamField body="priceRefHaltOnStale" type="boolean">
  Halt the order book when the reference price is stale.
</ParamField>

<ParamField body="priceRefStaleTolerance" type="integer">
  Maximum reference price age before it is considered stale, in seconds. 60-604800. Nullable.
</ParamField>

<ParamField body="priceRefCircuitBreakerBps" type="integer">
  Circuit breaker threshold in basis points. 10-10000. Nullable.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "status": "PAUSED",
    "makerFeeBps": 5,
    "takerFeeBps": 15,
    "tradingMode": "HYBRID",
    "hybridSwitchSpreadBps": 75,
    "priceRefSpreadBps": 150
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "id": "ob_abc123",
      "status": "PAUSED",
      "makerFeeBps": 5,
      "takerFeeBps": 15,
      "tradingMode": "HYBRID",
      "hybridSwitchSpreadBps": 75,
      "priceRefEnabled": true,
      "priceRefSpreadBps": 150
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-01-15T10:30:00.000Z",
      "instanceId": "inst_abc"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                   | Status | Description                                       |
| ---------------------- | ------ | ------------------------------------------------- |
| `ORDER_BOOK_NOT_FOUND` | 404    | No order book found with this ID in your instance |
| `INVALID_CONFIG`       | 400    | Invalid configuration values                      |
| `VALIDATION_ERROR`     | 400    | Request body failed schema validation             |
