Payoff Builder

Draw any payoff at maturity or enter it as a formula.
The builder finds the portfolio of cash, the underlying and options that replicates it best.
Compare exact and rounded quantities and add the result to your portfolio.

Draw a Payoff at Maturity

iWhy this works. Every payoff f(ST) can be written as cash, the underlying and calls (Carr–Madan): f(ST)=f(K0)+f′(K0)(ST−K0)+∫K0∞f″(K)(ST−K)+dK(ST≥K0) The density of calls at strike K is the curvature f″(K). With finitely many calls the payoff becomes piecewise linear, and each quantity wi is the change in slope at its kink Ki: P(ST)=a+bST+∑i=1nwi(ST−Ki)+

How the fit works. For given strikes P is linear in a,b,wi, so the best quantities follow from least squares over the drawn points (Sj,yj): mina,b,w ∑j(yj−P(Sj))2
The strikes are chosen greedily: in each step the strike that reduces the error most is added, up to the maximum number of options, then each strike is moved once more to the best position.

For rounded quantities each quantity is set to a multiple of the step, strikes may be dropped, and the cash amount a is refit to the mean residual.

Draw with the mouse or a finger over the spot axis. Draw again over a section to correct it. The fit uses a zero bond, the underlying and up to the maximum number of options set under Settings.

Payoff drawing

Blue: exact fit · green dashed: rounded quantities. The zero bond is cash and is not rounded.

Fitted Portfolio

Exact: 9 options · RMS error 0.0000 · Max error 0.0000
Rounded to 1: RMS error 0.0000 · Max error 0.0000

TypeStrikeQty (exact)Qty (rounded)
Zero Bond –0.00000.0000
Underlying –00
Call 65.0022
Call 80.00-4-4
Call 87.0033
Call 95.0022
Call 102.00-6-6
Call 116.0022
Call 117.0033
Call 128.00-4-4
Call 140.0022
Use