Fourcast is a venue-agnostic autonomous agent for prediction markets. It discovers edge, sizes positions under a policy-bound mandate, executes across multiple venues, and produces verifiable decision receipts that prove mandate adherence — before the outcome is known.
One agent core. Multiple execution venues. Verifiable decisions.
The wedge: every AI trading agent claims performance; none prove discipline. Fourcast commits a cryptographic decision receipt before each outcome resolves, then reconciles it against independently verifiable data. Operators get an auditable track record; allocators get mandate assurance without trusting a black box.
- docs/ARCHITECTURE.md — how the system fits together
- docs/CALIBRATION.md — Brier scoring, confidence buckets, the calibration curve
- docs/WALRUS_MEMORY.md — the memory layer: namespaces, ladder, precedence
- STRATEGY.md — positioning, venue roadmap, the Decision Log
- docs/INDEX.md — full documentation index (every doc, live status)
- docs/SETUP.md — install, env, wallets, deployment
- Production: fourcastapp.vercel.app
Status is tracked in docs/EXECUTION_PLAN.md and docs/SURFACES.md (dated, read from running services — not aspirational).
Node.js 24+, Next.js 16, React 19 · Polymarket CLOB, Delphi (LMSR), Canton DApp SDK · EVM, Solana (Anchor), Gensyn · TxLINE/TxOdds, Venice AI, Bright Data · Vercel, VPS+PM2, Redis/Upstash, Turso
MIT
Fourcast settles on Solana in three independent ways — each one verifiable read-only on a public explorer, no keys, no trust:
- Parametric escrow (
match-escrowprogram, devnet) — an Anchor program that locks SOL in a PDA against a sports fixture, then settles in a single transaction that CPIs into TxLINE'stxoraclev4 flow (validate_fixture_for_tree→validate_stat_v4→close_worker_ticket) with an API-signed Merkle proof of the verified score. Payout or refund happens entirely on-chain; there is no oracle operator and no trusted party. Program:AMT4n3imwTgHEpafKhsjfhfM5tKPXmTBVKvMCW4ohrvQ, source inonchain/match-escrow/. - Receipt commitment (Memo program) — each decision receipt's
contentHashcan be committed on-chain via the canonical Memo program before the outcome resolves;/api/worldcup/verify?commitmentTx=<sig>proves the commitment predated the result. - x402 payments (self-facilitated) —
POST /api/signals/premium-solanaquotes a 402, accepts a buyer-signedtransferCheckedtransaction, and only delivers the paid resource after verifying the instruction, simulating, broadcasting, confirming, and re-reading the on-chain balance delta. Devnet USDC by default; enable withX402_SOLANA_ENABLED=true(+X402_USDC_CEILING,X402_SOLANA_PAY_TO). Buyer client:scripts/x402-solana-demo.mjs— against production:X402_DEMO_URL=https://fourcastapp.vercel.app/api/signals/premium-solana X402_BUYER_KEYPAIR=<key> node scripts/x402-solana-demo.mjs.
- Program + oracle live on devnet —
curl https://fourcastapp.vercel.app/api/worldcup/settle/statusreturns the program id and RPC; both programs resolve on explorer.solana.com. - On-chain proof verification —
GET /api/worldcup/verify?fixtureId=18175981walks the full chain: pre-event receipt → optional on-chain commitment → TxLINE Merkle proof → Solana daily-root verification → reconciliation. - Full escrow round-trip —
node scripts/solana-escrow-v4-roundtrip.mjsbooks the fixture (once), creates a policy (locks SOL), then settles it in one transaction via the TxLINE v4 oracle CPI chain — printing explorer links for every transaction. Last verified run: create_policy → settle_policy_v4 (0.05 SOL paid to the recipient, policy account closed). - x402 quote —
GET /api/signals/premium-solanareturns 402 +Payment-Requiredheader with price, payee, mint and network.
The agent's trading account is a NEAR contract account — no private key
exists. The agent-mandate contract enforces venue/risk/liquidity/
slippage/cooldown policy on-chain and only asks the MPC signer for a
signature when a trade is in-policy.
# do X, see Y — read the live mandate + derived agent account (testnet, read-only)
node scripts/near-derive-address.mjs
# → contract policy, MPC pubkey, derived EVM address (0x6940…c61F)
# demo cold state (no worker/Redis needed)
FORECAST_REPLAY=1 npm run devEverything below is read-only or viewable on a public explorer — no keys, no trust:
- The mandate —
get_mandateoninexpensive-mother.testnet(venues, notional cap, liquidity floor, slippage, cooldown):node scripts/near-mandate-gates.mjs --view - The agent account —
0x6940…c61Fon Polygon. No private key exists —node scripts/near-derive-address.mjsre-derives it from the MPC pubkey + patharena/v1. - The envelope —
node scripts/near-first-order.mjs --drypicks a live market and shows the trade envelope passing each gate locally; the same checks run on-chain insiderequest_signature. - Live API —
GET /api/near/mandateon the deployed app returns the same contract state (read-only, no secrets). - Anchored receipts —
GET /api/txline/verify?fixtureId=<id>returns thenearCommitmentblock: anchored hash, social.near key, explorer link.
Receipts are anchored on NEAR (fourcast:receipt-v1:<fixtureId>:<hash>
via NEAR Social set) — the agent rail shows ⬡ anchored with an
explorer link per anchored cycle.
Fourcast is being adapted for the NEAR HACKATHON (Nov 1–14, 2026) under the Unstoppable DeFi track. See HACKATHON.md and docs/NEAR_HACKATHON.md for the NEAR integration plan, tools, demo script, and submission checklist.