PredictionMarketV2 contract deployed on BASE Sepolia.
Overview
When you create a market, you specify:- Actor Handle: The X.com (Twitter) handle to track
- Duration: How long until the market closes (1-720 hours)
Prerequisites
Connect Your Wallet
You need a connected wallet (MetaMask or Coinbase Embedded Wallet) with BASE Sepolia ETH for gas fees.Get testnet ETH from the BASE Sepolia Faucet.
Creating a Market
Enter Actor Handle
Specify the X.com handle to track (e.g.,
elonmusk, sama, zuck).- Do not include the
@symbol - Only letters, numbers, and underscores allowed
- Must be a valid X.com handle
Set Market Duration
Choose how long the market will accept predictions:
- Minimum: 1 hour
- Maximum: 720 hours (30 days)
- Default: 24 hours
Markets have a 1-hour betting cutoff before the end time. Submissions stop 1 hour before
endTime to prevent last-second manipulation.Contract Interaction
Using Web3.js (Frontend)
Here’s how the frontend creates markets:Using Python (Backend)
Creating markets via the Python backend:Market Lifecycle
Once created, markets go through these phases:Smart Contract Details
Contract Address
PredictionMarketV2:0x5174Da96BCA87c78591038DEe9DB1811288c9286 (BASE Sepolia)
Market Struct
Events Emitted
Validation Rules
Example Transaction
Here’s a complete example creating a market for Elon Musk:Querying Markets
Get Market Details
Via API
Best Practices
Choose Popular Handles
Choose Popular Handles
Select X.com handles that:
- Post frequently (daily or multiple times per day)
- Have predictable patterns or topics
- Are verified accounts with authentic content
Set Appropriate Duration
Set Appropriate Duration
- Short duration (1-6 hours): For handles that tweet multiple times daily
- Medium duration (12-48 hours): Most common use case
- Long duration (7+ days): For infrequent posters or specific events
Consider Time Zones
Consider Time Zones
Factor in when your target handle typically posts. Setting market end time during their active hours increases participation.
Troubleshooting
- Transaction Failed
- Market Not Appearing
Common causes:
- Insufficient gas
- Invalid duration (< 1 hour or > 30 days)
- Contract is paused
- Invalid character in handle
Next Steps
After creating a market:- Share the market ID with potential participants
- Monitor submissions as they come in
- Wait for the oracle to resolve after
endTime - Check the winning submission
Submit Predictions
Learn how to submit predictions and stake ETH on markets