PlayBase: The First On-Chain Sports Battle Royale

100 Players. 1 Survivor. The ultimate high-stakes elimination game on Base.


Inspiration

The world of sports betting is often slow, solitary, and dominated by "the house." You place a bet, wait three hours for the game to end, and either win or lose in isolation.

We wanted to bring back the energy of watching the game on the couch with your friends shouting at the TV, predicting the next play, and bragging when you call a touchdown before it happens.

We combined that social, play-by-play excitement with the adrenaline of Battle Royale games like Fortnite and Warzone.

We asked ourselves: What if we turned every drive into a survival round?

Instead of betting against a faceless bookie, you are in a lobby with 99 other players. You aren't waiting for the final score; you are betting on the next 3 minutes. "Will they convert this 3rd down?" "Will the next pass be over 10 yards?"

It is fast, it is social, and it is brutal. If you are wrong, you are out. If you are right, you survive to the next drive. The last player standing takes the entire pot.

What It Does

PlayBase is a decentralized gaming platform built on the Base L2 network that features two distinct game modes:

1. Prop Battle Royale (Live)

This is an elimination-style betting game.

  1. Entry: 100 players buy in with $10 USDC (Or As agreed upon by Players)
  2. The Pot: The prize pool hits $1,000 USDC.
  3. The Game Loop:
    • Every 3-5 minutes, a live NFL prop bet appears (e.g., "Will the Lions score on this drive?").
    • Players have 30 seconds to vote YES or NO.
    • Chainlink Functions verify the outcome using real-time data from Sportradar.
  4. Elimination: If you predict incorrectly, you are eliminated from the smart contract.
  5. Victory: The game continues until only one survivor remains (or a small group splits the pot).

2. Degen Trading League

This is a fantasy-style portfolio competition.

  1. Draft: Players draft a portfolio of "prediction tokens" representing specific outcomes (e.g., "Mahomes > 300 Yards").
  2. Trade: These tokens can be swapped instantly on a bonding curve AMM.
  3. Score: As the game progresses, token values fluctuate based on live probability.
  4. Win: The player with the highest portfolio value at the end of the game wins the league pot.

How We Built It

We architected a hybrid system that combines the speed of off-chain data with the trustlessness of on-chain settlement.

1. The Smart Contract (Base Sepolia)

The core logic lives in BattleRoyaleOracle.sol. It handles:

  • Staking: Securely holding player USDC.
  • State Management: Tracking active players vs. eliminated players.
  • Settlement: Using FunctionsClient to request trustless outcomes.

2. The Data Pipeline (Deep Research & MCP Integration)

This was the most technically complex part of our build. We could not just rely on a single API. We built a robust aggregation layer using the Astera Model Context Protocol (MCP).

  • Primary Source (Astera MCP): We run a custom MCP server that aggregates data from 27 different sports betting tools. It calculates the Expected Value (EV) of specific props to ensure we only present fair, high-quality questions to players.
  • Fallback (The Odds API): If Astera is unreachable, we failover to The Odds API to ensure the game never stops.
  • Verification (Sportradar): For the final on-chain settlement, we use Chainlink Functions to fetch cryptographically verifiable results directly from Sportradar's API.

3. Chainlink Functions Implementation

We moved beyond simple price feeds to build a custom Computational Oracle. We wrote custom JavaScript source code stored on-chain that executes within the Chainlink DON (Decentralized Oracle Network).

The script (sportradar-outcome-fetcher.js) performs the following logic inside the DON:

  1. Receives a request with metadata: { gameId, playId, propType: "next_play_first_down" }.
  2. Fetches the raw play-by-play JSON from the Sportradar API.
  3. Parses the specific drive and play event to determine the result.
  4. Returns a deterministic byte-encoded result (1 for YES, 2 for NO) to the smart contract.

This ensures that no single entity (including us) can manipulate the outcome of a round.

4. Deployment & Infrastructure

We have successfully deployed our entire smart contract infrastructure to the Base Sepolia testnet.

  • Smart Contracts: The BattleRoyaleOracle contract is live on Base Sepolia, managing all game logic and USDC staking.
  • Oracle Integration: Our custom Chainlink Functions consumer is deployed and connected to the Chainlink Base Sepolia DON (ID: 525), enabling real-time data verification.
  • Frontend Hosting: The Next.js application is deployed on Vercel, providing a fast and responsive user interface that connects directly to our Base Sepolia contracts.

Challenges We Faced

The "Oracle Latency" Problem

On-chain transactions take time. Real-time sports happen instantly.

  • Challenge: Waiting for a block confirmation to resolve a "Will they score?" prop is too slow if the next play has already started.
  • Solution: We implemented an Optimistic UI state where the frontend reflects the likely outcome immediately via WebSockets, while the smart contract settles asynchronously in the background via Chainlink.

API Fragmentation

We initially wanted to use Polymarket and Kalshi for all our odds.

  • Challenge: Our research found that while their markets are robust, their APIs (specifically Polymarket's Gamma API) were limited for granular, play-by-play NFL props.
  • Solution: We pivoted to using Astera MCP to aggregate data. This allowed us to "simulate" a prediction market by calculating fair odds from 50+ bookmakers, effectively creating our own micro-markets on-chain.

Accomplishments That We Are Proud Of

  • Custom Chainlink Oracle: We did not just use a price feed; we wrote custom JavaScript logic for the Chainlink DON to parse complex JSON data from Sportradar.
  • MCP Integration: Successfully implementing the Model Context Protocol to make our backend "AI-ready" and capable of switching data sources intelligently.
  • Seamless UX: The game feels like a Web2 app (fast, responsive) but settles entirely on Web3 rails.

What We Learned

  • The Power of Base: Deploying on Base was incredibly cheap and fast, which is essential for a game that requires frequent interactions.
  • Oracle Design: We learned that "trustless" does not mean "direct." You need a robust verification layer (Chainlink Functions) to bridge the gap between Web2 APIs and Web3 contracts.
  • Market Microstructure: Deep diving into Polymarket and Kalshi taught us how binary options are priced and how to calculate implied probabilities from moneyline odds.

What Is Next for PlayBase

  • Base Mini App Integration: We are actively working on integrating Coinbase's OnchainKit to transform PlayBase into a native Base Mini App. This will allow users to connect their wallets and play directly within the Coinbase Wallet mobile app, significantly reducing friction for new users.
  • "Degen League" Expansion: Adding more complex derivative tokens (e.g., leveraged player performance tokens).
  • Touchdown Tokens: Bonding curve tokens for individual players that rise in value as they score fantasy points.
  • Mainnet Launch: Moving from Base Sepolia to Base Mainnet for the NFL Playoffs.

Built With

  • base
  • chainlink
  • circle
  • coinbase
  • cryptocurrency
  • klashi
  • oracle
  • polymarket
  • stable-coin
  • usdc
  • vercel
Share this project:

Updates