# Welcome to Multiswap

Multiswap represents a return to sound financial engineering principles in the spirit of the Black-Scholes model. To understand what Multiswap is, and how it works, let's go back to the basics.

## What is an AMM?

An AMM is a protocol that maintains a balance between assets and liabilities. It creates a liquidity pool of asset tokens and introduces a pool token liability that mirrors the value of these underlying assets. The system ensures that the total value of assets always equals the total liabilities.

![](https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2FGQZoAsP8zyQfOoPwaydN%2Fpooltokens.png?alt=media\&token=7e30bbaf-107b-4e5f-adc4-d3040f9dbcdb)

In other words, the AMM is always balanced with the total asset value equal to the total liability value. From this, the AMM imposes a number of constraints that capture elements of supply and demand in order to make a market, i.e. produce prices, for the asset tokens in the pool.

### A Rebalancing Portfolio

The first constraint AMMs impose on the portfolio is that the post-trade weight of each asset token in the pool is known and does not depend on the trade. This means that an AMM operates as a rebalancing portfolio. For example, each Uniswap pool is a two-asset portfolio that maintains a 50/50 ratio between its assets. The total value of all Liquidity Provider (LP) tokens at any given time equals the combined value of the two asset tokens.

This constraint allows us to determine the state of the AMM given the weights and reserves of each token. It also lets us calculate the price of each asset based on the reserves of each token and their respective weights.

## The Three Principles&#x20;

Multiswap differentiates itself by enforcing three specific principles:&#x20;

* Value of LP tokens = Value of asset tokens
* A pre-specified pool rebalancing strategy
* Self-financing transactions&#x20;

These principles ensure a stable trading environment that benefits both LPs and traders.

### 1. Value of LP tokens = Value of asset tokens

The first principle stipulates that the value of a pool token must equal the value of all assets in the pool, making it a liability for the assets. This approach focuses on achieving and maintaining an optimal ratio between asset pairs in a liquidity pool.&#x20;

### 2. A Pre-Specified Pool Rebalancing Strategy

The second principle means that the post-trade weight of each asset is known before the AMM state changes and does not depend on the trade. This principle involves adjusting asset ratios within a liquidity pool to maintain the desired proportions. Rebalancing also helps mitigate the risk of impermanent loss and ensures that LPs receive a fair return on their investments.

### 3. Self-Financing Transactions

The third principle declares that no value is created or destroyed in the process of a transaction,  but is merely transferred from one token to another. Multiswap's commitment to self-financing transactions guarantees that it can reward LPs fairly and maintain a fair trading environment.


# Our Mission

CavalRe is on a mission to bring all capital markets on-chain. To do so, we must introduce radically capital-efficient and scalable financial primitives ultimately capable of supporting the entire global financial system.

As the first step toward this mission, we are proud to introduce Multiswap, A novel multi-asset Automated Market Maker offering unrivaled ease, speed, and security in trading and asset provision, all powered by cutting-edge math.&#x20;

#### Multiswap delivers a suite of features that seemed impossible together until now:

* Native multi-token swaps
* Unified liquidity
* No single-trade IL
* Single-sided staking
* No routing issues
* Perfect rebalancing
* Improved trade execution

A massive leap forward for both traders and liquidity providers.


# Multiswap: For Liquidity Providers

1. **Access to an ETF-Like LP Token:**&#x20;

LP tokens on Multiswap represent the value of all assets within the pool in their given weights, similar to how an ETF represents a basket of different stocks. This diversified exposure reduces risk and optimizes portfolio management.

2. **Perfect Rebalancing:**&#x20;

Multiswap pools are constantly rebalancing, aligning asset weights with preset constraints, and mimicking ETF behavior.

3. **No Single-Trade Impermanent Loss:**&#x20;

With its unique post-trade pricing mechanism, Multiswap eliminates subsidies on trades that would lead to both the single-trade impermanent loss and loss-vs-rebalancing found in other AMM designs.

