# Introduction to Save

Solana's permissionless savings account

Save is an algorithmic, decentralized protocol for lending and borrowing on Solana.

Lending and borrowing has proven itself as key in a DeFi ecosystem. However, current products are slow and expensive. On Solana, Save can scale to being 100x faster and 100x cheaper. Solend aims to be the easiest to use and most secure solution on Solana.

With Save, you can do the following:

* Earn interest
* Borrow
* Leverage long
* Short


# Start Here (Desktop)

## Install a Solana Wallet

In order to use Solend, you will need a Solana wallet. We recommend [Phantom](https://phantom.app).&#x20;

## Get SOL for Gas

Actions on Solend require SOL as gas. You can buy SOL and transfer it to your account from exchanges such as coinbase or binance. After that, you're all set to make your first deposit!

Choose an asset to deposit. Major ones like USDC, ETH, BTC or SOL are a good start.&#x20;

## Deposit <a href="#deposit" id="deposit"></a>

Select an asset to deposit. You will be receiving a yield (Supply APY) on the asset you deposited.&#x20;

![](/files/-MitMjWq0N3kwMq38H3O)

Enter amount to deposit.

![](https://gblobscdn.gitbook.com/assets%2F-MfHlKeK0wEppVzgq36Q%2F-MgF3ID94slF5tGh4pHd%2F-MgF4FToQKGCj1cRqkty%2Fimage.png?alt=media\&token=4527535e-ba4d-4069-8e70-88faece567b3)

Approve the transaction in your wallet.

![](https://gblobscdn.gitbook.com/assets%2F-MfHlKeK0wEppVzgq36Q%2F-MgF3ID94slF5tGh4pHd%2F-MgF4K3XxkFkHiRjw8Bb%2Fimage.png?alt=media\&token=30cbc362-f7b3-4c0f-869a-3bb277a2f02a)

### Borrow <a href="#borrow" id="borrow"></a>

Once you've deposited funds, you can use them as collateral for a loan.

Specify how much you want to borrow.

![](https://gblobscdn.gitbook.com/assets%2F-MfHlKeK0wEppVzgq36Q%2F-MgF3ID94slF5tGh4pHd%2F-MgF4_6cRYfKk6wote0X%2Fimage.png?alt=media\&token=ce1df1ae-fd7e-4199-b51d-ad22826b5521)

Approve the transaction in your wallet again.

## Account Panel

The account section on the right shows important information about your account's standing. Use this information to avoid costly liquidations.

![](/files/-Mivtrm7oSK0D6ny7hLH)

Let's go through each section from top to bottom.

### **Summary**

![](/files/-MivowtuzeVQ_fHriBDI)

**Borrow utilization** represents how much of your borrow limit is currently being borrowed. At 100%, you're no longer able to borrow and could be in danger of being liquidated. Keep this number low by supplying more collateral or repaying your borrow balance.

**Net value** is the value of your account, calculated as `supplies - borrows`.

![](/files/-MivtzkUPrd14xXV--Iz)

**Supply balance** is the total value of the deposits. In the utilization bar visualization, this is represented by the full length of the bar.

**Borrow balance** is the total value of borrows. In the visualization, this is represented by the green bar. This bar turns red when your borrow balance grows past your borrow limit.

**Borrow limit** is the maximum value of assets you can borrow. This is represented by the white bar. This limit is calculated based on your deposits and their [loan-to-value ratios](broken://pages/-MfR1AEZhIRJC3yBzp2L). Your borrowed balance can surpass this limit if the value of your borrowed assets drop in relation to your supplied asset.

**Liquidation threshold** is the maximum value of your borrow balance before your account will be eligible for liquidation. This is a costly event and should be avoided by lowering your borrow utilization. This limit is calculated based on your deposits and their respective [liquidation ratio](broken://pages/-MfR1AEZhIRJC3yBzp2L).

You can repay or withdraw by clicking on the table in your account section.

![](/files/-MivtpORDDnG66NnxwyY)

## Repay

Select an asset in the "Assets borrowed" table pictured above.

![](/files/-MitPvCvyb_RyMXBKC9C)

Enter and confirm an amount to repay in the resulting modal.

## Withdraw

Select an asset in the "Assets borrowed" table and enter a value

![](/files/-MitQRDWqOonZZYRH08h)

Enter and confirm an amount to withdraw in the resulting modal.

## Ledger

In order to use your Ledger device with Solend (and other Solana dapps), you must [enable blind signing.](https://support.ledger.com/hc/en-us/articles/360016265659-Solana-SOL-?docs=true)

1. Connect and unlock your Ledger device.
2. Open the **Solana** app.
3. Press the right button to navigate to **Settings**. Then press both buttons to validate.
4. In the **Blind signing** settings, select **Yes** by pressing both buttons.


# Start Here (Mobile)

Our site is very well mobile-optimised! Check out the future of finance, anywhere and anytime. Simply follow these instructions to get started. &#x20;

Install the latest Phantom wallet (currently only on iOS [here](https://apps.apple.com/us/app/phantom-solana-wallet/1598432977)). Set it up as normal, or log in to your existing Phantom wallet account. Sweet Phantom UI looks something like this.

![](/files/ftNpJ73ZRg0emW4L5wND)

In the bottom right corner, click the Global web icon. This lets you browse websites to connect your wallet to. Go to <https://solend.fi>, our site.&#x20;

![](/files/pWoKs0OMXvtsAPie5KE0)

Solend will show up on Recently Connected in the future. Connect your Phantom to our UI in the top right hand corner.

![](/files/UYPmxI0PnmGFiofGKKnQ)

You can now view the various assets, and supply/borrow against them by selecting them on this screen.&#x20;

![](/files/SgyM9tYUE4r2e4vBm0Fs)

Check out your account details by clicking on "Show Account" at the top to see this screen, which details your current supply/borrows, and etc.

![](/files/rvoa7CeGPtIoQ0fPRejw)


# Supply & Borrow APY

### **Supply APY**

Users who supply collect an APY from the users who borrow. The borrow APY is split across the entire pool, so Supply APY = Borrow APY \* Utilization. For example, if there is 2 BTC in a pool, and 1 BTC is lent out at 20% APY, the suppliers of the 2 BTC will receive 10% APY each.

This APY is given in the **same token as the supply**. Deposit **BTC** for **BTC** yields, or **SOL** for **SOL** yields. This is because the APY on borrows is charged on the same yield as well. The displayed APY is based on compounding over a year.&#x20;

Each Token has a different set of [Parameters ](/protocol/parameters)that determines their actual yields at different points, and can be seen [here](/protocol/parameters).&#x20;

Additionally, you get [Liquidity Mining](/protocol/liquidity-mining) (LM) rewards on SLND, UST, stSOL and mSOL. These LM rewards are collectible on the 3rd of every month, at UTC Midnight.&#x20;

### Borrow APY

When you are borrowing, you are **paying** a Borrow APY to the pool (for the users who supplied). This borrow APY is calculated based on the [Parameters ](/protocol/parameters)& [The Math](/protocol/fees#borrow-apy), and are displayed on our UI when you borrow. Borrow APY is added to your loan on a per-slot basis, so the amount of money you have to repay goes up over time.&#x20;

![Get paid to borrow! ](/files/sdpsngajlEIv9HqgZl47)

On most of the tokens, such as USDC and SOL, borrowers also receive SLND rewards for borrowing. These are claimable on the 3rd of every month at UTC Midnight, same as [Liquidity Mining](/protocol/liquidity-mining). For these, you can even get paid to borrow, as SLND Rewards > Borrow APY. These are displayed on our UI as a negative APY.

There is no "Deadline" for you to repay your loans. They will just tick up over time, but you can repay them any time!&#x20;

&#x20;

## Liquidity Mining Rewards

### Viewing Rewards

Rewards can be viewed by clicking on the Pending Rewards button on the top right, near the Connect Wallet button.

![](/files/sXI3A0FlWjk62WKcdkJY)

![](/files/bQIMzk65bPkBiGN7569M)

### Claiming Rewards

Rewards are claimable on the 3rd of each month, at UTC Midnight.&#x20;

SOCN rewards for the month will be claimable once the token launches.

### LM 2.0

In addition to the standard LM program where users receive SLND tokens, we are currently running a trial on a LM 2.0 program that involves call options.

An additional 10% of SLND tokens have been earmarked for LM rewards with the following parameters:

Options are American Strike

Price: 50% of the SLND price at the end of March&#x20;

Expiry: One month

These details are subject to change, but the terms are as follows:

SLND price is at $2.00 on March 31st, you get to claim call options with a strike at $1.50 on April 3rd. You can then exercise them for the token, paying the strike to receive the full token. Exercising the option will involve topping up $1.00 per SLND token ($1.00 given to you + $1.00 your entry price). You can choose to hold or sell the SLND token after that.&#x20;

Again, details are subject to change, and will eventually replace our regular LM program.&#x20;

### Claiming & Exercising LM Options

On the 3rd of every month at UTC 00:00, your options become claimable alongside your regular LM rewards.

![](/files/iwOVT0epWyEZbTD6OgSu)

Currently, the parameters are set at 50% ITM. Thus, assuming a $2 SLND price at the end of March, the strike price of the option will be $1 USDC. This means that you can pay 1 USDC to receive 1 SLND token worth $2. The image above shows a SLND LM reward of 5 SLND options, worth $5.&#x20;

The expiry date shown is in real time, so it will expire exactly at the stroke of midnight according to the expiry date displayed (not slot times).&#x20;

![](/files/qBwjcSmBfvwCDUcS8xgr)

1 Option Token = 0.1 SLND token, so 5 SLND will be 50 Options as displayed by Phantom's UI. Thus, you can claim your LM rewards in denominations of 0.1. If you have <0.1 SLND, they will be rolled forward to the next month. Our UI will handle this, so no action is needed from you.&#x20;

\
When you're ready, click on the Exercise button shown below to open the exercise UI.

![](/files/r4TtJTo0pDkwKydWqn1k)

On our exercise UI, you can swap your USDC for SLND immediately without leaving our site.&#x20;

![](/files/aajXQPt2Zx9KuZp0EYRz)


# Liquidations

Your current "Borrow Balance" and "Supply Balance" are calculated using our 2 oracles, Pyth (main) and Switchboard (backup). Using these oracles, we can calculate your current health factor.&#x20;

When your Health Bar reaches the orange line, your account is open to being liquidated. This orange line, the Liquidation Threshold, is based on the [parameters ](/protocol/parameters)set on different tokens. We calculate this liquidation threshold based on the weighted average of all the assets you deposited. &#x20;

![This can be found in your Account Details screen](/files/rr3LC5c7ZQ13AimnUMq1)

When your account is open to being liquidated, our Third Party Liquidators will repay **20%** of your loans by selling the equivalent amount in Collateral. The liquidators will also collect an additional **5%** on the amount (20%) they liquidated, as a bounty to secure our protocol. You can learn more about becoming a liquidator [here](/developers/liquidators).

### Liquidation Example

Let's say Bob supplied $10,000 USDC and borrowed $7,500 of BTC. BTC then goes up by 6.69% putting the BTC value at \~$8,000, making Bobs account eligible for liquidation.&#x20;

The liquidator repays 20% of the BTC loan, $1,600, collects $1,600 from the collateral USDC supply to cover the BTC, then collects an additional 5% ($80) as a bonus for completing the liquidation successfully.&#x20;

Now Bob has $10,000 - $1,600 - $80 = $8,320 in USDC, and $8,000 - $1,600 = $6,400 in BTC borrows while the liquidator paid $1600 in BTC and received 1,680 in USDC, for a profit of $80.&#x20;

Bob's Liquidation Threshold drops from 80% -> 77%.&#x20;


# Risks

All DeFi protocols, including Solend, come with risks, which are important to understand before depositing significant amounts of crypto. The main risks involved in using Solend are outlined here.

**Smart Contract Risk**

This is a risk that the Solend smart contracts get exploited to steal or permanently freeze funds. This risk is inherent to all smart contracts and can never be fully eliminated, but can be mitigated in various ways.

* Solend has undergone audits by [Kudelski](https://github.com/solendprotocol/solana-program-library/tree/master/token-lending/audit), Neodyme, and OSEC.
* Solend has a [bug bounty program](https://docs.solend.fi/protocol/bug-bounty) which will pay up to $1MM if a critical vulnerability is found, in order to encourage responsible disclosure rather than hacking.

The Solend smart contracts have been live on mainnet with hundreds of millions in total value locked (TVL) since 2021.

**100% Utilization Risk**

When an asset is fully utilized (100% of supply is lent out), there are no tokens left in the pool, which means that withdrawals and borrows will fail. Users have to wait until the utilization rate goes down, either through some users repaying their loans or depositing new funds.

A user is more likely to be affected by this if their deposit represents a large share of the pool, or if the asset has extremely high borrow demand.

**Oracle Risk**

Solend relies on Pyth and Switchboard for their price feeds to power liquidations. There is a risk that these oracles report incorrect prices, causing wrongful liquidations.

**Liquidation Risk**

Solend offers over-collateralized loans, which means loans must be backed by collateral of greater value than the loan. If the value of the collateral dips below a threshold (determined by asset LTVs), a user's position will be liquidated with a liquidation penalty.

**Untimely Liquidation Risk**

In the event of large-scale liquidations or market turmoil, there is a possibility that assets liquidated are unable to cover the loans taken out by the liquidated user. The shortfall "or negative balance" is treated as "bad debts". Solend manages this proactively by isolating newer or riskier tokens in Isolated Pools and managing deposit limits or collateralization ratios to keep the protocol safe.&#x20;

In the past, Bad debt in main pool has been filled via top-ups from the Insurance fund, which can be found at our [DAO addresses](/daotoken/dao#dao-wallets).&#x20;


# FAQ

## FAQ

### Does Solend have a token?

Yes. SLND is a spl-token on [here](https://solscan.io/token/SLNDpmoWTVADgEdndyvWzroNL7zSi1dF9PC3xHGtPwp).

### What was the IDO price?

$6.57

### What oracles does Solend use?

Pyth and Switchboard

### When will Solend list X token?

Since Solend uses Pyth and Switchboard, it needs a feed from one in order to list an asset.&#x20;

You can suggest tokens for isolated pools in Solend [Discord](https://discord.gg/solend).

### Why are fees a couple dollars?

*TL;DR it's only expensive the first time you use Solend.*

Solana state [accounts](https://docs.solana.com/developing/programming-model/accounts) need to be created to store state about your positions on Solend. Some SOL is required to make these accounts rent-exempt. These fees are only paid once, the first time you interact with Solend. [Read more](https://docs.solend.fi/protocol/fees#solana-network-fees).

### What is Nope?

Nope Finance is a project that Solend [acquired in June](https://blog.solend.fi/solend-acquires-nope-finance-a9ef9b11e4c6). Nope Finance already had the NOPE token, so Solend offered a conversion to bring the Nope community into Solend's.

Conversion can be done by following this [guide](https://docs.google.com/presentation/d/1Izm7N2mcMj629YkmgNcbJC4Jn3DeR0FOAIKKMlJtH4I).

To summarize, visit a Serum DEX client (e.g. [Bonfida](<https://dex.bonfida.org/#/market/L48mQEKqj4f9BAcokgbB2vZ29w8X8HaYS3njco5JfRH >)) and manually add the SLND/NOPE market. The market ID is `L48mQEKqj4f9BAcokgbB2vZ29w8X8HaYS3njco5JfRH`. The conversion rate is 346.15038 NOPE to 1 SLND. Details of this announcement are [here](https://blog.solend.fi/og-airdrop-nope-conversion-25f28679f250).


# Debugging FAQ

## Debugging FAQ

### Transaction too large: 1317 > 1232

Usually caused by having too many positions and trying to operate on SOL which uses WSOL under the hood. The extra work that needs to be done causes the transaction to be too large.

![User has a total of 6 positions. Even though they have a tiny amount of borrows, each position counts.](/files/-MjOKA7cSm7F8y254CpF)

**Fix:** Close one of your positions. This can be done by *fully* repaying one of your borrows, or fully withdrawing one of your deposits (other than SOL). You may have to buy some tokens to repay the tiny amount of debt for a borrow. Then try withdrawing SOL again.

### Error: Transaction was not confirmed in >60 seconds. It is unknown if it succeeded or failed.

![](/files/yQKtnSdF1F8NPA0yWKmE)

Confirm whether the transaction went through by using a Solana Explorer, either SolanaFM or Solscan to check whether the transaction went through. Alternatively, you can wait for a few minutes to see if your transaction is reflected on the platform. If not, try switching RPC Nodes.&#x20;

![](/files/GNV1Ie5c8MpPDmBCc8r6)

### Error: User rejected the request

![](/files/svjT3gTSQWA8JsefNcUp)

Usually a ledger issue or RPC issues, refresh and try again.

### Error: Account is already initialized

![](/files/9Zg91fYJ4m9ROiEmwEvQ)

Caused by a lack of SOL / unable to pay rent for account creation. Ensure that the wallet has 0.1 SOL.

### Error: Input Oracle Config

![](/files/PpX4KHHcXLpW2paTF31f)

This happens when Switchboard/Pyth is not pushing price updates, usually due to network congestion. Try again later when TPS is higher, or flag the situation in [Discord](https://discord.gg/solend).&#x20;

### Error: SOL disappeared

If a transaction fails, you might get wrapped SOL instead of SOL. This may look like your SOL disappeared, simply go to Jupiter to swap wSOL back into SOL.

It will look like this:

![](/files/8E8uBpeSLQbwJKe45IX7)

If you still need help, come join our [Discord ](https://discord.gg/solend)or open a [Support Ticket](https://discord.com/invite/J7m48UUPkJ).


# DAO

## DAO Wallets

<table><thead><tr><th width="174.92236740968488">Description</th><th width="593.4285714285713">Address</th></tr></thead><tbody><tr><td>fee receiver</td><td><code>9RuqAN42PTUi9ya59k9suGATrkqzvb9gk2QABJtQzGP5</code></td></tr><tr><td>orca LPs</td><td><code>AHcFLPeD964ucZ4F4b3ikPNHDPp8kz1ZmW7nid7r1hBQ</code></td></tr><tr><td>other treasury operations</td><td><code>GDmSxpPzLkfxxr6dHLNRnCoYVGzvgc41tozkrr4pHTjB</code></td></tr><tr><td>Maple tbill deposit</td><td><code>GYeMfpu1navNDeocAhLu27pCPqJBdYxGaRoAKyvz8kry</code></td></tr><tr><td>treasury msig</td><td><code>EaFPY9LTQeFR7SEyfbKKFuVMtYvUBbYiiK7WvBJJ7iBU</code></td></tr><tr><td>LM msig</td><td><code>5QbRL9MU5QakL5Fx2He9YaiUzB3TQpVAUBR2ARKN1NrM</code></td></tr><tr><td>gnosis safe (eth)</td><td><code>0xA21a60651183c11eCa1E6aA03B2cEBbe49Ca1a4E</code></td></tr><tr><td>treasury operations (eth)</td><td><code>0xF41f7FebD6574FE0B08B999598df44f6B3E95006</code></td></tr><tr><td>treasury operations (sui)</td><td><code>0xb737c9c6bf4d42ebeb68c67dff2ea03a8cc82fda24067f3eaf5f3dd627a8d866</code></td></tr><tr><td>2nd treasury operations (sui)</td><td><code>0x87a9375c824743f8729110368f18ab3420e67c0191795f13f5c0cc9a626a41ab</code></td></tr><tr><td>treasury msig (old)</td><td><code>BX1VZoS4sDyBeXWuLzfbngYtdJGEEBK39PzUGfWYpFNu</code></td></tr></tbody></table>

These wallets belong to the DAO and will be governed by SLND holders.


# Token

There are 100M SLND tokens. SLND’s distribution is as follows:

![SLND token distribution. Note that IDO allocation is part of the treasury.](/files/4B3qO2aKqdjdVqaRbHTH)

60% of SLND is allocated to the community. Half of that is allocated to the liquidity mining program and the other half is allocated to the Solend Treasury, owned and governed by the Solend DAO. 5% of SLND is allocated to the IDO, coming from the treasury. The Solend Treasury will own the IDO funds and LP position (details in IDO section.)

25% of SLND is allocated to the core team.

15% of SLND is allocated to VCs and Angels. Only 10% was distributed in the seed round, but an additional 5% is set aside for a potential future raise in case it’s needed.

### **Lockups** <a href="#id-671c" id="id-671c"></a>

Seed round participants have a 3-year unlock schedule with the first third unlocking October 1, 2022, and the rest unlock 1/36th monthly after. The team also has a 3-year unlocking schedule with the first third unlocking June 1, 2022 or later (based on join date). There is no lockup for IDO participants.

### Circulating supply

Solend's liquidity mining program is the main driver of circulating supply, especially early on. See this [spreadsheet](https://docs.google.com/spreadsheets/d/19YcoT2redeLiok_91jELsqEi2zAxpPF-cYFA6QN64yE) for a projection of the SLND circulating supply.


# IDO

*Read the IDO announcement here:*

{% embed url="<https://medium.com/solend/fundraise-tokenomics-and-ido-f9536b061973>" %}

IDO is available at [ido.solend.fi](https://ido.solend.fi/) and will be live on Nov 1, 2021 at 12:00pm UTC. There's also a backup at [ido-ui.pages.dev](https://ido-ui.pages.dev).

The IDO UI is open source and available at <https://github.com/solendprotocol/ido-ui>


# Solend Pools

![](/files/gd7dd9jSYro7N7tPsC2n)

The majority of Solend TVL sits in a global main pool and a series of smaller isolated pools and permissionless pools.&#x20;

The global main pool can be accessed on the main page [here](https://solend.fi/dashboard), and follow the set [parameters ](broken://pages/-MfR1AEZhIRJC3yBzp2L)(variables set for each token).&#x20;

Tokens can be listed in the main pool if they do not represent an increase in risk, mainly by having reliable oracles or thick liquidity to assist in liquidations. Most tokens will be listed on Isolated pools first before proceeding to Main pool after sufficient time.&#x20;

![](/files/UywLjbF1PebOyLj7GHZd)

Isolated pools are smaller pools that are used to list slightly riskier tokens such as Locked Staked IN (lsIN) or future tokens like xSTEP or SAMO. As these tokens have less liquidity and are more volatile, they might be an exploitable opportunity or a risk for the main pool,  isolated pools are used to screen/quarantine them before adding them to the main pool.&#x20;

This way, any exploit or risk will only affect the smaller TVLs present in the isolated pools instead of risking the bulk of TVL in the main pool.&#x20;

Permissionless pools allow anyone to create an isolated pool on Solend. The creator decides and earns 20% of origination fees generated in that pool. Therefore, a successful Permissionless Pool means success for the pool creator.

There will be many more isolated pools to come. If you're interested in a particular one, bring it up on [Discord](https://discord.com/invite/solend), or come join our #permissionless-pools channel in Discord to talk about new pool ideas!&#x20;


# Parameters

**APIs:** When in doubt, follow the data [here](https://app.swaggerhub.com/apis-docs/solendprotocol/API/1.0.1#/Reserves/get_v1_reserves_).\
\
This config also includes oracles used, their addresses, refresh rates, and is better for integration.

For non devs, parameters are available in app by clicking any asset then clicking "More parameters"

### Parameters:

Each reserve in Main or Isolated pool has these parameters that balance the supply & demand of the pool or governs the size of the loan you can take out (based on the quality and liquidity of the collateral asset).&#x20;

The critical thing to remember is the borrow APR changes based on utilization. Utilization is Tokens Borrowed / Tokens Supplied. At 0% utilization, there is excess supply and no demand, while at 100% there is excess demand but no supply. Details are in [Protocol Math & Fees](https://docs.solend.fi/protocol/fees).&#x20;

| Parameter                | Value                                                         |
| ------------------------ | ------------------------------------------------------------- |
| Optimal utilization rate | Utilization where borrow APR starts to increase exponentially |
| Loan to value ratio      | Borrow X% against your collateral                             |
| Liquidation penalty      | % of your liquidated collateral to incentivize liquidators    |
| Liquidation threshold    | Account health that will trigger a liquidation                |
| Min borrow APR           | Borrow APR when Utilization = 0%                              |
| Optimal borrow APR       | Borrow APR when at optimal utilization                        |
| Max borrow APR           | Borrow APR when utilization = 100%                            |
| Borrow fee               | Origination fee Solend keeps when you borrow                  |
| Flash loan fee           | Origination fee Solend keeps when you borrow via flash loan   |
| Host fee percentage      | % of borrow fee kept by referral, UI or pool creator          |
| Deposit limit            | The cap of tokens that can be deposited into the pool         |
| Borrow limit             | The cap of tokens that can be borrowed into the pool          |

## Recovery Mode:

Recovery Mode is triggered during times of heightened volatility or network congestion. During Recovery Mode, a council of contributors can make parameter changes with greater flexibility to minimize bad debt and damage to Solend and its users.&#x20;

\
**Note:** These changes might lead to liquidations occurring, done so without liquidation penalty in market turmoil. These changes are made to reduce bad debt for Solend as a whole, and may lead to user positions being forced closed by liquidators without penalty. <br>

When Recovery Mode triggers, announcements will be made on [Twitter](https://twitter.com/solendprotocol) and in [Solend's Discord. ](https://discord.gg/solend)A Banner will also be added on the primary Solend UI at:<https://solend.fi>.&#x20;


# Fees

## **Borrow APR**&#x20;

Solend charges an interest rate for borrowing assets. The borrow APR is set algorithmically, a function of utilization of the pool.

The following piecewise function is used:

![](/files/G4dJHt4p4CBT8TOCEwOA)

Which then produces the following graph:

![](/files/yBIP6GkFCwOX3szbMCNs)

## **Protocol Fees**

### **Interest Rate Spread**

Interest rate spread is a percentage of the borrow interest rate that Solend receives as protocol revenue. The interest spread is 20%.

### **Origination Fee**

Origination fee is a fee charged upon the origination of a loan. Applied once when borrowed, upfront.&#x20;

Solend's origination fees are broken down into a program fee and host fee. The host fee can be collected by any interface that refers loans to the protocol.

The fees for most vaults are set to 10 bips (0.1%). There's an 80/20 split between protocol and host fee. Check in-app or on the [Broken mention](broken://pages/-MfR1AEZhIRJC3yBzp2L) a page for specific asset rates.

### **Liquidation Fee**

Liquidation fee is a percentage of the liquidation penalty that Solend receives. These funds go to the DAO treasury. The liquidation fee is currently 30% of the liquidation penalty.

## Solana Network Fees

There are two types of fees you pay on the Solana blockchain when transacting: [transaction fees](https://docs.solana.com/transaction_fees) and [rent fees](https://docs.solana.com/implemented-proposals/rent).

#### Transaction fees

These fees compensate the validator network for the CPU/GPU and network resources necessary to process the state transaction. Transaction fees are extremely cheap (currently 0.000005 SOL).&#x20;

#### Rent fees

These fees compensate the validator network for the memory resources that are required to store state in an account. Accounts which maintain a minimum balance equivalent to 2 years of rent payments are exempt from paying rent. When solend.fi is used, accounts are allocated on behalf of the user and funded with enough SOL to be rent-exempt. This amount can be recuperated later when the account is closed (though this isn't yet implemented on solend.fi). Rent fees can be expensive compared to transaction fees (\~0.01 SOL), but are only paid the first time a user is interacting with Solend.


# Liquidity Mining

## LM 2.0

*Starting July 1st, 2022, all SLND rewards on Solend will become options. Read the announcement* [*here*](https://blog.solend.fi/liquidity-mining-2-0-phase-3-dd8722b6916f)*.*

Details of the options:

* American style (can be exercised any time)
* Strike price of 30% of the price of SLND at the end of the period
* 1-year expiry
* Redeemable at the beginning of the next month as with other rewards

Exercise your SLND options by paying 10% of the total value in USDC and receive the 90% as your LM reward. APRs on the UI have accounted for the exercise cost.&#x20;

### Liquidity Mining

*See announcement article* [*here*](https://medium.com/solend/retroactive-liquidity-mining-e917311143bf)*.*

SLND is being emitted at a rate of 0.1585 per slot *(10M / slots per year* where slots are every 500ms or *10,000,000 / 63,072,000*). SLND rewards are distributed proportionally according to each market's weight.

For example, consider the sum of all weights is 28. If an asset's borrows are incentivized with 6x SLND, it means borrowers are rewarded 6/28 of the monthly SLND emissions.

Additionally, some assets are incentivized by partner rewards. The reward schedule is as follows:

### Ongoing Rewards

These are more predictable and less likely to run out.&#x20;

<table><thead><tr><th>Asset</th><th width="165">Supply</th><th width="150">Borrow</th></tr></thead><tbody><tr><td>SLND</td><td>2x SLND options</td><td>N/A</td></tr><tr><td>SOL</td><td>N/A</td><td>6x SLND options </td></tr><tr><td>USDC</td><td>N/A</td><td>9x SLND options</td></tr><tr><td>USDT</td><td>N/A</td><td>4x SLND options</td></tr><tr><td>stSOL</td><td>80k LDO + 1x SLND</td><td>N/A</td></tr><tr><td>mSOL</td><td>MNDE + 1x SLND</td><td>N/A</td></tr></tbody></table>

### Period Rewards

<table><thead><tr><th width="152">Asset</th><th width="150">Supply</th><th width="150">Borrow</th><th width="150">Start date</th><th>End date</th><th width="261.2224208523153">End slot</th></tr></thead><tbody><tr><td>N/A</td><td>N/A</td><td>N/A</td><td>N/A</td><td>N/A</td><td>&#x3C;Not Confirmed></td></tr></tbody></table>

There are currently no period rewards.&#x20;

\*Actual end date is defined by a slot number, which may diverge from the estimated date due to blocks processing faster or slower than expected.&#x20;


# Limits

## Position Limits

An account can have at most 6 positions. A position is any supplied or borrowed asset. This limit is due to the Solana [compute limit](https://docs.solana.com/developing/programming-model/runtime#compute-budget), since attempting to enter more positions would cause the transaction to fail. We plan to address this in the future.

For example, Alice is supplying {10 SOL} and is borrowing {1 SOL, 5 USDC}. She has 3 positions in total.

For now, the workaround for more positions is to use multiple accounts.


# Media

Media kit [here](https://drive.google.com/drive/folders/1FoabZUFD5D-eVNT2LkDToPGX-NFnNn9S).


# Audit

Solend has been audited by [Kudelski](https://kudelskisecurity.com/). View the report [here](https://github.com/solendprotocol/solana-program-library/tree/master/token-lending/audit).

We have also used Soteria's scanner [here](https://www.soteria.dev/software), and cleared all vulnerabilities.

The Solend smart contracts are fully [open source](https://github.com/solendprotocol/solana-program-library) and have been since before the mainnet launch.

We built Solend using spl-token-lending as a starting point, which has been repeatedly audited/battle tested and used by many other teams in the space. We also intend to go through another round of audits if we make any major changes.&#x20;


# Bug Bounty

## Program Overview

The bug bounty program covers the Solend smart contracts (no UI bugs) and is focused on preventing thefts and freezing of funds.

The Solend smart contracts are fully [open source](https://github.com/solendprotocol/solana-program-library).

## Rewards

Rewards are distributed according to the following classifications:

| Severity | Max Prize                                  |
| -------- | ------------------------------------------ |
| Critical | 10% of value at risk, up to $1,000,000 USD |
| High     | $50,000 USD                                |
| Medium   | $5,000 USD                                 |

Severity is classified by the following:

| Severity | Description                                                                                                                                                                    |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Critical | <p>- Empty or freeze the contract's holdings (e.g. economic attacks, flash loans, reentrancy, MEV, logic errors, integer over-/under-flow)<br>- Cryptographic flaws</p>        |
| High     | <p>- Token holders temporarily unable to transfer holdings<br>- Users spoof each other<br>- Theft of yield<br>- Transient consensus failures<br></p>                           |
| Medium   | <p>- Contract consumes unbounded gas<br>- Block stuffing<br>- Griefing denial of service (i.e. attacker spends as much in gas as damage to the contract)<br>- Gas griefing</p> |

The actual prize amount is determined by a combination of factors including but not limited to severity, value at risk, and likelihood of being exploited.

Payouts are done in vesting SLND on Solana. This is anon-friendly (no KYC required).

## Reporting

Email us a detailed description of the attack at [security@solend.f](mailto:security@solend.fi)i. Critical and High bug reports must come with a proof of concept.

## Scope

#### Assets in Scope

[Smart contract code](https://github.com/solendprotocol/solana-program-library/tree/871935cafc590bf1985bebfbc7e6399b153a5b40/token-lending)

The main file of the lending program is [here](https://github.com/solendprotocol/solana-program-library/blob/871935cafc590bf1985bebfbc7e6399b153a5b40/token-lending/program/src/processor.rs).&#x20;

**Impacts in Scope**

Only the following impacts are accepted within this bug bounty program. All other impacts are not considered as in-scope, even if they affect the assets in the scope table.

**Smart Contracts**

* Loss of user funds staked (principal) by freezing or theft
* Loss of governance funds
* Theft of unclaimed yield
* Freezing of unclaimed yield
* Temporary freezing of funds for at least 1 hour
* Unable to call smart contract

#### Known Issues (not qualified)

Bug reports involving position limit, where a user can only have so many positions before actions fail due to the computation limit, are not accepted in this bug bounty program.

Bug reports involving borrow limit, where a user can borrow even when the limit is set, are not accepted in this bug bounty program.

#### Prioritized Vulnerabilities

We are especially interested in receiving and rewarding vulnerabilities of the following types:

**Smart Contracts and Blockchain**

* Re-entrancy
* Logic errors
  * Including user authentication errors
* Trust/dependency vulnerabilities
  * Composability vulnerabilities
* Oracle failure/manipulation
* Novel governance attacks
* Economic/financial attacks
  * Flash loan attacks
* Congestion and scalability
  * Running out of gas
  * Block stuffing
  * Susceptibility to front-running
* Consensus failures
* Cryptography problems
  * Signature malleability
  * Susceptibility to replay attacks
  * Weak randomness
  * Weak encryption
* Susceptibility to block timestamp manipulation
* Missing access controls / unprotected internal or debugging interfaces

## Out of Scope Rules

The following vulnerabilities are excluded from the rewards for this bug bounty program:

* Attacks that the reporter has already exploited themselves, leading to damage
* Attacks requiring access to leaked keys/credentials
* Attacks requiring access to privileged addresses (governance, strategist)

**Smart Contracts and Blockchain**

* Incorrect data supplied by third party oracles
  * Not to exclude oracle manipulation/flash loan attacks
* Basic economic governance attacks (e.g. 51% attack)
* Lack of liquidity
* Best practice critiques
* Sybil attacks

The following activities are prohibited by this bug bounty program:

* Any testing with mainnet contracts; all testing should be done on devnet or private testnets
* Any testing with live pricing oracles or live third party smart contracts
* Attempting phishing or other social engineering attacks against our employees and/or customers
* Any testing with third party systems and applications (e.g. browser extensions) as well as websites (e.g. SSO providers, advertising networks)
* Any denial of service attacks
* Automated testing of services that generates significant amounts of traffic
* Public disclosure of an unpatched vulnerability in an embargoed bounty


# Oracles

Solend's program primarily rely on Pyth and Switchboard as a backup.&#x20;

These price feeds determine account health for liquidation.

Each oracle has feed-dependent refresh rates and can be checked out here:

[Pyth ](https://pyth.network/markets/)& [Switchboard](https://switchboard.xyz/explorer)


# Introduction

Permissionless Pools allow anyone to create an isolated pool on Solend. The creator decides and earns 20% of origination fees generated in that pool. Therefore, a successful Permissionless Pool means fees generated for the pool creator.

Permissionless Pools unlock the following:

* **Ability to list tokens faster**: The core Solend team can only list so many tokens. Allowing anyone to list Permissionless Pools themselves means opening the floodgates for anyone to list any asset.
* **Utility for any token:** The idea that any token can be listed is a powerful one. With this, any asset wrapped as an SPL token has utility in being accepted as collateral for a loan.
* **Protocol owned market**: With 20% of origination fees generated in the pool going to the creator, user growth of the pool rewards both Solend and the pool creator. Protocols and influencers can create their own pools and promote it to their audience. Similar to what Uniswap did for tokens in DeFi Summer, Permissionless Pools unlock utility for the long tail of assets.

If you have any questions, ask us in the #permissionless-pools channel on [Discord](https://discord.gg/solend)!

**Oracles**

Solend relies on oracles to retrieve the price of a token for liquidation or account health calculations.

Creators can create Switchboard V2 oracle fees relatively easily by following this [guide](/permissionless-pools/switchboard-v2-guide). Permissionless Pools will be powered by [Pyth ](https://pyth.network/)and [Switchboard ](https://switchboard.xyz/)oracles.

**All Pools Page**

With this launch, a UI revamp is coming on our “All Pools” page! You can easily see which pools are permissionless and which ones are created by the Solend team. As Permissionless Pools have higher levels of risk and due diligence needed.

You can also click “Create Pool” to create your own pool via this UI.

**Liquidators**

Liquidations are important to maintain pool health and keep deposits safe. It is the pool creator’s responsibility to ensure the health of these pools and ensuring liquidators are operating in the pool.

As it is possible for anyone to create a permissionless pool and list it on Solend, it is important for users to take extra caution. In the event of bad debt or wrongful liquidations, Solend will not be able to compensate users. Solend's team have built an open sourced liquidator [here](https://github.com/solendprotocol/liquidator), which should serve as a starting point for you.&#x20;

Feel free to reach out on Discord if you have questions!&#x20;

**Configs**

At pool creation, creators can specify the configs for their pool. Some examples include Loan-To-Value or Max Borrow APRs. These configs will be displayed on the supply/borrow pages; be sure to review them before depositing or borrowing!

![Verify the configs and oracles here](/files/nuVUlT3T2jDXXn2EV2rY)

**Fees**

There’s a fee of 100 SLND to create a Permissionless Pool. This fee serves to prevent spam pools from being created. In return, pool creators get 20% of borrow fees according to the host fee priority [here](/developers/developer-referral-fee).&#x20;


# Risks

#### 💡 Take note that Solend does not conduct due dilligence or verify the safety of each Permissionless Pool. Read this page to understand the risks of Permissionless Pools.

#### How does a user stay safe in Permissionless Pools?

1. Understand all the tokens present in any Permissionless Pool (even if you are depositing USDC).
2. Make sure the parameters are realistic.
3. Ensure that a liquidator is running in the pool.
4. Check that the oracle is displaying the correct price.
5. Understand who (individual/multisig/dao) owns the pool. As pool owners are able to change parameters or add new assets to the pool at anytime.

Note: Solend does not reimburse for losses incurred in a Permissionless Pool. It is important to conduct your own research on each pool.

### Risks:

Let’s assume a pool of the following two reserves when discussing risks:&#x20;

**SNDO**: A governance token of a new project

**USDC**: Standard USDC

**Token Risk**

SNDO is a new token that you might not be familiar with. The risk of this token will affect the entire pool, even if you are just depositing USDC. For example, if a user managed to mint infinite numbers of SNDO, and deposits it to borrow USDC, it is possible to drain the pool. This could happen via an exploit by external parties or the team behind the token.

To assess this risk, you can research the mechanisms of the SNDO token, mainly around how new tokens enter the market (how tokens are minted), and the smart contract risks associated with the platform.

**Liquidity Risk**

As tokens can be listed permissionlessly with configs up to the creator, there is a chance of low-liquidity tokens being listed with “stable/safe” configs.

For example, if an open LTV of 75% is set, users can borrow $0.75 of USDC against $1 of SNDO. However, if SNDO is a new token with low liquidity, it might be common to have 15-20% slippage.

This means that a liquidator might not be able to reliably liquidate SNDO to pay back USDC debts, causing user’s health to turn negativ&#x65;**,** and bad debt for the pool.

**Liquidator Risk**

For Permissionless Pools, Solend will not be operating a liquidator to ensure that all the pools are kept healthy. Pool creators are responsible for ensuring that a liquidator is operating for smaller tokens such as the SNDO token.

Users should use pools that have a reliable liquidator. Learn more about how to run one [here](https://github.com/solendprotocol/liquidator).

**Oracle Risk**

For Permissionless Pools, pool creators are expected to create their own oracles. These oracles can be prone to error or used incorrectly (e.g. USDC oracle used for UST price). SNDO’s price might be inaccurate or stale, causing liquidations or preventing users from withdrawing or borrowing.

We have a doc on Switchboard oracle listings [here](/permissionless-pools/switchboard-v2-guide). Pool creators can follow it to learn how the existing oracles are created. Users can also read it to self-verify that an oracle is well created.


# Pre-Listing Checklist

This guide is for users who want to create their own pool. It assumes familiarity with Solend and an understanding of basic DeFi principles. Permissionless Pools are powered by the same smart contracts that power Main and Isolated Pools.

**Plan ahead for configurations**

Start your pre-listing prep with this [sheet ](https://docs.google.com/spreadsheets/d/1PDJoJHWSTZOwqUzhZC9-bnpibkB7BYS4Tbrt4PH4ywQ/edit?usp=sharing)(make a copy and fill it out). Plan ahead for the tokens you want to list along with their configurations. Their config definitions can be found here.

**Eligible Tokens**

In order to maintain the high quality UX on the Solend app, tokens must be on the token-list repo with a name, symbol, decimals and a high-def logo. If not, the token will not show up on the listing.

#### **Reserves**

For every token you want to list in the pool, you need one reserve with an initial deposit. To list a token, it must be on SPL-Token-List, and you need its mint address.

You will then need to deposit a small amount to start the pool. Depositing 0.01 X is enough.

Note: this deposit cannot be withdrawn.

#### **Oracles**

Assets in Main Pool are powered by both Pyth & Switchboard oracles, while most smaller cap tokens (SHDW, UXP, etc) only use Switchboard.

If the Solend team already maintains oracles for the token chosen, such as SOL/USDC/USDT they are automatically pre-filled for you in the permissionless pool creator UI.&#x20;

If the token you are trying to list does not have an existing oracle, proceed to use Switchboard’s [Publisher ](https://app.switchboard.xyz/)+ our [guide ](/permissionless-pools/switchboard-v2-guide)to create your own oracle.  This would be common for new tokens. Take note that there is a SOL fee for maintaining an oracle on-chain.&#x20;

#### Configs

Next, you can set the configs you want for your pool. Configs such as LTVs, liquidation thresholds and APRs at different utilization. Fill in the numbers in this section if you have specific configs in mind.

![Reference existing configs on Solend's dashboard. ](/files/POvHFB1cHGNKf4UvQNTa)

If you are unsure of the configs, we have pre-filled option for Stable (stablecoins), Risky (for large cap tokens like SOL) or Very Risky in our pool creator UI later.&#x20;

#### Liquidator

If you are listing a new token that isn’t present on the Solend platform, you will need to set up a liquidator to maintain pool health. You can read about doing so [here](https://github.com/solendprotocol/liquidator).

Creators are responsible for running a liquidator for their Permissionless Pool, our open sourced repo is [here](https://github.com/solendprotocol/liquidator). If help is needed, feel free to come to the liquidator or dev-support channel in [Discord](https://discord.gg/solend).

**Final Checklist:**

1. Do you clearly know what reserves you want to create and with what configurations?
2. Are your assets available on the token-list repo and on Jupiter?&#x20;
3. Do you have your Pyth/Switchboard addresses for each reserve you want to create?
4. Is there a liquidator operating on all assets?
5. Is your Google sheet filled in with all the information?


# Listing a Pool

Now that you have a filled out the Google sheet, we can begin pool listing.

Proceed to Solend’s All Pools page at: <https://solend.fi/pools>, and click on the “Create Pool” button on the top right corner.&#x20;

![](/files/UlLmDFzlqqZ6oQJwsBvy)

You will be directed to the Permissionless Pool creator.

**Panel 1 - Get Started**

![](/files/9lDyMr5nQxx5RXQZrXft)

Creating your own pool requires an initialization fee of 200 SLND. You’ll get 20% of the borrow fees generated by this pool in return!

**Panel 2 - Pool Overview**

![](/files/P4hgpIQfxQ2X9VvwWw7B)

Next, type in the name of your pool and its description. Note that Solend automatically appends the word ‘Pool’ on the UI.&#x20;

It will be displayed on Solend’s UI for users of your pool:

![](/files/f9Ur75eQBDNbWOc8GcOl)

**Panel 3 - Reserves Creation Page**

![](/files/gptlizT66SD3MrgqBdmf)

You already have all of this information in your Google sheet! Simply copy and paste all the information over to these fields. Repeat until all the reserve details are keyed in.

Note that if you ever have to edit these details in the future, you will have to use our edit pool form here.

**Panel 4 - Launch Pool**

![](/files/Hg7WGsSaAAQFGg28nBcW)

Hit "Register Pool" here and Solend will generate the pool creation transactions for you. Your wallet will pop up multiple times for you to approve certain transactions.&#x20;

Make sure to do this step when the network is operating well as transactions might otherwise fail. Also note that you need around 0.2 SOL + some tokens of all the reserves you want to create.

After all the transactions go through, you can complete the pool creation process!&#x20;

**Panel 5 - Register Pool**

![](/files/cu4LBJSfH2ZcXqHucroM)

This process hands authority over your pool over to Solend’s smart contracts, and further edits will have to be done through the Edit Pool form here. This is the final step, and your pool will appear on our UI after 5 minutes. Make sure to keep your token accounts open to receive 20% of borrow fees generated!&#x20;


# Post-Listing

Now that you’ve created your pool, what’s next?

1. Test the Pool
2. Bootstrap the Pool
3. Run Liquidator
4. Marketing to Users
5. Earn Borrow Fees

#### Test **the Pool**

Your pool is powered by the same contracts that power our Main & Isolated Pools and should work and feel the same.

Proceed to test the same actions (Deposit, Borrow, Repay or Withdraw) on your own pool.

Make sure your pool shows up correctly on the All Pools page and try it out by borrowing.

#### Bootstrap the Pool

When Solend launches a pool, it is usually bootstrapped with some small deposits & borrows to encourage activity and display a borrow APR. You can do the same by depositing and borrowing around $1,000\~ in each reserve.

If you are listing a pool with a Governance Token + USDC, depositing some USDC for your users to borrow from is ideal.

#### Run Liquidator

After generating the lending market address, double check that the liquidator can liquidate this pool. Additionally, ensure that your liquidator is funded and operational.

#### Marketing to Users

Now that your pool is listed and bootstrapped, it’s ready for users to use it. Copy & paste the Permissionless Pool link and announce it to your community and potential users!

#### Earn Borrow Fees

The pool creator is entitled to 20% of all the borrow fees generated by the platform, while the depositors earn the supply interest.

Be sure to keep your token accounts open to receive your share of the borrow fees!


# Managing a Pool

Permissionless pool creators have full ownership of their pools and can update parameters through the pool admin interface to add assets, update parameters, and update market properties

## Pool admin page

If you are the owner of a permissionless pool, the "Edit pool" button will show. Clicking it opens the pool admin page.

<figure><img src="/files/kfqaf2GABZvo1TlZx6K0" alt=""><figcaption><p>Screenshot of a permissionless pool. Note that the owner and connected wallet match.</p></figcaption></figure>

<figure><img src="/files/LBAYWuNhtcnZH1GsIAyV" alt=""><figcaption><p>pool admin page</p></figcaption></figure>

### Add asset

Pool owners may wish to list new assets. This can be achieved through the "Add reserve" panel on the admin admin page.&#x20;

<figure><img src="/files/MVipDmzpBM50YugqZ8mr" alt=""><figcaption><p>Adding a new reserve through pool admin page</p></figcaption></figure>

### Update existing assets

Asset parameters can be updated through the "Update reserve" panel. Be aware that updates to the reserve should be taken seriously as they may lead to user liquidations. Pool owners may wish to update a reserve's configuration to reflect the underlying token's risk, update supply/borrow apys, deprecate a token, set outflow limit, etc...&#x20;

&#x20;**⚠️ When in doubt, please reach out in the Solend Discord for assistance**

It is recommended for pool owners to give their users a 2 week notice before executing reserve updates so users may tweak their positions accordingly.

<figure><img src="/files/fqYMiPlRTD3m7TYhZMwE" alt=""><figcaption><p>Update reserve panel for permissionless pool owner.</p></figcaption></figure>

Changes to reserves can be observed through the blockchain and surfaced to users through the reserve changelog which is accessible on the pool's page

<figure><img src="/files/IRpQL7kGoZVTb7euLvZ4" alt=""><figcaption><p>bonk pool's change log</p></figcaption></figure>

## Update market properties

A market contains one or more reserves and has control over its underlying reserves. Pool owners may use the update market config for the following reasons:

* **Transfer the market ownership to a different wallet or multisig** \
  ⛔️ Note: whoever holds the market owner, holds control over its reserves! If you accidentally send the market owner to the wrong address, nothing can be done to get it back so be extra careful when dealing with market property updates&#x20;
* **Set global outflow limits for the market**. This param limits the damage possible due to an exploit. Using the screenshot below as an example, it means that a maximum of $10M can be borrowed or withdrawn from the Cactus pool in a 4 hour period

**⚠️ When in doubt, please reach out to the team on discord for assistance**

<figure><img src="/files/8acwtH6jScvMlb8tvEQI" alt=""><figcaption><p>update market config panel</p></figcaption></figure>


# Switchboard v2 Guide

Creating a Switchboard oracle for Solend is easy by relying on their publisher [here](https://publish.switchboard.xyz/). Take note that creating oracles costs SOL, \~0.04 SOL a day will be consumed based on our configs.

This process might be a bit tough, so feel free to get help from Soju on Discord!

#### Deciding Where to Pull Prices from

Before we can start listing the oracle, we need to decide where the oracle will pull prices from. This would mainly be from centralized exchanges like binance or [Gate.io](http://Gate.io), or decentralized exchanges like Raydium or Orca.

Pull up Coingecko’s Markets tab for your token, like the following for SLND:

![](/files/caEPPtrQuJTkLblCQbHG)

We can see that most of the trading volume for SLND takes place on Gate and MXC for centralized exchanges, and Raydium for decentralized exchanges.

Let’s pull prices from these sites.

#### Fetching Prices from Web2

To pull prices from centralized exchanges, we will use pre-built scripts for each exchange listed on the Appendix of this page. Alternatively, you can do a Web2 fetch under the Switchboard UI (centralized exchanges are Web2).

For Gate, we need to add an extra step for the “multiplyTask”. Gate quotes SLND in terms of USDT, so we need to convert USDT to USD. We do this via the second half of the script, where it says:

```cpp
    {
      "multiplyTask": {
        "aggregatorPubkey": "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9"
      }
```

In the Appendix, we have the oracle aggregators for USDC/USD, USDT/USD, and SOL/USD. Since Gate quotes in terms of USDT, we need to add in the USDT/USD oracle to convert the USDT price to the USD price. Simply make sure that the “aggregatorPubkey: \<USDT/USD Oracle>”.

#### Fetching Prices from Web3

For Orca or Raydium LPs, we will need to fetch the “LpExchangeRate” of a liquidity pair, such as SLND/USDC, and do the same multiply task as above.

![](/files/ojkByUmRj3Y6O68kBPhN)

Select the AMM you are pulling data from before proceeding to Solscan’s DeFi page for the respective AMM. Quick links: [Raydium](https://solscan.io/amm/raydium) or [Orca](https://solscan.io/amm/orca).

Search for the liquidity pair and copy and paste the address at the LpExchangeRateTask.

![](/files/rm0FuyCCNNQVbXztwJC3)

Next, put the same switchboard aggregator to convert to USD. As this pair is SLND/USDC, we will need to input the USDC/USD oracle into the aggregator pubkey.

Oracle for Raydium SLND/USD is done!

#### Publishing the Oracle

Once you have repeated all the steps above for each price source, it is time to publish the oracle. First step is to press “Test” and make sure each oracle provides you with an accurate price.

The configs we usually use are:

**Update Interval**: 1 min

**Variance Threshold**: 0.5%

**Force Report Period**: 1 min

This means that your oracle will be updated every minute, or when a price move of 0.5% occurs and has the same configs as what the core team uses.

#### Getting the Oracle ID

The final step is to copy and paste the oracle ID where you need to use it.

![](/files/hEVbh8wkXYvZNVAlXhA6)

You can also confirm that the oracle is working properly by checking the “Recent Value” against Coingecko. Expect a slight variance due to the different sources & frequency of update.

### Appendix

```cpp
Commonly used Switchboard Oracle Aggregators:
USDC/USD: BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW
SOL/USD: GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR
USDT/USD: ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9
```

Huobi:

```jsx
{
  "name": "Huobi GST/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://api.huobi.pro/market/detail/merged?symbol=gstusdt"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.tick.bid[0]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.tick.ask[0]"
            }
          }
        ]
      }
    },
    {
      "multiplyTask": {
        "aggregatorPubkey": "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9"
      }
    }
  ]
}
```

Binance:

```cpp
{
  "name": "BinanceCom BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://www.binance.com/api/v3/ticker/price?symbol=BTCUSDT"
      }
    },
    {
      "jsonParseTask": {
        "path": "$.price"
      }
    },
    {
      "multiplyTask": {
        "aggregatorPubkey": "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9"
      }
    }
  ]
}
```

MEXC:

```cpp
{
  "name": "Mxc BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://www.mexc.com/open/api/v2/market/ticker?symbol=LARIX_USDT"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.data[0].ask"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data[0].bid"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data[0].last"
            }
          }
        ]
      }
    },
          {
            "multiplyTask": {
              "aggregatorPubkey": "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9"
            }
          }
        ]
      }
```

AscendEX:

```cpp
{
  "tasks": [
    {
      "httpTask": {
        "url": "https://ascendex.com/api/pro/v1/spot/ticker?symbol=JET/USDT"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.data.close"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data.ask[0]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data.bid[0]"
            }
          },
          {
            "multiplyTask": {
              "aggregatorPubkey": "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9"
            }
          }
        ]
      }
    }
  ]
}
```

Bitfinex:

```cpp
{
  "name": "Bitfinex BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://api-pub.bitfinex.com/v2/tickers?symbols=tOXYUST"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$[0][1]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$[0][3]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$[0][7]"
            }
          },
          {
            "multiplyTask": {
              "aggregatorPubkey": "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9"
            }
          }
        ]
      }
    }
  ]
}
```


# Pool Ideas

### List any tokens

With permissionless pools, anyone can come to Solend and list their new token in an isolated pool! Users can set parameters based on how new the token is, and get them increased over time as the liquidity and holders grow.&#x20;

This is the first/original use case for permissionless pools and makes our goal of "Any SPL token as collateral" possible.&#x20;

### Experiment with different pool ideas

Permissionless pools also allow DeFi degens to create different pools based on certain strategies.&#x20;

For example, a mSOL / SOL pool with 98% LTV might be interesting. This would allow for higher leverage in the mSOL/SOL strategy, where you borrow SOL <6% APY and stake it with Marinade for 6-7% APY.

### Uncollateralized loans for protocols

Protocols can also set up a permissionless pool that allows them to borrow without collateral from. This allows protocols like Delta One to borrow funds and conduct leveraged defi strategies for example.

Protocols can do this by creating a pool with two reserves, USDC and another token they have mint authority over. They can then set the price of this token to a flat $1, and then mint themselves collateral accordingly.&#x20;

To minimize bad debt or default, this pool should be governed by the integrated protocols' smart contracts to manage position sizes and margin. Funds should not enter anyone's wallets at all times. If interested, reach out to Soju on Discord!&#x20;

### Uncollateralized loans for individuals/companies

Alternatively, a user can create a permissionless pool to borrow money as an individual or company such as a market making firm.&#x20;

Similar to how protocols do it, but instead of a protocol minting a token a user does it instead. This would allow the pool creator to borrow uncollateralized from users who deposit into the pool. DYODD is a must when depositing in these pools.&#x20;

This would have to rely on depositors trusting this borrower/pool creator and is a higher risk compared to relying on the integrated smart contracts.&#x20;


# Building Blocks

**Lending Market Owner/Authority:**

This is the account that owns the entire pool -there is one for Main, Isolated, and etc.

**Lending Market (State)**

This contains all the reserves.

**Reserves State (Market-level Positions)**

For every pool, each token has its own reserve. This is where supply/balances are tracked, and is updated using the account value \* pyth\_price pulled from oracles.

**Obligations State (User-level positions)**

Each user’s position is called an obligation, and is updated using RefreshObligation by calling Pyth\_price + the % of Liquidity provided (for supply) or cumulative borrow rate (for borrows)

**Reserves State:**

* Asset: Reserve Token
* Address: Reserve Address that contains the ATA of the liquidity
* CollateralMintAddress: cToken Mint Address
* CollateralSupplyAddress: Where cTokens are held to be used as collateral
* Liquidity Address: ATA of the Reserve that contains the tokens
* LiquidityFeeReceiverAddress: Where borrow fees generated are held before being swept into the protocol treasury

Example:

```json
        },
        {
          "asset": "UST",
          "address": "Ab48bKsiEzdm481mGaNVmv9m9DmXsWWxcYHM588M59Yd",
          "collateralMintAddress": "nZtL8HKX3aQtk3VpdvtdwPpXF2uMia522Pnan2meqdf",
          "collateralSupplyAddress": "4HXDioboWL85gQocYNkWM62AB5ctrf8jVykSVco67Lzx",
          "liquidityAddress": "5LyHdTXh1MSbRzE7xfTtfpV8W5eaySJnSiTs6FdHhrSo",
          "liquidityFeeReceiverAddress": "4GctGML68E1kDcvskGTXRPY9ngxmxVnJXjpsJ68YBXPR",
          "userSupplyCap": 5000000
        },
        {
```


# Software Flowchart

![](/files/bum4XzPS4fM3c9YU283B)

Take a look at the flowchart overview of Solend protocol. Credit to ilmoi on GitHub [here](https://github.com/ilmoi/solana-serum-program-viz/blob/master/token-lending/solana-token-lending.pdf).


# Access Controls

Our smart contracts are all open sourced, located [here](https://github.com/solendprotocol).&#x20;

<table><thead><tr><th width="243.26486291689724">Description</th><th width="474.29346314325454">Address</th></tr></thead><tbody><tr><td>Program</td><td><code>So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo</code></td></tr><tr><td>Upgrade authority</td><td><code>2Fwvr3MKhHhqakgjjEWcpWZZabbRCetHjukHi1zfKxjk</code></td></tr></tbody></table>

Our Solend Program, "`So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo"`, is owned by the BPF Upgradeable Loader program which lets the Upgrade Authority "`GDmSxpPzLkfxxr6dHLNRnCoYVGzvgc41tozkrr4pHTjB`" upload a new program to make changes/improvements. We hold the keypair of the Upgrade Authority, so we utilize that to push upgrades to mainnet.&#x20;

For now, there isn't a timelock program, but transitioning to governance in the future will cause upgrades to go through a governance vote as well.&#x20;

However, minor changes to mainnet program are reviewed internally across multiple members of the team, or by external engineers from the Solana team. We will likely conduct another audit if we perform major changes to the codebase.

Our code is not "Anchor verified" yet, but we will look into doing so soon.

<table><thead><tr><th width="243.26486291689724">Description</th><th width="474.29346314325454">Address</th></tr></thead><tbody><tr><td>Lending market owner</td><td><code>5pHk2TmnqQzRF9L6egy5FfiyBgS7G9cMZ5RFaJAvghzw</code></td></tr><tr><td>Fee receiver</td><td><code>9RuqAN42PTUi9ya59k9suGATrkqzvb9gk2QABJtQzGP5</code></td></tr></tbody></table>

This lending market owner contains all the reserves for our main/isolated pools. When updating the configs such as reserve limit or parameters, we pass a tx through the lending market owner such as this [one](https://solscan.io/tx/354SRxN9Px3gfgoxa6mA2SpeWsSTz7LQhDKYbCem8RaXXybU5Ni6i9yz8CkADhnAeRzc9HXqdbihep7FPoZeoFmM) to update the configs. This can only change the configs and can't move funds from the user.

An example of configs we can change is setting deposit/borrow limit to 0. We do this when deprecating or delisting certain assets. However, we can't set withdrawal to 0 and lock up user funds.


# User Instructions

Interact program to program via these instructions, or refer to the GitHub link below:

{% embed url="<https://github.com/solendprotocol/solana-program-library/blob/mainnet/token-lending/program/src/instruction.rs>" %}

**DepositReserveLiquidityAndObligationCollateral** (Supply)

* Deposit reserve liquidity (Transfer) + mint cTokens (MintTo) + Transfer cTokens into CollateralSupplyAddress (Transfer)
* Does not require RefreshReserve as it is impossible to worsen an obligation’s health by repaying.
* [Sample TX](https://solscan.io/tx/3Her2qWoAbits6VuagCmgskfaNiUSCBdr11ZuAV2z74Dcc2uNdT9dBJvXZ4NVUYEPpmGpri5RxPaT7caSQ24X39v)

**WithdrawObligationCollateralAndRedeemReserveCollateral**

* Redeem cTokens from CollateralSupplyAddress
* Exchange cTokens into Tokens using the cToken Rate
* Requires RefreshReserve to ensure that the user is able to withdraw without defaulting their existing borrows
* RefreshReserve → RefreshObligation → WithdrawObligationCollateralAndRedeemReserveCollateral

**BorrowObligationLiquidity**

* Bundled with Refresh Reserve
* if “borrow\_reserve.last\_update.is\_stale(clock.slot)? {” fails, reserve is considered stale (refreshreserve + borrow must be in the same slot)
* RefreshReserve → RefreshObligation → Borrow

**RepayObligationLiquidity**

* Does not require RefreshReserve as it is impossible to worsen an obligation’s health by repaying.

### **cToken Instructions**:

**DepositReserveLiquidity**

* Deposit funds into the reserve, mint cToken
* No need to escrow the cTokens in the CollateralSupplyAddress
* Relies on cToken:Token Ratio

**RedeemReserveCollateral**

* Withdraw Funds, burn cTokens
* Relies on cToken:Token Ratio

### **Monitoring/Misc Instructions**

**RefreshReserve**

* Update the price of every reserve, usually done before RefreshObligation
* Pull Oracle prices
* Update CumulativeBorrowRate to calculate interest paid since last refreshed block
* Update the Obligation CumulativeBorrowRate to apply an increase in borrow value&#x20;
* Update cToken Rate for supply side users
* Done 2x for every reserve, supply and borrow side

**RefreshObligation**

* Done after RefreshReserves
* Calculate individual obligations that ran the Withdraw or Borrow tx to calculate LTV before borrows
* Assess whether the tx can go through based on account health

**Notes**:

RefreshReserve/RefreshObligation used to be required for all transactions, but were removed to reduce oracle reliance after Jan 2022’s network issues.

Liquidator will call RefreshObligation before liquidating&#x20;

However, borrow/withdraw has to check whether the obligation is refreshed in the SAME slot. But obligations require that reserves are refreshed.

RefreshReserve → RefreshObligation (repeated through all the positions) requires a lot of memory, which is limited by Solana, and thus limits our positions to 6.&#x20;


# Computing Supply & Borrows

**Monitoring Instructions:**

* RefreshReserve - handles all the tracking work and updates ratio
* RefreshObligation - computes obligation balances based on reserve ratios

**For Supply:**

* cToken Ratio acts as a % ownership of the LP
* For a pool with 99 USDC, if you deposit 1 USDC, you will own 1% of the pool
* When the RefreshReserve occurs, the pool now has 110 USDC. Your 1% is now worth 1.1 USDC.
* Total Reserves / cTokens Minted&#x20;

**For Borrows:**

* APY is used to update CumulativeBorrowRate as an index
* When borrowing, calculate the initial CumulativeBorrowRate (let's say 1)
* RefreshReserve → Updates the CumulativeBorrowRate (let's say its 1.02)
* Obligation borrows would be increased by \*1.02/1 or 2%

```
/// Compound current borrow rate over elapsed slots
    fn compound_interest(
        &mut self,
        current_borrow_rate: Rate,
        slots_elapsed: u64,
    ) -> ProgramResult {
        let slot_interest_rate = current_borrow_rate.try_div(SLOTS_PER_YEAR)?;
        let compounded_interest_rate = Rate::one()
            .try_add(slot_interest_rate)?
            .try_pow(slots_elapsed)?;
        self.cumulative_borrow_rate_wads = self
            .cumulative_borrow_rate_wads
            .try_mul(compounded_interest_rate)?;
        self.borrowed_amount_wads = self
            .borrowed_amount_wads
            .try_mul(compounded_interest_rate)?;
        Ok(())
    }
}
```

**Why**: For efficiency, the RefreshReserve just has to update the cToken Rate or the CumulativeBorrowRate instead of updating every obligation’s supply or borrow numbers. Tracking is only done at the ratio/index level, and never at an individual level unless changes to the user's positions are being made.


# cTokens

https\://solend.fi/ctokens

cTokens are a *yield-bearing deposit receipt*. It means you can convert USDC into cUSDC to get a tradeable token that also earns interest on Solend. You can hold this token in your wallet to continue earning interest, or you can send it to someone else, and they’ll earn interest.

cTokens open up a world of possibilities for developer integrations. Because cTokens are just regular SPL tokens, they’re easily composable and compatible with just about everything! If you’re working on something that uses Solend cTokens, check out our [Developer Portal](https://dev.solend.fi/) and [Grants Program](https://dev.solend.fi/docs/grants)!

Take note that cTokens currently do not have liquidity mining, such as additional SLND or MNDE rewards. You can mint cTokens [here](https://solend.fi/ctokens).

{% embed url="<https://github.com/solendprotocol/solana-program-library/blob/400dd876c51862c21122f7d4378a7c82d996b0ef/token-lending/program/src/processor.rs#L439>" %}

Normally, if you are using our Main Lend/Borrow, your cTokens will be held in custody by our smart contracts to be used as "collateral" for borrowing against it. This tool is mainly for developers to integrate our cTokens into their protocols, and then direct their users here to mint their cTokens.&#x20;

### cToken Ratio Calculations:

* cToken Ratio acts as a % ownership of the LP
* For a pool with 99 USDC, if you deposit 1 USDC, you will own 1% of the pool
* When the RefreshReserve occurs, the pool now has 110 USDC. Your 1% is now worth 1.1 USDC.

cToken Ratio is calculated by taking the Total USDC in the reserves / cUSDC in Circulation.&#x20;


# cToken Addresses

## cToken Address / CollateralMintAddress

These are the cToken addresses that you can find using Solscan, and are also known as 'CollateralMintAddress' in our code.&#x20;

## Main Pool

<table><thead><tr><th width="190.39363145433748">Description</th><th width="537.2641509433962">Address</th></tr></thead><tbody><tr><td>cSOL</td><td><code>5h6ssFpeDeRbzsEHDbTQNH7nVGgsKrZydxdSTnLm6QdV</code></td></tr><tr><td>cUSDC</td><td><code>993dVFL2uXWYeoXuEBFXR4BijeXdTv4s6BzsCjJZuwqk</code></td></tr><tr><td>csoETH</td><td><code>AppJPZka33cu4DyUenFe9Dc1ZmZ3oQju6mBn9k37bNAa</code></td></tr><tr><td>cBTC</td><td><code>Gqu3TFmJXfnfSX84kqbZ5u9JjSBVoesaHjfTsaPjRSnZ</code></td></tr><tr><td>cSRM</td><td><code>4CxGuD2NMr6zM8f18gr6kRhgd748pnmkAhkY1YJtkup1</code></td></tr><tr><td>cUSDT</td><td><code>BTsbZDV7aCMRJ3VNy9ygV4Q2UeEo9GpR8D6VvmMZzNr8</code></td></tr><tr><td>csoFTT</td><td><code>A38TjtcYrfutXT6nfRxhqwoGiXyzwJsGPmekoZYYmfgP</code></td></tr><tr><td>cORCA</td><td><code>E9LAZYxBVhJr9Cdfi9Tn4GSiJHDWSZDsew5tfgJja6Cu</code></td></tr><tr><td>cRAY</td><td><code>2d95ZC8L5XP6xCnaKx8D5U5eX6rKbboBBAwuBLxaFmmJ</code></td></tr><tr><td>cSBR</td><td><code>4GAGuewTRMfBJukgu3HSzpT48iqP4bYVCq3tygnjqmxL</code></td></tr><tr><td>cMER</td><td><code>BsWLxf6hRJnyytKR52kKBiz7qU7BB3SH77mrBxNnYU1G</code></td></tr><tr><td>cmSOL</td><td><code>3JFC4cB56Er45nWVe29Bhnn5GnwQzSmHVf6eUq9ac91h</code></td></tr><tr><td>cETH</td><td><code>FbKvdbx5h6F86h1pZuEqv7FxwmsVhJ88cDuSqHvLm6Xf</code></td></tr><tr><td>cSLND</td><td><code>D3Cu5urZJhkKyNZQQq2ne6xSfzbXLU4RrywVErMA2vf8</code></td></tr><tr><td>cscnSOL</td><td><code>AFq1sSdevxfqWGcmcz7XpPbfjHevcJY7baZf9RkyrzoR</code></td></tr><tr><td>cstSOL</td><td><code>QQ6WK86aUCBvNPkGeYBKikk15sUg6aMUEi5PTL6eB4i</code></td></tr><tr><td>cUST</td><td><code>nZtL8HKX3aQtk3VpdvtdwPpXF2uMia522Pnan2meqdf</code></td></tr><tr><td>cFTT</td><td><code>DiMx1n2dJmxqFtENRPhYWsqi8Mhg2p39MpTzsm6phzMP</code></td></tr><tr><td>cUSDT-USDC</td><td><code>6XrbsKScacEwpEW5DVNko9t5vW3cim9wktAeT9mmiYHS</code></td></tr><tr><td>cmSOL-SOL</td><td><code>4icXEpFVMrcqob6fnd3jZ6KjKrc6cqre6do1f8kKAC1u</code></td></tr></tbody></table>

## Isolated Pools

<table><thead><tr><th width="208.86874562798977">Description</th><th width="537.2641509433962">Address</th></tr></thead><tbody><tr><td>cSOL (TURBO SOL)</td><td><code>AVxnqyCameKsKTCGVKeyJMA7vjHnxJit6afC8AM9MdMj</code></td></tr><tr><td>cUSDC (TURBO SOL)</td><td><code>HKijBKC2zKcV2BXA9CuNemmWUhTuFkPLLgvQBP7zrQjL</code></td></tr><tr><td>clsIN (Invictus)</td><td><code>5Jk2vER2x9WGAZmVGEafBtkEzjYB4mcvvVHbxMcbprhJ</code></td></tr><tr><td>cUSDC (Invictus)</td><td><code>DR1b9VzSe8o658UVJL9b6XzqkRmurcmLujpZRaBL3yDU</code></td></tr><tr><td>cUST (Invictus)</td><td><code>5vxqpDHcHhhJBwNdgeFjfJ814qL36S4fJneSihYccZNg</code></td></tr><tr><td>cxSTEP (Step)</td><td><code>E1hgwtGqjT4po2vg1LFGvf5XiZgUZBQeabcstQympPPa</code></td></tr><tr><td>cSTEP (Step)</td><td><code>9XtoqcLnc1psQuTPTGjfEwwabzBeUeFihvyZptcALwph</code></td></tr><tr><td>cSOL (Step)</td><td><code>7criSZai4hqKukScLUa5W2UV6Q9pjFMdJjQphKavBqur</code></td></tr><tr><td>cUSDC (Step)</td><td><code>7tBwN1tWTNsepwJcuD46zPBu6FuivWMvN2J5zP6HoPYg</code></td></tr><tr><td>cFIDA (FIDA)</td><td><code>ArohPh341JrQsWk7paiUwJKDe4MjvhtE5XxjYUoiM2fH</code></td></tr><tr><td>cSOL (FIDA)</td><td><code>2fHFudEbottFSbpe8oX5KyCDrnx8tfgL8PFj67iz9Y2h</code></td></tr><tr><td>cUSDC (FIDA)</td><td><code>7ziVqwra9BTyzXwFTL6JBMY4LtHdQZeQ9cqLkTKeYvoq</code></td></tr><tr><td>cATLAS (ATLAS)</td><td><code>EHFzasjYT1VmeKtvPtPCytJugQFBoYdhXXBt2WazinfY</code></td></tr><tr><td>cPOLIS (ATLAS)</td><td><code>ZeTubq2tcT9s8sPGKihum5scLGoQDqtYd6BYAy15y2P</code></td></tr><tr><td>cUSDC (ATLAS)</td><td><code>HwdCShcytebyeLaU79FB5cD4RDJVWnN7vs5kCJr6nKf7</code></td></tr><tr><td>cSAMO (SAMO)</td><td><code>E9qQ9pdZjk9zvm7Qp3UUynddJMadK85F8ZNqWyeUHcjV</code></td></tr><tr><td>cUSDC (SAMO)</td><td><code>9zCPUDEF5oGymtihmPQL6bUUxarno7w6qzM7Amiyh9bw</code></td></tr><tr><td>cUSDC (Stable)</td><td><code>4JZ6PXqRDp8jQxXUYX9cbAzHi6uzZk856aoAqPGdV5Da</code></td></tr><tr><td>cUSDT (Stable)</td><td><code>9wCxum1oB9JpgPUuVmsPTqDDvKeQqP3rnGFg3GEMrUGT</code></td></tr><tr><td>cPAI (Stable)</td><td><code>DyJZX45rgh9nADa19tsFeSV69ZwvX4UqPoPP39mdBiDq</code></td></tr><tr><td>cUST (Stable)</td><td><code>5czXDWSVFjH16hJGvwZTE8sMbh4vQggZ1gMhyVE4RWgx</code></td></tr><tr><td>cUXD (Stable)</td><td><code>3R3mzc8o9oXCsBX2dKG7Bzc3ov1m7t4UHtb81ktAeCxY</code></td></tr><tr><td>cUSDH (Stable)</td><td><code>DE9WN39kGuqZwsBpmd8Fs8F7b4T38nzpiNo8DseznLBU</code></td></tr><tr><td>cSMBD (NFT)</td><td><code>5NBAYi6ELmNCvxy1QQ3iLaNRidRSBM9R8DN4bVK6kXM2</code></td></tr><tr><td>cUSDC (NFT)</td><td><code>Awi5FDTwSH5XKH11kDLynccJPQbvKgkGFaekExSRk5QM</code></td></tr><tr><td>cSOL (NFT)</td><td><code>83xjxt6wQzci6zgEukhswGVwesHC94D6C7q6fUZaAThb</code></td></tr><tr><td>cC98 (C98)</td><td><code>VTyR5PvnbNAp7uAg7kr9cfAhNZEodoJrCTRGC67pAjP</code></td></tr><tr><td>cUST (C98)</td><td><code>DWYPVVz79kAbbiL42rWtmWoyvDX9M7aGLyf9Cu7Ewvds</code></td></tr><tr><td>cUXD (C98)</td><td><code>ErJswCkk3oRS9poFdRxJHt6j9yQisTB8YQAqJkE7iC5U</code></td></tr><tr><td>cPAI (C98)</td><td><code>CKUk55h1JcyK7DsvSYjYVw5XiEgrB2LgXMfyuBBnRmHT</code></td></tr><tr><td>cUSDH (C98)</td><td><code>AGhAmBTQGHhDWSwmBCL91GRyv7FP3HRZarmRK6XccnM7</code></td></tr></tbody></table>


# Addresses

Going forward, use our [endpoint](<https://app.swaggerhub.com/apis-docs/solendprotocol/API/1.0.1#/Reserves/get_v1_config_ >) to grab addresses.

We will be deprecating <https://github.com/solendprotocol/common> soon.

## SLND Token

`SLNDpmoWTVADgEdndyvWzroNL7zSi1dF9PC3xHGtPwp`

## Solend Contracts

<table><thead><tr><th width="243.26486291689724">Description</th><th width="474.29346314325454">Address</th></tr></thead><tbody><tr><td>Program</td><td><code>So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo</code></td></tr><tr><td>Upgrade authority</td><td><code>2Fwvr3MKhHhqakgjjEWcpWZZabbRCetHjukHi1zfKxjk</code></td></tr><tr><td>Lending market owner</td><td><code>5pHk2TmnqQzRF9L6egy5FfiyBgS7G9cMZ5RFaJAvghzw</code></td></tr><tr><td>Fee receiver</td><td><code>9RuqAN42PTUi9ya59k9suGATrkqzvb9gk2QABJtQzGP5</code></td></tr></tbody></table>


# Mainnet

### Glossary

<table><thead><tr><th width="237.48528969282935">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending market</td><td>Pubkey of the Authority over all the reserves </td></tr><tr><td>Vault</td><td>Where all the underlying tokens are held (= TVL)</td></tr><tr><td>pythProgramID</td><td>Pyth's Oracle program ID</td></tr><tr><td>switchboardProgramID</td><td>Switchboard's Oracle program ID</td></tr></tbody></table>

### Token X

<table><thead><tr><th width="254.0993910396336">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Reserve</td><td>Account address of the Reserve</td></tr><tr><td>CollateralMintAddress</td><td>Token address of the cTokens</td></tr><tr><td>CollateralSupplyAddress</td><td>Where cTokens are held/escrowed to be borrowed against</td></tr><tr><td>LiquidityAddress</td><td>Where the Tokens are held </td></tr><tr><td>LiquidityFeeReceiver Address</td><td>Where we collect fees generated from borrowing</td></tr></tbody></table>


# Main Pools

### Main Pool

<table><thead><tr><th width="237.48528969282935">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending market</td><td><code>4UpD2fh7xH3VP9QQaXtsS1YY3bxzWhtfpks7FatyKvdY</code></td></tr><tr><td>Vault</td><td><code>DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby</code></td></tr><tr><td>pythProgramID</td><td><code>FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH</code></td></tr><tr><td>switchboardProgramID</td><td><code>DtmE9D2CSB4L5D6A15mraeEjrGMm6auWVzgaD8hK2tZM</code></td></tr></tbody></table>

### Reserve

<table><thead><tr><th width="197.75068421655524">Description</th><th width="520.7368421052631">Address</th></tr></thead><tbody><tr><td>SOL </td><td><code>8PbodeaosQP19SjYFx855UMqWxH2HynZLdBXmsrbac36</code></td></tr><tr><td>USDC </td><td><code>BgxfHJDzm44T7XG68MYKx7YisTjZu73tVovyZSjJMpmw</code></td></tr><tr><td>soETH </td><td><code>3PArRsZQ6SLkr1WERZWyC6AqsajtALMq4C66ZMYz4dKQ</code></td></tr><tr><td>BTC </td><td><code>GYzjMCXTDue12eUGKKWAqtF5jcBYNmewr6Db6LaguEaX</code></td></tr><tr><td>SRM </td><td><code>5suXmvdbKQ98VonxGCXqViuWRu8k4zgZRxndYKsH2fJg</code></td></tr><tr><td>USDT </td><td><code>8K9WC8xoh2rtQNY7iEGXtPvfbDCi563SdWhCAhuMP2xE</code></td></tr><tr><td>soFTT  </td><td><code>2dC4V23zJxuv521iYQj8c471jrxYLNQFaGS6YPwtTHMd</code></td></tr><tr><td>RAY </td><td><code>9n2exoMQwMTzfw6NFoFFujxYPndWVLtKREJePssrKb36</code></td></tr><tr><td>SBR </td><td><code>Hthrt4Lab21Yz1Dx9Q4sFW4WVihdBUTtWRQBjPsYHCor</code></td></tr><tr><td>MER </td><td><code>5Sb6wDpweg6mtYksPJ2pfGbSyikrhR8Ut8GszcULQ83A</code></td></tr><tr><td>mSOL </td><td><code>CCpirWrgNuBVLdkP2haxLTbD6XqEgaYuVXixbbpxUB6</code></td></tr><tr><td>ETH  </td><td><code>CPDiKagfozERtJ33p7HHhEfJERjvfk1VAjMXAFLrvrKP</code></td></tr><tr><td>SLND </td><td><code>CviGNzD2C9ZCMmjDt5DKCce5cLV4Emrcm3NFvwudBFKA</code></td></tr><tr><td>scnSOL </td><td><code>DUExYJG5sc1SQdMMdq6LdUYW9ULXbo2fFFTbedywgjNN</code></td></tr><tr><td>stSOL </td><td><code>5sjkv6HD8wycocJ4tC4U36HHbvgcXYqcyiPRUkncnwWs</code></td></tr><tr><td>UST </td><td><code>Ab48bKsiEzdm481mGaNVmv9m9DmXsWWxcYHM588M59Yd</code></td></tr><tr><td>FTT </td><td><code>8bDyV3N7ctLKoaSVqUoEwUzw6msS2F65yyNPgAVUisKm</code></td></tr><tr><td>USDT-USDC LP</td><td><code>9mZsd1b9cN7JyqJvkbqhVuTfg8PAuKjuhPxpcsVNjYoC</code></td></tr><tr><td>mSOL-SOL LP</td><td><code>6ve8XyELbecPdbzSTsyhYKiWr7wg3JpjfxE1cqoN9qhN</code></td></tr></tbody></table>

##


# Isolated Pools

## TURBO SOL&#x20;

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market </td><td><code>7RCz8wb6WXxUhAigok9ttgrVgDFFFbibcirECzWSBauM</code></td></tr><tr><td>Vault</td><td><code>55YceCDfyvdcPPozDiMeNp9TpwmL1hdoTEFw5BMNWbpf</code></td></tr></tbody></table>

#### Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>SOL</td><td><code>UTABCRXirrbpCNDogCoqEECtM3V44jXGCsK23ZepV3Z</code></td></tr><tr><td>USDC</td><td><code>EjUgEaPpKMg2nqex9obb46gZQ6Ar9mWSdVKbw9A6PyXA</code></td></tr></tbody></table>

#### cTokens

<table><thead><tr><th width="247.18599407129645"></th><th width="462.4922408441962"></th></tr></thead><tbody><tr><td>cSOL</td><td><code>AVxnqyCameKsKTCGVKeyJMA7vjHnxJit6afC8AM9MdMj</code></td></tr><tr><td>cUSDC</td><td><code>HKijBKC2zKcV2BXA9CuNemmWUhTuFkPLLgvQBP7zrQjL</code></td></tr></tbody></table>

## Invictus Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market </td><td><code>5i8SzwX2LjpGUxLZRJ8EiYohpuKgW2FYDFhVjhGj66P1</code></td></tr><tr><td>Vault</td><td><code>6N6tqnemGoR5pUdtKKp3FvdD94Gi98f2ySEo1dzZ2Uqv</code></td></tr></tbody></table>

#### Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>lsIN</td><td><code>4XYbgZJirfnwjmpJKQgMQEvjncYFi2CsPTFzBguCjCjG</code></td></tr><tr><td>USDC</td><td><code>AuT5vA4bScsaJBiyNHnAttKToTCHj4Kwi4sg8bCyPPr8</code></td></tr><tr><td>UST</td><td><code>7MymBKwTPPMC4A9Ktwc1F2V5Xw7Kj3DqvRYUvLk2SF4h</code></td></tr></tbody></table>

#### cTokens

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>clsIN</td><td><code>5Jk2vER2x9WGAZmVGEafBtkEzjYB4mcvvVHbxMcbprhJ</code></td></tr><tr><td>cUSDC</td><td><code>DR1b9VzSe8o658UVJL9b6XzqkRmurcmLujpZRaBL3yDU</code></td></tr><tr><td>cUST</td><td><code>5vxqpDHcHhhJBwNdgeFjfJ814qL36S4fJneSihYccZNg</code></td></tr></tbody></table>

## Step Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>DxdnNmdWHcW6RGTYiD5ms5f7LNZBaA7Kd1nMfASnzwdY</code></td></tr><tr><td>Vault</td><td><code>csotR9rcbLV3bCzBKxNJ3GjYhzH9cXffZX3TAQpw4oG</code></td></tr></tbody></table>

#### Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>xSTEP</td><td><code>HH9Aig5MAvMNcivGfAbWU5Da9nfiTwBaYJBK2KZyZppn</code></td></tr><tr><td>STEP</td><td><code>C5ozcRb4PJeJvakPeGgm9bgwcL6rPcKPfV95d2owW86C</code></td></tr><tr><td>SOL</td><td><code>7trBAMkVU8dcPQVdScz7VNywZwqnD1rwXkwkVPQJ95bT</code></td></tr><tr><td>USDC</td><td><code>FCU2wpx3ED1dY7bKszzcyxUVNTduLurUEmCGGv2w3Lfm</code></td></tr></tbody></table>

#### cTokens

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>cxSTEP</td><td><code>E1hgwtGqjT4po2vg1LFGvf5XiZgUZBQeabcstQympPPa</code></td></tr><tr><td>cSTEP</td><td><code>9XtoqcLnc1psQuTPTGjfEwwabzBeUeFihvyZptcALwph</code></td></tr><tr><td>cSOL</td><td><code>7criSZai4hqKukScLUa5W2UV6Q9pjFMdJjQphKavBqur</code></td></tr><tr><td>cUSDC</td><td><code>7tBwN1tWTNsepwJcuD46zPBu6FuivWMvN2J5zP6HoPYg</code></td></tr></tbody></table>

## Bonfida Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>91taAt3bocVZwcChVgZTTaQYt2WpBVE3M9PkWekFQx4J</code></td></tr><tr><td>Vault</td><td><code>76Asux4XZYqrP61G52eRZRQ6GCUPQUmYme3hTCaNgmxv</code></td></tr></tbody></table>

#### Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>FIDA</td><td><code>A3ZhKMuwHygRqjXiMDqM2PyeT35Z1LiDUqwrtjiHn89M</code></td></tr><tr><td>SOL</td><td><code>3WPYWiZtc2uJq1JiF3Z3KswicFAp5VrFgEHwP3CkuDUn</code></td></tr><tr><td>USDC</td><td><code>EBRtjgHJiEBYnQ5QzTGcBxTwbapEQ3bvh1BrgaGzhX9e</code></td></tr></tbody></table>

#### cTokens&#x20;

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>cFIDA</td><td><code>ArohPh341JrQsWk7paiUwJKDe4MjvhtE5XxjYUoiM2fH</code></td></tr><tr><td>cSOL</td><td><code>2fHFudEbottFSbpe8oX5KyCDrnx8tfgL8PFj67iz9Y2h</code></td></tr><tr><td>cUSDC</td><td><code>7ziVqwra9BTyzXwFTL6JBMY4LtHdQZeQ9cqLkTKeYvoq</code></td></tr></tbody></table>

### Star Atlas Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>99S4iReDsyxKDViKdXQKWDcB6C3waDmfPWWyb5HAbcZF</code></td></tr><tr><td>Vault</td><td><code>2vhoVMQWEc12dUEEcJ6w8j3ZnrA4Tk6w8pPFhoWfVsUy</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>ATLAS</td><td><code>8RX5oDxnydPPsA92epWnyXrrM26w7JgAQoVVt9kbiZwq</code></td></tr><tr><td>POLIS</td><td><code>29Znf6g5qmRfTdnbyRQUWvMt94Gzn2KPCzY2ixxY9Mnt</code></td></tr><tr><td>USDC</td><td><code>5hVVs474TRejwwfqsecNp97riQGDtSmhTV6jiWSxJfWR</code></td></tr></tbody></table>

cTokens

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>cATLAS</td><td><code>EHFzasjYT1VmeKtvPtPCytJugQFBoYdhXXBt2WazinfY</code></td></tr><tr><td>cPOLIS</td><td><code>ZeTubq2tcT9s8sPGKihum5scLGoQDqtYd6BYAy15y2P</code></td></tr><tr><td>cUSDC</td><td><code>HwdCShcytebyeLaU79FB5cD4RDJVWnN7vs5kCJr6nKf7</code></td></tr></tbody></table>

### Dog Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>HASr6hiYVoRcVXk3GttC4PjBBPQ3sGYDzE7HSPJdcke6</code></td></tr><tr><td>Vault</td><td><code>DLokPHis2W5f3jQ4Kgv5PQHebkun2KQtsXcFidhR19Za</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>SAMO</td><td><code>HwZSKqyo2QQ2YCzF282ZrpH4JRQWf3Qad1fWHtKCDZjx</code></td></tr><tr><td>USDC</td><td><code>5VuBkDYXcV1svRm1BKShA2wqKsszYWjPwoT4Q32YXcp3</code></td></tr></tbody></table>

cTokens

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>cSAMO </td><td><code>E9qQ9pdZjk9zvm7Qp3UUynddJMadK85F8ZNqWyeUHcjV</code></td></tr><tr><td>cUSDC</td><td><code>9zCPUDEF5oGymtihmPQL6bUUxarno7w6qzM7Amiyh9bw</code></td></tr></tbody></table>

### Stable Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>GktVYgkstojYd8nVXGXKJHi7SstvgZ6pkQqQhUPD7y7Q</code></td></tr><tr><td>Vault</td><td><code>Ej4KxxUz73edQzjfsPVWvYxT5eyhQoWoXpo7BYm2Ejhj</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>USDC</td><td><code>JCRDg9T5mUUxazdJ2nGWDN2pdcXVQc5VM8XDp1DW6Aoa</code></td></tr><tr><td>USDT</td><td><code>aMyCaGf7MwsqpgoeioVGXZytadsjFZ6euuYSadLcXbY</code></td></tr><tr><td>PAI</td><td><code>Bd5pFCJf9AafuXZkfkU6SDZVpeE5xAqX69bs8nDSxd2J</code></td></tr><tr><td>UST</td><td><code>A57FVdDgcyz1NserCSMSWaWDyfWZw77ikfXvE2cwPF18</code></td></tr><tr><td>UXD</td><td><code>27YJsVpHWvjS8BKaz7Gd8unSFJAMrh6gPEFjqhYxn9AE</code></td></tr><tr><td>USDH</td><td><code>NoTf6a9khWa5cCh6v5RRronH7YuatY7gDWmdKUPoBhM</code></td></tr></tbody></table>

cTokens

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>cUSDC</td><td><code>4JZ6PXqRDp8jQxXUYX9cbAzHi6uzZk856aoAqPGdV5Da</code></td></tr><tr><td>cUSDT</td><td><code>9wCxum1oB9JpgPUuVmsPTqDDvKeQqP3rnGFg3GEMrUGT</code></td></tr><tr><td>cPAI</td><td><code>DyJZX45rgh9nADa19tsFeSV69ZwvX4UqPoPP39mdBiDq</code></td></tr><tr><td>cUST</td><td><code>5czXDWSVFjH16hJGvwZTE8sMbh4vQggZ1gMhyVE4RWgx</code></td></tr><tr><td>cUXD</td><td><code>3R3mzc8o9oXCsBX2dKG7Bzc3ov1m7t4UHtb81ktAeCxY</code></td></tr><tr><td>cUSDH</td><td><code>DE9WN39kGuqZwsBpmd8Fs8F7b4T38nzpiNo8DseznLBU</code></td></tr></tbody></table>

### NFT Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>29yTiqjGdoNiRLMVc7ZoqFpbW3gkmefwMG9SUiMMD4J9</code></td></tr><tr><td>Vault</td><td><code>BtDeXoN6L5s5Nodvny3qvwK55b3YLcFkL7KqvKD7bFNz</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>SMBD</td><td><code>EpZipddM7X7TofTzypVaz9GkjBziWgZZCgPz9HhGAB1t</code></td></tr><tr><td>USDC</td><td><code>8WpwDA1qs28vrkS3q1B8pfEXNP5MMkAc9qhiQZeYBK9N</code></td></tr><tr><td>SOL</td><td><code>8xogd14bBxBdGKDfkDciPPp6pZ3Cw4Yj5USRbGJDbZpA</code></td></tr></tbody></table>

cTokens

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>cSMBD</td><td><code>5NBAYi6ELmNCvxy1QQ3iLaNRidRSBM9R8DN4bVK6kXM2</code></td></tr><tr><td>cUSDC</td><td><code>Awi5FDTwSH5XKH11kDLynccJPQbvKgkGFaekExSRk5QM</code></td></tr><tr><td>cSOL</td><td><code>83xjxt6wQzci6zgEukhswGVwesHC94D6C7q6fUZaAThb</code></td></tr></tbody></table>

### Coin98 Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>7tiNvRHSjYDfc6usrWnSNPyuN68xQfKs1ZG2oqtR5F46</code></td></tr><tr><td>Vault</td><td><code>8web9hJK4TQJBV23WQpBw9jMvn3YE1EV3PEcnXJvgwQa</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>Coin98</td><td><code>9bVRrxPjXBxM6rEyTLcR2opvdA2UGhdDwL8CLLm1b8KP</code></td></tr><tr><td>UST</td><td><code>B5513y5wt161CxLX5U2o5cGFHYbcGMuTKc6yu1ni3AbC</code></td></tr><tr><td>UXD</td><td><code>46Lh1P2XmTNG8Gnt4zkTdG1BXi2V18NggfYTbXpSzAYy</code></td></tr><tr><td>PAI</td><td><code>A3cQwWXzsaC5nfLDf7cbakZeBAJFGf1qMxvnf4yDRUUJ</code></td></tr><tr><td>USDH</td><td><code>3eDDvVgyxZ7aWLjLmKDYpeGHidCH7jkfHXcCXtpGqNKg</code></td></tr></tbody></table>

cTokens&#x20;

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>cC98</td><td><code>VTyR5PvnbNAp7uAg7kr9cfAhNZEodoJrCTRGC67pAjP</code></td></tr><tr><td>cUST</td><td><code>DWYPVVz79kAbbiL42rWtmWoyvDX9M7aGLyf9Cu7Ewvds</code></td></tr><tr><td>cUXD</td><td><code>ErJswCkk3oRS9poFdRxJHt6j9yQisTB8YQAqJkE7iC5U</code></td></tr><tr><td>cPAI</td><td><code>CKUk55h1JcyK7DsvSYjYVw5XiEgrB2LgXMfyuBBnRmHT</code></td></tr><tr><td>cUSDH</td><td><code>AGhAmBTQGHhDWSwmBCL91GRyv7FP3HRZarmRK6XccnM7</code></td></tr></tbody></table>

### UXD Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>HCuEqcXaGeioiJf5vNMTyQC7HMPqJm5aZPkSjA2qceDS</code></td></tr><tr><td>Vault</td><td><code>AwT1ixXdQcjQMgDWpzyNQhMyuU3z2hbMGcEYT9sHBAsU</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>UXP</td><td><code>BvZwsK3v8gqHqhNMDnGsD7z2V83bGzw82o2vrqU3kvBC</code></td></tr><tr><td>UXD</td><td><code>GseYnT313pSLAVidDwKWzo48QRFMmaoF2QLk3fK8DpZU</code></td></tr><tr><td>SOL</td><td><code>3x4swTGLgBkCDmxXYQRP96J1evCgy3ZsnUf9YJzVPtNy</code></td></tr><tr><td>USDC</td><td><code>Br6ucRrPNrJXPMa31FGBqS9WH86YGMQvu8Lv4dma8R5k</code></td></tr></tbody></table>

cTokens

<table><thead><tr><th width="204.01018095632034">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>UXP</td><td><code>Gqi3AojEduDqgyNuKzTwW3QPwUD55J2WzbCuYaqCDMiU</code></td></tr><tr><td>UXD</td><td><code>GDkx8oKUf5rHx1UNCaMfvjwEGa8uZy6ECYmzGh3Pkxef</code></td></tr><tr><td>SOL</td><td><code>29icHQwfhSgSo3MYjtAgCXKyfFn6RETz2sREEtgfaXy4</code></td></tr><tr><td>USDC</td><td><code>5vsr61rdgfeCtWTZHv54y7jkJ4xKg9WQDT4UusBsnePf</code></td></tr></tbody></table>

### STEPN Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>BjsAGLZzAgBUsiaTTDQv7PWDUDL9dQfKvYwb4q6FoDuD</code></td></tr><tr><td>Vault</td><td><code>CqEyTyxQDSwqFcrp7GXqEhhyeDNGvYrhyDkWtUcaa9oG</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>GMT</td><td><code>BqYvhari2P9mXYLqcgJv41kRUvLhBfGoQXGWHnw26UJw</code></td></tr><tr><td>GST</td><td><code>CaacWq72hHubpwi92UUVsoE4xDNKqr1MhRwYeqH3YPAU</code></td></tr><tr><td>USDC</td><td><code>DxdbG2YwFFJeePbNFZRXuF2Sx34B1NTxWNbeEHdo4rzb</code></td></tr></tbody></table>

cToken&#x20;

<table><thead><tr><th width="204.01018095632034">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>GMT</td><td><code>C8Pm2aMMdvHHBV1QDFzTGMrTs5k6MdDjxBwJEXX3aJ5U</code></td></tr><tr><td>GST</td><td><code>GHuZTLtRqFH6s6nkRBaaHFrVuVpepuvHsNApX4zvP3Hg</code></td></tr><tr><td>USDC</td><td><code>9E4YoiXauf22frwmioB7WFkQ2XAaTgKV7J7YsvM4TAN</code></td></tr></tbody></table>

### Shadow Pool

<table><thead><tr><th width="226.48528969282938">Description</th><th width="488.4285714285714">Address</th></tr></thead><tbody><tr><td>Lending Market</td><td><code>Foo9vqN6fj1NyymHmD1gwZkgVgEqzNSrwyeqyoLYGe7j</code></td></tr><tr><td>Vault</td><td><code>79X5SSdcWcs9cFFByhSX2TBnoYmaU7BkJ6ajrpJPwxqe</code></td></tr></tbody></table>

Reserves

<table><thead><tr><th width="237.54057740395547">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>SHDW</td><td><code>27wbnZxrA8Gq7UMYaRFJPP4ijr6HuWZZNXAovEHrG6Pn</code></td></tr><tr><td>USDC</td><td><code>4JvgJDxBmXrrYzdLAN4sAbyGYVWVw6mGjJwnaHFVTNWY</code></td></tr></tbody></table>

cToken

<table><thead><tr><th width="204.01018095632034">Description</th><th width="478.4285714285714">Address</th></tr></thead><tbody><tr><td>SHDW</td><td><code>Bk2fPSoxvvm6bS1C5M6HSMrgofLCQmjoFDM9StTXJo4R</code></td></tr><tr><td>USDC</td><td><code>A7CsM2A83J1z7hGec45MGsRyqSLULdcLtxvrvPvvUoo6</code></td></tr></tbody></table>


# Devnet

## Devnet

<table><thead><tr><th width="227.96490293464697">Description</th><th width="476.93856817821046">Address</th></tr></thead><tbody><tr><td>Program</td><td><code>ALend7Ketfx5bxh6ghsCDXAoDrhvEmsXT3cynB6aPLgx</code></td></tr><tr><td>Lending Market</td><td><code>GvjoVKNjBvQcFaSKUW1gTE7DxhSpjHbE69umVR5nPuQp</code></td></tr><tr><td>pythProgramID</td><td><code>CqFJLrT4rSpA46RQkVYWn8tdBDuQ7p7RXcp6Um76oaph</code></td></tr><tr><td>switchboardProgramID</td><td><code>7azgmy1pFXHikv36q1zZASvFq5vFa39TT9NweVugKKTU</code></td></tr></tbody></table>

### Reserves

<table><thead><tr><th width="204.85787125557684">Description</th><th width="522.4285714285713">Address</th></tr></thead><tbody><tr><td>SOL</td><td><code>5VVLD7BQp8y3bTgyF5ezm1ResyMTR3PhYsT4iHFU8Sxz</code></td></tr><tr><td>USDC</td><td><code>FNNkz4RCQezSSS71rW2tvqZH1LCkTzaiG7Nd1LeA5x5y</code></td></tr><tr><td>ETH</td><td><code>CuQcLfN3iTWqyEEbAHNZp7awChbR4KQPFJsTUhsAxrcu</code></td></tr><tr><td>BTC</td><td><code>FNXBRv3saDgVoaoDLV5ho28D4AvZikG9r7QpThTLak9f</code></td></tr><tr><td>SRM</td><td><code>5YKmMZcuWEdF5NavNK4MgKPRhnhw6jq22zwcdh1dvxbd</code></td></tr><tr><td>USDT</td><td><code>ERm3jhg8J94hxr7KmhkRvnuYbKZgNFEL4hXzBMeb1rQ8</code></td></tr><tr><td>soFTT</td><td><code>8eUYeEiGXRMN7V9Xx7CehwSRfJB9iQfJW249zX1z7Uue</code></td></tr><tr><td>RAY</td><td><code>FpKhrtU6nDjEcAi3SsSevRRgPzirLkZpmXD6nfeb7k8c</code></td></tr><tr><td>SBR</td><td><code>5CXDzn4AygQwu59fGxo34T965BmYMHuGvAuoRMeRBKg4</code></td></tr><tr><td>MER</td><td><code>HbXi7Gpe5GXzE7V1SjEEy3sDurmFi7RbTvCZ3Rd7Nv6b</code></td></tr><tr><td>mSOL</td><td><code>Ei2dC7hFxBhVq5pn4qNJLMxKBSojx7p7wnNoBz4HELKG</code></td></tr></tbody></table>


# Introduction

### Welcome to Solend!

Solend is a core DeFi primitive on Solana, that offers lending and borrowing on-chain. Integrating Solend improves capital efficiency by earning yields on idle funds, and empowers a large range of DeFi yield strategies to come to live.

Solend offers a kickback to integrations, allowing integrations to earn borrow fees or utilize our platform to generate higher yields or improve capital efficiency for your users.

Some ideas of integrations:&#x20;

* DeFi Vaults (e.g. [Yearn](https://yearn.fi))
* GameFi game built on top of Solend mechanics&#x20;
* Streaming yield-bearing cTokens for payroll (e.g. [Sablier](https://sablier.finance/))&#x20;
* Fixed yield protocol using cTokens
* Historical APY dashboard&#x20;
* Margin Trading that borrows from Solend's reserves&#x20;
* Account liquidation saver (repay loans for subscriber at reduced penalty before they get liquidated)&#x20;
* Recursive deposit and borrow tool&#x20;
* Prize-linked savings account (e.g. PoolTogether)

Solend is one of the easiest platforms to integrate on Solana, with our open sourced codebase [here ](https://github.com/solendprotocol)and our SDK [here](https://sdk.solend.fi/). We also have a lightweight [client](/developers/solend-lite) which demos usage of the SDK. We also have a dev portal [here](https://dev.solend.fi/) and our APIs [here](https://api.solend.fi).&#x20;

Feel free to get a “Scribe” role and reach out on [Discord ](https://discord.gg/solend)at our #dev-support channel, or DM Soju on Telegram @Sojuuuu54.

### Devnet

The core team highly recommends testing on mainnet, on production! However, we maintain a devnet version of Solend. Devnet does not have as reliable oracles like mainnet, and to have all the latest features it's better to use production.&#x20;

As native USDC is not on devnet as well, the actual token in our devnet reserves is just a token we minted. If you need it for testing, airdrop yourself SOL and deposit it into the program, to borrow "USDC" to test with.&#x20;

&#x20;The instructions is similar for both mainnet and devnet!

Alternatively, you can also fork Solend's code to test against. It is open-sourced [here](https://github.com/solendprotocol/liquidator#target-specific-markets).&#x20;


# Integration Guide

### Introduction

Solend has 3 types of accounts: lending market, reserve, and obligation.

There's only one instance of a lending market for now. There's a one-to-one mapping from listed asset to reserve. There's a one-to-one mapping from user to obligations (which tracks user's collateral/borrows).

Rust definitions are [here](https://github.com/solendprotocol/solana-program-library/tree/9513a15f818ef141188e4727b22ec5b6195a0904/token-lending/program/src/state).

### Calculating TVL from on-chain data example

<https://github.com/solendprotocol/tvl-calculator-example>

### Deriving obligation address

```
const seed = LENDING_MARKET_ADDRESS.slice(0, 32);
const obligationAddress = await PublicKey.createWithSeed(
  new PublicKey(address),
  seed,
  new PublicKey(SOLEND_PROGRAM_ID),
);
```

### Calculating APY

The following typescript snippet is extracted from our codebase:

```
export const calculateSupplyAPY = (reserve: Reserve) => {
  const currentUtilization = calculateUtilizationRatio(reserve);
  const borrowAPY = calculateBorrowAPY(reserve);
  return currentUtilization * borrowAPY;
};

export const calculateUtilizationRatio = (reserve: Reserve) => {
  const borrowedAmount = reserve.liquidity.borrowedAmountWads
    .div(new BN(`1${''.padEnd(18, '0')}`))
    .toNumber();
  const availableAmount = reserve.liquidity.availableAmount.toNumber();
  const currentUtilization =
    borrowedAmount / (availableAmount + borrowedAmount);
  return currentUtilization;
};

export const calculateBorrowAPY = (reserve: Reserve) => {
  const currentUtilization = calculateUtilizationRatio(reserve);
  const optimalUtilization = reserve.config.optimalUtilizationRate / 100;
  let borrowAPY;
  if (optimalUtilization === 1.0 || currentUtilization < optimalUtilization) {
    const normalizedFactor = currentUtilization / optimalUtilization;
    const optimalBorrowRate = reserve.config.optimalBorrowRate / 100;
    const minBorrowRate = reserve.config.minBorrowRate / 100;
    borrowAPY =
      normalizedFactor * (optimalBorrowRate - minBorrowRate) + minBorrowRate;
  } else {
    const normalizedFactor =
      (currentUtilization - optimalUtilization) / (1 - optimalUtilization);
    const optimalBorrowRate = reserve.config.optimalBorrowRate / 100;
    const maxBorrowRate = reserve.config.maxBorrowRate / 100;
    borrowAPY =
      normalizedFactor * (maxBorrowRate - optimalBorrowRate) +
      optimalBorrowRate;
  }

  return borrowAPY;
};
```

Additionally, we have a few other resources for developers:

* [SDK](https:/sdk.solend.fi)
* [API](https://api.solend.fi)s
*


# Solend LITE

[Solend LITE](https://lite.solend.fi/) is a lightweight open-source client to the [Solend program](https://github.com/solendprotocol/solana-program-library).&#x20;

![](/files/8saK07gpbUXRaGcEjoMJ)

It is a great starting point to building with Solend!

1. Checkout the code to see how Solend SDK is used
2. Clone it and try self hosting your own Solend client
3. Fork it and use it to bootstrap your Solend integration

Check out the code [here](https://github.com/solendprotocol/public/tree/master/solend-lite)!


# Liquidators

We rely on third party liquidators, which means anyone can become a liquidator.

{% embed url="<https://github.com/solendprotocol/liquidator>" %}

Get started at the link above, and come introduce yourself in our Discord's #dev-intro for the latest updates.


# Flash Loans

Currently, this version of flash loan implementation for Solend exists, but functionality is limited due to the reentracy of Solana transactions, where Program A calls Program B, and etc.&#x20;

{% embed url="<https://github.com/solendprotocol/solana-program-library/blob/master/token-lending/program/src/processor.rs#L1715>" %}

We are currently working on a working flash loan program and the mitigation for it, so that it can be used safely, and will document it here when it's ready.&#x20;

[ https://github.com/solendprotocol/solana-program-library/pull/70](< https://github.com/solendprotocol/solana-program-library/pull/70>)\ <br>


# Developer Referral Fee

On Solend, 80% of fees are collected as a protocol fee with 20% earmarked as a host fee.&#x20;

The host fee goes to: (in order of priority)

* Users with 1,000 SLND self-referring
* Referrals from another address
* Permissionless pool creators
* Alternative UIs built on Solend smart contracts
* Solend&#x20;

When calling the borrow function on the Solend smart contracts, a client may pass in an address to receive the 20% host fee. This is applicable to DeFi strategies integrating Solend (discount off fee), or alternative UIs to Solend's (pass in an address to receive some fees).&#x20;

This is an incentive to encourage developers to build on top of Solend.

{% embed url="<https://github.com/solendprotocol/solana-program-library/blob/mainnet/token-lending/program/src/processor.rs#L1387>" %}


# Resources and FAQ

Resources:

* <https://api.solend.fi>
* <https://sdk.solend.fi>

Decimal places?

* Token decimals (find using Solscan)&#x20;
* Wads: 10^18
* Token decimals for external rewards: 10^36


