Skip to main content
v0 Alpha — BASE Sepolia TestnetThis quickstart uses testnet ETH. Get free testnet ETH from the BASE Sepolia faucet.

What You’ll Build

In this quickstart, you’ll:
  1. Connect your wallet to BASE Sepolia
  2. Browse active prediction markets
  3. Submit a prediction with a small ETH stake
  4. Claim your payout if you win
Time: ~5 minutes
Cost: 0.001+ ETH (testnet — free from faucet)

Prerequisites

MetaMask Wallet

Install MetaMask browser extension

BASE Sepolia ETH

Get free testnet ETH from the faucet

Step 1: Connect to BASE Sepolia

1

Add BASE Sepolia Network

Open MetaMask and add the BASE Sepolia testnet:
Network Name: BASE Sepolia
RPC URL: https://sepolia.base.org
Chain ID: 84532
Currency Symbol: ETH
Block Explorer: https://sepolia.basescan.org
2

Get Testnet ETH

Visit the BASE Sepolia faucet and request 0.05 ETH (free). You’ll need this for gas fees and predictions.
3

Verify Balance

Check your MetaMask — you should see ~0.05 ETH on BASE Sepolia.

Step 2: Interact with PredictionMarketV2

The deployed contract address on BASE Sepolia:
0x5174Da96BCA87c78591038DEe9DB1811288c9286
const Web3 = require('web3');
const web3 = new Web3('https://sepolia.base.org');

const contractAddress = '0x5174Da96BCA87c78591038DEe9DB1811288c9286';
const abi = [ /* Get ABI from basescan or docs */ ];

const contract = new web3.eth.Contract(abi, contractAddress);

// Get active markets
const marketCount = await contract.methods.marketCount().call();
console.log(`Total markets: ${marketCount}`);

Step 3: Browse Active Markets

Query the REST API to see active markets:
curl https://proteus-production-6213.up.railway.app/api/chain/markets?status=active
Response:
{
  "markets": [
    {
      "id": 5,
      "actorHandle": "@elonmusk",
      "endTime": 1735689600,
      "totalPool": "0.125",
      "resolved": false,
      "submissions": 8
    }
  ]
}

Step 4: Submit Your Prediction

1

Choose a Market

Pick an active market (one where resolved: false and endTime is in the future).
2

Craft Your Prediction

Write the exact text you think the actor will post:
  • Max length: 280 characters
  • Empty string → use __NULL__ (predicts silence)
  • Be precise — every character counts in Levenshtein scoring
3

Submit On-Chain

Call createSubmission() with your prediction + ETH stake:
const marketId = 5;
const predictedText = "Starship flight 2 confirmed for March. Humanity becomes multiplanetary or dies trying.";
const stakeAmount = web3.utils.toWei('0.01', 'ether'); // 0.01 ETH stake

await contract.methods.createSubmission(marketId, predictedText).send({
  from: yourAddress,
  value: stakeAmount,
  gas: 300000
});
Requirements:
  • Minimum stake: 0.001 ETH
  • Must submit before betting cutoff (1 hour before market end)

Step 5: Wait for Resolution

After the market ends, an oracle resolves it by submitting the actual text:
// Oracle calls (you can't call this — only contract owner)
await contract.methods.resolveMarket(marketId, actualText).send({
  from: oracleAddress
});
The contract computes Levenshtein distance for all submissions and determines the winner (closest match).

Step 6: Claim Your Payout

If you won (or placed in the money), claim your payout:
const submissionId = 42; // Your submission ID from SubmissionCreated event

await contract.methods.claimPayout(submissionId).send({
  from: yourAddress,
  gas: 150000
});
Payout calculation:
  • Winner gets: (totalPool - 7% platform fee) * 1.0
  • If your submission won, you receive the entire net pool
  • 7% fee split: Genesis NFT holders (1.4%), Oracles (2%), Creators (1%), Nodes (1%), Builder Pool (2%)

What’s Next?

How It Works

Deep dive into Levenshtein distance and market mechanics

Create a Market

Launch your own prediction market

Smart Contracts

Explore the on-chain implementation

API Reference

Complete API documentation

Worked Example: Elon Musk Market

Market: What will @elonmusk post?
SubmitterPredictionDistanceResult
AI (Claude)Starship flight 2 confirmed for March. Humanity becomes multiplanetary or dies trying.12✅ Winner
Human fanThe future of humanity is Mars and beyond59Lost
Random bota8j3kd9xmz pqlw7 MARS ufk2 rocket lol72Lost
Actual text: Starship flight 2 is GO for March. Humanity becomes multiplanetary or we die trying. The AI won with only 12 character edits. The 47-edit gap between AI and human is the entire pool.
Strategy: Use AI roleplay models (Claude, GPT) to predict tone and vocabulary. Insider information (seeing a draft tweet) is even better — you can get within 1-5 edits.

Build docs developers (and LLMs) love