There is no straightforward way to calculate the exact effect of the orders executed as a result of rebalancing. However, BB does provide an indication of the Profit & Loss (PnL) that results from the orders it triggers. In normal trading, the PnL is calculated by subtracting the invested funds (from one or more buys) from the recovered funds (from one or more sells). This principle cannot be fully applied when rebalancing, because it’s not like BB always buys assets first, and then sells all acquired assets later.

Instead, BB keeps track of all coins bought, and whenever some of those coins are sold, it updates the PnL. It does so by looking at the sell price versus the breakeven price for all buys up to that point. See the chart below. After starting a new bot with SOL in portfolio, the bot places 3 buy orders as the SOL price goes down. This does not yet have an effect on the PnL. Then, when the price goes up, a first sell order is executed. If the sell price is above the breakeven price for the 3 buys, the PnL will be positive. If the sell price is below the breakeven, the PnL will be negative.

Then there is a 2nd and 3rd sell, after which the accumulative PnL will certainly be positive, as the average sell price is higher than the average buy price, and the amount of recovered USDT is larger than the amount of invested USDT.

Then there is new buy, and the breakeven price is updated accordingly. If none of the acquired SOL was left after the last sell, then the buy price becomes the new breakeven price. If there was still a bit of SOL left, then those remaining coins are included in the updated breakeven.

What follows are again two sells, the 4th and the 5th sell. The 4th will increase the PnL, as the sell price is above the new breakeven price. However, with that sell most or all of the bought coins would be sold. So what happens when the 5th sell is executed? At this point, some of the initial SOL that was in portfolio when the bot was first started is sold. The PnL could be adjusted using the price at which the initial SOL was acquired. However, when people start a new bot, they don’t always properly indicate the initial buy price in the liquidity changes, so that could lead to inaccurate results. Also, let’s say the initial buy price was 50 USDT, and SOL goes up to e.g. 200 USDT. At that point, any sell of the initial SOL quantity would have a huge effect on the PnL, because of the large difference between the sell price and the initial buy price, and the calculated PnL would not be a good reflection of the actual PnL for the orders that BB initiates.

For that reason, BB only updates the PnL when it sells coins that it also bought as a result of rebalancing. In the example above, let’s say that with the 4th sell, all coins that BB previously bought were sold. Then the 5th sell will not have any effect on the PnL. Only after some new SOL is bought, will subsequent sells lead to a PnL change.

Because of this approach, the 4 (or perhaps even 5) last sells in the graph above won’t lead to a PnL change, even though BB takes profit on some of the initial SOL assets. Therefore, the PnL is not a reflection of the full rebalancing effect. However, it is an indication the additional USDT value the bot has acquired directly through the ‘micro trades’ it triggers.

Finally, BB does not take trading fees into account in the PnL calculations. Every exchange deals with fees differently. Also, fee discounts may apply (e.g. because of referral programs or VIP levels). And fees may be paid using specific tokens (like BNB on Binance, and KCS on KuCoin). In many cases, the exchange will however take the fee from the acquired asset. For instance, when buying SOL with 10 USDT, you would receive SOL worth slightly less than 10 USDT. And when selling SOL worth 10 USDT, you would receive slightly less than 10 USDT. In such case, trading fees are implicitly included in the PnL. But depending on your exchange and whether you’re paying fees using specific tokens, fees may not be considered in the PnL. Therefore, the PnL should be considered an indication rather than a 100% accurate value.