place_order, parameterized
by PlaceOrderParams.
PlaceOrderParams
Market order
- Walks the book immediately, taking up to 4 fills per tx (compute-unit cap).
- Any remainder is cancelled, not rested, limit orders are a separate thing.
- Reverts
SlippageExceededif the average fill price exceeds the quote +max_slippage_bps.
Limit order
- If it crosses (the limit price already matches resting orders on the other side), it takes up to 4 fills as a taker and rests the remainder.
- Otherwise, it rests on the book at
price, reservingbaseAmount × price × initialMarginRatio / 10_000of collateral.
Post-only
- If placing the order would cross the book (immediately match as a
taker), the tx reverts with
OrderWouldCross. - Otherwise, rests on the book, guaranteed maker fill semantics.
Direction semantics
Direction::Long = bid = buy = entering a long or closing a short.
Direction::Short = ask = sell = entering a short or closing a long.
Kimia does not distinguish “entering” vs “closing” at the instruction level
the direction simply flips your base_amount. If you’re long 1 SOL and place a
short order of 2 SOL, you end up short 1 SOL. This is called flipping, and
the realized PnL on the closed leg is banked automatically.
Cancel orders
free_collateral immediately.
Limits
| Quantity | Per market |
|---|---|
| Resting bids | 32 |
| Resting asks | 32 |
Fills per place_order | 4 |
| Orders per user | No hard cap; limited by total_reserved_margin ≤ collateral |
OrderbookFull. V2 expands this.
