moolah_withdraw_collateral
Withdraw collateral from a Moolah market. Use 'max' to remove all collateral only when no active borrows; ensure health factor is sufficient to avoid revert.
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.
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) |