> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Configuration Status

> Check whether a market is ready to accept loans

Returns a single readiness verdict plus the individual checks behind it. Poll this after deployment and after each authorization step until `fullyConfigured` is `true`.

Readiness spans two layers. Contract wiring is set up by the factory at deployment and rarely needs attention. Token-side authorization is the layer that blocks new markets, because it depends on parties outside Trusset: the collateral token's agent administrator and its identity registry operator.

## Path Parameters

<ParamField path="marketId" type="string" required>Market ID.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="fullyConfigured" type="boolean">
      The single flag to gate a market on. True only when all of the following hold: the market has a lender of record, contract wiring is complete, the adapter is authorized on the collateral token, the router is an eligible collateral recipient, the registered wallet can sign oracle prices, and it holds `LIQUIDATOR_ROLE`.
    </ResponseField>

    <ResponseField name="liquidationContract" type="string">Liquidation router the market is wired to.</ResponseField>
    <ResponseField name="insuranceFund" type="string">Insurance fund contract.</ResponseField>
    <ResponseField name="adapter" type="string">Collateral adapter contract.</ResponseField>
    <ResponseField name="liquidationConfigured" type="boolean">Router address is set on the market.</ResponseField>
    <ResponseField name="insuranceFundConfigured" type="boolean">Insurance fund address is set on the market.</ResponseField>
    <ResponseField name="adapterConfigured" type="boolean">Adapter address is set on the market.</ResponseField>
    <ResponseField name="routerAuthorized" type="boolean">The router accepts liquidations originating from this market.</ResponseField>
    <ResponseField name="routerHolderAuthorized" type="boolean">The router is an eligible recipient of the collateral token under its compliance rules. Without this, a liquidation cannot transfer seized collateral.</ResponseField>

    <ResponseField name="collateralAuthStatus" type="object">
      Adapter authorization detail. `null` when the market has no collateral token recorded.

      <Expandable>
        <ResponseField name="mode" type="string">`FREEZE` or `CUSTODY`.</ResponseField>
        <ResponseField name="adapterAuthorized" type="boolean">Whether the adapter can act on the collateral token.</ResponseField>
        <ResponseField name="requirement" type="string">What is needed. See the table below.</ResponseField>
        <ResponseField name="interfaceSupported" type="boolean">`FREEZE` only. False means the token cannot support freeze mode at all.</ResponseField>
        <ResponseField name="authorizedVia" type="string">`CUSTODY` only. `token_authorized_contract` or `identity_registry`, or null.</ResponseField>
        <ResponseField name="identityRegistry" type="string">`CUSTODY` only. Registry consulted, when one was resolvable.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="oracleSignerAuthorized" type="boolean">The registered wallet can push and sign prices for this market's oracle. The oracle owner is treated as authorized implicitly.</ResponseField>
    <ResponseField name="liquidatorRoleGranted" type="boolean">The registered wallet holds `LIQUIDATOR_ROLE` on the market, which liquidation and expired-auction settlement require.</ResponseField>
    <ResponseField name="relayerAddress" type="string">Registered wallet address, or null when none is configured. Every role check above is evaluated against this address.</ResponseField>
    <ResponseField name="pendingCurator" type="boolean">The market has no lender of record yet, so every configuration transaction would assign a role nobody holds. `fullyConfigured` can never be true while this is set. See [Lender of record](/endpoints/lending/introduction#lender-of-record).</ResponseField>
    <ResponseField name="liquidationRouterAddress" type="string">This market's liquidation router, resolved from the chain.</ResponseField>
    <ResponseField name="waitingForCurator" type="array">Names 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 register provider's to arrange and do not wait for anyone.</ResponseField>
    <ResponseField name="configurationCalldata" type="object">Ready-to-sign calldata for every step that can be offered now, keyed by step name. Each entry carries `to`, `data` and `description`. It also carries `requiredAuthority`, naming who must sign it, and `heldByThisInstance`, saying whether one of your verified wallets is that party. A `note` explains what to do when it is not.</ResponseField>
    <ResponseField name="blockedSteps" type="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 or the market prevents the transaction from existing.</ResponseField>
    <ResponseField name="pendingCuratorMessage" type="string">Explanation accompanying `pendingCurator`, or null when the role has been taken.</ResponseField>
  </Expandable>
</ResponseField>

## 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        |
| `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   |
| `token_not_freeze_compatible`           | The token does not implement the freeze interface. `FREEZE` mode is impossible. Redeploy in `CUSTODY` mode                          | Not resolvable                         |
| `collateral_authorization_unresolvable` | The token exposes neither an identity registry nor a contract allow-list, so the adapter can never be authorized to hold collateral | Not resolvable                         |
| `adapter_not_deployed`                  | No adapter address is recorded on the market                                                                                        | Contact Trusset                        |
| `unknown`                               | The check could not complete, usually an RPC failure                                                                                | Retry                                  |

<Note>
  `routerHolderAuthorized` is reported as `true` when the collateral token exposes no identity registry and no contract allow-list, because eligibility cannot be evaluated without one. That is an unknown, not a pass. Verify the router's authorization out of band before letting borrowers in.
</Note>

<Tip>
  This endpoint tells you what is unfinished. [Get Setup Steps](/endpoints/lending/get-setup-steps) returns the same state as an ordered checklist with ready-to-sign calldata for each outstanding item.
</Tip>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/configuration-status" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/lending-external-securities/api/markets/${marketId}/configuration-status`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response - Ready theme={null}
  {
    "success": true,
    "data": {
      "liquidationContract": "0x067a3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
      "insuranceFund": "0x8f1a...9c22",
      "adapter": "0x4d2b...77ae",
      "liquidationConfigured": true,
      "insuranceFundConfigured": true,
      "adapterConfigured": true,
      "routerAuthorized": true,
      "collateralAuthStatus": {
        "mode": "FREEZE",
        "adapterAuthorized": true,
        "interfaceSupported": true,
        "requirement": "adapter_must_hold_agent_role"
      },
      "routerHolderAuthorized": true,
      "oracleSignerAuthorized": true,
      "liquidatorRoleGranted": true,
      "relayerAddress": "0x123...456",
      "pendingCurator": false,
      "pendingCuratorMessage": null,
      "fullyConfigured": true
    }
  }
  ```

  ```json Response - Awaiting Token Agent theme={null}
  {
    "success": true,
    "data": {
      "liquidationContract": "0x067a3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
      "insuranceFund": "0x8f1a...9c22",
      "adapter": "0x4d2b...77ae",
      "liquidationConfigured": true,
      "insuranceFundConfigured": true,
      "adapterConfigured": true,
      "routerAuthorized": true,
      "collateralAuthStatus": {
        "mode": "FREEZE",
        "adapterAuthorized": false,
        "interfaceSupported": true,
        "requirement": "adapter_must_hold_agent_role"
      },
      "routerHolderAuthorized": false,
      "oracleSignerAuthorized": true,
      "liquidatorRoleGranted": false,
      "relayerAddress": "0x123...456",
      "fullyConfigured": false
    }
  }
  ```
</ResponseExample>
