> For the complete documentation index, see [llms.txt](https://seahorsefi.gitbook.io/seahorsefi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seahorsefi.gitbook.io/seahorsefi/protocol/liquidation/reserves.md).

# Reserves

### Reserves <a href="#reserves" id="reserves"></a>

Reserves are a balance of the base or collateral asset, stored internally in the protocol, which automatically protect users from bad debt. Reserves can also be withdrawn or used through the governance process.

Reserves are generated in two ways: the difference in interest paid by borrowers, and earned by suppliers of the base asset, accrue as reserves into the protocol. Second, the [liquidation](https://docs.compound.finance/liquidation/#liquidation) process uses, and can add to, protocol reserves based on the [target reserve](https://docs.compound.finance/liquidation/#target-reserves) level set by governance.

#### Get Base Asset Reserves <a href="#get-base-asset-reserves" id="get-base-asset-reserves"></a>

This function returns the amount of protocol reserves for the base asset as an integer.

```solidity
function getReserves() public view returns (int)
```

* `RETURNS`: The amount of base asset stored as reserves in the protocol as an unsigned integer scaled up by 10 to the “decimals” integer in the asset’s contract.

#### Get Collateral Asset Reserves <a href="#get-collateral-asset-reserves" id="get-collateral-asset-reserves"></a>

This function returns the amount of protocol reserves for the specified collateral asset as an integer.

```solidity
function getCollateralReserves(address asset) public view returns (uint)
```

* `RETURNS`: The amount of collateral asset stored as reserves in the protocol as an unsigned integer scaled up by 10 to the “decimals” integer in the collateral asset’s contract.

#### Target Reserves <a href="#target-reserves" id="target-reserves"></a>

This immutable value represents the target amount of reserves of the base token. If the protocol holds greater than or equal to this amount of reserves, the [*buyCollateral*](https://docs.compound.finance/liquidation/#buy-collateral) function can no longer be successfully called.

```solidity
function targetReserves() public view returns (uint)
```

* `RETURN`: The target reserve value of the base asset as an integer, scaled up by 10 to the “decimals” integer in the base asset’s contract.
