{"uid":"cap_lwH8YI_9SDgtk9U7D5fZI","slug":"api-quantoracle-dev-560b0ff8","name":"QuantOracle Risk Position Size Calculator","description":"QuantOracle: risk/position-size","url":"https://api.quantoracle.dev/v1/risk/position-size","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"stop_loss":{"type":"number","title":"Stop Loss","description":"Stop loss price"},"entry_price":{"type":"number","title":"Entry Price","description":"Planned entry price"},"account_size":{"type":"number","title":"Account Size","description":"Total account value"},"risk_per_trade":{"type":"number","title":"Risk Per Trade","default":0.02,"description":"Maximum risk per trade as fraction (e.g. 0.02 = 2%)"}}},"responseSchema":null,"example":{"request":{"risk_pct":0.02,"stop_loss":145,"entry_price":150,"account_size":50000},"response":{"ms":18.61,"risk":1000,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","calculator":"https://quantoracle.dev/position-size-calculator","powered_by":"QuantOracle"},"value":30000,"shares":200,"max_loss":1000,"target_2r":160,"pct_account":0.6,"risk_per_share":5}},"exampleRequest":{"risk_pct":0.02,"stop_loss":145,"entry_price":150,"account_size":50000},"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_InZuMFdGrqrVsdeH0mB9E","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, share count, risk exposure, and 2R target price given entry price, stop loss, account size, and risk percentage per trade","exampleAgentPrompt":"I'm entering a trade at $150 with a stop loss at $145, my account is $50,000 and I want to risk 2% per trade — how many shares should I buy and what's my 2R profit target?","exampleUseCases":null,"resultDescription":"Returns the number of shares to buy, total position value, dollar risk amount, max loss, the 2R target price, and the percentage of account at risk — all computed in ~12ms","failureModes":["stop_loss >= entry_price returns validation error","risk_per_trade > 1.0 or negative values return 400 bad request","account_size of zero or negative triggers error","missing required fields return 422 unprocessable entity","network timeout or service unavailability returns 5xx"],"whenToPreferThis":"Use this endpoint when you need fast, deterministic position sizing calculations based on fixed-risk methodology — especially for equities or any instrument where you know the entry price and stop loss. Preferred over manual calculation or general-purpose math tools when you need the full risk summary (shares, position value, max loss, 2R target) in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:52:50.116Z","isFirstParty":false}