UnderneathThe libraries
The server is a protocol surface over five libraries, each of which stands on its own. If you are writing Python rather than driving a model, import them directly — the server adds validation, handles and a wire format, and none of that is useful inside a process.
| Install | Import | What it does |
|---|---|---|
| moneyness | moneyness | option pricing under Black-Scholes-Merton with the full Greek set, implied volatility, SVI surfaces and Dupire local volatility, American exercise on lattices and in closed form, Heston stochastic volatility priced through its characteristic function by two independent routes, and Monte Carlo under both models, including Andersen's quadratic-exponential scheme for the variance process. |
| shortfall | shortfall | shrinkage covariance and factor risk attribution, value at risk and expected shortfall by five methods, risk contributions, risk parity and drawdown statistics, conditional volatility, simulated horizons and coverage backtests, generalised Pareto tails and Gaussian or Student-t copulas, and volatility from the whole bar by five range estimators. |
| tenor | tenor | day counts, business-day conventions and schedules, curve bootstrapping with monotone interpolation, bond analytics and key rate durations, option-adjusted spreads on a short-rate lattice, floating rate notes and index-linked bonds, forward curves, carry and roll-down, survival curves, credit default swaps and risky bonds, and deliverable bond futures, conversion factors and the basis. |
| slippage-tca | slippage | implementation shortfall decomposed against its benchmarks, market impact fitting and reversion, Almgren-Chriss schedules, constrained and for a whole basket, transient impact under a decay kernel, and the schedule it implies, volume curves and participation, and a simulator to score a schedule against. |
| holdout-backtest | holdout | deflated Sharpe ratios and effective trial counts, the probability of backtest overfitting, purged and combinatorial cross-validation, tests for superior predictive ability and a model confidence set, multiplicity haircuts and a robust Sharpe-difference test, and a test for a break in the Sharpe ratio at a date the data chose. |
Two of those install under a name that is not the name you
import. slippage and holdout on the package
index belong to unrelated projects that were there first, so these publish as
slippage-tca and holdout-backtest. Renaming the Python
packages to match would have broken every existing import to settle a registry
collision. The failure mode is quiet — pip install slippage
succeeds and hands you somebody else's library — which is why it is stated
here rather than left to be discovered.
In the libraries, not on the server
The tool surface has a size budget, because every tool's schema is in a model's context before it has done anything, and a surface that does not fit is a surface that crowds out the work. It stands at 39 tools and 138,286 characters against a ceiling of 140,000. The following are built and tested in the libraries and have no tool, which is a statement about the budget and not about what is worth having:
| Library | What it does |
|---|---|
| moneyness | Heston stochastic volatility: the transform, the smile it generates, and simulation of the variance process |
| moneyness | Asian and barrier payoffs under stochastic volatility |
| shortfall | volatility from open, high, low and close, by five range estimators |
| tenor | floating rate notes and discount margins |
| tenor | index-linked bonds, real duration and breakeven inflation |
| tenor | survival curves bootstrapped from par credit default swap spreads, risky bond pricing and the credit triangle's measured error |
| tenor | deliverable bond futures: conversion factors, the basis and the cheapest bond to deliver |
| slippage | post-trade mark-outs and reversion decay |
| slippage | impact that decays at a rate rather than instantly, and the block-rate-block schedule that minimises its cost |
| holdout | a bootstrap test for a break in the Sharpe ratio at a date chosen by the data, and how little power it has |
| slippage | basket liquidation under a matrix of impact and a matrix of risk |
Importing the library is the answer for any of them today, which is what the rest of this page is about.
When to use the server instead
The server earns its place when a language model is the caller. It adds argument validation with messages addressed at a caller that can retry, handles so state survives a stateless protocol, refusals that distinguish a fixable mistake from a broken request, and a tool surface with a budget on its size. In a Python process every one of those is overhead: you have exceptions, variables and a type checker already.
When to use the libraries instead
Any time the calling code is yours. They have no dependency on this server,
no dependency on each other, and between them no dependency beyond NumPy —
moneyness, shortfall and tenor have none
at all. Each ships type information, a command line, and its own test suite
against published reference figures.