# Kona Lend

### Overview

Kona Lend is a decentralized lending protocol built on Abstract Mainnet and a fork of Aave V3. Users can supply assets to earn interest or use them as collateral to borrow other assets.

#### Key Features

* **Supply & Earn**: Deposit assets to earn variable APY
* **Borrow**: Use your supplied assets as collateral to borrow other tokens
* **Variable Interest Rates**: Market-driven rates that adjust based on supply and demand
* **Health Factor Monitoring**: Real-time risk management to prevent liquidations
* **Multiple Asset Support**: WETH, USDC, USDT, and PENGU

***

### Smart Contracts

#### Core Protocol Contracts

All contracts are deployed on **Abstract Mainnet (Chain ID: 2741)**.

| Contract                    | Address                                      | Description                                                          |
| --------------------------- | -------------------------------------------- | -------------------------------------------------------------------- |
| **Pool (Main)**             | `0x8f16B5713F412C5dE4951Aaf678Eb8409101f819` | Main lending pool contract - handles supply, borrow, repay, withdraw |
| **Pool Addresses Provider** | `0x7326d30aDAec89c992eBfEbA3beDB9044AC2F704` | Registry for all protocol addresses                                  |
| **Pool Configurator**       | `0xCdba582C3ef468f7460e365e04180e34De3b80cf` | Manages protocol configuration and parameters                        |

#### Oracle & Data Contracts

| Contract                   | Address                                      | Description                      |
| -------------------------- | -------------------------------------------- | -------------------------------- |
| **Oracle**                 | `0xE4Cd99d4698482ff263C300fbe2fA5fE08af1622` | Price oracle for asset valuation |
| **Protocol Data Provider** | `0xDfc422c8793864ecD12Bc59F2024614034BcB078` | Provides reserve and user data   |
| **UI Pool Data Provider**  | `0x7F883af3cdC4e56BebfC34Fc04eAf76168399Eb9` | Aggregated data for UI display   |

#### Access Control & Treasury

| Contract        | Address                                      | Description                          |
| --------------- | -------------------------------------------- | ------------------------------------ |
| **ACL Manager** | `0x09dC8a784f3D299C2F525a880C9d43D9eCB0E81f` | Manages admin roles and permissions  |
| **Treasury**    | `0x24f12414C02ec41dbd1B1dAb2351d46C70fcBCb8` | Protocol treasury for collected fees |

#### Helper Contracts

| Contract                       | Address                                      | Description                       |
| ------------------------------ | -------------------------------------------- | --------------------------------- |
| **Wallet Balance Provider**    | `0x9C32e40483F4C394005F72DB6b9BBa08686d1306` | Batch fetch user token balances   |
| **UI Incentive Data Provider** | `0xa2dDec25Fa3ce04c5ce5f33F77CfDFDA6de8A089` | Provides incentive/rewards data   |
| **Wrapped Token Gateway**      | `0xf177F238C53B64A4faF513629A957889887c45bA` | Gateway for native token wrapping |
| **Emission Manager**           | `0xC8Ffda370edF4a15554A4120c95641Ddd6c084C8` | Manages reward emissions          |
| **Rewards Controller**         | `0x4237d126713bf1FaBA29Ed8A55A6A0634886e223` | Handles reward distribution       |

***

### Supported Assets

#### Asset Details

| Asset     | Address                                      | Decimals | Description    |
| --------- | -------------------------------------------- | -------- | -------------- |
| **WETH**  | `0x3439153EB7AF838Ad19d56E1571FBD09333C2809` | 18       | Wrapped Ether  |
| **USDC**  | `0x84A71ccD554Cc1b02749b35d22F684CC8ec987e1` | 6        | USD Coin       |
| **USDT**  | `0x0709F39376dEEe2A2dfC94A58EdEb2Eb9DF012bD` | 6        | Tether USD     |
| **PENGU** | `0x9eBe3A824Ca958e4b3Da772D2065518F009CBa62` | 18       | Pudgy Penguins |

### Price Oracles -&#x20;

Kona Lend uses **Pyth Network** as its price oracle to provide accurate, real-time asset valuations for all protocol operations. Pyth aggregates price data from over 90 institutional publishers including major exchanges, market makers, and trading firms, delivering sub-second price updates directly on-chain.&#x20;

**Pyth Price Feed Aggregators:** -&#x20;

**WETH:** `0x2bfa7432252D694fBCc1Ee6e2A6DFdA3Af05D989`&#x20;

**USDC:** `0x11F623E4C7BcCb716016c26633A73DE0fDcf8995`&#x20;

**USDT:** `0x2C153C79e814C1F51fF7dc75735A22872A862092`&#x20;

