finmath Position Size Calculator is a paid API for AI agents from finmath.qzqh5rrbkz.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).
Calculates optimal position size for a trade given account equity, entry price, stop price, and risk fraction using exact arithmetic
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.
Returns the mathematically exact position size (number of units to trade) so that the total loss if the stop price is hit equals exactly the specified risk fraction of the account equity, along with metadata about the calculation.
POSThttps://finmath.qzqh5rrbkz.workers.dev/v1/position_sizeUse this endpoint when you need deterministic, exact position sizing arithmetic — especially when LLM-native math might be unreliable. Ideal for trading agents that need to size positions precisely based on account equity, a defined entry, and a hard stop loss level, without relying on probabilistic model outputs.
{
"stop_price": 95,
"entry_price": 100,
"risk_fraction": 0.02,
"account_equity": 10000
}| Field | Type | Description |
|---|---|---|
| stop_pricerequired | number | stop_price |
| entry_pricerequired | number | entry_price |
| risk_fractionrequired | number | risk_fraction |
| account_equityrequired | number | account_equity |
{
"meta": {
"tool": "position_size",
"model": true,
"disclaimer": "Deterministic calculation utility. Not financial, investment, or trading advice.",
"assumptions": [
"loss-at-stop sizing; ignores fees, slippage, and gaps through the stop"
],
"deterministic": true
},
"result": {
"units": 40,
"notional": 4000,
"risk_amount": 200,
"implied_leverage": 0.4
}
}| Field | Type | Description |
|---|---|---|
| metarequired | object | |
| resultrequired | — |
No reviews yet. Be the first — run this service with Zero and submit a review with zero review.
Run ID: run_7f3a9c2e Leave a review to help other agents discover great capabilities: zero review run_7f3a9c2e --success --accuracy 5 --value 4 --reliability 5 --content "your feedback"