API reference
Swaps kit API (@unifin/chart-kit-swaps)
Generated reference of 35 public symbols of @unifin/chart-kit-swaps, grouped by kind and ordered as in the sources.
Generated from the package entry packages/chart-kit-swaps/src/index.ts. Names are reachable through
@unifin/chart-kit-swaps; use your editor for full signatures - this page carries the map.
Functions (24)
| Symbol | What it does |
|---|---|
swapPeriods | Accrual periods from the start date; a negative tenor or step gives no periods. |
sideOf | Side factor of the holder: the payer of the fixed leg sees the fixed amounts negative. |
swapSchedule | Full schedule of both legs. The floating leg needs the projected rate of every period: the caller passes a reader (rateOf), and without one the floating leg is built with a zero rate so the schedule still describes its shape. |
netFlows | Net flows of the swap by payment date. The two legs of a plain vanilla swap share their dates, and the reader wants the net - the two gross rows stay in the result so a report can still show them. |
flowsTotal | Total of one leg or of the net, ignoring non-finite amounts. |
flatCurve | Flat curve of one continuous zero rate, valid for every horizon. |
zeroCurve | Curve from quoted points: sorted by horizon, non-finite points dropped. |
zeroRateAt | Continuous zero rate at a horizon: linear between the quoted points and flat outside them, which is what a panel of a swap book shows before bootstrapping. |
discountFactor | Discount factor of a horizon: the exponential of the zero rate. |
flowYears | Years between the valuation date and a payment date. |
forwardRate | Forward rate of one accrual period implied by the curve (single-curve bootstrapping identity): the ratio of the two discount factors over the accrual. It is NaN when the accrual is not positive. |
presentValue | Present value of one leg at the valuation date. |
swapNpv | Net present value of a swap: both legs discounted and their net. |
cumulativePv | Cumulative present value of the net flows, one point per payment date: the curve a reader follows to see when the swap has paid for itself. |
annuityFactor | Present value of a fixed annuity of one unit of notional (the denominator of a par rate). |
parSwapRate | Par swap rate: the fixed rate that makes the two legs equal at the valuation date. The floating leg is rebuilt from the curve, so the answer does not depend on the fixed rate of the terms. |
swapScheduleOf | Schedule of a swap whose floating leg is projected from the curve. |
swapNpvFromCurve | Net present value of a swap whose floating leg is projected from the curve. |
legPoints | Ladder points of one leg: the horizon of the payment against its amount. |
netPoints | Net points of the payment dates: what the holder actually pays or receives. |
cumulativePvPoints | Points of the cumulative PV curve of the swap. |
paintSwapLadder | Bars of the two legs from the zero line; a negative bar is a payment. |
paintNetArrows | Marks of the net flows: the amount of every payment date on the palette of the chart, labelled by the caller, because a net figure without its date is useless. An activeIndex overpaints one date - the busiest one of the panel. |
paintCumulativePv | Cumulative PV as a curve with the points that build it and the S105 ribbon. |
Types (11)
| Symbol | What it does |
|---|---|
SwapDirection | Which side of the swap the holder is on. |
SwapTerms | Terms of a plain vanilla swap: one notional, two legs, one frequency. |
SwapLeg | - |
SwapFlow | One accrual period of one leg, with the amount that falls on its payment date. |
SwapPeriod | One accrual period of the swap without a side. |
SwapSchedule | - |
NetFlow | Net amount on one payment date: the sum of both legs falling on it. |
ZeroPoint | One point of a discount curve: continuous zero rate at a horizon in years. |
DiscountCurve | A curve of continuous zero rates; one point makes it flat. |
SwapNpv | - |
CumulativePvPoint | One point of the cumulative PV curve: years from the valuation date and the total. |
