moolah_withdraw_collateral
Withdraw collateral from a Moolah market. Use 'max' for full withdrawal only if no active borrows; otherwise specify amount and check health factor.
Instructions
Withdraw collateral from a Moolah market. Use amount='max' to withdraw all collateral (only allowed when no active borrows). Withdrawing too much while borrowing will revert — check health factor first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"marketId": "<marketId>",
"amount": "<amount>"
},
"name": "moolah_withdraw_collateral"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of collateral to withdraw, or 'max' for all (requires no active borrows) | |
| network | No | Network. Default: mainnet | |
| marketId | Yes | Market ID (bytes32 hex) |