Quantitative finance for .NET,
stateless by design.

Rates, credit, equity, FX, inflation and commodities, vanilla to exotic; short-rate, market, Heston and SABR models; Monte Carlo and PDE engines. Every pricer is a plain function of its inputs, and market conventions are data you can override.

A first swap

Install the package:

dotnet add package NanoQL

Then price a five-year SOFR swap on a flat curve. The curve, the swap and the evaluation date are values, and the engine is a function of them:

using NanoQL;
using NanoQL.Indexes;
using NanoQL.Instruments;
using NanoQL.PricingEngines;
using NanoQL.TermStructures;
using NanoQL.Time;

var today = new Date(15, Month.October, 2026);
var context = new EvaluationContext { EvaluationDate = today };
var curve = new FlatForward(today, 0.036, new Actual365Fixed());

var swap = new MakeOIS(new Period(5, TimeUnit.Years), new Sofr(curve))
    .WithFixedRate(0.036).WithNominal(10e6)
    .ToOvernightIndexedSwap(context);

var result = DiscountingSwapEngine.Calculate(swap, context, curve);
Console.WriteLine($"NPV {result.NPV:N2}, fair rate {result.FairRate:P4}");

It prints:

NPV 7,041.24, fair rate 3.6154%

Prefer Python? Run this and more in your browser: curves, SABR, options and CDS.

Why nanoql

Stateless

Instruments, curves and models are immutable values, pricers are static functions of them, and the evaluation date is an argument, not a global setting. The same inputs always give the same outputs, and calls run side by side.

Conventions as data

Calendars, day counts, currencies, indexes and the instrument builders' defaults are XML records: read them, override them for a desk, and version them with your trades.

Tested

Checked against 3,348,122 independent reference outputs, 99.86% within a relative 1e-10, and the reference library's own tests at their tolerances; 736 departures are each documented and tested. The validation report has the figures, the divergences page each departure.

C#, Python, C and Excel

From C# and F#, and from Python and C through one C interface over nanoql compiled to native code: pip install nanoql needs no .NET runtime, and the C archive serves any language that calls C. In Excel on Windows, an add-in puts the library in worksheet formulas.