Skip to Main Content

Risk Management (RMS)

How Shoonya's Risk Management System (RMS) evaluates orders before they reach the exchange, and how to design around it.

Overview

Every order placed via the API — the same as one placed manually — passes through Shoonya's RMS before reaching the exchange. RMS checks margin availability, position limits, and price sanity (circuit bands) in real time. A rejected order most often means an RMS check failed, not an API-level error.

Common rejection reasons

ReasonTypical cause
Insufficient marginAvailable funds/margin don't cover the order at current pricing.
Price out of circuit bandLimit price is outside the exchange-permitted range for the instrument.
Exposure limit breachedOrder would push net exposure past your account's configured RMS limit.
Square-off windowIntraday product order placed outside permitted market hours for that product type.

Best practices

  • Don't treat server-side RMS as your only safeguard — enforce your own pre-trade checks (max order size, max daily loss) in your strategy code so failures are caught before they even reach the API.
  • Check Funds & Limits before sizing an order rather than discovering insufficient margin via a rejection.
  • Always branch on stat and read emsg from Place Order's response — don't assume a rejection is a bug in your code before checking the reason.

Notes

RMS limits are configured per account and can be adjusted by request — contact your relationship desk if your strategy's legitimate exposure needs exceed the defaults.