Background

Based on feedback from managers, it was observed that in the case of users with very high value invested in smallcases (20 lakhs and above), the rebalance order required funds addition of 1 lakh or above in very rare cases. 


Upon investigation, we noticed that in case of a minor reduction in prescribed weightage for certain constituents (less than 1%), the rebalance algorithm would not execute the sell order, sometimes leading to the requirement of additional funds.



Overview of the rebalance algorithm

During the rebalance order, we transform the user’s invested smallcase (version 1) into the new manager-recommended smallcase (version 2) at run time for each user. The following steps are followed:


  • We compute the user’s current net worth in the smallcase and compare it with the smallcase minimum investment amount (MIA) or recommended amount (recommended amount taking precedence over MIA)

  • Based on the weightage prescribed by the manager, we determine the constituents that need to be Retained/Adjusted, Removed, or Added in version 2

  • We then proceed to determine the quantities that should be held by the user for each constituent based on the newly prescribed weightage

  • A comparison b/w quantities currently held vs quantities to be held based on prescribed weights determines the order configuration

  • Once the order configuration is created we adjust the order as per Rebalance buffer logic to remove some orders. The logic is as follows:
    1. Orders where the buy or sell value for a stock is less than 1% of smallcase net worth  or less than ₹500, the stock is ignored from the rebalance order

    2. These checks  are only implemented for stocks that are already a part of your holdings i.e. checks are not applied for fresh buy orders or complete sell orders

      The goal here is to not create low-value trades that may incur disproportionately high DP charges


  • Once the order configuration is adjusted, we provide the final order configuration to the user for reviewing and order placement
                   

We have now added more checks to the algorithm.


Changes to the rebalance algorithm

In the new proposed Algo, we continue up until step 5 to generate the order config. On top of it, we add the following order adjustment logic:

  • Calculate Total Buy Amount(BA) = Sum(TA(i)), where TA(i) are the respective buy trades for each constituent

  • Calculate Total Sell Amount(SA) = Sum(TA(i)), where TA(i) are the respective sell trades for each constituent

  • If BA>SA, proceed to the following logic:
    1. Calculate Adjusted buy amount(ABA(i)) for each constituent =(SA/BA)* TA(i), where TA(i) is the respective buy amount

    2. Calculate Adjusted buy quantity(ABQ(i)) for each constituent= roundup[(ABA(i))/CMP(i)], CMP(i) is the current market price for each constituent

  • After the adjustment, provide the final order configuration to the user for review and order placement

With this, we are actively trying to make the buy amount match closely with the sell amount, thereby reducing the amount required to be added by users


Changes to the buffer amount

In the rebalance flow improvements for Kite, a buffer amount was introduced. This buffer was introduced to account for changing market prices for the basket which is created for automatic execution on the next day. The basket usually comprises around 20% of buy orders that utilise the funds settled on the next market day from the sell order. 


Previously, the buffer was as follows:

Buffer = max(16 * Number of constituents sold, 2% of Buy Value)

This was revised to the following:

Buffer = max(100, 1.2* 16 * Number of constituents sold, 3%*20% of Buy Value)


This should further reduce the need for extra funds, as we have effectively reduced the buffer amount by 70% for cases with high investment value.