npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rickrosten/agent-deterministic-tools-finance

v1.0.0

Published

Deterministic financial tools for AI agents: interest, time value of money, annuities, loans, NPV and IRR with decimal precision and explicit conventions.

Readme

@rickrosten/agent-deterministic-tools-finance

Deterministic financial calculations for AI agents, with decimal precision and explicit conventions: nothing ambiguous is chosen silently.

| Tool | Purpose | | --- | --- | | finance.compound_interest | FV and interest of a single deposit | | finance.simple_interest | non-compounding interest (years, or days + day count) | | finance.future_value / finance.present_value | lump-sum TVM | | finance.annuity_future_value / finance.annuity_present_value | level payment streams | | finance.loan_payment | level payment of an amortizing loan | | finance.loan_amortization | full schedule | | finance.total_interest | total interest over the loan | | finance.npv | net present value | | finance.irr | internal rate of return |

Conventions

| Topic | Rule | | --- | --- | | Rates | annualRatePercent / ratePercent are in percent: 5 = 5%. | | Nominal vs effective | rateType is required. nominal: periodic rate = r / compoundingPerYear (APR-style). effective: r already includes compounding (APY/AER). | | Compounding frequency | compoundingPerYear is required. | | Payment frequency | paymentsPerYear is required for annuities and loans. If it differs from compoundingPerYear, the equivalent rate per payment period (1 + i_c)^(m/p) - 1 is used. | | Payment timing | paymentTiming (end / begin) is required for annuities and loans. | | NPV timing | firstCashFlowAt (now / end_of_first_period) is required. Excel NPV() equals end_of_first_period. | | Sign convention | TVM amounts are positive magnitudes. NPV/IRR cash flows are signed: negative = outflow. | | Day count | Not applicable (period based), except simple_interest with days, which requires dayCount (actual_360 / actual_365). | | Precision | All intermediate values: 34 significant digits (decimal.js, private clone). | | Rounding | Only final results are rounded: scale (default 2) and roundingMode (default half_up), both echoed in the output. | | Loan schedules | Level payment rounded to scale; each period's interest rounded to scale; final payment adjusted so the balance ends at exactly 0. total_interest uses the same schedule. |

Every monetary result contains result (number), resultDecimal (exact string), scale, roundingMode, internalPrecision and, when currency is supplied, currency and formatted.

{
  "result": 16470.09,
  "resultDecimal": "16470.09",
  "interest": 6470.09,
  "scale": 2,
  "roundingMode": "half_up",
  "internalPrecision": 34,
  "currency": "EUR",
  "formatted": "€16,470.09"
}