Releases: crp4222/pmq
Release list
0.7.1
pmq-doctor diagnostics:
- Separates "funder holds no USDC on-chain" (deposit first, or wrong funder) from "funder funded but the CLOB sees zero" (wrong signature_type, or the wallet not associated), probing the signature types and naming the one that sees the balance.
- A funder whose
owner()reverts or is unreadable is now a warning, not a wrong-key error (some deposit-wallet proxy generations do not expose it); only a different owner stays red. - The api-key line prints the EOA the derived key resolves to and states the create 400 is non-fatal by construction (the key already exists and derive returns it).
- Under signature_type 3, notes the order signer is the deposit wallet while the api key is the EOA, and that order authorization needs the backend to know the pair.
Read-only throughout, no order ever placed.
v0.7.0
MCP 0.7.0\n\n- Durable paper ledger and daily-buy safety rail.\n- Keyless status, market snapshot, order preview, and public portfolio tools.\n- Correct clean-install MCP onboarding and wheel smoke coverage.\n\nSee CHANGELOG.md for the complete release notes.
0.6.1
Accounting fixes measured on a live maker session (2026-07-06).
- trades_totals no longer misses maker fills: MAKER-role trade records carry the TAKER's side and asset at top level, so the old top-level side pre-filter skipped our fills whenever the counterparty was on the other side or on the complementary token (measured: 6 CONFIRMED maker fills, 16.97 shares for 16.19 USD, reported as zero). The requested side and token_id now apply per maker_orders slice using the slice's own side and asset_id; slices without a side derive it from the asset/outcome relation to the taker; the venue is queried by condition alone and taker records are filtered in-process on their top-level asset. The taker path is unchanged and locked by tests; the only-mine attribution gate applies to the recovered records exactly as before.
- cancel_order parses the response instead of trusting the HTTP 200: the CLOB can decline a cancel inside a 200 while the order is mid match. True only when the id is under canceled; not_canceled logs the venue reason and returns False; unrecognized bodies read as NOT canceled.
- get_order(order_id): single-order truth (status, size_matched) for harvesting the partial fill of an order right after it leaves the book; None on any error. Startup introspection now covers get_order.
179 offline tests pass; ruff and mypy --strict clean.
0.6.0
pmq.stream.PriceStream: standard-library client for the resolution price feed (ws-live-data.polymarket.com): the Chainlink stream that resolves the updown markets plus the Binance spot mirror. Short-poll design measured in production (the edge serves the sustained push only to browser connections; the initial batch is fresh to 1.2-2.8s and is re-polled about once per second), incremental RFC 6455 decoder, per-symbol dedup and rings, last()/age()/recent()/health(), optional on_tick callback. No new dependencies.
0.5.0
Order attribution registries: several order-senders can share one wallet without corrupting each other's exchange-truth accounting. Opt-in via POLY_ORDER_LOG / POLY_FOREIGN_ORDER_LOGS; taker trades filtered by taker_order_id, maker fills by per-slice order_id, and reconcile() claims trades unknown to every registry. Byte-identical behavior when unconfigured.
v0.4.10
Book-level validation in the data layer: best_bid_ask and band_ask_depth_usd now validate every level (finite price within [0, 1], finite size >= 0). Invalid levels are excluded with one counted warning; an all-invalid side reads as empty. This closes the last parser that could still raise through the MCP book tool or pass NaN into comparisons and paper fills. book_meta, get_book and resolved_winner join the same fail-closed contract.
Also: startup introspection now covers cancel_orders, post_only and get_clob_market_info (verified on py-clob-client-v2 1.0.2); http_get_json caps response bodies at 8 MB; paper account_trades counts BUY-side fees only, matching live semantics; real-client construction branches pinned by tests; Repository URL for PyPI.
Full details in CHANGELOG.md. 157 tests.
v0.4.9
trades_totals now enforces the same finite non-negative contract as the fill parser: NaN/Infinity/negative tape amounts book zero, a non-list /trades body reads as truth unavailable (None). The method was decomposed (complexity 13 to 6) with every 0.4.6 maker-slice branch pinned by tests first; behavior identical. Fuzz suite gained an adversarial-tape property, coverage 91 to 94 percent, dead paper helper removed, CHANGELOG link on PyPI. Full notes in CHANGELOG.md.
0.4.8: MCP paper mode, demoed against the real books
MCP paper mode, demoed up front.
PMQ_MCP_PAPER=1registers the trading tools with fills SIMULATED against the real live order books: filled only at the real best ask, capped by the displayed size, refused under the exchange minimum, charged the documented taker fee formula. Starting balancePMQ_MCP_PAPER_USD(default 1000). No keys needed, no order can reach the exchange, paper wins over live when both are set, and the per-order and daily caps still apply.- The README now opens on a real captured paper session (2026-07-04, quoted verbatim): five tool calls from market discovery to a simulated fill on the live book.
- docs/demo.html renders that same session as a walkthrough: one self-contained file, inline CSS, no JavaScript, no external requests, light and dark.
- New "Production receipt" issue template for reporting real fills placed through pmq (settlement tx, sig type, order path).
- bot-template dashboard: full English pass.
Full details in CHANGELOG.md.
0.4.7: MCP daily buy budget, agent-first docs
New operator rail: PMQ_MCP_DAILY_USD caps cumulative buys per UTC day on top of the per-order cap (confirmed spend counts, rejections cost nothing, unknown outcomes consume conservatively until reconciled). The README now leads agent-first and documents the exact tool surface and every operator-set rail. Any MCP client works; the model cannot widen the rails from inside a session.
0.4.6: maker-slice trade accounting, maker production receipt
trades_totals no longer overcounts MAKER-role fills (V2 bundles multi-maker matches into one record; we now sum only our maker_orders slices, matched by funder). Found live while producing the maker receipt now shown in the README: limit_gtc posted above the bid, matched as MAKER at zero fee, settled on-chain. Real settlement record ships as the test fixture.