CHAPTER 10/ 45
Financial Markets
Thread: a trade moves through quotation, execution, clearing and settlement. Its economic return, rights, obligations and cash-flow dates depend on the instrument and contract. Prerequisite: timestamps and the data lifecycle in Chapter 1. By the end, you can trace who owes what in an equity, bond, FX or derivative trade, when assets move, and how notional exposure, margin and actual profit differ.
1. Learning objectives
Describe stocks, exchange-traded funds, bonds, FX, futures, options, swaps and repurchase agreements as checkable rights and obligations. Distinguish brokers, dealers, exchanges, central counterparties and custody/settlement institutions; arrange events by trade, clearing and settlement dates. With explicit units, calculate dividend-inclusive return, coupons, net swap payments, currency conversion, futures variation settlement, option profit at expiry and repo haircuts. Explain why short sales and margin arrangements can cause losses exceeding initial collateral.
This chapter establishes instrument terminology and cash-flow ledgers. Full bond valuation, option-pricing models and order-book execution are developed later, along with return construction, market microstructure and costs, stress risk and derivative pricing.
2. Why a quant needs market instruments
A numerical column often captures only one aspect of a contract. Equity price changes omit some dividends; fund-share prices differ from net asset value; futures index points become monetary profit only after applying a multiplier. An FX quote of “1.10” is uninterpretable without its direction, and trade dates can differ from cash-settlement dates.
These distinctions determine return denominators, information availability, loss settlement and the date assigned in a backtest. Treating futures notional exposure as invested principal gives the wrong return. Treating margin as maximum loss understates cash shortfalls before liquidation. Collapsing reporting endpoints, executions and settlement dates into one time makes a tidy ledger that may violate the contract.
Ask four questions first: what is traded, how is it quoted, what have the parties promised, and when do cash or securities transfer? Use them throughout the instruments below.
3. Intuition
Begin with three teaching ledgers, all constructed rather than historical. An investor buys 100 shares at USD 50 each; price later becomes USD 50.20 and the holder becomes entitled to USD 0.50 per share in dividends. A USD 1,000 fixed-coupon bond pays 6% annually in semiannual installments. For CME Micro E-mini S&P 500 futures (MES), the contract multiplier is USD 5 per index point.
Equity holding-period wealth includes terminal security value and entitled dividends. Bondholders receive contractual interest and usually principal at maturity. Futures settle price changes through contract multipliers rather than requiring full cash purchase of an index basket, while demanding performance collateral. Each may respond to “a rising market,” yet their cash flows differ.
Think of a contract as a promise with explicit units and dates. Units resemble quantities in a recipe; dates resemble an agreed collection time. Without either, a number has no operational meaning. The analogy is only a memory aid: actual rights come from product documents, applicable law and trading rules.
4. Mathematical foundations
State a currency for every amount: USD for dollars and EUR for euros. Prices per share use USD/share; futures multipliers use USD/index point with contract count specified. Multiplication by share or contract quantity produces USD. Returns are dimensionless ratios, usually stored as decimals: 5% is 0.05.
Let
“One contract” is not a universal unit. Products specify size, currency, quote precision, maturity and delivery method. Define
5. Definitions
Stock/equity represents a company’s residual ownership claim. Shareholders may receive cash dividends and voting rights, but dividends are not guaranteed fixed interest and equity usually ranks after creditors in liquidation. Ordinary-share rights, voting, distributions and corporate actions depend on issue documents and applicable law.
An exchange-traded fund (ETF) holds an asset basket or follows another documented fund strategy, with shares traded on a venue. Retail investors typically trade at intraday market prices. Net asset value (NAV) follows the fund’s valuation rules; market price may trade at a discount or premium to NAV. An ETF share does not grant every investor on-demand redemption of each underlying asset. This introductory treatment follows US Investor.gov education; individual product terms differ.
A bond is a debt instrument promising contractual interest, principal repayment at maturity or another specified payment structure. Face value
Foreign exchange (FX) exchanges one currency for another. Here
A futures contract is a derivative traded on a standardized venue and settled daily or at the specified frequency under its rules. The contract multiplier converts underlying quote movements into contract monetary profit. CME MES pays USD 5 per contract per index point; E-mini S&P 500 futures (ES) pays USD 50. A multiplier sets the profit scale, rather than contract value or margin itself. Positive signed quantity is long; negative is short, describing price exposure rather than ownership of index constituents. Periodic cash adjustment following futures-price changes is variation margin; contract rules govern its settlement.
An option gives its buyer a contractual exercise-or-abandon right and imposes the corresponding obligation on its seller. Strike price is
A swap exchanges a contractual set of future cash flows. Interest-rate swaps use a notional amount to calculate interest without necessarily exchanging that principal: one side may pay fixed and receive floating, with contractual net settlement. Directions, floating benchmarks, reset dates and payment netting are specified. Central or bilateral clearing arrangements differ; the word “swap” alone determines no collateral rule.
A repurchase agreement (repo) sells securities with an agreement to repurchase them, economically often providing secured financing. A haircut is the proportion of collateral market value not financed. Contracts and market conventions determine actual haircuts, valuation frequency, margin calls and default disposal.
Margin consists of cash or securities required for performance or financing. A securities margin loan is broker financing secured by account assets. Futures margin resembles a performance bond, rather than a down payment on full notional exposure. Initial margin is required to open a position; maintenance margin is the minimum supporting continued holding. Rules and risk conditions can change amounts. Collateral supports performance or credit exposure, can change value and may require top-ups. Initial margin neither prepays a maximum loss nor limits losses; losses can exceed the original collateral.
6. Derivations
Hold
Quantity
A fixed-coupon bond’s annual interest is face value times annual coupon rate,
For a simplified single-currency fixed-for-floating swap with no principal exchange, let
With
For futures, let
A rising price produces positive cash for a long and negative cash for a short. If each settlement change is paid, several periods’ nominal cash flows sum to
7. Financial interpretation
A cash-equity purchase pays the full execution value; profit comes from price movement, dividends and corporate actions. A short sale typically borrows securities through securities lending, sells them and later repurchases and returns them. Rising prices increase repurchase cost; borrowing fees, substitute dividend payments, recalls, margin and compulsory buy-ins also matter. This mechanism implies no uniform short-selling rule across markets.
Bondholders have contractual payment claims but face issuer default, interest-rate, inflation, liquidity, reinvestment and early-redemption risk. The term structure relates rates or yields across maturities. Duration measures local price sensitivity to a small yield change; convexity measures curvature. Modified duration
When
7.1 From cash flows to duration and convexity
Extend Chapter 4’s single-payment discounting to fixed cash flows. Payment
Differentiate each power term and sum:
Futures notional exposure is the price level times multiplier times contract count. A constructed MES contract near 5,000 points represents 5,000 index points × USD 5/index point = USD 25,000. This reference exposure is usually neither USD 25,000 paid at inception nor margin. Profit uses subsequent point changes. Exchanges, clearing members and brokers adjust margin for products, clients, volatility and rules. Shortfalls may cause calls, reductions or liquidation; extreme losses can exceed initial collateral.
A futures roll closes a nearby or expiring contract and opens a later maturity. Record both contracts, execution prices, quantities, multipliers, costs and times. The near/far spread is not automatically a separate booked loss. Attribution and empirical roll costs belong to later strategy and trading chapters.
Option rights and obligations are asymmetric. Buyers usually pay premium upfront; pre-expiry profit also depends on time, implied volatility, rates, dividends and exercise rules. Expiry payoff shows only terminal intrinsic value. For a simply fully paid long option without subsequent costs, maximum contract loss is usually premium paid. Sellers owe performance; a short call can incur very large losses. One expiry-payoff line is no substitute for full risk disclosure.
Swaps and repos specify dated payment obligations rather than forming one generic “leverage” category. Swaps may settle net payments; repos provide securities-backed financing with reverse repurchase. Product documents determine clearing, collateral and default terms. Central clearing changes counterparties and requires margin without removing economic losses.
8. Numerical Example
Equity total return. Construct
Bond coupon. USD 1,000 face value, 6% annual coupon and two payments per year give each coupon
Interest-rate swap. Construct an effective date of January 4, 2027 and first settlement on April 5, 2027, using year fraction
MES periodic settlement. The reviewed CME specification gives USD 5/index point. Construct settlements at 5,000, 5,020, 4,980 and 5,010. One long receives/pays
FX quote. With
Options and repo. Construct one call with 100 shares/contract, strike USD 100/share, premium USD 4/share and terminal stock USD 110/share. Long profit at expiry is
Separate the call example by time and state. Opening premium paid is
9. Python Implementation
Default entry in the reader edition
From the accepted I3 reader package root, prepare an independent environment following its environment instructions, then run:
.venv/bin/python run_notebook.py notebooks/ch10_markets.ipynb
The Notebook calls the packaged shared implementation using constructed contract cash flows throughout Chapter 10. The runner saves fresh-kernel execution records to a unique runs/execution_* directory; new figures use another UUID directory. The terminal prints actual locations. Omitted French data are not read by default or downloaded. The old production tests and CLI below refer to the working-course root; reader checks use the Notebook assertions above. Optional historical data follow the data contract and are not rerun in this revision.
Historical working-course root and original implementation
Core functions in src/quant_course/market_instruments.py state currencies and quote directions through names, parameters and docstrings. They reject NaN, infinities, missing and invalid inputs rather than disguising them as zero. They calculate equity total return, coupons, simplified swap net cash, FX conversion/reference forwards, futures variation settlement, option expiry profit and repo advances. code/ch10_markets.py provides the historical CLI and teaching figure; tests use pytest. These commands run from the working-course root:
.venv/bin/python code/ch10_markets.py --output-dir figures/a3
.venv/bin/python -m pytest tests/test_ch10_markets.py -q
The original notebooks/ch10_markets.ipynb is opened and run sequentially from the project root. Notebook and tests call shared package functions; the CLI generates the figure and demonstration output. There is no observed price series or random simulation, so no seed is specified. Inputs are constructed cash-flow events or settlement intervals. Outputs are amounts/returns, without tradable signals, signal times, trade times or return estimation.
Interfaces require the caller to establish holding-period dividend entitlement. FX is always quote currency per one base unit; futures changes are index points between consecutive settlements. Option premium and terminal underlying prices share currency and underlying units, with explicit multiplier. Repo haircut satisfies
10. Visualization

