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:

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.
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.