← Changelog

Per-Strategy Final Audit Round

Patch7 June 2026· library-wide

Audit / Issue Found

After all the library-wide sweeps were complete, four strategies that have unique non-template logic and had not been individually deep-audited got a final per-strategy review. The four are the TWAP scalper, the inventory balancer, the Kalman grid, and the price-action-pro strategy. The review looked for strategy-specific bugs that would not show up in a template-derived sweep: model-fidelity issues, state-machine quirks, async timing, and integration of multiple sub-systems.

Before the patch

Four agent-driven audits surfaced four high-severity claims and a handful of medium and low severity items. Every high-severity claim was verified against the actual code before any change was made. All four turned out to be false positives on careful re-reading.

The TWAP scalper claim of no per-cycle throttle was wrong because the strategy returns early when any open order exists, which is the natural throttle for a TWAP scheduler that places one tranche at a time.

The inventory balancer claim of a missing one-half factor on the inventory-risk term was wrong because the code computes the full bid-to-ask spread per the Avellaneda-Stoikov closed form and then divides by two when placing bid and ask around the reservation price, which is the algebraically correct way to express the same half-spread.

The Kalman grid claim of resting-rungs being wiped on bot restart was wrong because the resting-rungs map lives in Gunbot's customStratStore, which is persisted to disk along with the rest of the strategy state. A bot restart resumes with the same map.

The price-action-pro claim of unsound fill detection was wrong because the quote-balance-polling pattern is the standard async Gunbot pattern; the strategy uses it correctly with FIFO matching against the pending-orders queue.

After the patch

No code changes were applied in this round. The four strategies passed the per-strategy review with no real bugs found.

The remaining medium and low severity items from the agents are all intentional design choices documented in the code, or bounded edge cases too small to be worth correcting. Some examples: the TWAP scalper uses market sells for emergency exits and post-only sells for normal exits, which is asymmetric but appropriate. The Kalman grid pauses trading during volatility regime breaks, which is a design choice for that strategy's mean-reversion thesis. The Avellaneda-Stoikov tau parameter is held constant rather than decaying toward session end, which is a simplification appropriate for a 24-hour crypto market with no real session boundary.

Bottom line

The four heavy-logic non-template strategies have been individually deep-audited and confirmed correct. Every other strategy in the library is template-derived and has already been covered by the wave of template sweeps earlier in this sprint.

Auditor honesty note

Across this entire sprint the LLM auditors had a false-positive rate of roughly fifty percent on high-severity claims. Every finding has been human-read before any edit. Trusting an agent finding without verification would have introduced bugs rather than fixed them. Future audit work should keep the same pattern: agents propose, the operator verifies, fixes go in only against confirmed real issues.