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
| View | Function | Reads |
|---|---|---|
| Payoff | payoffCurve + paintPayoff / paintPayoffZones / paintPayoffPair | one or more legs, valued at expiry or at the current time; profit zones, breakevens and the now curve |
| Greeks | greekProfile + paintGreekProfile, bsDelta, bsGamma, bsVega, bsTheta, bsRho | a greek across strikes or spot prices for one expiry |
| Smile and term structure | smileCurve + paintIvSmile, termStructure + paintIvTerm | implied volatilities solved from quotes; a smile per expiry, a term structure per strike |
| Surface | ivSurface + paintIvSurface | a grid of expiries and strikes; the kit paints the heat grid, the caller adds the axis labels |
| Open interest | oiPoints, oiTotals + paintOpenInterest | contracts per strike; calls above the zero line, puts below, in contracts or in notional |
| Option chain | buildOptionChainRows + CHAIN_COLUMNS | quotes 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

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.
| 85.0 | 18.27 | 0.825 | 42.3% | 400 | 2.21 | -0.175 | 42.3% | 600 | |
| 86.0 | 17.34 | 0.816 | 41.0% | 660 | 2.27 | -0.184 | 41.0% | 680 | |
| 87.0 | 16.43 | 0.806 | 39.7% | 920 | 2.35 | -0.194 | 39.7% | 760 | |
| 88.0 | 15.54 | 0.795 | 38.6% | 1,180 | 2.44 | -0.205 | 38.6% | 840 | |
| 89.0 | 14.66 | 0.783 | 37.5% | 1,440 | 2.55 | -0.217 | 37.5% | 920 | |
| 90.0 | 13.80 | 0.770 | 36.5% | 1,700 | 2.68 | -0.230 | 36.5% | 1,000 | |
| 91.0 | 12.96 | 0.755 | 35.5% | 1,960 | 2.83 | -0.245 | 35.5% | 1,080 | |
| 92.0 | 12.14 | 0.739 | 34.7% | 2,220 | 3.00 | -0.261 | 34.7% | 1,160 | |
| 93.0 | 11.35 | 0.721 | 33.9% | 2,480 | 3.19 | -0.279 | 33.9% | 1,240 | |
| 94.0 | 10.58 | 0.703 | 33.1% | 2,740 | 3.41 | -0.297 | 33.1% | 1,320 | |
| 95.0 | 9.83 | 0.682 | 32.5% | 3,000 | 3.65 | -0.318 | 32.5% | 1,400 | |
| 96.0 | 9.12 | 0.661 | 31.8% | 3,260 | 3.93 | -0.339 | 31.8% | 1,480 | |
| 97.0 | 8.44 | 0.638 | 31.3% | 3,520 | 4.23 | -0.362 | 31.3% | 1,560 | |
| 98.0 | 7.78 | 0.614 | 30.8% | 3,780 | 4.57 | -0.386 | 30.8% | 1,640 | |
| 99.0 | 7.17 | 0.589 | 30.4% | 4,040 | 4.94 | -0.411 | 30.4% | 1,720 | |
| 100.0 | 6.58 | 0.563 | 30.0% | 4,300 | 5.34 | -0.437 | 30.0% | 1,800 | |
| 101.0 | 6.03 | 0.536 | 29.7% | 4,560 | 5.78 | -0.464 | 29.7% | 1,720 | |
| 102.0 | 5.52 | 0.510 | 29.4% | 4,820 | 6.26 | -0.490 | 29.4% | 1,640 | |
| 103.0 | 5.05 | 0.482 | 29.2% | 5,080 | 6.77 | -0.518 | 29.2% | 1,560 | |
| 104.0 | 4.61 | 0.456 | 29.0% | 5,340 | 7.31 | -0.544 | 29.0% | 1,480 | |
| 105.0 | 4.20 | 0.429 | 28.9% | 5,600 | 7.90 | -0.571 | 28.9% | 1,400 | |
| 106.0 | 3.83 | 0.403 | 28.8% | 5,860 | 8.51 | -0.597 | 28.8% | 1,320 | |
| 107.0 | 3.49 | 0.378 | 28.8% | 6,120 | 9.16 | -0.622 | 28.8% | 1,240 | |
| 108.0 | 3.18 | 0.354 | 28.8% | 6,380 | 9.84 | -0.646 | 28.8% | 1,160 | |
| 109.0 | 2.91 | 0.330 | 28.8% | 6,640 | 10.55 | -0.670 | 28.8% | 1,080 | |
| 110.0 | 2.66 | 0.309 | 28.9% | 6,900 | 11.29 | -0.691 | 28.9% | 1,000 | |
| 111.0 | 2.43 | 0.288 | 29.1% | 7,160 | 12.05 | -0.712 | 29.1% | 920 | |
| 112.0 | 2.23 | 0.269 | 29.2% | 7,420 | 12.84 | -0.731 | 29.2% | 840 | |
| 113.0 | 2.06 | 0.251 | 29.5% | 7,680 | 13.65 | -0.749 | 29.5% | 760 | |
| 114.0 | 1.90 | 0.235 | 29.7% | 7,940 | 14.48 | -0.765 | 29.7% | 680 | |
| 115.0 | 1.76 | 0.220 | 30.0% | 8,200 | 15.33 | -0.780 | 30.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.

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
- Options kit API - every exported symbol.
- Table kit - strikes, moneyness and the greek columns as cells.
- Analytics kits - all four kits and the table kit.
Swaps kit
The accrual schedule of both legs, forward rates from a discount curve, present value, the par swap rate and the painters of the ladder, the net flows and the cumulative PV curve.
Table kit
The table layer of the kits - the column model of the core, figure cells drawn live in both palettes, and a table that drives the chart next to it.