4. **Native Single-Sided Staking:**&#x20;

Providing and removing liquidity is as easy as swapping one of the tokens in the pool for the LP token or vice versa. Greatly simplifying the user experience.


# Multiswap: For Traders

1. **Multi-Asset Swaps:**&#x20;

M-to-N multi-asset swaps allow you to natively rebalance your entire cryptocurrency portfolio in a single trade with no batching or liquidity fragmentation.

2. **Unified Liquidity:**&#x20;

By unifying all token liquidity into a single pool, Multiswap delivers better price execution and reduces price slippage on large trades.

3. **No Routing Issues:**&#x20;

Multiswap eliminates the need for trade routing through multiple two-token pools, creating savings on gas costs and enhancing trade execution.

4. **Effortless Hedging:**&#x20;

Multiswap enables traders to hedge their portfolios seamlessly by obtaining consistent, diversified exposure through a single LP token.


# The Large Cap Crypto Pool

Overview of Pool Assets and their Respective Weights

Whether you're a liquidity provider seeking sustainable yields, or a trader aiming to execute your first multi-token swap, Multiswap's debut pool is designed to cater to your needs. The pool offers a diverse selection of ten tokens on Avalanche, carefully curated to include trusted stablecoins and blue-chip cryptocurrencies like Bitcoin, Ethereum, and Avalanche.

In the Multiswap liquidity pool, the weight of each token is meticulously chosen to ensure optimal performance and risk management. The weights are strategically distributed to create an efficient and well-diversified pool, making it ideal for investors seeking an ETF-like experience, and traders seeking deep liquidity.&#x20;

The precise token weights are as follows:

| Asset  | Weight |
| ------ | ------ |
| WAVAX  | 25%    |
| USDC   | 25%    |
| USDt   | 10%    |
| EUROC  | 5%     |
| USDC.e | 2.5%   |
| USDT.e | 5%     |
| DAI.e  | 2.5%   |
| WETH.e | 10%    |
| wBTC.e | 2.5%   |
| BTC.b  | 12.5%  |


# A Unique Fee Structure

Overview of Multiswap's Unique Fee Implementation

Multiswap's introduction of an innovative tiered fee system, akin to major centralized exchanges like Coinbase, marks a groundbreaking shift in AMM fee structures. Unlike conventional AMMs that apply a uniform fee across the entire pool and often support only two tokens per pool, Multiswap's approach allows each asset within the pool to have an individualized fee structure.&#x20;

By tailoring fees for each asset within the unified pool, Multiswap offers a fee structure that can reward high-volume traders and liquidity providers.

Traders with higher trading volumes are rewarded with fee discounts, encouraging them to conduct more transactions on the platform and increase LP profitability.&#x20;

Below is the fee matrix for the Large Cap Crypto Pool:

| Asset  | Fee     |
| ------ | ------- |
| WAVAX  | 0.2500% |
| USDC   | 0.0050% |
| USDt   | 0.0050% |
| EUROC  | 0.0100% |
| USDC.e | 0.0050% |
| USDT.e | 0.0050% |
| DAI.e  | 0.0150% |
| WETH.e | 0.2000% |
| wBTC.e | 0.2000% |
| BTC.b  | 0.2000% |


# Providing Liquidity

## Providing liquidity on Multiswap

LP tokens on Multiswap represent a liquidity provider's share of the pool, similar to other decentralized exchanges (DEXs). The key feature that sets Multiswaps LP tokens apart is the ability to trade LP tokens with any asset.

### Providing Liquidity with a Single Asset

One of Multiswap's innovative features is giving users the opportunity to provide/remove liquidity with just a single token, instead of requiring pool assets to be provided/removed in their exact weights. One downside of providing/removing liquidity in non-exact weights is that it <mark style="color:red;">will lead to price slippage, as the reserves of all tokens are not being scaled equally.</mark>&#x20;

