moolah_borrow
Supply collateral to Moolah markets, borrow against existing collateral, or do both in sequential transactions. Collateral must cover borrow amount to avoid revert.
Instructions
Flexible Moolah borrow entry point. Provide collateralAmount only → supply collateral without borrowing. Provide borrowAmount only → borrow against existing collateral. Provide both → supply collateral then borrow in two sequential transactions. Collateral must cover the borrow at the market's LLTV or the borrow tx reverts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Network. Default: mainnet | |
| marketId | Yes | Market ID (bytes32 hex) — from get_moolah_markets | |
| borrowAmount | No | Loan token amount to borrow (e.g. '500' USDT). Omit to skip. | |
| collateralAmount | No | Collateral to supply first (e.g. '10000' TRX). Omit to skip. |