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.

AMM orders

AMM orders execute instantly at the calculated price.

CLOB orders

CLOB orders support different execution strategies through time-in-force options.

Time-in-force options

  • GTC (Good Till Cancel) — stays on the book until filled or manually cancelled. Default for limit orders.
  • FAK (Fill and Kill) — execute as much as possible immediately, cancel any unfilled portion.
  • FOK (Fill or Kill) — execute entirely or cancel completely. No partial fills.
  • GTD (Good Till Date) — remains active until a specified expiry time.

Order types

  • Limit orders — specify the max price you’ll pay (buy) or min price you’ll accept (sell). Execute at your price or better.
  • Market orders — execute immediately at the best available price.

Order statuses

  1. pending — order received and being validated.
  2. open — active on the book, waiting for matches.
  3. partial_filled — some shares executed, remainder still on book (GTC/GTD only).
  4. filled — completely executed.
  5. cancelled — cancelled by user or system.
  6. rejected — failed validation.
  7. expired — GTD order reached expiry time without filling.

Amending an open order

CLOB orders in open or partial_filled status can have their price, their size, or both mutated in place via batch amend. The order keeps its identity (orderId stays the same) and its current filledSize — the new size is the new TOTAL, so the new remaining becomes newSize − filledSize.
  • Independently optional fields — supply newPrice only, newSize only, or both. The omitted field keeps its current value. Items with neither field are rejected with BAD_REQUEST.
  • Time priority — preserved when the new (price, size) is unchanged or shrunk at the same price level. A price move (up or down) puts the order at the new tail of the new level, identical to a cancel-and-replace.
  • Funding — BID amends that grow the lock check wallet balance; ASK amends that grow the lock check the user’s free share balance. Either can be rejected per-item with INSUFFICIENT_BALANCE or INSUFFICIENT_SHARES.
  • Self-trade prevention — fixed server policy: any same-user resting crosser at the new price is auto-cancelled (CANCEL_OLDEST). The order’s resting stpMode set at placement governs matching, not amend. Crossers being amended in the same batch are skipped (no self-cancel). If you want an amend to fail rather than cancel a crosser, cancel + re-place instead.
  • Terminal orders — amend is rejected with NOT_FOUND once the order reaches filled, cancelled, expired, or rejected.
  • AMM orders — cannot be amended; cancel and re-place to change price/size.