Order sizing defines which quantity a client controls when placing an order. Every OrderIntent.sizing selects exactly one of two alternatives.
Sizing alternatives
| Intent | Meaning | Scale source | Eligible orders |
|---|---|---|---|
base_qty_scaled | Exact gross base quantity submitted for execution | Pair base_quantity_scale | BUY or SELL with any execution type |
max_quote_debit_scaled | Hard all-in quote debit ceiling, including any quote-denominated fee | Pair quote_quantity_scale | BUY Market IOC or BUY Limit IOC |
REST uses the equivalent decimal-string fields baseQty and maxQuoteDebit.
OrderIntent.sizing is a required Protobuf oneof. Treat it as a discriminated union in
application code, not as two unrelated optional values.Exact base quantity
base_qty_scaled controls the gross base quantity sent for execution. It does not describe the net
amount received after fees.
For a BUY with a quote-denominated fee, the account must fund trade notional plus the fee. For a BUY with a base-denominated fee, the fee reduces the base amount received. See Fee Assets.
Maximum quote debit
max_quote_debit_scaled controls the maximum quote amount that can be debited. Polyester resolves
the largest legal, step-aligned gross base quantity that fits inside the ceiling at the protected
price boundary.
The final debit can be lower after a better-priced or partial fill, but it cannot exceed the submitted ceiling. This sizing mode is invalid for SELL, Limit GTC, and Limit FOK orders.
Request examples
{
"order": {
"symbol": "BTC-USDT",
"side": "BUY",
"maxQuoteDebit": "100.00",
"feeAsset": "QUOTE",
"marketIoc": {
"maxSlippageBps": 50
}
}
}This example assumes the Pair's quote quantity scale has already been applied:
{
"order": {
"symbol": "BTC-USDT",
"side": "BUY",
"maxQuoteDebitScaled": "100000000",
"feeAsset": "QUOTE",
"marketIoc": {
"maxSlippageBps": 50
}
}
}Use Scaled Integers to resolve Pair scales and Market Order Price Protection for price-boundary behavior.
Create acknowledgement
CreateOrderResponse acknowledges admission, not execution:
resolved_base_qty_scaledis the authoritative gross base quantity accepted for execution.submitted_max_quote_debit_scaledis present only when quote-budget sizing was submitted.
Do not infer fills from this response. Use order reads and realtime streams for working, filled, canceled, and terminal state.
SBE WebSocket schema version 2
The client-facing SBE CreateOrder command requires sizingKind:
sizingKind | Selected field | Unselected field requirement |
|---|---|---|
BASE_QUANTITY | baseQtyScaled | maxQuoteDebitScaled is null |
MAX_QUOTE_DEBIT | maxQuoteDebitScaled | baseQtyScaled is null |
Successful create acknowledgements expose resolvedBaseQtyScaled and, for quote-budget orders, submittedMaxQuoteDebitScaled.
baseQtyScaled is not sufficient. A zero-initialized or omitted sizingKind is
rejected.Use Preview Order when an integration needs to check an order before submission.