Pricing Logic
Written By neostake
Last updated 4 months ago
How does the price logic work in detail?
NeoStake uses the Logarithmic Market Scoring Rule (LMSR) mechanism.
Developed by Robin Hanson, it is the most widely used automated market-maker model in prediction markets (Polymarket, Augur, etc.).
1. The Core Formula
The LMSR has a cost function:
C(q) = b * ln( Ξ£ ( e^(q_i / b) ) )q_i= number of shares bought for outcome ib= liquidity parameter (e.g. 100 or 110 in NeoStake)n= number of outcomes
The price for outcome i is derived from the partial derivative:
p_i = e^(q_i / b) / ( Ξ£ e^(q_j / b) )Interpretation:
Price
p_iis always between 0 and 1 (0β100%)All prices always sum to 1 (100%)
Price depends only on the current inventory of shares
2. Example with 2 Outcomes (YES / NO)
Set b = 100. Initial state: q_YES = q_NO = 0.
p_YES = e^(0/100) / ( e^(0/100) + e^(0/100) ) = 0.5
p_NO = 0.5Start: 50% vs. 50%
A user buys 100 shares on YES
New state: q_YES = 100, q_NO = 0.
p_YES = e^(100/100) / ( e^(100/100) + e^(0/100) ) = e^1 / (e^1 + 1) β 0.731
p_NO = 0.269Effect: YES price jumps to ~73%, NO drops to ~27%.
3. Trade Costs
The cost of a trade is the difference in the cost function:
Cost = C(q_new) - C(q_old)Example: buying 100 YES shares with b = 100.
C(0,0) = 100 * ln(e^0 + e^0) = 100 * ln(2) = 69.31
C(100,0) = 100 * ln(e^1 + 1) = 100 * ln(3.718) = 131.03
Cost = 131.03 - 69.31 = 61.72Even though 100 shares were bought, the cost is only 61.72, because the price increases gradually (slippage).
4. Multi-Outcome Example (A, B, C)
Start: all equal β each 33%.
p_A = p_B = p_C = 0.333Buying 100 shares on A:
p_A = e^(100/100) / ( e^(100/100) + 1 + 1 ) = 2.718 / 4.718 β 0.576
p_B = p_C = 0.212Result: A rises to ~58%, the others fall.
5. Cash-Out Logic (Position Value)
The mark-to-market value of your position before resolution:
Value = Shares CurrentPrice Payout(Example: Payout = 1 token per winning share)
You hold 100 YES shares
Current market price:
p_YES = 0.73
Value = 100 * 0.73 = 73Position is worth 73 tokens.
You can sell anytime β LMSR guarantees liquidity.
The exact cash-out when selling is also computed via the cost function:
CashOut_exact = C(q_old) - C(q_new)6. Final Settlement
At resolution, only the winning outcome pays out 1 token per share; all others are worth 0.
Example: 100 YES shares, bought for 61.72.
If YES wins β Payout = 100 β Profit = 100 - 61.72 = +38.28
If NO wins β Payout = 0 β Loss = 0 - 61.72 = -61.727. Advantages of LMSR
Always liquid β You can buy/sell anytime
Smooth & predictable β Prices change continuously, not in jumps
Fair & transparent β No manual price-setters, no insider influence
Supports multiple outcomes β Prices adjust automatically