# Overview

Lend. Farm. Stay Protected.

### What is Apricot?

Apricot is a next-gen lending protocol that supports leveraged yield farming on Solana. Our mission is to help users maximize yield while protecting their downsides.

With Apricot, users can:

* Deposit assets to earn interests (Apricot Lend)
* Borrow assets for trading or leveraged yield farming (Apricot Cross-Farm)
* Pre-configure when and how automated deleveraging takes place (Apricot Assist)

### Apricot Lend

Apricot Lend provides standard lending and borrowing services: users deposit assets to earn interests, and use their deposited assets as collateral to borrow other assets.

### Apricot Cross-Farm (X-Farm)

Apricot X-Farm provides **cross-margin** leveraged yield farming service for users to maximize yield from their existing holdings.

Let's take USDT-USDC LP farming for example. In other leveraged yield farming protocols, users would need to own some amount of USDT and USDC before they can start farming the stablecoin pair. If they do not have USDT and USDC sitting in their wallet, they would have to swap other tokens into these stablecoins first.&#x20;

On Apricot X-Farm, users do not need to own any amount of USDT or USDC to start farming. Instead, they can collateralize their non-stablecoin assets to borrow the stablecoins with up to 3x leverage, and start farming USDT-USDC LP right away. These stablecoins will then be auto-pooled and staked for LP tokens, resulting in 3x farming yield.&#x20;

In short, using X-Farm, users can:

1. Deposit any supported assets they already own (e.g. SOL, BTC, USDT, USDC, etc.)
2. Start farming LP tokens at up to 3x leverage, using entirely borrowed assets
3. The LP tokens in your account are auto-staked and periodically compounded, so you start earning 3x LP farming yield right away

In this way, X-Farm efficiently increases users' access to additional yield without forcing them to sell any assets.

But wait, what about the risk of liquidation?&#x20;

### Apricot Assist 1.0

Fear not, Apricot Assist is designed specifically to help users manage their leveraged positions to reduce liquidation risks through an automated self-deleveraging mechanism. With Apricot Assist, users will be able to control:&#x20;

* **When** to start selling or redeeming your collateral assets
* **What** and **how much** assets should be sold or redeemed

Take the example above where a user has opened a 3x leverage USDT-USDC LP position against SOL. However, now the price of SOL fall dramatically overnight. The user can stay protected if he or she has configured Apricot Assist to perform the following deleveraging actions:

* **When:** when "borrow limit used" reaches 95% (liquidation at 100%)
* **What** and **how**: redeem X amount of USDT-USDC LP tokens back to USDT and USDC, and repay the corresponding debt to get back to 90% "borrow limit used"

Apricot Assist's timely intervention produces the following outcomes:&#x20;

* “borrow limit used” goes down to 90%, back to **safety**
* All initial SOL principal is **preserved**
* Size of USDC-USDT LP position has decreased (**lower leverage ratio**, less rewards)

As a user, you can program when Apricot Assist gets activated and how many LP tokens get redeemed and etc. using the **Assist Simulator**.

Note that current version of Apricot Assist 1.0 only supports the repayment of stablecoin debt. In near future, there will be additional support for the repayment of non-stable tokens. For more details, please refer to the Apricot Assist section under Product User Guide.&#x20;


# Video Walkthrough

