Agent market simulator · auction theory lab · sports betting arbitrage scanner.
A market-microstructure research terminal that runs entirely in your browser. Three
self-contained experiments — a continuous limit-order-book market driven by 100
heterogeneous rule-based agents, a Monte Carlo auction-theory lab, and a
cross-bookmaker arbitrage scanner — with zero LLM calls and zero token spend.
Every price, revenue and edge is computed locally from the mathematical models in
src/lib/, which you can read end to end.
| Landing — the three labs | Market simulator — candles + fair value, order book, trades, events |
![]() |
![]() |
| Auction theory lab — Monte Carlo revenue comparison | Arbitrage scanner — surebets & +EV |
![]() |
![]() |
100 agents — fundamentalists, chartists, noise traders and market makers — trade
continuously on a price-time-priority limit order book (TICK_SIZE = 0.05).
- Candlestick chart with a fundamental-value overlay
- Live depth, spread, order flow, and regime detection
- Four scenarios: Normal, Bubble & Burst, Fundamental Crash, and a Flash Crash (liquidity withdrawal → V-shaped recovery) that you can inject manually
The model blends Smith-style zero-intelligence mechanics with a Lux-style fundamentalist-vs-chartist interaction: chartists chase the EMA and create herding/overshoot, fundamentalists anchor on fair value and mean-revert, market makers supply liquidity that evaporates under stress. All randomness comes from a deterministic seeded PRNG (mulberry32), so every scenario is reproducible.
Compare the four canonical formats — English, Dutch, Vickrey (second-price sealed-bid), and first-price sealed-bid — under symmetric independent private values.
- Thousands of Monte Carlo runs with risk-neutral or risk-averse bidders
- Verify the Revenue Equivalence Theorem, then see why risk aversion favors the seller under first-price
- Watch the winner's curse eat naive bidders — the reason eBay runs second-price proxy auctions
- Live animated auction with per-bidder valuations
Decimal odds from five sharp sportsbooks are normalized to implied probabilities and scanned for mispricing.
- Surebet detection — back every outcome for a guaranteed return (arb % + ROI)
- +EV scan — positive-expectation legs versus no-vig consensus fair lines
- Kelly-style stake allocation with equal-payout splitting
Research / education only. Odds data is synthetic (static fixtures modeled on real market structure). The scanner never connects to a real bookmaker and never places wagers. Nothing on this site is investment advice.
Requires Node 20+ and pnpm.
pnpm install
# development server on :5000
pnpm dev
# production build + bundled server (dist/server.js)
pnpm build
PORT=5000 pnpm startThe repo ships with headless test harnesses:
pnpm tsx scripts/validate-engines.ts # engine math: order book, 4 scenarios, auctions, odds — 58 checks
pnpm tsx scripts/e2e-flows.ts # user-flow replay: every button/slider/switch path — 39 checks
pnpm validate # eslint + tsc + stylelintA full user-perspective test report is in USER_TEST_REPORT.md.
src/
├── app/ # Next.js App Router
│ ├── market/ # agent market simulator page
│ ├── auctions/ # auction theory lab page
│ └── arbitrage/ # arbitrage scanner page
├── components/
│ ├── market/ # agent-panel, order-book, price-chart, events-feed…
│ └── auctions/ # live-auction, revenue-chart
└── lib/
├── sim/ # market-sim.ts (agents), order-book.ts (LOB), rng.ts
├── auctions/ # engine.ts (equilibrium bids, Monte Carlo)
└── arb/ # odds.ts (surebet/+EV), fixtures.ts
scripts/ # build/dev/start + validation harnesses
Next.js 16 (App Router) · React 19 · TypeScript 5 (strict) · Tailwind CSS 4 · lightweight-charts 5 · zero runtime dependencies beyond React/Next.
Apache-2.0 — see LICENSE.



