🚀 Inspiration

Prediction markets already surface brilliant signals, but we kept losing the thread between spotting a mispricing, proving it’s incoherent, logging the alert, and prepping the resolution receipts. Kairos was born to be that “markets mission control”—something a solo trader or a newsroom desk can open and instantly see how AI agents, watchlists, math, and evidence fit together without tab chaos.

🛠️ How I Built It

Kairos is a "proof-first" toolkit that integrates multiple market data APIs into a single, coherent workspace.

Core Stack:

  • Framework: Next.js 15 (App Router) with React 19, Server Components, and Server Actions.
  • Auth & DB: NextAuth 5 beta with the Prisma adapter connecting to a Neon/Postgres database.
  • Styling: Tailwind v4 with Radix UI, Lucide icons, and Recharts for charts.

Data Layer & Modules:

  • Agent & Memory: A Claude-powered copilot with canned jobs. Agent memory is stored in the Postgres claudeMemory JSONB field and managed via /api/memory, allowing all modules to share state.
  • Lists & Alerts: Full integration with the Nevua API for watchlist CRUD, tag/keyphrase search, and minting alert JSON for subscriptions, all handled server-side.
  • Newsroom Mode: Calls the Adjacent API for market and news data, pairing market movers with forward-looking journalism.
  • Users Portfolios: You can directly see public portfolios and copy them. !

  • Some sub jobs that the claude agent can tackle for experienced traders and developers*

  • Coherence: Streams live Polymarket prices, encodes overlapping markets into a boolean matrix, and runs a feasibility check. Violations generate a hedge vector and a proof. Price history is cached via a custom /api/polymarket/price-history endpoint.

  • Resolve: Turns any market into a deterministic spec that watches multiple price feeds, enforces a quorum, and exports a receipts bundle.

  • Factor: Claude sketches a factor graph, and we run lightweight message passing to keep beliefs interpretable, using a knapsack-style "attention budget" to find the strongest evidence.

  • Arena: Red-teams resolution criteria to find exploits, treating them as set-cover constraints to suggest a minimal patch mask.

🧗 Challenges I Faced

  • API Integration: Wiring four external APIs (Polymarket, Nevua, Adjacent, Claude) with different auth styles while keeping all keys server-only was a major challenge, especially using the new React 19 App Router.
  • Data Reliability: Polymarket data can have CORS or timeout issues. I solved this by building my own caching API route (/api/polymarket/price-history) and providing seeded demo fallbacks (like fallbackTopicMarkets) to ensure the UI is always functional and offline-friendly.
  • Modern Stack: Getting NextAuth 5 beta, Prisma, and React Server Components to work together seamlessly for data flow and authentication was a learning curve.
  • UX/Security: Translating a qualitative prompt (e.g., "ping me if price jumps 5%") into the strict JSON format required by the Nevua alerts API, without exposing any secrets on the client-side, required careful design of Server Actions.

🧠 What I Learned

  • React Server Components and Server Actions drastically simplify building products that orchestrate multiple APIs, as all secrets and complex logic can stay on the server.
  • Traders and analysts trust automation more when they can see the math. Providing explainable math (coherence proofs, factor attribution, loophole coverage) is more valuable than a "black-box AI" solution.
  • Good fallbacks are essential, especially for hackathons or demos where live APIs will inevitably fail. Shipping with seeded data (e.g., fallbackTopicMarkets) makes the project resilient.
  • Prompt engineering for agents is far easier when the rest of the application stack is built on typed schemas (like the Nevua alert payloads).

✨ What's Next

  • Connect to Polymarket’s order API (the @polymarket/clob-client is already installed) so the "Coherence" module can execute trade vectors.
  • Stream live news and price deltas via websockets instead of refetching.
  • Expand the "Arena" module to allow community submissions for red-teaming resolution specs.
  • Ship a public API so other desks can drop Kairos modules into their own workflows.

A HUGE SHOUTOUT TO NUVEA and ADJACENT for providing me personally with their APIs, it was such an amazing experience, i learnt so much. Please go check them out !

Built With

  • adjacent-api
  • anthropic-claude-api
  • framer-motion
  • nevua-api
  • next.js-15
  • nextauth-5
  • polymarket-api
  • postgresql-(neon)
  • prisma
  • radix-ui
  • react-19
  • recharts
  • server
  • server-components
  • tailwind-css-v4
  • typescript
Share this project:

Updates