true402
guide · quant

Price it,
size it.

A trading or risk agent needs the math — an option’s price and Greeks, a Kelly bet size, a portfolio’s Value at Risk. Here’s how it calls that math directly, as one pay-per-call endpoint, with no quant library to bundle and no API key.

§01 · one endpoint, ten calculators

Pick a function, pass its params.

The quant stall is a single dispatch endpoint. POST { function, params } and it runs that calculator — Black-Scholes + Greeks, implied volatility, Kelly, Sharpe, Sortino, max drawdown, historical VaR, CVaR, CAGR, or volatility. Pure computation over x402, no key.

quant
# Black-Scholes price + Greeks in one call. ~$0.003 USDC over x402, no API key.
curl -s -X POST https://true402.dev/api/v1/quant \
  -H 'content-type: application/json' \
  -d '{"function": "black_scholes",
       "params": {"S":100, "K":100, "T":1, "r":0.05, "sigma":0.2, "type":"call"}}'

# → { function: "black_scholes",
#     result: { price: 10.4506, delta: 0.6368, gamma: 0.01876,
#               vega: 0.3752, theta: -0.0176, rho: 0.5323 } }

# other functions: implied_volatility, kelly, sharpe, sortino,
#                  max_drawdown, historical_var, cvar, cagr, volatility
§02 · deterministic

Exact, reproducible, no black box.

Every function is pure math — no external data, no model drift. The same inputs always return the same output, tested against textbook reference values (a $100 at-the-money one-year call at 20% vol prices to 10.4506 with delta 0.6368). Greeks use standard conventions: vega per 1% vol, theta per calendar day, rho per 1% rate.

§03 · risk, not just price

Size the bet, measure the tail.

Beyond options, the same endpoint sizes positions with the Kelly criterion and measures risk from a return series — Sharpe and Sortino ratios, historical VaR and CVaR, max drawdown, CAGR and volatility. An agent supplies the numbers; nothing is ever fetched, so there is no data surface to trust.

§04 · for agents

Fractions of a cent, no key.

An unpaid request returns HTTP 402 with payment requirements; the agent pays ~$0.003 USDC on Base and retries — flat across every function, no signup. See the full parameter list in the API reference, or start with what is x402?

§05 · questions

Answered for machines.

How does an AI agent price an option?

It calls a Black-Scholes endpoint with the inputs and gets the price and Greeks back as JSON. true402’s quant stall exposes this at POST /api/v1/quant with function "black_scholes" and params {S, K, T, r, sigma, type} — spot, strike, years to expiry, risk-free rate, volatility, and call or put. It returns the price plus delta, gamma, vega, theta and rho. It is pure computation with no API key, so an agent gets a deterministic answer without bundling a quant library.

Is there an API for options Greeks (delta, gamma, vega, theta, rho)?

Yes — the same black_scholes call returns all five Greeks alongside the price, using standard conventions (vega per 1% vol, theta per calendar day, rho per 1% rate). There is also implied_volatility, which recovers the volatility implied by a given option price. One dispatch endpoint, pay-per-call over x402, no key.

What finance calculators can an agent call over x402?

The quant stall bundles ten deterministic calculators behind one endpoint: black_scholes and implied_volatility for options; kelly for bet sizing; and sharpe, sortino, max_drawdown, historical_var, cvar, cagr and volatility for risk and performance. You pick one with the "function" field and pass its params. Because it is pure math with no external dependency, the result is exact and reproducible.

What does a quant calculation cost, and is a key required?

About $0.003 in USDC per call over x402 — flat across every function — with no API key and no account. An unpaid request returns HTTP 402 with payment requirements; the agent pays on Base and retries. A trading or risk agent can size a position, price an option, and check a portfolio’s VaR for fractions of a cent each.