Rates and Loan Terms
Set Max Fixed Rate
Tighten the ceiling on any fixed rate the model owner can set
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
max-fixed-rate
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/max-fixed-rate" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "maxFixedRateBps": 1200 }'
const url = `https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/max-fixed-rate`;
const headers = { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' };
const build = await fetch(url, {
method: 'POST',
headers,
body: JSON.stringify({ maxFixedRateBps: 1200 })
});
const { data: calldata } = await build.json();
const tx = await ownerWallet.sendTransaction({
to: calldata.to,
data: calldata.data,
value: calldata.value,
chainId: calldata.chainId
});
await tx.wait();
await fetch(url, { method: 'POST', headers, body: JSON.stringify({ txHash: tx.hash }) });
{
"success": true,
"data": {
"action": "SIGN_TRANSACTION",
"transaction": {
"to": "0x3b25752c1459c5cf1b0bfcfdf0d56883c8047423",
"data": "0x..."
},
"to": "0x3b25752c1459c5cf1b0bfcfdf0d56883c8047423",
"data": "0x...",
"functionName": "setMaxFixedRate",
"requiredRole": "INTEREST_MODEL_OWNER",
"description": "Tighten the fixed-rate ceiling to 1200 bps (requires interest model owner; downward only)",
"requiredSigner": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"heldByThisInstance": false,
"signerAddress": null,
"note": "Only the interest model owner (0x5ad87a0621175206b72d10e4b8577b192e7f40ab) can sign this transaction, and no wallet registered on this instance is that owner: signed from any other wallet it reverts OwnableUnauthorizedAccount. Hand the calldata to the owner, or take the model over first.",
"confirmWith": {
"endpoint": "POST /lending-external-securities-v2/api/markets/clx_secmarket_001/max-fixed-rate",
"field": "txHash"
},
"chainId": 11155111,
"value": "0"
}
}
{
"success": false,
"error": {
"code": "MAX_FIXED_RATE_ONLY_DECREASES",
"message": "The maxFixedRate ceiling moves downward only: it is 1500 bps now, recorded at adoption so no later operator can loosen what the terms bound."
}
}
Builds the
Confirming with
setMaxFixedRate transaction that lowers the ceiling on the fixed rate a market can stamp. It targets the market’s interest model, and only the model owner can sign it, the same wallet that signs Set Rate Mode.
The ceiling moves down only. The lender of record can record it in its adoption terms, and from then on no owner can loosen what those terms bound. A market with no ceiling yet takes a first one here, and once recorded it can never be cleared.
The ceiling bounds the rates the owner can set, not the loans. Opening a loan never consults it, so loans already stamped keep their rate whatever the ceiling becomes.
Path Parameters
string
required
Body Parameters
integer
required
The new ceiling in basis points. Integer, 1 to 50000. Refused when it exceeds the ceiling already recorded, and while the mode is
FIXED when it falls below the rate new loans are being stamped with.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.Tighten Below the Current Stamp
While the market runsFIXED, the ceiling cannot drop below the rate new loans are stamped with, because it would advertise a bound every new loan breaks. Lower the stamp first with Set Rate Mode, then tighten the ceiling to at most the new stamp.
Confirm the Change
Send the mined hash back to this path as{ "txHash": "0x..." }. The API checks that the transaction called setMaxFixedRate on the market’s interest model. 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
Show child attributes
Show child attributes
string
SIGN_TRANSACTION. Returned when txHash is omitted.object
{ to, data } for the setMaxFixedRate call on the interest model. Returned when txHash is omitted.string
The interest model address. Returned when
txHash is omitted.string
The encoded
setMaxFixedRate call. Returned when txHash is omitted.string
Always
"0". Returned when txHash is omitted.integer
The chain your instance resolves to. Returned when
txHash is omitted.string
setMaxFixedRate, or the verified function when confirming.string
INTEREST_MODEL_OWNER. Returned when txHash is omitted.string
Plain-language summary of the change. Returned when
txHash is omitted.string
The model owner, the one wallet that can sign.
null when the owner could not be read. Returned when txHash is omitted.boolean
true when the owner is a verified wallet of your instance, false when it is not, null when the owner could not be read. The build is never refused on it. Returned when txHash is omitted.string
The owner, when your instance holds it. Otherwise
null. Returned when txHash is omitted.string
Says the owner could not be read, or what to do when your instance cannot sign: hand the calldata to the owner, because any other wallet reverts
OwnableUnauthorizedAccount. null when your instance holds the owner wallet. Returned when txHash is omitted.object
{ endpoint, field }: the call that confirms this transaction, and the body field that carries the hash. Returned when txHash is omitted.string
Transaction hash. Returned when confirming.
string
The wallet that sent the transaction. Returned when confirming.
integer
Block the transaction was mined in. Returned when confirming.
object
The market’s rate and term offering, read back from the chain after the transaction, with
maxFixedRate among its fields. The same object Set Rate Mode returns. Returned when confirming.array
Names of the stored market fields this confirmation changed. Returned when confirming.
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/max-fixed-rate" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "maxFixedRateBps": 1200 }'
const url = `https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/max-fixed-rate`;
const headers = { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' };
const build = await fetch(url, {
method: 'POST',
headers,
body: JSON.stringify({ maxFixedRateBps: 1200 })
});
const { data: calldata } = await build.json();
const tx = await ownerWallet.sendTransaction({
to: calldata.to,
data: calldata.data,
value: calldata.value,
chainId: calldata.chainId
});
await tx.wait();
await fetch(url, { method: 'POST', headers, body: JSON.stringify({ txHash: tx.hash }) });
{
"success": true,
"data": {
"action": "SIGN_TRANSACTION",
"transaction": {
"to": "0x3b25752c1459c5cf1b0bfcfdf0d56883c8047423",
"data": "0x..."
},
"to": "0x3b25752c1459c5cf1b0bfcfdf0d56883c8047423",
"data": "0x...",
"functionName": "setMaxFixedRate",
"requiredRole": "INTEREST_MODEL_OWNER",
"description": "Tighten the fixed-rate ceiling to 1200 bps (requires interest model owner; downward only)",
"requiredSigner": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"heldByThisInstance": false,
"signerAddress": null,
"note": "Only the interest model owner (0x5ad87a0621175206b72d10e4b8577b192e7f40ab) can sign this transaction, and no wallet registered on this instance is that owner: signed from any other wallet it reverts OwnableUnauthorizedAccount. Hand the calldata to the owner, or take the model over first.",
"confirmWith": {
"endpoint": "POST /lending-external-securities-v2/api/markets/clx_secmarket_001/max-fixed-rate",
"field": "txHash"
},
"chainId": 11155111,
"value": "0"
}
}
{
"success": false,
"error": {
"code": "MAX_FIXED_RATE_ONLY_DECREASES",
"message": "The maxFixedRate ceiling moves downward only: it is 1500 bps now, recorded at adoption so no later operator can loosen what the terms bound."
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MISSING_MARKET_ID | 400 | The marketId path segment is longer than 100 characters |
VALIDATION_ERROR | 400 | maxFixedRateBps is missing or outside 1 to 50000, or txHash is malformed |
MAX_FIXED_RATE_ONLY_DECREASES | 400 | maxFixedRateBps is above the ceiling already recorded |
INVALID_CONFIRMATION | 400 | The market has no on-chain address, so there is nothing to confirm against |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
MAX_FIXED_RATE_BELOW_STAMP | 409 | The mode is FIXED and maxFixedRateBps is below the rate new loans are stamped with |
MARKET_PENDING_CURATOR | 409 | The market has no lender of record yet, so the market itself still owns the model and no wallet can sign. Skipped when confirming with txHash |
INTERNAL_ERROR | 500 | The chain could not be read while confirming. Retry shortly |
MODEL_UNRESOLVED | 503 | The market’s interest model address could not be resolved. Retry shortly |
txHash can also return any transaction verification error.⌘I
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/max-fixed-rate" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "maxFixedRateBps": 1200 }'
const url = `https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/max-fixed-rate`;
const headers = { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' };
const build = await fetch(url, {
method: 'POST',
headers,
body: JSON.stringify({ maxFixedRateBps: 1200 })
});
const { data: calldata } = await build.json();
const tx = await ownerWallet.sendTransaction({
to: calldata.to,
data: calldata.data,
value: calldata.value,
chainId: calldata.chainId
});
await tx.wait();
await fetch(url, { method: 'POST', headers, body: JSON.stringify({ txHash: tx.hash }) });
{
"success": true,
"data": {
"action": "SIGN_TRANSACTION",
"transaction": {
"to": "0x3b25752c1459c5cf1b0bfcfdf0d56883c8047423",
"data": "0x..."
},
"to": "0x3b25752c1459c5cf1b0bfcfdf0d56883c8047423",
"data": "0x...",
"functionName": "setMaxFixedRate",
"requiredRole": "INTEREST_MODEL_OWNER",
"description": "Tighten the fixed-rate ceiling to 1200 bps (requires interest model owner; downward only)",
"requiredSigner": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"heldByThisInstance": false,
"signerAddress": null,
"note": "Only the interest model owner (0x5ad87a0621175206b72d10e4b8577b192e7f40ab) can sign this transaction, and no wallet registered on this instance is that owner: signed from any other wallet it reverts OwnableUnauthorizedAccount. Hand the calldata to the owner, or take the model over first.",
"confirmWith": {
"endpoint": "POST /lending-external-securities-v2/api/markets/clx_secmarket_001/max-fixed-rate",
"field": "txHash"
},
"chainId": 11155111,
"value": "0"
}
}
{
"success": false,
"error": {
"code": "MAX_FIXED_RATE_ONLY_DECREASES",
"message": "The maxFixedRate ceiling moves downward only: it is 1500 bps now, recorded at adoption so no later operator can loosen what the terms bound."
}
}
