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.
@unifin/chart-kit-swaps values a plain vanilla swap and paints the position: the accrual schedule of
both legs, the forward rates the curve implies, the present value of each leg and the par rate.
import { flatCurve, netFlows, parSwapRate, swapNpvFromCurve, swapScheduleOf } from '@unifin/chart-kit-swaps';
const terms = {
notional: 100_000_000,
fixedRate: 0.05,
startIso: '2026-10-06',
tenorMonths: 60,
stepMonths: 6,
direction: 'pay-fixed' as const,
};
const curve = flatCurve(0.05);
const schedule = swapScheduleOf(terms, curve, '2026-10-06'); // both legs, projected from the curve
const npv = swapNpvFromCurve(terms, curve, '2026-10-06'); // fixed, floating and the net
const par = parSwapRate(terms, curve, '2026-10-06'); // the fixed rate that prices it at par
const flows = netFlows(schedule); // what is paid or received on each dateWhat the kit renders
| Figure | Function | Reads |
|---|---|---|
| Leg ladder | legPoints + paintSwapLadder | one bar per payment, drawn from the zero line: a negative bar is a payment |
| Net flows | netPoints + paintNetArrows | the net of both legs per payment date, marked on the palette of the chart |
| Cumulative PV | cumulativePvPoints + paintCumulativePv | the running present value of the net flows - the curve that shows when the position has paid for itself |
| Schedule | swapSchedule, swapPeriods, flowsTotal | accrual boundaries, the periods of both legs and the totals per leg |
The kit signs every amount the same way (positive received, negative paid) and takes its day count conventions from the core, so a swap and a bond quote the same dates to the same accrual. Both ACT/365 and 30/360 are supported.
Live ladder, net flows and cumulative PV

The S105 wave adds the gradient fills and the smooth dynamics: the ladder bars ramp from the tip to
the zero line, the cumulative PV curve carries a ribbon down to the plot floor with a bright edge,
and the busiest payment date of the net view is emphasised. The two rate sliders set the target while
the figure follows a 200 ms ramp - data-swap-phase marks the running frames, ?frozen=1 pins a
deterministic capture, reduced motion lands at once, and the zoom indicator keeps the wheel and drag
readouts honest (data-swap-scale).

Where it appears
The swap view of the Yields workspace draws these painters: the leg ladder of the schedule, the net arrows of the payment dates and the cumulative PV curve next to the curve builders of the same kit.
- Table kit - the net flow rows as figure cells.
- Fixed income kit - the same curve and day count maths for bonds.
See also
- Swaps kit API - every exported symbol.
- Analytics kits - all four kits and the table kit.
Portfolio kit
Return and risk metrics of a book, the benchmark and underwater curves, allocation views, the monthly heatmap and the four risk figures.
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.
