Chartsv26.10.18
API reference

Options kit API (@unifin/chart-kit-options)

Generated reference of 71 public symbols of @unifin/chart-kit-options, grouped by kind and ordered as in the sources.

Generated from the package entry packages/chart-kit-options/src/index.ts. Names are reachable through @unifin/chart-kit-options; use your editor for full signatures - this page carries the map.

Functions (33)

SymbolWhat it does
buildOptionChainRowsInput order is kept: sorting is the host's controlled step.
smileCurveSmile model: atm + skew * ln(K/S) + curvature * ln(K/S)^2.
termStructureTerm structure model: atm + slope * T (own demo-grade shape).
smilePointsSmile points as analytic samples (x = strike, y = iv).
termPointsTerm points as analytic samples (x = years, y = iv).
paintIvSmilePaints the smile.
paintIvTermPaints the term structure.
ivSurfaceSurface from the smile and term models: each expiry gets its own smile.
paintIvSurfacePaints the surface as an accent-tinted heatmap with strike/expiry labels.
normCdfStandard normal cumulative distribution.
normPdfStandard normal density.
intrinsicIntrinsic value at expiry.
bsPriceBlack-Scholes price; degenerate inputs fall back to the intrinsic value.
bsDeltaDelta: the spot sensitivity (0..1 for calls, -1..0 for puts).
bsGammaGamma: the delta sensitivity (same for calls and puts).
bsVegaVega per one unit of volatility (divide by 100 for a vol point).
bsThetaTheta per year (divide by 365 for a calendar day).
bsRhoRho per one unit of the rate (divide by 100 for a rate point).
impliedVolImplied volatility solved by bisection; NaN when the market price sits below the no-arbitrage lower bound or the inputs are degenerate.
oiPointsSplit-bar samples: x = strike index shifted per side, y signed.
oiTotalsTotals of the table: calls, puts (absolute) and the net.
maxOiLargest single value of the table (for the Y domain of the host).
paintOpenInterestPaints the split bars (calls up, puts down).
legValueValue of one leg at the given spot (premium already subtracted).
payoffAtTotal payoff of the position at the given spot.
payoffCurveSampled payoff curve; empty for a degenerate range.
breakevensZero crossings of the curve with linear interpolation (grid precision).
profitZonesSegments of the curve above zero, edges interpolated at the crossings.
paintPayoffZonesPaints the gain and loss ribbons of the payoff: gain zones grow up from the zero line in the up colour, loss zones hang below it in the down colour. Returns the number of painted ribbons; a zero-width span paints nothing.
paintPayoffPaints the payoff curve itself.
paintPayoffPairPaints the expiry and the "now" curves (expiry accent, now muted). With zoneGradient the ribbon under the active (expiry) curve becomes a ramp dense at the curve and soft at the zero line (S105, ); the ramp is off by default and the return counts the curve samples only.
greekProfileSamples a greek across strikes or spot prices.
paintGreekProfilePaints the greek profile as a curve.

Types (26)

SymbolWhat it does
OptionChainQuote-
OptionChainStrike-
OptionChainContext-
ChainMoneyness-
OptionChainRow-
SmilePoint-
TermPoint-
IvCurveOptionsOptions of the IV curve painters; the bare curve is the default.
IvSurface-
SurfacePaintOptions-
OptionTypeOption math of the options kit ( §2, ): the Black-Scholes price and greeks on the public 1973 formula plus an own implied-volatility solver. Reference values and properties (put-call parity, monotonicity) live in tests/options-math.test.ts; provenance - §2.10.
BsParamsStandard Black-Scholes inputs: spot, strike, years, rate, volatility.
StrikeOiRow-
OiMode-
OpenInterestOptionsOptions of the open-interest painter; the flat fill is the default.
LegKind-
OptionLegOne leg: signed quantity, strike for options, premium paid per unit.
PayoffMode-
NowParamsParameters of the "now" valuation (remaining time, rate, volatility).
PayoffCurveOptions-
ProfitZone-
PayoffZoneStyleZone style of the payoff painter; the flat fill is the compatible default.
GreekName-
ProfileAxis-
ProfileParams-
ProfileRange-

Constants (12)

SymbolWhat it does
CHAIN_COLUMNSChain columns of the options kit; the host renders and sorts them.
IV_UNDERLAY_ALPHA_TOPUnderlay shares of the smile and the term curve (S105, ): the ribbon under the curve is dense at the line and soft at the plot bottom.
IV_UNDERLAY_ALPHA_BOTTOM-
IV_FRAME_UNDERLAY_ALPHAWash of the surface frame over the heat cells (S105, ).
IV_ROW_EDGE_ALPHALight edge of the row picked by the host (S105, ).
OI_BAR_ALPHA_TOPBar ramp shares of the open interest (S105, ): dense at the tip of every bar, soft towards the baseline; the role colour stays the theme one.
OI_BAR_ALPHA_BOTTOM-
PAYOFF_ZONE_ALPHA_TOPZone fills of the payoff (S105, ): the ramp is dense at the curve and fades towards the zero line, so the ribbons read as light.
PAYOFF_ZONE_ALPHA_ZERO-
PAYOFF_ZONE_FLAT_ALPHAFlat ribbon alpha: the host default and the canvas gradient degradation.
PAYOFF_PAIR_ALPHA_CURVEUnderlay of the active curve of a pair: dense under the curve, soft at zero.
PAYOFF_PAIR_ALPHA_ZERO-

On this page