{"uid":"cap_cqWKgx4kP407Xqgmltu0k","slug":"ozmium-agent-api-morpho-midnight-fixed-rate-collateral-withdrawal-ed0a8780","name":"Ozmium Agent API – Morpho Midnight Fixed-Rate Collateral Withdrawal","description":"Morpho Midnight collateral withdrawal calldata. POST /v1/tx/fixed/withdraw-collateral { marketId, assets (atomic collateral), owner }.","url":"https://ozmium.org/v1/tx/fixed/withdraw-collateral","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"to":{"type":"string"},"data":{"type":"string"},"value":{"type":"string"}}}},"network":{"type":"string"}}}}}}},"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_f2FLuFafH8aDvG2xDqIEs","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":"Generates calldata for withdrawing collateral from a Morpho Midnight fixed-rate market on Base, returning signed transaction steps ready for agent execution.","exampleAgentPrompt":"Generate the calldata to withdraw 5000 USDC worth of collateral (in atomic units) from my Morpho Midnight fixed-rate market with marketId 0xabc123 using my wallet address 0xYourOwnerAddress on Base.","exampleUseCases":[{"title":"Reclaim collateral after loan repayment","prompt":"I just repaid my Morpho Midnight fixed-rate loan and want to withdraw all 2000000000 atomic units of my collateral from market 0xabc123 — generate the transaction calldata I need to send from my wallet 0xMyWalletAddress."},{"title":"Partial collateral release to rebalance LTV","prompt":"I want to partially de-risk my Morpho Midnight fixed-rate position by withdrawing 500000000 atomic units of collateral from market 0xdef456. My owner address is 0xMyWalletAddress — can you build the withdrawal calldata for me?"},{"title":"Agent-automated collateral exit on maturity","prompt":"My Morpho Midnight fixed-rate term just matured on market 0x789fed — automatically prepare the collateral withdrawal transaction for the full 1000000000 atomic units from owner wallet 0xAgentWallet so I can sign and broadcast it."}],"resultDescription":"An array of transaction steps (to, data, value) along with the target network identifier, encoding the withdrawCollateral call against the Morpho Midnight market contract on Base. The agent can pass these steps directly to a wallet or broadcast layer for execution.","failureModes":["Invalid or unknown marketId returns an error indicating market not found","Assets value of zero or exceeding deposited collateral returns a validation error","Owner address not matching a collateral position may return empty or rejected calldata","Malformed request body (missing required fields) returns a 400 bad request","Payment failure or missing x402 payment header returns a 402 payment required","Network downtime on Base may cause calldata generation to fail with a 5xx error"],"whenToPreferThis":"Use this endpoint when an AI agent needs to generate ready-to-execute calldata for withdrawing collateral from a Morpho Midnight fixed-rate market on Base, specifically within the Ozmium ecosystem. Prefer this over generic DeFi SDKs when you need a simple API call that returns structured transaction steps without requiring the agent to construct ABI-encoded calls manually. Pair it with the supply-collateral and borrow endpoints for full position lifecycle management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:53:18.157Z","isFirstParty":false}