*Trade any number of tokens for the pool token, or vice versa. ⬇️*

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2FLoJvRAweljTw1fa32ZBR%2Fimage.png?alt=media&amp;token=b68f3932-5a75-4a76-beb9-0798229eb861" alt=""><figcaption><p>Providing Liquidity with One Pay Token</p></figcaption></figure>

### Providing Liquidity in Exact Weights:

Providing liquidity the classic way is made simple on Multiswap. Simply acquire the required tokens in their weights, and place the LP token into the quote panel.&#x20;

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2FZEG40XZTBIsbu2kb2z73%2Fimage.png?alt=media&amp;token=283a849a-fe70-411b-8888-f45188fc95bf" alt=""><figcaption><p>Setting up to Remove Liquidity</p></figcaption></figure>

You will then be prompted to either "Remove Liquidity" or "Add Liquidity" depending on if the LP token has been placed as a pay or receive token. Selecting one of these choices will construct a Multiswap using the exact weights, ensuring that you suffer <mark style="color:green;">no price slippage</mark>.&#x20;

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2FQTMHLmzp2PXLyiM0FISW%2Fimage.png?alt=media&amp;token=9e72f0fa-636e-4ffd-abb9-3afec7a223d7" alt=""><figcaption><p>Removing Liquidity</p></figcaption></figure>


# Building a Multiswap

## Trade

Users can view lists of available assets and pool tokens on the Trade page, along with important information such as the current price and token reserves. In addition, users can search for tokens using their respective ticker symbols, making it easy to find desired tokens.

To trade, users can click "Buy" or "Sell," and the asset will be added to the Quote panel.

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2Fy1maKltYjTOwvpw128Ux%2Fimage.png?alt=media&amp;token=ffe4440c-40b2-4773-8ab3-06ba1bf1b949" alt=""><figcaption><p>Multiswap Front End </p></figcaption></figure>

## Quote Panel

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2Fo8PYNBshxb9RZJ5HDXJm%2FScreenshot%202023-08-05%20at%2016.27.27.png?alt=media&amp;token=e9c71cb3-d441-4523-bb8d-05131a4353c1" alt="" width="184"><figcaption><p>Quote Panel</p></figcaption></figure>

The Quote panel is a familiar "shopping cart" panel on the right-hand side of the screen, displaying all the selected tokens for buying or selling. It allows users to manage multiple tokens in one place with ease.

Once the selection is made, users can confirm the transaction with a single click, streamlining the multi-tokens trading process and making it faster and more efficient. With Multiswap, users can quickly execute novel trading mechanisms with a familiar interface.

> Note: when **selling**, users need to input the **number of tokens** they want to sell, while when **buying**, users need to input the **allocation in percentage**.


# Setting Approvals

In this guide, we will walk you through the process of setting token approval for trading on the Multiswap platform.

#### **Step 1: Select the Token(s)**

To begin your trade on Multiswap, select the token(s) you wish to sell. &#x20;

#### **Step 2: Enter the Number of Tokens You Want to Sell**

Enter the number of tokens you wish to sell in the designated field. Double-check the entered amount to avoid any potential errors or discrepancies.

#### **Step 3: Approve and Give Permission for the Multiswap Contract**

With your token(s) and the quantity selected, you'll notice an "Approve" button in the quote panel at the platform's top right corner. By clicking this button, you will be prompted to approve and grant permission for the Multiswap contract to access your selected token(s).

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2FSHtnzSJUSn8xQbHt78oQ%2FUntitled%20(1).jpg?alt=media&amp;token=57bcd17f-233f-4b0b-a5d9-2499f8d77e04" alt="" width="375"><figcaption></figcaption></figure>

At this point, you have two options:

a) Approve Just Enough: This option allows you to approve only the specific amount of tokens needed for the current trade. This can provide an added layer of control over your assets, ensuring that only the needed amount is granted access.

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2FRMI9OAGnQINnC7dE7J0t%2Fcap%20spending.jpg?alt=media&amp;token=6813d9de-6d1c-446f-ae01-905a94b97965" alt="" width="563"><figcaption></figcaption></figure>

