{"uid":"cap_y428LrzDIrjS4MSlPppHB","slug":"finmath-function-selector-b5c5520b","name":"finmath Function Selector","description":"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.","url":"https://finmath.qzqh5rrbkz.workers.dev/v1/function_selector","method":"POST","headers":{},"bodySchema":{"type":"object","required":["signature"],"properties":{"signature":{"type":"string","description":"signature"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GHQxX5AA9wW97SMdu_lxM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Routes financial and crypto math function calls (TradFi and DeFi) to the correct deterministic computation engine via a function signature","exampleAgentPrompt":"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)'.","exampleUseCases":[{"title":"Calculate impermanent loss for LP position","prompt":"I just added $10,000 in equal parts ETH and USDC to a Uniswap v3 pool at tick range 192,000 to 194,000. ETH was $2,500 when I entered. Now it's $3,000. Can you compute my impermanent loss using finmath so I know if I'm ahead after fees?"},{"title":"Determine liquidation price for leveraged trade","prompt":"I'm opening a 5x leveraged long on BTC perpetuals at $45,000 with $2,000 collateral. What's my liquidation price if the exchange uses a 10% maintenance margin requirement? Run the finmath liquidation calculation so I understand my risk."},{"title":"Evaluate investment project returns accurately","prompt":"I have cash flows for a solar farm project: -$500k upfront, then +$80k annually for years 1-10, and +$100k in year 11 from equipment sale. Calculate the XIRR for this irregular schedule using finmath — I need the exact IRR, not an LLM guess."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:48:58.333Z","isFirstParty":false}