Prepare a loan
build_borrowReturns the unsigned transactions to open a loan: an approval (only if needed) then openLoan. Includes the quote and warnings. The user's wallet must sign and send each step in order.
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": {
"asset": "<asset>",
"collateral_amount": "<collateral_amount>",
"term": "<term>",
"borrower": "<borrower>"
},
"name": "build_borrow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | Loan term: short, medium or long (or 0/1/2). Durations and costs come from get_protocol_info. | |
| asset | Yes | Token contract address on Base (preferred) or its symbol, e.g. WETH, VIRTUAL, esALB | |
| borrower | Yes | Wallet that will sign; used to skip unneeded approvals and check balances | |
| loan_amount_usdc | No | ||
| collateral_amount | Yes | ||
| max_shortfall_bps | No | Max gap between requested and funded amount in basis points. Omit for the protocol default. |