**PENGU:** `0xb0b8935C6538242b6Fb49eFD64c2db3825b956f5`&#x20;

***

### Key Concepts

#### Health Factor

The Health Factor represents the safety of your borrowed position:

* **> 2.0**: Safe - Low liquidation risk
* **1.5 - 2.0**: Moderate - Monitor your position
* **1.0 - 1.5**: At Risk - Consider repaying or adding collateral
* **< 1.0**: **Liquidation will occur**

**Formula**: `Health Factor = (Collateral × Liquidation Threshold) / Total Debt`

#### Loan-to-Value (LTV)

LTV determines how much you can borrow against your collateral:

* Maximum percentage of collateral value you can borrow
* Varies by asset based on risk profile
* Example: 80% LTV means you can borrow up to $800 against $1000 collateral

#### Liquidation Threshold

The threshold at which your position becomes eligible for liquidation:

* Always higher than LTV
* When collateral value × liquidation threshold < debt, liquidation occurs
* Example: 85% threshold means liquidation happens when debt reaches 85% of collateral value

#### Interest Rate Modes

| Mode         | Value | Description                                        |
| ------------ | ----- | -------------------------------------------------- |
| **None**     | 0     | No interest (not used for borrowing)               |
| **Stable**   | 1     | Fixed rate for predictable payments (if enabled)   |
| **Variable** | 2     | Rate adjusts based on market utilization (default) |

***

### How to Use Kona Lend

#### Supplying Assets

1. Connect your wallet to Kona
2. Navigate to the Lending page
3. Select an asset to supply
4. Enter the amount you want to supply
5. Approve the transaction
6. Confirm the supply transaction
7. Start earning interest immediately!

**Benefits**:

* Earn variable APY on your deposits
* Use supplied assets as collateral for borrowing
* Withdraw anytime (subject to available liquidity)

#### Borrowing Assets

