Skip to main content

Binary Order Entry Order Entry

Orders are signed actions submitted over the TCP connection or as an HTTP byte batch. Use the 20-byte engine account in payload.account, not the 32-byte trading-account id.

Actions​

ActionUse
SpotPlaceOrderSpot order
PlaceOrderOutcome-market order with book YES or NO
CancelCancel by order id
AmendOrderQuantity reduction that keeps queue priority
SpotQuoteReplace, QuoteReplaceAtomic cancel and place of a quote

Other actions, such as deposit credits or market creation, are rejected on this path.

HTTP routes​

RouteUse
POST /api/order-entry/binaryByte batch with a provisioned order-entry key
POST /api/v1/bsl/orders/compactByte batch with HMAC authentication
POST /api/v1/bsl/orders/replaceReplace
POST /api/v1/bsl/orders/cancel-allCancel all, optionally by market, book, side
POST /api/v1/bsl/sessions/cancel-on-disconnectCancel-on-disconnect cleanup
GET /api/v1/bsl/limitsRate limits, batch sizes, nonceModel, errorGuidance
GET /api/v1/bsl/receiptsReceipts by account and seqs

Read GET /api/v1/bsl/limits instead of hard-coding limits. Reference: submit batch, limits, receipts.

POST /api/v1/bsl/orders/compact
Content-Type: application/x-senticore-order-entry-batch
X-BSL-Result-Mode: ack
X-Senticore-Response-Mode: detailed
Idempotency-Key: strategy-42-batch-9001
SC-Auth-Version: 2
SC-Key: <apiKeyId>
SC-Nonce: <fresh nonce>
SC-Timestamp: <unix ms>
SC-Passphrase: <apiPassphrase>
SC-Signature: <hmac>
{ "version": 1, "idempotencyKey": "strategy-42-batch-9001",
"actions": [ { "payload": { "account": "0x1111111111111111111111111111111111111111", "nonce": 4810, "client_order_id": "strategy-42-1", "ts": 1781715570085,
"action": { "PlaceOrder": { "market": 1, "book": "YES", "side": "Bid", "price": 100000, "qty": 1000, "time_in_force": "gtc" } } },
"signature": { "scheme": "EcdsaSecp256k1", "bytes": [ "<65 integers, 0-255: r || s || v>" ] } } ] }

bytes is the 65-byte signature as integers; the example shows a placeholder. client_order_id is optional; when set, it is part of the signed payload. For ack mode each action needs payload (account, nonce, ts, action) and signature. X-BSL-Result-Mode is ack or full; X-Senticore-Response-Mode sets the detail of the response body.

Send the JSON as UTF-8 bytes. Do not use application/json. A missing HMAC or order-entry key authorizes the route only; every action still needs its own valid signature.

Response​

FieldMeaning
okBatch accepted
seqsSequence numbers of accepted actions
derivedOrderIdsOrder ids; derive locally from the signed payload if missing
acceptedActionsNumber of signed parent actions
receiptPathReceipt lookup for seqs

An acknowledgement is not a terminal order state. Reconcile through execution reports, account reads or receipts. Keep the full response body and x-request-id.

Atomic batches​

A batch or group is admitted as one unit. If one leg fails, the whole batch is dropped and the receipt shows status: dropped, applied: false. Common causes: a YES or NO ask without minted shares, too little base asset for a spot ask, or notional below instrumentConfig.minNotionalMicro. Check each leg before submitting a two-sided quote.

Rejects​

RejectMeaningAction
TRADING_HALTEDTrading is haltedPause quoting; check tradingHalted on GET /api/v1/status
403 AGENT_AUTH_FAILEDCredential lacks permissionFix the credential or scope
205Nonce above nonceFloor + 256Re-sign with a nonce from nonceHoles or any unused in-window nonce
415, 400, 413Wrong content type, malformed batch, body too largeFix the request

Transport-level codes are listed in Execution streams and recovery.

Next steps​