Place a market order
place_market_orderPlace an IOC market order. It executes as an IOC limit at a worst-acceptable price mirrored around the oracle by side — BUY caps ABOVE the oracle, SELL below — at slippageBps distance (default 500 = 5%). Fills happen at book prices; the cap only limits how deep the sweep goes. reduceOnly closes an existing position. Returns confirmation with the REAL outcome verified via the indexer (filled / partially_filled / unfilled / pending): broadcast code: 0 only means the tx was accepted — an IOC order cancels UNFILLED when the book is entirely beyond the slippage cap (thin/spread market). Always report from confirmation.outcome, not code; if unfilled or partially_filled, retry with a larger slippageBps to sweep deeper; if pending, the indexer is lagging — wait a few seconds and re-check before concluding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| size | Yes | Size in base units | |
| market | Yes | Market ticker, e.g. BTC-USD | |
| confirm | No | Verify the real fill via the indexer after broadcast (default true). | |
| clientId | No | ||
| reduceOnly | No | ||
| slippageBps | No | Max slippage vs oracle, in bps (default 500). BUY bounds above the oracle, SELL below; raise to sweep a thin book. |