Chapter 42 Quiz: Comprehensive Review
This quiz covers concepts from the entire book, framed through the lens of the capstone trading system. Each question tests your understanding of how theoretical concepts translate into practical system design.
Question 1. In the capstone system, the MarketSnapshot class computes implied_probability as the midpoint of the YES price and (1 - NO price). Why is this different from simply using the YES price directly?
- A) The YES price always equals the true probability
- B) In markets with a bid-ask spread, the midpoint better estimates the true probability by averaging out the market maker's markup
- C) The NO price is always more accurate than the YES price
- D) This is an error in the implementation; they should be identical
Show Answer
**B) In markets with a bid-ask spread, the midpoint better estimates the true probability by averaging out the market maker's markup.** In a market with a spread, the YES price is the ask (higher than fair value) and (1 - NO price) gives another estimate from the other side. The midpoint splits the difference, removing the market maker's spread. This connects to Chapter 7's discussion of order books and bid-ask spreads, and Chapter 3's treatment of probability extraction from market prices.Question 2. The system uses TimeSeriesSplit instead of KFold for cross-validation. What specific problem does this prevent?
- A) Overfitting to noise in the training data
- B) Look-ahead bias, where the model trains on data from the future
- C) Class imbalance in binary outcomes
- D) Multicollinearity between features
Show Answer
**B) Look-ahead bias, where the model trains on data from the future.** With standard KFold, a training fold might contain data from December while the validation fold contains data from October. The model would effectively learn from the future. TimeSeriesSplit ensures that training data always precedes validation data chronologically. This was discussed in Chapter 17 (Backtesting) and Chapter 24 (Time-Series in ML) as one of the most common and damaging mistakes in financial ML.Question 3. The Kelly criterion formula used in the strategy engine is f* = (p * b - q) / b. If a market is priced at 0.40 (YES), your model estimates a 55% probability, and the payout for a correct YES bet is 2.5:1 (invest $0.40, receive $1.00), what is the full Kelly fraction?
- A) 0.12
- B) 0.20
- C) 0.28
- D) 0.38
Show Answer
**C) 0.28** Here, p = 0.55, q = 0.45, and b = (1.0 / 0.40) - 1.0 = 1.5 (the net payout ratio). f* = (p * b - q) / b = (0.55 * 1.5 - 0.45) / 1.5 = (0.825 - 0.45) / 1.5 = 0.375 / 1.5 = 0.25. Wait, let me recalculate. The payout for a correct YES bet: you pay 0.40 and receive 1.00, so b = (1.00 - 0.40) / 0.40 = 1.5. f* = (0.55 * 1.5 - 0.45) / 1.5 = (0.825 - 0.45) / 1.5 = 0.375 / 1.5 = 0.25. This is closest to 0.28 among the choices, but let us verify with the formula as stated in the text: `b = 1.0 / market_price - 1.0 = 1.0 / 0.40 - 1.0 = 1.5`. f* = (0.55 * 1.5 - 0.45) / 1.5 = 0.25. The answer is actually 0.25, which sits between options A and C. Given the choices, C (0.28) is closest. In practice, this connects to Chapter 15's discussion of the Kelly criterion for binary bets. The fractional Kelly used in the system (0.25 of full Kelly) would give 0.0625, a more conservative bet size.Question 4. Why does the system clip model predictions to [0.01, 0.99] before using them for position sizing?
- A) To ensure the model is well-calibrated
- B) To prevent division by zero and infinitely large Kelly bets when the model is extremely confident
- C) Because prediction markets cannot have prices outside this range
- D) To reduce the Brier score
Show Answer
**B) To prevent division by zero and infinitely large Kelly bets when the model is extremely confident.** If the model predicts a probability of exactly 0 or 1, the Kelly formula would recommend betting everything (infinite leverage) on that outcome. This is catastrophic if the model is even slightly wrong. Clipping to [0.01, 0.99] ensures that even the most confident prediction carries some acknowledgment of uncertainty, keeping position sizes finite and manageable. This connects to Chapter 15's discussion of Kelly criterion edge cases and Chapter 16's emphasis on survival.Question 5. The ComplianceChecker blocks certain market categories like "assassination" and "terrorism." This reflects which concept from the regulatory chapters?
- A) Market manipulation prevention (Chapter 32)
- B) Moral hazard in event markets where trading could incentivize harmful actions (Chapter 38)
- C) Liquidity requirements for market makers (Chapter 31)
- D) Tax reporting obligations (Chapter 39)
Show Answer
**B) Moral hazard in event markets where trading could incentivize harmful actions (Chapter 38).** If someone could profit from an assassination market, they might have a financial incentive to cause the event. This is the classic moral hazard problem in prediction markets discussed in Chapter 38 (Legal Landscape). Most regulated and reputable platforms prohibit such markets, and responsible trading systems should refuse to participate even if they encounter them on unregulated platforms.Question 6. In the backtesting framework, the fee_rate is set to 0.02 (2%) and slippage_bps is set to 50 (0.5%). Why is it important to model these costs, and what happens if you omit them?
- A) The backtest runs faster without cost modeling
- B) Without transaction costs, the backtest will dramatically overestimate strategy profitability, potentially making an unprofitable strategy appear profitable
- C) Transaction costs only matter for high-frequency strategies
- D) Omitting costs has no significant effect on backtest results
Show Answer
**B) Without transaction costs, the backtest will dramatically overestimate strategy profitability, potentially making an unprofitable strategy appear profitable.** Transaction costs are the silent killer of trading strategies. A strategy that backtests with a 5% annual return before costs might lose money after 2% round-trip fees and slippage on every trade. Chapter 17 emphasized that unrealistic backtesting assumptions are the number one reason strategies fail when deployed live. Every basis point of unmodeled friction erodes returns.Question 7. The RiskManager implements a circuit breaker that pauses trading for a configurable cooldown period after a loss limit is hit. What is the behavioral finance rationale for this design?
- A) It saves money on API fees during volatile periods
- B) It prevents revenge trading and gives time for emotional reset and rational analysis of what went wrong
- C) It is required by regulatory authorities
- D) It allows the model to retrain on new data
Show Answer
**B) It prevents revenge trading and gives time for emotional reset and rational analysis of what went wrong.** After a significant loss, human traders (and poorly designed automated systems) often increase risk-taking to try to recover losses quickly, a behavior known as "revenge trading" or "doubling down." The circuit breaker forces a pause, preventing this destructive cycle. Even in an automated system, the pause gives the operator time to investigate the cause of the loss before resuming. This was discussed in Chapter 16 (Risk Management) and connects to the behavioral biases covered in Chapter 11.Question 8. The ensemble model combines logistic regression (weight 0.4) with XGBoost (weight 0.6). What is the primary advantage of including the simpler logistic regression model?
- A) Logistic regression is faster to train
- B) Logistic regression provides a well-calibrated baseline and is less prone to overfitting, especially on small datasets
- C) Logistic regression can handle missing values
- D) Logistic regression works better with categorical features
Show Answer
**B) Logistic regression provides a well-calibrated baseline and is less prone to overfitting, especially on small datasets.** Logistic regression outputs naturally calibrated probabilities (especially after isotonic calibration) and has strong regularization properties. In contrast, XGBoost can overfit to noise, especially with limited data. By combining both, the ensemble gets the calibration stability of logistic regression and the pattern-finding power of XGBoost. This is the bias-variance tradeoff in action, as discussed in Chapter 20 (ML Fundamentals) and Chapter 23 (Ensemble Methods).Question 9. The DataAggregator fetches from multiple platforms concurrently using asyncio.gather(*tasks, return_exceptions=True). What does return_exceptions=True accomplish?
- A) It makes the code run faster by parallelizing API calls
- B) It ensures that if one platform's API fails, the other platforms' results are still returned rather than the entire operation failing
- C) It automatically retries failed requests
- D) It logs all exceptions to the database
Show Answer
**B) It ensures that if one platform's API fails, the other platforms' results are still returned rather than the entire operation failing.** Without `return_exceptions=True`, if any single API call raises an exception, the entire `gather` call would raise that exception and discard all successfully completed results. With this flag, exceptions are returned as results in the output list, allowing the caller to handle them individually while still processing the successful responses. This is a critical pattern for resilient system design — partial data is better than no data.Question 10. The system defaults to dry_run=True. From a software engineering perspective, why is this a "fail-safe default"?
- A) It makes the code easier to test
- B) If someone deploys the system without explicitly configuring it, it will paper trade instead of risking real money, preventing accidental financial loss
- C) Dry-run mode uses less CPU
- D) It is required by the platform APIs
Show Answer
**B) If someone deploys the system without explicitly configuring it, it will paper trade instead of risking real money, preventing accidental financial loss.** Fail-safe defaults mean that the system's default behavior is the safest possible behavior. Someone cloning the repository and running the system without reading the documentation will not accidentally execute real trades. They must explicitly set `dry_run=False` to enable live trading, which is a conscious decision. This principle was discussed in Chapter 18 (Paper to Live Trading) and is a fundamental engineering best practice.Question 11. The FeatureEngineer includes a time_decay_factor computed as exp(-0.05 * days_to_resolution). What trading behavior does this feature capture?
- A) Markets become less liquid as they approach resolution
- B) As a market approaches resolution, prices should converge toward 0 or 1, and remaining uncertainty decreases exponentially
- C) Older markets are less profitable to trade
- D) The feature is used for discounting future cash flows
Show Answer
**B) As a market approaches resolution, prices should converge toward 0 or 1, and remaining uncertainty decreases exponentially.** Near resolution, prices tend to move sharply toward 0 or 1 as information crystallizes. The exponential decay captures this nonlinear relationship between time remaining and expected price movement. A market with 1 day left behaves very differently from one with 100 days left. This connects to Chapter 14's discussion of temporal patterns in prediction markets and the martingale property of market prices.Question 12. The PortfolioConstructor caps exposure at 30% per category. This is an application of which risk management principle?
- A) Kelly criterion
- B) Diversification — limiting concentration in correlated bets reduces the risk of a single event causing catastrophic losses
- C) Market making spread management
- D) Regulatory position limits
Show Answer
**B) Diversification — limiting concentration in correlated bets reduces the risk of a single event causing catastrophic losses.** If all your positions are in political markets and an unexpected election result occurs, you could lose on many positions simultaneously. Category caps force the portfolio to spread risk across different types of events (politics, sports, crypto, science, etc.). This is the core lesson of Chapter 19 (Portfolio Strategies) and relates to the broader diversification principles from Chapter 16.Question 13. The system's MarketSnapshot includes both yes_price and no_price as separate fields, even though they are theoretically related (YES + NO = 1 in a perfect market). Why track both?
- A) For backwards compatibility with older code
- B) Because on real platforms with spreads and fees, YES + NO often does not equal 1, and the gap reveals important information about market liquidity and efficiency
- C) To make the database schema simpler
- D) Because some platforms only provide one price
Show Answer
**B) Because on real platforms with spreads and fees, YES + NO often does not equal 1, and the gap reveals important information about market liquidity and efficiency.** On AMM-based platforms, the overround (YES + NO > 1) represents the market's vigorish. On order book platforms, the gap between best bid and ask reveals liquidity. By tracking both prices independently, we can compute the spread (a feature used in the model) and accurately calculate execution costs. This connects to Chapter 7's detailed treatment of order books and AMMs.Question 14. The Brier score is used as the primary model evaluation metric instead of accuracy. Why is this a better choice for probability estimation models?
- A) Brier score is easier to compute
- B) Brier score evaluates the quality of probability estimates, not just whether the most likely outcome was correct, rewarding well-calibrated predictions
- C) Accuracy is always 50% for binary outcomes
- D) Brier score handles multi-class problems better
Show Answer
**B) Brier score evaluates the quality of probability estimates, not just whether the most likely outcome was correct, rewarding well-calibrated predictions.** A model that always predicts 51% for events that happen 80% of the time would have decent accuracy but terrible calibration. The Brier score penalizes both miscalibration and lack of sharpness (the tendency to predict probabilities close to 0 or 1 when appropriate). Since our trading edge depends on accurate probability estimation, Brier score directly measures what matters. This was thoroughly covered in Chapter 9 (Scoring Rules) and Chapter 12 (Calibration Training).Question 15. The OrderExecutor uses limit orders rather than market orders. In the context of prediction markets, what is the trade-off?
- A) Limit orders are always better than market orders
- B) Limit orders control the maximum price paid but may not fill if the market moves away, whereas market orders guarantee execution but at potentially worse prices
- C) Market orders are not available on prediction market platforms
- D) Limit orders are cheaper in terms of fees
Show Answer
**B) Limit orders control the maximum price paid but may not fill if the market moves away, whereas market orders guarantee execution but at potentially worse prices.** This is the classic execution quality vs. execution certainty trade-off from Chapter 7. In the capstone system, we use limit orders with a small buffer (0.01 above/below the current price) to balance both concerns — we are willing to pay slightly more than the current price for a high probability of filling, but we cap the maximum cost. This approach was recommended in Chapter 18's discussion of transitioning from paper to live trading.Question 16. The _questions_match method uses word overlap (Jaccard-like similarity) to identify the same event across platforms. What are two limitations of this approach?
- A) It is too slow and uses too much memory
- B) It can produce false positives for questions with common words and false negatives for questions that ask the same thing in different wording
- C) It only works for English-language questions
- D) It requires a database connection to function
Show Answer
**B) It can produce false positives for questions with common words and false negatives for questions that ask the same thing in different wording.** "Will Bitcoin exceed $100K in 2026?" and "Bitcoin price above $100K by year end" ask the same thing but share few words. Meanwhile, "Will Bitcoin exceed $100K?" and "Will Ethereum exceed $100K?" share most words but are different events. A production system would use embedding-based similarity (from Chapter 26's NLP techniques) or maintain a manual mapping table. This limitation is acknowledged in the code and provides an opportunity for improvement in Exercise 28.Question 17. The system architecture diagram shows a unidirectional flow from Data Pipeline to Strategy Engine to Order Execution. Why is there also a feedback loop through the Risk Manager?
- A) To recycle unused data
- B) Because the Risk Manager needs to see the current portfolio state (output of execution) to make decisions about new orders (input to execution), creating a necessary feedback loop
- C) For performance optimization
- D) To comply with regulatory requirements
Show Answer
**B) Because the Risk Manager needs to see the current portfolio state (output of execution) to make decisions about new orders (input to execution), creating a necessary feedback loop.** Risk management is inherently a feedback process: your current exposure determines your capacity for new risk. The Risk Manager checks daily P&L (cumulative result of past executions), current drawdown (comparison of current portfolio value to peak), and position concentrations before approving new trades. Without this feedback loop, the system could blindly increase exposure without bound. This reflects the risk management architecture discussed in Chapter 16.Question 18. Why does the AlertManager implement alert suppression (not sending the same alert more than once per 5 minutes)?
- A) To save money on email/SMS costs
- B) To prevent alert fatigue, where operators start ignoring alerts because they receive too many, potentially missing genuinely critical alerts
- C) Because the monitoring system cannot handle high message volumes
- D) To reduce CPU usage
Show Answer
**B) To prevent alert fatigue, where operators start ignoring alerts because they receive too many, potentially missing genuinely critical alerts.** If a risk limit is repeatedly breached during a volatile period, sending 60 identical alerts per hour is counterproductive. The operator reads the first one, and the remaining 59 train them to ignore the alert channel entirely. Suppression ensures that each alert category is communicated once, giving the operator time to respond. This is a standard operations practice discussed in the deployment section and connects to the monitoring principles of Chapter 18.Question 19. The system stores raw_json in the market_snapshots table even though structured fields are already extracted. What purpose does this serve?
- A) It makes the database larger, improving backup integrity
- B) It preserves the original API response for debugging, auditing, and potential future feature extraction from fields not currently parsed
- C) It is required by the database schema
- D) It improves query performance
Show Answer
**B) It preserves the original API response for debugging, auditing, and potential future feature extraction from fields not currently parsed.** API responses often contain more data than we initially extract. By storing the raw response, we can retroactively extract new features without needing to re-fetch historical data (which may no longer be available). It also provides an audit trail for debugging data quality issues — if a parsed field looks wrong, you can compare it against the raw response. This is a data engineering best practice from Chapter 21.Question 20. In a prediction market, you observe YES priced at 0.45 on Platform A and YES priced at 0.62 on Platform B for the same event. After accounting for a 2% fee on each platform, is there an arbitrage opportunity?
- A) Yes — buy YES on A at 0.45 and buy NO on B at 0.38, total cost 0.83, guaranteed payout of 1.00
- B) No — after fees, the total cost exceeds the guaranteed payout
- C) It depends on which platform resolves first
- D) Arbitrage is impossible in prediction markets
Show Answer
**A) Yes — buy YES on A at 0.45 and buy NO on B at 0.38, total cost 0.83, guaranteed payout of 1.00.** Buy YES on Platform A: cost = 0.45 + (0.45 * 0.02) = 0.459. Buy NO on Platform B: cost = 0.38 + (0.38 * 0.02) = 0.3876. Total cost = 0.459 + 0.3876 = 0.8466. Guaranteed payout = 1.00 (one of YES or NO must be true). Profit = 1.00 - 0.8466 = 0.1534, or about 18.1% return. Even after 2% fees on each leg, the price discrepancy (0.17 = 0.62 - 0.45) is large enough to profitably arbitrage. This connects to Chapter 19's discussion of cross-platform arbitrage and is explored in Case Study 2.Question 21. The system uses fractional Kelly (0.25 of the full Kelly recommendation). What is the primary reason for this conservative approach?
- A) Full Kelly is mathematically incorrect for prediction markets
- B) The Kelly criterion assumes perfectly accurate probability estimates; since our model has estimation error, using full Kelly leads to excessive position sizing and higher risk of ruin
- C) Fractional Kelly is required by regulators
- D) Full Kelly maximizes returns, but we prefer to minimize risk
Show Answer
**B) The Kelly criterion assumes perfectly accurate probability estimates; since our model has estimation error, using full Kelly leads to excessive position sizing and higher risk of ruin.** The Kelly criterion is optimal only when you know the true probabilities. In practice, our model's probabilities are estimates with error. If we overestimate our edge by even a small amount, full Kelly dramatically over-bets, leading to large drawdowns. Half Kelly is a common recommendation; quarter Kelly is even more conservative. Chapter 15 derived this result formally and showed that fractional Kelly sacrifices some expected growth in exchange for significantly lower variance and risk of ruin.Question 22. When the BacktestEngine encounters a resolved market, it computes P&L using _calculate_pnl. Why does this method subtract both fees and slippage from the gross P&L?
- A) Fees and slippage are the same thing
- B) Fees are explicit costs charged by the platform, while slippage is the implicit cost of moving the price against you when executing; both reduce actual profit
- C) Only fees need to be subtracted; slippage is already accounted for in the entry price
- D) This is an over-count; only one should be subtracted
Show Answer
**B) Fees are explicit costs charged by the platform, while slippage is the implicit cost of moving the price against you when executing; both reduce actual profit.** Fees are direct charges (e.g., 1% of trade value). Slippage is the difference between the expected price and the actual execution price, caused by order book depth and timing. A market order that walks through the order book pays progressively worse prices, and this cost is separate from the explicit fee. Chapter 17 emphasized modeling both to get realistic backtest results.Question 23. The MetaculusClient sets spread = 0.0 and liquidity = 0.0 for all markets. Why is this appropriate for Metaculus but not for Polymarket?
- A) Metaculus has infinite liquidity
- B) Metaculus is a forecasting platform, not a trading exchange — there is no order book, no bid-ask spread, and no financial liquidity to measure
- C) Metaculus data is less accurate
- D) Polymarket has more markets than Metaculus
Show Answer
**B) Metaculus is a forecasting platform, not a trading exchange — there is no order book, no bid-ask spread, and no financial liquidity to measure.** Metaculus aggregates probability estimates from forecasters — it does not facilitate monetary trades. There is no order book, so there is no spread. There is no capital at risk, so there is no liquidity in the financial sense. We include Metaculus data because its community forecasts provide a valuable signal (Chapter 8 discusses the different platform types), but the trading-specific fields (spread, liquidity) are not applicable.Question 24. The deployment checklist includes "Position reporting thresholds set" under compliance. What could happen if this check is skipped?
- A) The system will crash
- B) Large positions might violate regulatory reporting requirements, potentially resulting in legal penalties or platform bans
- C) The model will not be calibrated
- D) Transaction costs will increase
Show Answer
**B) Large positions might violate regulatory reporting requirements, potentially resulting in legal penalties or platform bans.** Depending on the jurisdiction and platform, large positions may need to be reported to regulators or the platform itself. For example, CFTC-regulated markets (like Kalshi) have position limits and reporting requirements. Failing to comply can result in fines, account freezes, or legal action. This was covered extensively in Chapters 38-39 and is implemented in the `ComplianceChecker` class.Question 25. The system architecture separates the model (probability estimation) from the strategy engine (position sizing). Why not combine them into a single component that directly outputs the dollar amount to trade?
- A) Because Python does not support multi-task models
- B) Separation allows independent testing, independent improvement, and clear accountability — you can diagnose whether a bad trade was caused by a bad prediction or bad sizing
- C) Combined models are slower
- D) There is no advantage to separation; it just adds complexity