Expand description
Data types and structures for interacting with the matching engine API.
This module provides all the necessary types for constructing transactions, submitting orders, canceling orders, and handling responses from the matching engine. It includes builder patterns for type-safe construction and comprehensive validation.
Structs§
- Cancel
Order Request - Request to cancel an existing order in the matching engine.
- Cancel
Order Request Builder - Builder pattern implementation for constructing
CancelOrderRequestinstances. - Conditional
- Comprehensive conditional order specification with advanced trading features.
- Conditional
Builder - Builder for constructing
Conditionalorders with a fluent API. - Conditional
Expiry - Defines expiration behavior for conditional orders.
- Conditional
Expiry Builder - Builder for constructing
ConditionalExpiryconfigurations with a fluent API. - Error
- Represents a single error with both numeric code and descriptive string.
- Errors
- A collection of errors that can accumulate during validation or processing.
- Liquidate
Position Request - Liquidate
Position Request Builder - Order
Placed - The order as the matching engine accepted (or rejected) it.
- Orders
Terminated - The orders a cancellation terminated.
- Rate
Limit Info - snapshot of the gateway’s rate-limit state for a single transaction.
always present on a
TransactionReport; clients use it to pace requests without round-tripping/metrics. - SetImr
Request - Request to set the position-level IMR for an account/market.
- SetImr
Request Builder - Submit
Order Request - Complete order submission request with support for all order types and advanced features.
- Submit
Order Request Builder - Builder for constructing
SubmitOrderRequestwith a fluent API. - Switch
ToCross Request - Request to switch a position’s margin mode to cross.
- Switch
ToCross Request Builder - Switch
ToIsolated Request - Request to switch a position’s margin mode to isolated.
- Switch
ToIsolated Request Builder - Trade
Executed - A fill the submitted order took part in.
- Transaction
- A complete transaction with payload and cryptographic signature.
- Transaction
Builder - Builder for constructing
Transactioninstances. - Transaction
Payload - The payload of a transaction containing all transaction data before signing.
- Transaction
Payload Builder - Builder for constructing
TransactionPayloadinstances. - Transaction
Report - A comprehensive report of a transaction containing one or more trading operations.
Enums§
- Cancel
Order Request Builder Error - Errors that can occur when building a
CancelOrderRequestusing the builder pattern. - Command
- Command variants that can be executed within a transaction.
- Conditional
Builder Error - Errors that can occur when building a
Conditionalorder. - Conditional
Expiry Builder Error - Errors that can occur when building a
ConditionalExpiry. - Error
String - Enumeration of all possible error condition descriptions.
- Liquidate
Position Request Builder Error - Order
Error - Specific error conditions that can cause order rejection during processing.
- Order
Status - Current lifecycle state of an order within the matching engine.
- Order
Type - Order execution type determining how orders interact with the market.
- Quantity
- Defines how the quantity for a conditional order should be determined.
- Rejected
By - Report
- A report detailing the outcome of a specific trading operation.
- SetImr
Request Builder Error - Side
- Order direction specifying whether to buy or sell the base asset.
- Submit
Order Request Builder Error - Errors that can occur when building a
SubmitOrderRequest. - Switch
ToCross Request Builder Error - Switch
ToIsolated Request Builder Error - Time
InForce - Time-in-force instructions that control order lifecycle and execution behavior.
- Transaction
Builder Error - Errors that can occur when building a
Transactionusing the builder pattern. - Transaction
Payload Builder Error - Errors that can occur when building a
TransactionPayloadusing the builder pattern. - Trigger
- Defines the trigger mechanism for conditional orders.
Constants§
- ERROR_
ADMIN_ COMMAND_ NOT_ AUTHORIZED_ FOR_ QUORUM - Error 804: the multisig quorum’s name does not authorize this admin command
- ERROR_
ADMIN_ COMMAND_ REQUIRES_ MULTISIG - Error 800: An admin-only command was submitted by a non-multisig owner
- ERROR_
BATCH_ OF_ ONE_ REQUIRED - Error 430: Margin-parameter commands must be alone in the transaction (batch of 1)
- ERROR_
CANCEL_ ORDER_ CONFLICTING_ IDS - Error 204: Order cancellation specified both an order id and a client order id
- ERROR_
CANCEL_ ORDER_ MISSING_ ACCOUNT - Error 203: Order cancellation submitted without specifying an account identifier
- ERROR_
CANCEL_ ORDER_ MISSING_ MARKET - Error 201: Order cancellation submitted without specifying a market identifier
- ERROR_
CANCEL_ ORDER_ UNKNOWN_ MARKET - Error 202: Order cancellation references a market that doesn’t exist
- ERROR_
CHAIN_ ID_ EMPTY - Error 412: the signed payload’s
chain_idis empty — the field was never filled in. - ERROR_
CHAIN_ ID_ MISMATCH - Error 411: the signed payload’s
chain_idnames a different network than the one serving the request. The signature binds the transaction to that other network, so it cannot be admitted here. Read the right value fromreal_chainId. - ERROR_
CONDITIONAL_ INDEX_ REFERENCE_ PRICE_ NOT_ SUPPORTED - Error 126: Index reference price is not supported yet
- ERROR_
CONDITIONAL_ INVALID_ TRIGGER_ PRICE - Error 130: Invalid trigger price format
- ERROR_
CONDITIONAL_ MARK_ REFERENCE_ PRICE_ NOT_ SUPPORTED - Error 127: Mark reference price is not supported yet
- ERROR_
CONDITIONAL_ MISSING_ TRIGGER_ CONDITION - Error 134: Trigger condition was not specified
- ERROR_
CONDITIONAL_ OCO_ NOT_ SUPPORTED - Error 129: OCO (One-Cancels-Other) orders are not supported yet
- ERROR_
CONDITIONAL_ ORDER_ LINKED_ ACTIVATION_ NOT_ SUPPORTED - Error 128: reserved. Order-linked activation is supported today and nothing emits this code; it stays as wire vocabulary for a deployment that disables the feature.
- ERROR_
CONDITIONAL_ ORDER_ LINK_ BOTH_ IDS - Error 145: a linked conditional referenced both a client order id and an order id
- ERROR_
CONDITIONAL_ ORDER_ LINK_ INVALID_ FILL_ QUANTITY - Error 148: the order link fill quantity threshold was not a valid quantity
- ERROR_
CONDITIONAL_ ORDER_ LINK_ MISSING_ FILL_ QUANTITY - Error 147: a linked conditional did not specify a fill quantity threshold
- ERROR_
CONDITIONAL_ ORDER_ LINK_ MISSING_ PARENT - Error 146: a linked conditional did not reference any parent order
- ERROR_
CONDITIONAL_ ORDER_ LINK_ QUANTITY_ NOT_ SUPPORTED - Error 133: Order link quantity is not supported yet
- ERROR_
CONDITIONAL_ ORDER_ MUST_ HAVE_ QUANTITY - Error 136: Conditional orders must have a quantity specified
- ERROR_
CONDITIONAL_ ORDER_ MUST_ NOT_ HAVE_ MAIN_ QUANTITY - Error 135: Conditional orders must not have a quantity in the main order
- ERROR_
CONDITIONAL_ TRAILING_ STOP_ NOT_ SUPPORTED - Error 125: Trailing stop triggers are not supported yet
- ERROR_
CONDITIONAL_ TRIGGER_ PRICE_ MUST_ BE_ POSITIVE - Error 132: Trigger price must be positive
- ERROR_
CONDITIONAL_ TRIGGER_ PRICE_ NOT_ MULTIPLE_ OF_ TICK_ SIZE - Error 141: Trigger price is not a multiple of the market’s tick size
- ERROR_
CONDITIONAL_ TRIGGER_ PRICE_ TOO_ MANY_ DECIMAL_ PLACES - Error 140: Trigger price exceeds the allowed decimal precision
- ERROR_
CONDITIONAL_ TRIGGER_ PRICE_ ZERO - Error 131: Trigger price cannot be zero
- ERROR_
INVALID_ TRANSACTION_ PAYLOAD - Error 401: Transaction payload is malformed or invalid
- ERROR_
LIQUIDATE_ POSITION_ MISSING_ ACCOUNT - ERROR_
LIQUIDATE_ POSITION_ MISSING_ DISTRESSED_ ACCOUNT - ERROR_
LIQUIDATE_ POSITION_ UNKNOWN_ MARKET - ERROR_
MARGIN_ PARAM_ IMR_ ABOVE_ ONE - Error 711: set_imr value exceeds 1.0
- ERROR_
MARGIN_ PARAM_ IMR_ BELOW_ MARKET_ MINIMUM - Error 710: set_imr value is below the market’s minimum IMR
- ERROR_
MARGIN_ PARAM_ IMR_ NOT_ POSITIVE - Error 712: set_imr value must be strictly positive
- ERROR_
MARGIN_ PARAM_ IMR_ TOO_ MANY_ DECIMALS - Error 713: set_imr value has more than 18 decimal places
- ERROR_
MARGIN_ PARAM_ MISSING_ ACCOUNT - Error 703: Margin-parameter command submitted without an account identifier
- ERROR_
MARGIN_ PARAM_ MISSING_ MARKET - Error 701: Margin-parameter command submitted without a market identifier
- ERROR_
MARGIN_ PARAM_ PENDING - Error 720: A previous margin-parameter change for this (account, market) is still pending chain confirmation
- ERROR_
MARGIN_ PARAM_ UNKNOWN_ MARKET - Error 702: Margin-parameter command references a market that doesn’t exist
- ERROR_
NEW_ BLOCK_ COMMAND_ IS_ RESTRICTED - Error 301: New block command is restricted and cannot be executed
- ERROR_
NONCE_ IN_ FUTURE - Error 408: the payload
nonceis further ahead of the sequencer’s clock than the skew allowance. The client’s clock is ahead. - ERROR_
NONCE_ NOT_ SET - Error 410: the payload
noncewas zero, which no clock ever reads — the field was never filled in. Mint it as microseconds since the Unix epoch. - ERROR_
NONCE_ REUSED - Error 409: this owner already used the payload
nonce. Either the transaction is a replay, or two clients are signing with the same key and minted the same microsecond — retry with a fresh nonce. - ERROR_
NONCE_ TOO_ OLD - Error 407: the payload
nonceis older than the replay-protection window, so the sequencer cannot tell a new transaction from a replayed one. Retry with a fresh nonce; if this is persistent, the client’s clock is behind. - ERROR_
PLATFORM_ OFFLINE - Error 902: the platform is in Offline mode
- ERROR_
PLATFORM_ RESTRICTED - Error 901: the platform is in Restricted mode and the sender is not a market maker
- ERROR_
SENDER_ NOT_ ALLOWED - Error 501: The transaction sender is not authorized to perform this operation
- ERROR_
SETTLE_ MARKET_ INVALID_ PRICE - Error 803: settle_market
priceis not a valid decimal - ERROR_
SET_ MARKET_ TRADING_ MODE_ NO_ IMMEDIATE_ PERIOD - Error 802: set_market_trading_mode periods do not begin with an immediate (start_ms == 0) entry
- ERROR_
SET_ MARKET_ TRADING_ MODE_ PAST_ PERIOD - Error 806: set_market_trading_mode nonzero period start_ms is not in the future
- ERROR_
SET_ MARKET_ TRADING_ MODE_ UNSORTED_ PERIODS - Error 805: set_market_trading_mode periods are not strictly ascending by start_ms
- ERROR_
SET_ PLATFORM_ MODE_ UNKNOWN_ MODE - Error 801: set_platform_mode
modeis not one of “online” / “restricted” / “offline” - ERROR_
SUBMIT_ ORDER_ ABOVE_ MAXIMUM_ ORDER_ VALUE - Error 149: Order’s notional value is above the market’s maximum
- ERROR_
SUBMIT_ ORDER_ BELOW_ MINIMUM_ ORDER_ VALUE - Error 143: Order’s notional value is below the market’s minimum
- ERROR_
SUBMIT_ ORDER_ CANNOT_ USE_ ORDER_ LINK_ QUANTITY - Error 116: Order link quantity cannot be used without proper conditional order setup
- ERROR_
SUBMIT_ ORDER_ EXPIRY_ TIMESTAMP_ IN_ THE_ PAST - Error 106: The provided expiry timestamp is in the past
- ERROR_
SUBMIT_ ORDER_ EXPIRY_ TIMESTAMP_ ONLY_ VALID_ FOR_ GTT - Error 142: Expiry timestamp provided for non-GTT time in force
- ERROR_
SUBMIT_ ORDER_ EXPIRY_ TIMESTAMP_ TOO_ FAR_ IN_ FUTURE - Error 150: expiry timestamp is beyond the latest supported date
- ERROR_
SUBMIT_ ORDER_ INVALID_ ORDER_ PRICE_ ZERO - Error 112: Order price cannot be zero
- ERROR_
SUBMIT_ ORDER_ INVALID_ ORDER_ QUANTITY - Error 118: The provided quantity is in an invalid format
- ERROR_
SUBMIT_ ORDER_ INVALID_ ORDER_ QUANTITY_ ZERO - Error 119: Order quantity cannot be zero
- ERROR_
SUBMIT_ ORDER_ INVALID_ PERCENTAGE_ OF_ POSITION_ QUANTITY - Error 122: The percentage of position quantity is in an invalid format
- ERROR_
SUBMIT_ ORDER_ INVALID_ PRICE - Error 111: The provided price is in an invalid format
- ERROR_
SUBMIT_ ORDER_ MARK_ PRICE_ UNAVAILABLE - Error 144: Market order rejected — no current mark price
- ERROR_
SUBMIT_ ORDER_ MISSING_ ACCOUNT - Error 123: Account identifier was not provided
- ERROR_
SUBMIT_ ORDER_ MISSING_ EXPIRY_ TIMESTAMP_ FOR_ GTT_ TIME_ IN_ FORCE - Error 105: Good-Till-Time orders require an expiry timestamp
- ERROR_
SUBMIT_ ORDER_ MISSING_ MARKET - Error 101: Order submitted without specifying a market identifier
- ERROR_
SUBMIT_ ORDER_ MISSING_ ORDER_ QUANTITY - Error 117: Order quantity was not provided (duplicate of 115)
- ERROR_
SUBMIT_ ORDER_ MISSING_ ORDER_ TYPE - Error 108: Order submitted without specifying order type (market/limit)
- ERROR_
SUBMIT_ ORDER_ MISSING_ PRICE_ FOR_ LIMIT_ ORDER - Error 110: Limit orders require a price to be specified
- ERROR_
SUBMIT_ ORDER_ MISSING_ QUANTITY - Error 115: Order quantity was not provided
- ERROR_
SUBMIT_ ORDER_ MISSING_ SIDE - Error 103: Order submitted without specifying buy/sell side
- ERROR_
SUBMIT_ ORDER_ MISSING_ TIME_ IN_ FORCE - Error 104: Order submitted without specifying time in force
- ERROR_
SUBMIT_ ORDER_ PERSISTENT_ MARKET_ ORDER - Error 124: Persistent order for market order
- ERROR_
SUBMIT_ ORDER_ POST_ ONLY_ MUST_ BE_ PERSISTING - Error 107: Post-only orders must have a persisting time in force
- ERROR_
SUBMIT_ ORDER_ PRICE_ MUST_ BE_ POSITIVE - Error 113: Order price must be a positive value
- ERROR_
SUBMIT_ ORDER_ PRICE_ NOT_ MULTIPLE_ OF_ TICK_ SIZE - Error 138: Order price is not a multiple of the market’s tick size
- ERROR_
SUBMIT_ ORDER_ PRICE_ TOO_ MANY_ DECIMAL_ PLACES - Error 114: Order price exceeds the allowed decimal precision
- ERROR_
SUBMIT_ ORDER_ QUANTITY_ MUST_ BE_ POSITIVE - Error 120: Order quantity must be a positive value
- ERROR_
SUBMIT_ ORDER_ QUANTITY_ NOT_ IN_ RANGE - Error 139: Percentage of position quantity must be between 0 and 1
- ERROR_
SUBMIT_ ORDER_ QUANTITY_ NOT_ MULTIPLE_ OF_ LOT_ SIZE - Error 137: Order quantity is not a multiple of the market’s lot size
- ERROR_
SUBMIT_ ORDER_ QUANTITY_ TOO_ MANY_ DECIMAL_ PLACES - Error 121: Order quantity exceeds the allowed decimal precision
- ERROR_
SUBMIT_ ORDER_ UNEXPECTED_ PRICE_ FOR_ MARKET_ ORDER - Error 109: Market orders should not include a price parameter
- ERROR_
SUBMIT_ ORDER_ UNKNOWN_ MARKET - Error 102: Order references a market that doesn’t exist or is not available
- ERROR_
TRANSACTION_ INVALID_ SIGNATURE - Error 403: Transaction signature verification failed
- ERROR_
TRANSACTION_ PAYLOAD_ INVALID_ BASE64 - Error 402: Transaction payload is not valid base64 encoding
- ERROR_
UNKNOWN_ TRANSACTION_ VERSION - Error 405: Transaction
versionis not a known value - ERROR_
V2_ REQUIRES_ SIGNER - Error 404: V2 transaction envelope is missing the required
signerfield - ERROR_
V2_ SIGNER_ NOT_ OWNER - Error 406: the V2 envelope
signeris not entitled to the payloadowner— it is neither the owner itself nor a member of the owner’s quorum. - MAX_
EXPIRY_ TIMESTAMP_ MS - Latest accepted expiry,
3000-01-01T00:00:00Zin epoch milliseconds.