Inventory Balancer Maker — Patch Update
Audit / Issue Found
The strategy held a target half-half inventory split, but each cycle it would post a single bid and a single ask at the full size needed to drift back toward that 50-50 target. When the market made a fast one-sided move, the bot could fill the entire rebalancing trade in one go, well past the price level the math intended.
Before the patch
If the price wicked down into the bid, the bot bought the full target rebalance amount at the very top of the wick. If the price spiked into the ask, the bot sold the entire rebalance amount at the first tick of the spike and left the rest of the move on the table. The Avellaneda-Stoikov reservation lean was tilting the price correctly, but the execution was lump-sum.
After the patch
The bid and ask sizes are now split into four rungs each side, walking ten basis points deeper into the book per side by default. The reservation price lean and the quantity skew that respond to inventory imbalance both still work — they just apply across a stack of orders now. Only the top rung fills on a single tick; deeper rungs fill if the move continues, giving you a better average price both when adding and when reducing inventory.
Number of rungs and the rung spacing are tunable per pair. Set rungs to one for the old behaviour.
Bottom line
Rebalancing back toward the 50-50 split now happens gradually across a price band instead of in a single shot, so a fast move in either direction no longer puts you in a worse spot than the math intended.
Follow-up correctness audit, same day
Three real issues were found and fixed in a deeper review of the new laddered placement.
First, a renaming mistake in the earlier patch. The notification line that tells you what bid and what ask got placed was referring to two variables that no longer existed, which would have thrown an error and stopped the strategy mid-cycle every time a quote was placed. The fix points it at the correct names.
Second, the balance check on the bid side only required enough cash for a single rung. With four rungs in the stack, the strategy could decide to start placing and then run out of cash partway through. The fix raises the gate to require the total cash for the full ladder.
Third, the same problem on the ask side. The gate required only one rung of holdings to be present. The fix raises it to require enough holdings for the full ask ladder.
Three other findings were checked and confirmed as documentation or cosmetic and did not need code changes.