Setup
Get Configuration Status
Check whether a market is ready to accept loans, and what is still outstanding
GET
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
configuration-status
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/configuration-status" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/configuration-status`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
for (const [key, step] of Object.entries(data.configurationCalldata)) {
if (step.heldByThisInstance === true) console.log(`Sign ${key} yourself`, step);
else console.log(`Send ${key} to ${step.requiredAuthority}`);
}
{
"success": true,
"data": {
"liquidationContract": "0x067A3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"insuranceFund": "0x8F1A4c2e9b7d3056a1E8C4f29D0b7a3e5c619c22",
"adapter": "0x4D2b9E71c3a05F8D6e2b41c7a9F03D58E6b177aE",
"liquidationConfigured": true,
"insuranceFundConfigured": true,
"adapterConfigured": true,
"routerAuthorized": true,
"fullyConfigured": true,
"collateralAuthStatus": {
"mode": "FREEZE",
"adapterAuthorized": true,
"interfaceSupported": true,
"requirement": "adapter_must_hold_agent_role"
},
"auctionVenue": null,
"auctionVenueAdmitted": null,
"auctionVenueAdmissionRequirement": null,
"routerHolderAuthorized": true,
"oracleSignerAuthorized": true,
"liquidatorRoleGranted": true,
"relayerAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"pendingCurator": false,
"pendingCuratorMessage": null,
"waitingForCurator": [],
"configurationCalldata": {},
"blockedSteps": {},
"liquidationRouterAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf"
}
}
{
"success": true,
"data": {
"liquidationContract": "0x067A3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"insuranceFund": "0x8F1A4c2e9b7d3056a1E8C4f29D0b7a3e5c619c22",
"adapter": "0x4D2b9E71c3a05F8D6e2b41c7a9F03D58E6b177aE",
"liquidationConfigured": true,
"insuranceFundConfigured": true,
"adapterConfigured": true,
"routerAuthorized": true,
"fullyConfigured": false,
"collateralAuthStatus": {
"mode": "FREEZE",
"adapterAuthorized": false,
"interfaceSupported": true,
"requirement": "adapter_must_hold_agent_role"
},
"auctionVenue": null,
"auctionVenueAdmitted": null,
"auctionVenueAdmissionRequirement": null,
"routerHolderAuthorized": false,
"oracleSignerAuthorized": true,
"liquidatorRoleGranted": true,
"relayerAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"pendingCurator": false,
"pendingCuratorMessage": null,
"waitingForCurator": [],
"configurationCalldata": {
"grantAgentRoleToAdapter": {
"to": "0x9f8c1d4b2e7a3056c1b8f4d29e0a7c3518b6d24f",
"data": "0x84e79842000000000000000000000000...",
"description": "Grant agent role to freeze adapter 0x4d2b...77ae on the security token (requires token agent admin)",
"requiredAuthority": "the collateral token's agent admin",
"heldByThisInstance": false,
"note": "Only the collateral token's agent admin can sign this. No wallet registered for this instance holds it, so this step belongs to another party on this market.",
"value": "0",
"chainId": 11155111
}
},
"blockedSteps": {
"verifyRouterAsHolder": {
"code": "IDENTITY_REGISTRY_WRITE_REJECTED",
"message": "The identity registry at 0x2f6a0c9e41d7b3a58e0c2f4a6d8b1e3c5a7f9d10 did not accept this registration from 0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93: it reverted without returning a reason. Registrations here are executed by the registry's own agent..."
}
},
"liquidationRouterAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf"
}
}
Returns a single readiness verdict, the individual checks behind it, and ready-to-sign calldata for every outstanding step. Each step names the authority that must sign it and says whether a wallet of your instance holds that authority. Poll this after deployment and after each authorization step until
The key is the
fullyConfigured is true.
Readiness spans three parties. Contract wiring is set up by the factory at deployment and rarely needs attention. The market admin and the oracle owner exist only once a lender of record has taken the market. Token-side authorization depends on parties outside Trusset: the collateral token’s agent administrator, its compliance administrator and its identity registry operator. That layer is the one that usually blocks a new market.
Path Parameters
string
required
Response Fields
object
Show child attributes
Show child attributes
boolean
The single flag to gate a market on. It is
true only when every check holds. The market has a lender of record, and its router and insurance fund are wired with the router accepting the market. The adapter is authorized on the collateral token and the router is an eligible holder of it. The instance’s wallet can sign oracle prices and holds LIQUIDATOR_ROLE.string
Liquidation router the market is wired to.
string
Insurance fund the market is wired to.
string
Collateral adapter the market is wired to.
boolean
A router address is set on the market.
boolean
An insurance fund address is set on the market.
boolean
An adapter address is set on the market.
boolean
The router accepts liquidations originating from this market. When
false, request the transaction from Configure Market with action authorizeOnRouter.boolean
Present and
true when a wiring read failed. Hold your last verified answer rather than treating the zeros as fact.boolean
The router is an eligible holder of the collateral token under its compliance rules. Without this, a liquidation cannot transfer seized collateral.
null when the token or its registry could not be read.object
Adapter authorization detail.
null when the market has no collateral token recorded.Show child attributes
Show child attributes
string
FREEZE or CUSTODY.boolean
Whether the adapter can act on the collateral token.
null when that could not be read.string
What is needed. See the table below.
boolean
FREEZE only. false means the token cannot support freeze mode at all.string
CUSTODY only. token_authorized_contract, identity_registry, token_transfer_rules (an ERC-7943 token whose canReceive admits the adapter, or an ERC-1404 token whose detectTransferRestriction answers 0 for the adapter) or unrestricted_token, or null. With none_required it is token_transfer_rules or unrestricted_token, and the warning below applies to unrestricted_token only.string
CUSTODY only. Present with authorizedVia token_transfer_rules and with token_refuses_holder: the transfer rule the token was asked through. erc7943 (canReceive), erc1404 (detectTransferRestriction), or transfer_rules when the token’s standard could not be read but its own transfer check answered.string
Present with
token_not_freeze_compatible and token_refuses_holder: the sentence that explains the block.string
CUSTODY only. The token’s identity registry, when it has one.string
Present with
none_required. With unrestricted_token it says what that does not cover. With token_transfer_rules it names the token’s rule that admits the adapter.string
The market’s auction venue, lowercased, or
null when none is wired.boolean
Whether the auction venue may hold the collateral token.
false when it must be allow-listed or verified and is not yet. null when there is no venue or its status is unknown.string
The venue’s
requirement, in the same vocabulary as the adapter’s, or null.boolean
The instance’s wallet may sign prices on the market’s oracle, or owns it. On an
ORACLE market it is true once a wallet is registered, because that oracle reads an external feed and takes no signatures. The same holds on a FIXED market, whose oracle accepts no signed price.boolean
The instance’s wallet holds
LIQUIDATOR_ROLE on the market, which liquidation and expired-auction settlement require.string
The instance’s registered wallet: the primary one, or the oldest verified wallet when no primary is set.
null when none is registered. The oracle signer and liquidator checks are evaluated against this address.boolean
The market has no lender of record yet, so the market admin and the oracle owner are unheld.
fullyConfigured can never be true while this is set. See Lender of record.string
Explanation accompanying
pendingCurator, naming the steps not offered yet. null when the role has been taken.string
This market’s liquidation router, resolved from the chain.
array
Keys of the outstanding steps that assign a role nobody holds yet, so they cannot be offered until a lender of record takes the market. Token-side steps are never in this list: those are the collateral token’s authorities to sign and do not wait for anyone.
object
Ready-to-sign calldata for every step that can be offered now, keyed by step name. Empty when nothing is outstanding.
Show child attributes
Show child attributes
string
Contract to send the transaction to.
string
Encoded calldata.
string
Always
"0".integer
The chain your instance resolves to.
string
What the transaction does and which role it needs.
string
Who must sign it, for example
the market administrator (DEFAULT_ADMIN_ROLE) or the collateral token's agent admin.boolean
Whether one of your instance’s verified wallets holds that authority.
null when it could not be established, which is not the same as false.string
Set when
heldByThisInstance is false: the step belongs to another party on this market. Otherwise null.object
Steps that cannot be built at all, keyed by step name, each with a
code and a message saying why. A step here is not waiting on a signature: something about the token, its registry or the signing wallet prevents a transaction that would work.Step Keys
| Key | Offered when | Signed by |
|---|---|---|
setInsuranceFund | No insurance fund is set on the market | The market admin |
grantAgentRoleToAdapter | FREEZE: the adapter lacks the agent role | The collateral token’s agent administrator |
authorizeAdapterOnToken | CUSTODY: the token gates holders through its own contract allow-list | The collateral token’s compliance administrator |
verifyAdapterAsHolder | CUSTODY: the token gates holders through an identity registry | An agent of that registry |
authorizeRouterOnToken | The router must be allow-listed on the token | The collateral token’s compliance administrator |
verifyRouterAsHolder | The router must be registered on the token’s identity registry | An agent of that registry |
authorizeVenueOnToken | An auction venue is wired and must be allow-listed on the token | The collateral token’s compliance administrator |
verifyVenueAsHolder | An auction venue is wired and must be registered on the token’s identity registry | An agent of that registry |
authorizeRelayerOnOracle | The instance’s wallet cannot sign prices on the oracle | The oracle owner |
grantLiquidatorRole | The instance’s wallet lacks LIQUIDATOR_ROLE | The market admin |
action to name on Configure Market and Confirm Configuration.
Requirement Values
requirement | Meaning | Resolved by |
|---|---|---|
adapter_must_hold_agent_role | FREEZE mode. The adapter needs the agent role on the collateral token | The token’s agent administrator |
token_not_freeze_compatible | The token does not implement the freeze interface, or it is an ERC-7943 token, so FREEZE mode is impossible. Redeploy in CUSTODY mode | Not resolvable |
token_refuses_holder | The token is ERC-7943 and its canReceive check refuses the adapter, or it is ERC-1404 and detectTransferRestriction returns a restriction code for the adapter as both sender and receiver (the reason quotes the code and the token’s message). Only the token issuer can admit it under the token’s own rules. standard names the rule | Token issuer |
adapter_must_be_verified_holder | CUSTODY mode. The adapter must be a verified holder on the token’s identity registry | The token’s identity registry operator |
adapter_must_be_authorized_contract | CUSTODY mode. The adapter must be allow-listed on the collateral token itself | The token’s compliance administrator |
none_required with authorizedVia unrestricted_token | The token exposes no identity registry, no contract allow-list and no transfer rule the platform reads, so there is nothing to authorize on it | Nobody. Verify out of band, see the warning below |
none_required with authorizedVia token_transfer_rules | The token has no identity registry and no contract allow-list, and its own transfer rule was asked and admits the adapter: canReceive on an ERC-7943 token, detectTransferRestriction on an ERC-1404 token. standard names the rule | Nobody |
holder_status_unreadable | The token or its registry could not be read, so authorization is unknown | Retry |
adapter_not_deployed | No adapter address is recorded on the market | Contact Trusset |
unknown | The check could not complete, usually an RPC failure | Retry |
Blocked Step Codes
code | Meaning |
|---|---|
IDENTITY_REGISTRY_UNRECOGNISED | The registry answers neither the Trusset registry interface nor the ERC-3643 reference interface. The token issuer has to authorize the subject on it directly |
IDENTITY_REGISTRY_WRITE_REJECTED | Replayed from your instance’s wallet, the registration reverts. The registry’s own agent, usually the token issuer’s KYC operator, must send it |
ONCHAINID_REQUIRED | The ERC-3643 registry admits a holder only through an ONCHAINID, and the subject has none. The token issuer’s KYC operator issues it. Then pass identityAddress to Configure Market |
IDENTITY_CLAIMS_REQUIRED | The subject is registered, but its ONCHAINID carries no valid claim for a required topic from a trusted issuer |
IDENTITY_ALREADY_REGISTERED | The subject already holds a valid ONCHAINID on the registry. Refresh to pick up the registry’s answer |
CLAIM_TOPICS_UNREADABLE | The ERC-3643 registry did not return the claim topics it requires |
With
none_required and authorizedVia unrestricted_token, the adapter and the router both report as authorized, because nothing the platform can read gates who holds the token. That is not proof of eligibility. If the token restricts transfers through a surface this platform cannot read, only its issuer can admit the adapter and the router, and a liquidation would fail until it does. Verify out of band before letting borrowers in. With authorizedVia token_transfer_rules, the token’s own rule was asked and admits the adapter, so this warning does not apply.This endpoint tells you what is unfinished and who signs it. Get Setup Steps returns the same state as an ordered checklist that starts with the lender-of-record step. Configure Market returns one step’s calldata on request.
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/configuration-status" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/configuration-status`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
for (const [key, step] of Object.entries(data.configurationCalldata)) {
if (step.heldByThisInstance === true) console.log(`Sign ${key} yourself`, step);
else console.log(`Send ${key} to ${step.requiredAuthority}`);
}
{
"success": true,
"data": {
"liquidationContract": "0x067A3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"insuranceFund": "0x8F1A4c2e9b7d3056a1E8C4f29D0b7a3e5c619c22",
"adapter": "0x4D2b9E71c3a05F8D6e2b41c7a9F03D58E6b177aE",
"liquidationConfigured": true,
"insuranceFundConfigured": true,
"adapterConfigured": true,
"routerAuthorized": true,
"fullyConfigured": true,
"collateralAuthStatus": {
"mode": "FREEZE",
"adapterAuthorized": true,
"interfaceSupported": true,
"requirement": "adapter_must_hold_agent_role"
},
"auctionVenue": null,
"auctionVenueAdmitted": null,
"auctionVenueAdmissionRequirement": null,
"routerHolderAuthorized": true,
"oracleSignerAuthorized": true,
"liquidatorRoleGranted": true,
"relayerAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"pendingCurator": false,
"pendingCuratorMessage": null,
"waitingForCurator": [],
"configurationCalldata": {},
"blockedSteps": {},
"liquidationRouterAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf"
}
}
{
"success": true,
"data": {
"liquidationContract": "0x067A3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"insuranceFund": "0x8F1A4c2e9b7d3056a1E8C4f29D0b7a3e5c619c22",
"adapter": "0x4D2b9E71c3a05F8D6e2b41c7a9F03D58E6b177aE",
"liquidationConfigured": true,
"insuranceFundConfigured": true,
"adapterConfigured": true,
"routerAuthorized": true,
"fullyConfigured": false,
"collateralAuthStatus": {
"mode": "FREEZE",
"adapterAuthorized": false,
"interfaceSupported": true,
"requirement": "adapter_must_hold_agent_role"
},
"auctionVenue": null,
"auctionVenueAdmitted": null,
"auctionVenueAdmissionRequirement": null,
"routerHolderAuthorized": false,
"oracleSignerAuthorized": true,
"liquidatorRoleGranted": true,
"relayerAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"pendingCurator": false,
"pendingCuratorMessage": null,
"waitingForCurator": [],
"configurationCalldata": {
"grantAgentRoleToAdapter": {
"to": "0x9f8c1d4b2e7a3056c1b8f4d29e0a7c3518b6d24f",
"data": "0x84e79842000000000000000000000000...",
"description": "Grant agent role to freeze adapter 0x4d2b...77ae on the security token (requires token agent admin)",
"requiredAuthority": "the collateral token's agent admin",
"heldByThisInstance": false,
"note": "Only the collateral token's agent admin can sign this. No wallet registered for this instance holds it, so this step belongs to another party on this market.",
"value": "0",
"chainId": 11155111
}
},
"blockedSteps": {
"verifyRouterAsHolder": {
"code": "IDENTITY_REGISTRY_WRITE_REJECTED",
"message": "The identity registry at 0x2f6a0c9e41d7b3a58e0c2f4a6d8b1e3c5a7f9d10 did not accept this registration from 0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93: it reverted without returning a reason. Registrations here are executed by the registry's own agent..."
}
},
"liquidationRouterAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
NO_MARKET_ADDRESS | 400 | The market has no on-chain address recorded |
MISSING_MARKET_ID | 400 | marketId is longer than 100 characters |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
ROUTER_UNRESOLVED | 503 | The record carries no router address and the market’s router could not be read. Retry |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/configuration-status" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/configuration-status`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
for (const [key, step] of Object.entries(data.configurationCalldata)) {
if (step.heldByThisInstance === true) console.log(`Sign ${key} yourself`, step);
else console.log(`Send ${key} to ${step.requiredAuthority}`);
}
{
"success": true,
"data": {
"liquidationContract": "0x067A3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"insuranceFund": "0x8F1A4c2e9b7d3056a1E8C4f29D0b7a3e5c619c22",
"adapter": "0x4D2b9E71c3a05F8D6e2b41c7a9F03D58E6b177aE",
"liquidationConfigured": true,
"insuranceFundConfigured": true,
"adapterConfigured": true,
"routerAuthorized": true,
"fullyConfigured": true,
"collateralAuthStatus": {
"mode": "FREEZE",
"adapterAuthorized": true,
"interfaceSupported": true,
"requirement": "adapter_must_hold_agent_role"
},
"auctionVenue": null,
"auctionVenueAdmitted": null,
"auctionVenueAdmissionRequirement": null,
"routerHolderAuthorized": true,
"oracleSignerAuthorized": true,
"liquidatorRoleGranted": true,
"relayerAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"pendingCurator": false,
"pendingCuratorMessage": null,
"waitingForCurator": [],
"configurationCalldata": {},
"blockedSteps": {},
"liquidationRouterAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf"
}
}
{
"success": true,
"data": {
"liquidationContract": "0x067A3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"insuranceFund": "0x8F1A4c2e9b7d3056a1E8C4f29D0b7a3e5c619c22",
"adapter": "0x4D2b9E71c3a05F8D6e2b41c7a9F03D58E6b177aE",
"liquidationConfigured": true,
"insuranceFundConfigured": true,
"adapterConfigured": true,
"routerAuthorized": true,
"fullyConfigured": false,
"collateralAuthStatus": {
"mode": "FREEZE",
"adapterAuthorized": false,
"interfaceSupported": true,
"requirement": "adapter_must_hold_agent_role"
},
"auctionVenue": null,
"auctionVenueAdmitted": null,
"auctionVenueAdmissionRequirement": null,
"routerHolderAuthorized": false,
"oracleSignerAuthorized": true,
"liquidatorRoleGranted": true,
"relayerAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"pendingCurator": false,
"pendingCuratorMessage": null,
"waitingForCurator": [],
"configurationCalldata": {
"grantAgentRoleToAdapter": {
"to": "0x9f8c1d4b2e7a3056c1b8f4d29e0a7c3518b6d24f",
"data": "0x84e79842000000000000000000000000...",
"description": "Grant agent role to freeze adapter 0x4d2b...77ae on the security token (requires token agent admin)",
"requiredAuthority": "the collateral token's agent admin",
"heldByThisInstance": false,
"note": "Only the collateral token's agent admin can sign this. No wallet registered for this instance holds it, so this step belongs to another party on this market.",
"value": "0",
"chainId": 11155111
}
},
"blockedSteps": {
"verifyRouterAsHolder": {
"code": "IDENTITY_REGISTRY_WRITE_REJECTED",
"message": "The identity registry at 0x2f6a0c9e41d7b3a58e0c2f4a6d8b1e3c5a7f9d10 did not accept this registration from 0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93: it reverted without returning a reason. Registrations here are executed by the registry's own agent..."
}
},
"liquidationRouterAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf"
}
}
