Skip to main content

Submit binary order batch

POST 

/api/v1/bsl/orders/compact

Operational contract​

This is the binary order-entry interface for latency-sensitive signed action batches. Each action inside the batch still carries its own account action signature. Machine auth only authorizes the transport and institutional access.

RequirementValue
Agent typeinstitutional_agent; a standard api_agent is rejected for binary order entry.
Scopesquote for quote/replace, cancel for cancels, read for protected reads.
Transport authSC-Auth-Version: 2 HMAC headers, or a provisioned X-Senticore-Order-Entry-Key where the beta bundle allows it.
BodySDK-encoded binary batch bytes.
Content typePrefer application/x-senticore-order-entry-batch; application/x-senticore-bsl-batch is accepted for existing binary clients.
Response modeStart with X-BSL-Result-Mode: ack and X-Senticore-Response-Mode: detailed.

HTTP 200 means the edge accepted the envelope. It does not guarantee every action made the book. Inspect ok, derivedOrderIds[], actionResults[], receipts, and drop-copy before treating the order as live.

On terminal QuoteReplace completion, derivedOrderIds[] retains one parent correlation slot per action. For QuoteReplace this is the verbatim client-sent parent identity, also exposed as parentOrderId; it is null when absent. No hash or first-child fallback is invented. Child order ids remain hex32. It is not a flattened child list. The complete quoteReplaceLegs table maps original actionIndex and physical legIndex to cancellation and placement outcomes, child ids, terminal quantities, and the original committed cut. Cancel-only legs remain in place with a null placement id. Immediate fills retain their child ids even without an open order. Modes full, compact, and summary return the same terminal assignment. Unknown outcomes require authorized receipt recovery before completion; never invent missing server child ids.

QuoteReplace example payload​

Outcome markets use QuoteReplace and include book. Spot markets use SpotQuoteReplace and omit book.

{
"version": 1,
"actions": [
{
"payload": {
"account": "0x2222222222222222222222222222222222222222",
"nonce": 0,
"nonce_reservation_id": null,
"ts": 1765500000000,
"action": {
"QuoteReplace": {
"market": 1,
"legs": [
{
"cancel_order_id": null,
"book": "YES",
"side": "Bid",
"price": 100000,
"qty": 100000,
"stp_mode": "skip_self",
"time_in_force": "post_only",
"is_market": false,
"reduce_only": false,
"expires_at": null
}
]
}
}
},
"signature": {
"scheme": "EcdsaSecp256k1",
"bytes": ["..."]
}
}
],
"idempotencyKey": "quote-1-yes-bid-0"
}

Expected accepted response​

{
"ok": true,
"ackMode": "ack",
"seqs": [12345],
"derivedOrderIds": [
"0xfeac5884704773dd3150bef258b3f5a139dafaba0bba2190fc9d520b8a505e22"
]
}

Expected risk reject response​

{
"ok": false,
"seqs": [],
"responseMode": "detailed",
"acceptedActions": 0,
"error": "risk approval rejected request: account would exceed available usdc under spot risk: current_required=0 projected_required=10000 available=0",
"actionResults": [
{
"seq": 0,
"status": "rejected",
"rejectCode": "INSUFFICIENT_BALANCE",
"rejectReason": "risk approval rejected request: account would exceed available usdc under spot risk: current_required=0 projected_required=10000 available=0",
"risk": {
"asset": "USDC",
"free": "0",
"locked": "0",
"required": "10000",
"account": "0x2222222222222222222222222222222222222222",
"market": 1,
"book": null
}
}
]
}

For nonce rejects, resync with GET /api/v1/accounts/:engineAccount/bootstrap?fresh=true, use nonceFloor, stay within nonceFloor <= nonce < nonceFloor + nonceWindow, and rebuild plus re-sign the action. Changing only Idempotency-Key cannot fix an action nonce failure.

Canonical binary byte order-entry facade for latency-sensitive quote engines. Each action in the batch still carries a signed action payload. Use an institutional_agent HMAC credential with quote scope, or a provisioned dedicated order-entry connection key where the connectivity bundle allows it. HTTP 200 is an envelope/admission outcome; inspect actionResults[], receipts, streams, and drop-copy for terminal state.

Request​

Responses​

BSL compact batch result