{"uid":"cap_txPCuXzMVckgGkzN9qJ5m","slug":"margin-requirement-calculator-a44acbd1","name":"Margin Requirement Calculator","description":"Calculate required margin for collateral","url":"https://margin-api-production-d413.up.railway.app/calculate?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5rrbKi86uO7vWjYhkcVS-","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the required margin amount for a given collateral position","exampleAgentPrompt":"What's the required margin for my collateral position — I want to make sure I know how much I need to post before opening a trade.","exampleUseCases":[{"title":"Pre-trade margin check for derivatives","prompt":"Before I open this futures position, can you calculate how much margin I'll need to post as collateral so I don't get liquidated?"},{"title":"DeFi lending collateral sizing","prompt":"I'm about to deposit collateral into a lending protocol — can you tell me the required margin amount so I know exactly how much to lock up?"},{"title":"Risk management margin audit","prompt":"Can you compute the required margin for my current collateral holdings so I can verify I'm not under-margined across my open positions?"}],"resultDescription":"Returns the calculated required margin amount for the specified collateral, typically including the minimum margin needed, margin ratio, and any relevant thresholds or warnings about sufficiency.","failureModes":["Missing or invalid input parameters returns a 400 error","Unsupported collateral type or asset returns a validation error","Service unavailable or Railway deployment downtime returns a 503","Payment not included or insufficient USDC results in a 402 Payment Required response","Malformed query parameters cause computation failure"],"whenToPreferThis":"Use this endpoint when you need to compute the required margin before posting collateral or opening a leveraged position, particularly in automated trading or DeFi workflows where precise margin calculations are needed programmatically. Pair it with the sibling 'check if posted margin is sufficient' endpoint for a complete pre- and post-collateral workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T19:04:26.851Z","isFirstParty":false,"canonicalSlug":"margin-requirement-calculator-a44acbd1"}