Standing Policies
Create Standing Policy
Record how this institution takes markets of one deployer or one collateral token
POST
/
lending-external-securities-v2
/
api
/
markets
/
standing-policies
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"kind": "DEPLOYER",
"address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "ACME Industrial AG",
"termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
"acceptanceTerms": {
"admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"realizationMode": "ISSUER_REDEMPTION",
"liquidityCommitment": "250000",
"maxFixedRateBps": 1200
}
}'
const res = await fetch(
'https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
kind: 'DEPLOYER',
address: '0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52',
label: 'ACME Industrial AG',
termsTemplateId: 'cmwh2t9e10002l80d7s3k5m8c',
acceptanceTerms: {
admin: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
issuer: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
realizationMode: 'ISSUER_REDEMPTION',
liquidityCommitment: '250000',
maxFixedRateBps: 1200
}
})
}
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
const policyId = data.policy.id;
{
"success": true,
"data": {
"policy": {
"id": "cmwh3p7k20004l80dq2x9v1ab",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t",
"kind": "DEPLOYER",
"address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "ACME Industrial AG",
"termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
"acceptanceTerms": {
"admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"realizationMode": "ISSUER_REDEMPTION",
"liquidityCommitment": "250000",
"maxFixedRateBps": 1200
},
"enabled": true,
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"updatedBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-15T09:20:11.000Z",
"updatedAt": "2026-11-15T09:20:11.000Z"
}
},
"error": null,
"metadata": {
"timestamp": "2026-11-15T09:20:11.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
{
"success": false,
"data": null,
"error": {
"code": "STANDING_POLICY_EXISTS",
"message": "A standing policy for this deployer already exists on this instance; edit it instead"
},
"metadata": {
"timestamp": "2026-11-15T09:21:40.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440001",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": [
{ "field": "acceptanceTerms", "message": "Unrecognized key(s) in object: 'assetDataHash'" }
]
},
"metadata": {
"timestamp": "2026-11-15T09:22:05.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440002",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
Creates a standing policy for one deployer wallet or one collateral token and answers
Only an account Trusset approved as a lender of record can write policies. Any other account is refused with
The queue reflects a write at once: List Queued Markets is read fresh on the next call.
201. This is a database write: nothing is signed and nothing goes on chain. What a policy does, and what it never does, is set out on List Standing Policies.
A policy never takes a role. Every market it matches is still adopted with one transaction signed by the lender’s own wallet through Accept Lender Role.
403 CURATOR_NOT_APPROVED before the body is read. An instance holds one policy per kind and address: a second one is refused with 409 STANDING_POLICY_EXISTS, so change the existing one with Update Standing Policy.
Body Parameters
DEPLOYER to match markets deployed by address, or COLLATERAL_TOKEN to match markets whose collateral token is address. When a market matches an enabled policy of each kind, the DEPLOYER policy wins.The deployer wallet or collateral token,
0x followed by 40 hex characters, not the zero address. Matched exactly and stored lowercased.Your name for the policy, at most 120 characters. Trimmed, and a blank label is stored as
null.A template of this instance’s terms library, 1 to 100 characters. Confirm Lender Role publishes it as the terms of use of a market adopted under the policy while the market has none. An archived template is refused with
409 TEMPLATE_ARCHIVED. Omit it or send null to bind none.The loan agreement policy a market adopted under this policy starts with:
{ mode, validityDays?, autoIssue?, autoIssueMaxAmount?, frameworkValidityDays?, requestAccess? }, with mode OFF, OPTIONAL or REQUIRED, validityDays 1 to 365 (default 30), autoIssue (default false), autoIssueMaxAmount a decimal borrow amount or null, frameworkValidityDays 7 to 1830 or null, and requestAccess ANY (default) or BANK_ONLY. Any other key is refused. A mode other than OFF needs the Scale plan (402 AGREEMENT_FEATURE_REQUIRED). It applies only to markets adopted after it is saved, and never over a market’s own policy. The response adds agreementPolicySetAt.The adoption values the issuer app pre-fills for a matching market. Every key is optional. Any key not listed here is refused with
400 VALIDATION_ERROR. Leave a key out to leave it unset: null or an empty string as a value is refused with 400 VALIDATION_ERROR. An empty object is stored as null.Show child attributes
Show child attributes
Address, not the zero address. The
admin party of Accept Lender Role.EXCHANGE_SALE, ISSUER_REDEMPTION or AUCTION. It is pre-filled only where the market’s price source offers it: EXCHANGE_SALE only on a MARKET-priced market, AUCTION only on a market priced any other way.false creates the policy switched off. A switched-off policy matches no market.Response Fields
Show child attributes
Show child attributes
The policy as written, with the fields of a row on List Standing Policies except
template.curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"kind": "DEPLOYER",
"address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "ACME Industrial AG",
"termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
"acceptanceTerms": {
"admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"realizationMode": "ISSUER_REDEMPTION",
"liquidityCommitment": "250000",
"maxFixedRateBps": 1200
}
}'
const res = await fetch(
'https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
kind: 'DEPLOYER',
address: '0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52',
label: 'ACME Industrial AG',
termsTemplateId: 'cmwh2t9e10002l80d7s3k5m8c',
acceptanceTerms: {
admin: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
issuer: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
realizationMode: 'ISSUER_REDEMPTION',
liquidityCommitment: '250000',
maxFixedRateBps: 1200
}
})
}
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
const policyId = data.policy.id;
{
"success": true,
"data": {
"policy": {
"id": "cmwh3p7k20004l80dq2x9v1ab",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t",
"kind": "DEPLOYER",
"address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "ACME Industrial AG",
"termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
"acceptanceTerms": {
"admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"realizationMode": "ISSUER_REDEMPTION",
"liquidityCommitment": "250000",
"maxFixedRateBps": 1200
},
"enabled": true,
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"updatedBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-15T09:20:11.000Z",
"updatedAt": "2026-11-15T09:20:11.000Z"
}
},
"error": null,
"metadata": {
"timestamp": "2026-11-15T09:20:11.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
{
"success": false,
"data": null,
"error": {
"code": "STANDING_POLICY_EXISTS",
"message": "A standing policy for this deployer already exists on this instance; edit it instead"
},
"metadata": {
"timestamp": "2026-11-15T09:21:40.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440001",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": [
{ "field": "acceptanceTerms", "message": "Unrecognized key(s) in object: 'assetDataHash'" }
]
},
"metadata": {
"timestamp": "2026-11-15T09:22:05.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440002",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | A field breaks its type, format or length rule, or acceptanceTerms carries a key not listed above |
INVALID_STANDING_POLICY | 400 | address or an address in acceptanceTerms is the zero address |
STANDING_POLICY_SAVE_FAILED | 400 | The policy could not be saved for a reason that carries no code of its own |
CURATOR_NOT_APPROVED | 403 | Trusset has not approved this account to act as a lender of record |
TEMPLATE_NOT_FOUND | 404 | termsTemplateId names no template of this instance |
STANDING_POLICY_EXISTS | 409 | This instance already holds a policy of this kind for this address. Update that one instead |
TEMPLATE_ARCHIVED | 409 | termsTemplateId names an archived template |
RATE_LIMIT_EXCEEDED | 429 | More than 10 writes in the minute |
⌘I
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"kind": "DEPLOYER",
"address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "ACME Industrial AG",
"termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
"acceptanceTerms": {
"admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"realizationMode": "ISSUER_REDEMPTION",
"liquidityCommitment": "250000",
"maxFixedRateBps": 1200
}
}'
const res = await fetch(
'https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
kind: 'DEPLOYER',
address: '0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52',
label: 'ACME Industrial AG',
termsTemplateId: 'cmwh2t9e10002l80d7s3k5m8c',
acceptanceTerms: {
admin: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
issuer: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
realizationMode: 'ISSUER_REDEMPTION',
liquidityCommitment: '250000',
maxFixedRateBps: 1200
}
})
}
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
const policyId = data.policy.id;
{
"success": true,
"data": {
"policy": {
"id": "cmwh3p7k20004l80dq2x9v1ab",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t",
"kind": "DEPLOYER",
"address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "ACME Industrial AG",
"termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
"acceptanceTerms": {
"admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"realizationMode": "ISSUER_REDEMPTION",
"liquidityCommitment": "250000",
"maxFixedRateBps": 1200
},
"enabled": true,
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"updatedBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-15T09:20:11.000Z",
"updatedAt": "2026-11-15T09:20:11.000Z"
}
},
"error": null,
"metadata": {
"timestamp": "2026-11-15T09:20:11.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
{
"success": false,
"data": null,
"error": {
"code": "STANDING_POLICY_EXISTS",
"message": "A standing policy for this deployer already exists on this instance; edit it instead"
},
"metadata": {
"timestamp": "2026-11-15T09:21:40.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440001",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": [
{ "field": "acceptanceTerms", "message": "Unrecognized key(s) in object: 'assetDataHash'" }
]
},
"metadata": {
"timestamp": "2026-11-15T09:22:05.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440002",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
