Rates and Loan Terms
Set Term Config
Set the maximum duration, terminal date, grace period and term penalty for new loans
POST
Builds the
setTermConfig transaction that sets the market’s loan terms. Requires ISSUER_ROLE on the market, held by the wallet the lender of record named at adoption. Before adoption only the deploying factory could call it, so the API refuses a market that has no lender of record yet.
Read the current terms first with Get Term Config. The market brings its interest accrual up to date before the new terms apply.
Which Loans a Change Reaches
A new maturity reaches new loans only, and nothing here moves an open loan’s maturity earlier. Whether the grace period and the penalty also stay with new loans depends on the market’s implementation, which the calldata response names astermStamping.
On PER_LOAN, the current implementation, each loan carries the grace period and term penalty it was signed under, so the whole change reaches new loans only. Loans signed before the market stamped terms still follow the live configuration, and openLoansFollowingConfig counts them. On MARKET_CONFIG, the earlier implementation, the grace period and the penalty are read at realization, so a change reaches every open termed loan.
When a change shortens the grace period or raises the penalty for loans that follow the live configuration, the response carries an OPEN_TERMED_LOANS_AFFECTED warning. Such a borrower can be realized sooner, or at a higher charge, than the terms in force when it borrowed.
Path Parameters
string
required
Market ID.
Body Parameters
integer
required
How long a new loan may run before it falls due. Integer number of days, 0 to 3650.
0 sets no duration, and with no terminalDueDate either it switches terms off for new loans.integer | string
A date every new loan falls due by, whatever its duration. A unix timestamp in seconds, or an ISO date. Must be in the future. With
maxLoanDurationDays at 0, every new loan matures on this date. Omitting it clears any terminal date the market has.integer
Days between a loan’s maturity and the moment it becomes realizable. Integer, 1 to 30. Omit it to keep the market’s current grace period, or 3 days on a market that has none yet. Refused when terms are being switched off.
integer
default:"0"
Charge on the whole claim when a loan is realized for its term, in basis points. The schema accepts 0 to 50000, but it cannot exceed the market’s liquidation penalty. A penalty above zero needs terms.
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. When
txHash is present, every other field is ignored.Switch Terms Off
SendmaxLoanDurationDays: 0 with no terminalDueDate, no grace period and no penalty. New loans then open without a maturity, and loans already open keep the maturity they were signed with.
Terms cannot be switched off while the interest model stamps a fixed rate, because the term clock is what pulls a fixed-rate loan toward repayment. Move the rate mode off FIXED with Set Rate Mode first.
A terminal date that has passed closes the market to new loans. Set a future terminal date, or a duration without one, to reopen it.
Confirm the Change
Send the mined hash back to this path as{ "txHash": "0x..." }. The API checks that the transaction called setTermConfig on the market. It then reads the offering back from the chain and updates the market record.
Response Fields
The calldata response carries the transaction twice.transaction holds to and data. The same to and data also sit directly on data, and that is where the chainId and value binding lands, so sign from those four fields.
object
Error Codes
Confirming with
txHash can also return any transaction verification error.