The script generated this cash-flow timeline. Its horizontal axis lists events from trade through T+1, illustrative dividend entitlement, T+3, and semiannual/annual bond nodes. Spacing is not proportional to days or a calendar. T+1 illustrates applicable US security settlement only; dividend and other-lane dates are constructed rather than synchronized market events. Vertical lanes classify equities, a USD 1,000 face-value bond and one MES; they are not amount scales. Arrow labels use USD; upward means receipt and downward means payment/deposit. A blue diamond separately marks dividend entitlement, not cash receipt.
The equity purchase settles at the constructed T+1 node; entitlement and later dividend payment are distinct. Bond coupons follow constructed semiannual dates. Futures settle signed periodic cash flows and illustrate return of assumed collateral on closure. Collateral transfers account funds rather than constituting a trading loss. Compare timing and cash-flow nature, not arrow heights or spacing across lanes.
11. Real Market Example
This chapter neither loads/downloads market prices nor treats constructed values as executions. Actual-rule examples concern US securities settlement and CME specifications. The SEC staff FAQ identifies May 28, 2024 as the compliance date. Rule 15c6-1 covers the specified security transactions executed by US-registered brokers/dealers, with listed instrument/arrangement exceptions and some expressly agreed extended settlement at execution. For a covered trade on Tuesday May 28, 2024, business-day T+1 is Wednesday May 29. This is no common calendar for all bonds, FX, futures, repos, cross-border securities or transactions.
DTCC descriptions of NSCC Continuous Net Settlement (CNS) and DTC securities/cash book-entry transfers illustrate US infrastructure rather than defining global clearing. Reviewed CME specifications state MES as USD 5 × S&P 500 index points and ES as USD 50 × points. Only multipliers are used, excluding changing margin quotes and notional valuations. See source_notes.md for pages and reading scope.
12. Common Mistakes
Calling price return equity total return. The 100-share example gives price-only return 0.4%, or 1.4% after USD 0.50/share dividend. Name the measure and verify holding-period entitlement.
Omitting FX quote direction. “1.10” alone converts nothing. USD/EUR=1.10 means USD 1.10 per EUR; the reverse EUR/USD is
Treating trade date as cash settlement. T+1 belongs to specific markets, instruments and rules. T is trade date; count subsequent days under the relevant business calendar. Economic exposure may begin at execution, while available cash or settled securities follow rules. Record them separately.
Drawing only option expiry payoff. It omits opening premium, pre-expiry market value, assignment risk and contract adjustments. A single upward/downward payoff curve cannot establish the risks of long and short options.
Treating a repo haircut as risk-free insurance. A haircut provides an initial difference between funding and collateral value. Price gaps, liquidity discounts, legal enforcement and counterparty risk can consume the buffer. One haircut value does not eliminate credit risk.
Calling a futures roll spread a realized loss. A roll closes the nearby position and opens a later contract. Different quotes change position reference prices but do not automatically equal realized cash loss. Outcomes depend on quantity, multipliers, close/open prices, costs, margin and underlying movements. Term-structure and roll-return attribution follow later.
13. Quant Research Application
Build a research prototype that checks units and timing first. Record instrument, contract code, quote currency/unit, multiplier, maturity, trade/settlement times and data availability. Store executions, terminal marks, dividends/coupons, variation settlement, fees and collateral changes separately. Do not force heterogeneous instruments into one return column.
For cash equities, identify adjusted-price conventions, dividend accrual/payment and tax basis. For futures, specify notional, margin-capital or NAV denominator and roll rules. For FX, state home/foreign direction and conversion date. Missing fields should fail checks or enter a defined quality queue, never default to zero. Strategies additionally require Chapter 3 information clocks, Chapters 29–30 execution delay/look-ahead checks, and Chapters 34–36 quotes, order books and costs. This ledger alone is no backtest evidence.
14. Chapter Summary
Financial instruments specify future rights and obligations, differing in underlying, units, funding, return sources and settlement. Stocks and bonds are cash securities; ETFs are fund shares. Futures, options and swaps are derivative contracts; repo provides secured financing; FX requires a quote direction. Brokerage, trading, clearing and settlement have distinct responsibilities.
Begin calculations with units and timing. State currencies, unit prices, quantities and multipliers, then distinguish cash entitlement from payment. Total return differs from price movement; notional differs from invested capital; margin differs from maximum loss; T+1 differs from a universal settlement rule.
15. Exercises
10-E01 (concepts). What may brokers, dealers and market makers do? Must they be three separate institutions?
10-E02 (concepts). Distinguish ETF intraday price, NAV and underlying securities. Why is buying an ETF share not the same as buying every underlying security individually?
10-E03 (concepts). In the US example, what do T, clearing and settlement mean? Why is T+1 no universal rule for all global securities and derivatives?
10-E04 (concepts). Explain why futures margin is not maximum loss. Distinguish a securities margin loan from a futures performance bond.
10-E05 (concepts). What cash obligations and operational risks accompany a short sale beyond a rising stock price?
10-E06 (hand calculation). Buy 100 shares at USD 50/share; terminal price is USD 49.80/share, with entitled dividend USD 0.30/share. Calculate price and total returns, stating the denominator.
10-E07 (hand calculation). One long MES contract has USD 5/index point multiplier. Settlements are 4,000, 3,992, 4,005. Calculate both variation payments and cumulative profit. Why does assumed USD 500 collateral not cap loss?
10-E08 (hand calculation). A USD 1,000,000 notional interest-rate swap receives floating 3.6% and pays fixed 4.0%, with year fraction
10-P01 (programming). Use the chapter functions to calculate E06 total return and one coupon for USD 5,000 face value, 4% annual rate and quarterly payments. Print amounts/ratios and assert the results.
10-P02 (programming). Convert EUR 25,000 using
10-P03 (programming). Construct a short MES position with settlement changes (−12,+7) points and calculate cash flows. Calculate a long put with terminal underlying USD 85/share, strike USD 90/share, premium USD 2/share and multiplier 100, then a repo advance for USD 2,000,000 collateral and 3% haircut. Assert all three results.
16. Programming Exercises
10-P04. Extend a ledger function accepting dated amounts, currencies and event types, ordered by time. Sum within currency only; reject NaN, infinities or missing currency. Return daily balances and cumulative cash flows. Use separate dividend-entitlement/payment dates to demonstrate that events are not merged.
10-P05. Write a contract checker accepting instrument, quote string, multiplier, quantity and price change. Check monetary units. Reject missing FX direction, nonpositive multipliers and futures changes mislabeled as “USD per contract” instead of index-point changes paired with USD/index point.
17. Challenge Problems
10-C01 (research design). A cash ETF and MES referencing the same index each have initial USD 25,000 notional exposure. Design a comparison separating holding return, dividends/financing, fees, rolls, margin capital and settlement cash flows. Specify at least four required data items and explain why percentage price movements cannot establish replicable returns.
10-C02 (reasoning). An institution pledges bonds worth USD 1,000,000 in a repo with 5% haircut and borrows USD 950,000. Design price, liquidity/haircut and counterparty/settlement stresses. Explain worsening balances and the contractual/market data needed to assess loss. Why does the initial haircut not ensure full recovery?
Additional independent exercises
10-N01 (events and state). Use the Section 3 table: terminal stock price is 50.20 and USD 50 dividend entitlement is established but unpaid. State securities, receivable, dividend cash and total wealth before and after payment. Why should payment not increase wealth a second time?
10-N02 (two FX paths). Starting with EUR 1, spot USD/EUR=1.10, simple annual USD rate 5%, EUR rate 3% and six months, write both terminal USD paths and solve the forward. Explain the reciprocal for EUR/USD.
10-N03 (sensitivity). Use the Section 7.1 two-year bond’s cash flows to compute price, modified duration and convexity. Give first-order, second-order and exact repricing for a 100bps increase. State cash-flow and compounding assumptions.
10-N04 (capital and option profit). Why does USD 50 MES profit produce 0.2%, 5% and 0.05% in Section 6? For a call with strike USD 100, premium USD 4 and multiplier 100 shares, calculate payoff/profit at terminal prices 102 and 104.
18. Solutions / Solution Hints
10-E01. Brokers transmit or arrange customer orders; dealers take inventory/counterparty exposures on their own accounts; market makers provide two-way quotes under institutional/commercial arrangements. One entity can perform several roles, with jurisdiction-, venue- and activity-specific duties and disclosure. Economic roles do not determine legal-entity count.
10-E02. ETF shares are units of fund ownership, with venue prices determined by supply/demand and NAV by valuation rules. Discounts/premiums may be temporary or persistent. Ordinary secondary-market purchases do not deliver the underlying basket on every trade. Authorized participants usually handle creation/redemption under product rules; consult the fund documents.
10-E03. T is execution date. Clearing confirms trades, calculates obligations and may net/manage risk; settlement transfers cash/securities. The SEC staff FAQ describes T+1 from May 28, 2024 for transactions covered by Rule 15c6-1 and US-registered brokers/dealers, with scope, exceptions and expressly extended-settlement cases. Other markets, instruments and arrangements require their own rules and business calendars.
10-E04. Securities margin loans finance purchases against account collateral; futures margin supports performance while profit settles through point changes and multipliers. Shortfalls may cause cash calls, reductions or forced liquidation; gaps can produce losses beyond deposits.
10-E05. A short seller must repurchase and return borrowed securities. Rising prices increase repurchase cost; borrowing fees, substitute dividends, recalls, changing borrow availability, margin and compulsory buy-ins add obligations. Rules and eligible securities vary by market and broker.
10-E06. Initial investment
10-E07. First change
10-E08. The receive-floating/pay-fixed net amount is
10-P01 reference implementation (run independently from the working-course root):
import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from quant_course.market_instruments import bond_coupon_cashflow, equity_total_return
total_return = equity_total_return(100, 50.0, 49.8, 0.3)
coupon = bond_coupon_cashflow(5_000.0, 0.04, 4)
assert abs(total_return - 0.002) < 1e-12
assert abs(coupon - 50.0) < 1e-12
print(f"Total return={total_return:.3%}; Coupon per payment=USD {coupon:.2f}")
Expected output is total return 0.200% and coupon per payment USD 50.00. Equity return follows Section 6; the coupon is
10-P02 reference implementation:
import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from quant_course.market_instruments import covered_fx_forward_quote, fx_convert_base_to_quote
spot_usd_per_eur = 1.08
usd = fx_convert_base_to_quote(25_000.0, spot_usd_per_eur)
forward = covered_fx_forward_quote(spot_usd_per_eur, 0.04, 0.02, 0.5)
assert abs(usd - 27_000.0) < 1e-10
assert abs(forward - 1.0906930693069308) < 1e-12
print(f"USD per EUR: spot={spot_usd_per_eur:.4f}, reference forward={forward:.6f}")
print(f"EUR 25,000 converts to USD {usd:,.2f} at the stated spot")
Units are USD/EUR, so EUR 25,000 × 1.08 USD/EUR = USD 27,000. The simplified forward is
10-P03 reference implementation:
import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from quant_course.market_instruments import (
futures_variation_margin_usd, listed_option_pnl, repo_cash_advanced,
)
short_mes = futures_variation_margin_usd(-1, 5.0, [-12.0, 7.0])
put_pnl = listed_option_pnl(85.0, 90.0, 2.0, 1, 100, "put")
repo_cash = repo_cash_advanced(2_000_000.0, 0.03)
assert short_mes == (60.0, -35.0)
assert abs(put_pnl - 300.0) < 1e-12
assert abs(repo_cash - 1_940_000.0) < 1e-8
print(f"short MES settlement cashflows: {short_mes} USD")
print(f"long put expiry P&L: USD {put_pnl:.2f}")
print(f"repo cash advanced: USD {repo_cash:,.2f}")
The short receives USD 60 for a 12-point fall, then pays USD 35 for a 7-point rise, totaling USD 25. The put has USD 5/share intrinsic value, less USD 2/share premium, times 100 shares: net USD 300. Repo advances USD 2,000,000 × 97% = USD 1,940,000.
10-P04 reference implementation (independent execution):
from dataclasses import dataclass
from datetime import date
import math
import re
@dataclass(frozen=True)
class CashEvent:
event_date: date
amount: float
currency: str
event_type: str
moves_cash: bool
def cash_ledger(events: list[CashEvent]) -> list[dict[str, object]]:
ordered = sorted(events, key=lambda event: event.event_date)
balances: dict[str, float] = {}
rows: list[dict[str, object]] = []
for event in ordered:
if not isinstance(event.event_date, date):
raise TypeError("event_date must be datetime.date")
if (
isinstance(event.amount, bool)
or not isinstance(event.amount, (int, float))
or not math.isfinite(event.amount)
):
raise ValueError("amount must be a finite number")
if (
not isinstance(event.currency, str)
or re.fullmatch(r"[A-Z]{3}", event.currency.upper()) is None
):
raise ValueError("currency must be a three-letter code")
if not isinstance(event.event_type, str) or not event.event_type:
raise ValueError("event_type must be non-empty")
if not isinstance(event.moves_cash, bool):
raise TypeError("moves_cash must be a boolean")
currency = event.currency.upper()
cash_flow = float(event.amount) if event.moves_cash else 0.0
balances[currency] = balances.get(currency, 0.0) + cash_flow
rows.append({
"date": event.event_date.isoformat(),
"event_type": event.event_type,
"currency": currency,
"event_amount": float(event.amount),
"cash_flow": cash_flow,
"running_cash": balances[currency],
})
return rows
events = [
CashEvent(date(2025, 1, 2), 50.0, "USD", "dividend_entitlement", False),
CashEvent(date(2025, 1, 6), 50.0, "USD", "dividend_payment", True),
]
rows = cash_ledger(events)
assert rows[0]["date"] == "2025-01-02" and rows[0]["cash_flow"] == 0.0
assert rows[0]["running_cash"] == 0.0
assert rows[1]["date"] == "2025-01-06" and rows[1]["cash_flow"] == 50.0
assert rows[1]["running_cash"] == 50.0
print(rows)
The ledger retains entitlement date but increases USD cash only on payment date. It does not treat a receivable as cash. Currency balances accumulate separately. NaN, infinities, empty currency and invalid events fail. Scoring, 10 points: fields/currency checks 2, missing/nonfinite rejection 2, separate entitlement/payment dates 2, reproducible daily/cumulative balances 2, tests/units 2. Entitlement-as-cash or cross-currency summation cannot earn full credit.
10-P05 reference implementation (independent execution):
import math
import re
def convert_fx(amount_base: float, quote: str, quote_per_base: float) -> tuple[str, float]:
if not isinstance(quote, str) or re.fullmatch(r"[A-Z]{3}/[A-Z]{3}", quote) is None:
raise ValueError("quote must state QUOTE/BASE, for example USD/EUR")
if not math.isfinite(amount_base) or not math.isfinite(quote_per_base):
raise ValueError("FX amount and rate must be finite")
if amount_base < 0 or quote_per_base <= 0:
raise ValueError("amount must be non-negative and rate positive")
quote_currency, _base_currency = quote.split("/")
return quote_currency, amount_base * quote_per_base
def futures_pnl(
signed_contracts: int,
multiplier: float,
multiplier_unit: str,
price_change: float,
price_change_unit: str,
) -> float:
if isinstance(signed_contracts, bool) or not isinstance(signed_contracts, int):
raise TypeError("signed_contracts must be an integer")
if multiplier_unit != "USD/index point" or price_change_unit != "index point":
raise ValueError("futures multiplier and price-change units do not match")
if not math.isfinite(multiplier) or multiplier <= 0 or not math.isfinite(price_change):
raise ValueError("multiplier must be positive and inputs finite")
return signed_contracts * multiplier * price_change
currency, converted = convert_fx(10_000.0, "USD/EUR", 1.10)
mes_pnl = futures_pnl(-1, 5.0, "USD/index point", -12.0, "index point")
assert currency == "USD" and converted == 11_000.0
assert mes_pnl == 60.0
for invalid_pair in ("", "1.10", "EURUSD"):
try:
convert_fx(10_000.0, invalid_pair, 1.10)
except ValueError:
pass
else:
raise AssertionError(f"accepted ambiguous FX quote: {invalid_pair!r}")
try:
futures_pnl(1, 0.0, "USD/index point", 1.0, "index point")
except ValueError:
pass
else:
raise AssertionError("accepted zero multiplier")
try:
futures_pnl(1, 5.0, "USD/contract", 1.0, "USD")
except ValueError:
pass
else:
raise AssertionError("accepted mismatched units")
print(f"FX conversion: {currency} {converted:.2f}; short MES P&L: USD {mes_pnl:.2f}")
FX assertions reject missing/ambiguous direction; futures require matching contract × USD/index point × index point units. Scoring, 10 points: FX direction/conversion units 3, multiplier/direction checks 2, futures-unit derivation 2, counterexample tests 2, field-specific errors 1.
10-C01 reasoning and scoring, 10 points. Include execution prices/fees, ETF distributions/fund fees, daily futures settlement, margin capital, rolls/maturities, financing/cash rates, settlement times and FX conversion. Supply at least four auditable data items; distinguish ETF NAV from traded price and specify multiplier/delivery. Compare equal notional or risk budgets with an explicit denominator. A supported conclusion is that the tools have different cash flows, funding and implementation risks despite shared index exposure; percentage price changes cannot establish replicable net returns. Score denominator 2, data 3, cash-flow/cost distinctions 3, restrained causal/arbitrage claims 2.
10-C02 reasoning and scoring, 10 points. Initial buffer is USD 50,000. A 4% collateral decline leaves USD 960,000 against USD 950,000 debt, only USD 10,000 buffer before interest/fees. Raising haircut from 5% to 8% supports USD 920,000 funding on USD 1,000,000 collateral, potentially requiring USD 30,000 cash/collateral. A price gap, delayed default disposal and additional 7% liquidation discount can leave recovery below debt; disposal costs widen the gap. Assess repo agreements, valuation/top-up frequency, interest, insolvency/clearing law, liquidity and stress prices. Score at least two quantified stresses 4, contractual/execution data 3, explanation that haircut does not guarantee recovery 3. Other consistent inputs/formulas are acceptable.
10-N01 complete solution. Before payment: securities USD 5,020, dividend receivable USD 50, dividend cash zero, total USD 5,070. After payment: receivable zero, dividend cash USD 50, securities unchanged, total still USD 5,070. Converting a receivable into cash does not add a second USD 50 to wealth already containing it. Initial capital USD 5,000 gives 1.4% total return with valid entitlement and no taxes/fees.
10-N02 complete solution. EUR deposits grow to EUR
10-N03 complete solution.
10-N04 complete solution.
19. Further Reading
- Must Know: Investor.gov equity, ETF, bond, margin, short-sale and order-execution education introduces investor rights/obligations without replacing contracts or regulation.
- Must Know: SEC T+1 FAQ and DTCC clearing/settlement descriptions, limited to their US security/service scopes and exceptions.
- Must Know: CME MES/ES specifications and margin education for multipliers, quote precision and terminology; actual trading also requires current rulebooks and broker requirements.
- Should Know: OCC standardized-option disclosures, especially exercise, assignment and expiry. The complete document was not reviewed page by page.
- Should Know: CFTC swap/clearing explanations, ECB repo mechanisms and BIS FX-swap discussion for notional, cash-flow and counterparty distinctions; individual materials do not establish current market size.
- Advanced: MIT OpenCourseWare 15.401 fixed-income materials for yields and rate-risk measures. Section 7.1 gives fixed-cash-flow local sensitivity; Chapter 27 uses zero-coupon duration for rolldown and Chapter 44 develops derivative pricing.
20. References
See source_notes.md for URLs, actual reading scope, boundaries and dates. Main sources are official SEC/Investor.gov, DTCC, CME, OCC, CFTC, ECB, BIS and MIT OCW materials. Original constructed inputs illustrate arithmetic, separate from source quotes or observations. US T+1, CME multipliers and margin statements support only the named rules/contracts and are not generalized to other markets/products.
The C5 sensitivity bridge uses original derivations and constructed cash flows. The October 13, 2026 supplemental source read covered MIT Part IV transcript 17:05–19:32 on local approximations and risk use. See the batch source review for that scope and inherited evidence.