Rates and Loan Terms
Get Term Config
Read the market loan terms, which loans a change would reach, and the exit horizon
GET
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
term-config
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/term-config" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/term-config`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
if (data.appliesToOpenLoans.length > 0) {
console.warn(`A term change reaches open loans too: ${data.appliesToOpenLoans.join(', ')}`);
}
{
"success": true,
"data": {
"termStamping": "PER_LOAN",
"stampedOnNewLoansOnly": ["maxLoanDuration", "terminalDueDate", "termGracePeriod", "termPenalty"],
"appliesToOpenLoans": [],
"openLoansFollowingConfig": 0,
"termsEnabled": true,
"maxLoanDurationSeconds": "15552000",
"termGracePeriodSeconds": "259200",
"terminalDueDate": null,
"marketDueFloor": null,
"termPenaltyBps": 200,
"allowExtension": true,
"latestDueAt": "1789516800",
"bookEmpty": false,
"exitHorizon": {
"horizon": "1789776000",
"bounded": true,
"applies": true,
"basis": "OPEN_LOANS"
},
"closedToNewLoans": false,
"closedReason": null,
"termFloorExposure": {
"useDutchAuction": false,
"auctionMinPremiumBps": 9500,
"termPenaltyBps": 200,
"floorGapBps": 500,
"uncoveredBps": 0,
"exposed": false,
"sliceSizedToFloor": true,
"reserveCoversFloorSales": true,
"reserveFloorSaleNote": "The reserve is drawn first for a sale settled below the debt and only what it cannot pay lands on liquidity providers."
}
}
}
Reads the market’s loan terms live from the chain: the maximum duration, the terminal due date, the grace period, the term penalty and the extension switch. It also says which of those a change would reach on loans already open, and when the book could have turned liquid.
A termed loan falls due at its maturity. Once the grace period after it has run out, an unrepaid loan becomes realizable whatever its health. The whole claim is then realized at the term penalty, and collateral beyond what that needs returns to the borrower in the same transaction. Change the terms with Set Term Config.
Path Parameters
string
required
Market ID.
Response Fields
object
Show child attributes
Show child attributes
string
PER_LOAN when the market stamps the grace period and term penalty onto each loan at signing, so a change reaches new loans only. MARKET_CONFIG on the earlier implementation, which reads both from the market at realization, so a change reaches every open termed loan. UNKNOWN when the implementation could not be read.array
The term fields a change reaches on new loans only. The maturity fields are always here, and on
PER_LOAN so are the grace period and the penalty.array
The term fields a change also reaches on open loans:
termGracePeriod and termPenalty unless the market is PER_LOAN, where the array is empty.integer
On a
PER_LOAN market, open termed loans signed before the market stamped terms. They still follow the live configuration. Counted over at most 200 of the positions Trusset has recorded for the market. Present only on PER_LOAN markets, and only when the count could be made.boolean
true when the market sets a maximum duration, a terminal due date, or both.string
Longest a new loan may run, in seconds.
"0" when no duration is set.string
Time between maturity and realizability, in seconds.
string
Unix seconds by which every new loan falls due, whatever its duration.
null when none is set.string
Unix seconds below which no termed loan’s effective maturity falls, raised by a
FLOOR extension. null when none is set.integer
Charge on the whole claim when a loan is realized for its term, in basis points. Never above the liquidation penalty.
boolean
Whether the extension flow is switched on. See Set Allow Extension.
string
The latest maturity any loan on this market has carried, in unix seconds. It only ever rises, so it can outlive the loan that set it.
null when no loan has carried one.boolean
true when nothing is lent out. null when it could not be read.object
When the whole book can have turned liquid, absent new borrows.
Show child attributes
Show child attributes
string
Unix seconds: the latest maturity plus its grace.
null when no loan has carried a term.boolean
false when a loan without a term is outstanding. No horizon exists then: withdrawals depend on borrowers repaying.boolean
true when a bounded horizon exists and the book is not empty.string
OPEN_LOANS when the horizon was taken from the open loans’ own maturities, HIGH_WATER_MARK when it falls back to latestDueAt plus the longest grace. Present only when applies is true.boolean
true when the terminal due date has passed. The contract then refuses every new loan, while repayment, collateral release and liquidity withdrawal stay open.string
Why the market is closed to new loans and how the issuer reopens it.
null when it is open.object
Whether a term realization sold at the auction floor could leave the pool short.
null when the market configuration could not be read.Show child attributes
Show child attributes
boolean
true when terms and Dutch auctions are both on, the term penalty does not cover the gap to the auction floor, and the implementation does not size the seized collateral against the floor.integer
The part of that gap the term penalty leaves uncovered, in basis points of the claim.
0 when the market sizes the seized collateral against the floor.boolean
true on the implementation that sizes the seized collateral against the auction floor, where the exposure does not arise.integer
10000 minus auctionMinPremiumBps.integer
The auction floor, in basis points of the attested price.
integer
The term penalty.
boolean
Whether Dutch auctions are on.
boolean
true when the insurance fund is drawn first for a sale settled below the debt. false when the shortfall lands on liquidity providers, null when the implementation could not be read.string
That answer in one sentence.
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/term-config" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/term-config`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
if (data.appliesToOpenLoans.length > 0) {
console.warn(`A term change reaches open loans too: ${data.appliesToOpenLoans.join(', ')}`);
}
{
"success": true,
"data": {
"termStamping": "PER_LOAN",
"stampedOnNewLoansOnly": ["maxLoanDuration", "terminalDueDate", "termGracePeriod", "termPenalty"],
"appliesToOpenLoans": [],
"openLoansFollowingConfig": 0,
"termsEnabled": true,
"maxLoanDurationSeconds": "15552000",
"termGracePeriodSeconds": "259200",
"terminalDueDate": null,
"marketDueFloor": null,
"termPenaltyBps": 200,
"allowExtension": true,
"latestDueAt": "1789516800",
"bookEmpty": false,
"exitHorizon": {
"horizon": "1789776000",
"bounded": true,
"applies": true,
"basis": "OPEN_LOANS"
},
"closedToNewLoans": false,
"closedReason": null,
"termFloorExposure": {
"useDutchAuction": false,
"auctionMinPremiumBps": 9500,
"termPenaltyBps": 200,
"floorGapBps": 500,
"uncoveredBps": 0,
"exposed": false,
"sliceSizedToFloor": true,
"reserveCoversFloorSales": true,
"reserveFloorSaleNote": "The reserve is drawn first for a sale settled below the debt and only what it cannot pay lands on liquidity providers."
}
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MISSING_MARKET_ID | 400 | The marketId path segment is longer than 100 characters |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
INTERNAL_ERROR | 500 | The market’s term configuration could not be read. Retry shortly |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/term-config" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/term-config`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
if (data.appliesToOpenLoans.length > 0) {
console.warn(`A term change reaches open loans too: ${data.appliesToOpenLoans.join(', ')}`);
}
{
"success": true,
"data": {
"termStamping": "PER_LOAN",
"stampedOnNewLoansOnly": ["maxLoanDuration", "terminalDueDate", "termGracePeriod", "termPenalty"],
"appliesToOpenLoans": [],
"openLoansFollowingConfig": 0,
"termsEnabled": true,
"maxLoanDurationSeconds": "15552000",
"termGracePeriodSeconds": "259200",
"terminalDueDate": null,
"marketDueFloor": null,
"termPenaltyBps": 200,
"allowExtension": true,
"latestDueAt": "1789516800",
"bookEmpty": false,
"exitHorizon": {
"horizon": "1789776000",
"bounded": true,
"applies": true,
"basis": "OPEN_LOANS"
},
"closedToNewLoans": false,
"closedReason": null,
"termFloorExposure": {
"useDutchAuction": false,
"auctionMinPremiumBps": 9500,
"termPenaltyBps": 200,
"floorGapBps": 500,
"uncoveredBps": 0,
"exposed": false,
"sliceSizedToFloor": true,
"reserveCoversFloorSales": true,
"reserveFloorSaleNote": "The reserve is drawn first for a sale settled below the debt and only what it cannot pay lands on liquidity providers."
}
}
}
