Exchange Options

Calculate the price of an option to exchange a second asset (the benchmark by default) for each ticker, an outperformance option: what the right to receive the ticker for the second asset at expiration is worth, with the formula of Margrabe (1978).

The option receives one share of the ticker and delivers the number of units of the second asset that are worth the exchange ratio times the ticker’s price today, so at an exchange ratio of 1 it pays at expiration what the ticker gained over the second asset since today, if anything, per share of the ticker.

Measured in units of the second asset the payoff is a call on the ratio of the two prices, so the risk-free rate drops out and the volatility is that of the ratio. An American option may be exercised at any time, which is an American call on the ticker with the second asset as strike, a risk-free rate of q2 and a dividend yield of q1 (Bjerksund and Stensland, 1993), priced with the QD+ exercise boundary and its integral (Li, 2010; Andersen, Lake and Offengenden, 2016), within about 0.1% of a 999-step Leisen-Reimer tree. Without a dividend yield on the ticker early exercise is never optimal and the American option is worth the European one.

The formula is as follows:

\[S_{2} = \text{Exchange Ratio} \cdot S_{1},\;\; \text{the value today of the units of the second asset delivered}\] \[\text{Exchange} = S_{1} \cdot e^{- q_{1} \cdot T} \cdot N(d_{1}) - S_{2} \cdot e^{- q_{2} \cdot T} \cdot N(d_{2})\] \[\sigma = \sqrt{\sigma 1^{2} + \sigma 2^{2} - 2 \rho \sigma 1 \sigma 2}\] \[d_{1} = \frac{\ln\left(\frac{S_{1}}{S_{2}}\right) + \left(q_{2} - q_{1} + \frac{\sigma^{2}}{2}\right) \cdot T}{\sigma \sqrt{T}},\;\; d_{2} = d_{1} - \sigma \sqrt{T}\]

Where S1 is the ticker’s price (the traded close on the pricing date), S2 the second asset’s price, \(\sigma_{1}\) and \(\sigma_{2}\) the annualized volatilities (the standard deviation of the daily returns over the trailing 252 trading days of each times √252), \(\rho\) the correlation of the daily returns of the two over the trailing 252 days on which both traded, q1 and q2 the dividend yields (ln(1 + dividend yield), continuously compounded), T the time to expiration in years (days / 365) and N the cumulative standard normal distribution.

Options on other two-asset payoffs, and the exchange option on prices and correlations of your own, are priced by the model functions in financetoolkit.options.multiasset.multi_asset_model.

See: Margrabe, W. (1978), “The Value of an Option to Exchange One Asset for Another”, Journal of Finance, 33(1), 177-186; Bjerksund, P. & Stensland, G. (1993), “American Exchange Options and a Put-Call Transformation: A Note”, Journal of Business Finance & Accounting, 20(5), 761-764; Haug, E. G. (2007), The Complete Guide to Option Pricing Formulas, 2nd ed., chapter 5. The American value is checked against a Leisen-Reimer tree of 999 steps on the call it equals (QuantLib’s AnalyticAmericanMargrabeEngine takes the Bjerksund-Stensland (1993) approximation, a lower bound about 1% below it).

Also known as: Margrabe option, exchange option, outperformance option, swap option.

Example · AAPL, MSFT · 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_exchange_option:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-12-31",
)

exchange_option = toolkit.options.get_exchange_option(expiration_time_range=91)

exchange_option[["2026-01-30", "2026-03-01", "2026-03-31"]]

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

What was the option to swap the S&P 500 (SPY) for Apple or for Microsoft at expiry worth at the end of 2025, for the expiries of 30 January, 1 March and 31 March 2026?

Which returns:

Parameters

get_exchange_option accepts the following parameters.

ParameterTypeDescriptionExample
start_datestr | NoneThe date whose prices, volatilities and correlation the values start from; a date without prices (a weekend or a holiday) uses the last trading day before it, and a ticker without a price or a month of returns shared with the second asset is left out with a warning. Defaults to None, which uses the last date of the historical data."2021-01-01"
second_tickerstr | NoneThe asset delivered, “Benchmark” or one of the tickers (which is then left out of the rows). Defaults to None, which uses the benchmark.None, which uses the benchmark
american_optionboolWhether the option can be exercised before expiration. Defaults to False.True
exchange_ratiofloatThe value today of the units of the second asset delivered, as a share of the ticker’s price: below 1 the option is in the money, above 1 out of the money. Defaults to 1.0, at the money.
expiration_time_rangeintThe number of days to use for the time to expiration: the columns are the expirations 1 up to expiration_time_range - 1 days after the start date, so at least 2. Defaults to 30, which gives expirations of 1 to 29 days.90
show_input_infoboolWhether to show the input information. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

Share