1. Supply collateral first (if you haven't already)
2. Select an asset to borrow
3. Enter the amount (must be within your borrowing capacity)
4. Review your new Health Factor
5. Confirm the borrow transaction

**Requirements**:

* Must have supplied collateral
* Borrowing capacity depends on your LTV
* Must maintain Health Factor > 1.0

#### Repaying Debt

1. Navigate to your borrow positions
2. Click "Repay" on the asset you want to repay
3. Enter the amount to repay (or click MAX for full repayment)
4. Approve token spending (if first time)
5. Confirm the repay transaction

**Benefits**:

* Improve your Health Factor
* Reduce interest costs
* Free up borrowing capacity

#### Withdrawing Assets

1. Navigate to your supply positions
2. Click "Withdraw" on the asset
3. Enter the amount to withdraw
4. Ensure withdrawal doesn't push Health Factor below 1.0
5. Confirm the withdrawal transaction

**Limits**:

* Cannot withdraw if used as collateral and would cause Health Factor < 1.0
* Subject to available liquidity in the pool

***

### Understanding APY

#### Supply APY

* Interest earned on deposited assets
* Paid by borrowers
* Variable rate based on utilization
* Higher utilization = higher APY for suppliers

#### Borrow APY

* Interest charged on borrowed assets
* Variable rate based on utilization
* Higher utilization = higher borrow rate
* Accrues continuously

#### Net APY

Your overall position performance:

```
Net APY = (Supply Interest Earned) - (Borrow Interest Paid)
```

* Positive Net APY = You're earning more than you're paying
* Negative Net APY = You're paying more than you're earning

***

### Risk Management

#### Liquidation

Liquidation occurs when Health Factor drops below 1.0:

* Liquidators can repay up to 50% of your debt
* They receive your collateral at a discount (liquidation bonus)
* You lose a portion of your collateral

**How to Avoid Liquidation**:

1. Maintain Health Factor > 1.5
2. Monitor market volatility
3. Repay debt if Health Factor drops
4. Supply additional collateral
5. Set up price alerts

#### Best Practices

**Safety Tips**

* Keep Health Factor above 2.0 for safety buffer
* Use stablecoins as collateral to reduce volatility risk
* Don't max out your borrowing capacity
* Monitor your position regularly
* Understand asset price volatility {% endhint %}

**Common Risks**

* Price volatility can rapidly change your Health Factor
* High utilization may prevent withdrawals
* Gas fees apply to all transactions
* Smart contract risks (audited but not risk-free) {% endhint %}

***

### Transaction Flow

#### Supply Transaction

```mermaid
graph LR
    A[User] -->|1. Approve Token| B[ERC20 Token]
    A -->|2. Supply| C[Pool Contract]
    C -->|3. Mint kTokens| D[User Wallet]
    C -->|4. Transfer Tokens| E[Reserve]
```

#### Borrow Transaction

```mermaid
graph LR
    A[User] -->|1. Request Borrow| B[Pool Contract]
    B -->|2. Check Collateral| C[Health Factor]
    C -->|3. Validate| D{HF > 1?}
    D -->|Yes| E[Transfer Borrowed Asset]
    D -->|No| F[Revert Transaction]
    E -->|4. Mint Debt Token| G[User Wallet]
```

***

### Technical Details

#### Rate Calculations

Interest rates use RAY units (10²⁷) for precision:

```
Annual Rate = (Rate per Second × Seconds per Year)
APY = ((1 + Rate per Second) ^ Seconds per Year - 1) × 100
```

#### Utilization Rate

```
Utilization = Total Borrowed / Total Supply
```

Higher utilization leads to higher interest rates to incentivize more supply.

#### Collateral Calculation

```
Total Collateral Value = Σ(Asset Balance × Price × LTV)
Available Borrows = Total Collateral Value - Total Debt
```

***

### Integration Guide

#### For Developers

**Connect to Pool Contract**

```typescript
import { createPublicClient, http } from 'viem';
import { abstract } from 'viem/chains';
import PoolABI from './abis/Pool.json';

const client = createPublicClient({
  chain: abstract,
  transport: http()
});

const POOL_ADDRESS = '0x8f16B5713F412C5dE4951Aaf678Eb8409101f819';

// Read reserve data
const reserveData = await client.readContract({
  address: POOL_ADDRESS,
  abi: PoolABI.abi,
  functionName: 'getReserveData',
  args: [assetAddress]
});
```

**Supply Assets**

```typescript
import { parseUnits } from 'viem';

// 1. Approve token
await walletClient.writeContract({
  address: tokenAddress,
  abi: ERC20ABI,
  functionName: 'approve',
  args: [POOL_ADDRESS, amount]
});

// 2. Supply to pool
await walletClient.writeContract({
  address: POOL_ADDRESS,
  abi: PoolABI.abi,
  functionName: 'supply',
  args: [
    tokenAddress,           // asset
    parseUnits(amount, decimals), // amount
    userAddress,           // onBehalfOf
    0                      // referralCode
  ]
});
```

**Borrow Assets**

```typescript
await walletClient.writeContract({
  address: POOL_ADDRESS,
  abi: PoolABI.abi,
  functionName: 'borrow',
  args: [
    tokenAddress,           // asset
    parseUnits(amount, decimals), // amount
    2,                     // interestRateMode (2 = variable)
    0,                     // referralCode
    userAddress            // onBehalfOf
  ]
});
```

**Get User Account Data**

```typescript
const accountData = await client.readContract({
  address: POOL_ADDRESS,
  abi: PoolABI.abi,
  functionName: 'getUserAccountData',
  args: [userAddress]
});

// Returns:
// - totalCollateralBase
// - totalDebtBase
// - availableBorrowsBase
// - currentLiquidationThreshold
// - ltv
// - healthFactor
```

***

### FAQ

#### How do I earn interest on Kona Lend?

Simply supply assets to the protocol. Interest is earned automatically and compounds in real-time. You'll receive kTokens that increase in value as interest accrues.

#### What are kTokens?

kTokens are interest-bearing tokens you receive when supplying assets. They represent your deposit plus accrued interest. 1 kToken ≠ 1 underlying token over time due to interest growth.

#### Can I withdraw anytime?

Yes, as long as:

1. There's sufficient liquidity in the pool
2. If you have borrows, your Health Factor stays above 1.0 after withdrawal

#### What happens if I get liquidated?

A liquidator repays part of your debt and receives your collateral at a discount. You'll lose collateral but your debt is reduced. Always maintain Health Factor > 1.5 to stay safe.

#### How are interest rates determined?

Rates are algorithmic and based on supply/demand (utilization):

* Low utilization = Low rates
* High utilization = High rates

This ensures the protocol always has liquidity available.

#### Can I use multiple assets as collateral?

Yes! You can supply multiple different assets and they all count toward your total collateral value.

#### What's the difference between LTV and Liquidation Threshold?

* **LTV**: Maximum you can borrow (e.g., 80%)
* **Liquidation Threshold**: When you get liquidated (e.g., 85%)

The gap between them is your safety buffer.

#### Are there any fees?

The protocol charges:

* Reserve factor (small % of interest goes to treasury)
* No fees for supply, borrow, repay, or withdraw transactions (only gas fees)

***

### Security

#### Audits

Kona Lend is built on Aave V3, which has been extensively audited by multiple security firms including:

* OpenZeppelin
* Trail of Bits
* Certora
* ABDK
* Peckshield

Additional Kona-specific audits are underway.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kittypunch.gitbook.io/kittypunch-docs/protocols-and-products-abstract/kona-lend.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
