Repository navigation
Add check-polymarket connectivity check; never follow redirects with credential headers - #3
Merged
Merged
Conversation
`npm run cli -- check-polymarket [--prod] [--json] [--with-credentials] [--binance]` checks, read-only, every Polymarket endpoint BotLab uses (CLOB, Gamma, data API, geoblock endpoint, public IP / country) and optionally Binance, classifies each request (ok, geo_blocked, bot_challenge, forbidden, rate_limited, network_error, unexpected) and prints a verdict with exit code 0 ok / 1 blocked / 2 degraded. With credentials it derives the wallet's existing CLOB API key and makes two L2 GETs (nothing created, no secrets printed). Logic in core with injectable fetch; README "Hosting on a VPS"; PROGRESS R205-R207. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjwENrgG4j59smeu31MTHW
- Credentials never follow a redirect: authenticated connectivity probes use redirect 'manual' (3xx = unexpected, not followed) and refuse http CLOB URLs; axios request interceptor sets maxRedirects 0 for requests with POLY_* headers (trading path); Binance signed requests use redirect 'error'. - Cloudflare 1009 country ban classified as geo_blocked. - Read-only DB open reports the real error; proxy detection follows Node's order and no_proxy; "via proxy" only when fetch uses it. - Tests for all of the above, checkPolymarket.ts and authHeaders.ts. - PROGRESS: R205-R207 amended, R208, log entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjwENrgG4j59smeu31MTHW
markb-1
added a commit
that referenced
this pull request
Nov 1, 2026
Brings in PRs #2 and #3. Their README edits now live in the guides: "Hosting on a VPS" in docs/guide/install.md, the min_liquidity_usd note in operations.md, the executor / position manager / copy-trading changes in strategies.md, and check-polymarket in development.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm run cli -- check-polymarket: tests whether this machine's IP can use every Polymarket endpoint BotLab needs, before you move to a VPS or new box.--with-credentialsadds authenticated read-only checks that print no keys;--binanceadds Binance.--jsonis available.Authorization/Cookieon a cross-host redirect. A redirect would therefore have sentPOLY_API_KEY,POLY_PASSPHRASEandPOLY_SIGNATUREto the other host. An axios interceptor now setsmaxRedirects: 0on any request withPOLY_*headers.redirect: 'error'. A redirected order is treated as an unknown outcome, which the reconciler settles.Testing
SKIP_NETWORK_TESTS=1); typecheck, lint (0 errors) and build pass. Reviewed independently, and the findings are fixed.Decisions R205–R208 are in
docs/PROGRESS.md.Generated by Claude Code