← Changelog

Patch note — auto-clearing one-shot reset flags

Patch10 June 2026· library-wide

What changed

The three "one-shot" knobs you use to recover a stuck pair now actually behave like one-shots. You flip them on, restart, and the strategy clears the flag itself after the reset fires. No more manually flipping them back to false and restarting again.

Which flags

How it works under the hood

When the reset fires, the strategy writes false back into two places:

  1. The in-memory ws snapshot (so nothing else in this cycle re-fires).
  2. The persistent pairLedger.whatstrat config (so the GUI shows the flag cleared and the next cycle starts clean).

Why this matters for the current stuck pairs

Until this patch, leaving RESET_STATS_ONCE: true set across restarts caused the stats to be wiped every single cycle. That is exactly why the InvBalancer trade counter on NEAR stayed pinned at 0 even after the fix landed. With auto-clear, the wipe runs exactly once and the new counters start accumulating immediately after.

Strategies covered

glostenMilgrom, hawkesMM, inventoryBalancer, cartaJaiMicroMM, harrisScalpMM, rollModelMM, microPriceMM, queueReactiveMM, ofiFlashMM, parabolicSarMM, kalmanGrid.

Operator workflow now

  1. Set the flag to true for the pairs you want reset.
  2. Restart Gunbot.
  3. Watch the next cycle log for the reset warning.
  4. That's it. The flag is already cleared, no follow-up edit needed.

Bonus correctness fix

In GM and Hawkes there was a subtle ordering issue: the stats-reset block runs near the top of the script and the V2 PnL reset runs further down. With auto-clear in place, the first block would have wiped the flag before the second block could see it. A small "hand-off" marker (_qResetStatsJustFired) bridges the two so both fire on the same cycle, then the marker is consumed.