Borrow-Lending System โ
The DEX provides a comprehensive borrow-lending system that allows users to lend their assets and borrow against their collateral. By default, all deposited tokens are automatically lent to the lending pool, but users can opt out of this feature if desired.
How Borrow-Lending Works โ
Lending โ
Auto-Lending (Default):
- All deposited tokens are automatically lent to the lending pool
- Users earn interest based on utilization rates
- Interest accrues continuously and compounds automatically
Interest Calculation:
textSupply Rate = Borrow Rate ร Utilization ร (1 - System Haircut)Where:
- Borrow Rate is determined by the utilization curve
- Utilization is the ratio of borrowed tokens to total supplied tokens
- System Haircut is a protocol fee (e.g., 10%)
Borrowing โ
Collateral Requirements:
- Users must provide sufficient collateral to borrow
- Each token has specific collateral and maintenance factors
- Borrowing is subject to origination fees
Borrow Rate Calculation: The borrow rate follows a utilization curve with three segments:
- Base Rate: Minimum rate when utilization is low
- Linear Growth: Rate increases linearly with utilization up to the kink point
- Steeper Growth: Rate increases more rapidly after the kink point
Token Parameters โ
Each token has specific parameters that control its behavior in the borrow-lending system:
| Parameter | Description | Example (BTC) |
|---|---|---|
| collateral_factor | Percentage of token value that counts as collateral | 0.95 (95%) |
| borrow_initial_factor | Required collateral ratio to open a borrow | 1.2 (120%) |
| borrow_maintenance_factor | Minimum collateral ratio to avoid liquidation | 1.1 (110%) |
| liquidation_penalty | Penalty applied to collateral when liquidated | 0.01 (1%) |
| origination_fee | Fee charged when opening a borrow position | 0.001 (0.1%) |
Example: Borrow-Lending Scenario โ
Let's walk through a typical borrow-lending scenario:
Initial Deposit:
- User deposits 1 BTC (worth $30,000)
- Collateral factor: 0.95
- Effective collateral value: $28,500
Borrowing:
- User wants to borrow USDC
- Borrow initial factor: 1.2
- Maximum borrow amount: $28,500 รท 1.2 = $23,750
- Origination fee: $23,750 ร 0.1% = $23.75
Interest Accrual:
- If utilization is 80% and borrow rate is 10%
- Supply rate = 10% ร 80% ร (1 - 10%) = 7.2%
- Interest accrues continuously on both lent and borrowed amounts
Summary โ
- All deposits are auto-lent by default (can be opted out)
- Borrowing requires sufficient collateral
- Interest rates are dynamic based on utilization
- Liquidation protects the protocol from undercollateralization
- Each token has specific parameters for risk management