Check out this [testnet feature walkthrough video](https://www.loom.com/share/c8f4d9df066347b9944f8c7df07006d9):


# Apricot EDU

The education hub for all things Apricot Finance

* [How to open a delta-neutral farming strategy](https://apricotfinance.medium.com/apricot-edu-how-to-open-a-delta-neutral-farming-position-51fcb6b9fa8d) — ([View Video](https://www.youtube.com/watch?v=FLVhUgcOeyU))&#x20;
* [How to open a long position farming strategy](https://apricotfinance.medium.com/apricot-edu-how-to-open-a-long-position-farming-strategy-ba43820d7086) — ([View Video](https://www.youtube.com/watch?v=PKX1koVygTw))
* [Explaining Assist & Borrow Limits](https://medium.com/me/stats/post/2dbb36a200b9) — ([View Video](https://www.youtube.com/watch?v=UpHdnVwTS-E))
* [Apricot Assist: How to Stay Protected with X-Farm](https://medium.com/p/ad0e2c1a4bb4)
* [X-Farm: A Closer Look](https://medium.com/@apricotfinance/x-farm-a-closer-look-48eb873ce17f)


# Relevant Links

**Exchanges**&#x20;

* [Gate](https://gate.io/trade/APT_USDT)
* [Raydium](https://dex.raydium.io/#/market/ATjWoJDChATL7E5WVeSk9EsoJAhZrHjzCZABNx3Miu8B)&#x20;
* [Orca](https://www.orca.so/)

Token Trackers

* [CoinGecko](https://www.coingecko.com/en/coins/apricot)&#x20;
* [CoinMarketCap](https://coinmarketcap.com/currencies/apricot/)

TVL Trackers

* [DefiLlama](https://defillama.com/protocol/apricot-finance)&#x20;

Social Accounts

* [Twitter](https://twitter.com/ApricotFinance)
* [Discord](https://discord.com/invite/C6JrtqZF5U)
* [Telegram](https://t.me/ApricotOfficial)

**Blog —**[ Medium ](https://medium.com/@apricotfinance)


# UI & Connect Wallet

When you head to <https://test.apricot.one>, you'll be greeted with the following:

![List of markets under the Lend tab ](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj78s7pgSMkXODoWzwv%2F-Mj7BDT0os_XUG23tHA4%2Fimage.png?alt=media\&token=73ace48d-35e8-4ad2-898c-149d1d134c7b)

![List of pools under the X-Farm tab](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj78s7pgSMkXODoWzwv%2F-Mj7Bj5Svm4quTQAS19j%2Fimage.png?alt=media\&token=042d7fbc-3930-459b-ab0d-154fad814a66)

Once you connect your wallet using the "Connect To Wallet" button at the top-right corner, you will see the following

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj78s7pgSMkXODoWzwv%2F-Mj7CsVCq7-ai3kvEcYp%2Fimage.png?alt=media\&token=2b9529ee-34f1-4017-aa03-672f859c0eca)

You will see the following dashboard on top showing the assets that you have deposited and borrowed on Apricot

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj78s7pgSMkXODoWzwv%2F-Mj7J_mBkOWazfOoSd_I%2Fimage.png?alt=media\&token=22cc8fed-3cd7-484c-a50c-afba42d1355a)

You can also see key portfolio metrics on the right-hand panel&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7KvwzpSWt_SkmllM7%2F-Mj7MYPKjhjJrWy3VcUb%2Fimage.png?alt=media\&token=7501b1f5-2de6-4ccb-bd64-9c7c6a09b88d)

Finally, you can navigate the Apricot app using the menu on the left-hand side.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj78s7pgSMkXODoWzwv%2F-Mj7KF-gd9rQXLSK_xQI%2Fimage.png?alt=media\&token=c77e40a9-e32a-4c79-bd61-d27c74dad763)


# Dashboard

The "Dashboard" tab is where you can see your entire portfolio and earnings summary. It has a few important sections

* Apricot Bar
* Earnings&#x20;
* Farming positions
* Deposit / Borrow positions

**Apricot Bar**

The bar reflects the overall health of your portfolio by showing how far your current “Borrow Limit Used" is from the "Safe Borrow Limit" and the "Liquidation" point. The higher the percentage of your Borrow Limit Used, the more levered your portfolio is and the more likely liquidation could take place during market volatilities. &#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7KvwzpSWt_SkmllM7%2F-Mj7LqL5vRPgNg4nX7bN%2Fimage.png?alt=media\&token=3205b3e8-aae6-42f6-a879-39a7698ec607)

**Earnings**

Earnings section shows your overall net portfolio APY and its underlying yield components from supplying, borrowing and farming.&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7KvwzpSWt_SkmllM7%2F-Mj7NdoOh4SG5JqA2P44%2Fimage.png?alt=media\&token=4a0eb0b9-b954-4104-8700-30eab5d14b21)

\
**Farming Positions**&#x20;

Farming Positions section shows the respective LP tokens farmed and the associated farming APY and rewards earned in value.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7KvwzpSWt_SkmllM7%2F-Mj7O4D6ahHTyCNL8hBt%2Fimage.png?alt=media\&token=19180ddb-de99-4f94-bba8-ab4e39431a92)

**Deposit / Borrow Positions**&#x20;

In a similar format, you can see details of your deposit/borrow positions and respective rewards earned in the sections&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7KvwzpSWt_SkmllM7%2F-Mj7OYhNBzY0jW4BlyFK%2Fimage.png?alt=media\&token=c6268682-222d-48bf-8e95-336853f272e0)


# Apricot Lend

Lending & borrowing

This guide covers how to:

* Deposit
* Borrow
* Withdraw
* Repay

### Markets

At the "Lend" tab, you can see the list of all tokens supported by Apricot.&#x20;

Note that **LP tokens** can be deposited as collateral against which users can borrow and farm with leverage. However, LP tokens cannot be borrowed so there is no deposit or reward APY.  Apricot will instead farm LP tokens for you to earn a farming APY.&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7P-JnPA_4-53e5xRy%2Fimage.png?alt=media\&token=17f9345f-6bf1-429a-a9de-706a94e4a7de)

### Deposit

Once you have already connected your wallet, you will be able to deposit your tokens by clicking on the deposit button for the corresponding token. Hovering over the info button will show you the breakdown of the base deposit APY and the Apricot reward APY.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7S7ommlR5KBueDg_n%2Fimage.png?alt=media\&token=df978170-73b8-4f2f-bf0b-5780c6ad5635)

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7RlInYlxey2efh2o8%2Fimage.png?alt=media\&token=6cd1d56e-0fd7-47c4-a4e5-446eb0be343d)

After clicking the deposit button, you'll see a popup where you can specify the amount of token you'd like to deposit:

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7VWnVEZt7Z0CAhK74%2Fimage.png?alt=media\&token=7858b72b-7e95-4348-a5f9-eb3e359afd37)

After you confirm the amount of token to deposit and click on the Supply button, the  dashboard on top will be updated to reflect the new deposit you just made.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7W6VAOPh6NpuOlWQb%2Fimage.png?alt=media\&token=904da3a9-a872-463a-8443-7ab203efe534)

### Borrow

Borrow works in a similar way. You can click the Borrow button for your chosen token, specify the amount to borrow in the popup, and confirm transaction. Upon successful transaction,  your borrow position will be reflected in the dashboard on top.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7X3580hZqO5JMFvqa%2Fimage.png?alt=media\&token=54ca944a-07f4-4d79-ae96-6c1684025367)

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7XL4H1N5Ej09J1yPq%2Fimage.png?alt=media\&token=5ff34d90-2cf7-44d5-8bb4-2db097ccbbcb)

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7XVes928cTiAddUAa%2Fimage.png?alt=media\&token=c2193421-ac35-48ce-90eb-46c2f969d839)

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7OfoMaNHxHeqsJc3p%2F-Mj7XpyR4Oy_R7jxMo5d%2Fimage.png?alt=media\&token=9c1dd37a-4ea0-40e2-b176-c710faee7940)

