Skip to main content

Risk Management Errors (160–179)

These errors enforce margin safety, leverage limits, and liquidation logic.


Error Table

CodeNameMessageCauseSolution
160PositionAtRiskPosition at riskPosition health below safe thresholdAdd margin or reduce size
161OrderNotAtRiskOrder not at riskDoes not meet liquidation criteriaCannot liquidate healthy order
162LiquidationThresholdExceededLiquidation threshold exceededMargin ratio below maintenance rateAdd margin urgently
163InvalidMarginAmountInvalid margin amountMargin insufficient for sizeIncrease margin
164RiskCheckFailedRisk check failedOperation would cause undercollateralizationCannot withdraw/reduce margin
165InvalidLiquidationThresholdInvalid liquidation thresholdConfig threshold invalidAdmin must correct setting
166InvalidLeverageInvalid leverageZero or above max leverageUse valid leverage range
167LeverageTooHighLeverage too highExceeds allowed maximumReduce leverage
168LiquidationFailedLiquidation failedLiquidation process errorRetry liquidation

Characteristics

  • Triggered during open, modify, withdraw, or liquidation flows
  • Enforce maintenance margin constraints
  • Prevent undercollateralized positions
  • Protect system solvency
  • Bound leverage to configured limits