{"uid":"cap_5v77PBTIJoz36Es1lGf1k","slug":"margin-required-calculator-f0c10f4e","name":"Margin Required Calculator","description":"Margin required for a notional at a given leverage. Call when pre-trade margin checks without exchange APIs. Returns margin required 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/margin-required","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"leverage":{"type":"integer","description":"Input field: leverage."},"notional":{"type":"integer","description":"Input field: notional."}}},"responseSchema":{"type":"json","example":{"margin":1000,"schema":"delx/util-margin-required/v1","leverage":5,"notional":5000}},"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_vsb3g9R-gAYCBNuGeFRJB","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 the margin required for a given notional amount at a specified leverage, using pure local math with no exchange API calls.","exampleAgentPrompt":"What margin is required for a notional of 50000 at 20x leverage? I need to do a pre-trade check before placing the order.","exampleUseCases":[{"title":"Pre-trade margin check for bot","prompt":"Before my trading bot submits a $25000 notional position at 10x leverage, can you calculate exactly how much margin it needs to have available?"},{"title":"Risk sizing for portfolio manager","prompt":"I'm considering a $100000 notional trade at 5x leverage — what's the required margin so I can make sure I have enough collateral set aside?"},{"title":"Leverage comparison for a trader","prompt":"Can you tell me the margin required on a $5000 notional at 50x leverage so I can compare how much capital I'd tie up versus using 25x?"}],"resultDescription":"A deterministic JSON response containing the margin required (in currency units matching the notional) computed as notional divided by leverage, with no dependency on live market feeds, exchange APIs, or external state.","failureModes":["Missing or zero leverage value causing division-by-zero or validation error","Non-integer or negative notional/leverage inputs rejected with a 400-level error","Payment failure via x402 resulting in request not being processed","Extremely large notional values may exceed integer bounds"],"whenToPreferThis":"Use this endpoint when you need a fast, deterministic, offline margin calculation — especially in pre-trade checks within automated trading pipelines where you cannot or do not want to call a live exchange API. Ideal for bots, risk systems, and backtesting workflows that need margin math without external dependencies or API keys.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:10:44.542Z","isFirstParty":false}