Inspiration

People think in stories: “AI spending slows down,” “crypto rallies,” or “the economy avoids a recession.” Prediction markets divide those stories into individual questions.

Expressing one broader view means finding relevant contracts, choosing the right sides, comparing prices, and understanding how the outcomes connect. We wanted to bring those steps into one experience.

That became Thesis: turn a view of the future into one trade.

What it does

Thesis turns a narrative into a weighted basket of live Gemini prediction markets.

Users can explore ready-made stories across economics, crypto, politics, sports, and weather—or describe their own view and build a basket around it. Each basket shows its underlying markets, selected sides, weights, prices, and historical movement.

The Story Index summarizes the basket on a 0–100 scale. Users can explore it with practice money, track their portfolio, and inspect overlapping exposures.

Thesis also offers different ways to participate:

  • Whole: exposure to the entire basket.
  • Safe: priority payout up to a cap.
  • Bold: the remaining payout above that cap.
  • Tiered pools: shared baskets with an ordered payout structure, from capped tiers to an uncapped residual tier.

“Safe” describes payment priority, not a guarantee against losses. Pool return targets are conditional on the available payout.

Users can publish custom stories, explore leaderboards, and view a Solana devnet integration for minting and burning story-token receipts.

The demo uses live market data and practice money. It does not place real Gemini orders or accept real-money deposits. Devnet token minting requires a funded devnet treasury.

How we built it

We built Thesis with Next.js, React, and TypeScript, using server routes for market data, accounts, stories, and pools.

The Gemini integration retrieves events, quotes, historical prices, and volume. Caching, request deduplication, and controlled concurrency help keep the interface responsive.

For market-side prices (p_i) and weights (w_i), the Story Index is:

$$ I = 100 \sum_{i=1}^{n} w_i p_i, \qquad \sum_{i=1}^{n} w_i = 1 $$

Purchase and sale estimates use the underlying ask and bid prices separately.

Our pricing engine models weighted settlement outcomes. It supports exact independent-outcome calculations and a deterministic Gaussian-copula simulation for correlated outcomes. Historical price movements inform dependence estimates, blended with assumptions when trading data is sparse.

The narrative matcher integrates Jev from TypeSafe AI and Anthropic Claude when credentials are configured. Exact rules and keyword matching provide fallback paths, and the interface identifies the matching method.

Accounts and sessions use SQLite, while other application state is stored on disk. We deployed the application to Railway using Docker. The blockchain integration uses Solana’s standard SPL Token program on devnet.

Challenges we ran into

Related markets do not move independently. A crypto rally can affect several contracts at once. Modeling that dependence matters for joint outcomes and the division of payouts.

Market data can be thin. Some contracts have incomplete quotes or little trading history. We needed fallback prices, visible indicative-price labels, and restrained use of historical estimates.

A simple interface can hide complicated risk. We worked to show payment priority, possible losses, spreads, and pool composition without making users interpret a spreadsheet.

Deployment required persistent storage. Accounts, community stories, and pool state need to survive restarts. We also resolved a Railway-specific Dockerfile validation issue.

Accomplishments that we're proud of

  • Connecting broad narratives to inspectable baskets of live prediction markets.
  • Implementing weighted, correlation-aware pricing and payout waterfalls.
  • Bringing story creation, simulated trading, portfolio analysis, and community publishing into one application.
  • Building a Solana devnet token integration.
  • Passing 31 automated tests covering pricing, pool payouts, exposure analysis, sentiment rules, and password handling.
  • Publishing a working web demo with responsive layouts, custom charts, and live market data.

What we learned

An appealing story is only the beginning. Users also need to understand the contracts behind it, the cost of entering and exiting, and what happens when only part of the story comes true.

We learned to distinguish market prices from modeled probabilities, expected payouts from executable quotes, and payment priority from guaranteed safety.

We also learned that deployment architecture is part of the product: saved accounts and reliable state matter as much as the interface.

What's next for Thesis

Our next priority is moving trade validation and repricing fully onto the server. From there, we want to add authenticated exchange execution, stronger settlement reconciliation, and carefully designed on-chain custody.

We also plan to improve correlation calibration, expand the market catalog, strengthen AI matching evaluations, and add email verification and password recovery.

The goal is to make a broad view of the future something users can inspect, price, and manage with confidence.

Built With

Share this project:

Updates

Submission history