Skip to main content

Order Errors (40–79)

These errors relate to order lifecycle, trading pair validation, and order parameter constraints.


Error Table

CodeNameMessageCauseSolution
40OrderNotFoundOrder not foundDeal ID does not existVerify order ID
41InvalidOrderStateInvalid order stateOrder state does not allow operationEnsure correct state (ACTIVE, PENDING, etc.)
42OrderNotActiveOrder not activeOrder closed, cancelled, or liquidatedCannot operate on inactive order
43OrderAlreadyClosedOrder already closedAttempted to close closed orderCheck state before closing
44InvalidOrderAmountInvalid order amountZero or exceeds limitsUse between minOrderSize and maxOrderSize
45OrderTooSmallOrder too smallBelow Config.minOrderSizeIncrease order size
46OrderTooLargeOrder too largeExceeds Config.maxOrderSizeReduce or split order
47InvalidOrderNameInvalid order nameInvalid trading pair formatUse format like BTC-USD
48OrderNameMismatchOrder name mismatchPair does not match expectedVerify trading pair
49OrderStateMismatchOrder state mismatchState conflicts with operationValidate state compatibility
50InvalidAssetNameInvalid asset nameName invalid or >64 charsUse valid name under 64 chars
51InvalidOrderSizeInvalid order sizeOrder size parameter invalidProvide positive value
52InvalidAmountInvalid amountAmount zero or invalidUse positive non-zero amount
53AssetNotEnabledAsset not enabledPair disabled in configEnable asset before trading
54AssetNotCollateralAsset not collateralAsset not allowed as collateralUse approved collateral
55AssetNotInitializedAsset not initializedAsset account missingCall SetUnderlying first
56InvalidPriceDataInvalid price dataMalformed or invalid priceVerify oracle/price feed
57InvalidDealIdInvalid deal IDDeal ID invalid or out of rangeUse valid active deal ID
58CloseFailedClose operation failedPosition close encountered errorVerify position state

Characteristics

  • Triggered during open/close/modify order flows
  • Enforce pair configuration constraints
  • Enforce order size bounds
  • Validate asset state and enablement
  • Dependent on correct deal and state tracking