How Sorocast Works
Decentralized prediction markets powered by mathematics and game theory
Introduction
A revolutionary approach to prediction markets using automated market makers
Sorocast reimagines prediction markets by eliminating traditional order books in favor of algorithmic market making. Our novel multi-seeder LMSR implementation creates always-available liquidity while maintaining mathematical elegance and fairness. This documentation explains the theory, implementation, and economics behind our decentralized prediction market protocol.
Goal & Vision
Enable open, on-chain prediction markets to crowdsource insights and incentivize accurate forecasting using Soroban smart contracts.
โฆ Platform Capabilities
- โขCreate and trade on outcome-based markets for any event - elections, sports, crypto trends, and more
- โขUse conditional tokens and liquidity pools for transparent, trustless market resolution
- โขImplement reputation and staking mechanics to ensure market quality and truthful participation
โฆ Ecosystem Impact
Brings powerful crowd-driven forecasting to the Stellar ecosystem, showcasing the utility of oracles and smart contracts while opening new DeFi-aligned use cases for speculation, governance, and collective intelligence.
The Disruption
Race to Zero Platform Fees
This platform will be completely open-sourced, creating a fundamental disruption in the prediction market space.
Fully Open
All smart contracts and UI code open-sourced and verifiable
Code is Law
No administrators, no company cuts, only transparent smart contracts
Verifiable
Compile code yourself and verify bytecode hashes on-chain
โ ๏ธ Author Disclaimer
The author receives no fees from this platform. This documentation serves as a complete specification enabling anyone to build competing implementations. The goal is to commoditize prediction market infrastructure and drive platform fees to zero through open competition.
The Problem with Order Books
โ Liquidity Issues
Traditional order books require matching buyers and sellers. If you want to buy YES at $0.70, someone must sell NO at $0.30. This creates friction, wide spreads, and poor liquidity, especially in niche markets.
โ Price Slippage
The "thin market" problem means large trades cause significant price movement. This discourages informed traders from participating, reducing the market's ability to aggregate information effectively.
These fundamental flaws limit prediction markets' potential for accurate price discovery
LMSR: Always Available Pricing
The Logarithmic Market Scoring Rule (LMSR) eliminates the need for counterparties through algorithmic market making.
Seeders
Provide initial capital that creates market liquidity and earn fees from trades. Think of seeders as the insurance companies - they take on risk to make markets possible and profit from trading activity, not from predicting outcomes.
Traders
Buy or sell shares based on their beliefs about outcome probabilities. Traders profit when they buy shares at prices lower than the true probability of an event occurring.
Key Innovation: LMSR provides continuous pricing based on mathematical formulas, ensuring traders can always buy or sell at deterministic prices regardless of market activity.
Visualizing Market Dynamics
An animated comparison illustrating how an Automated Market Maker's (AMM) pricing curve offers continuous liquidity across a range of prices, contrasted with a traditional order book's discrete depth levels and bid-ask spread. Observe the dynamic shifts as market conditions evolve.
Keen-eyed and mathematically inclined viewers might notice a resemblance between the AMM graph, particularly the shape of the buy and sell curves, and an inverted logistic function. This is indeed an expected characteristic. LMSR utilizes a softmax function to determine pricing. When you consider a cross-section of the softmax function in one particular direction (isolating the probability of one outcome against all others), it mathematically simplifies to a logistic function. Therefore, the observed sigmoidal shape in the visualization is a direct consequence of the underlying mathematics and is to scale. More detailed explanations of the mathematical underpinnings are provided in later sections.
LMSR vs Order Books
โ LMSR Advantages
- โขAlways available liquidity without counterparties
- โขDeterministic pricing based on mathematical formulas
- โขWorks well in low-volume markets
- โขBounded loss for liquidity providers
- โขNo bid-ask spread (in the traditional sense)
โ LMSR Challenges
- โขSeeders likely lose most capital at resolution
- โขSeeder returns depend on uncertain trading volume
- โขPrice impact for large trades can be significant
- โขMore complex mathematics than order books
- โขRequires initial seeding capital
๐ฐ Money Conservation Principle
All money is fully collateralized and conserved within the market. The protocol itself never takes any funds - all money flows only between participants (seeders and traders). This creates a zero-sum game where profits and losses balance exactly, ensuring market integrity.
A Novel Multi-Seeder LMSR
Revolutionary Design
Sorocast implements a custom LMSR that allows seeders to join at any time, even after trading has started. Traditional implementations have a fixed liquidity parameter set at market creation - ours dynamically grows as new seeders join.
Dynamic Liquidity
The effective liquidity parameter increases as new seeders join, improving market depth over time.
Individual Markets
Each seeder has their own market. When traders trade, shares are traded in each seeder's individual market proportionally.
Unified Interface
Traders see a single market with unified pricing, while the protocol manages the complexity of multiple individual markets seamlessly.
The Mathematics
Cost Function
The LMSR uses a cost function that determines how much traders pay to buy shares. This function ensures that prices always sum to 1 (100%) and provides bounded loss for liquidity providers.
The market maintains a cost function where is the vector of shares outstanding for seeder j, is the liquidity parameter for seeder j, is seeder j's prior probability for outcome i, and is an arbitrary constant. Only the difference in cost matters, not the actual value, similar to comparing definite to indefinite integrals.
Liquidity Parameter Calculation
The liquidity parameter determines market depth and maximum loss. For the initial seeder with uniform prior for all outcomes:
For subsequent seeders joining at current market probabilities :
Where is the minimum probability across all outcomes at the time of seeding.
Multiple Seeders Mathematics
When multiple seeders join a market, each with their own priors and b values, they don't simply combine into one larger b parameter. Instead:
Individual Cost Functions
Each seeder j has their own cost function based on their individual b value and prior:
Proportional q-splitting
Unlike the single universal shares vector for a single seeder LMSR, each new seeder j gets a brand new initialized when they seed and updated like so when somebody trades:
Combined Cost Function
The combined cost function is the sum of individual cost functions, each incorporating the seeder's prior and shares sold:
Combined Pricing
The market price for outcome i is determined by the contributions from all seeders, each with their own priors:
Where is seeder j's prior probability for outcome i, is their shares sold, and is seeder j's liquidity parameter.
New Seeder Price Neutrality
When new seeders join, their priors are set to current market prices. This ensures that adding a new seeder doesn't immediately change market prices. If a new seeder's priors were different from current prices, their entry would shift the market, creating potential manipulation opportunities:
Price Calculation
For a single seeder with prior for outcome i, prices are calculated as:
With multiple seeders, each with their own priors and liquidity parameters, the price is:
Prices always sum to one: . This property ensures that the prices can be interpreted as probabilities.
Cost of Trading
When traders buy or sell shares, they pay the difference in the total cost function before and after the trade:
This can be decomposed as the sum of individual cost contributions from all seeders:
Each seeder's individual cost function contributes to the total cost of the trade. This ensures that the risk is properly distributed among seeders according to their individual b values and priors.
Fee Structure
Fees are only applied to buy orders, not sell orders. The fee structure is designed to award seeders for taking the risk while not being too high to drive away prospective buyers:
This constant fee ensures seeders receive compensation for providing liquidity, while keeping trading costs predictable and reasonable for traders.
Seeder Economics
The Business of Uncertainty
Seeders are uncertainty merchants.
They profit from the journey, not the destination.
Fee Collection
Earn fees on every trade. The more trading activity, the more fees collected. High-volume controversial markets are a seeder's best friend.
Uncertainty Profits
Markets that stay uncertain and active generate the most fees. Price swings and changing sentiment create trading volume.
Underdog Windfalls
If a low-probability outcome wins, seeders can make significant profits on their capital in addition to collected fees.
The ideal seeder market: Stays controversial for a long time, generates high volume with traders on both sides, and has multiple price swings as new information emerges.
Secondary Market for b-tokens
Seeders can exit positions before market resolution through our innovative secondary market.
b-tokens
Your seed becomes b-tokens representing your share of market liquidity and fee rights
Order Book
Simple auction mechanism where buyers and sellers set their own prices
Dynamic Pricing
b-tokens trade at premiums or discounts based on market conditions
For Sellers
- โข Exit positions before resolution
- โข Realize profits early
- โข Manage risk exposure
- โข Redeploy capital efficiently
For Buyers
- โข Enter established markets
- โข Buy b-tokens at discounts
- โข Acquire specific b-values
- โข Diversify across markets
How to Participate
Trading
Buy low, sell high, profit from knowledge
Buy shares when you believe the market price is wrong. Your profit comes from the difference between your purchase price and the final resolution price (1 XLM for winning outcomes, 0 for losing).
Example: If a market shows 30% chance of an event but you believe it's 70%, buy YES shares. If correct, you profit from the 40% difference.
Trading Strategies
Seeding
Provide liquidity, collect fees, enable markets
Provide liquidity to markets and earn fees from trading activity. Your profit comes primarily from collecting fees during the market's active life, though you can also profit if an underdog outcome wins.
Example: Seed 1000 XLM in a market that generates 100,000 XLM volume. With 2% fees, you collect 2,000 XLM. If a 10% underdog wins, you could profit even more.
Seeding Strategies
Market Parameters
| Parameter | Value | Purpose |
|---|---|---|
| Creation Bond | 1000 XLM | Prevents spam markets and ensures creator commitment. Returned after successful resolution. |
| Minimum Seed | 1000 XLM | Ensures sufficient liquidity for trading. Higher seeds create deeper markets. |
| Fee Structure | 0.02 XLM/share | Flat fee per share to encourage trading volume and price discovery. |
| Liquidity (b) | Dynamic | Calculated as for each seeder. |
| Resolution Time | Creator Set | When the market will resolve. Can be date or event-based. |
Note: Parameters are subject to change based on testing and market feedback. These values are placeholders for initial markets.
Fair Market Design
Starting Fair
All markets begin with uniform priors where each outcome has equal probability, ensuring a neutral starting point without bias.
Starting with uniform priors ensures no manipulation and provides a fair starting point. For the initial seeder, the minimum probability is , so their maximum loss is .
Market Rules
Seeders can also trade to correct prices if they believe the market is mispriced, aligning their incentives with market accuracy
New seeders enter at current prices, preventing dilution of existing positions and ensuring fair participation
Seed capital is locked until market resolution, preventing liquidity withdrawal attacks
Trading fees are distributed proportionally to seeders based on their individual b values
Market creators must post a bond to create markets, ensuring they have skin in the game
Technical Implementation
Built on Stellar blockchain for fast, low-cost transactions with robust smart contracts.
Smart Contracts
On-chain contracts for market creation, trading, seeding, and resolution with full transparency
LMSR Calculations
On-chain mathematical operations for transparent and verifiable pricing using fixed-point arithmetic
Oracle System
Decentralized oracle system for reliable market resolution without central authority
Web Interface
User-friendly interface for market creation, trading, and portfolio management
Mathematical Implementation Details
Fixed-Point Arithmetic
Stroop Conversion
XLM amounts multiplied by 10โท to convert to stroops (1 XLM = 10โท stroops) XLM amounts multiplied by 10โท to convert to stroops (1 XLM = 10โท stroops), ensuring all calculations work with integers and maintain precision down to the smallest unit
Rust Fixed Crate
Uses the Rust fixed crate's built-in ln() and exp() functions, which provide deterministic results across all blockchain nodes without custom implementations
Deterministic Results
The fixed crate ensures identical results across all network nodes, preventing consensus issues that could arise from floating-point arithmetic
Computational Efficiency
LMSR Operations
- ln() and exp():~10-50ns
- Cost function:~100ns
- Price calc:~50ns
- Total per trade:~200ns
Cryptographic Operations
- Ed25519 verification:~50-100ฮผs
- Transaction auth:~100-200ฮผs
- Crypto overhead:~300ฮผs
Mathematical operations are 1000x faster than cryptographic operations, making LMSR calculations negligible in terms of computational cost.
Risk Warning
All prediction market participation involves risk:
Seeders
Should expect to lose most or all seed capital at resolution. Profitability depends entirely on collecting sufficient trading fees during the market's active life, which cannot be guaranteed.
Traders
Can lose their entire stake if they bet on incorrect outcomes or sell at unfavorable prices. Market manipulation and unexpected events can impact outcomes.
Only participate with funds you can afford to lose. Past performance of similar markets is not indicative of future results.
Further Reading
- ๐Ludwig Boltzmann, "Studien รผber das Gleichgewicht der lebendigen Kraft zwischen bewegten materiellen Punkten" (1868)
- ๐Robin Hanson, "Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation"
- ๐Abraham Othman, et al., "Automated Market Makers for Prediction Markets"
- ๐Sorocast Technical Whitepaper (coming soon)