### Withdraw & Repay

Your existing deposit and borrow positions are displayed in the dashboard on top. For your deposits, you can click the "Withdrawal" button and specify the amount you'd like to withdraw. For your borrow positions, you can click on the "Repay" button and specify the amount of token's you'd like to repay.


# X-Farm

Cross-margin, leveraged yield farming

This guide covers how to:

* Farm LP tokens&#x20;
* Redeem LP tokens

**Farm LP tokens**&#x20;

At the "X-Farm" tab, you can see a list of all liquidity pools supported by Apricot:

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7YVjjsd29-Ywzyofc%2Fimage.png?alt=media\&token=67926e00-e428-4c1e-8053-df2e13ae326f)

For a given pool, you can change the Borrow Power Utilization slider to get a quick overview of the APY breakdown if you choose to farm with that amount or at that leverage level&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7YtRrJfbzk_cL39dJ%2Fimage.png?alt=media\&token=18c37f7a-c315-4bd1-85d2-10eef0e9aa18)

After clicking "Farm", you will see the following popup.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7ZZH_XuLQS8ivY1DC%2Fimage.png?alt=media\&token=ed7b8207-6178-4c67-b5a0-324fb74d5590)

Note that the "Max amount of LP token you can farm now" refers the value of LP tokens you can leverage farm without supplying any additional assets (calculated based on the borrowing limit of your existing deposits with Apricot).

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7Zcd62m_AWELMmhWR%2Fimage.png?alt=media\&token=33c8b15d-ab06-4715-abf1-ed8efcff96c5)

You also have the option to increase your borrowing power by supplying additional tokens. Just click the plus sign right next to the number value, and you will see the following popup that guide you to supply tokens from your wallet.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-MiTJF5Wzqb8SZC92a97%2F-MiTUzxnPAPD7oGJ-weG%2Fimage.png?alt=media\&token=d04a8185-fbd8-4624-92cb-b1924a60808a)

Sliding “Select farm value" will cause the "Borrowing Limit Used" to change accordingly to reflect the corresponding leverage impact on your portfolio with that farming amount.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7_RNLroyewoWfqzHS%2Fimage.png?alt=media\&token=ed7a3410-7a20-4aac-b7fe-cc4cd2c808d2)

