Skip to content

Fix Metaforecast platform fetchers: Manifold, Kalshi, Polymarket#4101

Open
OAGr wants to merge 1 commit intomainfrom
metaforecast-platform-fixes
Open

Fix Metaforecast platform fetchers: Manifold, Kalshi, Polymarket#4101
OAGr wants to merge 1 commit intomainfrom
metaforecast-platform-fixes

Conversation

@OAGr
Copy link
Contributor

@OAGr OAGr commented Mar 22, 2026

Summary

  • Manifold: Add per-market error handling in upgradeLiteMarketsToFull so one bad market doesn't crash the entire pipeline. Fix non-null assertions on optional lastUpdatedTime field. Add logging for skipped markets without probability.
  • Kalshi: Rewrite from disabled stub to fully working fetcher using public API (api.elections.kalshi.com/trade-api/v2, no auth needed). Uses Zod-validated schemas, cursor-based pagination, and async generator pattern matching Polymarket's approach.
  • Polymarket: Add 30s fetch timeout, HTTP status checking before JSON parse, try/catch on page fetches, outcomes/prices array length validation, and skip counting. Document legacy "Long"/"Short" outcome filter.

Test plan

  • Verify Kalshi fetcher works: cd apps/metaforecast && pnpm cli kalshi (needs DB)
  • Verify Manifold fetcher handles errors gracefully
  • Verify Polymarket fetcher still works with hardening changes
  • Check that no type errors are introduced in the changed files

🤖 Generated with Claude Code

- Manifold: Add per-market error handling so one bad market doesn't crash
  the entire pipeline. Fix non-null assertions on optional lastUpdatedTime.
  Add logging for skipped markets.
- Kalshi: Rewrite fetcher from disabled stub to working implementation
  using public API (no auth needed). Zod-validated schemas, cursor
  pagination, async generator pattern.
- Polymarket: Add 30s fetch timeout, HTTP error checking, outcomes/prices
  length validation, and skip counting. Document legacy "Long" outcome filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@OAGr OAGr requested a review from berekuk as a code owner March 22, 2026 20:50
@github-project-automation github-project-automation bot moved this to 🆕 To prioritize in Overview Mar 22, 2026
@changeset-bot
Copy link

changeset-bot bot commented Mar 22, 2026

⚠️ No Changeset found

Latest commit: 826082a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package "@quri/evaluations" depends on the ignored package "@quri/squiggle-ai", but "@quri/evaluations" is not being ignored. Please add "@quri/evaluations" to the `ignore` option.

@vercel
Copy link

vercel bot commented Mar 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quri-hub Ready Ready Preview Mar 22, 2026 11:06pm
squiggle-components Ready Ready Preview Mar 22, 2026 11:06pm
squiggle-website Ready Ready Preview Mar 22, 2026 11:06pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
fermi-contest-2025-02 Ignored Ignored Preview Mar 22, 2026 11:06pm
metaforecast Ignored Ignored Preview Mar 22, 2026 11:06pm
quri-ui Ignored Ignored Preview Mar 22, 2026 11:06pm

Request Review

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

Labels

None yet

Projects

Status: 🆕 To prioritize

Development

Successfully merging this pull request may close these issues.

1 participant