> For the complete documentation index, see [llms.txt](https://ag0.gitbook.io/cooler-v2-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ag0.gitbook.io/cooler-v2-docs/cooler-v2-technical-documentation.md).

# Cooler V2 Technical Documentation

### System Overview

Cooler V2 is a lending system that allows users to borrow USDS against gOHM collateral. Key differences from V1:

1. Perpetual positions instead of fixed-term loans
2. Single unified position per user instead of separate loan entries
3. Governance-controlled LTV growth through drip system
4. Built to be integrated into other protocols

### Core Components

#### MonoCooler

* Main lending contract managing user positions
* Handles borrows, repayments, and liquidations
* Tracks user collateral and debt

#### CoolerTreasuryBorrower

* Interfaces with Treasury to access reserves
* Converts between USDS and sUSDS when moving funds to/from Treasury

#### CoolerLtvOracle

* Sets and updates lending and liquidation ratios
* Implements controlled LTV increases
* Can only increase or maintain LTV, never decrease

#### Delegation System

* Allows gOHM collateral to maintain voting power
* Users can delegate to up to 10 addresses, unless a specific address is whitelisted for a higher cap
* Each delegate gets their own escrow contract

### Key Functions

#### Position Management

* Borrow USDS against gOHM at current LTV ratio
* Add or remove collateral
* Repay debt partially or fully
* Interest accrues continuously

#### Risk Management

* Separate thresholds for borrowing vs liquidation
* System-wide pause for borrows and liquidations
* Minimum position size of 1000 USDS

#### Governance

* Collateral retains voting power through delegation
* Multiple delegates per position
* Delegates change with position size

#### Admin Controls

* Emergency: Can pause system
* Admin: Can update parameters
* Manager: Can control protocol settings
