# finmath Function Selector

> finmath Function Selector is a paid API for AI agents from finmath.qzqh5rrbkz.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Routes financial and crypto math function calls (TradFi and DeFi) to the correct deterministic computation engine via a function signature

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/function_selector
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/finmath-function-selector-b5c5520b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_y428LrzDIrjS4MSlPppHB

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability finmath-function-selector-b5c5520b -d '<json body>'
```

Example prompt: Use the finmath function selector to compute the Black-Scholes call option price and Greeks for a stock at $150, strike $155, 30-day expiry, 20% volatility, and 5% risk-free rate — pass the signature string 'black_scholes(S=150,K=155,T=0.0822,sigma=0.20,r=0.05,flag=call)'.

## When to prefer this

Choose this endpoint when you need exact, deterministic financial arithmetic that LLMs are known to hallucinate or approximate incorrectly — such as Black-Scholes Greeks, IRR/XIRR, bond pricing, impermanent loss, DeFi liquidation thresholds, or Uniswap v3 math. Prefer it over asking an LLM to compute finance formulas directly, as this guarantees model-free precision.

## Known failure modes

- Invalid or malformed function signature string returns an error
- Unsupported function name in signature causes routing failure
- Missing required parameters within the signature string cause computation errors
- Division by zero or mathematically undefined inputs (e.g. negative volatility) return error
- Payment not received or insufficient USDC causes 402 rejection

## How this service works

Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.

## Output

Returns a result object containing the computed financial value (e.g. option price, NPV, liquidation price, impermanent loss percentage) and a meta object with call metadata such as function name, input echo, and execution info.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "signature"
 ],
 "properties": {
  "signature": {
   "type": "string",
   "description": "signature"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "result",
  "meta"
 ],
 "properties": {
  "meta": {
   "type": "object"
  },
  "result": {}
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/finmath-function-selector-b5c5520b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from finmath.qzqh5rrbkz.workers.dev](https://www.zero.xyz/host/finmath.qzqh5rrbkz.workers.dev/llms.txt)
