Chartsv26.10.18
Kits

Options kit

Black-Scholes price and greeks, implied volatility, multi-leg payoff at expiry and now, greek profiles, the smile, the term structure, the surface and open interest by strike.

@unifin/chart-kit-options prices options, solves implied volatility and paints the views an options surface needs - from the payoff of a multi-leg position to the two-dimensional volatility surface.

import { bsPrice, bsDelta, impliedVol, payoffCurve } from '@unifin/chart-kit-options';

bsPrice('call', { S: 100, K: 100, T: 1, r: 0.05, sigma: 0.2 }); // 10.4506
impliedVol('call', marketPrice, { S: 100, K: 100, T: 1, r: 0.05, sigma: 0.2 });

What the kit renders

ViewFunctionReads
PayoffpayoffCurve + paintPayoff / paintPayoffZones / paintPayoffPairone or more legs, valued at expiry or at the current time; profit zones, breakevens and the now curve
GreeksgreekProfile + paintGreekProfile, bsDelta, bsGamma, bsVega, bsTheta, bsRhoa greek across strikes or spot prices for one expiry
Smile and term structuresmileCurve + paintIvSmile, termStructure + paintIvTermimplied volatilities solved from quotes; a smile per expiry, a term structure per strike
SurfaceivSurface + paintIvSurfacea grid of expiries and strikes; the kit paints the heat grid, the caller adds the axis labels
Open interestoiPoints, oiTotals + paintOpenInterestcontracts per strike; calls above the zero line, puts below, in contracts or in notional
Option chainbuildOptionChainRows + CHAIN_COLUMNSquotes per strike; mids, greeks from the quoted volatility and open interest in one row

The payoff builder supports multi-leg positions, so a spread, a straddle or a condor is a leg list. Greeks come from the same price function, and the implied volatility solver rejects quotes below the no-arbitrage bound instead of returning a meaningless number.

The S105 wave settles the fills: the payoff zones ramp towards the zero line, the open-interest bars fade from a dense tip to the baseline, the smile and the term structure carry an accent underlay, and the heat grid keeps flat cells but gains a diagonal frame wash with a light edge on the picked row. On the live sections the volatility slider and a strike click move the figure with a 200 ms ramp (instant under prefers-reduced-motion), so the readouts change together with the frame.

Live payoff, smile and chain

Options kit - live panel
Theme
Options - payoff, volatility smile and the chain

Payoff, volatility smile and open interest

The screener

The option chain analytics board builds its rows with the chain builder: mids, deltas from the quoted implied volatilities and open interest per side, with the legs of every strike behind a chevron. The locale switch moves the digits; the moneyness and the greeks keep their kit precision.

Number locale moves the grouping and the decimal separator; the declared precision of every column stays.
Number locale
Option chain analytics31 rows
Headless rows of @unifin/chart-kit-options - mids, Black-Scholes deltas from the quoted IVs and OI per side, the chevron splits the strike into its legs
85.018.270.82542.3%4002.21-0.17542.3%600
86.017.340.81641.0%6602.27-0.18441.0%680
87.016.430.80639.7%9202.35-0.19439.7%760
88.015.540.79538.6%1,1802.44-0.20538.6%840
89.014.660.78337.5%1,4402.55-0.21737.5%920
90.013.800.77036.5%1,7002.68-0.23036.5%1,000
91.012.960.75535.5%1,9602.83-0.24535.5%1,080
92.012.140.73934.7%2,2203.00-0.26134.7%1,160
93.011.350.72133.9%2,4803.19-0.27933.9%1,240
94.010.580.70333.1%2,7403.41-0.29733.1%1,320
95.09.830.68232.5%3,0003.65-0.31832.5%1,400
96.09.120.66131.8%3,2603.93-0.33931.8%1,480
97.08.440.63831.3%3,5204.23-0.36231.3%1,560
98.07.780.61430.8%3,7804.57-0.38630.8%1,640
99.07.170.58930.4%4,0404.94-0.41130.4%1,720
100.06.580.56330.0%4,3005.34-0.43730.0%1,800
101.06.030.53629.7%4,5605.78-0.46429.7%1,720
102.05.520.51029.4%4,8206.26-0.49029.4%1,640
103.05.050.48229.2%5,0806.77-0.51829.2%1,560
104.04.610.45629.0%5,3407.31-0.54429.0%1,480
105.04.200.42928.9%5,6007.90-0.57128.9%1,400
106.03.830.40328.8%5,8608.51-0.59728.8%1,320
107.03.490.37828.8%6,1209.16-0.62228.8%1,240
108.03.180.35428.8%6,3809.84-0.64628.8%1,160
109.02.910.33028.8%6,64010.55-0.67028.8%1,080
110.02.660.30928.9%6,90011.29-0.69128.9%1,000
111.02.430.28829.1%7,16012.05-0.71229.1%920
112.02.230.26929.2%7,42012.84-0.73129.2%840
113.02.060.25129.5%7,68013.65-0.74929.5%760
114.01.900.23529.7%7,94014.48-0.76529.7%680
115.01.760.22030.0%8,20015.33-0.78030.0%600

The product-level view of the same data lives on the Options desk: the full chain with sorting, locale and ITM shading, and the gallery of every strategy with its payoff, risk summary and legs.

import { buildOptionChainRows, CHAIN_COLUMNS } from '@unifin/chart-kit-options';
import { sortTableRows } from '@unifin/chart-core';

const rows = buildOptionChainRows(strikes, { spot: 100, T: 0.25, r: 0.05 });
const byOi = sortTableRows(rows, CHAIN_COLUMNS, { key: 'putOi', direction: 'desc' });

The implied volatility surface in 3D

The surface grid also reads as a 3D mesh: strikes walk one axis, expiries the other, and the solved implied volatility sets the height. Drag rotates the scene, the wheel and a two-pointer pinch zoom the scale, the arrow keys rotate the focused canvas, and the reset button plus the two angle presets return to the canonical views. The mesh model and the painter ship on the /formats subpath, so a host canvas reuses the same geometry.

Theme
yaw 0.60 · pitch 0.90 · scale 1.00
The implied volatility surface as a mesh: strikes across, expiries away from the viewer, the solved volatility as the height. Hover reads strike, expiry and IV; a tap pins the strike slice.

The implied volatility surface as a 3D mesh

import { ivSurface } from '@unifin/chart-kit-options';
import { ivSurface3dModel, paintIvSurface3d } from '@unifin/chart-kit-options/formats';
import { scene3dCamera } from '@unifin/chart-core/scene3d';

const surface = ivSurface(strikes, expiries, 100, 0.24, -0.35, 1.6, 0.012);
const model = ivSurface3dModel(surface);
paintIvSurface3d(ctx, model, { width, height, theme, camera: scene3dCamera() });

The surface builder sits in the Options kit API entry; the camera is part of the core API.

See also

On this page