MuesliSwap is a DEX on the Cardano blockchain, which allows you to trade tokens, with a decentralized order book model, unlike most DEXes, which employ the MMA model.
In the first part of this article I explained DEX models in detail. Now I will tell you about the MuesliSwap model.
How Does Muesliswap Work?
The exchange model at the base of MuesliSwap is fundamentally different from DEXes on other chains, such as Uniswap on Ethereum, and indeed replicates the traditional order book exchange in a new, decentralized way.
Traders place orders (buy or sell) using the web interface. By confirming the trade with a Cardano wallet, the order is locked in a smart contract on the blockchain like UTXO, and they are unlocked only for a trade that meets the trader’s demands (limit price, quantity). A pending order can be canceled at any time by its creator.
The protocol has three main players: the traders, the matchmakers and the front-end operators. The matchmaker and front-end operator are required to provide the necessary infrastructure for traders to transact.
The task of the front-end provider is to provide traders with the necessary infrastructure to send limit orders to the smart contract. Through an interface, the trader should be able to indicate his trading intention. This trading intent is then used to build a smart contract with which the trader can send their order to the blockchain. When a trader submits their order, they will pay a small fee to the front-end provider. This small fee can be seen as an incentive to provide a trading interface for the MuesliSwap protocol.
The task of the external matchmaker is to find matches between the supply and demand of the orders sent to the smart contract. The exact details of the match are described in the protocol specifications. For each successful match that the matchmaker sends to the blockchain, a reward is paid to it, which is the bid and ask price spread on the orders. This reward is payment for the matchmaker’s work in finding orders that can match.
In an ideal scenario, there will be multiple front-end providers and multiple independent matchmakers. No matter which interface the orders were submitted on, they will all be submitted to the same smart contract. That means matchmakers will be able to find all orders placed, regardless of the front-end providers used. This makes the MuesliSwap order book model a truly decentralized exchange model and helps solve the liquidity problem across all traders.
To prevent the matchmaker from becoming a central entity, the obvious remedy is to have multiple entities, where everyone can take on the role of matchmaker.
Two additional problems arise.
One problem is that since matchmakers charge the difference in bid and ask as a reward. So to maximize their individual profit they would be incentivized to seek the highest available bid with the lowest available bid, widening the spread, but unfortunately this would hurt traders.
Another issue is that from a matchmaker’s perspective, it makes sense to bundle multiple matches into a single transaction, to keep fees low. If each matchmaker tried to minimize fees, in order to put all of their matches into a single transaction, then overlaps between discovered matches would be very likely, and thus most batches of transactions would fail.
To solve these two additional problems, coordination is necessary, without relying on a shared state and no central entity.
If matchmakers are aware of the competitive game they are playing, and if they want to stand a chance of winning, then they must change the optimal matchmaking strategy.
If everyone is looking for the best price, and the largest possible batch of matches, then they lock each other out, and none of them are going to get a reward. Conversely, if they try orders with lower prices, or smaller lot sizes, the eUTxOs may have already been spent, and there is no second option.
If neither matchmaker is looking for the best price or largest lot size, they don’t get in each other’s way and suboptimal price eUTxOs still won’t be spent. That is the only way both matchmakers and traders win.
These observations led the development team to a conclusion, which is at the core of the MuesliSwap exchange model, and that is that the system regulates itself without the need for additional restrictions, because the incentives are set in such a way that, when the individual’s reward is greater, the total of the exchange also makes the greater progress. This occurs in a Decentralized Order Book model, where traders can freely submit their orders, and a group of matchmakers can freely start their matches.
Another problem can also arise, which occurs when the orders are of very different sizes. The solution is to split large orders into several smaller ones, ie the order appears as a set of eUTxOs that can be paired independently.
As rewards may be too small to be sent via the Cardano blockchain, traders must supply a sufficient amount of ADA to be included in the matchmaker reward, and returned to the trader during the transaction.
Below I copy the graphic from the publication: MuesliSwap presents: The protocol powering Cardano’s first DEX
Charles placing an order of his MILK by submitting it to the order book maintained by the MuesliSwap smart contract.
Alice and Bob joining the game by submitting competing orders. Which one might become matched with Charles’s?
It’s a match!
Verifying the Validity of a Token
Unverified tokens are not moderated, so users should do their due diligence on trading pages that are marked as “unverified”, and compare the policy ID of the linked token on Cardanoscan with the policy ID from the official project page.
Adding new tokens:
Everyone can add a new token for trading at MuesliSwap. To do so, follow these steps:
- Find the policy ID and the name of the token that you want to trade. This information is usually displayed on a project’s homepage. You should double check the information with Cardanoscan.
- Go to https://ada.muesliswap.com/markets/community
- Enter “<policyId>.<tokenname>” into the search bar
- The token trading page will now load after a few seconds and you can start placing orders
No fee is charged for all trades up to 120 ADA, so users can freely familiarize themselves with the platform before trading larger amounts. The holder of at least 100 MILK in his wallet will enjoy discounted rates.
Fees on Muesliswap Trades (for successful orders)
If you have 500 MILK in your wallet and place an order of 1000 ADA, you will pay the following fees, the Frontend Fee: 1 + 1000 * 0.02% = 1 + 0.2 = 1.2 ADA, and the Network Fee: 0.6 ADA.
In the event that the user cancels their order, both fees will be returned in full to the user’s wallet.
What Are MILK Pools and How Can You Delegate to Them?
MuesliSwap MILK Pools will allow MILK to be delegated in exchange for various (popular) trending tokens as a reward.
Unlike Yield Farming, you do not face the risk of an impermanent loss when MILK is delegated, because you only need to delegate a single asset (MILK) to start earning.
To start delegating you must lock your MILK tokens in one of the MILK pools. MILK tokens will be locked in a Cardano smart contract, and only you can unlock them. This is crucial as it turns the staking solution into a decentralized mechanism that ensures the security of all delegated funds.
As soon as the tokens are locked, you will start earning tokens. Once you unlock your MILK, you can claim the token rewards.
A beta version of MILK Staking is planned to be released in February.
If you participated in the initial sale and your tokens are still locked with kick.io, your tokens will still be eligible for staking, and will automatically be deposited into a special pool where you will earn tokens.
Rewards will be available to claim after MILK tokens are unlocked in April.
To trade MuesliSwap on Cardano, Nami, Gerowallet or CCVault.guide Wallets will help you on Cardano.
You can learn more details on How to trade.