# Hello!

MuesliSwap

[MuesliSwap](https://muesliswap.com/) is the first decentralized exchange on Cardano, providing the Cardano community with a smart contract-powered trading platform since November 2021.

## What is a decentralized exchange?

Muesliswap is a decentralized exchange that allows you to trade crypto assets (tokens, NFTs) on the blockchain. It is similar to a stock exchange, where assets are traded between participants. Yet there is a key difference: Anyone, not just market makers, can provide liquidity in the form of liquidity pools! Moreover, the project is completly decentralised. This means that we are only developing a decentalized protocol but are not involved in any of the trading aspects.&#x20;

## How can I trade tokens on Muesliswap?

The good news is that trading tokens is really easy! Still, there is some initial setup that you will need to do. First, you will need a crypto wallet that supports dApps. Check out [Cardano Wallets](https://docs.muesliswap.com/cardano/cardano-wallets) for details on the setup. Second of course, you will need to have some crypto in this wallet, otherwise there wouldn't be anything to trade, right?

Ready to start? Check out our getting started guide here:&#x20;

{% content-ref url="/pages/-MjoO5DBMAvQpShBF54u" %}
[Introduction](https://docs.muesliswap.com/cardano/introduction)
{% endcontent-ref %}


# Introduction

MuesliSwap is a decentralized exchange (DEX) on the Cardano blockchain that enables you to trade Cardano native tokens.

Backed by a newly developed token swapping protocol, MuesliSwap aims to become the go-to DEX on Cardano. MuesliSwap uses a hybrid trading model with an on-chain order book connected to liquidity pools, providing crypto traders with features like limit orders. In this model, there is no central order matching authority. Instead, order matching is incentivized and can be performed by anyone, subject to rules fixed in a smart contract.


# Cardano Wallets

## 1. Installing a wallet

In order to trade on MuesliSwap, you will need a Cardano wallet that supports dApps. \
All light wallets which follow the [CIP-30 specification](https://cips.cardano.org/cips/cip30/) should work out of the box.\
The following light wallets are officially supported:

1. [Nami](https://namiwallet.io/)
2. [Eternl Wallet](https://eternl.io/app/mainnet/welcome)
3. [Flint Wallet](https://flint-wallet.com/)
4. [GeroWallet](https://gerowallet.io/)
5. [Eternl Wallet](https://chrome.google.com/webstore/detail/ccvaultio/kmhcihpebfmpgmihbkipmjlmmioameka)

Note that you will need to use the browser plug-in version of the wallet. Also note that hardware wallets (Trezor, Ledger) are not supported yet.

You can also use the Eternl mobile app to interact with a dApp on your mobile device. There are multiple other mobile wallets out there, and alternatively you can also use mobile browsers like [Kiwi browser](https://kiwibrowser.com/) or [Yandex browser](https://play.google.com/store/apps/details?id=com.yandex.browser), which allow the installation of chrome extensions like wallets on mobile devices.

## 2. Connecting your wallet

After installing one of the wallets, your wallet needs to be connected to MuesliSwap.

1. Press the "Connect Wallet" button in the top-right of the website (see *Fig.1)*
2. Select one of your installed wallets (see *Fig.2*)

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FSddYkRildDOo4zV5zmxc%2FScreen%20Shot%202022-10-05%20at%2018.49.28.png?alt=media\&token=8585de59-91b8-4ee6-8108-c24e48917f84)

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FqlgmgrdBifSOxcyiRsLm%2Fimage.png?alt=media\&token=8bfddc49-184a-47fa-bfad-c61acd31f9b4)

Now you are ready to place buy and sell orders. Congratulations!

**Note:** In order to connect with Eternl, you need to activate one wallet as a dApp Account (starting from version 1.4.1)

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FFwnzek3h2CTVGGnyP0w8%2Fimage.png?alt=media\&token=89e7b3e2-5dbb-4ebd-bdf9-523f7a0c3639)

## 3. Adding collateral

To interact with smart contracts on Cardano, you need to set a "collateral" amount.\
This collateral will remain in your wallet, but might no longer be displayed as spendable.\
Some wallets support collateral by default (e.g. Nami and Gero), while for others we added this functionality to our page (e.g. Eternl).

You can always get your collateral back! It's not locked there forever.

### Nami

1. Click your user icon, to show your wallet settings
2. Click on "Collateral"
3. Enter your password, the collateral will be deducted from your wallet

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FFHU3Qn29yvBP3uOJ7VDa%2Fimage.png?alt=media\&token=1a7eda1a-29d6-4710-b1da-9340131694fc)![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2F3lBDlxE1Jpy4TlqCeYT3%2Fimage.png?alt=media\&token=da1a669b-4c03-4e14-9cb5-6b6958a712e1)

### Gero

1. Click on "Account"
2. Click on "Collateral"
3. Click on "Deposit Collateral"
4. Enter your password

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2F6ASdPeEi0wcGfLjLiTPx%2Fimage.png?alt=media\&token=51007e2d-0611-4c8c-82ab-d9730484c4e9)![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FASNfXTyuXv4pdWxk0hIF%2Fimage.png?alt=media\&token=2e152bed-2f42-4127-91c0-af6a3cd98475)

### Eternl

CCVault supports Collateral starting from v1.4.1 directly within the wallet. To set collateral please go to CCVault. In CCVault select your wallet and go to the wallet specific settings. In the settings menu please enable the option collateral and set collateral if needed.

1. Select your dApp Account
2. Select the tab "Settings"
3. There you will find the option "Collateral". Enable it.
4. Press "Set Collateral" in case that no collateral is displayed.

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2F4xenFOvf8jsKiO0ACNOz%2Fimage.png?alt=media\&token=c16a7dda-3c8c-4eb2-9678-fc9d62d25cf7)

Older versions of CCVault don’t have the notion of Collateral, instead the interacting website has to make sure that the wallet is smart contract ready.\
We will ask you to press a button on the ["My Orders" page](https://legacy.muesliswap.com/orders) in case your wallet is not already smart-contract-ready.

## 4. Full Disconnect

In case you ever want to revoke the wallet access rights of the site, you can disconnect by following one of the guides for your wallet below or alternatively fully uninstall the wallet extension.

### Nami

1. Open Nami & click on your profile picture in the top-right corner
2. Click on "Settings"
3. Go to "Whitelisted sites"
4. Click the small cross to the right of "ada.muesliswap.com"

![Step 1 & 2](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FGyXCwYtOiMg9uCFQXW1v%2Fimage.png?alt=media\&token=7362392d-afba-492c-8ba7-6915bcf0d038) ![Step 3](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FJpHzgaFO1M6WSapdA2M0%2Fimage.png?alt=media\&token=e0e49e8e-2fe1-44e3-b00c-09109530f173) ![Step 4](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FeilO8Q61hGtQEMf6B1ub%2Fimage.png?alt=media\&token=80a19793-fad2-4500-a0f1-d052405399e9)

### Gero

1. Go to [ada.muesliswap.com](https://ada.muesliswap.com) & open Gero wallet by clicking on its icon.
2. Click the small green circle in the top-right corner \
   (If it is not there press the green circle in the top-left corner first for it to appear)
3. Click "Disconnect"

![Step 2 & 3](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FqKxBXu8lwsBqAECXLUl3%2Fimage.png?alt=media\&token=3925e409-32a6-454d-8477-14a1feab1492)

### Eternl

1. Click on the ccVault icon
2. Click on "Settings" in the bottom-left of your window
3. Open the "Whitelisted dApp Sites" category
4. Click the red trash-can to the right of "<https://ada.muesliswap.com>"

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FK2LV1Z8RQoLv73Tkhzna%2Fimage.png?alt=media\&token=97841cf8-bec1-419a-8bab-2a63aafbaabb)

## 5. FAQ

**Question:** I bought tokens with my Nami Wallet, but I received collectibles?\
**Answer:** Nami wallet has a display bug, where tokens could be displayed as collectibles. By hovering over the collectible, you will see the amount of token you received. You can double check on [pool.pm](https://pool.pm/) or by using another wallet that you have indeed received the correct amount of tokens.

**Question:** I am trying to place orders with my Hardware Wallet (i.e. Ledger) but the order fails!\
**Answer:** Hardware wallets like ledger do currently not support interactions with Smart Contracts. Please consider creating a Software Wallet, to which you can send small amounts for trading.

**Question:** Is there any mobile wallet support?\
**Answer:** We are not aware of any mobile wallet with dApp support. Using browsers like [Kiwi browser](https://kiwibrowser.com/) or [Yandex browser](https://play.google.com/store/apps/details?id=com.yandex.browser), some wallet Chrome extensions like Nami can be used on mobile devices.


# Token Listing

Every Cardano Native Token can be traded on the MuesliSwap platform.

{% hint style="info" %}
Every Cardano token is uniquely identified by 2 values: *policy id* and *token name*.
{% endhint %}

Tokens listed on the MuesliSwap platform typically have one of the following tags:\
*Verified, Unverified, Scam, Outdated, Onhold*

We do not closely moderate unverified tokens, so we encourage users to do due diligence on tokens that are marked as *Unverified*.

Tokens marked as *Outdated* or *Scam* should be traded at your own risk! This means that the team has identified that the project has either migrated to a new token (*outdated*) or the project/token is a scam.

Trading will only be stopped for tokens marked as *Onhold*.

### Verifying validity of a token

Always DYOR and compare the policy ID of the token with the policy ID of the project's official homepage.

![The policy ID of a project shown on a projects official website.](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FR4aCiAdAUlSZMb9Y7dfl%2Fimage.png?alt=media\&token=d131c7d9-abe8-4e49-826b-e549846aa26c)

![The Policy ID of a token as displayed on Cardano Scan](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FtbD92CITo5fWrV7cBqea%2Fimage.png?alt=media\&token=3a06125a-465a-48a3-8ccb-29dd702b3372)

### Adding new tokens

Everyone can add a new token for trading on MuesliSwap, however any properly registered Cardano Native Asset should be tradeable within a day of registration.

Therefore the following is only relevant for token creators:

You will be needing the *policy ID* and the *name* of the token that you want to add. This information is usually displayed on a project's homepage. You should double check the information with Cardanoscan.

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2Fkpq0WWuGHcySoI1ylEXs%2Fimage.png?alt=media\&token=2303a523-0052-42a0-b84f-112a082ee9fc)

We recommend registering your token with the [Cardano Token Registry](https://github.com/cardano-foundation/cardano-token-registry). They have a written step-by-step [guide](https://developers.cardano.org/docs/native-tokens/token-registry/how-to-submit-an-entry-to-the-registry/) to follow along. This will list your token automatically on Muesliswap and will also ensure valid metadata (decimal places, icon, description, homepage, etc.) as provided by you.

In case you are a token creator but don't plan on listing your token in the Cardano Token Registry, you can also list your token via our website.\
We do *not* recommend this, as alternatively, the metadata of a token is used. The intention behind this is primarily to support NFTs, that usually store their metadata in the on-chain metadata after minting. This information is used by MuesliSwap to list NFTs.\
Therefore your token will likely only have a *policy ID* and *name*, and will be missing out on support for decimal places and all the other metadata introduced with the Cardano Token Registry.

In case this is fine for your token, here is how to proceed:

* Go to <https://muesliswap.com/add-token>
* Enter the policyId and tokenname in the corresponding fields
* Click List New Token, this will place a transaction, causing the token to be listed without requiering a CTR entry


# Creating a Pool

If you want to create a pool for your token, you can do so by following these steps. Note that currently, in order to protect users, you can only provide liquidity to pools with verified tokens. Please note the **minimum amount of ADA to send is 6 ADA.**

*Note: This is an intermediate mechanism for early adopters. We are working on a smooth frontend utility for this.*

For pool creation you need to submit the following

* The tokens that you want to provide as liquidity
* The ADA equivalent of the token
* 4 ADA (of which all but the fees will be returned)

Submit tokens + ADA equivalent + 4 ADA to this address:&#x20;

<sub>`addr1vxed8f0jlnntvtqcy42xn9c4tpcc8w6xrfh9unj7pyxse5c6g4gj8`</sub>

Please check that the mentioned addresses previous transactions are pool creation.


# Orderbook

In this guide, you will learn how to get started trading Cardano tokens via the Orderbook feature on MuesliSwap. If you'd like to get a better understanding of the technology behind the MuesliSwap order book, we recommend reading [this blog post](https://medium.com/@muesliswap/muesliswap-presents-the-protocol-powering-cardanos-first-dex-3db25a844245). If you want to even better understand the rationale behind these mechanisms, please refer to our [white paper](https://ada.muesliswap.com/whitepaper.pdf).

If you want to play around with the DEX without spending any ADA, check out [the development version of the DEX](broken://pages/et7yCr3sS9O5fw8eS071) that is publicly accessible and running on testnet.

📘 New to Cardano? Make sure you're well informed before using dApps! You can learn more about the Cardano blockchain and the main ideas behind it on its official website: [https://cardano.org](https://cardano.org/)

### Installing a Cardano wallet

In order to trade on MuesliSwap, you will need a Cardano wallet that supports dApps.\
Check out our [Wallets](https://docs.muesliswap.com/cardano/cardano-wallets) guide on [How to install](#installing-a-cardano-wallet) and [How to connect](#installing-a-cardano-wallet) a wallet.

💡 A wallet is simply an application that holds your funds. When you create a new account, your wallet will assign you a Cardano address (similar to bank account number), and a secret key that you can use to access your funds. Needless to say, keep your key hidden in a safe place!

💸 To use the Cardano blockchain, you will need the ADA cryptocurrency. To fund your wallet, you can simply send ADA from any of the reputable centralized exchanges to your new address that you've just created. See for example: [Kraken](https://www.kraken.com/learn/buy-cardano-ada), [Coinbase](https://www.coinbase.com/how-to-buy/cardano), [Binance](https://www.binance.com/en/buy-cardano)

You can only cancel or edit orders if you have set a collateral, so make sure you check out our [guide](https://docs.muesliswap.com/pages/sOFRZyG2yYpxLqjiON3Y#3.-adding-collateral) on how to do that. \
As the procedure is a bit different for each wallet please check the wallet specific descriptions: [Nami](https://docs.muesliswap.com/cardano/cardano-wallets#nami), [Gero](https://docs.muesliswap.com/cardano/cardano-wallets#gero), [Eternl](https://docs.muesliswap.com/cardano/cardano-wallets#ccvault)

### Placing a trade

It is very easy to trade tokens on MuesliSwap! First, head to the trading interface at <https://muesliswap.com> and find the token you wish to buy or sell under Markets. Clicking on the token entry will open the trading interface, where you can place buy/sell orders and see token information, price data and open orders.

After entering your desired token amounts, you can click the "Swap Instantly" button to trade. As soon as your trade is submitted to the blockchain and fulfilled by a matchmaker, you will receive your assets in your wallet. To learn more about how this works, see [Concepts](https://docs.muesliswap.com/cardano/introduction#more-details).

Placing a trade incurs a small fee to cover costs for both the matchmakers and the frontend providers. You can save fees by buying [MILK](broken://pages/zWyBGYndKUAKhbkYrvSL). More details on the fees can be found in the [Fee Structure page](broken://pages/Sw3yfe8vMpmExL8NzENO).

As soon as your order has been registered on the blockchain, it will appear on the [Open Order ](https://muesliswap.com/wallet/orders)page. You can also inspect your order history on the [Order History](https://muesliswap.com/wallet/orders-history) page!

### Cancelling a trade

You can see a list of your outstanding orders under the "My orders" tab in the menu. These orders can be cancelled at any time, simply by opening the order detail and clicking on "Cancel". The input assets will be refunded to you immediately. In case your order has been partially filled, you will receive remaining assets of the open order and all assets that have been filled already.

To cancel, your wallet has to be made smart contract ready. Please refer to the [wallets page](https://docs.muesliswap.com/cardano/cardano-wallets) for more information on how to check and set your collateral.

**Tip:** Sometimes cancellation fails even when the collateral has been set. In most cases, it helps to reload the browser window and to reset the collateral. Please also make sure that the correct wallet is connected. If that doesn't help reach out to us for help by Telegram, Twitter, Discord or email.

### Retrieving ordered tokens

The tokens you ordered are delivered directly to your wallet upon being fully matched. There is nothing you need to do in order to retrieve them! In case you want to retreive a part of your order before it has been fully matched, you need to cancel the order or change its limit. You can see whether your order has been matched in the MuesliSwap Order History and in your Wallet history.

### Frequently asked questions

**Question:** How does your DEX work? Is there a high level description?

**Answer:** We created an exhaustive blog post to the trading concepts of MuesliSwap on Medium, check it out here: <https://medium.com/@muesliswap/muesliswap-presents-the-protocol-powering-cardanos-first-dex-3db25a844245>\
More details can be found in our white paper outlining the MuesliSwap Cardano DEX: <https://legacy.muesliswap.com/whitepaper.pdf>

**Question:** Why doesn't my order get matched?

**Answer:** First of all, note that MuesliSwap is an orderbook-based exchange, meaning unlike with liquity pool based exchanges, orders are pending *until a accordingly priced matching order is found*. This means if you choose your buy price to high compared to what sell prices are currently available on the market, your order will not find a match. A second point is that in the current version of our protocol, *the result of partial matches stays in the contract.* That means you have to check the list of open orders to see the current state of your order.

**Question:** What happens to my ADA / tokens when I place a trade?

**Answer:** Being a decentralized exchange, MuesliSwap does not hold any assets. Instead, these are stored on the blockchain and protected by a validator script. The assets may only be unlocked if certain conditions are met. These are: a) the trade succeeds, and you get the ordered value, or b) the order is canceled by you.

**Question:** I can not cancel my order! What is happening?

**Answer:** There can be several reasons an order can not be canceled. First, make sure that your wallet is smart contract ready . Also, it may be necessary to try several time before the order works. Or, the order has been matched already, in which case you should see the received funds in your wallet.  If you have already put a collateral and canceling did still not work, try removing it and setting it again. If it did not work after some attempts, please reach out to us.

**Question:** I bought tokens with my Nami Wallet, but I received collectibles?

**Answer:** Nami wallet has a display bug, where tokens could be displayed as collectibles. By hovering over the collectible, you will see the amount of token you received. You can double check on [pool.pm](https://pool.pm/) or by using another wallet that you have indeed received the correct amount of tokens.

**Question:** What fees are being paid to use the service?

**Answer:** The main amount of funds sent to the contract is the amount of token you want to sell or the amount of ADA which you are willing to spend on tokens. This is accompanied by 1.5 ADA, which is the minimum amount of ADA in any transaction on the Cardano network. An additional 0.6 ADA are sent to reward matchmakers for matching your order and to cover Cardano network fees. There is also a small frontend fee for server maintainance and development cost, explained in more detail on the [Fee Structure page](broken://pages/Sw3yfe8vMpmExL8NzENO).&#x20;

**Question:** Can MuesliSwap access my wallet?

**Answer:** No. When you place an order, this is done entirely in your browser and has to be signed by your wallet. We do not receive any data. Note: never share your private keys with anyone!

**Question:** Are there any risks involved in trading ADA/tokens?

**Answer:** As always, investing comes with certain risks. When you buy an asset, is value may increase or decrease over time, which may result in gains or losses. As a rule, never invest more than you are willing to lose.


# Network Load

The load of the Cardano network can have consequences on your trading experience.

This means that during heavy network load placing, modifying, matching and cancelling orders may take longer than usual.  If you are faced with error code 2 please retry after a few minutes. Most likely a previous transaction is still being processed.

**Note:** It may happen that after placing a transaction nothing happens. This is due to the network load - it might take some time before the transaction appears and gets processed. This also depends on the wallet used.

**Tips for trading under high load**

Under high load, submitting a transaction to the cardano network might takes several minutes or even fail completely. Below are some suggestions to cope with the situation

1. **Use your own node**, where your wallet permits it. Each wallet uses its own cardano node to submit transactions to the network. Under high load, these nodes can become slow and overloaded. Set up your own node and configure your wallet to use your own node to circumvent the problem (i.e. Nami offers this functionality)
2. **Place orders slightly below/above market price.** This incentivizes other users to place matching orders. Even for existing matches, matchmakers prefer orders with a small margin!
3. Use the **limit change rather than the cancel button** when changing an open order. This way, you will only have to wait for one transaction to be submitted to the cardano network, rather than two.
4. **Split your tokens among several UTxOs**. Each order placement consumes one or more utxos and creates new ones in your wallet. If you have your tokens split among several small UTxOs, you can submit a new order using unused UTxOs rather than waiting for the new UTxO of a preceding order to be created.


# Swaps (AMMs and LPs)

Next to its orderbook trading features, MuesliSwap also has functionality to trade against liquidity pools. These liquidity pools have the benefit of high liquidity, which is supplied by users in a decentralized manner.&#x20;

Read on to learn how to place orders against liquidity pools using the MuesliSwap Swap feature.


# Instant Swap

Next to its orderbook trading features, MuesliSwap also has functionality to trade against liquidity pools. These liquidity pools have the benefit of high liquidity, which is supplied by users in a decentralized manner. There are different (and an increasing number of) DEXs that support trading via liquidity pools. Finding the best price is not always easy and may take a lot of time.

Over MuesliSwap you can always get the best price, from whichever DEX on the Cardano blockchain. In Instant swap, we find the cheapest prices on Cardano for you by aggregating all DEX protocols!

**How does it work?**

Simply head to our [markets page](https://muesliswap.com/markets), select the pair you want to swap, and our aggregator will take care of the rest! You can always see the protocol which currently offers the best price, as well as the estimated swap price and associated fees.

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2Fd9KOVX1cics1uGA7Fnlh%2FScreen%20Shot%202022-10-05%20at%2019.01.28.png?alt=media\&token=3c571d18-7ad6-4f2d-abaa-ef238821e4ea)

Note that this feature allows you to trade at the best price currently available. If you want to have a swap executed once a given price limit is reached, read on about Limit Swaps.


# Limit Swap

Using the MuesliSwap Limit Swap feature, you can place limit orders against liquidity pools. As soon as the price in the pool matches your specified limit, the order will be executed.

You don't need to hit enter at the right price anymore! Just add your limit swap order and relax.

**How does it work?**

1. Open the [trading page](https://muesliswap.com/swap) and select "Limit" in the top of the swap dialog.
2. Select the token pair you want to trade.
3. Insert the amount of token you want to sell, or receive.
4. You may now change the amount of token to receive or the price at which to swap by inserting your desired price/ received tokens.
5. Choose a pool to place the trade against. Your order will only be executed once this specific pool reaches the price you choose. Therefore, carefully consider which pool you want to trade with. You may want to take into account the Total Value Locked (lower = more price fluctuation, higher = less price impact), the current market price, fees etc.
6. Hit "Place Limit Order". This will open your wallet to construct a transaction as requested by you!

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2F3CAMtOgkGDSb7pLWB8KD%2FScreen%20Shot%202022-10-05%20at%2019.15.38.png?alt=media\&token=36627f97-1ae3-44c3-be76-8f1c89f4c8ed)


# Liquidity pools 101

We are happy to announce that liquidity pools are now a part of MuesliSwap's Hybrid DEX. This page aims to explain the concept of liquidity pools from user's perspective in simple terms. Please note this is not investment advice.

{% hint style="info" %}
We recommend that liquidity providers familiarize themselves with the following concepts before interacting with liquidity pools.
{% endhint %}

Let's say Alice wants to buy 1 ADA for BTC at the current (market) price. In a traditional market, there needs to be a second trader, Bob, who is willing to sell this 1 ADA to Alice. This allows Alice and Bob to "meet in the middle" and find a fair price for 1 ADA. *This is the orderbook model.*

However, it could happen that at the moment there is no one selling their ADA and thus Alice can't trade it either. This problem can be solved by introducing a *liquidity provider*. The liquidity provider owns a certain amount of ADA and BTC available for trading. He or she then uses it to act as a counterparty to Alice's trade. The liquidity provider charges a slightly higher price for buying ADA than for selling it, earning a small profit on every transaction.

#### Liquidity pools enable trading on blockchain

In off-chain finance, the role of liquidity provider is traditionally fulfilled by financial institutions. **Liquidity pools** (LPs) are a way to democratize this role on the blockchain. In principle, a liquidity pool is a smart contract that holds tokens A and B. Without going into technical details, for this model to work, the liquidity pool is programmed to follow a simple rule: the ratio of token A to token B in the pool determines the price of A/B. Anyone can provide their tokens ("liquidity") to the pool in the current ratio. A liquidity provider then owns a **share of the pool**.

Alice can now trade ADA/BTC against the liquidity pool - e.g. by depositing x BTC, the smart contract lets her withdraw the equivalent value from the pool, y ADA. Because the ADA/BTC ratio in the pool has changed, this also changes the pool price offered to the next trader.

#### Providing liquidity may lead to profits or losses

The smart contract also charges a small percentage of each trade as a **transaction fee**, adding the fee amount to the total pool amount. The total amount of tokens locked in the liquidity pool will therefore slightly increase, resulting in a profit for liquidity providers. *The higher the trading volume, the more liquidity providers earn on transaction fees.*

When a provider decides to **withdraw** their liquidity, they will get back their share of the pool (tokens A and B). If transaction fees have added more tokens into the pool, the provider will have made a profit. However, if the price of A/B has changed, the provider will have made a loss compared to the situation if they had kept the tokens A and B in their wallet the whole time. The more the price changes in either direction, the less resulting total value the provider gets back. The *bigger the price change in any direction, the more liquidity providers lose on this so-called "divergence loss", or "impermanent" loss.*

*You can learn more about the risks of divergence loss in this article:* \
[*https://pintail.medium.com/uniswap-a-good-deal-for-liquidity-providers-104c0b6816f2*](https://pintail.medium.com/uniswap-a-good-deal-for-liquidity-providers-104c0b6816f2)

#### The math of providing liquidity

The main concept of providing liquidity is that transaction fee gains should outweigh divergence losses. For volatile token pairs, it might make more sense to add liquidity into a pool with a higher transaction fee to make a profit, whereas for stable token pairs, it might make sense to choose a liquidity pool with a lower fee, where the transaction volume is higher.

Before providing liquidity, it is useful to estimate both potential gains based on the pool's volume, and potential losses based on the tokens' volatility. The resulting profit or loss is then a sum of these two percentages. For the latter, one can use an online tool such as: <https://dailydefi.org/tools/impermanent-loss-calculator/>

&#x20;**Liquidity Pools on MuesliSwap**

For security reasons, the creation of liquidity pools is currently permissioned. If you want to create a new liquidity pool for your token, please feel free to reach out to us.&#x20;

A list of all available liquidity pools can be found at: \
<https://muesliswap.com/earn/liquidity>

<figure><img src="https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FxtKDGA16eSlqdLTS7jmg%2FScreen%20Shot%202022-10-05%20at%2019.24.04.png?alt=media&amp;token=fbed57c1-8bbb-4e5c-bbb5-41db503ca972" alt=""><figcaption></figcaption></figure>

&#x20;**Add Liquidity**

To add liquidity for a token pair, press the "Add Liquidity" button for the relevant liquidity pool.

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FoIAxrwsyOJQUlBOaNH46%2FScreen%20Shot%202022-10-05%20at%2019.25.42.png?alt=media\&token=6684a7cc-453c-4771-8f29-69b59d9b8c97)

1. Click "+ Add Liquidity"
2. Select the amount of one of the tokens you want to provide
3. The amount of the other token is automatically determined by the current price in the liquidity pool.
4. Click "Add Liquidity" and confirm your inputs.

Your share in the liquidity pool is represented through liquidity pool tokens (LP tokens). When adding liquidity, you will receive your liquidity pool tokens back in a separate transaction in a few seconds to minutes. You can track your open transactions in "Open orders".<br>

**Your Liquidity Positions**

After connecting your wallet, you can see your open liquidity positions by clicking the "My Earnings" button. On this overview page you also have the option to remove the liquidity that you have previously added.&#x20;

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FORqrosWdkAiGVE2hlMsA%2FScreen%20Shot%202022-10-05%20at%2019.28.46.png?alt=media\&token=0e7bc3de-f2f6-4ba3-9db2-16263ce88cb2)

**Remove Liquidity**&#x20;

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2F2eVqeCXOwFLcwYdnxYns%2FScreen%20Shot%202022-10-05%20at%2019.31.50.png?alt=media\&token=8950fad6-d039-47e8-8591-cbf89b3779ab)

When removing liquidity, you can select what part of the provided liquidity to remove from the pool. When clicking the "Remove Liquidity" button, you will receive your tokens back in a separate transaction. You can track your open transactions in "Open orders".


# Social media & Contact

How to contact the MuesliSwap Team

For any inquiries, please send us an DM on Twitter [@MuesliSwapTeam](https://twitter.com/MuesliSwapTeam) or open a Discord ticket <https://discord.gg/VG7fWHvHSM>

**Beware of fake support groups on Telegram!** These are the official ones:

* Telegram Group: <https://t.me/muesliswapADA>
* Telegram Team: @muesliswap\_ADA

Don't respond to DMs from unknown Telegram accounts! These are almost always scammers. We will never DM you first. We will never ask for your private keys. We will never send you links to install a wallet. Use only official links from Cardano project websites!

You can also join our official Telegram group using this QR code:

![](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2F0L8GOFLH2M5vkijVIFCi%2Fmuesli-telegram-qr-lowres.png?alt=media\&token=3d1b4f1e-fd2a-41e4-9320-4d702ecb71c0)


# API

MuesliSwap provides a number of API endpoints for querying the state of the DEX. The following is an incomplete list of endpoints, subject to change. Token decimals have to be accounted for by the client, unless explicitely stated.

## General

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/token-list" method="get" expanded="true" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/list" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

## Price

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/price" method="get" expanded="true" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/trades" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/orderbook" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/charts/price" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

## Pools, etc

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/liquidity/pools" method="get" expanded="true" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/staking/myield-pools" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/staking/token-pools" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/staking/farming-pools" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

## Wallet Specific

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/orders/v2" method="get" expanded="true" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/staking/farming-open" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

{% openapi src="/files/LS6s5rjksznBVRHhrF5f" path="/open-positions" method="get" %}
[trimvis-api.muesliswap.com-1.0-resolved.yaml](https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FbAY7m1zmb0e1sBHlUNBy%2Ftrimvis-api.muesliswap.com-1.0-resolved.yaml?alt=media\&token=aa6018b4-e4dd-4382-a7cd-e6f931db7908)
{% endopenapi %}

### Terms of Use

For private use only. If you are interested in using this API commercially please contact us at <contact@muesliswap.com>. Moreover, we are applying a fair use policy to our API where we expect a reasonable number of requests.

## Community Tools

In this section, we simply highlight certain tools that have been built on top of our API and contract. We take no liability for the quality of these services and do encourage some caution before employing these tools.

### Google Sheets

Twitter user @cardanostra wrote a small thread on importing live price feed data into Google Sheets: <https://twitter.com/cardanostra/status/1488522351985799173>

### Coin Overview

Cardanians built a pretty overview on all currently available tokens on the network, including data on the prices and volume powered by the MuesliSwap API: <https://cardanoassets.com/>

### Last Trades

This website shows the most recent trades for featured tokens on the MuesliSwap page: <https://yummymuesli.com/>


# Swap Integration

Swap component for integration on any website

We created a component, which is easy to integrate & customize, for use with any website. This allows developers to directly allow swapping of either a selected token or all tokens directly on their site.

### Tutorial

1. Visit [muesliswap.com/creator/embedded-swap](https://muesliswap.com/creator/embedded-swap)
2. Configure to your liking on the right or bottom of the page
3. Copy the generated code (placed below the configuration) into your clipboard
4. And paste it at the corresponding location in your html file
5. You are done! 🥳

<figure><img src="https://2598377122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjoGoMS0wqMF7Accm3h%2Fuploads%2FHXM3e1rwXZQ5JLX5BC9u%2Fimage.png?alt=media&amp;token=a0602a74-5dc9-4145-bcad-3a3125302fa1" alt=""><figcaption><p>The embed swap creator page</p></figcaption></figure>

### Configuration

* *Select Base Token / Select Quote Token:* Change the tokens which will be selected after load. Be careful: prices will be quoted in the base token and not in the quote token.
* *Auto Connect to Last Wallet:* Automatically reconnect to the last wallet connector used inside the iframe. This option is not intended to be used in combination with selective auto connecting.
* *Theme:* Let either the website determine the theme (*Detect*) through the system preferences or force the usage of a certain theme (*Dark / Light*). In the future more options will be added here.
* *Hide Background:* Makes the background of the iframe see-through to make it easier to cleanly integrate
* *Tight Layout:* If enabled this option will remove all surrounding paddings and margins of the iframe. This e.g. can be used to stretch the swap modal to the borders of the iframe.
* *Use Recommended Size:* This will set the recommended minimum width and height. We do not recommend going below these defaults.
* *Height / Width:* Make sure to hardcode your width and size here, these arguments will be processed internally. Therefore you should not change the iframe width and height manually!

### Advanced Configuration

You can automatically connect to any (injected) wallet of your choosing by passing the key to a CIP-30 compliant object in `window.cardano` as the first argument. See the explanatory text in the second script element for more details. This should not be used in combination with the *Auto Connect to Last Wallet* option.

To integrate in any framework, please look into how to import and use external javascript files in your framework. Please refrain from downloading and storing the `embed.js` file locally, in case we ever update or change the internally used interface.


