{"uid":"cap_0LH_E14vxwA7aJlOERK1C","slug":"leveraged-trade-risk-calculator-98d36a21","name":"Leveraged Trade Risk Calculator","description":"Find current AI-agent jobs and bounties with explicit funding evidence, normalized across public marketplaces and filterable for zero mandatory spend.","url":"https://proofwork-codex-0902.ophl.link/x402/leveraged-trade-risk","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"side":{"enum":["long","short"],"type":"string","title":"Side"},"leverage":{"anyOf":[{"type":"number","maximum":200,"minimum":1},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,4}|(?=[\\d.]{1,9}0*$)\\d{0,4}\\.\\d{0,4}0*$)"}],"title":"Leverage","default":"1"},"stop_price":{"anyOf":[{"type":"number","maximum":1000000000000,"exclusiveMinimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,22}0*$)\\d{0,13}\\.\\d{0,8}0*$)"}],"title":"Stop Price"},"entry_price":{"anyOf":[{"type":"number","maximum":1000000000000,"exclusiveMinimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,22}0*$)\\d{0,13}\\.\\d{0,8}0*$)"}],"title":"Entry Price"},"risk_percent":{"anyOf":[{"type":"number","maximum":100,"exclusiveMinimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,4}|(?=[\\d.]{1,9}0*$)\\d{0,4}\\.\\d{0,4}0*$)"}],"title":"Risk Percent","default":"1"},"target_price":{"anyOf":[{"type":"number","maximum":1000000000000,"exclusiveMinimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,22}0*$)\\d{0,13}\\.\\d{0,8}0*$)"},{"type":"null"}],"title":"Target Price","default":null},"fee_bps_per_side":{"anyOf":[{"type":"number","maximum":5000,"minimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,4}|(?=[\\d.]{1,9}0*$)\\d{0,4}\\.\\d{0,4}0*$)"}],"title":"Fee Bps Per Side","default":"5"},"account_equity_usd":{"anyOf":[{"type":"number","maximum":1000000000000,"exclusiveMinimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,22}0*$)\\d{0,13}\\.\\d{0,8}0*$)"}],"title":"Account Equity Usd"},"slippage_bps_per_side":{"anyOf":[{"type":"number","maximum":5000,"minimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,4}|(?=[\\d.]{1,9}0*$)\\d{0,4}\\.\\d{0,4}0*$)"}],"title":"Slippage Bps Per Side","default":"5"},"maintenance_margin_percent":{"anyOf":[{"type":"number","maximum":50,"minimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,4}|(?=[\\d.]{1,9}0*$)\\d{0,4}\\.\\d{0,4}0*$)"}],"title":"Maintenance Margin Percent","default":"0.5"}}},"responseSchema":{"type":"json","example":{"side":"long","result":"CALCULATED","sizing":{"limiting_factor":"risk_budget","risk_budget_usd":"10","initial_margin_usd":"64.19632719","max_position_units":"1.92492735","position_notional_usd":"192.58898157","estimated_loss_at_stop_usd":"10","effective_account_risk_percent":"1"},"target":{"net_reward_to_risk":"2.846","fill_price_estimate":"114.9425","net_profit_per_unit_usd":"14.78500375","position_profit_at_target_usd":"28.46005812"},"version":"1","warnings":[],"disclaimer":"Deterministic sizing estimate only. Exchange liquidation tiers, funding, mark price, taxes, gaps, partial fills, and order-book impact are not modeled; verify against the venue before trading.","execution_model":{"loss_per_unit_usd":"5.19500125","round_trip_fee_bps":"10","stop_fill_estimate":"94.9525","entry_fill_estimate":"100.05","round_trip_slippage_bps":"10"},"liquidation_reference":{"price":"67.26666667","buffer_percent":"32.7333","exchange_specific":false,"stop_before_reference":true}}},"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_GDZR4g1T00kK0taIuHtvU","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":"Computes position sizing, liquidation price, risk/reward ratio, and fee-adjusted P&L for leveraged long or short trades given entry, stop, and target prices.","exampleAgentPrompt":"I want to go long on BTC at an entry price of $100.05, with a stop at $94.95 and a target at $114.94, using 3x leverage on a $10,000 account risking 1% — can you calculate my position size, margin required, liquidation price, and reward-to-risk ratio, assuming 5 bps fees and 5 bps slippage per side?","exampleUseCases":[{"title":"Crypto futures position sizing","prompt":"I'm planning a long ETH trade at $3,200 entry, stop at $3,050, target at $3,600, using 5x leverage on a $25,000 account. I want to risk only 2% of my account. Can you size the position and tell me my liquidation price and reward-to-risk ratio, assuming 5 bps fees and 5 bps slippage each side?"},{"title":"Short trade risk check before entry","prompt":"I'm going short on SOL at $145 with a stop at $152 and a target at $125, 10x leverage, $50,000 account, risking 1.5%. What's my position size, how much USD am I risking, and where is my liquidation reference price? Use 8 bps fees and 3 bps slippage per side."},{"title":"Max leverage liquidation buffer analysis","prompt":"If I enter a long at $30,000 with 50x leverage, a stop at $29,400, and no target yet, on a $5,000 account risking 1%, what is my liquidation price and how much buffer do I have between my stop and liquidation? Use default fee and slippage settings."}],"resultDescription":"Returns a JSON object with: position sizing details (units, notional USD, initial margin, risk budget USD, account risk percent, limiting factor), execution model (entry and stop fill estimates accounting for slippage and fees, round-trip costs in bps), target P&L metrics (net profit per unit, total profit at target, net reward-to-risk ratio), liquidation reference price with buffer percent and a flag indicating whether the stop is above liquidation, plus any warnings and a disclaimer about model limitations.","failureModes":["Invalid side enum value — must be 'long' or 'short'","Stop price on wrong side of entry for the given trade direction (stop above entry for long, or below for short)","Leverage outside allowed range of 1–200","account_equity_usd or entry_price at or below zero","risk_percent outside (0, 100] range","Numeric strings failing regex pattern validation","Target price below entry for long or above entry for short leading to nonsensical reward-to-risk","fee_bps_per_side or slippage_bps_per_side exceeding 5000"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, fee-aware, slippage-adjusted position sizer for leveraged directional trades (long or short) with a clear entry, stop, and optional target. It is especially useful when you need a liquidation reference price alongside sizing — not just notional exposure. Prefer it over generic calculators when you need round-trip cost modeling in basis points and a reward-to-risk ratio in the same response. It does not execute trades, place orders, or access live market data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:34:59.204Z","isFirstParty":false}