b) Approve Default Amount: Alternatively, you can approve the default amount. This is equivalent to the number of tokens in your wallet at the time. This option can save you time and effort, particularly if you plan on making multiple trades in the future.

<figure><img src="https://3444489299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMPC8VyOwEYMS3andgvMd%2Fuploads%2FpTiMJmDG98YY3gopbph6%2FMax%20spending.jpg?alt=media&amp;token=77ec5966-7d1f-47dc-a592-62e37a2a737b" alt="" width="563"><figcaption></figcaption></figure>

Congratulations! You've successfully completed the token approval process for Multiswap.


# Multiswap FAQ

### **General**

1. **What is Multiswap?** \
   Multiswap is an AMM that adheres to all three principles of a good AMM: balanced, rebalanced, and self-financing. In addition, it aims to provide a fair and efficient trading environment for traders and liquidity providers by ensuring a stable trading environment and maximizing the benefits for both parties.
2. **How can I access Multiswap?** \
   Multiswap can be accessed through the web3 browser extension like MetaMask or WalletConnect-enabled wallets on desktop and mobile devices. In addition, users can visit the Multiswap website to connect their wallets and start trading and providing liquidity.
3. **How does Multiswap differ from other popular AMMs like Uniswap and Curve?**\
   Unlike Uniswap and Curve, which fall short of fully adhering to the three principles of a good AMM, Multiswap follows all three principles. This allows liquidity providers to be profitable on liquidity provision and traders to access the whole liquidity for the token, unlike other AMMs.
4. **How can liquidity providers benefit from using Multiswap?** \
   Liquidity providers on Multiswap can benefit from a balanced, rebalanced, and self-financing AMM that allows them to be profitable on liquidity provision. In addition, this ensures fair compensation for their contributions compared to other AMMs.
5. **How does Multiswap provide a better trading environment for traders?** \
   Multiswap allows traders to have access to the whole liquidity of the token, which results in better price execution and lower slippage compared to other AMMs.
6. **How flexible is Multiswap?** \
   Multiswap is highly flexible and designed with the idea that "Everything is a multiswap." This means the platform can accommodate various types of swaps, from single-token to multi-tokens in one transaction. As well as trades between regular tokens and LP tokens. Additionally, you can provide liquidity using single or multiple assets and even move liquidity between pools. This flexibility enables users to optimize their trading strategies and manage their assets efficiently within a user-friendly platform.
7. **Is there any risk in using Multiswap?** \
   As with any decentralized exchange, there is a risk of smart contract vulnerabilities, impermanent loss, or transaction errors. Users should always exercise caution and do their own research before trading or providing liquidity on Multiswap. It is recommended that users only invest what they can afford to lose and use best practices like setting slippage limits and double-checking transaction details before executing trades.
8. **Is Multiswap decentralized?** \
   Yes, Multiswap is a decentralized exchange (DEX), meaning it is non-custodial and operates on a blockchain network. This ensures that users have full control over their assets and that trades are executed in a trustless and transparent.

### Liquidity Provision&#x20;

1. **How to provide liquidity on Multiswap?** \
   Providing liquidity on Multiswap is simple and flexible. You can choose to supply liquidity using a single token or multiple tokens. Then, trade your selected token(s) for the corresponding pool token(s) to become a liquidity provider and earn fees from trades within the pool.
2. **Can I provide liquidity with one token on Multiswap?** \
   Yes, Multiswap allows you to provide liquidity using just a single token. You can trade your chosen token for the corresponding pool token(s) to contribute liquidity to the pool and earn fees from trades.
3. **How do I withdraw liquidity from Multiswap?** \
   Users can withdraw their liquidity by simply swapping the LP token(s) they hold for another desired token (s). It’s that simple.
4. **How can I move my liquidity from one pool to another on Multiswap?** \
   Moving liquidity on Multiswap is as easy as doing multiswap itself. Users can swap one LP token for another LP token, and now liquidity is moved to the new pool.
