> ## 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 User Collateral

> Read a borrower total collateral in a market

Returns the total collateral one address has locked across all of their loans in a market, read from the contract. This is the figure the market's `maxUserCollateral` cap is applied against.

## Path Parameters

<ParamField path="marketId" type="string" required>Market ID.</ParamField>
<ParamField path="userAddress" type="string" required>Borrower address, 0x-prefixed with 40 hex characters.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="userAddress" type="string">The address queried, echoed back.</ResponseField>
    <ResponseField name="collateral" type="string">Total collateral locked as a decimal string, in collateral token units. `"0"` when the borrower holds no position or the chain read failed.</ResponseField>
  </Expandable>
</ResponseField>

<Note>
  This is an aggregate across every loan the address holds in this market, not a per-loan figure. For the breakdown, use [Get User Loans](/endpoints/external-securities-lending/get-user-loans).
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/lending-external-securities/api/positions/{marketId}/user-collateral/0xabc...def" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const [collateralRes, capsRes] = await Promise.all([
    fetch(`https://api.trusset.org/lending-external-securities/api/positions/${marketId}/user-collateral/${address}`,
      { headers: { 'X-API-Key': 'trusset_your_key_here' } }),
    fetch(`https://api.trusset.org/lending-external-securities/api/markets/${marketId}/supply-caps`,
      { headers: { 'X-API-Key': 'trusset_your_key_here' } })
  ]);
  const { data: c } = await collateralRes.json();
  const { data: caps } = await capsRes.json();
  const cap = Number(caps.maxUserCollateral);
  const headroom = cap === 0 ? Infinity : cap - Number(c.collateral);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "userAddress": "0xabc...def",
      "collateral": "1250.000000000000000000"
    }
  }
  ```
</ResponseExample>
