Skip to content

fix: parse current market price changes#117

Merged
cgfixit merged 1 commit into
mainfrom
agent/market-ws-price-changes-schema
Jul 13, 2026
Merged

fix: parse current market price changes#117
cgfixit merged 1 commit into
mainfrom
agent/market-ws-price-changes-schema

Conversation

@cgfixit

@cgfixit cgfixit commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What changed

  • parse current market-channel price_change payloads from price_changes[]
  • emit one price tick per subscribed nested asset
  • retain legacy top-level price_change and current top-level last_trade_price handling
  • ignore malformed event/update containers at the WebSocket trust boundary

Root cause

The current Polymarket market channel nests changed token prices under price_changes[]. The shared parser looked only for top-level asset_id and price, so valid current events produced no ticks and open-position risk evaluation could miss updates.

Impact

Current market-channel events reach the existing price callback. Subscription behavior and pricing/risk calculations are unchanged.

Validation

  • pytest tests/test_monitor.py tests/test_chaos.py -q -p no:cacheprovider — 71 passed
  • python -m py_compile polymarket_copier/core/monitor.py tests/test_monitor.py — passed
  • ruff check polymarket_copier/core/monitor.py tests/test_monitor.py — passed
  • ruff format --check polymarket_copier/core/monitor.py tests/test_monitor.py — passed
  • git diff --check — clean

Risk

Low and isolated to WebSocket message normalization. No REST polling, subscription, order, wallet, or persistence code changed.

Reference: https://docs.polymarket.com/market-data/websocket/market-channel

@cgfixit
cgfixit marked this pull request as ready for review July 13, 2026 07:29
@cgfixit
cgfixit merged commit b1acc66 into main Jul 13, 2026
7 checks passed
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