{"uid":"cap_zJnd7AFjyIsOGydxaJJNT","slug":"finmath-for-agents-c9f8dbd9","name":"FinMath for Agents","description":"Pay-per-call financial math utilities for AI trading agents: position sizing, liquidation, DCA, fees, slippage, APY. Payment via x402, USDC on Base. No API keys, no accounts.","url":"https://x402-finmath.whale-feed-max.workers.dev/v1/calc","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"apr":{"type":"number","description":"APR, % (apy)"},"entry":{"type":"number","description":"Entry price (liq)"},"price":{"type":"number","description":"Asset price (slippage)"},"slPct":{"type":"number","description":"Stop-loss, % (position)"},"slots":{"type":"number","description":"Number of DCA slots (dca)"},"total":{"type":"number","description":"Total amount to invest (dca)"},"amount":{"type":"number","description":"Trade amount (fees, slippage)"},"equity":{"type":"number","description":"Account equity (position)"},"feePct":{"type":"number","description":"Fee, % (fees)"},"margin":{"type":"number","description":"Margin (liq, optional)"},"riskPct":{"type":"number","description":"Risk, % of equity (position)"},"slipPct":{"type":"number","description":"Slippage, % (slippage)"},"leverage":{"type":"number","description":"Leverage (liq)"},"compoundPerYear":{"type":"number","description":"Compounds per year (apy)"}}},"responseSchema":{"type":"object","properties":{"fee":{"type":"number"},"net":{"type":"number"},"apyPct":{"type":"number"},"perSlot":{"type":"number"},"totalCost":{"type":"number"},"riskAmount":{"type":"number"},"positionSize":{"type":"number"},"slippageCost":{"type":"number"},"liquidationLong":{"type":"number"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JuTnR3hL-ApjP8Xqtp74U","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes financial math for trading agents: position sizing, liquidation price, DCA schedules, fees, slippage cost, and APY — paid per-call via USDC on Base.","exampleAgentPrompt":"I have $10,000 in equity and want to risk 1.5% per trade with a 3% stop-loss — what position size should I use?","exampleUseCases":[{"title":"Leveraged position liquidation check","prompt":"I'm entering a long at $42,000 with 10x leverage and $5,000 margin — what's my liquidation price so I know where to set my safety stop?"},{"title":"DCA schedule per slot sizing","prompt":"I want to DCA $3,000 into an asset over 8 slots — how much should I invest in each slot?"},{"title":"APR to APY conversion for staking","prompt":"A staking pool is offering 18% APR compounded daily — what does that work out to in APY so I can compare it to other yield opportunities?"}],"resultDescription":"Returns a flat JSON object with whichever computed fields apply to the requested calculation: positionSize (units to trade), riskAmount (dollar risk), liquidationLong (liquidation price for longs), perSlot and totalCost (DCA breakdown), fee and net (fee-adjusted amounts), slippageCost (slippage in dollar terms), and apyPct (annualized yield). Unused fields are omitted.","failureModes":["Missing required parameters for the selected calculation type returns an error or null fields","Invalid or zero values for denominator fields (e.g. slPct=0) may cause divide-by-zero errors","Payment failure via x402/USDC prevents the call from completing","Passing parameters for the wrong calculation type (e.g. APY params to a position sizing call) returns irrelevant or empty results","Network timeout on the Cloudflare Worker edge node"],"whenToPreferThis":"Choose this endpoint when an AI trading agent needs fast, deterministic financial math computed server-side without managing spreadsheet logic locally. It is ideal for agents that need position sizing, liquidation prices, or DCA slot sizing in real-time during trade execution flows, and prefer pay-per-call USDC billing with no API key management. Prefer alternatives if you need market data, price feeds, or order execution — this is purely a math utility.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:38:09.925Z","isFirstParty":false}