# Swap

## How it works

Aries Markets allows swapping for any Aptos assets and many more through Panora Aggregator.

This swap checks price and routes among various Automated Market Maker (AMM) behind the scene to ensure users automatically trade with the **best** rates in the Aptos ecosystem.

Check [Panora](https://docs.panora.exchange/) to further understand the mechanism of Smart Routine.

Aries Swap enables you to swap across [assets that are listed](https://docs.ariesmarkets.xyz/aries-markets/protocol-parameters/assets-supported).&#x20;

{% hint style="info" %}
*Please note that liquidity for each pair varies, and one should always account for slippage and price impact.*
{% endhint %}

## Leverage Swap

The[ Aries Swap](https://app.ariesmarkets.xyz/swap) product is built upon our Aries Lend, which means users can utilize Aries Swap to swap assets they not yet hold and gain leveraged exposure on assets. The funds that are deposited into Aries can also be used to swap and trade on various AMM markets.

By toggling on ”**Allow Borrowing**”, you will be able to borrow any token from Aries Lend pools directly and gain additional long exposure to trade.

Below are some examples:

<table><thead><tr><th width="133"> </th><th>Successful Example 1</th><th>Successful Example 2</th><th>Successful Example 3</th></tr></thead><tbody><tr><td><strong>Before Swap</strong></td><td><p>Deposit: <code>50 USDC</code> </p><p>Loan: <code>None</code></p></td><td><p>Deposit: <code>50 USDC;</code></p><p><code>20 USD worth of BTC</code></p><p>Loan: <code>None</code></p></td><td>Deposit: <code>50 USDC</code></td></tr><tr><td><strong>Swap</strong></td><td><p><em>Buy SOL</em> </p><p><code>100 USDC</code> borrowed </p><p>⇒ <code>100 USD worth of SOL</code></p></td><td><p><em>Buy BTC</em> </p><p><code>50 USDC</code> deposited + <code>50 USDC</code> borrowed = <code>100 USDC</code> </p><p>⇒ <code>100 USD worth of BTC</code></p></td><td><p><em>Sell Aptos</em> </p><p><code>100 USD worth of Aptos</code> borrowed</p><p> ⇒ <code>100 USDC</code></p></td></tr><tr><td><strong>After Swap</strong></td><td><p>Deposit: <code>100 USD worth of SOL</code></p><p>Loan: <code>50 USDC</code></p></td><td><p>Deposit: <code>120 USD</code> <code>worth of BTC</code></p><p>Loan: <code>50 USDC</code></p></td><td>Deposit: <code>150 USDC</code> Loan: <code>100 USD worth of Aptos</code></td></tr><tr><td><p><strong>Maximum borrow</strong> </p><p><strong>value</strong></p></td><td>100 USD * 80% = 80 > 50</td><td>120 USD * 80% = 96 > 50</td><td>150 USD * 90% = 135 > 100</td></tr></tbody></table>

For simple cases such as USDC → some other coins, such as SOL/BTC :

$$MaximumLeverage=\frac 1 {1-LTV\_{Target  Coin}}$$​

*You can check out the LTV of each supported asset from* [*Assets supported*](https://docs.ariesmarkets.xyz/aries-markets/protocol-parameters/assets-supported)*.*

<table><thead><tr><th width="130"> </th><th width="304">Boundary Example 4</th><th width="380">Boundary Example 5</th></tr></thead><tbody><tr><td><strong>Before Swap</strong></td><td>Deposit: <code>50 USDC</code> </td><td><p>Deposit: <code>50 USDC；</code></p><p><code>100 USD worth of BTC</code></p></td></tr><tr><td><strong>Swap</strong></td><td><p><em>Buy SOL with USDC</em></p><p><code>50 original</code> + <code>200 borrowed</code> = <code>250 USDC</code></p><p> ⇒ <code>250 USD worth of SOL</code></p></td><td><p><em>Buy SOL with BTC</em> </p><p><code>100 USD worth of BTC</code> deposited + <code>625 USD worth of BTC</code> borrowed </p><p>= <code>725 USD worth of BTC ⇒ SOL</code></p></td></tr><tr><td><strong>After Swap</strong></td><td><p>Deposit: <code>250 USD worth of SOL</code></p><p>Loan: 200 USDC</p></td><td><p>Deposit: <code>50 USDC</code>, </p><p><code>725 USD worth of SOL</code> </p><p>Loan: <code>625 USD worth of BTC</code></p></td></tr><tr><td><p><strong>Maximum borrow</strong> </p><p><strong>value</strong></p></td><td>250 USD * 80% = 200 ≤ 200</td><td>50 USD * 90% + 725 * 80% = 625 ≤ 625</td></tr></tbody></table>

In the Example 4, the maximum leverage is 1 / (1 - 80%) = 5x leverage.