You can also see the details of the entire farming transaction and yield breakdown via "APY Summary" and "Transaction Summary".

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7ai2v20I2FdlxCzZ3%2Fimage.png?alt=media\&token=c539ee0c-65fe-4e2d-99d5-9ad319cf6ee3)

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7b0-Mr56mqD3LnSyT%2Fimage.png?alt=media\&token=3261e65d-7425-4c0d-806e-f32b7c135b3f)

Click "Start Stable Farming" to confirm transaction and you can see from the dashboard increases of LP tokens in "My Deposit" and USDT+USDC in "My Borrow" positions.&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7YDUtUOuRSsNMcdKF%2F-Mj7bNwzbP4FS-r3SAbL%2Fimage.png?alt=media\&token=f67d54ea-3d1e-4b47-aa7e-19310791c4ff)

**Redeem LP tokens**&#x20;

You can choose to redeem your LP tokens partially or fully back into the underlying tokens (e.g. USDT-USDC LP into USDT and USDC), which would be used to repay your borrowed positions in the respective assets first. The remaining amount, if any, will go to your deposit balance.&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7bRNo9IGxWtouRndF%2F-Mj7beRD6a8iW2Mzjll1%2Fimage.png?alt=media\&token=15e0e277-a599-4956-8db8-85d6e8e7744b)


# In-App Swap

## Overview

Apricot has integrated with Raydium, Orca and Saber so that our users can easily swap their assets already deposited in Apricot, and without the need to withdraw tokens and go to a separate DEX to perform the swap.

For example, with in-app swap, users can:

* Swap their already deposited SOL to USDC (vice versa)
* Easily repay borrowed tokens using their existing deposit
* Borrow USDC to long SOL (or short), on leverage
* Change their farming exposure after they have started LP farming

## How it works

From the Swap tab, users can swap any of our supported tokens with USDC in either direction. If the user has deposited enough of the token being sold, the sold amount is deducted from their Apricot account and the bought token is credited into their account at the same time.

In the case that the user is trying to sell more than what they have deposited into their Apricot account, Apricot helps the user borrow the needed token from our lending pool, and use that to complete the swap transaction. The bought token is then credited into their account. The bought token will be used to repay the user's debt, if they have borrowed the corresponding token. The excess will then go into their deposit.

At the bottom of the swap tab, the details of the transaction, and how your account will change after the transaction, is displayed so you can have a clearer understanding. As an example:

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgy_H-REivbwMEM9tBd%2Fuploads%2Fj8UIYCshJhTbmoGGNvsM%2Fimage.png?alt=media\&token=c8cd5eaf-d732-4923-bfc4-d0fd92f49b97)

## Using leverage

With in-app swap, users would be able to long or short any of the supported token with close to 3x leverage. For example, user A could deposit $1000 worth of SOL, and use in-app swap to buy another $2000 worth of SOL so as to increase his long exposure.&#x20;

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgy_H-REivbwMEM9tBd%2Fuploads%2FzdMws9AOOEh2Ztdw0Qi6%2Fimage.png?alt=media\&token=6dad862a-4a6d-4135-8ac1-05d3dca88a02)

The table below shows how his account would change after the transaction.

| Position    | Before swap  | After swap           |
| ----------- | ------------ | -------------------- |
| Deposit     | $1000 of SOL | $1000 + $2000 of SOL |
| Borrow      | None         | $2000 USDC           |
| Net deposit | $1000        | $1000                |
| Leverage    | 0x           | 2x                   |

Do note that when you long or short tokens on leverage, your account is exposed to greater risk of liquidation, and you may consider having Assist enabled to reduce that risk.


# Apricot Assist

Automated, self-deleveraging tool

### Overview

Apricot Assist is a background program that constantly monitors your account's [Borrow Limit Used](/product/glossary). When your Borrow Limit Used reaches the "Trigger Level" set by yourself, Apricot Assist can help you automatically sell/redeem tokens in your deposit to repay the tokens you've borrowed.

### How does it work?

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj5a3h0dwAdcAAHUpXf%2F-Mj5anAaQOOi5TFPa6Xb%2Fimage.png?alt=media\&token=596ba67b-93c2-4fab-8cbd-7de51d85c13c)

Here are the steps:

1. Configure Trigger Level and Target Level, and **Enable** Apricot Assist on your account
2. Apricot Assist will start a background program that constantly monitors your Borrow Limit Used&#x20;
3. Once Borrow Limit Used exceeds the Trigger Level configured in step 1, Apricot Assist will sell/redeem some of the tokens in your deposits to repay your stablecoin debt.
4. After step 3, your Borrow Limit Used should now reach your configured Target Level.

