> ## 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 Liquidation Desk

> Everything the liquidation desk of one market needs, in one read

Returns, in one read, what a lender of record needs to work the market's liquidations: the loans that can be realized now, the loans close to it, the running and ended Dutch auctions, the records awaiting sale, how the records compare with the chain, and whether the lender of record's liquidator is ready. Every figure is read from the chain. A part that could not be read says so; it never reads as an all-clear.

Poll it with the `cursor` the previous read returned. While nothing on the market moved and nothing needs work, the answer is `unchanged: true` with no body, which costs one small batched read. `pollSeconds` says when to read again: `120` on a quiet desk, `30` while anything needs work.

## Path Parameters

**marketId** `string` *required*

The market's record ID, as `id` on [List Markets](https://docs.trusset.org/endpoints/lending/list-markets.md), not its contract address. At most 100 characters.

## Query Parameters

**cursor** `string`

The `cursor` of the previous read. Ignored when longer than 64 characters.

**watchBand** `number` (default: 1.25)

Health factor below which a loan is listed in `loans.watchLoans`, from `1.01` to `3`. Other values fall back to the default.

**graceDays** `integer` (default: 7)

Days ahead in which a termed loan whose grace period ends is listed in `loans.watchLoans`, from `0` to `90`.

## Response Fields

**data** `object`

**unchanged** `boolean`

`true` when the cursor still matches a quiet desk. No other field but `cursor`, `readAt` and `pollSeconds` is sent then.

**cursor** `string`

Pass it on the next read. `null` when the market could not be read.

**readAt** `string`

ISO 8601 time of the read.

**pollSeconds** `integer`

Seconds until the next read is worth making.

**marketPaused** `boolean`

Whether the market is paused. While it is, bids revert and only a `LIQUIDATOR_ROLE` holder may settle an expired auction. `null` when unread.

**loans** `object`

The loan book: `liquidatableLoans`, `termedLoans`, `auctionedLoans` (loans an auction is already realizing) and `watchLoans`, with `readFailed` and the completeness of each scan. The shapes match [Get Liquidatable Loans](https://docs.trusset.org/endpoints/lending/get-liquidatable-loans.md).

**auctions** `object`

Active auctions with `phase`, `expired`, `biddable` and `settleable`, as on [List Auctions](https://docs.trusset.org/endpoints/lending/list-auctions.md), and `readFailed`.

**pending** `object`

`rows`, `readFailed` and `truncated`: the records awaiting sale, as on [Get Pending Liquidations](https://docs.trusset.org/endpoints/lending/get-pending-liquidations.md).

**sync** `object`

How the records compare with the chain.

**state** `string`

`CURRENT`, `BEHIND` or `FAILED`. `BEHIND` when the market holds a liquidation no record shows yet, or the reconciliation could not finish.

**chainHasOpenDebt** `boolean`

Whether the market carries liquidation debt awaiting settlement. `null` when unread.

**recorded** `integer`

Open records this instance holds.

**unrecordedOnChain** `boolean`

`true` when the market holds liquidation debt that no record here shows.

**unrecordedOpen** `integer`

Liquidations the market holds open that no record here shows yet.

**unresolved** `integer`

Market records not matched to a router record or an auction yet.

**watchBehind** `boolean`

Whether the background watch reports this market behind.

**watchGaveUpAt** `string`

ISO 8601 time the background adoption stopped retrying, or `null`.

**lastSyncedAt** `string`

ISO 8601 time of this comparison.

**lenderOfRecord** `object`

`ready` (whether a wallet or connected bot of the lender of record holds `LIQUIDATOR_ROLE`, `null` when unread), `via` (`WALLET` or `BOT`), `holder`, and `routerAdmin`, the lender-of-record wallet that holds `DEFAULT_ADMIN_ROLE` on the router and signs router-side setup.

**customers** `object`

Your own instance's customer names for the borrower wallets on the desk, keyed by lowercase address. Never another instance's customers.

## Error Codes

| Code | HTTP | Cause |
| - | - | - |
| `NO_MARKET_ADDRESS` | `400` | The market has no on-chain address yet |
| `MARKET_NOT_FOUND` | `404` | No market with this ID on your instance |
| `CHAIN_READ_FAILED` | `503` | The desk could not be read, so whether anything is open is unknown. Retry in a moment |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.