Esc

    The API is under testing and may change before release.

    How equity products work

    An equity option and an equity total return swap both read a share's quoted spot, but they answer different questions. An option prices the right to buy or sell the share later, so it needs a forward and a volatility. A total return swap passes the share's return from one side to the other, so it needs only today's price and what the period started at. This page explains both models and what each one leaves out.

    What the market supplies

    The market holds the trade currency's discount curve, each share's quoted spot, set with with_equity_spot, and, for options, the share's vol surface by expiry and strike, set with with_equity_vols. Dividends and the prices a later swap period starts from arrive as fixings: DIV-<name> and EQ-<name>. Building them is covered on equity spots and vols.

    The forward

    With no dividends, holding the share to a date TT costs what buying it forward does, so the forward is the spot carried at the discount rate:

    F=SP(T).F = \frac{S}{P(T)}.

    A share that pays a dividend before TT has a lower forward, because the forward buyer doesn't receive it. The option model here assumes a dividend-free spot and doesn't see dividends.

    Equity options

    A European option pays at expiry, on the share price then. A call on QQ shares struck at KK is Black-76 on the forward:

    C=Q P(T) Black(F,K,σ,τ),C = Q\,P(T)\,\mathrm{Black}(F, K, \sigma, \tau),

    where σ\sigma is the surface's vol at the option's expiry and strike, and τ\tau is the surface's ACT/365 Fixed time to expiry. A put is the same formula with the payoff reversed. A call less a put at one strike pays Q(ST−K)Q(S_T - K) whatever happens, which is a forward purchase, so

    C−P=Q (S−K P(T)).C - P = Q\,(S - K\,P(T)).

    A negative QQ is the short side: the same premium with the sign turned. See equity option.

    Barriers

    A barrier adds a level that switches the option. A knock-out dies if the spot trades through the level before expiry, and a knock-in only comes alive if it does. A down barrier sits below the spot and an up barrier above it. A rebate pays a fixed amount per share to a knocked-out holder, or to a knock-in that never knocked in.

    Barriers make an option cheaper, which is why structured products use them. With no rebate, a knock-in and a knock-out on the same level are, between them, the vanilla: exactly one of the two is alive at expiry. A single continuously monitored barrier has a closed-form price, the Reiner-Rubinstein formulas. They assume the spot starts on the live side of the barrier, so a spot already through it is refused.

    Equity total return swaps

    A total return swap gives the receiver the economics of holding shares without buying them: the gain or loss on the price over each period, plus the dividends, against a funding rate on the notional. Prime brokers and dealers use it to finance equity inventory and to give clients leveraged exposure.

    The swap resets periodically. At each reset the gain is settled, and the next period starts from the share's fixing at that date. The value VV of the period under way, to the receiver, is what the shares gained since the period's start, plus the dividends DjD_j gone ex since then, less the funding accrued on the funding notional at ACT/360. The funding notional is by default the quantity times the initial price.

    That value is undiscounted, and periods not yet started are worth nothing. The payer holds −V-V. The formula, with every symbol, is on equity total return swap.

    From formula to API

    Symbol Meaning Rust Python
    SS, σ\sigma the spot and the surface MarketContext::with_equity_spot, with_equity_vols MarketContext.with_equity_spot, with_equity_vols
    P(T)P(T) the discount factor to expiry curve.view::<f64>().discount(T) MarketContext.discount_factor
    Black\mathrm{Black} Black-76 on the forward black76(forward, strike, vol, expiry, kind) models.black76(forward, strike, vol, expiry, kind)
    CC, PP an option's premium EquityOption::new, then AnyInstrument::npv products.equity_option, then Instrument.npv
    VV a total return swap's value EquityTotalReturnSwap::new, then AnyInstrument::npv products.equity_total_return_swap, then Instrument.npv
    DjD_j dividends DIV-<name> in a FixingStore MarketContext.with_fixings([("DIV-<name>", date, amount)])

    See also

    • Equity option and equity total return swap, the reference pages.
    • Equity spots and vols, for the market they read.
    • How FX products work, for the same option model on a currency.
    • Bond total return swap, for the same swap on a bond.

    From the 0.0 line at revision bf7f2e2. Every printed number is that revision's own output.