### Order of operation

Currently, Apricot Assist 1.0 can help you sell/redeem any token in your deposits to repay your stablecoin debt only. When triggered, Apricot Assist will attempt the following actions in order:

* Redeem LP tokens to repay corresponding stablecoin debt
* Sell stablecoins in your deposit to repay stablecoin debt
* Sell non-stable tokens in your deposit to repay stablecoin debt

You can observe the exact deleveraging action plan under the Assist Simulator.

### Assist Simulator

Assist Simulator shows you the exact operations Apricot Assist will execute when it is triggered. You can change your Trigger Level and Target Level on the left to observe how Apricot Assist changes its deleveraging plan accordingly.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj5g_l1pua5281eWBmF%2F-Mj5wr6X77DSioCcF2Xn%2Fimage.png?alt=media\&token=af64b30f-c240-4cf6-91a3-19d7ebf84dc2)

### Apricot Assist 2.0

In the next version of Apricot Assist, we will be able to help you repay debts in non-stable tokens (such as BTC, ETH and SOL) as well. If you have borrowed any non-stable token (e.g. if you've borrowed BTC to short it), current Apricot Assist 1.0 will not be able to help you repay the non-stable debt.

### Recommended Configuration

It is recommended to keep the difference between the Trigger Level and Target Level to a relatively small value (e.g. 5%), so that Assist does not sell/redeem too much of your deposits when it is triggered.&#x20;

Apricot Assist will be fired whenever your Borrow Limit Used exceeds Trigger Level. It will be fired multiple times if your Borrow Limit Used reaches the Trigger Level multiple times in a day, so there is no need to intentionally set a Target Level significantly lower than your Trigger level.

### Apricot Assist 1.0 Limitations

1. Assist can execute at most 6 actions when it is triggered. When the number of required deleveraging steps is 7 or more, Assist will still perform 6 actions only. In this case, it is possible that your Borrow Limit Used will not actually reach your Target Level. This situation is likely to occur when your Target Level is significantly lower than your Trigger Level, and when you have a very complex account with a large number of different tokens in your deposit and borrow.
2. When Apricot Assist sells your non-stable tokens to repay stablecoin debt, it performs the transaction with a 1% slippage tolerance. When the execution slippage is larger than 1%. Apricot Assist will reject the transaction. As a result, this could lead to Assist failing to fully execute its planned actions, thus failing to bring down Borrow Limit Used to Target Level.


# Glossary

| **Term**            | **Explanation**                                                                                                                                                                                                                                                |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Total Deposit Value | Sum of the USD value of all the assets you have deposited                                                                                                                                                                                                      |
| Total Borrow Value  | Sum of the USD value of all the assets you have borrowed                                                                                                                                                                                                       |
| Net Deposit         | Total Deposit Value less Total Borrow Value in your account                                                                                                                                                                                                    |
| Net APY             | Expected total earnings from all positions, divided by net deposit.                                                                                                                                                                                            |
| Max Borrow Value    | When Total Borrow Value exceeds Max Borrow Value, your account may be subject to liquidation. The computation of your Max Borrow Value is documented in the [LTV page](/protocol-details/risk-parameters).                                                     |
| Safe Borrow Value   | Protocol Safe Borrow Value is set to be 90% (of Max Borrow Value).  Users will not be able to borrow beyond the Safe Borrow Value. However, when collaterals fall in value, or borrowed assets appreciate, it is possible that Total Borrow Value exceeds 90%. |
| Borrow Limit Used   | Ratio between Total Borrow Value and Max Borrow Value. When it reaches or exceeds 90% (Safe Borrow Value), users will not be able to borrow further. When it reaches 100%, liquidation could occur.                                                            |


# FAQ-APYs

## Regarding Net APY and Net Deposit

#### My Net APY is negative. What does that mean?

It means your borrow cost is greater than your earning from your deposit and farming positions. When this happens, it may make sense to reduce your borrow positions.

####

#### Is it possible for an LP pool to generate a negative APY?

Yes. This happens when the cost of borrowing is greater than the expected farming APY of that pool. However, if you are using your own deposit to perform farming, then you can actually farm without borrowing additional tokens. If that is the case, you may not incur additional borrow cost.

#### What is your Net Deposit?

Your net deposit is how much you've deposited (LPs also count as deposits) minus how much you have borrowed.

When you deposit or borrow directly in the Lend tab, your net deposit will correspondingly increase or decrease. When you perform X-Farming, however, since your deposit and borrow increase by the same amount, your Net Deposit does not change (or only changes by a very small amount).

#### What is your Net APY?

Net APY shows the amount you are expected to earn over a year, divided by your net deposit. Note that when you perform farming in the X-Farm tab, your net deposit does not change (see previous question), but your Net APY will change as a consequence of the added borrow position and LP farming position.

#### What is Max Net APY vs. Net APY Change vs. Final Net APY, and why are they so different?

On the X-Farm tab, each pool has a "Max Net APY". This Max Net APY is computed on these assumptions:

1. User deposit contains USDT or USDC only (these have the highest LTV)
2. User performs farming on this LP pool to his maximum permissible leverage

This number is not very accurate for you if your account consists of a mix of different deposits, or if you have no intention of using maximum leverage.

Instead, the more accurate APY numbers for you are "Net APY change" and "Final Net APY".

<img src="https://31048181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgy_H-REivbwMEM9tBd%2Fuploads%2FbYbbw2lfNRsikwaCuUnh%2Fimage.png?alt=media&amp;token=f1b90bed-a827-4b54-a946-5c2c11c91d7c" alt="" data-size="original">

Here, Net APY Change indicates how much your Net APY will change if you enter into this new farming position. And Final Net APY is just your current Net APY plus this change.


# FAQ-Farming

#### What happens when I start X-Farming?

Let's take SOL-USDC for example. If you decided to farm $X dollar of SOL-USDC, Apricot usually helps you get approximately $X/2 dollar of SOL and $X/2 dollar of USDC.&#x20;

If you have these tokens in your deposit, Apricot will first use your SOL and USDC deposit positions. However, if you do not have or do not have enough of these tokens in your deposit, Apricot will help you borrow the additional amounts of SOL and USDC to make up for a total of $X/2 dollar of SOL and $X/2 dollar of USDC.

These $X/2 dollars of SOL and $X/2 dollars of USDC will then be deposited into the corresponding LP pool to generate new LP tokens. Apricot will then deposit these LP tokens back into your Apricot account, and use these as collateral.

The LP tokens deposited on Apricot are automatically farmed and auto-compounded to give you higher yields.

#### What happens when I redeem my LP token deposits?

Apricot will stop farming the portion of LP that you are redeeming, and redeem the LP token back to its constituents. For example, when you redeem your SOL-USDC LP, you will receive SOL and USDC in your Apricot account.

When SOL-USDC LP is redeemed, if you have any borrow position in SOL or USDC, these SOL and USDC tokens returned will first be used to repay your borrow positions. Any amount remaining will then be added to your deposit positions.

#### After redemption, additional imbalances appeared in my account. What happened?

LP tokens represent shares of liquidity pool, and the balance within a liquidity pool can change depending on market situation. If we take SOL-USDC LP as an example, it is possible that, when you started farming, each LP corresponds to 1 SOL and 100 USDC. If the price of SOL rises and the liquidity pool's balance changes, it is possible that now each LP will correspond to less SOL and more USDC (e.g. 0.9 SOL and 111 USDC).

If you borrowed 1 SOL and 100 USDC to enter into this farming position, and, at redemption, this LP token is redeemed back to 0.9 SOL and 111 USDC, you will end up with a borrow position of 0.1 SOL and a deposit position of 11 USDC.

Currently Apricot does not automatically help you even out the imbalance after redemption. You would need to manually withdraw that added deposit, and swap it to the other token (e.g. SOL) and manually perform repayment.

We are working on a feature to help users even out these imbalances with a few clicks and without the need to withdraw & swap on another dex.

**Does farming change my exposure to the underlying tokens? E.g. does farming SOL-USDC LP change my exposure to SOL?**

X-farm is delta-neutral by default, meaning it does not change your Apricot account's exposure to the underlying tokens. When you open a farming position for SOL-USDC LP, your exposure to SOL is not altered. If your Apricot account is already longing SOL, it remains so; if it is already shorting SOL, it remains short too.


# FAQ-Miscellaneous

W**here on the interface do I track my X-Farm performance?**

Currently, it’s difficult for users to track and monitor which unique positions are impacting their PnL on the platform, particularly given the Apricot borrow platform is cross-margin.&#x20;

We’re mitigating this issue by adding to our interface transaction history and the reporting of isolated performance of each position opened, so that users can easily monitor and adjust their farming positions accordingly.

**If I am withdrawing from X-Farm, do I need to redeem or repay first?**

You can choose to redeem your LP tokens partially or fully back into the underlying tokens (e.g. USDT-USDC LP into USDT and USDC), which would be used to repay your borrowed positions in the respective assets first.&#x20;

The remaining amount, if any, will go to your deposit balance. You will then be able to withdraw.

**Does my Net Deposit (featured on the sidebar) include the value of deposited APT?**

The net deposit does include your APT deposit, yet.&#x20;


# Interest Rates

We use a 2-stage interest rate model, where computation of the interest rate is separated into two stages.

![Kinked Interest Rate Model Example](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mgy_H-REivbwMEM9tBd%2F-Mj7iz7Mnz45OPCWXum3%2F-Mj7lHkM3_F9tIYyW7DZ%2Fimage.png?alt=media\&token=8e2fd45b-bc47-463e-90a1-47992d69fb95)

Before utilization reaches the kink level, interest rate is a linear interpolation between `r0` and `kink_rate`. After utilization goes above the kink level, interest rate is computed as a linear interpolation between `kink_rate` and `full_rate.`

The parameters, `r0`, `kink_rate`, `full_rate` and `kink` for various tokens are listed below:

Do note these numbers are tentative and applies only to testnet for now. Mainnet numbers may change.

<table data-header-hidden><thead><tr><th width="150">Token</th><th width="150">r0</th><th width="150">r1</th><th width="150">r2</th><th>kink</th></tr></thead><tbody><tr><td>Token</td><td>r0</td><td>kink rate</td><td>full rate</td><td>kink</td></tr><tr><td>BTC</td><td>2%</td><td>20%</td><td>200%</td><td>0.85</td></tr><tr><td>ETH</td><td>2%</td><td>20%</td><td>200%</td><td>0.85</td></tr><tr><td>SOL</td><td>2%</td><td>20%</td><td>200%</td><td>0.85</td></tr><tr><td>mSOL</td><td>2%</td><td>20%</td><td>200%</td><td>0.85</td></tr><tr><td>RAY</td><td>2%</td><td>20%</td><td>200%</td><td>0.85</td></tr><tr><td>ORCA</td><td>2%</td><td>20%</td><td>200%</td><td>0.85</td></tr><tr><td>USDT</td><td>1%</td><td>8%</td><td>100%</td><td>0.85</td></tr><tr><td>USDC</td><td>1%</td><td>8%</td><td>100%</td><td>0.85</td></tr><tr><td>USTw</td><td>2%</td><td>20%</td><td>3000%</td><td>0.90</td></tr></tbody></table>


# Liquidity Mining Program

The team is pleased to announce the refurbishment of Apricot's platform emissions, both platform liquidity mining architecture and APT utility implementation.

The rate of emissions for APT is 100M per year.

![Weights in the table are subject to further adjustments in the future.](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgy_H-REivbwMEM9tBd%2Fuploads%2FQSxBbVrf09u3HC3tNWHJ%2FLiquidity%20Mining%20Weights.png?alt=media\&token=ae6a8ccb-4d14-4135-ac1a-fa63fe5c8a03)

## Liquidity Mining Claim Periods

* Liquidity Mining rewards are claimable once every 2 weeks.&#x20;
* There is also a lockup period of 2 weeks.&#x20;
* Rewards earned during Week 1 and Week 2 will be made available at the beginning of Week 4.

## **Staking-Dependent Liquidity Mining Rates**

Users who wish to receive full liquidity mining rewards are required to hold 0.1% of their net deposit as APT in order to earn 100% reward emissions, otherwise rewarded emissions are halved by 50%.

**View Relevant Article:** Inserting Link Shortly&#x20;


# Liquidation Threshold & LTV

## Liqiudation Threshold

The following ratios are the liquidation threshold for the supported assets deposited into the Apricot platform. Note that LTV is just 0.9 \* liquidation threshold.&#x20;

| APT                  | 0%  |
| -------------------- | --- |
| SOL                  | 60% |
| mSOL                 | 60% |
| stSOL                | 60% |
| scnSOL               | 0%  |
| soBTC                | 0%  |
| soETH                | 0%  |
| whETH                | 85% |
| RAY                  | 60% |
| ORCA                 | 40% |
| SRM                  | 0%  |
| USDT                 | 90% |
| USDC                 | 90% |
| USTw                 | 0%  |
| USDT-USDC LP (Saber) | 80% |
| All other LPs        | 0%  |

### Max Borrow Value

Your Max Borrow Value is determined by the assets you have deposited, and their liquidation threshold. Specifically, it is computed as below, summed over all the assets you have in your deposits:

```
token_deposit_amount * token_price * token_liquidation_threshold
```

For instance, if you have 1 whETH and and 1000 USDT in your deposits, and the price of whETH is $10,000, then your Max Borrow Value is computed as

```
  1 * 10,000 * 85% + 1000 * 1 * 0.90
= 8500 + 900
= 9400
```


# Fees

## Lending

20% of all lending interests paid by borrowers are collected as protocol fees, and the remaining 80% are distributed to depositors.

### Recursive Loans

When you borrow a token for which you already have a deposit position, we charge a 0.075% one-time fee.

### Assist 1.0

Apricot Assist 1.0 currently does not charge a fee — it is completely free.&#x20;

## Farming

Apricot charges a 20% performance fee on the earning from LP token farming. Do note that the earnings shown on Apricot Dashboard already has the performance fee deducted, so the amount shown in the Dashboard tab is the full amount you've earned.

![](https://31048181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgy_H-REivbwMEM9tBd%2Fuploads%2FgXxc7jJ7vbxuSRXYpRdG%2Fimage.png?alt=media\&token=719e1bf4-a726-4398-a56c-f7aadf60b979)


# Liquidation Penalty

## Liquidation Penalty

| Token  | Liquidation Penalty/discount |
| ------ | ---------------------------- |
| BTC    | 4%                           |
| ETH    | 4%                           |
| SOL    | 4%                           |
| mSOL   | 4%                           |
| stSOL  | 4%                           |
| scnSOL | 4%                           |
| SRM    | 4%                           |
| RAY    | 4%                           |
| ORCA   | 4%                           |
| USDT   | 4%                           |
| USDC   | 4%                           |
| USTw   | 4%                           |

**Liquidation Threshold Function:** SUM(LTV\*BorrowValue) / SUM(DepositValue) >= 100%


# Price Oracles

Apricot's platform is dependent on the market feeds of two pricing oracles:

* [Pyth Network](https://pyth.network/)&#x20;
* [Switchboard](https://switchboard.xyz/)

An asset's price on the platform is updated once the asset price of each feed is congruent.&#x20;


# Client Interface

You will be able to find more info on our [apricot-client](https://github.com/Apricot-Finance/apricot-client) repo. The JS part is now replaced by the ts sdk and samples.

* [samples-ts](https://github.com/Apricot-Finance/apricot-client/tree/main/samples-ts)
* [sdk-ts](https://github.com/Apricot-Finance/apricot-client/tree/main/sdk-ts)
* [rust](https://github.com/Apricot-Finance/apricot-client/tree/main/rust)
* [samples-rust-client](https://github.com/Apricot-Finance/apricot-client/blob/main/samples-rust-client/src/main.rs)
* [samples-rust-contract](https://github.com/Apricot-Finance/apricot-client/blob/main/samples-rust-contract/src/lib.rs)

We haven't updated the rust interface in a while, so some of the features might be broken. If you need help find us in our [discord](https://discord.gg/C6JrtqZF5U)!

## Specific pointers

### How to get UserInfo?

rust:

```
// taken from apricot-client/samples-rust-client/main.rs
#[allow(unaligned_references)]
{
    let user_info_key = consts::get_user_info_k(user_wallet);
    let data = conn.get_account_data(&user_info_key).unwrap();
    let user_info = utils::cast::<state::UserInfo>(&data[..]);
    println!("Showing user with {} assets:", user_info.num_assets);
    for i in 0 .. user_info.num_assets as usize  {
        println!("=============================");
        println!("Asset PoolID: {}", user_info.user_asset_info[i].pool_id);
        println!("Asset borrow amount: {}", user_info.user_asset_info[i].borrow_amount.to_native_amount());
        println!("Asset deposit amount: {}", user_info.user_asset_info[i].deposit_amount.to_native_amount());
        println!("Asset borrow interests: {}", user_info.user_asset_info[i].borrow_interests);
        println!("Asset deposit interests: {}", user_info.user_asset_info[i].deposit_interests);
    }
}

```

ts:

```
// taken from apricot-client/samples-ts/src/samplePortfolio.ts
let portfolioLoader = createPortfolioLoader(walletKey, getConnection());
await portfolioLoader.refreshPortfolio();
console.log(await portfolioLoader.getUserInfoAddress());
console.log(await portfolioLoader.getUserAssetInfoList());
console.log(await portfolioLoader.getBorrowPowerInfo());
```


# Liquidator Interface

Our own liquidator is here:

<https://github.com/Apricot-Finance/liquidator-bot-ts>


