Skip to main content
POST
Opens an overcollateralized loan. The borrower pledges ERC-3643 security tokens and receives the market’s borrow asset. How the collateral is secured depends on the market’s mode: FREEZE locks the tokens in the borrower’s own wallet, CUSTODY escrows them in the adapter. The maximum borrow is the collateral value multiplied by the market’s collateral factor. Quote it first with Get Max Borrow.

Path Parameters

string
required
Market ID.

Body Parameters

string
required
Security tokens to pledge, as a decimal string. Parsed at the collateral token’s decimals.
string
required
Amount to borrow, as a decimal string. Parsed at the borrow asset’s decimals. Must be at least the market’s minBorrowAmount.
string
required
Wallet that will sign the loan and hold the collateral. Required when building calldata. Every collateral, identity and supply-cap check runs against this address, and there is no loan to resolve it from yet. Omitting it returns BORROWER_ADDRESS_REQUIRED. Not needed on the confirm call, where the borrower is taken from the mined transaction.
object
EIP-712 signed price from Sign Price, applied atomically with the loan. Omit to price against the stored oracle value, which must not be stale.
string
Hash of the transaction you broadcast for this operation. Send it to confirm the transaction and record the result. Omit it to receive the calldata.

Transaction Shape by Mode

When txHash is omitted the response is always SIGN_TRANSACTIONS with a mode field, and the step count depends on the market. CUSTODY returns two steps: approve on the collateral token for the adapter, then openLoan. Broadcast in order. FREEZE returns one step: openLoan. No approval exists because the tokens never leave the borrower’s wallet. Both shapes carry confirmStepIndex and confirmWith: "openLoan", naming the step whose hash confirms the loan.

Response Fields

Confirming returns 201.
object
Loans cannot be opened until the market has a lender of record and its collateral adapter is authorized on the token. A market still seeking a lender of record is refused on that ground first, with MARKET_PENDING_CURATOR. The token-side authorizations are that party’s to arrange, so naming them as the obstacle would send the borrower to the wrong place. Once the role is taken, an unauthorized adapter rejects with COLLATERAL_ADAPTER_NOT_AUTHORIZED or FREEZE_MODE_UNSUPPORTED_TOKEN. See Get Setup Steps.
Minimum and maximum borrow are checked when the calldata is built, not when you confirm. Broadcasting an out-of-range amount reverts on-chain rather than returning BELOW_MIN_BORROW or EXCEEDS_MAX_BORROW. The maximum borrow check is also skipped whenever a signedPrice is supplied, since the contract will price against the signature rather than the stored value.

Error Codes

The calldata call runs the same checks the contract would, in the same order. A refusal therefore names the condition the borrower would otherwise have hit on-chain. Confirming with txHash can also return any transaction verification error.