Skip to main content
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.
Every call writes the whole term configuration. An omitted terminalDueDate clears the terminal date, and an omitted termPenaltyBps sets the term penalty to zero. Only an omitted termGracePeriodDays keeps the value the market already runs. Send every term you want to keep.

Which Loans a Change Reaches

A change reaches new loans only. Each loan is stamped at signing with its maturity, grace period and term penalty, so nothing here moves an open loan’s maturity earlier or changes the grace period and penalty it was signed under. The calldata response names this as termStamping: PER_LOAN.

Path Parameters

string
required
The market’s record ID, as id on List Markets, not its contract address. See Market IDs.

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

Send maxLoanDurationDays: 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.