# Your lending status

`GET /collateral/wallet` · Lithos client API · Collateral Market · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/get-collateral-wallet-status

This wallet's side of the collateral market: lender keys and their state, queued and live positions, and the self-collateralization settings in effect. Balances are under `GET /wallet/balances`.

## Responses

### 200: Lender keys, positions and settings

`WalletCollateralStatus`

- `autoCollateralize` (boolean, required): Whether the client joins the queue on its own timer. **While this is true the client refuses manual joins** — the automated pass owns lender-key selection, and a manual join can take a key it is already using. Turn it off in the client config to join by hand. 
- `maxOwnCollateral` (integer · int32, required): Configured ceiling on live positions owned by this wallet
- `maxJoinsPerRun` (integer · int32, required): Most positions one automated pass creates. Does not bound a manual join, which is limited by free lender keys, the exposure budget and the wallet balance. 
- `maxLenderKeys` (integer · int32, required): Wallet addresses dedicated to lending
- `maxPermitPerJoinLit` (string, required): The permit price above which automated joins stop. Decimal string.
- `ownPositionsQueued` (integer · int32, required)
- `ownPositionsLive` (integer · int32, required)
- `ownBudgetRemaining` (integer · int32, required): How many more positions the configured exposure budget allows
- `freeLenderKeys` (integer · int32, required): Keys with status FREE — positions that can be opened without deriving a new key. A join needs one key per position. 
- `keysDerivable` (integer · int32, required): Further keys the client may derive before reaching `maxLenderKeys`. A join of N positions is possible when `freeLenderKeys + keysDerivable >= N`. 
- `lenderKeys` (CollateralLenderKeyStatus[], required)
  - `address` (string, required)
  - `status` (string, required, one of FREE, QUEUED, ACTIVE, RETIRING): FREE has no position and can join. QUEUED is waiting in the queue. ACTIVE holds a live collateral box. RETIRING held one until recently and cannot be reused yet. Only FREE keys are available to a join. One key holds at most one position; a second position under a key already in the active set is forfeited. 
  - `position` (integer · int64): Queue position, when QUEUED
- `positions` (CollateralPositionSummary[], required)
  - `kind` (string, required, one of QUEUED, LIVE)
  - `boxId` (string, required)
  - `position` (integer · int64): Queue position, when QUEUED
  - `principalNanoErgs` (string, required): Decimal string.
  - `permitLit` (string, required): Permit paid at join. Present for QUEUED positions only.
  - `carriedLit` (string): LIT carried on the box — emission plus permit together. Present for LIVE positions only. Decimal string. 
  - `creationHeight` (integer · int32, required)

### 403: Missing or wrong api_key

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 404: No emission state on this network yet, or the node is not indexed.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 503: Node or wallet unavailable. Retry.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### default: Error

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

## Example request

```bash
curl -X GET "http://localhost:9000/collateral/wallet" \
  -H "api_key: $LITHOS_API_KEY"
```

## Example response

```json
{
  "autoCollateralize": false,
  "maxOwnCollateral": 10,
  "maxJoinsPerRun": 5,
  "maxLenderKeys": 32,
  "maxPermitPerJoinLit": "30000000000000",
  "ownPositionsQueued": 3,
  "ownPositionsLive": 7,
  "ownBudgetRemaining": 0,
  "freeLenderKeys": 4,
  "keysDerivable": 12,
  "lenderKeys": [
    {
      "address": "3WwbQFz3vgi8ChY9dM1haQLGDeQYe5U9z98bwWW4TqxxEAvyYu5y",
      "status": "ACTIVE",
      "position": 411
    }
  ],
  "positions": [
    {
      "kind": "QUEUED",
      "boxId": "ce00d6e0f4fd3390c0519bb0d24824e1e6b06978163f4845a7cf2c1c7d8f1b65",
      "position": 411,
      "principalNanoErgs": "2915000000",
      "permitLit": "19380000000",
      "carriedLit": "19380000000",
      "creationHeight": 484102
    }
  ]
}
```
