Chapter 16: Exercises
Part A: Within-Platform Arbitrage (Exercises 1--6)
Exercise 1: Basic Binary Arbitrage Detection
A binary prediction market on "Will the US GDP growth exceed 3% in 2026 Q3?" has the following prices: - YES ask: $0.44 - NO ask: $0.52
(a) What is the total cost of buying one YES and one NO contract? (b) What is the gross arbitrage profit per pair? (c) If the platform charges a 2% fee on profits, calculate the net profit for each outcome (YES wins vs. NO wins). What is the guaranteed (worst-case) net profit? (d) What is the percentage return on the arbitrage?
Exercise 2: When Fees Kill the Opportunity
Consider a binary market with: - YES ask: $0.47 - NO ask: $0.51
(a) Calculate the gross arbitrage profit. (b) If the platform charges a 5% fee on profits, calculate the net profit under each outcome. (c) Does a profitable arbitrage still exist after fees? Show your work. (d) What is the maximum fee rate (on profits) at which this arbitrage remains profitable?
Exercise 3: Multi-Outcome Arbitrage Sizing
A 4-outcome market "Which company will have the highest market cap by year-end?" has these ask prices:
| Outcome | Ask Price |
|---|---|
| Apple | $0.35 |
| Microsoft | $0.28 |
| NVIDIA | $0.18 |
| Other | $0.12 |
(a) What is the total cost of buying all outcomes? (b) What is the gross arbitrage profit per complete set? (c) With a 2% settlement fee on profits, what is the worst-case net profit? (Hint: the worst case is when the cheapest outcome wins, because the winning profit is largest and thus the fee is largest.) (d) You have $5,000 available. How many complete sets can you buy, and what is your total guaranteed profit?
Exercise 4: Overround vs. Underround
A prediction market for "Who will win the 2028 Republican primary?" shows:
| Candidate | Ask Price |
|---|---|
| A | $0.38 |
| B | $0.27 |
| C | $0.18 |
| D | $0.12 |
| E | $0.06 |
| Field | $0.05 |
(a) What is the sum of all ask prices? Is this an overround or underround? (b) If the sum exceeds $1.00, can you construct a buyer's arbitrage? Why or why not? (c) If the platform allows selling (shorting) contracts, describe the arbitrage trade when the sum exceeds $1.00. (d) With a 2% fee on profits, is the seller's arbitrage still profitable?
Exercise 5: Order Book Depth Analysis
A binary market shows YES at $0.42 and NO at $0.54 (total $0.96), creating a 4-cent gross arbitrage. The order books are:
YES side: 200 contracts at $0.42, 500 contracts at $0.43, 1000 contracts at $0.45 NO side: 100 contracts at $0.54, 300 contracts at $0.55, 800 contracts at $0.56
(a) If you want to buy 200 pairs, what is your average cost per pair? Is the arbitrage still profitable at the average price? (b) What about 600 pairs? Calculate the average cost using the tiered order book. (c) What is the maximum number of pairs you can buy while maintaining a gross profit of at least $0.02 per pair? (d) Explain why checking order book depth is critical before executing an arbitrage.
Exercise 6: AMM-Based Arbitrage
A constant-product automated market maker (AMM) has pools for YES and NO tokens: - YES pool: 1000 tokens at $0.44 each - NO pool: 1000 tokens at $0.44 each - The AMM prices YES at $0.44 and NO at $0.56 based on current pool balances. - Buying tokens shifts the price upward.
Suppose you buy 50 YES tokens and the AMM reprices YES to $0.46 after your purchase, with your average fill at $0.45.
(a) Before your NO purchase, NO is repriced to $0.54. What is your total cost for 50 pairs if NO fills at an average of $0.545? (b) Is this still profitable? What is the net profit per pair? (c) Explain the concept of "slippage" in the context of AMMs and how it differs from order-book slippage. (d) What strategy would you use to minimize slippage on an AMM: one large order or multiple small orders? Why?
Part B: Cross-Platform Arbitrage (Exercises 7--12)
Exercise 7: Basic Cross-Platform Calculation
The event "Will the EU impose carbon tariffs by July 2026?" is listed on two platforms: - Platform A: YES at $0.58, NO at $0.44 - Platform B: YES at $0.50, NO at $0.52
(a) Identify the cheapest YES and cheapest NO across platforms. (b) What is the total cost of buying YES on B and NO on A? (c) Calculate the guaranteed gross profit. (d) Platform A charges a 2% settlement fee on profits, and Platform B charges a $0.03 per-contract trading fee. Calculate the net profit under each outcome.
Exercise 8: Three-Platform Scan
The event "Will SpaceX launch Starship successfully before April 2026?" is listed on three platforms:
| Platform | YES price | NO price | Settlement fee | Trading fee |
|---|---|---|---|---|
| Polymarket | $0.72 | $0.30 | 0% | 1% (taker) | |
| Kalshi | $0.68 | $0.35 | 0% | $0.03/contract | |
| PredictIt | $0.74 | $0.30 | 10% on profit | 0% |
(a) List all 6 possible cross-platform pairs (YES on one, NO on another). Calculate the gross profit for each. (b) For each pair with positive gross profit, calculate the fee-adjusted net profit. (c) Which pair offers the best net return? What is its percentage return? (d) PredictIt has an $850 position limit. How does this constrain the maximum profit from the best opportunity?
Exercise 9: Capital Requirements
You have identified a cross-platform arbitrage with: - Buy YES on Platform A at $0.55 (Platform A balance: $3,000) - Buy NO on Platform B at $0.40 (Platform B balance: $1,500) - Market resolves in 90 days
(a) What is the maximum number of pairs you can buy, given your capital on each platform? (b) What is the total capital deployed and the total guaranteed profit? (c) Calculate the ROI and the annualized return. (d) If your opportunity cost of capital is 6% per year, what is the lock-up cost? Is the arbitrage still worthwhile after accounting for opportunity cost?
Exercise 10: Resolution Risk Scenario
You enter a cross-platform arbitrage on "Will Candidate X win the election?": - Platform A: Buy YES at $0.60 - Platform B: Buy NO at $0.35 - Total cost: $0.95, expected profit: $0.05
After the election, Platform A declares YES as the winner, but Platform B's rules state the market resolves based on a different criterion, and Platform B declares the result as N/A (voiding the market and refunding $0.35).
(a) What is your actual net result? (Calculate payout from A minus total cost.) (b) Did you make a profit or a loss? (c) What is the key lesson about resolution criteria in cross-platform arbitrage? (d) How would you modify your pre-trade checklist to prevent this scenario?
Exercise 11: Currency and Withdrawal Costs
Platform A operates in USD and Platform B operates in USDC (a cryptocurrency stablecoin). You execute an arbitrage: - Buy YES on A at $0.55 (1000 contracts) = $550 deployed - Buy NO on B at $0.40 (1000 contracts) = $400 deployed (in USDC) - Gross profit: $50
After settlement, you need to withdraw profits from both platforms. Costs: - Platform A: $0 withdrawal fee (bank transfer) - Platform B: $12 gas fee to convert USDC back to USD
(a) What is your net profit after the gas fee? (b) Now suppose USDC depegs to $0.98 during the settlement period. Recalculate your profit assuming Platform B settles in USDC at face value. (c) What is the minimum gross arbitrage profit needed to justify the gas fee and currency risk? (d) Describe two strategies to mitigate cryptocurrency-related risks in cross-platform arbitrage.
Exercise 12: Simultaneous Execution Failure
You attempt to execute a cross-platform arbitrage with 500 pairs: - Leg A (YES on Platform A at $0.55): Fills 500 contracts successfully. - Leg B (NO on Platform B at $0.40): Only fills 200 contracts before the price moves to $0.44.
(a) You now have 500 YES contracts and 200 NO contracts. How many pairs are matched? How many YES contracts are unmatched? (b) For the 200 matched pairs, what is the guaranteed profit per pair (ignore fees)? (c) For the 300 unmatched YES contracts, what is your exposure? In what scenario do you lose money? (d) If you can sell the 300 unmatched YES contracts on Platform A at $0.53, what is your loss on those contracts? What is your overall profit or loss on the entire trade?
Part C: Programming Exercises (Exercises 13--20)
Exercise 13: Binary Arbitrage Calculator
Write a Python function binary_arb_check(yes_price, no_price, fee_rate) that:
- Takes the YES ask, NO ask, and a fee rate (as a decimal, e.g., 0.02 for 2%).
- Returns a dictionary with keys: "is_arb" (bool), "gross_profit", "net_profit", "return_pct".
- The net profit should be the worst-case (minimum) profit across both outcomes after fees.
- Test it on the following inputs: (0.42, 0.55, 0.02), (0.47, 0.51, 0.05), (0.38, 0.58, 0.01).
Exercise 14: Multi-Outcome Scanner
Write a Python function multi_outcome_arb(prices, fee_rate) that:
- Takes a list of ask prices for a multi-outcome market and a fee rate.
- Returns a dictionary with keys: "total_cost", "is_arb" (bool), "gross_profit", "worst_case_net", "return_pct".
- The worst case occurs when the most expensive outcome wins (highest price means smallest profit, so the fee takes a larger bite of the smaller net).
- Test it on: [0.35, 0.25, 0.15, 0.10, 0.05, 0.05] with fee rates of 0%, 2%, and 5%.
Exercise 15: Cross-Platform Arbitrage Finder
Write a Python function find_cross_platform_arb(listings) where listings is a list of dictionaries, each with keys "platform", "yes_price", "no_price", "settlement_fee", "trading_fee". The function should:
- Check all pairs of platforms for arbitrage (buy YES on one, NO on the other).
- Return a list of opportunities sorted by net return percentage.
- Each opportunity should include: platforms involved, prices, total cost, net profit, return percentage.
Test with three platforms: - Polymarket: YES=0.62, NO=0.40, settlement_fee=0%, trading_fee=1% - Kalshi: YES=0.55, NO=0.47, settlement_fee=0%, trading_fee=3 cents - PredictIt: YES=0.58, NO=0.44, settlement_fee=10%, trading_fee=0%
Exercise 16: Annualized Return Calculator
Write a Python function annualized_return(profit_per_pair, cost_per_pair, days_to_settlement) that:
- Computes the simple ROI.
- Computes the annualized return using: $R_{annual} = (1 + ROI)^{365/T} - 1$.
- Returns both values.
Then write a comparison function that takes a list of arbitrage opportunities (each with profit, cost, and days) and ranks them by annualized return. Demonstrate that a 2% profit settling in 7 days is better than a 5% profit settling in 180 days.
Exercise 17: Order Book Simulator
Write a Python class OrderBookSimulator with:
- A constructor that takes a list of (price, quantity) tuples representing the order book.
- A method fill(target_qty, max_price) that walks the book, filling at each price level, and returns (filled_qty, avg_price, total_cost).
- A method slippage(target_qty) that returns the difference between the best price and the average fill price.
Test with this order book: [(0.42, 200), (0.43, 300), (0.44, 500), (0.45, 1000)] for target quantities of 100, 500, and 1500.
Exercise 18: Monte Carlo Execution Simulator
Write a function simulate_arb_execution(book_a, book_b, target_qty, price_volatility, num_sims) that:
- Simulates filling Leg A from book_a.
- Adds a random price shift drawn from N(0, price_volatility) to each level of book_b to simulate latency.
- Fills Leg B from the shifted book.
- Computes the profit or loss for each simulation.
- Returns: average profit, probability of profit, worst-case loss, and a histogram of outcomes (as a list of profit values).
Run 10,000 simulations with price_volatility = 0.005, 0.01, and 0.02. How does volatility affect the probability of profit?
Exercise 19: Related-Market Constraint Checker
Write a Python module with four functions:
- check_subset(subset_price, superset_price, fee_rate) -- returns True if the constraint P(subset) <= P(superset) is violated and the violation is profitable after fees.
- check_sequential(prerequisite_price, dependent_price, fee_rate) -- checks P(dependent) <= P(prerequisite).
- check_complement(prices, fee_rate) -- checks if mutually exclusive and exhaustive outcomes sum to 1.0.
- check_conditional(joint_price, marginal_a_price, marginal_b_price, fee_rate) -- checks P(A and B) <= min(P(A), P(B)).
Each function should return a dictionary with "violation" (bool), "profit_per_pair", and "trade_description".
Test with: - Subset: P("Dems win Texas") = 0.25, P("Dems win any Southern state") = 0.22 - Sequential: P("X wins primary") = 0.40, P("X wins general") = 0.45 - Complement: [0.35, 0.25, 0.15, 0.10, 0.05, 0.05] (sum = 0.95) - Conditional: P("A and B") = 0.35, P(A) = 0.50, P(B) = 0.30
Exercise 20: Fee Structure Comparison Engine
Write a Python class FeeCalculator that models different platform fee structures:
- Percentage trading fee (on purchase price)
- Per-contract fixed fee
- Settlement fee (percentage of profit)
- Withdrawal fee (percentage of withdrawal amount)
The class should have a method total_cost(price, quantity, profit_per_contract) that returns the all-in cost including all fees.
Then write a function compare_platforms(platforms, price, quantity) that, given the same trade parameters, shows the effective cost on each platform and ranks them.
Test with Polymarket (1% trading fee), Kalshi ($0.03 per contract), and PredictIt (10% settlement fee + 5% withdrawal fee) for buying 500 contracts at $0.55.
Part D: Temporal and Statistical Arbitrage (Exercises 21--26)
Exercise 21: Information Speed Advantage
A prediction market for "Will the central bank cut rates?" is at $0.40. Breaking news at 2:00 PM strongly suggests a cut. You estimate the true probability is now 0.70. The market takes 15 minutes on average to fully incorporate the news, moving linearly from $0.40 to $0.70.
(a) If you buy at 2:01 PM (1 minute in), what price do you expect to pay? (b) If the market reaches its new equilibrium at 2:15 PM, what is your expected profit per contract? (c) If the trading fee is 1% and you buy 200 contracts, what is your total expected profit after fees? (d) What risk are you taking? (This is quasi-arbitrage, not true arbitrage -- explain why.)
Exercise 22: Stale Price Detection
You monitor a market on two platforms every 5 minutes. Over the last hour, you observe:
| Time | Platform A YES | Platform B YES |
|---|---|---|
| 13:00 | 0.50 | 0.50 |
| 13:05 | 0.52 | 0.50 |
| 13:10 | 0.55 | 0.51 |
| 13:15 | 0.58 | 0.51 |
| 13:20 | 0.60 | 0.52 |
| 13:25 | 0.62 | 0.52 |
(a) Platform B appears to be lagging. Calculate the price gap at each time step. (b) If Platform B eventually catches up to Platform A, what is the expected profit from buying YES on Platform B at 13:25? (c) This is temporal arbitrage, not true arbitrage. What could go wrong? (d) At what gap size would you consider the opportunity worth trading, given a 2% round-trip transaction cost?
Exercise 23: Mean Reversion Analysis
You have the following price history for a market (20 observations of YES price):
0.50, 0.52, 0.48, 0.51, 0.53, 0.49, 0.47, 0.50, 0.52, 0.54,
0.51, 0.49, 0.48, 0.50, 0.53, 0.55, 0.52, 0.50, 0.48, 0.42
(a) Calculate the mean and standard deviation of the series. (b) The current price (0.42) is the last observation. How many standard deviations below the mean is it? (c) If you believe in mean reversion and the price will return to the mean, what is your expected profit from buying at $0.42? (d) What are two reasons mean reversion might fail in this case?
Exercise 24: Pairs Trading Signal
Two correlated markets (A and B) have the following recent price pairs:
(0.50, 0.48), (0.52, 0.50), (0.55, 0.52), (0.53, 0.51),
(0.56, 0.53), (0.54, 0.52), (0.58, 0.55), (0.60, 0.53)
(a) Calculate the spread (A - B) for each pair. (b) Calculate the mean and standard deviation of the spread. (c) Calculate the z-score of the current spread (the last observation). (d) If your entry threshold is z > 2.0 or z < -2.0, should you enter a trade? If so, which direction? (e) Describe the exact trade (what to buy, what to sell) and the scenario under which it profits.
Exercise 25: Half-Life Estimation
Given the spread series from Exercise 24: [0.02, 0.02, 0.03, 0.02, 0.03, 0.02, 0.03, 0.07]:
(a) Fit an AR(1) model to the spread: $s_t = \alpha + \beta \cdot s_{t-1} + \epsilon$. Estimate $\beta$ using least squares (or by hand: $\beta = \text{Cov}(s_t, s_{t-1}) / \text{Var}(s_{t-1})$). (b) Calculate the half-life of mean reversion: $h = -\ln(2) / \ln(\beta)$. (c) Interpret the half-life. If it is very large (or infinite), what does that say about trading the spread? (d) Why is the half-life important for position sizing and trade duration?
Exercise 26: Backtest a Temporal Strategy
You have 100 daily price observations for a prediction market. The price starts at 0.50, drifts upward to 0.65 over 100 days with daily noise of standard deviation 0.02. Design a simple mean-reversion strategy:
- Compute a 20-day rolling mean and rolling standard deviation.
- Buy when the price drops more than 1.5 standard deviations below the rolling mean.
- Sell when the price returns to the rolling mean.
- Assume a 1% round-trip transaction cost.
(a) Describe in pseudocode how you would implement this backtest. (b) Why might this strategy perform poorly on a market with a trending price? (c) How would you adapt the strategy to account for the upward drift? (d) What is the key difference between backtesting a mean-reversion strategy on prediction market prices vs. stock prices?
Part E: Risk Assessment and Strategy (Exercises 27--30)
Exercise 27: Comprehensive Risk Assessment
You have identified the following cross-platform arbitrage: - Event: "Will Company X IPO in 2026?" - Platform A (Polymarket): Buy YES at $0.45 - Platform B (Kalshi): Buy NO at $0.50 - Gross profit: $0.05 per pair - Settlement date: December 31, 2026 (318 days away) - Capital required: $9,500 per 100 pairs ($4,500 on A, $5,000 on B)
Fill in this risk assessment table:
| Risk Factor | Severity (1--5) | Likelihood (1--5) | Mitigation | Accept? |
|---|---|---|---|---|
| Platform A insolvency | ||||
| Platform B insolvency | ||||
| Resolution ambiguity | ||||
| Execution slippage | ||||
| Capital lock-up cost | ||||
| Regulatory change |
(a) Assign severity and likelihood scores to each risk. (b) Which risks can be mitigated and which are inherent? (c) Calculate the annualized return. Is it worth the risk? (d) What is the maximum position size you would take, and why?
Exercise 28: Opportunity Cost Framework
You have $20,000 to deploy across prediction markets. You face three opportunities:
| Opportunity | Type | Profit per pair | Cost per pair | Days to settle | Max pairs |
|---|---|---|---|---|---|
| A | Cross-platform arb | $0.04 | $0.96 | 14 | 2,000 | |
| B | Cross-platform arb | $0.06 | $0.94 | 180 | 500 | |
| C | Within-platform arb | $0.03 | $0.97 | 30 | 5,000 |
(a) Calculate the ROI and annualized return for each. (b) What is the maximum capital each opportunity can absorb? (c) Construct an optimal capital allocation across the three opportunities given your $20,000 budget. Justify your allocation. (d) If Opportunity A is available once per week (same parameters), how does that change your strategy?
Exercise 29: Tax Impact Analysis
You execute 50 arbitrage trades over the course of a year: - Total gross profit: $4,200 - Total fees paid: $380 - Net profit before tax: $3,820 - Short-term capital gains tax rate: 37% - State tax rate: 8%
(a) Calculate your total tax liability (federal + state). (b) What is your after-tax profit? (c) What is your after-tax return if your average capital deployed was $25,000? (d) A tax advisor suggests structuring trades through an LLC taxed as an S-corp. If this reduces your effective tax rate to 30% (combined), what is the incremental after-tax profit? At what profit level does the cost of the LLC ($2,000/year) become worthwhile?
Exercise 30: Building Your Arbitrage Playbook
Synthesize the material from this chapter into a personal arbitrage playbook:
(a) Write a step-by-step checklist (at least 10 items) for evaluating any potential arbitrage opportunity, from discovery through execution to settlement. (b) Define your personal risk parameters: maximum position size per trade, maximum exposure per platform, minimum acceptable return, maximum acceptable time to settlement. (c) Design a simple logging format for tracking arbitrage trades (columns/fields that you would record for each trade). (d) Identify three specific prediction market events currently active that you could monitor for cross-platform price discrepancies. For each, note the platforms, the event, and the resolution criteria. (e) Describe the infrastructure (hardware, software, accounts) you would need to systematically pursue prediction market arbitrage.