5. **What is the fee structure on Multiswap?** \
   Multiswap charges fees based on token(s) that have been traded. This differs from what generally charges for other DEXs, which charge fees based on the pool.

### Trade

1. **Can I trade multiple tokens simultaneously on Multiswap?** \
   Yes, Multiswap allows you to trade multiple tokens simultaneously in a single transaction. This feature streamlines the trading process, making it more efficient and user-friendly.
2. **Can I trade pool token(s) and regular token(s) in the same transaction?** \
   Yes, every token can be swapped in and out without hassle on Multiswap. This includes pool token(s) and regular token(s)
3. **Can I trade regular token(s) to multiple pool tokens in a single transaction?** \
   Yes, users can trade regular token to pool tokens with a single transaction.&#x20;

### Miscellaneous&#x20;

1. **What is loss versus rebalancing?** \
   Loss versus rebalancing is a metric used to evaluate the performance of LP in an AMM. It compares the potential returns from holding assets in a pool against the returns from periodically rebalancing the assets outside the pool. This metric helps LPs determine if providing liquidity to a specific pool is profitable compared to other investment strategies.


# Multiswap Glossary

* **Allocation**: The distribution of tokens in an output, represented as a percentage of each token involved in the transaction.
* **Asset Fee:** A fee charged for using the liquidity of a specific asset, with collected fees being paid to liquidity providers as an incentive.
* **Asset Token:** A token owned by users that represents their holdings.
* **Basis Point**: A unit representing price movements, where one basis point equals 0.01%
* **Fees Paid:** The total fees traders pay liquidity providers for using their provided liquidity.
* **Impermanent Loss (IL)**: A temporary loss experienced by LPs when providing liquidity to a pool in AMMs, occurring when the price of tokens in the pool changes compared to their initial deposit price.
* **Loss Versus Rebalancing (LVR)**: A performance metric that compares the potential returns of holding assets in a pool against returns from periodically rebalancing the assets outside the pool, helping LPs evaluate their investments in an AMM.
* **Minimum Received:** The lowest amount a trader can expect to receive after a trade is executed, accounting for price impact and fees.
* **Pool (LP) Token:** A token representing a liquidity provider's share of the liquidity in a pool
* **Pool Weight:** The proportion of each token in the pool, expressed as a percentage, indicating its relative importance within the pool.
* **Post-Trade Price**: Price that has been calculated **with** consideration for the trade that will be executed
* **Pre-Trade Price**: Price that has been calculated **without** consideration for the trade that will be executed
* **Price Impact:** Also known as slippage, this refers to an asset's price change resulting from a trade execution, which can affect the final received amount.
* **Reserve**: The total liquidity reserves held in the AMM for each token, used to facilitate trades
* **Total Sell Value**: Total value of assets sold to the AMM.
* **Token List**: List of tokens available on Multiswap.
* **Value (After Fees):** The calculated value of a token after accounting for fees, representing the net value received by the trader.
* **Value (Before Fees):** The calculated value of a token before accounting for any associated fees.


# Links

This is the hub for all official links related to Multiswap

Website: [https://caval.re](https://caval.re/)

Blog: <https://caval.re/blog>

Twitter: <https://twitter.com/TheCavalRe>

Discord: <https://discord.com/invite/VA6MhZ8cVb>


# Audits

Multiswap contracts have been heavily audited, below are the audit results:

{% file src="/files/g0aYkXr18jCVNNb4w2hY" %} <mark style="background-color:green;">**Audit Completed by Ivan Kuznetsov**</mark>
{% endfile %}

{% file src="/files/26WtfX2NLB0bjdlQ1C3e" %} <mark style="background-color:green;">**Audit Completed by DEDAUB**</mark>
{% endfile %}


# Contracts

List of all contracts for Multiswap

Pool contract: 0x5f1e8eD8468232Bab71EDa9F4598bDa3161F48eA<br>


