Search for an answer or browse help topics to create a ticket
View all categories

How does Zerodha square off positions?

The process of squaring off positions is subject to Zerodha’s discretion and may differ from the scenarios mentioned below.

Zerodha squares off positions when intraday positions are not squared off by the client, required margins are not maintained, the collateral value from pledged stocks decreases due to increased haircuts, value of the pledged stocks is falling, etc. To learn more, see Why does Zerodha square off positions?

When multiple positions are held, and some of them need to be squared off because of a margin shortfall, Zerodha decides which positions to close based on the following factors:

Multiple futures positions

If a client holds multiple futures positions with different expiries and one of them needs to be squared off due to a margin shortfall, Zerodha will generally close the contract closest to expiry, i.e., the near-month contract, instead of the next month or far-month contract to the extent of the shortfall amount. The preference for near-month contracts is mainly due to higher liquidity (more buyers and sellers), which helps reduce impact costs. To learn more about impact costs, see What are Iceberg orders, and how to use them?

Far-month contracts have lower liquidity, leading to a wider bid-ask spread (the difference between the maximum price a buyer will pay and the minimum price a seller will accept for an instrument). This wider bid-ask spread can increase trading costs, potentially leading to larger losses for the client if Zerodha chooses to square off these far-month expiry positions.

If a client holds multiple futures positions of different instruments with the same expiry, Zerodha’s preference will be to close the position with the lowest bid-ask spread.

Example scenario

A client holds November’s Futures positions of ABBOTINDIA and AMBUJACEMENT, and one of the positions is supposed to be squared off because of a margin shortfall. Zerodha gives preference to closing the position in the contract that has a smaller bid-ask spread compared to other held positions.


The bid-ask spread of the ABBOTINDIA NOV Futures contract is almost 80 points, whereas the bid-ask spread of the AMBUJACEM NOV Futures contract is only 0.20. Hence, Zerodha will consider squaring off the AMBUJACEM position.

Since the position is squared off to the extent of the margin shortfall amount, Zerodha can decide to square off next month or far month contracts instead of current month’s contract if the required margin for the next or far month expiry is closer to or equivalent to the margin shortfall amount. Zerodha squares off the position based on the extent of the margin shortfall amount.

Example Scenario

  1. There is a margin shortfall of  ₹1 lakh in a client’s account, and they hold ADANIENT’s current and next month’s futures contracts.
  2. ADANIENT’s November futures contract, i.e., the current month contract, requires a margin of approximately ₹4 lakh.
  3. ACC’s December futures contract, i.e., the next month's expiry, requires a margin of around ₹1.0 lakh.
  4. Since positions are squared off based on the extent of the margin shortfall amount, Zerodha may square off the next month's contract, i.e., December’s futures contract, to cover the margin shortfall instead of closing the November contract.

If the client holds a position for the current month in an instrument that is under a ban period, Zerodha prefers to close positions in instruments not under the ban, which could be for the next or far-month expiry.

The reason for not closing a contract in the ban period is due to the higher margin requirements usually associated with them. Additionally, closing the position for a contract under the ban period would prevent the client from re-initiating the position until the contract is no longer under the ban period. To learn more about ban period, see Why do F&O contracts enter the ban period?

Multiple positions with different margin requirements

If a client holds multiple positions with different margin requirements, Zerodha prefers to close positions with higher margin requirements.

Example Scenario

A client has a margin shortfall of ₹6 lakh with the following positions:

  • 5 lots of ADANIENT with a margin requirement of ₹4,50,000 per lot.
  • 5 lots of HINDPETRO with a margin requirement of ₹3,00,000 per lot.
  • 10 lots of SBILIFE with a margin requirement of ₹1,50,000 per lot.
  • 10 lots of HDFCBANK with a margin requirement of ₹1,50,000 per lot.

In this case, Zerodha will reduce 1 lot of ADANIENT and 1 lot of either SBILIFE or HDFCBANK to cover the margin shortfall because Zerodha prioritises closing the positions with the highest required margin and then closing the position closest to the shortfall amount.

Stock and Index F&O positions

If a client holds stock and index F&O positions, Zerodha will prefer squaring off index F&O positions to cover the shortfall. This is because index F&O contracts are more liquid compared to stock F&O contracts. However, Zerodha may decide to square off stock positions instead of index positions in the following cases:

  1. If the index position is illiquid, such as deep ITM option contracts or far-month F&O contracts.
  2. If a client is holding stock positions more than index positions.

Example Scenario

  1. The client has a shortfall of ₹2.7 lakh in their Zerodha account.
  2. They have open positions in BankNifty options and PFC (Power Finance Corporation) futures.
  3. Among these positions, the client has 3 lots of BankNifty, each requiring a margin of ₹90,000, and 1 lot of PFC, requiring a margin of ₹2.7 lakh.
  4. To cover the shortfall, Zerodha will prioritise closing the BankNifty positions first (₹90,000 per lot x 3 lots = ₹2.7 lakh), rather than the single lot of PFC with the same margin requirement, as index F&O positions are prioritised during the squaring off process.

Hedged positions

Zerodha generally squares off positions for clients holding hedged positions in a manner that the hedge is not broken, i.e., the positions aren’t naked, or to minimise the client’s potential losses.

Example Scenario

  1. A client has a shortfall in their Zerodha account, and they have not added funds or squared off their positions to cover the shortfall. Zerodha decides to square off their positions to the extent of the margin shortfall.
  2. A client has open positions, specifically in long Futures and long Put option (PE) contracts.
  3. Given the nature of the client's positions, Zerodha takes into account the hedged setup. Squaring off only one type of option (either long Futures or long PE option) could break the hedge, potentially exposing the client to greater risk.
  4. Since futures positions are settled on an MTM basis and options positions are settled when squared off or expired. If the market moves against the Futures positions, the MTM loss will be settled on the same day leading to a margin shortfall. To learn more about MTM, see What is Mark to Market (MTM)?
  5. Therefore, Zerodha will square off the equivalent of both the Futures and options positions. This action maintains the balance of the hedge, reducing the client's exposure to further market volatility.
  6. The exact quantities to be squared off from each position would be determined based on the weightage of the options. This could depend on factors such as the liquidity of the positions, the margin requirements, current market prices, etc.

This way, Zerodha ensures that the client's shortfall is covered without breaking the hedge.