lend_borrow
Borrow against deposited collateral (non-custodial).
Returns an UNSIGNED base64 tx + current health factor (pre-borrow estimate). amount in base units of borrow_token. Deposit collateral first. Past the daily free tier an x402 payment_header is required. The borrowed token is authenticity-verified first; set allow_unverified=true to borrow an unverified token at your own risk.
idempotency_key (optional): a client-generated UUID.
Retrying with the same key + same args replays the original result instead
of re-borrowing. Reuse the SAME key across the build call and its
signed_transaction completion call -- see lend_deposit;
the two legs dedupe independently, so this never raises
IDEMPOTENCY_CONFLICT.
signed_transaction / verify (two-phase execution):
see lend_deposit -- re-call with the signed tx and Crank broadcasts it,
confirms it on-chain, and re-reads the borrowed balance + obligation health.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | ||
| market | No | ||
| verify | No | ||
| protocol | Yes | ||
| caller_id | No | ||
| borrow_token | Yes | ||
| pay_in_crank | No | ||
| payment_header | No | ||
| wallet_address | Yes | ||
| idempotency_key | No | ||
| allow_unverified | No | ||
| collateral_token | Yes | ||
| marginfi_account | No | ||
| signed_transaction | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||