Contract Reference
Core contracts deployed on Monad.
Contract Overview
| Contract | Description |
|---|
PredictionMarket.sol | Core SKC logic — create markets, predict, resolve, claim |
MarketFactory.sol | Factory for deploying isolated PredictionMarket instances |
FixedPointMath.sol | Library for on-chain ln() and cross-entropy scoring |
Market Parameters
| Parameter | Default | Description |
|---|
| Alpha (α) | 20% | Stop probability per prediction |
| K | 2 | Last k predictors get flat reward |
| Flat Reward (R) | 0.01 ETH | Reward per last-k predictor |
| Bond | 0.1 ETH | Deposit per prediction |
| Liquidity (b) | 1.0 ETH | LMSR scaling parameter |
| Initial Price | 0.5 | Starting market price |
Write Functions
createMarket
function createMarket(
string calldata question,
uint256 alpha,
uint256 k,
uint256 flatReward,
uint256 bondAmount,
uint256 liquidityParam,
uint256 initialPrice
) external payable returns (uint256 marketId)
predict
function predict(uint256 marketId, uint256 probability) external payable
Submit a prediction with bond attached. One prediction per wallet per market.
claimPayout
function claimPayout(uint256 marketId) external
forceResolve
function forceResolve(uint256 marketId) external
Force-resolve a stale market. Owner can call anytime, anyone can call after 2 days of inactivity.
Read Functions
| Function | Returns | Description |
|---|
getMarketCount() | uint256 | Total markets created |
getMarketInfo(id) | tuple | Core market data (question, price, status) |
getMarketParams(id) | tuple | Market configuration (alpha, k, bond, etc.) |
getPrediction(id, idx) | tuple | Specific prediction details |
getPayoutAmount(id, addr) | uint256 | Net payout amount (post-fee) |
isMarketActive(id) | bool | Whether market is accepting predictions |
hasPredicted(id, addr) | bool | Whether address has already predicted |
Events
event MarketCreated(uint256 indexed marketId, string question, ...)
event PredictionMade(uint256 indexed marketId, address indexed predictor, ...)
event MarketResolved(uint256 indexed marketId, uint256 finalPrice, ...)
event PayoutClaimed(uint256 indexed marketId, address indexed predictor, ...)
Alpha Tuning Guide
| Alpha | Avg Predictions | Best For |
|---|
| 10% | ~10 | Deep analysis, many participants |
| 20% | ~5 | Balanced (default) |
| 33% | ~3 | Quick resolution |
| 50% | ~2 | Very fast, binary questions |