> ## 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 Router Stats

> Lifetime counters from a liquidation router

Returns cumulative totals from a liquidation router: how many liquidations it has received and settled, how much collateral has passed through it, and how much in proceeds it has routed back to markets.

Pass `marketId` to read that market's own router. Omit it to read the shared legacy router, which only serves markets deployed before per-market routers existed.

## Query Parameters

<ParamField query="marketId" type="string">
  Market whose router to query. Maximum 100 characters. Omit to query the instance default router.
</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="routerAddress" type="string">Router the figures came from.</ResponseField>
    <ResponseField name="totalReceived" type="string">Liquidations received over the router's lifetime.</ResponseField>
    <ResponseField name="totalSettled" type="string">Liquidations settled. The difference against `totalReceived` is the outstanding count.</ResponseField>
    <ResponseField name="totalCollateralProcessed" type="string">Collateral handled, formatted at the collateral token's decimals.</ResponseField>
    <ResponseField name="totalCollateralProcessedRaw" type="string">The same figure in base units.</ResponseField>
    <ResponseField name="totalProceedsRouted" type="string">Proceeds routed back to markets, formatted at the borrow asset's decimals.</ResponseField>
    <ResponseField name="totalProceedsRoutedRaw" type="string">The same figure in base units.</ResponseField>
  </Expandable>
</ResponseField>

<Warning>
  Without `marketId` the endpoint cannot resolve token decimals and formats `totalCollateralProcessed` at 18 places and `totalProceedsRouted` at 6. For any market whose tokens differ from those defaults, always pass `marketId`, or read the `Raw` fields and scale them yourself.
</Warning>

<Note>
  Each market deployed with a per-market router has counters covering that market alone, so these totals are market-level rather than protocol-level. Only the shared legacy router aggregates across markets.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/lending-external-securities/api/liquidations/router-stats?marketId=clx_secmarket_001" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/lending-external-securities/api/liquidations/router-stats?marketId=${marketId}`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();
  const outstanding = Number(data.totalReceived) - Number(data.totalSettled);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "routerAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf",
      "totalReceived": "5",
      "totalSettled": "4",
      "totalCollateralProcessed": "1140.000000000000000000",
      "totalCollateralProcessedRaw": "1140000000000000000000",
      "totalProceedsRouted": "104820.500000",
      "totalProceedsRoutedRaw": "104820500000"
    }
  }
  ```

  ```json Error - Unavailable theme={null}
  {
    "success": false,
    "error": {
      "code": "STATS_UNAVAILABLE",
      "message": "Could not fetch router stats"
    }
  }
  ```

  ```json Error - Market Not Found theme={null}
  {
    "success": false,
    "error": {
      "code": "MARKET_NOT_FOUND",
      "message": "Market not found"
    }
  }
  ```
</ResponseExample>
