Skip to main content
POST
Returns the EIP-2612 permit the borrower signs to repay a loan through Repay Loan in a single transaction. A wallet cannot read the figures the permit has to carry, so the quote supplies all of them. That is the value, the token’s current nonce for the borrower, a bounded deadline and the token’s EIP-712 domain. The permit names the market as spender. The quote exists only where the settlement asset provably implements EIP-2612, and only the loan’s borrower can use it. A third party repaying someone else’s loan uses the approve-then-repay steps on Repay Loan. Signing the permit moves nothing by itself: the repayment transaction redeems it.

Path Parameters

string
required
Market ID.

Body Parameters

integer
required
On-chain loan ID. A positive integer. Accepted as a JSON number or as a numeric string.
string
Amount to repay, as a positive decimal string in borrow asset units. The permit is quoted over exactly this amount. Required unless all is true.
boolean
Quote a full repayment. The value is the live debt plus a 20 basis point accrual buffer, plus the repayment fee on that figure.
integer
How long the permit stays valid, in seconds from now. An integer from 60 to 86400. Defaults to 1800.

Sign and repay

1

Quote

Request the quote with the loan and either amount or all: true.
2

Sign

Sign typedData from the wallet named in signer, which is the loan’s borrower, and split the signature into v, r and s.
3

Build the repayment

Call Repay Loan with the fields in repay, plus a permit holding permit.value, permit.deadline, v, r and s.
4

Broadcast and confirm

Send the returned steps from the borrower’s wallet, then confirm with the hash of the step at confirmStepIndex.
A partial quote is exact: the repayment must carry the same amount. A full-repayment quote covers the debt at quote time plus the buffer, and interest keeps accruing. If the live debt plus the fee has outgrown the value by the time Repay Loan is called, it refuses with INVALID_PERMIT. If the growth only eats into the buffer, the repayment builds with a warning. The repay call also checks the signature against the borrower’s current nonce. If another permit from the borrower is redeemed on the token in between, the nonce moves and the repay call refuses this signature with INVALID_PERMIT. Request a fresh quote.

Domain resolution

A token does not expose its EIP-712 domain as a readable struct, so the API rebuilds it from name() and version(). It tries the token’s own version() first, then 1 and 2, and accepts a candidate only when it reproduces the token’s DOMAIN_SEPARATOR. The wallet therefore signs a digest the token will recover. When no candidate matches, the call returns PERMIT_DOMAIN_UNRESOLVED. Sign with tooling that knows the token’s domain, or use the approve-then-repay steps.

Response Fields

object

Error Codes