Withdraw collateral that has been supplied to a Morpho Market.
A Morpho Market is a primitive lending pool that pairs one collateral asset with one
loan asset. Each market is isolated (meaning risks are contained within each
individual market), immutable (cannot be changed after deployment), and will persist
as long as the blockchain it is deployed on is live.
Required Allowances
In order to make this transaction, token allowances need to be set for the following contracts.
MorphoMarket
POST
/
v1
/
morpho
/
withdraw_collateral
Python (SDK)
from compass_api_sdk import CompassAPI, modelswith CompassAPI( api_key_auth="<YOUR_API_KEY_HERE>",) as compass_api: res = compass_api.morpho.morpho_withdraw_collateral(amount=0.5, unique_market_key="0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5", chain=models.MorphoWithdrawCollateralRequestChain.BASE, sender="0x81d310Eb515E05EB26322e2DeDE9e75b754885A4", estimate_gas=True) # Handle response print(res)
import { CompassApiSDK } from "@compass-labs/api-sdk";
const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await compassApiSDK.morpho.morphoWithdrawCollateral({
amount: 0.5,
uniqueMarketKey: "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
chain: "base",
sender: "0x81d310Eb515E05EB26322e2DeDE9e75b754885A4",
});
console.log(result);
}
run();
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Compass API Docs","colors":{"primary":"#0284c7","light":"#0e9fe9","dark":"#0284c7"},"logo":{"light":"https://mintcdn.com/compasslabs-f07467e0/x2NrFgZ7soJbH6sc/logo/light.svg?fit=max\u0026auto=format\u0026n=x2NrFgZ7soJbH6sc\u0026q=85\u0026s=80a04b06674000990914306c6a833cb9","dark":"https://mintcdn.com/compasslabs-f07467e0/x2NrFgZ7soJbH6sc/logo/dark.svg?fit=max\u0026auto=format\u0026n=x2NrFgZ7soJbH6sc\u0026q=85\u0026s=77e910ba12605c7f004ad72498f8076f"},"favicon":"https://mintcdn.com/compasslabs-f07467e0/x2NrFgZ7soJbH6sc/favicon.svg?fit=max\u0026auto=format\u0026n=x2NrFgZ7soJbH6sc\u0026q=85\u0026s=2025e9c84a2b6b167d319b28e1ecb8a0","appearance":{"default":"light","strict":true},"navbar":{"links":[{"href":"https://calendly.com/elisabeth-compasslabs/30min","label":"Book a demo"},{"href":"https://compasslabs.ai/login","label":"Login"}]},"footer":{"socials":{"x":"https://x.com/labs_compass","github":"https://github.com/CompassLabs","linkedin":"https://www.linkedin.com/company/compass-labs-ai","medium":"https://medium.com/@compasslabs","telegram":"https://discord.com/invite/ujetyJJPYr","discord":"https://discord.com/invite/ujetyJJPYr"},"links":[{"header":"Resources","items":[{"label":"Blog","href":"https://medium.com/@compasslabs"}]},{"header":"Legal","items":[{"label":"Terms \u0026 Conditions","href":"https://docs.compasslabs.ai/v1/support/terms-and-conditions"},{"label":"Privacy Policy","href":"https://docs.compasslabs.ai/v1/support/privacy-policy"}]}]},"styling":{"eyebrows":"section","codeblocks":"system","latex":false},"integrations":{"ga4":{"measurementId":"G-EQSZ3TK15C"},"gtm":{"tagId":"GTM-5NXMZG6D"}},"contextual":{"options":["chatgpt","claude"],"display":"header"},"navigation":{"global":{"tabs":[],"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"compasslabs-f07467e0","hasAudioNarration":false,"actualSubdomain":"compasslabs-f07467e0","customDomains":["docs.compasslabs.ai"],"gitSource":{"type":"github","owner":"compasslabs","repo":"mono","deployBranch":"production","contentDirectory":"api_docs","isPrivate":true,"mountPath":"","label":""},"feedback":{"issues":true,"edits":true,"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af5b5300b3858d5ef253beb","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"API Reference","count":300},{"language":"default","tag":"Documentation","count":30},{"language":"default","tag":"Aave V3","count":15},{"language":"default","tag":"Credit","count":15},{"language":"default","tag":"Perpetual Trading","count":15},{"language":"default","tag":"Tokenized Assets","count":15},{"language":"default","tag":"Earn","count":13},{"language":"default","tag":"Morpho","count":12},{"language":"default","tag":"Uniswap V3","count":10},{"language":"default","tag":"Transaction Bundler","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"button.css","content":"@keyframes jump{0%,100%{transform:translateY(0)}50%{transform:translateY(-20px)}}.jump-loop{animation:jump 0.5s ease infinite}#code-group{background-color:#EFEFEF33;box-shadow:0 4px 12px rgba(0, 0, 0, 0.08)}#code-group:hover{box-shadow:0 6px 18px rgba(0, 0, 0, 0.1)}#content-area>div.flex.flex-col.gap-8>div.mt-6.flex.w-full.flex-col.space-y-4>div{background-color:#EFEFEF33}#content-area>div.flex.flex-col.gap-8>div.mt-6.flex.w-full.flex-col.space-y-4>div{box-shadow:0 4px 12px rgba(0, 0, 0, 0.08)}#content-area>div.flex.flex-col.gap-8>div.mt-6.flex.w-full.flex-col.space-y-4>div:hover{box-shadow:0 6px 18px rgba(0, 0, 0, 0.1)}"}],"page":{"pagePath":"v1/api-reference/morpho/withdraw-collateral-from-market","slug":"/v1/api-reference/morpho/withdraw-collateral-from-market","pageMetadata":{"title":"Withdraw Collateral from Market","description":"Withdraw collateral that has been supplied to a Morpho Market.\n\nA Morpho Market is a primitive lending pool that pairs one collateral asset with one\nloan asset. Each market is isolated (meaning risks are contained within each\nindividual market), immutable (cannot be changed after deployment), and will persist\nas long as the blockchain it is deployed on is live.\n \u003cInfo>\n **Required Allowances**\n\n In order to make this transaction, token allowances need to be set for the following contracts.\n\n - `MorphoMarket`\n \u003c/Info>\n ","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/withdraw_collateral","href":"/v1/api-reference/morpho/withdraw-collateral-from-market","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n li: \"li\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n }, {Info} = _components;\n if (!Info) _missingMdxReference(\"Info\", true);\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Withdraw collateral that has been supplied to a Morpho Market.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"A Morpho Market is a primitive lending pool that pairs one collateral asset with one\\nloan asset. Each market is isolated (meaning risks are contained within each\\nindividual market), immutable (cannot be changed after deployment), and will persist\\nas long as the blockchain it is deployed on is live.\"\n }), \"\\n\", _jsxs(Info, {\n children: [_jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Required Allowances\"\n })\n }), _jsx(_components.p, {\n children: \"In order to make this transaction, token allowances need to be set for the following contracts.\"\n }), _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: _jsx(_components.code, {\n children: \"MorphoMarket\"\n })\n }), \"\\n\"]\n })]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\nfunction _missingMdxReference(id, component) {\n throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Withdraw Collateral from Market","description":"Withdraw collateral that has been supplied to a Morpho Market.\n\nA Morpho Market is a primitive lending pool that pairs one collateral asset with one\nloan asset. Each market is isolated (meaning risks are contained within each\nindividual market), immutable (cannot be changed after deployment), and will persist\nas long as the blockchain it is deployed on is live.\n \u003cInfo>\n **Required Allowances**\n\n In order to make this transaction, token allowances need to be set for the following contracts.\n\n - `MorphoMarket`\n \u003c/Info>\n ","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/withdraw_collateral","href":"/v1/api-reference/morpho/withdraw-collateral-from-market","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/compasslabs-f07467e0/27fd886bf35b6ed0/redeploy-trigger.js","/_mintlify/custom/compasslabs-f07467e0/5b350f94165e79a1/scripts/auth-btns.js","/_mintlify/custom/compasslabs-f07467e0/0c2ee6a003a69104/scripts/home-btn-link.js","/_mintlify/custom/compasslabs-f07467e0/17a3e2d25ff9b880/scripts/magic.js","/_mintlify/custom/compasslabs-f07467e0/2592024b81e4044f/scripts/modal.js","/_mintlify/custom/compasslabs-f07467e0/60b3db97b96f7d26/scripts/language-icon-fixer.js","/_mintlify/custom/compasslabs-f07467e0/60408501351ea2bb/scripts/disable-bundler-playground.js"],"openApiReferenceData":{"operation":{"tags":["Morpho"],"summary":"Withdraw Collateral from Market","description":"Withdraw collateral that has been supplied to a Morpho Market.\n\nA Morpho Market is a primitive lending pool that pairs one collateral asset with one\nloan asset. Each market is isolated (meaning risks are contained within each\nindividual market), immutable (cannot be changed after deployment), and will persist\nas long as the blockchain it is deployed on is live.\n \u003cInfo>\n **Required Allowances**\n\n In order to make this transaction, token allowances need to be set for the following contracts.\n\n - `MorphoMarket`\n \u003c/Info>\n ","operationId":"v1_morpho_withdraw_collateral","requestBody":"b15b9cf8-20b0-4cf5-9fbc-36f6894d854d","responses":{"200":"3b0919ba-a0c7-4ed7-a303-5ca5718f943d","422":"2edde080-7a32-4ec8-b30b-07249e2aeb34"},"x-speakeasy-name-override":"morpho_withdraw_collateral","x-codeSamples":[{"lang":"python","label":"Python (SDK)","source":"from compass_api_sdk import CompassAPI, models\n\n\nwith CompassAPI(\n api_key_auth=\"\u003cYOUR_API_KEY_HERE>\",\n) as compass_api:\n\n res = compass_api.morpho.morpho_withdraw_collateral(amount=0.5, unique_market_key=\"0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5\", chain=models.MorphoWithdrawCollateralRequestChain.BASE, sender=\"0x81d310Eb515E05EB26322e2DeDE9e75b754885A4\", estimate_gas=True)\n\n # Handle response\n print(res)"},{"lang":"typescript","label":"Typescript (SDK)","source":"import { CompassApiSDK } from \"@compass-labs/api-sdk\";\n\nconst compassApiSDK = new CompassApiSDK({\n apiKeyAuth: \"\u003cYOUR_API_KEY_HERE>\",\n});\n\nasync function run() {\n const result = await compassApiSDK.morpho.morphoWithdrawCollateral({\n amount: 0.5,\n uniqueMarketKey: \"0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5\",\n chain: \"base\",\n sender: \"0x81d310Eb515E05EB26322e2DeDE9e75b754885A4\",\n });\n\n console.log(result);\n}\n\nrun();"}],"method":"post","type":"path","servers":["ee380481-ad5f-49b2-8b30-bd32fd1eec74"],"security":["70fdf724-c75e-4fe1-a206-d18c8410221f"],"path":"/v1/morpho/withdraw_collateral","baseUrlOptions":["https://api.compasslabs.ai"],"title":"Withdraw Collateral from Market","codeSamples":[{"label":"Python (SDK)","lang":"python","source":"from compass_api_sdk import CompassAPI, models\n\n\nwith CompassAPI(\n api_key_auth=\"\u003cYOUR_API_KEY_HERE>\",\n) as compass_api:\n\n res = compass_api.morpho.morpho_withdraw_collateral(amount=0.5, unique_market_key=\"0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5\", chain=models.MorphoWithdrawCollateralRequestChain.BASE, sender=\"0x81d310Eb515E05EB26322e2DeDE9e75b754885A4\", estimate_gas=True)\n\n # Handle response\n print(res)"},{"label":"Typescript (SDK)","lang":"typescript","source":"import { CompassApiSDK } from \"@compass-labs/api-sdk\";\n\nconst compassApiSDK = new CompassApiSDK({\n apiKeyAuth: \"\u003cYOUR_API_KEY_HERE>\",\n});\n\nasync function run() {\n const result = await compassApiSDK.morpho.morphoWithdrawCollateral({\n amount: 0.5,\n uniqueMarketKey: \"0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5\",\n chain: \"base\",\n sender: \"0x81d310Eb515E05EB26322e2DeDE9e75b754885A4\",\n });\n\n console.log(result);\n}\n\nrun();"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"oneOf":[{"type":"number","title":"Amount","description":"Amount of the token to supply to the market as collateral.","default":0.5,"minimum":0,"example":1.5,"exclusiveMinimum":true,"isRequired":true,"uniqueKey":"amount.oneOf.0","typeLabel":"number"},{"type":"string","title":"Amount","description":"Amount of the token to supply to the market as collateral.","default":0.5,"pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","example":1.5,"isRequired":true,"uniqueKey":"amount.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"amount","typeLabel":"number | string"},"unique_market_key":{"type":"string","pattern":"^0x.*","title":"Unique Market Key","description":"The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.","examples":["0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4"],"default":"0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5","isRequired":true,"uniqueKey":"unique_market_key","typeLabel":"string"},"chain":{"type":"string","enum":["arbitrum","base","ethereum"],"title":"Chain","default":"base","examples":["base"],"isRequired":true,"uniqueKey":"chain","typeLabel":"enum\u003cstring>"},"sender":{"type":"string","title":"Sender","description":"The address of the transaction sender.","examples":["0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"],"default":"0x81d310Eb515E05EB26322e2DeDE9e75b754885A4","isRequired":true,"uniqueKey":"sender","typeLabel":"string"},"action_type":{"type":"string","const":"MORPHO_WITHDRAW_COLLATERAL","title":"Action Type","default":"MORPHO_WITHDRAW_COLLATERAL","uniqueKey":"action_type","typeLabel":"string"},"on_behalf_of":{"oneOf":[{"type":"string","title":"On Behalf Of","description":"The address on behalf of whom the withdraw is made. Defaults to sender.","uniqueKey":"on_behalf_of.oneOf.0","typeLabel":"string"},{"type":"null","title":"On Behalf Of","description":"The address on behalf of whom the withdraw is made. Defaults to sender.","uniqueKey":"on_behalf_of.oneOf.1","typeLabel":"null"}],"uniqueKey":"on_behalf_of","typeLabel":"string | null"},"receiver":{"oneOf":[{"type":"string","title":"Receiver","description":"The address where the withdrawn collateral will be received. Defaults to sender.","uniqueKey":"receiver.oneOf.0","typeLabel":"string"},{"type":"null","title":"Receiver","description":"The address where the withdrawn collateral will be received. Defaults to sender.","uniqueKey":"receiver.oneOf.1","typeLabel":"null"}],"uniqueKey":"receiver","typeLabel":"string | null"},"estimate_gas":{"type":"boolean","title":"Estimate Gas","description":"Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.","default":true,"uniqueKey":"estimate_gas","typeLabel":"boolean"}},"type":"object","required":["amount","unique_market_key","chain","sender"],"title":"MorphoWithdrawCollateralRequest","default":{"chain":"base","sender":"0x81d310Eb515E05EB26322e2DeDE9e75b754885A4","amount":0.5,"unique_market_key":"0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5"},"required_allowances":["MorphoMarket"],"uniqueKey":"","typeLabel":"MorphoWithdrawCollateralRequest · object"},"examples":{"Example":{"title":"Example","value":{"chain":"base","sender":"0x81d310Eb515E05EB26322e2DeDE9e75b754885A4","amount":0.5,"unique_market_key":"0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"3b0919ba-a0c7-4ed7-a303-5ca5718f943d":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"transaction":{"oneOf":[{"type":"object","title":"UnsignedTransaction","description":"The unsigned transaction data. User must sign and broadcast to network.","required":["chainId","data","from","gas","to","value","nonce","maxFeePerGas","maxPriorityFeePerGas"],"example":{"chainId":"0x2105","data":"0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000675f4a3d","from":"0x4A83b4413CF41C3244027e1590E35a0F48403F0c","gas":"0x7a120","maxFeePerGas":"0x59682f00","maxPriorityFeePerGas":"0x3b9aca00","nonce":"0x5","to":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","value":"0x0"},"properties":{"chainId":{"type":"string","title":"Chainid","description":"The chain id of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.chainId","typeLabel":"string"},"data":{"type":"string","title":"Data","description":"The data of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.data","typeLabel":"string"},"from":{"type":"string","title":"From","description":"The sender of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.from","typeLabel":"string"},"gas":{"oneOf":[{"type":"string","title":"Gas","description":"The gas of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.gas.oneOf.0","typeLabel":"string"},{"type":"null","title":"Gas","description":"The gas of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.gas.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"transaction.oneOf.0.gas","typeLabel":"string | null"},"to":{"type":"string","title":"To","description":"The recipient of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.to","typeLabel":"string"},"value":{"type":"string","title":"Value","description":"The value of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.value","typeLabel":"string"},"nonce":{"type":"string","title":"Nonce","description":"The nonce of the address","isRequired":true,"uniqueKey":"transaction.oneOf.0.nonce","typeLabel":"string"},"maxFeePerGas":{"type":"string","title":"Maxfeepergas","description":"The max fee per gas of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.maxFeePerGas","typeLabel":"string"},"maxPriorityFeePerGas":{"type":"string","title":"Maxpriorityfeepergas","description":"The max priority fee per gas of the transaction","isRequired":true,"uniqueKey":"transaction.oneOf.0.maxPriorityFeePerGas","typeLabel":"string"}},"isRequired":true,"uniqueKey":"transaction.oneOf.0","typeLabel":"UnsignedTransaction · object"},{"type":"object","title":"UserOperationResponse","description":"The unsigned transaction data. User must sign and broadcast to network.","required":["to","data","value"],"properties":{"to":{"type":"string","title":"To","description":"The target contract address for the operation","isRequired":true,"uniqueKey":"transaction.oneOf.1.to","typeLabel":"string"},"data":{"type":"string","title":"Data","description":"The calldata for the operation","isRequired":true,"uniqueKey":"transaction.oneOf.1.data","typeLabel":"string"},"value":{"type":"string","title":"Value","description":"The ETH value to send with the operation","isRequired":true,"uniqueKey":"transaction.oneOf.1.value","typeLabel":"string"}},"isRequired":true,"uniqueKey":"transaction.oneOf.1","typeLabel":"UserOperationResponse · object"}],"isRequired":true,"uniqueKey":"transaction","typeLabel":"UnsignedTransaction · object | UserOperationResponse · object"}},"type":"object","required":["transaction"],"title":"TransactionResponse","uniqueKey":"","typeLabel":"TransactionResponse · object"},"examples":{"Example":{"title":"Example","value":{"transaction":{"chainId":"0x2105","data":"0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000675f4a3d","from":"0x4A83b4413CF41C3244027e1590E35a0F48403F0c","gas":"0x7a120","maxFeePerGas":"0x59682f00","maxPriorityFeePerGas":"0x3b9aca00","nonce":"0x5","to":"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67","value":"0x0"}}}},"exampleType":"generated"}},"exampleType":"generated"},"2edde080-7a32-4ec8-b30b-07249e2aeb34":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"70fdf724-c75e-4fe1-a206-d18c8410221f":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Compass API Key. Get your key [here](https://www.compasslabs.ai/dashboard).","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"ee380481-ad5f-49b2-8b30-bd32fd1eec74":{"url":"https://api.compasslabs.ai","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Compass API Key. Get your key [here](https://www.compasslabs.ai/dashboard).","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"x-api-key","type":"string","description":"Your Compass API Key. Get your key [here](https://www.compasslabs.ai/dashboard).","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"x-api-key"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"v1/combined_spec.json"},"subdomain":"compasslabs-f07467e0","siteName":"Compass API Docs","title":"Withdraw Collateral from Market - Compass API Docs","navMaps":{"firstHrefInVersion":{"V2":{"href":"/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction","matchLevel":2},"V1":{"href":"/v1/api-reference/morpho/withdraw-collateral-from-market","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-11-05T13:11:31.434Z","originalFileLocation":"v1/api-reference/morpho/withdraw-collateral-from-market.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Withdraw collateral that has been supplied to a Morpho Market. A Morpho Market is a primitive lending pool that pairs one collateral asset with one loan asset. Each market is isolated (meaning risks are contained within each individual market), immutable (cannot be changed after deployment), and will persist as long as the blockchain it is deployed on is live. Required Allowances In order to make this transaction, token allowances need to be set for the following contracts. - MorphoMarket\">\u003cmeta data-mint-head name=\"application-name\" content=\"Compass API Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Withdraw Collateral from Market - Compass API Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Withdraw collateral that has been supplied to a Morpho Market. A Morpho Market is a primitive lending pool that pairs one collateral asset with one loan asset. Each market is isolated (meaning risks are contained within each individual market), immutable (cannot be changed after deployment), and will persist as long as the blockchain it is deployed on is live. Required Allowances In order to make this transaction, token allowances need to be set for the following contracts. - MorphoMarket\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Compass API Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://compasslabs-f07467e0.mintlify.site/_mintlify/api/og/v2?division=Morpho\u0026amp;title=Withdraw+Collateral+from+Market\u0026amp;description=Withdraw+collateral+that+has+been+supplied+to+a+Morpho+Market.%0A%0AA+Morpho+Market+is+a+primitive+lending+pool+that+pairs+one+collateral+asset+with+one%0Aloan+asset.\u0026amp;theme=3dbf73b4b3dd364abd493b9c\u0026amp;signature=ce9e509f5e754345a12b37d751862e721b27e15972b99c48f0b55c5fd71ddbce\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Withdraw Collateral from Market - Compass API Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Withdraw collateral that has been supplied to a Morpho Market. A Morpho Market is a primitive lending pool that pairs one collateral asset with one loan asset. Each market is isolated (meaning risks are contained within each individual market), immutable (cannot be changed after deployment), and will persist as long as the blockchain it is deployed on is live. Required Allowances In order to make this transaction, token allowances need to be set for the following contracts. - MorphoMarket\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://compasslabs-f07467e0.mintlify.site/_mintlify/api/og/v2?division=Morpho\u0026amp;title=Withdraw+Collateral+from+Market\u0026amp;description=Withdraw+collateral+that+has+been+supplied+to+a+Morpho+Market.%0A%0AA+Morpho+Market+is+a+primitive+lending+pool+that+pairs+one+collateral+asset+with+one%0Aloan+asset.\u0026amp;theme=3dbf73b4b3dd364abd493b9c\u0026amp;signature=ce9e509f5e754345a12b37d751862e721b27e15972b99c48f0b55c5fd71ddbce\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/compasslabs-f07467e0/CejAEahS9T_GZmf_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Compass API Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0284c7\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/v1/api-reference/morpho/withdraw-collateral-from-market.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.compasslabs.ai/#organization\",\"name\":\"Compass API Docs\",\"url\":\"https://docs.compasslabs.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/compasslabs-f07467e0/x2NrFgZ7soJbH6sc/logo/light.svg?fit=max\u0026auto=format\u0026n=x2NrFgZ7soJbH6sc\u0026q=85\u0026s=80a04b06674000990914306c6a833cb9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.compasslabs.ai#website\",\"name\":\"Compass API Docs\",\"url\":\"https://docs.compasslabs.ai\",\"publisher\":{\"@id\":\"https://docs.compasslabs.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market#webpage\",\"url\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market\",\"name\":\"Withdraw Collateral from Market\",\"description\":\"Withdraw collateral that has been supplied to a Morpho Market. A Morpho Market is a primitive lending pool that pairs one collateral asset with one loan asset. Each market is isolated (meaning risks are contained within each individual market), immutable (cannot be changed after deployment), and will persist as long as the blockchain it is deployed on is live. Required Allowances In order to make this transaction, token allowances need to be set for the following contracts. - MorphoMarket\",\"dateModified\":\"2026-11-05T13:11:31.434Z\",\"isPartOf\":{\"@id\":\"https://docs.compasslabs.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.compasslabs.ai/v1/api-reference/aave-v3/aave-supported-tokens\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Morpho\",\"item\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/get-vaults\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Withdraw Collateral from Market\",\"item\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market#apireference\",\"headline\":\"Withdraw Collateral from Market\",\"name\":\"Withdraw Collateral from Market\",\"description\":\"Withdraw collateral that has been supplied to a Morpho Market. A Morpho Market is a primitive lending pool that pairs one collateral asset with one loan asset. Each market is isolated (meaning risks are contained within each individual market), immutable (cannot be changed after deployment), and will persist as long as the blockchain it is deployed on is live. Required Allowances In order to make this transaction, token allowances need to be set for the following contracts. - MorphoMarket\",\"url\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market\",\"mainEntityOfPage\":{\"@id\":\"https://docs.compasslabs.ai/v1/api-reference/morpho/withdraw-collateral-from-market#webpage\"},\"dateModified\":\"2026-11-05T13:11:31.434Z\",\"publisher\":{\"@id\":\"https://docs.compasslabs.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.compasslabs.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Compass API Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Compass API Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/v1/api-reference/morpho/withdraw-collateral-from-market.md","siteName":"Compass API Docs","nav":{"global":{"tabs":[],"anchors":[]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/v2/get_started/overview"}]},{"tab":"API Reference","versions":[{"version":"V2","pages":[{"title":"V2","href":"/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction"}]},{"version":"V1","groups":[{"group":"Get Started","pages":[{"title":"Overview","href":"/v1/get_started/overview"},{"title":"Quick Start Guide","href":"/v1/get_started/get-started"}]},{"group":"Transaction Bundler","pages":[{"title":"Overview","href":"/v1/transaction-bundler/introduction"},{"title":"Quick Start Guide","href":"/v1/transaction-bundler/quick_start"},{"title":"Leverage on Aave with Transaction Bundler ","href":"/v1/transaction-bundler/aave_looping"},{"title":"Gas Savings with Transaction Bundler ","href":"/v1/transaction-bundler/bundler_gas_savings"},{"title":"Embed Fees with Transaction Bundler ","href":"/v1/transaction-bundler/embed_a_fee_in_bundle"},{"title":"Add Earn to your app","href":"/v1/transaction-bundler/wallet_integration"}]},{"group":"Basic Examples","pages":[{"title":"Morpho: deposit into a vault","href":"/v1/examples/morpho_deposit"},{"title":"Pendle: Trade fixed \u0026 variable yield","href":"/v1/examples/pendle"}]},{"group":"Compass AI","pages":[{"title":"Overview","href":"/v1/compass-ai/compass-ai"}]},{"group":"Support","pages":[{"title":"FAQ","href":"/v1/support/FAQ"},{"title":"Partnerships","href":"/v1/support/partnerships"},{"title":"Changelog","href":"/v1/support/changelog"},{"title":"Terms \u0026 Conditions","href":"/v1/support/terms-and-conditions"},{"title":"Privacy Policy ","href":"/v1/support/privacy-policy"}]},{"group":"API Reference","pages":[{"group":"Aave V3","pages":[{"title":"Aave Supported Tokens","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/aave_supported_tokens","href":"/v1/api-reference/aave-v3/aave-supported-tokens"},{"title":"Interest Rates","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/rate","href":"/v1/api-reference/aave-v3/interest-rates"},{"title":"Interest Rates: Time Average","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/avg_rate","href":"/v1/api-reference/aave-v3/interest-rates:-time-average"},{"title":"Interest Rates: Standard Deviation","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/std_rate","href":"/v1/api-reference/aave-v3/interest-rates:-standard-deviation"},{"title":"Reserve Overview","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/reserve_overview","href":"/v1/api-reference/aave-v3/reserve-overview"},{"title":"Token Prices","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/token_price","href":"/v1/api-reference/aave-v3/token-prices"},{"title":"Liquidity Index","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/liquidity/change","href":"/v1/api-reference/aave-v3/liquidity-index"},{"title":"Positions - Total","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/user_position_summary","href":"/v1/api-reference/aave-v3/positions--total"},{"title":"Positions - per Token","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/user_position_per_token","href":"/v1/api-reference/aave-v3/positions--per-token"},{"title":"Historical Transactions","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aave/historical_transactions","href":"/v1/api-reference/aave-v3/historical-transactions"},{"title":"Supply/Lend","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aave/supply","href":"/v1/api-reference/aave-v3/supplylend"},{"title":"Borrow","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aave/borrow","href":"/v1/api-reference/aave-v3/borrow"},{"title":"Repay Loans","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aave/repay","href":"/v1/api-reference/aave-v3/repay-loans"},{"title":"Unstake","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aave/withdraw","href":"/v1/api-reference/aave-v3/unstake"},{"title":"Set User eMode","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aave/set_user_emode","href":"/v1/api-reference/aave-v3/set-user-emode"}]},{"group":"Aerodrome Slipstream","pages":[{"title":"List LP Positions","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aerodrome_slipstream/liquidity_provision/positions","href":"/v1/api-reference/aerodrome-slipstream/list-lp-positions"},{"title":"Pool Price","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/aerodrome_slipstream/pool_price","href":"/v1/api-reference/aerodrome-slipstream/pool-price"},{"title":"Swap - from Specified Amount","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aerodrome_slipstream/swap/sell_exactly","href":"/v1/api-reference/aerodrome-slipstream/swap--from-specified-amount"},{"title":"Swap - into Specified Amount","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aerodrome_slipstream/swap/buy_exactly","href":"/v1/api-reference/aerodrome-slipstream/swap--into-specified-amount"},{"title":"Open a New LP Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aerodrome_slipstream/liquidity_provision/mint","href":"/v1/api-reference/aerodrome-slipstream/open-a-new-lp-position"},{"title":"Increase an LP Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aerodrome_slipstream/liquidity_provision/increase","href":"/v1/api-reference/aerodrome-slipstream/increase-an-lp-position"},{"title":"Withdraw an LP Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/aerodrome_slipstream/liquidity_provision/withdraw","href":"/v1/api-reference/aerodrome-slipstream/withdraw-an-lp-position"}]},{"group":"Morpho","pages":[{"title":"Get Vaults","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/morpho/vaults","href":"/v1/api-reference/morpho/get-vaults"},{"title":"Get Vault \u0026 User Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/morpho/vault","href":"/v1/api-reference/morpho/get-vault-\u0026-user-position"},{"title":"Get Markets","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/morpho/markets","href":"/v1/api-reference/morpho/get-markets"},{"title":"Get Market","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/morpho/market","href":"/v1/api-reference/morpho/get-market"},{"title":"Check Market Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/morpho/market_position","href":"/v1/api-reference/morpho/check-market-position"},{"title":"Check User Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/morpho/user_position","href":"/v1/api-reference/morpho/check-user-position"},{"title":"Deposit to Vault","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/deposit","href":"/v1/api-reference/morpho/deposit-to-vault"},{"title":"Withdraw from Vault","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/withdraw","href":"/v1/api-reference/morpho/withdraw-from-vault"},{"title":"Supply Collateral to Market","description":"Supply collateral to a Morpho Market in order to borrow against it.\n\nA Morpho Market is a primitive lending pool that pairs one collateral asset with one\nloan asset. Each market is isolated (meaning risks are contained within each\nindividual market), immutable (cannot be changed after deployment), and will persist\nas long as the blockchain it is deployed on is live.\n \u003cInfo>\n **Required Allowances**\n\n In order to make this transaction, token allowances need to be set for the following contracts.\n\n - `MorphoMarket`\n \u003c/Info>\n ","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/supply_collateral","href":"/v1/api-reference/morpho/supply-collateral-to-market"},{"title":"Withdraw Collateral from Market","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/withdraw_collateral","href":"/v1/api-reference/morpho/withdraw-collateral-from-market"},{"title":"Borrow from Market","description":"Borrow tokens from a Morpho Market against supplied collateral.\n\nThe position could be liquidated when a borrower's Loan-To-Value (LTV) exceeds the\nLiquidation Loan-To-Value (LLTV) threshold of the market.\n\nA Morpho Market is a primitive lending pool that pairs one collateral asset with one\nloan asset. Each market is isolated (meaning risks are contained within each\nindividual market), immutable (cannot be changed after deployment), and will persist\nas long as the blockchain it is deployed on is live.\n \u003cInfo>\n **Required Allowances**\n\n In order to make this transaction, token allowances need to be set for the following contracts.\n\n - `MorphoMarket`\n \u003c/Info>\n ","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/borrow","href":"/v1/api-reference/morpho/borrow-from-market"},{"title":"Repay to Market","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/morpho/repay","href":"/v1/api-reference/morpho/repay-to-market"}]},{"group":"Sky","pages":[{"title":"Check USDS Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/sky/position","href":"/v1/api-reference/sky/check-usds-position"},{"title":"Buy USDS","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/sky/buy","href":"/v1/api-reference/sky/buy-usds"},{"title":"Sell USDS","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/sky/sell","href":"/v1/api-reference/sky/sell-usds"},{"title":"Deposit USDS","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/sky/deposit","href":"/v1/api-reference/sky/deposit-usds"},{"title":"Withdraw USDS","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/sky/withdraw","href":"/v1/api-reference/sky/withdraw-usds"}]},{"group":"Token","pages":[{"title":"Token Price","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/token/price","href":"/v1/api-reference/token/token-price"},{"title":"Token Balance","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/token/balance","href":"/v1/api-reference/token/token-balance"},{"title":"List known tokens","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/token/list","href":"/v1/api-reference/token/list-known-tokens"},{"title":"Transfer Tokens","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/token/transfer","href":"/v1/api-reference/token/transfer-tokens"},{"title":"Wrap ETH","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/token/wrap_eth","href":"/v1/api-reference/token/wrap-eth"},{"title":"Unwrap WETH","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/token/unwrap_weth","href":"/v1/api-reference/token/unwrap-weth"}]},{"group":"Uniswap V3","pages":[{"title":"Get Quote - to Specified Amount","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/uniswap/quote/buy_exactly","href":"/v1/api-reference/uniswap-v3/get-quote--to-specified-amount"},{"title":"Get quote - From Specified Amount","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/uniswap/quote/sell_exactly","href":"/v1/api-reference/uniswap-v3/get-quote--from-specified-amount"},{"title":"Pool Price","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/uniswap/pool_price","href":"/v1/api-reference/uniswap-v3/pool-price"},{"title":"Check if LP is Active.","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/uniswap/liquidity_provision/in_range","href":"/v1/api-reference/uniswap-v3/check-if-lp-is-active"},{"title":"List LP","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/uniswap/liquidity_provision/positions","href":"/v1/api-reference/uniswap-v3/list-lp"},{"title":"Buy exact amount","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/uniswap/swap/buy_exactly","href":"/v1/api-reference/uniswap-v3/buy-exact-amount"},{"title":"Sell exact amount","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/uniswap/swap/sell_exactly","href":"/v1/api-reference/uniswap-v3/sell-exact-amount"},{"title":"Open a new LP position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/uniswap/liquidity_provision/mint","href":"/v1/api-reference/uniswap-v3/open-a-new-lp-position"},{"title":"Increase an LP position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/uniswap/liquidity_provision/increase","href":"/v1/api-reference/uniswap-v3/increase-an-lp-position"},{"title":"Withdraw an LP position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/uniswap/liquidity_provision/withdraw","href":"/v1/api-reference/uniswap-v3/withdraw-an-lp-position"}]},{"group":"Universal","pages":[{"title":"List User Portfolio","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/generic/portfolio","href":"/v1/api-reference/universal/list-user-portfolio"},{"title":"List Supported Chains","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/generic/supported_chains","href":"/v1/api-reference/universal/list-supported-chains"},{"title":"Get Allowance","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/generic/allowance","href":"/v1/api-reference/universal/get-allowance"},{"title":"Resolve ENS","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/generic/ens","href":"/v1/api-reference/universal/resolve-ens"},{"title":"Set Allowance","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/generic/allowance/set","href":"/v1/api-reference/universal/set-allowance"}]},{"group":"Pendle","pages":[{"title":"Get Market \u0026 User Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/pendle/market","href":"/v1/api-reference/pendle/get-market-\u0026-user-position"},{"title":"List User's Market Positions","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/pendle/positions","href":"/v1/api-reference/pendle/list-users-market-positions"},{"title":"List Market Data","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/pendle/markets","href":"/v1/api-reference/pendle/list-market-data"},{"title":"Trade Principal Token (PT)","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/pendle/pt","href":"/v1/api-reference/pendle/trade-principal-token-pt"},{"title":"Trade Yield Token (YT)","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/pendle/yt","href":"/v1/api-reference/pendle/trade-yield-token-yt"},{"title":"Manage Liquidity (LP)","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/pendle/liquidity","href":"/v1/api-reference/pendle/manage-liquidity-lp"},{"title":"Redeem Claimable Yield","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/pendle/redeem_yield","href":"/v1/api-reference/pendle/redeem-claimable-yield"}]},{"group":"Swap","pages":[{"title":"Odos Swap","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/swap/odos","href":"/v1/api-reference/swap/odos-swap"}]},{"group":"Transaction Bundler","pages":[{"title":"Enable Transaction Bundling","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/transaction_bundler/authorization","href":"/v1/api-reference/transaction-bundler/enable-transaction-bundling"},{"title":"Construct Bundled Transaction","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/transaction_bundler/execute","href":"/v1/api-reference/transaction-bundler/construct-bundled-transaction"},{"title":"AAVE Leverage Long/Short","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/transaction_bundler/aave/loop","href":"/v1/api-reference/transaction-bundler/aave-leverage-longshort"}]},{"group":"Smart Account","pages":[{"title":"Get Smart Account Batched User Operations","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/smart_account/batched_user_operations","href":"/v1/api-reference/smart-account/get-smart-account-batched-user-operations"}]},{"group":"ERC-4626 Vaults","pages":[{"title":"Get Vault \u0026 User Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/vaults/vault","href":"/v1/api-reference/erc-4626-vaults/get-vault-\u0026-user-position"},{"title":"Deposit to Vault","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/vaults/deposit","href":"/v1/api-reference/erc-4626-vaults/deposit-to-vault"},{"title":"Withdraw from Vault","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/vaults/withdraw","href":"/v1/api-reference/erc-4626-vaults/withdraw-from-vault"}]},{"group":"Ethena","pages":[{"title":"Get Vault \u0026 User Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/ethena/vault","href":"/v1/api-reference/ethena/get-vault-\u0026-user-position"},{"title":"Deposit USDe","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/ethena/deposit","href":"/v1/api-reference/ethena/deposit-usde"},{"title":"Request to Withdraw USDe","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/ethena/request","href":"/v1/api-reference/ethena/request-to-withdraw-usde"},{"title":"Unstake USDe","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json post /v1/ethena/unstake","href":"/v1/api-reference/ethena/unstake-usde"}]},{"group":"Wildcat","pages":[{"title":"Get Market \u0026 User Position","deprecated":null,"version":null,"openapi":"/v1/combined_spec.json get /v1/wildcat/market","href":"/v1/api-reference/wildcat/get-market-\u0026-user-position"}]}]}]}]}]},"basePath":"","title":"Withdraw Collateral from Market - Compass API Docs","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DdEMm2kG.js","utils-BMo572L7.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C-4m9KAx.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DPLK2Oq9.js","snippetPresets-BKjfJMC9.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-DTsgtCEj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C8vmhyQM.js","shallow-r9w8LQGS.js","getApiPlaygroundDisplay-DjPI64HQ.js","CodeSnippet-C8Bvhl16.js","CodeSnippets-BtWUwcMy.js","Page-BIYvYBgk.js","getPastedJson-Dcm_3Pgl.js","icon-BXwrTpjc.js","MethodPill-CcjfVmmy.js","DuplicateIcon-BuKIbXAQ.js","createIcon-DaL9yXsO.js","DynamicMarkdown-Co5nikxh.js","SectionHeading-P4UNTsMZ.js","axios-vUo_bRtp.js","Markdown-CEfymfIH.js","clsx-Dq9TQuNi.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-D2J8knkn.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BgZ2ThuU.js"]}