Skip to main content

Module types

Module types 

Source
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§

CancelOrderRequest
Request to cancel an existing order in the matching engine.
CancelOrderRequestBuilder
Builder pattern implementation for constructing CancelOrderRequest instances.
Conditional
Comprehensive conditional order specification with advanced trading features.
ConditionalBuilder
Builder for constructing Conditional orders with a fluent API.
ConditionalExpiry
Defines expiration behavior for conditional orders.
ConditionalExpiryBuilder
Builder for constructing ConditionalExpiry configurations 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.
LiquidatePositionRequest
LiquidatePositionRequestBuilder
OrderPlaced
The order as the matching engine accepted (or rejected) it.
OrdersTerminated
The orders a cancellation terminated.
RateLimitInfo
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.
SetImrRequest
Request to set the position-level IMR for an account/market.
SetImrRequestBuilder
SubmitOrderRequest
Complete order submission request with support for all order types and advanced features.
SubmitOrderRequestBuilder
Builder for constructing SubmitOrderRequest with a fluent API.
SwitchToCrossRequest
Request to switch a position’s margin mode to cross.
SwitchToCrossRequestBuilder
SwitchToIsolatedRequest
Request to switch a position’s margin mode to isolated.
SwitchToIsolatedRequestBuilder
TradeExecuted
A fill the submitted order took part in.
Transaction
A complete transaction with payload and cryptographic signature.
TransactionBuilder
Builder for constructing Transaction instances.
TransactionPayload
The payload of a transaction containing all transaction data before signing.
TransactionPayloadBuilder
Builder for constructing TransactionPayload instances.
TransactionReport
A comprehensive report of a transaction containing one or more trading operations.

Enums§

CancelOrderRequestBuilderError
Errors that can occur when building a CancelOrderRequest using the builder pattern.
Command
Command variants that can be executed within a transaction.
ConditionalBuilderError
Errors that can occur when building a Conditional order.
ConditionalExpiryBuilderError
Errors that can occur when building a ConditionalExpiry.
ErrorString
Enumeration of all possible error condition descriptions.
LiquidatePositionRequestBuilderError
OrderError
Specific error conditions that can cause order rejection during processing.
OrderStatus
Current lifecycle state of an order within the matching engine.
OrderType
Order execution type determining how orders interact with the market.
Quantity
Defines how the quantity for a conditional order should be determined.
RejectedBy
Report
A report detailing the outcome of a specific trading operation.
SetImrRequestBuilderError
Side
Order direction specifying whether to buy or sell the base asset.
SubmitOrderRequestBuilderError
Errors that can occur when building a SubmitOrderRequest.
SwitchToCrossRequestBuilderError
SwitchToIsolatedRequestBuilderError
TimeInForce
Time-in-force instructions that control order lifecycle and execution behavior.
TransactionBuilderError
Errors that can occur when building a Transaction using the builder pattern.
TransactionPayloadBuilderError
Errors that can occur when building a TransactionPayload using 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_id is empty — the field was never filled in.
ERROR_CHAIN_ID_MISMATCH
Error 411: the signed payload’s chain_id names 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 from real_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 nonce is 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 nonce was 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 nonce is 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 price is 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 mode is 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 version is not a known value
ERROR_V2_REQUIRES_SIGNER
Error 404: V2 transaction envelope is missing the required signer field
ERROR_V2_SIGNER_NOT_OWNER
Error 406: the V2 envelope signer is not entitled to the payload owner — 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:00Z in epoch milliseconds.