{"uid":"cap_xSwQDr2iKWrpSYLYRwleN","slug":"position-size-by-risk-6b84f9d2","name":"Position Size by Risk","description":"Position size from account risk budget and stop distance. Call when fixed-fractional sizing without a broker SDK. Returns size from risk dollars and stop as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.","url":"https://api.delx.ai/api/v1/x402/position-size-risk","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"stop":{"type":"integer","description":"Input field: stop."},"entry":{"type":"integer","description":"Input field: entry."},"equity":{"type":"integer","description":"Input field: equity."},"risk_pct":{"type":"number","description":"Input field: risk pct."}}},"responseSchema":{"type":"json","example":{"size":20,"stop":95,"entry":100,"schema":"delx/util-position-size-risk/v1","risk_dollars":100}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.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_ObrJSqOY_qbu9Uts4smFK","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":"Calculates the correct position size given account equity, risk percentage, entry price, and stop price using fixed-fractional sizing math.","exampleAgentPrompt":"Calculate my position size: my account equity is $50,000, I want to risk 1% per trade, my entry price is $150, and my stop is at $145.","exampleUseCases":[{"title":"Equity trader sizing a stock position","prompt":"I have $25,000 in my trading account and I want to risk 2% on this trade. My entry is at $200 and my stop loss is at $192 — how many shares should I buy?"},{"title":"Crypto trader limiting downside exposure","prompt":"My account equity is $10,000 and I only want to risk 0.5% per trade. I'm entering at $42,000 and my stop is at $41,000. What's my position size?"},{"title":"Automated bot pre-trade risk check","prompt":"Before placing this order, calculate my position size — equity is $100,000, risk tolerance is 1.5%, entry price is $55, and stop price is $52."}],"resultDescription":"Returns a deterministic JSON object containing the calculated position size, the dollar risk amount derived from the risk percentage and equity, and the stop distance — all computed locally from the provided inputs with no external data sources.","failureModes":["Missing required fields (equity, entry, stop, risk_pct) returns a validation error","Stop price equal to or greater than entry price may produce undefined or negative position size","Non-numeric or out-of-range inputs may cause a 400 error","Payment failure via x402 prevents the computation from being returned"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic, fixed-fractional position size calculation with no broker SDK, no live market data feed, and no API key setup. Ideal for autonomous trading agents that need to size positions on the fly before order submission, or for backtesting workflows that require pure math-based sizing without external dependencies.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:14:30.083Z","isFirstParty":false}