Skip to content

MarketData Adapter: runtime startup/shutdown + health/metrics + tests + CI#199

Open
VirilePeak wants to merge 79 commits intoPolymarket:mainfrom
VirilePeak:feat/market-data-adapter-tests-health
Open

MarketData Adapter: runtime startup/shutdown + health/metrics + tests + CI#199
VirilePeak wants to merge 79 commits intoPolymarket:mainfrom
VirilePeak:feat/market-data-adapter-tests-health

Conversation

@VirilePeak
Copy link

@VirilePeak VirilePeak commented Feb 11, 2026

Entry/Risk Gate ist jetzt “un-umgehbarâ€^] (Chokepoint + low-level enforcement) Kill-Switch Cooldown ist persistent (überlebt Restart via RISK_STATE_PATH) Details: - src/order_executor.py::place_entry_order_with_gate() als zentraler Chokepoint - ^Ggents/polymarket/polymarket.py::execute_order(... gate_checked=...) wirft, wenn ENTRY_GATE_ENFORCE_POLY=True und Gate nicht geprüft wurde Neue Settings: - MAX_ENTRY_SPREAD, HARD_REJECT_SPREAD, ENTRY_REQUIRE_FRESH_BOOK, ENTRY_GATE_ENFORCE_POLY - Kill-switch: KILL_SWITCH_* + RISK_STATE_PATH Persistence: - Default data/risk_state.json, atomarer Schreibvorgang (temp + rename), auto-clear nach Ablauf Tests hinzugefügt: - ests/order_executor/test_executor_gate.py - ests/risk/test_entry_gate.py - ests/risk/test_kill_switch_persistence.py Risk/Notes: - Default ENTRY_GATE_ENFORCE_POLY=True kann in Notfällen deaktiviert werden (nicht empfohlen) - Gate kann initial viele Einträge blocken, wenn Märkte untradable (erwartetes Verhalten) \n\n### Addendum: trade performance reporting CLI\n- Adds ools/research/trade_report.py CLI to aggregate trade artifacts (JSON/JSONL/CSV) and report ALL vs ONLY_REAL (non-smoke/test/paper), confidence breakdown, rolling windows, exit reasons and blocked reasons (best-effort).\n- Wrapper script: scripts/trade_report.py\n- Includes pytest fixtures + unit test: ests/research/test_trade_report.py\n- Example: python -m tools.research.trade_report --roots --out-md report.md --out-json report.json --last-n 50 --since-hours 24 --print-blocked\n\nCI note: ensure CI runs pytest -q so the new test runs automatically.

VirilePeak and others added 30 commits February 8, 2026 17:10
Co-authored-by: Cursor <cursoragent@cursor.com>
…-automatic)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…secrets)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… file to prevent duplicate webhook processing after restart

Co-authored-by: Cursor <cursoragent@cursor.com>
…enen Wert zu überschreiben — verhindert Verlust benutzerdefinierter PYTHONPATH-Einträge beim Start.

Co-authored-by: Cursor <cursoragent@cursor.com>
…rice drop detection logic, and refactor market token fetching to use httpx directly
…on branch

Co-authored-by: Cursor <cursoragent@cursor.com>
YAML value for 'commit-message' contained a colon causing a nested mapping parse error; changed to block scalar.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…n PR)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… test

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…irmation store, exit safety; tests and scripts

Co-authored-by: Cursor <cursoragent@cursor.com>
…n confirmation key

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ptance; remove duplicate confirmation block

Co-authored-by: Cursor <cursoragent@cursor.com>
…irmed)

Co-authored-by: Cursor <cursoragent@cursor.com>
VirilePeak and others added 29 commits February 13, 2026 10:36
…when scheduling market data consumer

Co-authored-by: Cursor <cursoragent@cursor.com>
…available

Co-authored-by: Cursor <cursoragent@cursor.com>
…odule introspection issues

Co-authored-by: Cursor <cursoragent@cursor.com>
…pter EventBus and handle realtime soft-stops

Co-authored-by: Cursor <cursoragent@cursor.com>
…st-effort)

Co-authored-by: Cursor <cursoragent@cursor.com>
…'await' outside async)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…eation (best-effort)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…t token

Co-authored-by: Cursor <cursoragent@cursor.com>
…/unsubscribe

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…r; ensure subscribe scheduling uses module var

Co-authored-by: Cursor <cursoragent@cursor.com>
…to increase live data coverage

Co-authored-by: Cursor <cursoragent@cursor.com>
…; reconcile loop + heartbeat

Co-authored-by: Cursor <cursoragent@cursor.com>
…to subscribe/unsubscribe

Co-authored-by: Cursor <cursoragent@cursor.com>
…ests

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…g_threshold; export reconcile state/desire map

Co-authored-by: Cursor <cursoragent@cursor.com>
…unts + missing cycles

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… token; add message-flow verification warning (no msgs while subs>0)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… (fallback to opened_at)

Co-authored-by: Cursor <cursoragent@cursor.com>
…irement)

Co-authored-by: Cursor <cursoragent@cursor.com>
@VirilePeak
Copy link
Author

Main points: entry gate is now enforced via chokepoint + low-level guard; kill-switch cooldown is persistent via RISK_STATE_PATH; CI green; tests added.\n\nPlease focus review on: order_executor gate wiring, execute_order enforcement flag, kill-switch persistence/atomic write.\n\nAddendum: trade reporting CLI added (tools/research/trade_report.py + scripts/trade_report.py) to aggregate artifacts and report ALL vs ONLY_REAL, confidence breakdown, rolling windows, exit reasons and blocked reasons (best-effort). Tests included.

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