Glossary

505 terms from Learning Prediction Markets

# A B C D E F G H I K L M N O P Q R S T U V W X

#

"12 Factor App"
[12factor.net](https://12factor.net/). The twelve-factor methodology for building software-as-a-service applications. Factor III (Config) directly addresses our approach to environment variables and secrets management. → Chapter 6 Further Reading
"Add Python to PATH"
this is critical. Alternatively, install via the Windows Store or use the `winget` package manager: → Chapter 6: Setting Up Your Python Toolkit
"Algorithmic Trading and DMA" by Barry Johnson
The definitive reference on execution quality, order types, and market microstructure. While focused on traditional markets, the execution principles apply directly to prediction markets. → Further Reading: Chapter 19
"Apache Parquet format"
[parquet.apache.org](https://parquet.apache.org/). Documentation for the Parquet columnar storage format. Understanding the format helps you make informed decisions about compression and partitioning for larger datasets. → Chapter 6 Further Reading
"Fooled by Randomness" by Nassim Nicholas Taleb
Essential reading on the human tendency to mistake noise for signal. Critical for maintaining discipline during drawdowns and winning streaks. → Further Reading: Chapter 19
"httpx" library documentation
[www.python-httpx.org](https://www.python-httpx.org/). Documentation for `httpx`, the async-capable HTTP library. The sections on async usage, connection pooling, and timeouts are relevant to our concurrent API access patterns. → Chapter 6 Further Reading
"Matplotlib documentation"
[matplotlib.org/stable](https://matplotlib.org/stable/). The official documentation includes tutorials, examples, and a comprehensive gallery. The "Customizing Matplotlib" section is particularly useful for establishing consistent visual styles. → Chapter 6 Further Reading
"NumPy documentation"
[numpy.org/doc](https://numpy.org/doc/stable/). The official NumPy documentation, including the user guide and API reference. The sections on array operations and broadcasting are essential background. → Chapter 6 Further Reading
"Pandas documentation"
[pandas.pydata.org/docs](https://pandas.pydata.org/docs/). Comprehensive documentation including the "10 Minutes to pandas" tutorial, user guide, and API reference. → Chapter 6 Further Reading
"Python Packaging User Guide"
[packaging.python.org](https://packaging.python.org/). The official guide to packaging Python projects, including `setup.py`, `pyproject.toml`, virtual environments, and dependency management. Essential reference material. → Chapter 6 Further Reading
"python-dotenv documentation"
[pypi.org/project/python-dotenv](https://pypi.org/project/python-dotenv/). Documentation for the `python-dotenv` library used for loading `.env` files. → Chapter 6 Further Reading
"requests" library documentation
[docs.python-requests.org](https://docs.python-requests.org/). The official documentation for the `requests` library. The advanced usage section covers session objects, retry adapters, and authentication hooks. → Chapter 6 Further Reading
"RESTful API Design" by various authors
Understanding REST API conventions helps you integrate with prediction market platforms more effectively and build better internal APIs for your trading system. → Further Reading: Chapter 19
"Seaborn documentation"
[seaborn.pydata.org](https://seaborn.pydata.org/). Documentation for seaborn, including its tutorial on statistical visualization and the distribution, regression, and categorical plotting functions. → Chapter 6 Further Reading
"SQLite documentation"
[sqlite.org/docs.html](https://sqlite.org/docs.html). The official SQLite documentation. The "SQL As Understood By SQLite" section and the documentation on pragmas (like `journal_mode=WAL`) are useful references. → Chapter 6 Further Reading
"The Art of Execution" by Lee Freeman-Shor
Based on real portfolio manager data, this book examines how execution decisions (when to cut losses, when to add to winners) determine outcomes independent of stock selection skill. → Further Reading: Chapter 19
"The Checklist Manifesto" by Atul Gawande
While not about trading, this book makes a compelling case for using checklists in high-stakes operations. Directly applicable to trading deployment and daily operations checklists. → Further Reading: Chapter 19
"The Daily Trading Coach" by Brett Steenbarger
101 practical lessons for building psychological resilience in trading. Useful for developing self-awareness about emotional patterns. → Further Reading: Chapter 19
"Thinking in Bets" by Annie Duke
A former professional poker player applies decision-making frameworks to situations of uncertainty. Directly relevant to prediction market trading where outcomes are probabilistic. → Further Reading: Chapter 19
"Trading in the Zone" by Mark Douglas
The classic text on trading psychology. Covers the mental framework needed to execute a probabilistic edge consistently despite emotional pressures. → Further Reading: Chapter 19
$120.00
Maximum profit (DeSantis wins): 500 x ($1.00 - $0.24) = **$380.00** - Maximum loss (DeSantis loses): 500 x $0.24 = **-$120.00** - Break-even: DeSantis must win (binary outcome). → Case Study 1: Anatomy of a Multi-Outcome Election Market
$960.00
Guaranteed payout: 1,000 x $1.00 = **$1,000.00** (one outcome always wins) - Guaranteed profit: **$40.00** (4.2% return, risk-free) → Case Study 1: Anatomy of a Multi-Outcome Election Market
+2.20%
**Probability of profit**: 42% (if C, D, or F wins) - **Probability of loss**: 58% (if anyone else wins) - **Maximum loss**: -12.4% (bounded and manageable) - **Maximum gain**: +38.2% (if Whitmer wins) - **Sharpe-like ratio**: 2.20% / 19.3% = 0.114 → Case Study 1: Optimizing a Multi-Candidate Election Portfolio
09:22
A strong signal fires for Market B. The bot submits a BUY order for 45 contracts at 0.38. (Risk check passes: 45 < 50 order limit, 0+45 < 100 position limit.) → Case Study 2: Post-Mortem: When the Bot Went Wrong
09:23
The order is submitted to the exchange but does not fill immediately. → Case Study 2: Post-Mortem: When the Bot Went Wrong
09:25
Another strong signal fires for Market B (the price has moved further in the favorable direction). The bot submits a second BUY order for 42 contracts at 0.36. → Case Study 2: Post-Mortem: When the Bot Went Wrong
09:27
Both orders fill within seconds of each other. The bot now has a position of 87 contracts (45 + 42), which is within the 100-contract limit. But if the first order had been for 55 contracts and the second for 55, the position would have been 110 -- exceeding the limit. → Case Study 2: Post-Mortem: When the Bot Went Wrong
09:30
A third signal fires. The bot submits a BUY order for 40 contracts. Risk check: - Position limit: current_position(87) + order_quantity(40) = 127 > 100. FAIL. → Case Study 2: Post-Mortem: When the Bot Went Wrong
1. B
Virtual environments isolate dependencies per project, preventing version conflicts between projects and the system Python. → Chapter 6 Quiz
1. Choice of scoring rule:
Brier score: Easy to explain, bounded, decomposable -- good for educational settings - Log score: Stronger incentives for precise probabilities -- good for expert tournaments - Relative scoring (vs. crowd): Rewards beating the consensus -- good for competitive settings → Chapter 9: Scoring Rules and Proper Incentives
1. Database separation
PostgreSQL moves to a managed cloud database (AWS RDS or equivalent) with automatic backups, failover, and read replicas. - Connection pooling via PgBouncer: 200 max client connections, 30 pool size. - One read replica handles all read-only queries (market listings, portfolio views, leaderboards). → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
1. Matching engine sharding
Markets are distributed across 4 matching engine shards using consistent hashing. - Each shard handles 125 markets independently. - Sharding key: `market_id` (deterministic, no cross-shard coordination needed). → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
10. B
Parquet is a columnar binary format that is compressed (smaller files), preserves column types (no need to specify `parse_dates` when reading), and is significantly faster to read for large datasets. CSV is text-based and loses type information. → Chapter 6 Quiz
10:45 PM --- Race Called
The overall election is called. One final surge of trading. - Peak order volume: 6,800/second (exceeds load test maximum). - p99 latency spikes to 240ms for approximately 90 seconds. - Error rate: 0.3% (brief connection timeouts). - Matching engine queue depth: 2,800 (briefly). - System recovers wit → Case Study 1: Scaling for Election Night
11. A
Each handler independently filters by level. The console handler only passes through messages at INFO level and above (INFO, WARNING, ERROR, CRITICAL). The file handler passes through everything at DEBUG and above, providing a complete record for troubleshooting. → Chapter 6 Quiz
11:02
The bot has positions in 5 markets, all of which are correlated with the political event: - Market C: Long 60 contracts (political outcome A) - Market D: Long 40 contracts (policy consequence of A) - Market E: Short 30 contracts (alternative outcome B) - Market F: Long 25 contracts (economic impact → Case Study 2: Post-Mortem: When the Bot Went Wrong
11:05
The event resolves contrary to the bot's positions. All five markets move against the bot simultaneously: - Market C: drops from 0.55 to 0.35 (-$12.00 unrealized) - Market D: drops from 0.60 to 0.42 (-$7.20 unrealized) - Market E: rises from 0.40 to 0.62 (-$6.60 unrealized) - Market F: drops from 0. → Case Study 2: Post-Mortem: When the Bot Went Wrong
11:06
The daily loss limit is -$200. The combined loss of $34.80 does not trigger it. But the bot's effective exposure to "political outcome A" is far larger than any single position limit suggests. → Case Study 2: Post-Mortem: When the Bot Went Wrong
11:08
The bot's signal generator sees the price drops as mean-reversion opportunities. It generates BUY signals for Markets C, D, and F (prices have "deviated" from their EMAs). The risk manager approves these orders because each individual position is within limits. → Case Study 2: Post-Mortem: When the Bot Went Wrong
11:10
Some of the new orders fill, increasing the bot's exposure to the same correlated risk. → Case Study 2: Post-Mortem: When the Bot Went Wrong
11:15
Alex sees the alerts (daily P&L is now -$42 after the new positions also lose). Alex manually cancels all orders and begins unwinding positions. → Case Study 2: Post-Mortem: When the Bot Went Wrong
11:30
After unwinding, the total realized loss is $58.40. → Case Study 2: Post-Mortem: When the Bot Went Wrong
11:30 PM --- Cooldown
Traffic drops to 20x normal. - HPA begins scaling down. - Team reviews the 90-second SLO breach. → Case Study 1: Scaling for Election Night
12. B
Hardcoding secrets in source files means they will be committed to version control and potentially exposed. The correct approach is to store them in a `.env` file (excluded by `.gitignore`) and load them with `python-dotenv` at runtime. → Chapter 6 Quiz
13. B
The pattern `*.py[cod]` uses character class syntax: `[cod]` matches a single character that is either `c`, `o`, or `d`. So it matches `.pyc`, `.pyo`, and `.pyd` files — all forms of compiled Python. → Chapter 6 Quiz
14. B
Notebooks are ideal for exploratory work, visualization development, and prototyping where you need to see results immediately. Production code (automated pipelines, trading logic) should be in scripts with proper error handling and testing. → Chapter 6 Quiz
14:35
The trading bot's retry handler starts triggering. Requests succeed on retry, so the circuit breaker does not trip. No alerts are sent. → Case Study 2: Post-Mortem: When the Bot Went Wrong
14:42
The platform's API begins returning stale data. Price quotes are 10 minutes old, but the response format is correct and the HTTP status is 200 OK. The bot does not detect the staleness. → Case Study 2: Post-Mortem: When the Bot Went Wrong
14:48
The bot's signal generator sees a "deviation" between the stale price and what it expects based on its EMA. It generates a BUY signal for Market A at 0.42, believing the price has dropped significantly. → Case Study 2: Post-Mortem: When the Bot Went Wrong
14:49
The order is submitted. Despite the slow API, the order endpoint is working normally. The order is placed at 0.42 when the actual market price is 0.50. The order does not fill immediately (it is 8 cents below the ask). → Case Study 2: Post-Mortem: When the Bot Went Wrong
14:55
More stale-data signals fire. The bot submits three more orders in other markets, all based on stale prices. → Case Study 2: Post-Mortem: When the Bot Went Wrong
15. C
`@abstractmethod` makes the class abstract: you cannot create an instance of `PredictionMarketClient` directly. You must create a subclass that implements all abstract methods. This enforces the contract that every platform client must define its own `_setup_session`, `_parse_markets`, and `_markets → Chapter 6 Quiz
15:10
The platform resolves the data issue. Fresh prices flow in. The bot's EMA updates, and the "deviations" disappear. No new signals fire. → Case Study 2: Post-Mortem: When the Bot Went Wrong
15:15
One of the four stale-data orders fills. A seller hits the 0.42 bid in Market A (perhaps also using stale data or making an error). The bot now has a long position at 0.42 in a market trading at 0.50. → Case Study 2: Post-Mortem: When the Bot Went Wrong
15:20
Alex (the bot operator) returns from lunch and notices the position. The unrealized P&L is +$1.20 (8 cents * 15 contracts), but Alex is concerned because the entry was based on bad data. → Case Study 2: Post-Mortem: When the Bot Went Wrong
15:30
Alex reviews the logs and discovers the stale data issue. The other three orders are still open and unfilled. Alex manually cancels them. → Case Study 2: Post-Mortem: When the Bot Went Wrong
16. B
A Brier score of 0.18 indicates moderate accuracy. The scale runs from 0 (perfect) to 2 (worst possible, though practically 1 is the baseline for a naive "always predict 50%" strategy on balanced data). While context (base rate) helps interpretation, 0.18 is generally considered decent performance. → Chapter 6 Quiz
17. B
The `fractional` parameter implements "fractional Kelly" — a common risk management technique where you bet a fraction (often 0.5 for "half Kelly") of the theoretically optimal Kelly amount. This reduces variance in returns at the cost of slightly lower expected growth rate. → Chapter 6 Quiz
18. C
Indexes create a sorted data structure (typically a B-tree) that allows the database engine to quickly locate rows matching a condition without scanning the entire table. A query like `WHERE market_id = 'X' AND timestamp > '2024-01-01'` runs orders of magnitude faster with this index. → Chapter 6 Quiz
19. B
A scheduled data collection script needs: error handling with retries (APIs fail), logging (to diagnose issues when you are not watching), database storage (to persist collected data), and configuration management (API keys, schedule parameters). Visualization and notebooks are for interactive analy → Chapter 6 Quiz
1:00 AM --- Markets Suspended
Election markets suspended pending official certification. - Traffic at 3x normal. - HPA scaled down to 10 pods. - War room winds down; on-call engineer takes over. → Case Study 1: Scaling for Election Night
2. Aggregation across questions:
Simple average: Each question has equal weight - Weighted average: More important or more difficult questions count more - Geometric mean (for log scores): Multiplicative aggregation is natural for log scores → Chapter 9: Scoring Rules and Proper Incentives
2. Application server scaling
The Django application runs in Docker containers behind an application load balancer. - Two instances minimum, auto-scaling to six based on CPU utilization (threshold: 70%). → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
2. B
`pip freeze` outputs every installed package with exact version pins, including transitive dependencies (dependencies of your dependencies). → Chapter 6 Quiz
2. Dedicated WebSocket service
WebSocket handling is separated into its own service, subscribed to Redis Pub/Sub for price updates. - Three WebSocket server instances, each supporting 50,000 connections. - Connection load balancing via IP hash for session affinity. → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
20. A
Overround = yes_price + no_price - 1.0. Market A: 0.55 + 0.50 - 1.0 = 0.05 (5%). Market B: 0.62 + 0.42 - 1.0 = 0.04 (4%). Market A has higher vig, meaning the market maker takes a larger cut. → Chapter 6 Quiz
2004 (Bush vs. Kerry):
InTrade's final price gave Bush approximately a 55% chance of winning. - On election night, InTrade prices reacted to returns from Ohio faster than the major television networks called the state. - Post-election analysis showed InTrade correctly identified the winner in 49 of 50 states. → Case Study 1: The Rise and Fall of InTrade
2008 (Obama vs. McCain):
InTrade correctly predicted the winner of every state except Indiana (Obama won by 1%) and Missouri (McCain won by 0.1%). - The market tracked the financial crisis in real time: Obama's probability surged from around 55% in August to over 90% by late October as the economic collapse favored the chal → Case Study 1: The Rise and Fall of InTrade
2012 (Obama vs. Romney):
InTrade's final price gave Obama approximately a 67% chance of winning. - This was less confident than Nate Silver's FiveThirtyEight model, which estimated approximately 90%. - Post-election debate centered on whether InTrade had been "too close to call" while Silver had been more decisive. Some res → Case Study 1: The Rise and Fall of InTrade
3. D
Both `~=1.24.0` (compatible release, allows >=1.24.0, <1.25.0) and `>=1.24.0,<2.0.0` are acceptable, though they define slightly different ranges. The `~=` operator is more restrictive (minor version only), while the range specifier allows any version below 2.0.0. → Chapter 6 Quiz
3. Event sourcing adoption
The `events` table is formalized into a proper event store with aggregate versioning and optimistic concurrency control (Section 33.2). - A `MarketAggregate` class rebuilds market state from events. - Snapshots are taken every 500 events per market. → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
3. Message queue backbone
All inter-service communication goes through a message queue (RabbitMQ or AWS SQS). - Priority queues: order matching (critical), notifications (normal), analytics (low). - Dead letter queues capture failed messages for manual inspection. → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
3. Timing and updates:
Score at each update: Rewards early movers but penalizes experimentation - Score at close only: Simpler but rewards waiting and free-riding on others' information - Time-weighted scoring: Discounts early forecasts less, rewarding consistent accuracy → Chapter 9: Scoring Rules and Proper Incentives
4. C
`_throttle()` ensures a minimum time gap between requests to avoid exceeding the API's rate limit. It checks the time since the last request and sleeps if necessary. → Chapter 6 Quiz
4. CQRS introduction
The write path (order placement, matching) uses the event store as its source of truth. - Read models (order book, market summary, portfolio) are built as projections that subscribe to the event stream. - Projections run in a separate process, ensuring read-heavy traffic does not affect write perfor → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
4. Handling missing forecasts:
If a forecaster skips a question, assign the prior (e.g., community median or base rate) - Or exclude missing questions from their average (but this allows cherry-picking easy questions) → Chapter 9: Scoring Rules and Proper Incentives
4. Multi-level caching
L1: In-process LRU cache (1-second TTL) for the hottest data. - L2: Redis cluster for shared cache (2--300 second TTL depending on data type). - L3: Database (source of truth). - Event-driven cache invalidation: when a trade executes, the affected market's cache is immediately invalidated. → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
5. B
Jitter prevents the "thundering herd" problem. Without jitter, clients that all hit the rate limit simultaneously would all retry at the same time, causing another rate limit event. → Chapter 6 Quiz
5. Comprehensive monitoring and alerting
Custom Prometheus metrics for prediction-market-specific concerns: - `market_spread` (bid-ask spread per market) - `matching_engine_queue_depth` (orders waiting to be processed) - `order_to_trade_latency` (time from order placement to match) - `websocket_connections_active` (per-server connection co → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
5. Monitoring
Prometheus collects metrics from all services. - Grafana dashboards show the four golden signals: latency, traffic, errors, and saturation. - PagerDuty alerts fire when p99 latency exceeds 200 ms or error rate exceeds 1%. → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
5:00 PM --- Pre-Event
Cache warmer activated for all election markets. - Kubernetes HPA minimum raised from 4 to 15 pods. - WebSocket servers pre-scaled to 5 instances. - All team members in the war room. - Baseline metrics recorded. → Case Study 1: Scaling for Election Night
6. C
HTTP 429 (Too Many Requests) is the standard status code for rate limiting. 401 is authentication failure, 403 is authorization failure, and 503 is server overload (which may also indicate rate limiting in some implementations). → Chapter 6 Quiz
6. Disaster recovery
Database: continuous WAL archiving to object storage, point-in-time recovery tested monthly. - Event store: all events also written to a cross-region backup. - Failover: automated database failover; matching engine shards have hot standby. - Recovery Time Objective (RTO): 5 minutes. Recovery Point O → Case Study 2: Cloud-Native Prediction Market: Scaling from 100 to 100,000 Users
6:00 PM --- Polls Close in East Coast States
Traffic increases 5x above normal. - HPA scales API pods from 15 to 22. - All systems green. Latency well within SLOs. → Case Study 1: Scaling for Election Night
7. B
Different exceptions need different responses: a `ConnectionError` might mean the server is down (retry later), while a `Timeout` might mean the request was too complex (retry with different parameters). A broad `except Exception` would also catch programming errors like `TypeError`, hiding bugs. → Chapter 6 Quiz
7:00 PM --- First Major Call
A key state is called for a candidate. Traffic spikes to 30x normal within 2 minutes. - Order volume surges to 2,500/second. - HPA scales to 30 pods. - WebSocket connections reach 45,000 across 5 servers. - Database connection pool utilization: 65%. - All systems green. → Case Study 1: Scaling for Election Night
8. B
Dataclasses provide type annotations (documentation and IDE autocomplete), automatically generate `__init__`, `__repr__`, and `__eq__` methods, and make the data structure explicit. They do not enforce types at runtime without additional validation. → Chapter 6 Quiz
8:15 PM --- Surprising Result
An unexpected result in a major state causes a massive trading surge. - Traffic hits 80x normal. Order volume: 4,200/second. - HPA reaches 38 pods (near maximum of 40). - Action: Engineer increases HPA maximum to 60 pods. - Database connection pool: 78%. Warning alert triggered. - Action: Database e → Case Study 1: Scaling for Election Night
9. A
WAL (Write-Ahead Logging) is a SQLite journaling mode that allows concurrent reads while a write is in progress, improving performance for our use case of writing price snapshots while reading data for analysis. → Chapter 6 Quiz
9:30 PM --- Peak Traffic
Multiple states called simultaneously. - Traffic: 110x normal. Order volume: 5,500/second. - HPA at 48 pods. - WebSocket connections: 82,000. Sixth WebSocket server added. - Database replication lag: 3 seconds (elevated but not critical). - Redis memory: 72% utilized. - p99 latency: 188ms. Very clos → Case Study 1: Scaling for Election Night
|
$370.40** | | **Net return** | **-3.70%** | → Case Study 2: Closing the Gap — Profiting from Stale Markets
| |
10.2%** | **91.1%** | | Positions that gained (E4, E6) | 2 | +1.0% | -8.9% (offset) | | **Net portfolio loss** | | **-9.2%** | **100%** | → Case Study 2: Stress Testing Through a Black Swan Event

A

About cross-market relationships:
Do related markets move together? - Does one market lead another? - Are there arbitrage relationships between markets? → Chapter 21: Exploratory Data Analysis of Market Data
About data quality:
Are there missing observations or gaps in the time series? - Are there obviously erroneous prices (e.g., a price of 0.99 immediately followed by 0.01)? - Does the data source provide consistent timestamps and formats? → Chapter 21: Exploratory Data Analysis of Market Data
About price behavior:
Is the price trending or mean-reverting? - Are there sudden jumps or gradual drifts? - Does the price cluster near 0 or 1, or does it stay in the middle? - How volatile is the price? Has volatility changed over time? - Are price changes autocorrelated, or do they behave like a random walk? → Chapter 21: Exploratory Data Analysis of Market Data
About the market itself:
What is being predicted? What is the resolution criterion? - How long has the market been active? When does it resolve? - What is the current price, and how has it changed over time? - How liquid is the market? Is there enough volume to trust the price signal? → Chapter 21: Exploratory Data Analysis of Market Data
About volume and participation:
When do people trade? Are there time-of-day or day-of-week patterns? - Do volume spikes correspond to information events? - Is the market getting more or less active over its lifetime? - What is the typical trade size? → Chapter 21: Exploratory Data Analysis of Market Data
Academic demonstration
researchers show that markets outperform alternatives in a controlled setting. 2. **Pilot deployment** --- a forward-thinking organization runs a small-scale internal market. 3. **Scaling challenges** --- liquidity, participation, and incentive problems emerge at scale. 4. **Institutional integratio → Chapter 40: Real-World Applications
Account Events:
`FundsDeposited` --- a trader adds funds to their account - `FundsWithdrawn` --- a trader removes funds - `PositionOpened` --- a new market position is created - `PositionClosed` --- a position is settled after market resolution - `PayoutIssued` --- funds are disbursed to winning positions → Chapter 33: Scaling, Performance, and Operations
Advantages of AMMs:
Always available liquidity (no empty order books) - Simple user experience (just buy or sell, no limit orders) - No need for market makers - Gas-efficient for simple trades → Chapter 35: Smart Contract Market Mechanisms
Advantages of CLOBs:
Zero price impact for small orders (within the spread) - Professional market makers can provide tight spreads - Complex order types (limit, stop, FOK, etc.) - Better price discovery for high-volume markets → Chapter 35: Smart Contract Market Mechanisms
Advantages of the limit order:
Save 3 cents per contract ($0.55 - $0.52) - Earn the spread instead of paying it - May qualify for maker rebates (zero or negative fees) - Avoid slippage — you get exactly your price → Chapter 10 Quiz
Advantages:
Simple to implement - Reduces temporary impact by allowing the book to replenish - Does not require market microstructure knowledge → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Adverse selection cost
the risk of trading against better-informed counterparties 2. **Inventory risk** — the risk of accumulating a directional position that moves against you 3. **Order processing costs** — the operational costs of providing liquidity (technology, capital, time) → Chapter 10 Quiz
Alice's track record:
Of the 100 days she said "10% chance of rain," it rained on 10 of them. - Of the 200 days she said "30% chance of rain," it rained on 60 of them. - Of the 150 days she said "50% chance of rain," it rained on 75 of them. - Of the 250 days she said "70% chance of rain," it rained on 175 of them. - Of → Chapter 12: Calibration — Measuring Forecast Quality
Alternatives for prediction markets:
**Brier score loss:** $\frac{1}{N} \sum (y_i - \hat{p}_i)^2$. Sometimes used for calibration-focused training. - **Focal loss:** $-\alpha_t (1-\hat{p}_t)^\gamma \log(\hat{p}_t)$. Down-weights easy examples, focusing on hard-to-classify events. Useful for imbalanced prediction market outcomes. → Chapter 23: Machine Learning for Probability Estimation
Always commit:
Source code (`.py` files) - Configuration templates (not the actual `.env`) - Requirements files - Tests - Notebooks (but be mindful of size — clear output before committing) - Documentation → Chapter 6: Setting Up Your Python Toolkit
AMM Markets (Manifold, some DeFi platforms):
Impact is continuous along the bonding curve - Impact is deterministic: $x \cdot y = k$ (constant product) or similar formula - No hidden liquidity — you can calculate exact impact before trading - All impact is "mechanical" — the formula determines the new price → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Analysis:
**Politics** markets have the highest average volume, consistent with high public interest in political outcomes. - **Entertainment** markets have the lowest volume, reflecting a more niche participant base. - **Crypto** markets show the widest volume dispersion (highest variance), likely reflecting → Case Study 1: EDA of 1,000 Resolved Polymarket Markets
Annual cost:
200 trades × $2.50 = **$500 per year** → Chapter 10 Quiz
Anti-Money Laundering (AML):
Implement a written AML compliance program - Designate a compliance officer - Conduct independent audits of AML controls - File Suspicious Activity Reports (SARs) for transactions that raise red flags - File Currency Transaction Reports (CTRs) for transactions exceeding $10,000 → Chapter 38: The Regulatory Landscape
Approximation Methods
sampling, Bayesian networks, mean-field, and belief propagation --- make it possible to work with larger state spaces at the cost of some accuracy. The right method depends on the correlation structure and accuracy requirements. → Chapter 30: Combinatorial Prediction Markets
Arguments for our model (thinner tails):
The current economic environment is stable - No major systemic risks on the horizon - The Fed has tools to manage volatility - Historical quarterly GDP growth has been relatively well-behaved in the absence of crises → Case Study 2: Scalar Market Trading: GDP Growth Brackets
Arguments for privacy (anonymous trading):
Anonymous trading encourages participation by those who fear retaliation (e.g., government employees trading on policy outcomes) - Privacy protects proprietary trading strategies - Position disclosure may chill trading by risk-averse participants - Freedom from surveillance is a fundamental right in → Chapter 39: Ethics of Prediction Markets
Arguments for the market (fatter tails):
Black swan events are always possible - The market may be incorporating geopolitical risks - Participants may have information our model does not capture - GDP measurement revisions create additional uncertainty → Case Study 2: Scalar Market Trading: GDP Growth Brackets
Arguments for transparency (position disclosure):
Transparency deters manipulation (traders cannot manipulate anonymously) - Position disclosure allows for assessment of potential conflicts of interest - Regulatory compliance requires knowing who is trading - Other traders benefit from seeing the distribution of positions → Chapter 39: Ethics of Prediction Markets
Arguments That Smart Contracts Can Be Regulated:
The humans who write, deploy, and govern smart contracts are subject to law - Front-end interfaces that make protocols usable can be regulated - DNS registrars, cloud hosting providers, and other infrastructure can be compelled to restrict access - On-chain analytics can identify users despite pseud → Chapter 38: The Regulatory Landscape
Arrow-Debreu securities
a concept from general equilibrium theory introduced by Kenneth Arrow and Gerard Debreu in the 1950s. An Arrow-Debreu security pays $1 in exactly one "state of the world" and $0 in all others. → Chapter 4: Contracts, Payoffs, and Market Mechanics
As percentage of bankroll:
$500 / $50,000 = **1.0%** → Chapter 10 Quiz
Assumptions:
Organic growth rate: 10% per month (common for marketplace startups) - Growth modifier based on market quality (liquidity → attracts traders → more liquidity): - Excellent liquidity (Options A, D): 1.2x growth modifier - Good liquidity (Option E): 1.1x growth modifier - Moderate liquidity (Options B → Case Study 2: Fee Structure Design for a New Platform
At regime transitions:
The transition from calm to volatile often corresponds to a specific event. Traders who anticipate which events will trigger volatility can pre-position. - The transition from volatile back to calm represents a stabilization opportunity. → Case Study 2: Detecting Market Regimes in Election Markets
Avoid trading immediately after news:
Spreads widen dramatically after major news events - Market makers pull their quotes to avoid adverse selection - Wait 5-30 minutes for liquidity to return before trading → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Avoid wishful thinking
your portfolio does not care about your political preferences. → Chapter 1 — What Are Prediction Markets?
Avoids slippage
you get your exact price or nothing - **Provides a free option** to the market (you can cancel before it fills) → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees

B

Bad reasons to add capital:
You want to recover from a drawdown faster. - You feel pressure to "make up for lost time." - A single trade looks "too good to miss." → Chapter 17: Portfolio Construction and Risk Management
Bayesian updating
especially via the Beta-Binomial model --- is how rational agents (and efficient markets) process sequential information. → Chapter 3: Probability Fundamentals
Be aware of resolution timing:
As resolution approaches, spreads may widen (less time for market makers to manage risk) - Or narrow (if the outcome becomes obvious and risk decreases) - The optimal trading window depends on the specific market → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Benefits:
Increased frequency of participation - Broader appeal to casual users - Clear progression path for new users → Chapter 28: Principles of Prediction Market Design
Bernoulli Distribution
$X \sim \text{Bernoulli}(p)$ → Appendix A: Mathematical Foundations
Best practices:
Implement automatic reconnection logic for WebSocket feeds. - Cross-reference data from multiple sources when possible. - Log raw data for later verification and debugging. - Build your systems to handle missing data gracefully. → Chapter 7: Order Books and the Limit Order Market
Beta Distribution
$X \sim \text{Beta}(\alpha, \beta)$ → Appendix A: Mathematical Foundations
Binomial Distribution
$X \sim \text{Binomial}(n, p)$ → Appendix A: Mathematical Foundations
Bob's track record:
Of the 50 days he said "10% chance of rain," it rained on 25 of them (50% actual). - Of the 200 days he said "30% chance of rain," it rained on 100 of them (50% actual). - Of the 300 days he said "50% chance of rain," it rained on 150 of them (50% actual). - Of the 250 days he said "70% chance of ra → Chapter 12: Calibration — Measuring Forecast Quality
Box office prediction
forecasting opening weekend and cumulative gross --- was a major feature of the Hollywood Stock Exchange. → Chapter 40: Real-World Applications
bracket contracts
a set of binary contracts that partition the numeric range into intervals (brackets). → Chapter 4: Contracts, Payoffs, and Market Mechanics
Brackets (winner's EV minus loser's EV):
0-19 EV (extremely close) - 20-49 EV (close) - 50-99 EV (moderate) - 100-149 EV (comfortable) - 150-199 EV (solid) - 200-269 EV (landslide) - 270+ EV (historic landslide / one candidate wins all) → Case Study 2: Designing a Market Suite for a Presidential Election
Brackets:
Before 11:00 PM ET on election night - 11:00 PM - 2:00 AM ET - 2:00 AM - 8:00 AM ET the morning after - 8:00 AM ET day after through 3 days post-election - More than 3 days after election day → Case Study 2: Designing a Market Suite for a Presidential Election
Brier score comparison:
Maria's Brier score: 0.198 - Market prices' Brier score (for the same events): 0.217 → Case Study 1: From Gut Feeling to Quantified Edge: A Trader's Journey
Building Automation:
A systematic approach with data collection, opportunity detection, risk evaluation, and execution can scale arbitrage activity. - Production systems require robust error handling, database storage, monitoring, and compliance logging. → Chapter 16: Arbitrage in Prediction Markets

C

Calibration metrics:
Calibration curve (predicted vs. actual probabilities) - Brier score - Log-loss score → Chapter 13: Finding and Quantifying Your Edge
Calm regime:
Lower standard deviation of price changes (approximately 0.008-0.012). - Moderate volume. - Near-zero autocorrelation (consistent with efficiency within the regime). - Longer average episode duration (the market spends extended periods in calm mode). → Case Study 2: Detecting Market Regimes in Election Markets
CFTC no-action letter
essentially a promise from the regulator not to take enforcement action, contingent on several conditions: → Chapter 5: The Modern Platform Landscape
CFTC's Defense:
The agency has broad discretion under the "contrary to the public interest" catch-all provision - Election contracts share fundamental characteristics with gambling - The agency's determination deserved deference under administrative law principles - Approving election contracts would create unaccep → Case Study 1: Kalshi's Path to CFTC Approval
Challenges:
**Quality variance:** User-created markets vary enormously in quality - **Resolution trust:** Market creators resolve their own markets, creating potential conflicts - **Ambiguity:** Many markets are poorly worded and generate resolution disputes - **Liquidity fragmentation:** Thousands of markets w → Chapter 28: Principles of Prediction Market Design
Chapter 14: Binary Outcome Trading Strategies
The strategies that are evaluated using the backtesting framework built in this chapter. → Chapter 26: Further Reading
Chapter 20: Data Collection and APIs
Collecting the raw text data (news articles, social media posts, market data) that feeds into the NLP pipeline. → Chapter 24: Further Reading
Chapter 20: Data Collection and Web Scraping
Gathering market data from platform APIs, building scrapers, and managing databases. - **Chapter 21: Exploratory Data Analysis of Market Data** -- Analyzing price time-series, volume profiles, and detecting market regimes. - **Chapter 22: Statistical Modeling — Regression and Time Series** -- Applyi → Chapter 19: Live Trading, Execution, and Operational Discipline
Chapter 22: Statistical Modeling
The statistical foundations (hypothesis testing, confidence intervals) applied to backtest evaluation. → Chapter 26: Further Reading
Chapter 24: Ensemble Methods and Model Stacking
Combining multiple ML models into ensembles that outperform individual models. Builds directly on the diverse model training from this chapter. → Chapter 23: Further Reading
Chapter 24: NLP and Sentiment Analysis
NLP features that are stored in the feature store and fed into production pipelines. → Chapter 27: Further Reading
Chapter 25: Ensemble Methods
Ensemble models whose components are individually tracked, versioned, and monitored. → Chapter 27: Further Reading
Chapter 25: Ensemble Methods and Model Stacking
Combining NLP-derived features with polling-based and market-based models in ensemble forecasts. → Chapter 24: Further Reading
Chapter 27: Feature Stores, Pipelines, and MLOps
The operational infrastructure for deploying strategies that have passed backtesting into production. → Chapter 26: Further Reading
Chapter 6: Platform Landscape
Provides background on the prediction market platforms whose APIs are covered in this chapter. - **Chapter 21: Feature Engineering for Prediction Markets** --- Transforms the raw data collected here into features for machine learning models. - **Chapter 22: Machine Learning for Forecasting** --- Use → Further Reading
Chapter Index
an overview of the chapter's objectives and key topics, so you know what to expect before you begin. - **Main Content** — the core exposition, with concepts developed incrementally and accompanied by Python code examples that you can run and modify. - **Code Examples** — complete, working Python scr → How to Use This Book
Check:
Are signals being generated at the expected frequency? - Are the signals consistent with what the historical data would predict? - Is the data feed providing clean, timely data? → Chapter 26: Backtesting Prediction Market Strategies
Chen, Kash, and Ruberry (2014)
Proposed "decision scoring rules" that directly reward traders for the causal effect, not the conditional expectation. This requires additional structural assumptions. → Chapter 31: Decision Markets and Futarchy
Choose CPMM when:
The market will attract significant liquidity from participants - You want simplicity and familiarity (especially in DeFi contexts) - Fees can compensate for unbounded loss - Two-outcome markets dominate - Example: A decentralized prediction market on a blockchain → Chapter 8: Automated Market Makers
Choose LMSR when:
You need predictable, bounded subsidy costs - You are operating many markets with a fixed budget - Multi-outcome markets are common - You want well-understood theoretical properties - Example: A company running internal prediction markets for strategic planning → Chapter 8: Automated Market Makers
Choose LS-LMSR when:
You want adaptive liquidity without manual parameter tuning - Market activity is unpredictable (could be thin or heavy) - You are willing to accept potentially higher costs for better behavior - Example: A platform like Manifold Markets with diverse market types → Chapter 8: Automated Market Makers
Clearly Excluded Events:
Terrorist attacks or assassinations - Events whose contract creates incentives for illegal activity → Chapter 38: The Regulatory Landscape
Clearly Permissible Events:
Economic indicators (GDP, unemployment, inflation) - Weather events (temperature, rainfall, hurricane landfall) - Corporate events (earnings beats, product launches) → Chapter 38: The Regulatory Landscape
CLOB API
For order book data, trade execution 2. **Gamma API** — For market metadata, historical data → Chapter 5: The Modern Platform Landscape
Code Review
[ ] All code reviewed by at least one other person (or by your future self after a 48-hour break) - [ ] Unit tests pass with >90% coverage of critical paths - [ ] Integration tests pass against paper trading environment - [ ] No hardcoded credentials in source code - [ ] All configuration is externa → Chapter 19: Live Trading, Execution, and Operational Discipline
Command Side (Write Model):
Receives order submissions, cancellations, market creation requests. - Validates business rules (sufficient funds, market is open, price within bounds). - Applies changes to the event store. - Optimized for consistency and correctness. → Chapter 33: Scaling, Performance, and Operations
Common ambiguity patterns:
Missing time zone specifications - Undefined terms ("pass," "launch," "win") - Edge cases not contemplated by the question creator - Events that partially satisfy the resolution criteria → Case Study 1: UMA Optimistic Oracle Resolution in Practice
Common approaches:
**Logistic regression**: Model the binary outcome as a function of predictive features. - **Ensemble methods**: Combine predictions from multiple models (random forests, gradient boosting, etc.) for more robust estimates. - **Bayesian models**: Start with a prior (the base rate) and update with new → Chapter 13: Finding and Quantifying Your Edge
composability
advantages that centralized platforms cannot fully replicate. - These benefits come with trade-offs: higher transaction costs (gas), slower execution (block times), a steeper learning curve, and smart contract risk. - The choice between centralized and decentralized prediction markets depends on you → Chapter 34: Key Takeaways
compression toward 50%
it avoids extreme probabilities more than the market does. When the true probability is 90%, the market might say 87% while the LLM says 78%. This compression hurts the LLM's Brier score on questions with extreme true probabilities. → Case Study 2: Can LLMs Beat Prediction Markets?
Con:
Markets on specific attacks could create incentives for violence. - The appearance of the U.S. government "betting on terrorism" was politically toxic, regardless of the technical merits. - Participants who profit from correctly predicting suffering may become desensitized to it. → Chapter 39: Ethics of Prediction Markets
conditional expectation
the crowd's belief about the outcome given the decision. - The **decision rule** compares conditional prices: adopt the decision with the highest conditional expected outcome. - Implementation approaches: separate conditional markets (simple, splits liquidity), combinatorial tokens (complex, preserv → Chapter 31: Key Takeaways
Conditional Token Framework
the technical standard that Polymarket and others build upon. The Omen prediction market, powered by Gnosis, provided a decentralized interface for trading conditional tokens. → Chapter 5: The Modern Platform Landscape
Confusing scoring conventions
always check whether lower or higher is better. 5. **Over-interpreting small samples** -- with few questions, luck dominates; use bootstrap confidence intervals. 6. **Scoring only the final forecast** -- this incentivizes free-riding and late updating. → Chapter 9 Key Takeaways: Scoring Rules and Proper Incentives
Cons for Meridian:
Low sensitivity at extreme probabilities (distinguishing 90% from 99% barely matters) - For rare events (base rate 5%), the "always say 5%" strategy scores well (Brier = 0.0475), making it hard to identify genuinely skilled forecasters → Case Study 2: Designing a Scoring System for a Corporate Forecasting Program
Conversion formulas:
Probability to decimal odds: $d = 1 / p$ - Decimal odds to probability: $p = 1 / d$ - Probability to American odds: If $p \geq 0.5$: $A = -100p / (1-p)$; if $p < 0.5$: $A = +100(1-p) / p$ - The "implied prob with vig" column assumes a typical 4.5% overround (vigorish), illustrating how bookmakers sh → Appendix B: Statistical Tables
Core positions:
**BUY 250 contracts of Bracket 5** (1.0-1.5%) at $0.18 = $450 - **BUY 200 contracts of Bracket 6** (1.5-2.0%) at $0.21 = $420 - **BUY 100 contracts of Bracket 4** (0.5-1.0%) at $0.13 = $130 - **SELL 80 contracts of Bracket 1** (Below -1%) at $0.03 = $2.40 credit - **SELL 60 contracts of Bracket 10** → Case Study 2: Scalar Market Trading: GDP Growth Brackets
Corrected:
Buy 1,385 shares of Bracket 4 at $0.13 each = cost $180.05 - Buy 2,889 shares of Bracket 5 at $0.18 each = cost $520.02 - Buy 1,810 shares of Bracket 6 at $0.21 each = cost $380.10 - Total cost: $1,080.17 → Case Study 2: Scalar Market Trading: GDP Growth Brackets
cost function
a mathematical formula that determines the price of every trade. Here is the key insight: → Chapter 8: Automated Market Makers
cost of attack
the minimum expenditure required for an adversary to force an incorrect resolution --- and compare it to the **maximum profit from attack** ($50M, the full TVL). → Case Study 2: Multi-Oracle Security Analysis for a High-Stakes Political Market
Costs:
**Adverse selection losses**: When informed traders pick off stale quotes - **Inventory risk**: Directional losses when positions accumulate - **Platform fees**: Maker fees (if any) - **Technology costs**: Bots, APIs, monitoring - **Capital costs**: Opportunity cost of capital tied up in positions → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Cross-platform arbitrage trade structure:
Buy YES on the cheaper platform - Buy NO on the more expensive platform (equivalent to selling YES) - Guarantee profit regardless of outcome → Chapter 16: Arbitrage in Prediction Markets
Current market prices
queried on every page load and WebSocket tick. 2. **Open orders for a market** --- queried by the matching engine on every new order. 3. **A trader's positions** --- queried on every portfolio page load. 4. **Recent trades** --- queried for chart rendering and market activity feeds. → Chapter 33: Scaling, Performance, and Operations

D

Data available:
Current market prices and order books (real-time) - Historical price data with configurable intervals (minutely to daily) - Trade-level data (individual transactions) - Market metadata (question text, resolution criteria, close dates) - Volume and open interest → Appendix D: Data Sources
Database connections
the first thing to saturate. 2. **Lock contention** --- multiple orders for the same market compete for the same locks. 3. **Network bandwidth** --- WebSocket price feeds to many clients. 4. **CPU on matching engine** --- sorting and matching order books. 5. **Memory** --- holding large order books → Chapter 33: Scaling, Performance, and Operations
Defenses against P+epsilon:
**Commit-reveal schemes**: Prevent voters from conditioning their votes on the bribe contract. - **Identity-based systems**: Make it harder to verify that a voter voted as bribed. - **Increasing penalties**: Make $P$ large enough that the risk of voting incorrectly outweighs the bribe. → Chapter 37: Oracles, Resolution, and the Decentralization Trilemma
dependent
knowing one outcome changes your assessment of others. → Chapter 3: Probability Fundamentals
Design considerations for scalar markets:
**Range:** Set minimum and maximum values that are extremely unlikely to be breached (e.g., GDP growth between -10% and +15%) - **Resolution value:** What exact number will be used? (BEA advance estimate, not revised) - **Payoff function:** Linear between bounds? Piecewise? → Chapter 28: Principles of Prediction Market Design
Design considerations:
**Targeting:** Credits should be allocated based on demographic and geographic underrepresentation, not simply income. - **Anti-gaming:** Users must not be able to convert credits to cash immediately or create fake accounts to claim multiple allocations. - **Market integrity:** Credits must function → Case Study 2: Addressing Inequality in Market Access
Designated Contract Market (DCM)
the same regulatory designation held by the Chicago Mercantile Exchange (CME). This made Kalshi the first federally regulated exchange dedicated to event contracts in the United States. → Chapter 5: The Modern Platform Landscape
designated reporter
an address chosen by the market creator that has the first opportunity to report the outcome. The designated reporter system works as follows: → Chapter 37: Oracles, Resolution, and the Decentralization Trilemma
Detection:
Monitor model performance over time. A sudden increase in log-loss signals potential drift. - Track the distribution of input features. If the feature distribution shifts significantly from training data, predictions may be unreliable. - Use statistical tests (Page-Hinkley, ADWIN) to detect change p → Chapter 23: Machine Learning for Probability Estimation
differencing
computing the change between consecutive values: → Chapter 22: Statistical Modeling — Regression and Time Series
Disadvantages of AMMs:
Impermanent loss for liquidity providers - Price impact scales with trade size (slippage) - The liquidity parameter $b$ must be set in advance - Cannot express complex order types - MEV (Maximal Extractable Value) exposure: arbitrageurs can front-run trades → Chapter 35: Smart Contract Market Mechanisms
Disadvantages of CLOBs:
Requires active market makers for liquidity - On-chain CLOBs are extremely gas-intensive - Off-chain matching introduces centralization - Empty order books provide no liquidity → Chapter 35: Smart Contract Market Mechanisms
Disadvantages of the limit order:
**Execution risk**: The order may never fill (price may move up without coming back to $0.52) - **Adverse selection**: If the order fills, it may be because the price is falling through $0.52, meaning you are catching a falling knife - **Opportunity cost**: While waiting for the fill, the price may → Chapter 10 Quiz
Disadvantages:
Does not adapt to market conditions - Suffers from price drift if the market is trending - Execution is predictable, making you vulnerable to front-running → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
dYdX Model (for perpetuals):
Order matching: Off-chain (Starkware L2) - Margin: On-chain (Ethereum L1) - Settlement: L2 with L1 finality → Chapter 35: Smart Contract Market Mechanisms

E

Economic Features:
`gdp_growth`: Annualized GDP growth rate in the quarter preceding the election. - `unemployment_change`: Change in unemployment rate over the past 12 months. - `consumer_sentiment`: University of Michigan Consumer Sentiment Index. - `inflation_rate`: Year-over-year inflation rate. → Case Study 1: Predicting Election Outcomes with Logistic Regression
Economic Risk
**Impermanent loss**: As discussed in Section 36.3. - **Token price risk**: Mining rewards denominated in volatile governance tokens. - **Correlation risk**: Multiple positions may be correlated through shared dependencies. - **Depegging risk**: Stablecoins used as collateral may depeg. → Chapter 36: DeFi Integration and Liquidity Mining
Edge metrics:
Average edge per trade (your probability - market price, signed by direction of bet) - Realized edge (actual returns minus market-implied expected returns) - Edge by category (information, analytical, behavioral, timing) - Edge trend over time (is your edge growing or shrinking?) → Chapter 13: Finding and Quantifying Your Edge
Entity Features:
`entity_count`: Number of unique entities mentioned. - `key_entity_frequency`: How often a specific key entity is mentioned. - `new_entity_flag`: Whether a previously unseen entity appears. → Chapter 24: NLP and Sentiment Analysis
Estimating the likelihoods:
P(E1 | H): If the Fed IS going to announce the facility, how likely is it that an unscheduled weekend meeting occurred and was reported? This is quite likely --- emergency facilities require significant coordination. **Estimate: 0.90** - P(E1 | not H): If the Fed is NOT going to announce the facilit → Case Study 1: Bayesian Updating During a Breaking News Event
Event 1: Endorsement (Week 4)
Pre-event estimate: Endorsements historically move markets 1-3 cents - Position: Buy YES at 0.53 (Wednesday before expected Friday announcement) - Outcome: Price moved from 0.53 to 0.54. Sold at 0.54. - Profit: +$0.01 x 200 contracts = +$2.00 → Case Study 1: Trading a Presidential Election — Strategy Comparison
Event 1: Fed Rate Cut in March
Buy YES on Kalshi at $0.32. Fee = $0.03. Cost = $0.35. - Buy NO on Polymarket at $0.67. Fee = 1% of $0.67 = $0.0067. Cost = $0.6767. - Total cost per pair: $0.35 + $0.6767 = $1.0267. Too high. → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
Event 2: Convention A (Weeks 7-8)
Pre-event estimate: Convention bounce typically 3-5 cents, fades 50% within 2 weeks - Position: Buy YES at 0.55 on Monday of convention week - Sold 50% at 0.62 (peak of convention bounce) - Sold remaining 50% at 0.60 (beginning of fade) - Profit: 100 x ($0.07) + 100 x ($0.05) = +$12.00 → Case Study 1: Trading a Presidential Election — Strategy Comparison
Event 3: Convention B (Weeks 10-11)
Pre-event estimate: B's convention will narrow the gap by 3-4 cents - Position: Buy NO (sell A) at 0.40 before B's convention - Sold NO at 0.45 (A drops to 0.55) - Profit: 150 x ($0.05) = +$7.50 → Case Study 1: Trading a Presidential Election — Strategy Comparison
Event 4: First Debate (Week 17)
Pre-event estimate: 60% chance A wins debate; expected market impact +5 cents for A win, -3 cents for A loss - Expected value of YES: 0.60 x (+0.05) + 0.40 x (-0.03) = +$0.018 per contract - Position: Small YES buy at 0.56 (100 contracts) - Outcome: A wins debate, price jumps to 0.63 - Sold at 0.63 → Case Study 1: Trading a Presidential Election — Strategy Comparison
Event 4: S&P 500 > 6000 by June
Buy YES on Kalshi at $0.50. Fee = $0.03. Cost = $0.53. - Buy NO on Polymarket at $0.47. Fee = 1% of $0.47 = $0.0047. Cost = $0.4747. - Total cost per pair: $0.53 + $0.4747 = $1.0047. Too high. → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
Event 5: Scandal (Week 20)
Not in calendar (unscheduled). Event-driven trader reacts post-event. - Assessment: Scandals in October historically fade. Similar scandals in past elections had 5-8 cent permanent impact, not 15 cents. - Position: Buy YES at 0.48 after initial reaction (200 contracts) - Held to resolution - Profit: → Case Study 1: Trading a Presidential Election — Strategy Comparison
Example 1: "Will Elon Musk buy Twitter in 2022?"
Musk signed the acquisition agreement in April 2022. - He attempted to back out in July 2022. - The acquisition closed in October 2022. - When did the "buy" occur? At agreement signing? At closing? What if it had fallen through? → Chapter 37: Oracles, Resolution, and the Decentralization Trilemma
Example 1: Polymarket (Zero Fees)
Market price: $0.60 (bid $0.58, ask $0.60) - Spread cost: $\frac{0.02}{2} = 0.01$ - Gas: ~$0.005 per contract (negligible for $100+ trades) - Breakeven edge: ~$0.01$ above midpoint ($0.59$) - Breakeven probability: $\approx 0.60$ → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Example 2: Kalshi (Taker Fee)
Market price: $0.60 (bid $0.58, ask $0.60) - Spread cost: $0.01$ - Taker fee: $\min(0.01, 0.60/15) = 0.01$ per contract on each side - Total cost per contract: $0.01 + 0.01 + 0.01 = 0.03$ - Breakeven probability: $0.60 + 0.02 = 0.62$ → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Example 3: PredictIt (Profit + Withdrawal Fee)
Market price: $0.60 - Profit fee: 10% of profit if win - Withdrawal fee: 5% - Breakeven probability: $\frac{0.60}{0.955 \times 0.95} \approx 0.661$ - Required edge: 6.1 cents — more than triple Kalshi's requirement → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Example applications:
**Proving data provenance**: A ZKP could prove that a price feed came from a specific exchange's API without revealing the API key. - **Proving computation correctness**: A ZKP could prove that an aggregation was performed correctly without revealing individual inputs. - **Privacy-preserving voting* → Chapter 37: Oracles, Resolution, and the Decentralization Trilemma
Example programs:
Partner with agricultural cooperatives in Africa and South Asia to recruit farmers for food security prediction markets. - Partner with public health networks to recruit healthcare workers for pandemic prediction markets. - Partner with local government associations to recruit municipal officials fo → Case Study 2: Addressing Inequality in Market Access
Example:
Market 1: "Will GDP growth exceed 3%?" - Market 2: "Will the stock market rise 10%+ this year?" → Chapter 3: Probability Fundamentals
Examples in prediction markets:
Using the final resolution outcome to filter which markets to trade. ("I only backtested on markets that resolved YES, because those are the ones with clear outcomes.") - Using end-of-day volume data to make trading decisions that would have been made intraday. - Using a model trained on the entire → Chapter 26: Backtesting Prediction Market Strategies
Examples:
Price discrepancies between platforms trading the same event (cross-platform arbitrage) - Markets with low liquidity where prices lag information - New markets where prices have not yet converged to fair value - Events near resolution where prices stick at round numbers instead of moving to 95-99% → Chapter 13: Finding and Quantifying Your Edge
Execution Challenges:
Simultaneous execution is difficult in practice. - Partial fills, slippage, and latency can erode or eliminate profits. - Cross-platform execution adds complexity from different APIs, funding methods, and interfaces. → Chapter 16: Arbitrage in Prediction Markets
execution risk
your order may never fill, or it may fill at the worst possible time (when an informed trader picks you off). → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Execution:
50 contracts filled at $0.55 - 50 contracts filled at $0.56 - Average execution price: $0.555 → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Expected output pattern:
`n=10`: The final average may be noticeably different from 0.6 (e.g., 0.5000 or 0.7000). The maximum deviation from 0.6 will be large. - `n=100`: The final average will be closer to 0.6 (e.g., 0.5800 or 0.6300). Maximum deviation decreases. - `n=1000`: The final average will be quite close to 0.6 (e → Chapter 3 Quiz: Probability Fundamentals
Expected trading patterns:
200 community members, maybe 20-50 will trade on any given market - Average 2-3 trades per participant per market - Average trade size: 5-10 shares - Expected total volume: ~200-500 shares per market → Case Study 1: Designing an AMM for a Community Prediction Platform
Exponential Distribution
$X \sim \text{Exponential}(\lambda)$ → Appendix A: Mathematical Foundations
extreme forecasts
it pushes forecasters to report 0 or 1 regardless of their true beliefs! This is terrible for a forecasting system. The linear score is **improper**. → Chapter 9: Scoring Rules and Proper Incentives

F

Fee structure (as of 2024-2025):
**Trading fees**: 0% — Polymarket does not charge trading fees on most markets - **Gas fees**: Polygon network fees, typically $0.001 - $0.05 per transaction - **Deposit fees**: Free for USDC deposits - **Withdrawal fees**: Gas fee for on-chain withdrawal (~$0.01 - $0.10) → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Fee structure (play money / Mana):
**Trading fee**: Dynamic based on liquidity pool mechanism - **No explicit fees**: Costs embedded in the AMM (Automated Market Maker) curve - **Loan system**: Users receive loans on long-dated positions → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Fee structure (Sweepcash):
**Redemption fee**: Varies by redemption method - **Trading cost**: Embedded in AMM pricing → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Fee structure:
**Trading fee**: 0% on trades themselves - **Profit fee**: 10% of profits on each market - **Withdrawal fee**: 5% of withdrawal amount - **Position limit**: Maximum $850 per contract per market → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Fees and friction
trading fees, winner's fees, and the bid-ask spread — erode your edge. The fee-adjusted EV formula shows the true break-even probability for any fee structure. → Chapter 4: Contracts, Payoffs, and Market Mechanics
Final book state:
Bids: Order 1 — Buy 20 at $0.50 - Asks: Order 3 — Sell 5 at $0.52 - Spread: $0.52 - $0.50 = $0.02 → Chapter 32: Quiz — Building a Platform from Scratch
Financial/Economic Markets:
Average spreads: 2-4 cents (will the Fed raise rates?) - Spreads tighten leading up to announcements as markets price in expectations - Significant spread widening during the announcement itself - Moderate adverse selection (some traders may have early access to data) → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Findings from the academic literature:
**Favorite-longshot bias.** Longshots (unlikely outcomes) tend to be slightly overpriced, and favorites slightly underpriced. This bias is smaller in exchange markets (like Betfair) than in traditional bookmaker markets. - **Late-informed trading.** Prices become more efficient as event start time a → Chapter 40: Real-World Applications
Fully Autonomous:
Immutable smart contracts - No governance or upgradeability - No identifiable operator → Chapter 38: The Regulatory Landscape
Fully Centralized (e.g., Kalshi):
Central operator controls all functions - Clear regulatory entity - Traditional enforcement tools apply → Chapter 38: The Regulatory Landscape
fully collateralized
the total capital posted by both sides always equals the maximum payout. → Chapter 4: Contracts, Payoffs, and Market Mechanics
futarchy
a form of governance in which prediction markets replace (or supplement) deliberation, debate, and voting as the mechanism for choosing policies. → Chapter 31: Decision Markets and Futarchy

G

Good reasons to add capital:
Your strategy has been profitable over a meaningful sample size. - New opportunities have arisen that you cannot fund from current capital. - You have reached a new all-time high and want to scale up proportionally. → Chapter 17: Portfolio Construction and Risk Management
Governance Risk
**Parameter changes**: Protocol governance may change fee structures, collateral factors, or other parameters adversely. - **Treasury risk**: Protocol treasury may be mismanaged or drained. - **Regulatory risk**: Legal actions against a protocol may affect operations. → Chapter 36: DeFi Integration and Liquidity Mining

H

Heating Degree Day (HDD) futures
settle based on cumulative heating degree days during a contract month, providing a prediction of cold weather intensity. - **Cooling Degree Day (CDD) futures** --- the summer equivalent, predicting hot weather intensity. - **Hurricane futures** --- settled based on the CME Hurricane Index, providin → Chapter 40: Real-World Applications
hedge
intentionally misreporting on one question to reduce risk across a portfolio of questions. For example, if Alice's bonus depends on her *total* score across 100 questions, she might report less extreme probabilities to reduce variance in her overall score. → Chapter 9: Scoring Rules and Proper Incentives
High moral hazard risk:
Individual health or death events - Specific terrorist attack occurrences - Targeted corporate failures - Specific crime occurrences → Chapter 39: Ethics of Prediction Markets
Historical and Structural Features:
`incumbency`: Binary indicator for whether the candidate's party holds the presidency. - `term_length`: Number of terms the incumbent party has held the presidency. - `midterm_loss`: Size of the incumbent party's loss in the most recent midterm election. - `approval_rating`: Presidential approval ra → Case Study 1: Predicting Election Outcomes with Logistic Regression
How much would it cost to corrupt an Augur market?
## Background: Augur's Dispute Mechanism → Case Study 2: Augur Dispute Resolution --- Modeling the Cost of Corruption
Human baselines:
Metaculus community median (typically 100–500 forecasters per question) - A panel of 15 superforecasters from the Good Judgment Project - Individual non-expert human forecasters (recruited via Prolific) → Case Study 1: GPT-4 as a Forecaster — Benchmarking LLM Predictions Against Human Superforecasters
Hybrid (e.g., early Polymarket):
Decentralized settlement but centralized order book - Identifiable operator but decentralized infrastructure - Regulatory grey zone → Chapter 38: The Regulatory Landscape

I

If gambling:
Winnings are reported as "other income" on Line 8 of Schedule 1 - Losses are deductible only as itemized deductions and only to the extent of winnings - The Tax Cuts and Jobs Act of 2017 eliminated miscellaneous itemized deductions, making gambling loss deductions less valuable - Professional gamble → Chapter 38: The Regulatory Landscape
If investment:
Gains are capital gains (short-term or long-term) - Losses are deductible against gains plus up to $3,000 of ordinary income - Excess losses can be carried forward indefinitely - Section 1256 treatment provides the favorable 60/40 split → Chapter 38: The Regulatory Landscape
If NO wins (Republican wins):
Loss on Kalshi = $0.51. - Payout from PredictIt = $1.00, but settlement fee = 10% of ($1.00 - $0.49) = 10% of $0.51 = $0.051. - Net from PredictIt = $1.00 - $0.051 - $0.49 = $0.459. - Total net = $0.459 - $0.51 = -$0.051. **Loss!** → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
If YES wins (Democrat wins):
Payout from Kalshi = $1.00 (no settlement fee). Net from Kalshi = $1.00 - $0.51 = $0.49. - Loss on PredictIt = $0.49. - Net = $0.49 - $0.49 = $0.00. Break even. → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
If your resolution is low:
Your forecasts are not differentiating between events that happen and events that do not. - Focus on identifying the most informative signals for each event type. - Try making more extreme predictions — you may be hedging away useful information. → Chapter 12: Calibration — Measuring Forecast Quality
Immediacy
Any arriving trader can execute instantly rather than waiting for a natural counterparty. 2. **Price discovery** — The market maker's quotes provide a continuous price signal, even during periods of low natural trading activity. 3. **Depth** — The market maker's orders contribute to book depth, redu → Chapter 29: Liquidity Provision and Market Making
Impact on markets:
Market 1 (Winner): Continues --- the replacement candidate runs under "Democratic Party nominee" category - Market 4 (Dem Nominee): Already resolved to the original nominee; no change - Conditional markets: If conditional on the dropped-out candidate, resolve N/A - State markets: Continue with repla → Case Study 2: Designing a Market Suite for a Presidential Election
In the calm regime:
Market-making strategies are more profitable (spreads can be tighter because the risk of adverse selection is lower). - Trend-following strategies are unprofitable (no persistent trend to follow). - The primary risk is being caught off-guard by a regime transition. → Case Study 2: Detecting Market Regimes in Election Markets
In the volatile regime:
Market-making is riskier (wider spreads are needed to compensate for information asymmetry). - Trend-following may be profitable during the initial reaction to events. - Risk management is critical; position sizes should be reduced. → Case Study 2: Detecting Market Regimes in Election Markets
information aggregation
how prediction markets combine the private information of many traders into accurate aggregate forecasts. We will see how the proper incentive structure guaranteed by scoring rules ensures that market prices converge to reflect the collective wisdom of participants, and examine conditions under whic → Chapter 9: Scoring Rules and Proper Incentives
Infrastructure
[ ] Server has reliable internet connection with failover - [ ] Monitoring and alerting is configured and tested - [ ] Log rotation is configured (logs can grow very fast) - [ ] Backup procedure for configuration and state files - [ ] Firewall rules restrict access to necessary services only → Chapter 19: Live Trading, Execution, and Operational Discipline
Initial Conditions:
It is Monday morning - The market price is **$0.30** (30% implied probability) - There have been rumors of banking stress, but no official action - The contract expires Friday at market close → Case Study 1: Bayesian Updating During a Breaking News Event
Intuition
provides a plain-language explanation or analogy to help you build mental models before engaging with formal definitions or mathematics. When a concept feels abstract, look for this box. - **Real-World Application** — describes how a concept or technique is used in practice on actual prediction mark → How to Use This Book
invariant
a quantity that must remain constant before and after every trade: → Chapter 8: Automated Market Makers
inventory risk
the risk that the position moves against them before they can unwind it. If a market maker has sold many "Yes" contracts and the event is looking increasingly likely, they are exposed to significant losses. → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees

K

Kalshi
CFTC-regulated Designated Contract Market (DCM) - **PredictIt** — Operated under a CFTC no-action letter (historically) → Chapter 5: The Modern Platform Landscape
Kalshi API documentation
[trading-api.readme.io](https://trading-api.readme.io/). Kalshi's API documentation covering market data, order placement, and portfolio management endpoints. → Chapter 6 Further Reading
Kalshi Documentation
https://kalshi.com/docs/ - Kalshi's official API documentation and fee schedule. → Chapter 10 Further Reading
Kalshi's Arguments:
The CFTC exceeded its statutory authority by treating all election contracts as categorically impermissible - Election contracts do not constitute "gaming" under any reasonable interpretation of the statute - The CFTC's public interest analysis was arbitrary and capricious - The decision was politic → Case Study 1: Kalshi's Path to CFTC Approval
Key characteristics:
Zero trading fees make Polymarket attractive for active traders - The order book model (CLOB — Central Limit Order Book) means costs come primarily from the spread - Market makers are incentivized through the spread itself rather than maker rebates - Low gas costs on Polygon make small trades viable → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Key Conditions of the Letter:
Markets limited to **5,000 traders** (later informally treated as 5,000 per contract) - Individual positions capped at **$850** - Not-for-profit operation with any revenues directed to academic research - Only certain categories of political and economic event contracts - Victoria University must ma → Chapter 38: The Regulatory Landscape
Key decisions:
**Initial funding amount:** More funding means tighter spreads and more liquidity, but higher cost. A typical range is $100-$10,000 per market depending on expected interest. - **Initial price (prior):** The AMM's initial price should reflect the best available prior estimate. For a binary market, t → Chapter 28: Principles of Prediction Market Design
Key features:
**Community review:** Questions go through a review process before opening - **Fine print:** Extensive "fine print" sections address edge cases - **Resolution council:** A council of community members can adjudicate disputes - **Question series:** Related questions are grouped into series for system → Chapter 28: Principles of Prediction Market Design
Key findings:
The resolution rate is approximately 50%, consistent with the symmetric Beta(0.8, 0.8) prior used for true probabilities. - Total volume is highly right-skewed: the mean is much larger than the median, indicating a few markets attract disproportionate trading. - Market durations vary widely across c → Case Study 1: EDA of 1,000 Resolved Polymarket Markets
Key observations from optimization:
The four correlated Senate races (P1-P4) received significantly reduced allocations compared to their individual Kelly sizes. P1 alone would justify a 5% half-Kelly allocation, but with the three correlated races, it received only 2.5%. - Economic positions E2 and E4 rank highest despite similar edg → Case Study 1: Building a Diversified Prediction Market Portfolio
Key observations from the true regime statistics:
The Volatile regime (Phase 3) has roughly 2-3x the price change standard deviation of the Stable regime. - Volume increases monotonically across regimes, with the Convergence phase showing the highest average volume (reflecting increased interest as election day approaches). - The largest single-day → Case Study 2: Detecting Market Regimes in Election Markets
Key predictions:
The spread $A - B$ is increasing in $\pi$ (more informed traders → wider spread) - The spread is increasing in $V_H - V_L$ (more uncertainty → wider spread) - The spread is zero when $\pi = 0$ (no informed traders) - The midpoint converges to the true value over time as the market maker learns from → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Key properties:
**Additivity.** SHAP values sum to the model's prediction minus the base value. - **Consistency.** If a feature contributes more in model A than model B for every possible subset, its SHAP value is higher in model A. - **Local accuracy.** The explanation exactly matches the model's output for each i → Chapter 23: Machine Learning for Probability Estimation
Key series for prediction market analysis:
GDP and GDP growth (GDPC1, A191RL1Q225SBEA) - Unemployment rate (UNRATE) - Consumer Price Index / Inflation (CPIAUCSL) - Federal funds rate (FEDFUNDS, DFEDTARU) - Treasury yields (DGS10, DGS2, T10Y2Y for spread) - S&P 500 (SP500) - Housing starts (HOUST) - Initial jobless claims (ICSA) → Appendix D: Data Sources
Key success factors:
Language localization (not just English-language platforms) - Mobile-first design (many target populations have smartphones but not desktop computers) - Low bandwidth requirements (many target populations have limited internet access) - Cultural sensitivity (framing matters — "forecasting" may be mo → Case Study 2: Addressing Inequality in Market Access
Know Your Customer (KYC):
Verify the identity of all customers at account opening - Maintain customer identification programs (CIP) - Conduct ongoing due diligence on customer activity - Apply enhanced due diligence (EDD) for higher-risk customers → Chapter 38: The Regulatory Landscape

L

Layer 1: Edge / CDN
Absorb volumetric attacks at the network edge. - Cache static assets and read-only API responses at CDN points of presence. - Use Anycast routing to distribute attack traffic globally. → Chapter 33: Scaling, Performance, and Operations
Layer 2: Application Load Balancer
TLS termination (the TLS handshake itself can be used as a DDoS vector). - Connection rate limiting per IP. - Geographic blocking if the platform only operates in specific regions. → Chapter 33: Scaling, Performance, and Operations
Layer 3: Application
Token bucket rate limiting (per user, per IP, per API key). - Request validation (reject malformed requests early, before they reach business logic). - Adaptive throttling: under load, reduce rate limits dynamically. → Chapter 33: Scaling, Performance, and Operations
Layer 4: Infrastructure
Auto-scaling to absorb legitimate traffic spikes (which may resemble DDoS). - Circuit breakers to prevent cascading failures. - Graceful degradation: during extreme load, disable non-essential features. → Chapter 33: Scaling, Performance, and Operations
Lee-Ready algorithm
if a trade occurs above the midpoint, it was likely buyer-initiated; below the midpoint, seller-initiated. → Chapter 7: Order Books and the Limit Order Market
Limitations:
Requires genuine domain expertise - Model may be systematically wrong (model risk) - Slow to react to sudden new information - Overconfidence in model leads to oversized positions → Chapter 14: Binary Outcome Trading Strategies
linear payoffs
the payout scales proportionally with the outcome value. → Chapter 4: Contracts, Payoffs, and Market Mechanics
liquidity
they make it possible for informed traders to express their views. Informed traders correct the price when it drifts from reality. Market makers sit in between, profiting from the spread while ensuring there is always someone to trade with. → Chapter 1 — What Are Prediction Markets?
Liquidity Risk
**Withdrawal liquidity**: In stressed markets, LPs may withdraw simultaneously, causing a liquidity crisis. - **Bridge liquidity**: Cross-chain positions depend on bridge liquidity. - **Market depth**: Thin markets may be impossible to exit at fair prices. → Chapter 36: DeFi Integration and Liquidity Mining
Log everything
you will need detailed trade-level data for post-trade analysis and model improvement. → Key Takeaways: Liquidity Provision and Market Making
Long-term (2030+):
Prediction markets as an established asset class with comprehensive regulation - Integration with traditional financial markets infrastructure - Global regulatory standards for event contracts - Prediction market data formally recognized as a public good → Chapter 38: The Regulatory Landscape
Lookahead bias
Using future information in past decisions. 2. **Overfitting** --- Fitting noise instead of signal. 3. **Survivorship bias** --- Testing only on markets/data that survived. 4. **Unrealistic execution** --- Assuming instant fills at observed prices. 5. **Ignoring costs** --- Omitting fees, spreads, a → Chapter 26: Backtesting Prediction Market Strategies
Losing trades (3):
Losses on the three incorrect trades: - M-024: True prob was 0.08, but market resolved YES. Bought NO at $0.81. Loss: 200 x $0.81 = -$162.00 - M-045: True prob was 0.05, but market resolved YES. Bought NO at $0.84. Loss: 200 x $0.84 = -$168.00 - M-061: True prob was 0.94, but market resolved NO. Bou → Case Study 2: Closing the Gap — Profiting from Stale Markets
Low moral hazard risk:
Weather outcomes (virtually impossible to influence) - Large-scale economic indicators (GDP, unemployment) - Sports outcomes (existing anti-corruption frameworks, difficulty of influencing major leagues) - Election outcomes (extremely difficult for individual market participants to influence) → Chapter 39: Ethics of Prediction Markets

M

makers
they "make" the market by placing orders that others can trade against. → Chapter 7: Order Books and the Limit Order Market
Manifold Markets
Community-driven, anyone can create markets - **Metaculus** — Forecasting platform with continuous distributions → Chapter 5: The Modern Platform Landscape
Manifold Markets API:
`/bets` endpoint returns individual bet records with timestamps - Each bet record includes `probBefore` and `probAfter` --- the probability before and after the bet - This allows reconstruction of the full probability time series - Limitation: Large markets may have thousands of bets → Case Study 2: Scraping Historical Data for Backtesting
margin
capital held as collateral to cover potential losses. → Chapter 4: Contracts, Payoffs, and Market Mechanics
Market A (CLOB):
Average spread: $0.03 - Trades: 150 - Total volume: 5,000 contracts - Average depth at best: 100 contracts → Chapter 7 Exercises
Market B (AMM):
Average spread: $0.05 - Trades: 80 - Total volume: 3,000 contracts - Average depth at best: Unlimited (AMM provides continuous liquidity) → Chapter 7 Exercises
Market conditions:
Bid: $0.52, Ask: $0.55, Midpoint: $0.535 - Order book depth: 50 contracts at $0.55, 50 contracts at $0.56 - Kalshi taker fee: $0.01 per contract (on both entry and exit, capped) → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Market Features:
`market_price`: The prediction market price (implied probability) at the time of our analysis. - `market_price_30d_ago`: The market price 30 days before the election. → Case Study 1: Predicting Election Outcomes with Logistic Regression
Market Lifecycle Events:
`MarketCreated` --- a new market is opened for trading - `MarketSuspended` --- trading is temporarily halted - `MarketResumed` --- trading resumes after suspension - `MarketResolved` --- the outcome is determined and the market closes - `MarketVoided` --- the market is cancelled and all positions ar → Chapter 33: Scaling, Performance, and Operations
Market Mechanics and Order Types
how orders are actually matched, what different order types mean, and how market microstructure affects your trading. We will build on the platform knowledge from this chapter with hands-on examples of placing orders, managing positions, and understanding the order book. → Chapter 5: The Modern Platform Landscape
Market quality metrics
spread, depth, order imbalance, VWAP -- provide quantitative tools for assessing how well a market functions and how costly it is to trade. → Chapter 7: Order Books and the Limit Order Market
Match!
Trade: 30 contracts at $0.53 (Carol's resting price). Carol is partially filled. - Carol's remaining: 50 - 30 = 20 contracts at $0.53. - Dave's order is fully filled. - Book: Bids = [{Carol, $0.53, 20}, {Alice, $0.50, 100}], Asks = [{Bob, $0.55, 80}] → Chapter 7: Order Books and the Limit Order Market
Maximum drawdown:
$10.00 (during scandal weeks with NO position losses) - **Sharpe ratio:** 1.42 (annualized, estimated from weekly returns) → Case Study 1: Trading a Presidential Election — Strategy Comparison
Medium-term (2027-2030):
Potential federal legislation in the US - Greater international regulatory harmonization - Maturation of DeFi compliance tools (decentralized identity, zero-knowledge proofs) - Entry of traditional financial institutions into prediction markets → Chapter 38: The Regulatory Landscape
Metaculus
https://www.metaculus.com/ - While not a trading market, Metaculus provides well-calibrated probability forecasts that can serve as a reference for evaluating prediction market prices and overround. → Chapter 10 Further Reading
Metaculus API
[metaculus.com/api](https://www.metaculus.com/api/). API documentation for Metaculus, a forecasting platform that provides probability estimates and community predictions. → Chapter 6 Further Reading
Metaculus API:
Question detail includes community prediction history - Prediction values at various time points - Limitation: Granularity varies by question activity → Case Study 2: Scraping Historical Data for Backtesting
Methods:
Surveys with proper scoring rule incentives - Delphi-style iterative forecasting with feedback - Expert panels with diverse geographic and demographic representation - Peer prediction mechanisms (Chapter 41) for communities without easy access to trading platforms → Case Study 2: Addressing Inequality in Market Access
Metrics:
Total number of active markets - Number of distinct categories/topics - Rate of new market creation (markets per week) - Coverage of "important" events (do major world events have markets?) → Case Study 2: Evaluating Platform Quality — A Data-Driven Approach
Mitigation strategies:
Pre-stage orders on both platforms before executing either - Use APIs for faster execution where available - Start with the less liquid leg (harder to fill), then execute the more liquid leg - Accept slightly worse prices on limit orders to increase fill probability → Chapter 16: Arbitrage in Prediction Markets
Mitigation:
Retrain models regularly on recent data. - Use sliding window training instead of expanding window. - Weight recent observations more heavily. - Ensemble models trained on different time periods. → Chapter 23: Machine Learning for Probability Estimation
Moderate moral hazard risk:
Corporate earnings or executive decisions (insider trading concerns more than causation) - Regulatory decisions (lobbying is legal but market positions add a layer) - Scientific replication outcomes (researchers might be influenced) → Chapter 39: Ethics of Prediction Markets
Monday 11:00 UTC
A major political event occurs (surprise election result). Multiple prediction markets that are correlated with the outcome begin moving rapidly. → Case Study 2: Post-Mortem: When the Bot Went Wrong
Most traders are overconfident
their estimates are more extreme than their accuracy warrants, and their confidence ratings do not predict accuracy. 2. **Round-number anchoring is nearly universal** — estimates cluster near 25%, 50%, and 75% far more than they should. 3. **The disposition effect is common** — losing positions are → Case Study 2: Behavioral Audit of Your Trading History

N

Negative autocorrelation (mean reversion):
Prices tend to reverse direction. - Possible causes: overreaction followed by correction, bid-ask bounce, market-making activity. - Trading implication: contrarian strategies may be profitable. → Chapter 21: Exploratory Data Analysis of Market Data
nested conditions
splitting outcome tokens from one condition into sub-positions contingent on another condition. When splitting from raw collateral, `parentCollectionId` is `bytes32(0)`. → Chapter 35: Smart Contract Market Mechanisms
Net P&L:
$6.90 - **Return on capital:** -0.07% - **Number of trades:** 4 - **Win rate:** 4/4 = 100% - **Maximum drawdown:** -$4.80 (during Signal 4 when price moved against before reverting) - **Sharpe ratio:** -0.15 (annualized) → Case Study 1: Trading a Presidential Election — Strategy Comparison
Neural Network:
Hidden layer sizes, number of layers - Learning rate, weight decay - Dropout rate, batch size - Activation function → Chapter 23: Machine Learning for Probability Estimation
Never commit:
`.env` files (API keys, secrets) - Data files (`.csv`, `.parquet`, `.db`) — too large and potentially sensitive - Log files - Virtual environment directories - `__pycache__` directories - IDE-specific files (`.vscode/settings.json` with personal settings) → Chapter 6: Setting Up Your Python Toolkit
Never use the test set for any decision
not feature selection, not model selection, not hyperparameter tuning. → Chapter 22: Statistical Modeling — Regression and Time Series
No autocorrelation:
Consistent with an efficient market. - Price changes are unpredictable from past changes. - Trading implication: simple trend-following or mean-reversion strategies will not work. → Chapter 21: Exploratory Data Analysis of Market Data
Normal (Gaussian) Distribution
$X \sim \mathcal{N}(\mu, \sigma^2)$ → Appendix A: Mathematical Foundations
Novelty Features:
`news_surprise`: How novel the latest article is (from Section 24.7). - `information_velocity`: Rate at which new information is appearing. → Chapter 24: NLP and Sentiment Analysis

O

Observations:
**Spread**: $0.01 (tight for a prediction market) - **Midpoint**: $0.555 - **Depth at best**: 750 contracts (400 bid + 350 ask) - **Total depth**: 3,950 contracts - **Order imbalance**: (2,200 - 1,750) / (2,200 + 1,750) = +0.114 (slightly bullish) → Case Study 1: Order Book Analysis of a High-Profile Polymarket Event
odds ratio
the factor by which the odds are multiplied for a one-unit increase in $x_j$. If $\beta_j = 0.5$, then $e^{0.5} \approx 1.65$, meaning a one-unit increase in $x_j$ multiplies the odds by 1.65 (a 65% increase in odds). → Chapter 22: Statistical Modeling — Regression and Time Series
Operational
[ ] Runbook documents startup, shutdown, and emergency procedures - [ ] Contact information for platform support is accessible - [ ] Calendar marked with platform maintenance windows - [ ] Team members know how to shut down the bot in an emergency → Chapter 19: Live Trading, Execution, and Operational Discipline
Option A: Standard LMSR
Pros: Bounded loss (budget predictable), well-understood theory, natural multi-outcome support - Cons: Fixed liquidity parameter, requires upfront subsidy commitment per market → Case Study 1: Designing an AMM for a Community Prediction Platform
Option B: CPMM
Pros: Simple to implement, familiar from DeFi, intuitive "pool" metaphor - Cons: Unbounded loss, reserve limits on trading, less elegant for multi-outcome markets → Case Study 1: Designing an AMM for a Community Prediction Platform
Option C: LS-LMSR
Pros: Adaptive liquidity, better long-term price behavior - Cons: More complex to implement, no bounded loss guarantee, harder to budget → Case Study 1: Designing an AMM for a Community Prediction Platform
Oracle Risk
**Data feed manipulation**: Oracles providing resolution data can be manipulated. - **Oracle downtime**: If the oracle fails to report, markets cannot resolve. - **Oracle disagreement**: Multiple oracle sources may disagree on the outcome. → Chapter 36: DeFi Integration and Liquidity Mining
order book
a data structure that collects and organizes all outstanding buy and sell orders, matching them according to precise rules. Understanding the order book is not optional if you want to trade prediction markets seriously. It is the lens through which you see the market's true state: not just the last → Chapter 7: Order Books and the Limit Order Market
Order Book Markets (Polymarket, Kalshi):
Impact is discrete: your order "walks" through price levels - Impact depends on the specific shape of the order book - You can observe the book and predict your impact before trading - Temporary impact is high; permanent impact depends on information content → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Order Events:
`OrderPlaced` --- a new order enters the system - `OrderMatched` --- two orders are matched (partially or fully) - `OrderCancelled` --- a trader cancels an open order - `OrderExpired` --- a time-limited order reaches its expiry → Chapter 33: Scaling, Performance, and Operations
Order flow
the sequence of orders arriving at the exchange -- contains information beyond what the order book snapshot shows. Key signals include: → Chapter 7: Order Books and the Limit Order Market
Original specification:
Title: "Will AI take over?" - Close date: December 31, 2030 - Resolution: "Resolves YES if AI takes over." - Initial price: 0.50 - Platform: Fictional internal corporate prediction market → Case Study 1: Redesigning a Poorly Designed Market
Othman and Sandholm (2010)
Studied the game-theoretic equilibria of decision markets and showed that truthful reporting is a Bayesian Nash Equilibrium under certain conditions, but that multiple equilibria can exist. → Chapter 31: Decision Markets and Futarchy
Outcomes:
Democratic Party nominee - Republican Party nominee - Independent/Third-party candidate - No election held (catch-all for extraordinary scenarios) → Case Study 2: Designing a Market Suite for a Presidential Election

P

Page and Clemen (2013)
Analyzed conditions under which conditional market prices converge to causal effects and showed that even small deviations from the ideal conditions can produce large biases. → Chapter 31: Decision Markets and Futarchy
Paper trading with live data
As discussed in Section 19.10, building a paper trading engine against live market data is the most realistic way to test before going live. → Further Reading: Chapter 19
Parameters:
$b = 200$ (moderate liquidity for a popular local topic) - Initial probability: 50% → Case Study 2: LMSR in Action --- Analyzing Manifold Markets' Market Maker
partial fill
the incoming order was only partially matched. → Chapter 7: Order Books and the Limit Order Market
partition
a set of disjoint index sets that cover all outcomes. → Chapter 35: Smart Contract Market Mechanisms
Per round-trip trade:
Spread cost: 3 cents × 50 contracts = $1.50 - Entry fee: $0.01 × 50 = $0.50 - Exit fee: $0.01 × 50 = $0.50 - Total per trade: $1.50 + $0.50 + $0.50 = **$2.50** → Chapter 10 Quiz
Phase 1: Assessment (2-4 weeks)
Identify 5-10 candidate questions where forecasting accuracy matters - Assess cultural readiness and leadership support - Determine regulatory constraints (real vs. play money) - Estimate the potential participant pool → Chapter 40: Real-World Applications
Phase 2 (Months 13-24): Modified Option E — Hybrid
Maker fee: $0.00 (remove rebate as liquidity is self-sustaining) - Taker fee: $0.01 - Resolution fee: $0.005 (on winning contracts) - Rationale: Reduce subsidies to market makers once the flywheel is spinning. The resolution fee is less visible and adds revenue without significantly impacting tradin → Case Study 2: Fee Structure Design for a New Platform
Phase 2: Design (4-8 weeks)
Select a market mechanism (continuous double auction, LMSR, etc.) - Design the incentive structure - Build or acquire the platform - Create resolution criteria for initial questions → Chapter 40: Real-World Applications
Phase 3 (Month 25+): Optimized Hybrid
Maker fee: $0.00 - Taker fee: $0.008 - Resolution fee: $0.005 - Volume discounts for top traders - Rationale: Reduce taker fee slightly to remain competitive. Revenue is sustained by high volume. → Case Study 2: Fee Structure Design for a New Platform
Phase 3: Pilot (8-16 weeks)
Launch with 50-200 participants - Run 10-20 markets simultaneously to ensure engagement - Monitor trading patterns for quality signals - Compare market forecasts to official forecasts → Chapter 40: Real-World Applications
Phase 3: Resolution
**If no dispute**: The assertion is accepted as true. The proposer receives their bond back plus a small reward. - **If disputed**: The question is escalated to UMA's **Data Verification Mechanism (DVM)**, a token-weighted Schelling point vote among UMA token holders. → Chapter 37: Oracles, Resolution, and the Decentralization Trilemma
Phase 4: Evaluation (2-4 weeks)
Measure forecast accuracy against baselines - Survey participants on experience - Assess organizational impact - Decide whether to scale → Chapter 40: Real-World Applications
Phase 5: Scaling
Expand participant pool - Integrate market signals into decision processes - Build internal expertise in market design - Establish ongoing governance → Chapter 40: Real-World Applications
Pilot program design:
Budget: $500,000 per year - Target population: Residents of Sub-Saharan Africa with relevant expertise - Distribution: $100 per qualified participant (5,000 participants) - Markets: Focus on questions where local knowledge is valuable (food security, weather, public health) - Measurement: Compare ma → Case Study 2: Addressing Inequality in Market Access
Platform sandbox/testnet environments
Most prediction market platforms offer sandbox environments for testing API integration without risking real capital. Always use these before connecting to production. → Further Reading: Chapter 19
Platforms used:
Platform A (Polymarket-style, crypto-settled): Up to 40% of trading capital - Platform B (Kalshi-style, USD-settled): Up to 40% of trading capital - Platform C (smaller exchange): Up to 25% of trading capital → Case Study 1: Building a Diversified Prediction Market Portfolio
Poisson Distribution
$X \sim \text{Poisson}(\lambda)$ → Appendix A: Mathematical Foundations
Political Markets:
Average spreads: 2-5 cents on major races, 5-10 cents on minor races - Spreads widen before debates, primary elections, and polling releases - Spreads narrow after definitive results in related races - Highest adverse selection risk around insider information (endorsements, campaign strategy changes → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Polling Features:
`polling_avg`: Weighted average of polls in the final 30 days before the election. - `polling_trend_30d`: Change in polling average over the last 30 days. - `polling_volatility`: Standard deviation of polls in the final 60 days. - `polls_count`: Number of polls conducted in the final 30 days. → Case Study 1: Predicting Election Outcomes with Logistic Regression
Polymarket
Largest by volume, built on Polygon - **Augur** — Pioneering decentralized protocol on Ethereum - **Gnosis/Omen** — Conditional token framework → Chapter 5: The Modern Platform Landscape
Polymarket (buy YES) + Kalshi (buy NO):
Cost: $p_{YES}^{Poly} \times 1.01 + p_{NO}^{Kalshi} + 0.03$ - If YES wins: Payout = $1.00. Net = $1.00 - \text{cost}$. - If NO wins: Payout = $1.00. Net = $1.00 - \text{cost}$. → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
Polymarket (buy YES) + PredictIt (buy NO):
Cost: $p_{YES}^{Poly} \times 1.01 + p_{NO}^{PI}$ - If YES wins: Payout from Poly = $1.00. Net = $1.00 - \text{cost}$. - If NO wins: Payout from PI = $1.00 - 0.10 \times (1.00 - p_{NO}^{PI})$. Net = Payout $- \text{cost}$. → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
Polymarket API documentation
[docs.polymarket.com](https://docs.polymarket.com/). The official API documentation for Polymarket, including endpoint references, authentication guides, and WebSocket documentation for real-time data. → Chapter 6 Further Reading
Polymarket CLOB API:
`/prices-history` endpoint returns historical price data - Supports intervals: 1d, 1w, 1m, 3m, 1y, all - Returns `{timestamp, price}` pairs at configurable fidelity - Limitation: Limited to active and recently resolved markets → Case Study 2: Scraping Historical Data for Backtesting
Polymarket Documentation
https://docs.polymarket.com/ - Official documentation for Polymarket's API and fee structure. Essential for traders building automated systems on the platform. → Chapter 10 Further Reading
Polymarket Model:
Order matching: Off-chain (centralized operator) - Token custody: On-chain (user wallets) - Settlement: On-chain (CTF Exchange contract) - Resolution: On-chain (UMA oracle) → Chapter 35: Smart Contract Market Mechanisms
portfolio construction for prediction markets
how to size positions, manage risk across multiple correlated markets, and build a diversified portfolio of probability bets. You will learn that trading prediction markets successfully is not just about being right; it is about being right in the right amounts, at the right times, with appropriate → Chapter 12: Calibration — Measuring Forecast Quality
Position Held
> Resolution -> Settlement. After your order is matched, you hold a position that you can monitor and manage. → Chapter 4 Quiz
Position:
Buy Bracket 5 (1.0--1.5%): Strong edge of 7.15 percentage points - Buy Bracket 6 (1.5--2.0%): Strong edge of 5.12 percentage points - Sell Bracket 1 (Below -1.0%): Edge of 2.59 percentage points - Sell Bracket 2 (-1.0% to 0.0%): Edge of 2.85 percentage points - Sell Bracket 9 (3.0--4.0%): Edge of 3. → Case Study 2: Scalar Market Trading: GDP Growth Brackets
Positive autocorrelation (momentum):
Prices tend to continue moving in the same direction. - Possible causes: gradual information incorporation, trend-following behavior, underreaction to news. - Trading implication: momentum strategies may be profitable. → Chapter 21: Exploratory Data Analysis of Market Data
Post-debate metrics:
**Spread**: $0.01 (back to pre-debate tightness) - **Midpoint**: $0.685 - **Depth at best**: 900 contracts (even deeper than pre-debate) - **Total depth**: 4,500 contracts (exceeds pre-debate) - **OBI**: (2,500 - 2,000) / (2,500 + 2,000) = +0.111 → Case Study 1: Order Book Analysis of a High-Profile Polymarket Event
Practical considerations
liquidity, slippage, contract specification pitfalls, and platform risk — separate paper profits from real-world profits. → Chapter 4: Contracts, Payoffs, and Market Mechanics
Practical guidelines:
If $f^* \leq 0$, do not bet (no edge). - Half Kelly ($f^*/2$) achieves approximately 75% of the growth rate with substantially lower variance and drawdown. - Quarter Kelly ($f^*/4$) is recommended when probability estimates are uncertain. - Never exceed full Kelly; "over-betting" reduces long-run gr → Appendix B: Statistical Tables
Practical responses:
Use stationary transformations as features: returns instead of prices, changes instead of levels. - Include time-to-resolution as a feature, allowing the model to learn that different features matter at different time horizons. - Separate models for different time horizons (e.g., one model for predi → Chapter 23: Machine Learning for Probability Estimation
Practical tips for model building:
Always hold out data for validation. Backtested performance on the same data used for training is meaningless. - Be skeptical of complex models. Simple models with a few strong features often outperform complex models, especially with limited training data. - Quantify model uncertainty. A model that → Chapter 13: Finding and Quantifying Your Edge
Practical tips:
Do not rely on stale order book data. If your data is more than a few seconds old, the book may have changed. - Use limit orders rather than market orders to control your execution price. - If you are building automated strategies, implement rate limiting to avoid overwhelming the exchange's API. → Chapter 7: Order Books and the Limit Order Market
practice
how to estimate probabilities from data, test whether your edge is real, build confidence intervals, and assess whether prediction market prices are well-calibrated. The tools you built here (Bayesian updater, EV calculator, Monte Carlo simulator) will be extended and applied to real market data. → Chapter 3: Key Takeaways
pre-event positioning
market makers widen their quotes to protect against the uncertainty of the debate, and some early informed buying may be occurring. → Case Study 1: Order Book Analysis of a High-Profile Polymarket Event
Prediction Market Resource List
Various academic and practitioner resources on prediction market design, efficiency, and trading strategies. Many university economics departments maintain curated lists. → Chapter 13 Further Reading
PredictIt API
Market data from PredictIt is accessible via their public API endpoints, though formal documentation is limited. Community-maintained Python wrappers exist on GitHub. → Chapter 6 Further Reading
Prevention:
Organize data with strict timestamps. - Implement a `FeatureStore` that only returns features available at a given timestamp. - Run leakage detection: if a feature has suspiciously high importance (e.g., a single feature yields near-perfect predictions), investigate. → Chapter 23: Machine Learning for Probability Estimation
prior probability
your belief about A before observing evidence B. P(B|A) is the likelihood, P(B) is the evidence (or marginal likelihood), and P(A|B) is the posterior probability. → Chapter 3 Quiz: Probability Fundamentals
Pro:
Intelligence agencies already try to predict conflicts. Markets might do it better. - Better predictions could enable diplomatic intervention and save lives. - Traders with local knowledge (journalists, aid workers, diaspora communities) could contribute valuable signals. → Chapter 39: Ethics of Prediction Markets
Profit and Loss (P&L):
Total P&L (absolute dollars) - P&L per trade (average) - P&L by market category - P&L by edge source → Chapter 13: Finding and Quantifying Your Edge
Prometheus and Grafana
The standard open-source stack for monitoring and alerting in production systems. Essential for trading system dashboards. https://prometheus.io/ and https://grafana.com/ → Further Reading: Chapter 19
proper scoring rules
formulas that reward forecasters for honest probability assessments (which we explored in Chapter 4). Hanson's insight was to chain scoring rule payments together: each trader "updates" the market's probability, paying or receiving the difference in scores between the old and new states. → Chapter 8: Automated Market Makers
Properties:
Simple, with only two parameters. - Works well when the calibration mapping is roughly sigmoidal. - Can be fit on a small calibration set (a few hundred samples). - Assumes a monotonic, parametric relationship between raw output and true probability. → Chapter 23: Machine Learning for Probability Estimation
Pros for Meridian:
Easy to explain: "It's the squared error between your forecast and what happened" - Bounded: worst score is 1, so employees face limited downside - Decomposable: can give employees feedback on calibration and resolution → Case Study 2: Designing a Scoring System for a Corporate Forecasting Program
provider
a service that runs an Ethereum node and exposes an API. There are three types: → Chapter 34: Blockchain Fundamentals for Prediction Markets
Python `asyncio` documentation
For building asynchronous trading systems that handle multiple data feeds and order streams concurrently. https://docs.python.org/3/library/asyncio.html → Further Reading: Chapter 19
Python.org official tutorial
[docs.python.org/3/tutorial](https://docs.python.org/3/tutorial/). If you need to brush up on Python fundamentals, the official tutorial is clear and authoritative. → Chapter 6 Further Reading

Q

QuantConnect and Zipline communities
Open-source backtesting and live trading platforms with active communities. While focused on traditional markets, the infrastructure discussions are directly relevant. → Further Reading: Chapter 19
Quasi-Arbitrage:
Statistically likely profit but not guaranteed - Small probability of loss exists - Execution may not be perfectly simultaneous - Related but not identical events or resolution criteria → Chapter 16: Arbitrage in Prediction Markets
Query Side (Read Model):
Maintains denormalized views optimized for specific query patterns. - Updated asynchronously by subscribing to the event stream. - Can have multiple read models, each optimized for different use cases. - Eventual consistency is acceptable (typically milliseconds of lag). → Chapter 33: Scaling, Performance, and Operations

R

Random Forest:
`n_estimators`: number of trees (100-1000) - `max_depth`: maximum tree depth (3-15) - `min_samples_leaf`: minimum samples per leaf (5-50) - `max_features`: features per split (`'sqrt'`, `'log2'`, or fraction) → Chapter 23: Machine Learning for Probability Estimation
Real Python
[realpython.com](https://realpython.com/). High-quality Python tutorials covering many of the topics in this chapter, including virtual environments, logging, testing, and API interaction. → Chapter 6 Further Reading
Redis documentation
Redis is widely used in trading systems for real-time data caching, pub/sub messaging, and rate limiting. https://redis.io/documentation → Further Reading: Chapter 19
reference forecast
typically the base rate (climatological frequency) or a naive forecast of 0.5. The **Brier Skill Score (BSS)** is: → Chapter 9: Scoring Rules and Proper Incentives
regression models
both linear and logistic — that translate features like polling data, economic indicators, and historical base rates into probability estimates. Second, **time series models** — ARIMA, GARCH, and state space approaches — that capture the temporal dynamics of market prices themselves. Third, **valida → Chapter 22: Statistical Modeling — Regression and Time Series
Regulation fundamentally shapes prediction markets
determining what markets exist, who can trade, and how platforms operate. → Chapter 38: The Regulatory Landscape
reputation
a non-transferable score based on historical accuracy: → Chapter 37: Oracles, Resolution, and the Decentralization Trilemma
resolution criteria
the objective rules that determine whether the event occurred. Good resolution criteria are: → Chapter 1 — What Are Prediction Markets?
Resolution criteria comparison:
Polymarket: "Will a Supreme Court Justice announce retirement or die before February 28, 2026?" - Kalshi: "Will there be a new vacancy on the US Supreme Court by end of February 2026?" → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
Resolution criteria:
If [Candidate X] is NOT the Democratic nominee: Resolves N/A - If [Candidate X] IS the Democratic nominee: Resolves YES if they win the presidential election per Market 1 criteria, NO otherwise → Case Study 2: Designing a Market Suite for a Presidential Election
resolution risk
the possibility that two platforms resolve the "same" event differently. This can happen because: → Chapter 16: Arbitrage in Prediction Markets
Revenue:
Spread earned per contract: $S$ - Volume of contracts traded: $V$ - Gross revenue: $S \times V$ → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Revised portfolio:
Positions: 39 (down from 42) - Deployed capital: $21,210 (down from $22,890) - Deployment ratio: 65% (down from 70%) → Case Study 2: Stress Testing Through a Black Swan Event
Risk Configuration
[ ] All risk limits set conservatively (you can always loosen later) - [ ] Daily loss limit is set and tested - [ ] Position limits are set per market and per portfolio - [ ] Kill switch is tested and accessible → Chapter 19: Live Trading, Execution, and Operational Discipline
Risk metrics:
Sharpe ratio (mean return / standard deviation of returns) - Maximum drawdown (largest peak-to-trough decline) - Win rate (fraction of trades with positive P&L) - Profit factor (gross profit / gross loss) → Chapter 13: Finding and Quantifying Your Edge
Risks in "Risk-Free" Trades:
Settlement risk (platform failure or delayed resolution) - Resolution ambiguity (different platforms may resolve differently) - Capital lock-up cost (opportunity cost of tied-up capital) - Regulatory risk (platform shutdowns, rule changes) - Counterparty risk (especially on less established platform → Chapter 16: Arbitrage in Prediction Markets
Risks:
Encouraging quantity over quality (trading for streaks rather than information) - Trivializing serious forecasting - Creating addictive patterns that may attract regulatory scrutiny → Chapter 28: Principles of Prediction Market Design

S

sample space
the complete set of all possible outcomes. We denote it with the Greek letter omega: **S** (or sometimes **$\Omega$**). → Chapter 3: Probability Fundamentals
Scoring Guide:
23–25 correct: Excellent — you have a thorough understanding of the prediction market landscape. - 18–22 correct: Good — solid grasp of the major platforms and their differences. - 13–17 correct: Fair — review the sections on platforms you missed. - Below 13: Review the chapter carefully before proc → Chapter 5 Quiz
Sentiment Features:
`sentiment_mean_1h`: Average sentiment of articles in the past 1 hour. - `sentiment_mean_24h`: Average sentiment over the past 24 hours. - `sentiment_std_24h`: Standard deviation of sentiment (higher = more disagreement). - `sentiment_momentum`: Change in average sentiment from 24h ago to now. - `se → Chapter 24: NLP and Sentiment Analysis
Setup:
Prior: $p \sim \text{Beta}(\alpha, \beta)$ --- your belief about the true probability p - Likelihood: $X \sim \text{Binomial}(n, p)$ --- you observe X successes in n trials - Posterior: $p | X \sim \text{Beta}(\alpha + X, \beta + n - X)$ → Chapter 3: Probability Fundamentals
Short-term (2025-2027):
Expansion of Kalshi and other DCMs into new event categories - Implementation of MiCA for European crypto prediction markets - Continued enforcement against unregistered platforms - Initial regulatory sandbox experiments → Chapter 38: The Regulatory Landscape
Signal 1 (Week 8, Convention Bounce):
Convention drove price to 0.62, exceeding the upper band at 0.60 - Volume was elevated but driven by speculative "convention excitement" - Bought NO at 0.38 (equivalent to selling YES at 0.62) - Price reverted to 0.60 within 1 week; exited at 0.40 (YES at 0.60) - P&L: 130 contracts x $0.02 = +$2.60 → Case Study 1: Trading a Presidential Election — Strategy Comparison
Signal 2 (Week 11):
Z-score of -1.8 did not exceed the 2.0 threshold. No trade. → Case Study 1: Trading a Presidential Election — Strategy Comparison
Signal 3 (Week 17, Post-Debate Spike):
Debate win drove price to 0.63, exceeding the upper band at 0.60 - Bought NO at 0.37 - Price reverted to 0.61 within 1 week; exited at 0.39 - P&L: 140 contracts x $0.02 = +$2.80 → Case Study 1: Trading a Presidential Election — Strategy Comparison
Signal 4 (Week 20, Scandal Drop):
Scandal drove price from 0.59 to 0.48, well below the lower band at 0.50 - Volume was extremely high --- this signal should have been filtered as information-driven - **Without volume filter:** Bought YES at 0.48. Price continued down to 0.45 before recovering. - Exited at 0.50 (2-week time limit, p → Case Study 1: Trading a Presidential Election — Strategy Comparison
Signal 5 (Week 21, Continued Scandal):
Price at 0.45, Z-score -3.2. Extremely oversold. - Volume starting to decline (scandal becoming old news) - Bought YES at 0.45. Price reverted to 0.50 within 1 week. - P&L: 170 contracts x $0.05 = +$8.50 → Case Study 1: Trading a Presidential Election — Strategy Comparison
Smart Contract Risk
**Code bugs**: Vulnerabilities in the prediction market's smart contracts can lead to loss of funds. - **Upgrade risk**: Proxy contracts can be upgraded, potentially introducing malicious code. - **Dependency risk**: The prediction market depends on other contracts (oracles, AMMs, tokens) that may h → Chapter 36: DeFi Integration and Liquidity Mining
spoofing
see Section 7.8), and the depth chart can change dramatically in seconds. → Chapter 7: Order Books and the Limit Order Market
Sports betting markets:
Extremely well-calibrated for major events (NFL, Premier League) with ECE often below 0.02. - Less well-calibrated for minor events where liquidity is lower. - Exhibit the classic favorite-longshot bias: favorites are slightly underpriced, longshots are slightly overpriced. → Chapter 12: Calibration — Measuring Forecast Quality
Sports Markets:
Average spreads: 1-3 cents on major events (Super Bowl, World Cup) - Spreads tighten significantly close to game time (less uncertainty about lineups, conditions) - Spreads widen at halftime or during injury timeouts - Relatively low adverse selection (information is mostly public) → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
spread
represents the cost of immediacy. If you want to buy *right now* without waiting, you must pay the ask price. If you want to sell *right now*, you must accept the bid price. The spread is, in effect, the price you pay for the convenience of immediate execution. → Chapter 7: Order Books and the Limit Order Market
Stack Overflow
[stackoverflow.com/questions/tagged/python](https://stackoverflow.com/questions/tagged/python). When you encounter specific error messages or unexpected behavior, searching Stack Overflow often provides solutions faster than reading documentation. → Chapter 6 Further Reading
stale markets
markets where the outcome has become clear but the price has not fully adjusted. This happens because: → Chapter 14: Binary Outcome Trading Strategies
Staleness indicators:
Last trade more than 12 hours ago, OR - Fewer than 20 active traders, OR - 24-hour volume below 50 contracts 4. **Minimum edge:** 3 cents after transaction costs (2 cents per contract) → Case Study 2: Closing the Gap — Profiting from Stale Markets
Step 1: Define the Problem
What are you forecasting? (Binary outcome, multi-class, continuous?) - What is your evaluation metric? (Brier score, log loss, calibration?) - What is your time horizon? → Chapter 25: Ensemble Methods and Model Combination
Step 1: Define your terms.
A = "Policy is announced this month" - B = "News reports officials are drafting the document" - P(A) = 0.30 (prior, from the market price) - P(A^c) = 0.70 → Chapter 3: Probability Fundamentals
Step 2: Build Diverse Base Models
Start with at least 3-5 models using different approaches: - A simple baseline (historical base rates) - A statistical model (logistic regression on structured features) - A machine learning model (gradient boosting, random forest) - Market price (if available) - Expert or crowd forecast (if availab → Chapter 25: Ensemble Methods and Model Combination
Step 2: Estimate the likelihoods.
P(B|A): If the policy IS going to be announced, how likely is it that drafting news would leak? Let's say 0.85. - P(B|A^c): If the policy is NOT going to be announced, how likely is it that such news would appear? Maybe 0.15 (false reports, speculative journalism, drafting that goes nowhere). → Chapter 3: Probability Fundamentals
Step 2: Specific factors.
Governor Smith has a 52% approval rating (moderate, not strong) - Her primary opponent is a well-funded challenger with 35% name recognition - Recent polling shows Smith leading 48-38 with 14% undecided - Historical pattern: candidates leading by 10+ points in primaries at this stage win about 75% o → Case Study 1: From Gut Feeling to Quantified Edge: A Trader's Journey
Step 3: Combining estimates.
Base rate estimate: 65% - Polling-based estimate: 75% - Qualitative assessment (strong campaign infrastructure, endorsements): 70% → Case Study 1: From Gut Feeling to Quantified Edge: A Trader's Journey
Step 3: Evaluate Individual Models
Assess each model's calibration, discrimination (AUC), and overall accuracy (Brier score). - Use proper scoring rules (see Chapter 6). - Evaluate on a held-out test set or via cross-validation. → Chapter 25: Ensemble Methods and Model Combination
Step 4: Choose a Combination Method
**Start with simple averaging** as a baseline. - **Try weighted averaging** if you have enough historical data (at least 50-100 resolved predictions per model). - **Try extremizing** if your models share significant information. - **Try stacking** if you have abundant data and features. - **Try BMA* → Chapter 25: Ensemble Methods and Model Combination
Step 5: Validate the Ensemble
Use time-series cross-validation (never peek at the future). - Compare the ensemble to each individual model. - Check calibration of the ensemble. - Analyze the diversity metrics to understand why the ensemble works. → Chapter 25: Ensemble Methods and Model Combination
Step 6: Monitor and Update
Track ensemble performance over time. - Periodically re-estimate combination weights. - Add new models or remove underperformers. - Watch for concept drift (systematic changes in the forecasting environment). → Chapter 25: Ensemble Methods and Model Combination
Strategy B: Register as DCM (Kalshi's approach)
Revenue: Lower initially (compliance costs, slower time to market), higher long-term (US market access) - Compliance cost: $5M upfront + $2M/year - Net present value (5-year): Positive if US market revenue exceeds compliance costs → Case Study 2: CFTC vs Polymarket — Regulatory Compliance Case Analysis
Strengths:
Highest liquidity of any prediction market (especially for political and crypto events) - Non-custodial: users control their own wallets - Fast order execution with the hybrid CLOB model - Strong mobile experience - Rich public API for data access - No position limits on most markets → Chapter 5: The Modern Platform Landscape
Subsidy analysis:
Total collected: $44.16 - If "Yes" wins: Payout = $50 (50 Yes shares), Loss = $50 - $44.16 = $5.84 - If "No" wins: Payout = $26 (26 No shares), Profit = $44.16 - $26 = $18.16 - Maximum possible loss was $24.25; actual worst case is $5.84 --- well within budget → Case Study 1: Designing an AMM for a Community Prediction Platform

T

taker
they "take" liquidity from the book. For example, if the best ask is $0.57 and you submit a buy limit at $0.58, your order will immediately match against the ask at $0.57. → Chapter 7: Order Books and the Limit Order Market
Target:
`won`: Binary outcome (1 if the candidate won, 0 otherwise). → Case Study 1: Predicting Election Outcomes with Logistic Regression
telescope
the total paid out by the market is: → Chapter 9: Scoring Rules and Proper Incentives
The API is incomplete
it does not expose certain data visible on the web interface. 3. **Historical data** is only available through web archives or wayback machines. 4. **Cross-platform comparison** requires data from platforms without APIs. 5. **One-time data collection** where building an API integration is not worth → Chapter 20: Data Collection and Web Scraping
The Beginner Path
You are new to prediction markets and want a comprehensive understanding. Read the book in order, Parts I through VII. Work through at least the Part A and Part B exercises in every chapter. Do not skip Part I, even if the probability review feels familiar — the prediction-market-specific framing wi → How to Use This Book
The case against:
Markets on identifiable individuals' deaths commodify human life and reduce persons to financial instruments. - Even if the moral hazard risk is low (most market participants cannot cause someone's death), the mere existence of such markets may be experienced as a form of violence by the subject and → Chapter 39: Ethics of Prediction Markets
The case for death/health markets:
Life insurance and annuity markets already involve betting on mortality. The life settlement industry involves purchasing life insurance policies from the terminally ill — essentially a mortality prediction market. - Health-related prediction markets could aggregate information about drug efficacy, → Chapter 39: Ethics of Prediction Markets
The Data Scientist Path
You have strong programming and statistics skills and want to focus on modeling and forecasting. Skim Part I for domain context (Chapters 1--3 are essential; 4--6 may be review). Read Part II selectively, focusing on Chapters 7 and 10 for market structure context. Read Part III in full — this is you → How to Use This Book
The disciplined backtester asks:
"What could be wrong with this result?" not "How good is this result?" - "How would this fail?" not "How much would this make?" - "Is this edge robust across different time periods, markets, and parameter choices?" not "What parameters maximize the backtest return?" → Chapter 26: Backtesting Prediction Market Strategies
The Grey Zone:
Political elections - Geopolitical events (wars, coups, sanctions) - Social outcomes (pandemic severity, crime rates) - Cultural events (Oscar winners, Supreme Court decisions) → Chapter 38: The Regulatory Landscape
The Howey Test
An investment contract exists when there is: 1. An **investment of money** 2. In a **common enterprise** 3. With a reasonable **expectation of profits** 4. Derived from the **efforts of others** → Chapter 38: The Regulatory Landscape
the losses are much larger than the wins.
Average win: +$14.40 - Average loss: -$166.67 - Loss-to-win ratio: 11.6x → Case Study 2: Closing the Gap — Profiting from Stale Markets
The Platform Builder Path
You are a software engineer who wants to build or contribute to prediction market platforms. Read Chapters 1--3 for context, then Chapters 7--9 in Part II for market mechanics. Read Part V in its entirety — this is your core section. Then read Chapters 31--34 in Part VI for advanced market design co → How to Use This Book
The Strategy:
The trader identifies binary contracts where their estimated true probability q exceeds the market price p - They buy one contract on each identified opportunity - They make approximately 1,000 trades over the course of a year - All contracts are binary (pay $1 or $0) - Contract prices vary, but ave → Case Study 2: Monte Carlo Simulation of Prediction Market Returns
The trade:
Buy YES on Polymarket at $0.15. Fee = 1% of $0.15 = $0.0015. Cost per contract = $0.1515. - Buy NO on Kalshi at $0.90. Fee = $0.03 per contract. Cost per contract = $0.93. - Total cost per pair: $0.1515 + $0.93 = $1.0815. → Case Study 1: Finding $50,000 in Cross-Platform Arbitrage
The Trader Path
You have trading experience in other markets and want to apply it to prediction markets. Read Chapters 1--3 in Part I for domain orientation. Read Part II carefully — microstructure knowledge is your edge. Skim Part III for modeling awareness, then read Part IV in full, paying special attention to t → How to Use This Book
thin order books
buy and sell orders sit unmatched for hours or days. This creates three serious problems: → Chapter 8: Automated Market Makers
Thursday 09:15 UTC
The bot is operating normally with these risk limits: - Max position per market: 100 contracts - Max order size: 50 contracts → Case Study 2: Post-Mortem: When the Bot Went Wrong
Tier 2: Major institutional data
WHO disease reports, IMF economic data, major academic studies - Generally reliable but may have methodological disputes → Chapter 28: Principles of Prediction Market Design
Tier 3: Reputable media organizations
Reuters, AP, major newspapers - Good for event-based resolution but subject to correction and retraction → Chapter 28: Principles of Prediction Market Design
Tier 4: Domain-specific specialized sources
Box Office Mojo for film revenue, Transfermarkt for sports transfers, GitHub for software releases - Reliable within domain but may have coverage gaps → Chapter 28: Principles of Prediction Market Design
Tier 5: Platform or community determination
Market creator judgment, community vote, arbitration panel - Use only as last resort; subject to bias and manipulation → Chapter 28: Principles of Prediction Market Design
Time series models
ARIMA, GARCH, and state space models — capture the temporal dynamics of prediction market prices. ARIMA models autocorrelation in price changes, GARCH models time-varying volatility, and regime-switching models detect structural changes in market behavior. → Chapter 22: Statistical Modeling — Regression and Time Series
Timeline:
**T-48 hours**: Rumors begin circulating among political insiders. A few large buy orders appear in the "VP pick" conditional market. VPIN rises from 0.45 to 0.55. → Case Study 2: Adverse Selection in Political Markets
Timing implications by architecture:
**Centralized**: Can resolve at informal result, but risks premature resolution if result is contested. - **UMA**: Proposer asserts at informal result, 48-hour dispute window allows time for challenges. If result is contested, dispute extends resolution. - **Kleros**: Jury votes after event, but app → Case Study 2: Multi-Oracle Security Analysis for a High-Stakes Political Market
Topic Features:
`topic_k_weight`: Weight of topic $k$ in recent articles (one feature per topic). - `topic_shift`: Change in dominant topic over time. - `topic_entropy`: Entropy of topic distribution (higher = more diverse coverage). → Chapter 24: NLP and Sentiment Analysis
Toxicity
Do prices move in the direction of recent trades? - **VPIN** — What fraction of volume is directionally imbalanced? - **Kyle's Lambda** — What is the price impact per unit of order flow? - **Realized Spread** — Is the market maker earning less than the quoted spread? → Key Takeaways: Liquidity Provision and Market Making
Trade during high liquidity periods:
Spreads are tightest when many participants are active - On Polymarket, this typically coincides with U.S. business hours - On Kalshi, spreads tighten during their most active trading hours - Major political or sporting events attract temporary liquidity → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Trade early in a market's lifecycle:
New markets often have temporarily wide spreads as market makers calibrate - However, early markets may also have less adverse selection (no one has private information yet) → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Trader profile:
Total available capital: $50,000 - Trading capital (60%): $30,000 - Reserve capital (25%): $12,500 - Emergency fund (15%): $7,500 - Risk tolerance: Moderate (half-Kelly, 4% individual cap, 70% max deployment) - Time horizon: 3 months (one "season" of active trading) → Case Study 1: Building a Diversified Prediction Market Portfolio
Trader types:
With probability $\alpha$, the next trader is **informed** and knows whether $E$ will occur. - With probability $1 - \alpha$, the next trader is **uninformed** and buys or sells with equal probability. → Chapter 29: Liquidity Provision and Market Making
True Arbitrage:
Mathematically guaranteed profit - No possible outcome results in a loss - Both legs can be executed simultaneously - Same underlying event with identical resolution criteria → Chapter 16: Arbitrage in Prediction Markets
Tuesday 14:32 UTC
The prediction market platform begins experiencing degraded API performance. Response times increase from 200ms to 3-5 seconds. → Case Study 2: Post-Mortem: When the Bot Went Wrong
Types of Arbitrage:
**Within-platform**: Prices on a single platform that violate no-arbitrage conditions (YES + NO < $1.00, or multi-outcome sum < $1.00). - **Cross-platform**: The same event priced differently on different platforms, allowing risk-free profit by taking opposite sides. - **Temporal**: Exploiting delay → Chapter 16: Arbitrage in Prediction Markets

U

Uniform Distribution
$X \sim \text{Uniform}(a, b)$ → Appendix A: Mathematical Foundations
Use a CLOB when:
You expect high trading volume - You want to minimize operator subsidy costs - Traders are sophisticated and will provide liquidity themselves - You need complex order types (limit orders, stop-loss, etc.) → Chapter 8: Automated Market Makers
Use a hybrid when:
You want an AMM as a backstop but prefer peer-to-peer trading when available - The market starts thin but may grow (begin with AMM, transition to CLOB) → Chapter 8: Automated Market Makers
Use an AMM when:
You expect thin trading volume - You need guaranteed liquidity from day one - You are running many markets simultaneously (like a platform with thousands of questions) - Speed of price discovery matters more than capital efficiency → Chapter 8: Automated Market Makers

V

Valid.
**II. {3, 4}**: 3 AND 4 = 011 AND 100 = 0. 3 OR 4 = 111 = 7. **Valid.** - **III. {1, 6}**: 1 AND 6 = 001 AND 110 = 0. 1 OR 6 = 111 = 7. **Valid.** - **IV. {1, 2, 3}**: 1 AND 3 = 001 AND 011 = 001 != 0. **Invalid** (overlapping). - **V. {5, 2}**: 5 AND 2 = 101 AND 010 = 0. 5 OR 2 = 111 = 7. **Valid.* → Chapter 35: Quiz
Vices that prediction markets may cultivate:
**Avarice**: The financial incentive structure may promote excessive focus on profit at the expense of other values. - **Callousness**: Regular trading on events involving human suffering may desensitize participants to that suffering. A trader who thinks of a war primarily in terms of their market → Chapter 39: Ethics of Prediction Markets
Virtues that prediction markets may cultivate:
**Intellectual humility**: Markets punish overconfidence. Traders who are well-calibrated — who assign appropriate uncertainty to their beliefs — tend to outperform. This incentivizes a genuinely valuable intellectual virtue. - **Epistemic rigor**: Successful trading requires careful analysis of evi → Chapter 39: Ethics of Prediction Markets
Volatile regime:
Higher standard deviation (approximately 0.020-0.030). - Higher volume. - Possible positive autocorrelation at lag 1 (suggesting information is being processed over multiple days). - Shorter, more fragmented episodes (interspersed with brief calm periods). - Higher kurtosis (extreme moves within the → Case Study 2: Detecting Market Regimes in Election Markets
Volume Features:
`article_count_1h`: Number of relevant articles in the past hour. - `article_count_24h`: Number of relevant articles in the past 24 hours. - `volume_ratio`: Ratio of recent volume to historical average. - `source_diversity`: Number of unique sources covering the topic. → Chapter 24: NLP and Sentiment Analysis

W

Weaknesses:
Not available to U.S. residents (officially) - Requires cryptocurrency (USDC on Polygon) to participate - Market creation is centralized — users cannot create their own markets - Resolution disputes can be contentious (relies on UMA oracle system) - Regulatory uncertainty remains → Chapter 5: The Modern Platform Landscape
Weather Markets:
Average spreads: 3-7 cents - Spreads narrow as the forecast date approaches (weather models converge) - Relatively low adverse selection (weather data is publicly available) - Spreads can be wide for rare events (hurricanes, extreme temperatures) → Chapter 10: Bid-Ask Spreads, Transaction Costs, and Fees
Web Archives (Wayback Machine):
Historical snapshots of prediction market pages - Useful for platforms that no longer exist or for data not in APIs - Limitation: Irregular snapshot frequency, requires HTML parsing → Case Study 2: Scraping Historical Data for Backtesting
WebSocket protocol specification (RFC 6455)
For platforms that offer WebSocket-based data feeds, understanding the protocol helps debug connection issues. https://tools.ietf.org/html/rfc6455 → Further Reading: Chapter 19
welfare metrics
what constitutes the good society. For example: maximize GDP per capita plus a health index minus a Gini coefficient penalty. 2. For any proposed policy, conditional prediction markets are opened: "If this policy is adopted, what will the welfare metric be in 5 years?" and "If this policy is *not* a → Chapter 31: Decision Markets and Futarchy
whale effects
a small number of very large traders disproportionately moving the price. → Chapter 1 — What Are Prediction Markets?
What happened:
**Spread exploded**: From $0.01 to $0.04 (9:10 PM) - **Ask side thinned dramatically**: From 1,600 contracts to 830. Sellers pulled their orders as they reassessed. - **Bid side shifted up**: New bids at $0.57 and $0.58 appeared. The old best bid ($0.55) is no longer the best. - **Midpoint jumped**: → Case Study 1: Order Book Analysis of a High-Profile Polymarket Event
What markets got right:
By late January 2020, Metaculus community forecasts assigned a 60–70% probability that COVID-19 would cause more than 100 deaths outside China. The median expert estimate at the time was considerably lower. - Good Judgment superforecasters, drawing on analogies to SARS and MERS but noting critical d → Case Study 2: COVID-19 Pandemic Prediction Markets — Real-Time Tracking Performance
What markets got wrong:
Almost all forecasters — market participants included — underestimated the eventual scale of the pandemic. In February 2020, the median Metaculus forecast for US deaths by year-end was approximately 15,000–30,000. The actual figure exceeded 340,000. - Markets were slow to price in the possibility of → Case Study 2: COVID-19 Pandemic Prediction Markets — Real-Time Tracking Performance
What paper trading does not validate:
Market impact (your orders are not hitting the real book) - Fill probability (real fills depend on queue position and order flow) - Psychological responses (no real money at risk) - Latency effects (simulated fills are instantaneous) → Chapter 19: Live Trading, Execution, and Operational Discipline
What paper trading validates:
Data pipeline correctness - Signal generation logic - Risk check behavior - Order management lifecycle - System stability over time → Chapter 19: Live Trading, Execution, and Operational Discipline
What they do well:
**Standardized resolution sources:** Most markets reference specific, named data sources (BLS reports, official election results, etc.) - **Clear resolution criteria:** Resolution criteria are written in the market description with explicit conditions - **Edge case handling:** Markets typically addr → Chapter 28: Principles of Prediction Market Design
What works:
**Rapid market creation:** Anyone can create a market on any topic - **Diverse topics:** Markets cover everything from geopolitics to personal bets - **Social features:** Comments, reactions, and sharing increase engagement - **Play money:** Lower stakes encourage experimentation → Chapter 28: Principles of Prediction Market Design
When to use isotonic regression:
You have a large amount of calibration data (500+ forecasts). - The miscalibration pattern is complex or non-monotonic in probability space. - You want maximum flexibility in the recalibration function. → Chapter 12: Calibration — Measuring Forecast Quality
When to use Platt scaling:
You have a modest amount of calibration data (50-500 forecasts). - The miscalibration pattern is approximately monotonic and smooth. - You want a simple, interpretable recalibration function. → Chapter 12: Calibration — Measuring Forecast Quality
Why token price?
Continuously observable on-chain. - Hard to manipulate (would require buying/selling the actual token on DEXes). - Captures the market's assessment of the protocol's long-term value. - Aligns governance with token holder interests. → Case Study 2: Futarchy for DAO Governance
Widen spreads
The most direct response. Wider spreads reduce the market maker's loss per informed trade. 2. **Reduce order size** — Smaller quotes limit the amount an informed trader can extract. 3. **Shift fair value** — If trades consistently push the mid-price in one direction, the market maker should update i → Chapter 29: Liquidity Provision and Market Making
Winning trades (24):
Average edge captured: 7.2 cents per contract - Average profit per trade: 200 x $0.072 = $14.40 - Total winning profit: $345.60 → Case Study 2: Closing the Gap — Profiting from Stale Markets
With corrected positions (on $10,000 bankroll):
Buy $180 of Bracket 4 at 0.13 = 138 contracts - Buy $520 of Bracket 5 at 0.18 = 289 contracts - Buy $380 of Bracket 6 at 0.21 = 181 contracts - Total cost: $1,080 → Case Study 2: Scalar Market Trading: GDP Growth Brackets
world state
a mapping from addresses to account states. Every transaction modifies this world state, and the state root (a hash of the entire state) is stored in each block header. → Chapter 34: Blockchain Fundamentals for Prediction Markets

X

XGBoost:
`learning_rate`: shrinkage (0.01-0.3) - `max_depth`: tree depth (3-10) - `n_estimators`: boosting rounds (100-2000, with early stopping) - `subsample`: row sampling (0.5-1.0) - `colsample_bytree`: column sampling (0.5-1.0) - `min_child_weight`: minimum child weight (1-20) - `reg_alpha`, `reg_lambda` → Chapter 23: Machine Learning for Probability Estimation