{"uid":"cap_z0rB5KcjN7kh2fdxFv_dP","slug":"agent-quant-position-sizing-1ea01a05","name":"Agent Quant Position Sizing","description":"Pure quant math for AI trading agents: percent change, position sizing, rough liquidation price, DCA schedule, APR/APY. No market data feeds, no API keys. Pay-per-request USDC via x402 on Base and Solana.","url":"https://agent-quant.annushka1190.workers.dev/v1/position-size","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"body":{"type":"object"},"type":{"const":"http"},"method":{"enum":["POST"]},"bodyType":{"const":"json"}}}}},"responseSchema":{"type":"json","example":{"ok":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_AsXvfgeQRLJ30znB5MekT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates optimal position size for a trade given account balance, risk tolerance, and entry/stop-loss parameters using pure math — no market data feeds required.","exampleAgentPrompt":"Calculate my position size: I have a $10,000 account, I'm willing to risk 2% per trade, my entry price is $42,000 and my stop loss is $40,500 — how many units should I buy?","exampleUseCases":[{"title":"Crypto trade position sizing","prompt":"I want to buy Bitcoin at $65,000 with a stop loss at $63,000. My account is $25,000 and I never risk more than 1.5% on any single trade — how large should my position be?"},{"title":"Forex lot sizing for risk management","prompt":"Size my EUR/USD position: account is $5,000, I'm risking 1% per trade, entry at 1.0850, stop loss at 1.0800. How many units or lots should I trade?"},{"title":"Automated agent trade sizing pipeline","prompt":"Before I execute this ETH long, calculate the right position size — account is $50,000, risk per trade is 2%, entry $3,200, stop at $3,050. Give me the exact unit count to send to the exchange."}],"resultDescription":"Returns a JSON object with the computed position size in units, the dollar amount at risk, and potentially the notional value of the position — derived purely from the mathematical relationship between account size, risk percentage, entry, and stop-loss price.","failureModes":["Missing required fields (entry price, stop loss, account balance) returns a validation error","Stop loss equal to or above entry price for a long (or below for a short) may cause a divide-by-zero or invalid result","Malformed JSON body returns a 400-level error","Payment failure via x402 (insufficient USDC balance) returns a 402 Payment Required","Extreme input values (zero account balance, negative prices) may return an error or nonsensical result"],"whenToPreferThis":"Choose this endpoint when you need fast, pure-math position sizing with no external data dependencies or API key setup. Ideal for AI trading agents that already have market prices and need deterministic risk calculations on-demand, billed per-use in USDC. Prefer over spreadsheet tools or broker APIs when you need a lightweight, composable computation step in an automated pipeline.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:35:34.502Z","isFirstParty":false}