1. Configure the market
q. One entry per
outcome counts the shares currently outstanding.
Higher b → prices move less for a given trade. Lower
b → prices move more.
| Outcome name | Shares (qi) | Current price pi | Actions |
|---|
pi = exp(qi / b) / Σ exp(qj / b).
2. Market snapshot
3. Simulate a trade
How LMSR works
The logarithmic market scoring rule (LMSR) is a cost-function market
maker. It defines a potential function
C(q) = b · ln(Σi exp(qi / b)) where
q is the vector of outstanding shares for each outcome and
b controls liquidity.
The instantaneous price of outcome i is the gradient of the
cost function:
pi = exp(qi / b) / Σj exp(qj / b).
Buying Δq shares of outcome i costs
C(q + Δqi) – C(q). Selling shares (negative Δq)
refunds that amount.
Explore the excellent primer from Cultivate Labs for a deeper dive: How does LMSR work?.