{"uid":"cap_Dq_dboX_XorZwDeT5Rwpe","slug":"haoskionchain-xyz-183b3abd","name":"HaoskiOnChain Crypto Derivatives Risk Oracle","description":"Crypto derivatives risk, margin, liquidation, collateral, and exchange architecture specialist.","url":"https://haoskionchain.xyz/query","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"buyer":{"type":"string","description":"Optional buyer/caller identifier for pass purchases."},"query":{"type":"string","description":"Exchange-risk, margin, liquidation, collateral, LTV, oracle, venue formula, or product-risk question."},"top_k":{"type":"integer","default":5,"maximum":20,"minimum":1,"description":"Number of retrieved knowledge chunks/passages used as answer context. Optional; defaults to 5. Min 1, max 20. Values outside 1-20 are rejected with HTTP 422 after request validation. Does not change the per-query price."},"caller":{"type":"string","description":"Optional caller or agent identifier."}}},"responseSchema":null,"example":{"request":{"query":"How is the liquidation price calculated for a cross-margin BTC perpetual position, and how do the oracle price feed and maintenance margin rate interact in this calculation?","top_k":8,"caller":"qa-agent"},"response":{"answer":"I'll walk you through cross-margin BTC perp liquidation pricing, which is fundamentally different from isolated margin because your entire account equity backs every position.\n\n**The liquidation price formula for cross-margin:**\n\nFor a long position, liquidation triggers when:\n```\nAccount Equity ≤ Total Maintenance Margin Across All Positions\n```\n\nWhere Account Equity = Wallet Balance + Unrealized PnL from all positions\n\nThe liquidation price for your BTC position specifically is:\n```\nLiq Price = (Wallet Balance + Unrealized PnL from other positions - Total MM from other positions) / (Position Size × MM Rate - Position Size)\n```\n\n**Oracle interaction mechanics:**\n\nThe oracle price (mark price) drives two critical components:\n1. **Unrealized PnL calculation** - Your BTC position's unrealized PnL uses mark price, not last trade price\n2. **Maintenance margin assessment** - MM is calculated using position value at mark price\n\nThis creates a feedback loop. When BTC mark price moves against you, it simultaneously increases your maintenance margin requirement AND reduces your account equity through unrealized losses. Cross-margin amplifies this because a single position can drain equity that supports your entire portfolio.\n\n**The real operational challenge** is mark price manipulation during liquidation cascades. When large positions get liquidated, they can drive the underlying spot price away from the perpetual price, causing the oracle to adjust mark price, which triggers more liquidations. I've seen this create multi-block liquidation events where the mark price keeps chasing the spot price down while positions cascade.\n\n**Maintenance margin rate interaction:**\n\nYour MM rate isn't fixed - it steps up with position size. So as BTC price moves against you, not only does your equity shrink, but if you're near a tier boundary, your MM rate can jump higher, accelerating liquidation. The formula becomes path-dependent because the MM rate itself depends on the position value at current mark price.\n\nCross-margin means one bad position can liquidate your entire account, but it also means profitable positions can absorb losses from losing ones. The tradeoff is between capital efficiency and liquidation risk concentration.\n\nWhat size BTC position are you looking at, and are you trying to calculate safe entry levels or understand why a liquidation happened faster than expected?","timestamp":1781758494.5031412,"request_id":"99eb45db","receipt_hash":"05ee657a34f7582db5a6febec86b9c73","payment_method":"x402","chunks_searched":33}},"exampleRequest":{"query":"How is the liquidation price calculated for a cross-margin BTC perpetual position, and how do the oracle price feed and maintenance margin rate interact in this calculation?","top_k":8,"caller":"qa-agent"},"tags":["x402"],"displayCostAmount":"0.2","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.2/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.2","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.2","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OWzI8857CQ-e_wdznd8cM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.2","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Answers specialized questions about crypto derivatives risk, margin mechanics, liquidation logic, collateral management, LTV ratios, oracle pricing, and exchange architecture via a retrieval-augmented knowledge base.","exampleAgentPrompt":"Can you explain how liquidation price is calculated for a cross-margin BTC perpetual position, including how the oracle price feed and maintenance margin rate interact — pull from the top 8 most relevant knowledge chunks?","exampleUseCases":null,"resultDescription":"Returns a synthesized answer to the derivatives/risk question, grounded in up to top_k retrieved knowledge passages covering topics like margin formulas, liquidation thresholds, collateral rules, oracle mechanics, and exchange architecture.","failureModes":["HTTP 422 if top_k is outside the 1–20 range","Vague or unanswerable query may return low-confidence or generic passages","Payment not included or insufficient results in HTTP 402 rejection","Highly novel or product-specific exchange mechanics may not be covered in the knowledge base"],"whenToPreferThis":"Choose this endpoint when an AI agent needs deep, specialized knowledge about crypto derivatives risk management — including margin mechanics, liquidation cascades, LTV collateral rules, oracle price feed design, or exchange-specific risk architecture — rather than general crypto price data or portfolio tracking.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:37:39.099Z","isFirstParty":false}