Skip to main content

Order Types

Senticore is designed for professional order handling across spot, binary options, and prediction markets.

Test coverage

Every order type below has dedicated behavior test coverage and is included in continuous integration coverage gating. Randomized sequence fuzzing across supported order types runs regularly, asserting deterministic state across independent engine instances.

Time-in-force

TypeBehavior
GTCRests on the book until filled, cancelled, or expired
IOCFills immediately against available liquidity and cancels the remainder
FOKFills the entire quantity immediately or rejects
Post-onlyRests as maker liquidity; rejects if it would cross the spread

Modifiers

ModifierBehavior
is_marketMarket order; takes available liquidity
reduce_onlyOutcome (YES/NO) markets only: can only reduce an existing position. Rejected on spot markets (reduce_only_invalid_side)
stp_modeSelf-trade prevention behavior
expires_atAuto-cancel timestamp for eligible orders

Self-trade prevention

The engine default is cancel_taker. An account or credential default overrides the engine default, and an explicit per-order stp_mode overrides both.

stp_modeBehavior on an otherwise executable self-cross
cancel_takerPreserve the resting maker; cancel the incoming remainder
cancel_makerCancel the resting self-owned maker and continue matching
rejectReject the incoming action without changing either order
skip_selfSkip self-owned makers and continue to external liquidity

Use the exact lowercase values above on JSON and BSL. FIX tag 7928 and FIXP use the documented numeric mapping. An unsupported value returns the stable invalid_stp_mode cause and the allowed values.

Post-only is evaluated before STP. A crossing post-only order is rejected with post_only_would_cross even when the maker belongs to the same account and the selected STP mode would normally skip or cancel that maker. This preserves the invariant that post-only never removes liquidity.

Conditional orders

Conditional orders trigger child orders based on market conditions.

The TypeScript SDK high-level local-signing helpers currently cover SpotPlaceOrder, OutcomePlaceOrder, Cancel, AmendOrder, SpotQuoteReplace, and QuoteReplace. Advanced algo and conditional actions are available as raw signed HTTP/BSL actions where enabled; construct and sign the raw action payload shown in Raw actions instead of calling non-existent sdk.placeAlgoOrder or sdk.placeConditionalOrder helpers.

Stop loss

{
"PlaceConditionalOrder": {
"market": 1,
"book": "YES",
"side": "Ask",
"qty": 100000,
"limit_price": 600000,
"trigger_price": 610000,
"trigger_direction": "at_or_below",
"conditional_kind": "stop_loss",
"reduce_only": true,
"signed_trigger_order": {
"payload": { "...": "pre-signed child order payload" },
"signature": { "scheme": "EcdsaSecp256k1", "bytes": [1, 2, 3] }
}
}
}
DirectionUse case
at_or_belowSell-side stop for downside protection
at_or_aboveBuy-side stop or short-position protection

Take profit

{
"PlaceConditionalOrder": {
"market": 1,
"book": "YES",
"side": "Ask",
"qty": 100000,
"limit_price": 795000,
"trigger_price": 800000,
"trigger_direction": "at_or_above",
"conditional_kind": "take_profit",
"reduce_only": true,
"signed_trigger_order": {
"payload": { "...": "pre-signed child order payload" },
"signature": { "scheme": "EcdsaSecp256k1", "bytes": [1, 2, 3] }
}
}
}

OCO

One-cancels-other links a take-profit and stop-loss path. Submit the first conditional order, then submit the second with linked_conditional_id set to the returned conditional id. When one triggers, the linked order is cancelled.

Algorithmic orders

Algorithmic orders execute over time according to a strategy.

For spot algo orders, omit book (or send null) and use the spot market id; YES/NO is outcome-market routing only. Conditional orders in the current raw schema remain outcome-book based and must not be presented as generic spot conditional orders.

Iceberg

{
"PlaceAlgoOrder": {
"market": 1,
"book": "YES",
"side": "Bid",
"total_qty": 1000000,
"limit_price": 510000,
"strategy": {
"kind": "iceberg",
"display_qty": 100000
}
}
}

Behavior:

  • Only the display quantity is visible at a time.
  • A new slice posts as the visible slice fills.
  • Cancelling the parent releases remaining reserved collateral.

TWAP

{
"PlaceAlgoOrder": {
"market": 1,
"book": "YES",
"side": "Bid",
"total_qty": 1000000,
"limit_price": 510000,
"strategy": {
"kind": "twap",
"slice_qty": 100000,
"interval_ms": 60000,
"start_at": 1781190000000
}
}
}

Behavior:

  • Slices are submitted on a fixed interval.
  • The last slice is capped to remaining quantity.
  • A stale or blocked child order prevents uncontrolled order spam.

VWAP

{
"PlaceAlgoOrder": {
"market": 1,
"book": "YES",
"side": "Bid",
"total_qty": 1000000,
"limit_price": 510000,
"strategy": {
"kind": "vwap",
"participation_bps": 1000,
"min_slice_qty": 100000
}
}
}

Behavior:

  • Child size follows recent market volume.
  • participationBps controls the target share of market volume.
  • Execution pauses when observed volume is zero.

Validation rules

RuleBehavior
Price tickPrice must align to the market tick size
Lot sizeQuantity must align to lot size
Max quantityPer-market cap is enforced
Open order capPer-account cap is enforced
Book depth capPrevents unbounded price-level growth
Minimum notionalRejects dust orders

Tick size, lot size, native asset decimals, and minimum notional are market-definition data. Resolve them from GET /api/v1/public/exchange-info; do not copy representative BTC/ETH/SOL values into an order client.

Common rejection reasons

ErrorMeaning
post_only_requires_passive_limit_orderPost-only order is marketable or not a passive limit
post_only_would_crossPost-only order would cross the spread
insufficient_balanceAccount lacks free balance for the order plus fee buffer
book_depth_exceededOrder book depth cap reached
price_level_order_cap_exceededPer-price-level order cap reached
reduce_only_qty_exceeds_positionReduce-only order would increase exposure
reduce_only_invalid_sideReduce-only used on the wrong side or on a spot market