Skip to content

fix(monitor): reprime re-added wallets#122

Draft
cgfixit wants to merge 1 commit into
mainfrom
origin/cx-polymarket-optimize-reprime-wallets
Draft

fix(monitor): reprime re-added wallets#122
cgfixit wants to merge 1 commit into
mainfrom
origin/cx-polymarket-optimize-reprime-wallets

Conversation

@cgfixit

@cgfixit cgfixit commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Clear the primed marker for wallets removed by TradeMonitor.set_wallets().
  • A wallet re-added after a rebalance now seeds a fresh activity baseline before it can emit trades.
  • Add the regression test and mark DD-12 fixed in the active invariant ledger.

Why

Previously, a removed wallet retained its primed marker. If it returned later, its first poll could treat trades accumulated during the gap as new. The existing staleness gate is not a substitute for the cold-start guard.

Verification

  • python -m pytest tests/test_monitor.py -q -p no:cacheprovider — 56 passed
  • python -m pytest -m "not integration" -q -p no:cacheprovider — 625 passed
  • powershell -NoProfile -ExecutionPolicy Bypass -File scripts/check-lint.ps1
  • python -m mypy polymarket_copier --ignore-missing-imports --no-strict-optional
  • python -m py_compile polymarket_copier/core/monitor.py tests/test_monitor.py
  • git diff --check

Scope and risk

Monitor state only. No trading math, position sizing, order behavior, live-mode gate, or credentials changed. Retained wallets keep their existing priming state and seen IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant