Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.bayse.markets/llms.txt

Use this file to discover all available pages before exploring further.

New endpoint

Batch amend orders — POST /v1/pm/orders/batch/amend

Modify the price and/or size of up to 20 open CLOB orders in a single round-trip. The natural complement to batch place and batch cancel — designed for market makers running cancel-and-replace ladders who want to keep time priority where possible instead of always going to the tail of the queue.
{
  "items": [
    {
      "orderId": "f6a7b8c9-d0e1-2345-fabc-678901234567",
      "newPrice": 0.50,
      "newSize": 15
    },
    {
      "orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "newPrice": 0.40,
      "newSize": 8
    }
  ]
}
Key behavior:
  • newPrice and newSize are independently optional — supply one or both. The omitted field keeps its current value. Items with neither field are rejected per-item with BAD_REQUEST.
  • Total size, not deltanewSize is the new TOTAL size in the order’s original currency. For partial-filled orders the new remaining becomes newSize − filledSize.
  • Per-item failure isolation — bad items return their own error without aborting siblings. Failures use the same per-item shape as the place/cancel batches.
  • Funding rejection codesINSUFFICIENT_BALANCE (BID amend exceeds wallet) and INSUFFICIENT_SHARES (ASK amend exceeds free shares) surface per-item rather than failing the whole call.
  • Cross-market — items may target orders in different markets and events.
  • Time priority — preserved when the new (price, size) is unchanged or shrunk at the same price level. Price moves go to the new tail.
  • Self-trade prevention — fixed server policy: amend always uses CANCEL_OLDEST to resolve same-user crossers at the new price. The order’s resting stpMode (set at placement) governs matching, not amend. Crossers being amended in the same batch are excluded from the cancel set.
  • Idempotency — supports the standard Idempotency-Key header with the same 24-hour replay semantics as the other batch endpoints.
Requires write authentication. Charged one rate-limit token per item against the write bucket. See Batch amend orders for the full schema and Order lifecycle for the funding and time-priority semantics.

Breaking changes

Batch place + amend max items: 50 → 20

Both POST /v1/pm/orders/batch and POST /v1/pm/orders/batch/amend now accept at most 20 items per call (was 50 for batch place). Larger payloads are rejected with 400 BAD_REQUEST before any items reach the matching engine. The cap on DELETE /v1/pm/orders/batch (batch cancel) is unchanged at 100. Rationale: bound wallet round-trips and DB statement sizes under high-frequency cancel-and-replace ladders. Existing integrations sending up to 20 items per batch are unaffected.

Enhancements

Cancel-and-replace cycle guidance

The Batch orders concept page documents the canonical three-step cycle for re-quoting: cancel → amend → place. Each step’s wallet/balance state is visible to the next, so size-up amends in step 2 can use capacity freed by step 1.

Amend section in order lifecycle

Order lifecycle now describes amend semantics, time-priority preservation, and per-side funding checks.