# Kamino

## Kamino

### Overview

Kamino is a decentralized lending protocol built on the Solana blockchain. It allows users to deposit their assets into liquidity pools, which in turn enable others to borrow various tokens. Borrowers can access the pooled funds and are required to repay the borrowed assets along with any applicable fees.

### What is Lending?

Lending in decentralized finance (DeFi) refers to a process where:

* Users deposit their tokens into a lending pool as collateral
* This collateral enables them to borrow other tokens up to a certain percentage of their deposit value
* Borrowers pay interest on the borrowed amount
* Depositors earn interest on their supplied tokens
* The system maintains solvency through collateralization ratios and liquidation mechanisms

### How Kamino Works

#### 1. Depositing Tokens

* Users deposit tokens into Kamino's lending pools
* These tokens serve as collateral for potential borrowing
* Depositors earn interest on their supplied tokens
* Option to deposit all available tokens or a specific amount
* Deposited tokens increase borrowing capacity

#### 2. Borrowing Tokens

* Users can borrow tokens against their deposited collateral
* Borrowing capacity is determined by the value of the collateral
* The Loan-to-Value (LTV) ratio determines how much can be borrowed
* Borrowed tokens can be used for various purposes
* Interest accrues on the borrowed amount

#### 3. Managing Positions

* Users can monitor their LTV ratio to avoid liquidation
* Deposited collateral can be withdrawn if not needed to secure loans
* Borrowed tokens can be repaid at any time
* Interest rates may fluctuate based on supply and demand
* Maintaining a healthy LTV ratio is essential to avoid liquidation

### Using the Tool

To interact with Kamino, use the following command formats:

#### For Depositing:

```
Deposit tokens as collateral with:
 - Chain name: solana
 - Token: [TOKEN_ADDRESS]
 - Amount: [AMOUNT] (use -1 to deposit all available tokens)
```

#### For Withdrawing:

```
Withdraw deposited tokens with:
 - Chain name: solana
 - Token: [TOKEN_ADDRESS]
 - Amount: [AMOUNT] (use -1 to withdraw all deposited tokens)
```

#### For Borrowing:

```
Borrow tokens against collateral with:
 - Chain name: solana
 - Token: [TOKEN_ADDRESS]
 - Amount: [AMOUNT] (use -1 to borrow maximum available)
```

#### For Repaying:

```
Repay borrowed tokens with:
 - Chain name: solana
 - Token: [TOKEN_ADDRESS]
 - Amount: [AMOUNT] (use -1 to repay all borrowed tokens)
```

#### For Checking LTV:

```
Get current Loan-to-Value ratio with:
 - Chain name: solana
```

#### For Checking Borrows:

```
Check current borrowed positions with:
 - Chain name: solana
```

#### For Checking Deposits:

```
View deposited collateral with:
 - Chain name: solana
```

#### Example:

```
Deposit tokens as collateral with:
 - Chain name: solana
 - Token: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v (USDC)
 - Amount: 100
```

### Token Types

#### 1. Deposit Tokens

* Any supported tokens can be used as collateral
* Different tokens may have different collateral factors
* Higher quality assets typically allow higher borrowing capacity
* Examples include SOL, USDC, ETH, and other major tokens

#### 2. Borrow Tokens

* Various tokens are available for borrowing from the lending pools
* Borrow rates vary by token and utilization rate
* Some tokens may have borrowing limits or restrictions
* Available borrow tokens depend on the liquidity in the pools

### Important Considerations

#### 1. Liquidation Risk

* If LTV exceeds maximum threshold, collateral may be liquidated
* Maintaining a healthy buffer below maximum LTV is recommended
* Market volatility can rapidly change LTV ratios
* Liquidations may incur additional fees

#### 2. Interest Rates

* Borrow interest rates fluctuate based on supply and demand
* Higher utilization of a token pool leads to higher borrowing rates
* Interest accrues continuously while tokens are borrowed
* Deposit interest rates also vary based on pool utilization

#### 3. Collateral Factors

* Different tokens have different collateral factors
* Collateral factor determines maximum borrowing capacity
* Higher quality assets typically have higher collateral factors
* Diversifying collateral can optimize borrowing capacity

#### 4. Protocol Safety

* Smart contract risks are inherent to DeFi protocols
* Market volatility can impact collateral values
* Oracle reliability is crucial for accurate price feeds
* Understand the risks before depositing significant amounts

### Available Functions

* `deposit`: Supply tokens as collateral to enable borrowing on Kamino
* `withdraw`: Withdraw deposited tokens from Kamino lending pool
* `borrow`: Borrow tokens against your deposited collateral from Kamino
* `repay`: Repay borrowed tokens to Kamino lending pool
* `getLtv`: Get current Loan-to-Value ratio
* `getBorrows`: Check your current borrowed positions on Kamino
* `getDeposits`: View your deposited collateral on Kamino

### Parameters for Functions

#### deposit

| Parameter | Type   | Description                                                                     |
| --------- | ------ | ------------------------------------------------------------------------------- |
| chainName | string | Must be "solana"                                                                |
| token     | string | The address of the token to be deposited                                        |
| amount    | string | Amount of tokens to deposit. Set to "-1" to deposit all available token balance |

#### withdraw

| Parameter | Type   | Description                                                                |
| --------- | ------ | -------------------------------------------------------------------------- |
| chainName | string | Must be "solana"                                                           |
| token     | string | The address of the token to be withdrawn                                   |
| amount    | string | Amount of tokens to withdraw. Set to "-1" to withdraw all deposited tokens |

#### borrow

| Parameter | Type   | Description                                                                 |
| --------- | ------ | --------------------------------------------------------------------------- |
| chainName | string | Must be "solana"                                                            |
| token     | string | The address of the token to be borrowed                                     |
| amount    | string | Amount of tokens to borrow. Set to "-1" to borrow maximum available balance |

#### repay

| Parameter | Type   | Description                                                         |
| --------- | ------ | ------------------------------------------------------------------- |
| chainName | string | Must be "solana"                                                    |
| token     | string | The address of the token to be repaid                               |
| amount    | string | Amount of tokens to repay. Set to "-1" to repay all borrowed tokens |

#### getLtv, getBorrows, getDeposits

| Parameter | Type   | Description      |
| --------- | ------ | ---------------- |
| chainName | string | Must be "solana" |

### Example Prompts:

* "HeyAnon, please supply 25 Solana to @kamino on Solana"
* "HeyAnon, use my deposited Solana on @kamino as collateral for 100USDC on Solana"
* "HeyAnon, please update me on both my supply and borrow positions with @kamino on Solana"


---

# 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://docs.heyanon.ai/heyanon.ai/hey-anon/protocols-and-functions-supported/defi-protocols/kamino.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.
