Sections: Overview | Tutorial | Strategies
Tutorial
Now that you have a basic idea of what the Maiar Exchange is, let’s go through step by step how to use it.
You will see the menu bar on the top of the screen showing the three sections you will need, plus a Home tab and an Analytics tab. We will only need to use the middle three for this: Swap, Liquidity, and Farms.
Click on Swap.
You will see the swap app now in the center of your screen.
This will allow you to swap between any two assets within the liquidity pools hosted on the Maiar Exchange. For now this is $EGLD, $MEX, and a stablecoin $USDC. To make a swap you will select from the drop down menu for the on top, the token you wish to swap from, and on the bottom the token you wish to swap to. The fields next to each are where you will enter the amount you wish to swap. Entering a value in either one will autofill the other so no need to do any quick maths. Clicking the arrow in the middle will flip the selections around the other way.
You will notice that selecting a token on top limits what you can select on the bottom. $EGLD for example can swap with $MEX or $USDC but selecting $USDC on top only shows the option for $EGLD on the bottom. This is likewise the case for $MEX. If you go backwards and select $USDC on the bottom you will have all options revealed on the top, however clicking on any of them other than $EGLD will make the bottom menu blank. This is because you can only swap between two assets that have a liquidity pool. There is no pool for $MEX to $USDC (yet) and so the app will not let you set up that trade. This will hold true for whatever pools become available on the mainnet as the platform develops. There must be a liquidity pool before any swap can happen. This makes sense, right? and this is why you may have to end up swapping two or three times in the future in order to connect two distant ESDT tokens.
Below this we have some information about the trade you are setting up. Slippage is a concept with liquidity pools. When liquidity is low then the exchange rate can be quite volatile. The more liquidity that is in the pool, the more stable the exchange between the two assets. Think about whales on a stock exchange or in crypto. They often do trades so large that the effects ripple out across the whole market. This is because for them, the whole market has low liquidity. When institutional investors or super wealthy private citizens want to make major trades, they have to do so in small pieces, over time so as not to crash (or run up) the price of the asset they want to trade in or out of and end up losing value. This is also true for us unfortunate plebs when we trade penny stocks, and it is true here in pools where liquidity is low. This is the whole reason we are being compensated to provide liquidity. It is necessary for the exchange to function.
Setting the slippage is telling the Automated Market Maker (AMM) how much of a difference in value you are willing to accept in order to make this trade, should the value ratio of your request shift due to the trading activity in the pool before it is finally executed. The rate on the line below this is only a snapshot of that moment in time and as you execute the trade this ratio may change. This is here to protect you as without slippage set, you could potentially lose a lot of money. If the price moves outside of the stated exchange rate byond what is set by slippage, then the trade will be canceled. This can be frustrating when there is a mad rush on the exchange because everyone has caught FOMO-19. The drop down menu suggests a maximum of 1% but you can manually type in whatever you want to.
During the opening of the exchange there was such a mad rush as everyone scrambled to buy mex so they could provide liquidity. The price of $MEX skyrocketed and was up 5x in a matter of an hour. Those who had their slippage set too low missed out on buying at the lower prices and those who had it set higher, lost a bit on the trade but ended up making the value back as the token continued to climb. It's a gamble and I don't recommend it if you are looking to provide liquidity immediately. The only way that you came out on top there was to lose say, 10% early and held the token until after it settled at the higher price to provide liquidity. I myself saw two failed transactions due to slippage as the price ran up faster than my orders could be executed. I saw millions of potential $MEX vanish as everyone jumped in all at once. I was also at work and decided to take a breath, and not worry since all I lost was an opportunity... a loss of potential and a loss only on paper. As I was providing liquitidy immediately after purchasing a couple of hours later, my investment in the pool remained the same. I could have profited greatly by buying 10M $MEX and waited for a 5x and then provided liquidity with much more value but only a very few lucky souls achieved that one. (This can also go sideways on you if the token tanks before providing liquidity so be careful about waiting if that is your intention.)
Minimum received is what you will receive after the swap is executed, if the price stays within the bounds you set with slippage and it goes through.
Liquidity provider fee is another incentive to provide liquidity. A fee of 0.30% is taken by the pool on every single trade that occurs there. 0.25% is deposited back into the pool as $EGLD, raising the pool’s value (and therefore the value of your LP tokens) and 0.05% is used to buy back $MEX and burn it, reducing the supply and making $MEX tokens more valuable.
Price impact is an estimate on the impact this trade will have on the exchange rate of the asset in the pool. As one asset becomes more scarce it requires exponentially more of the other asset to swap. In this way, is it impossible to drain the pool enitrely of one asset. It simply makes it more and more expensive to swap until supply is returned.
If this goes higher than your slippage it will cancel the trade. If you really really want to push a trade through and this number is higher than your slippage you must adjust it accordingly, or break your trade up into several smaller trades that don't impact the price as much. For these earlier asset pairs like EGLD-MEX and EGLD-USDC this probably won’t be much of an issue for most of us but once there are hundreds of ESDT tokens populating the exchange, several of them will have low enough liquidity that this will be an issue.
When you have looked over every line and it all looks good, do a second read to double check and if you are satisfied, then click swap. Make sure this trade is what you want to execute from top to bottom. Once you push swap, there is no turning back and the code will run whether or not you made an oversight. There are no do-overs here.
Liquidity
The Liquidity tab has three sub-tabs underneath it. My Liquidity, Active Pools and + Add Liquidity. This may show only two until you provide liquidity once and then My Liquidity should also appear.
We’ll start with Active Pools. Each possible liquidity pool (sometimes also called a swap pool) is listed here. At this moment this shows exactly two, and they are named after what they swap between. EGLD-MEX will allow you to exchange between $EGLD and $MEX, in either direction, and the same goes for EGLD-USDC with $EGLD and $USDC. A reminder sits below these to let us know that we will need to stake any LP tokens we have in order to receive additional rewards (i.e. $MEX tokens). Next to the names you will notice the APY. We will explore this concept in more detail in the Farms section but right now this shows you an approximation of the return you will receive on your value for the farm of each pool. At the moment, this is at >10,000%, and yes you read that right. 10,000% is roughly a 100x by the end of the year and this is greater than that. These returns are completely unrealistic and have moslty to do with the participation in the pool. Mainnet will start out here and then quickly go much lower, likely until it is comparable to other DEX in the broader crypto-sphere. Remember that where there are sky high returns to be had, there are professional farmers waiting with plenty of liquidity at the ready.
Clicking on either of the pools here will introduce a drop down menu with more information on each one.
Total Liquidity is the total value of all tokens in the pool. The next two lines tell you how many of each token are in the pool currently. Remember the red and black chips analogy, that is literally how it works here. Underneath that we have two buttons + Add and Swap. If you need more of one token in order to add liquidity then you can press Swap to bring up the Swap app, and it will already be set up to exchange between these two tokens. Pressing + Add will likewise bring up the + Add Liquidity tab in the Liquidity app with this transaction already set up for you.
When adding liquidity you need to keep in mind that these will need to be an exact match in dollar value of the two tokens. If you wanted to provide $400 USD worth of liquidity to the EGLD-MEX pool then you will need to provide $200 USD worth of $EGLD and $200 USD worth of $MEX, totaling $400 USD. Luckily again, we have no need to do any quick maths. Entering in a value for one side of this equation will autofill the other side for us. If we want to put in 1.8 $EGLD, the app will tell us that we need 552,448.9963 $MEX tokens on the other side. Provided you have these available in your wallet then you can add the liquidity and receive your LP tokens. If not, you will need to swap (or buy with fiat) to get more of either one such that the values match. Both sides of this must be of equal value in order to provide liquidity.
Underneath this we see another explanation of the transaction similar to the same section on the Swap app. This begins with Slippage, which for the same reasons as before will require us to set a percent limit. You may use any value you want here but the app has three options in the drop down. Many people will be using the liquidity pool to swap and during moments of low liquidity or high volume, the exchange between the two tokens may be quite volatile. When you provide liquidity you are providing it based on the values in that moment and, after you begin the transaction to the time when it is fulfilled these values may change dramatically. The slippage is there to protect you and will simply cancel the transaction if the values fall too far out of range. Otherwise this could be a sure way to get REKT.
The following two lines display the current exchange ratio for this transaction. Make sure these values make sense to you before you begin. If there was a sudden run on one token or a dump, these values may be out of the ordinary and you may want to consider waiting (or FOMOing in with everyone else depending on the circumstances). We don’t have a good idea of the value of $MEX to $EGLD at the moment so this is more for the stable coin pool and for the future. If the price in the stablecoin pool is way out of wack compared to the rest of the market, by all means take advantage if you can because it probably won’t last long.
The next two lines show you the USD value of the liquidity you are providing and Pool Share, the total percentage of the pool this will give you ownership of. The red and black chips example above was simplified and it’s worth considering that this Pool Share percentage is only the share you have in this precise moment. If more people add liquidity then you will own less of the entire pool and if people withdraw their liquidity then you will own a higher percentage of the whole. This makes sense because this is simply a ratio between the USD value of the total liquidity and the USD value of your liquidity. Your percentage will fluctuate with the total value of the pool but the value of your percentage will remain stable to the value of the tokens you have provided.
The orange notice below this explains that you will earn 0.25% on all trades, meaning the value of your LP tokens will increase as people use the pool to swap. Between this, people adding and withdrawing liquidity and the value of the tokens involved themselves, calculating the value of your LP tokens can be quite complex. As the tokens themselves rise and fall on the broader market this will also be reflected in the value of your LP. The Maiar Exchange with be making all of these calculations for you so you don’t have to worry.
If everything looks good to you, please be sure to double and triple check as a mistake here (like in the swaps) is final and there are no do-overs. When you are ready, press Add Liquidity and as it says, you will be prompted to sign 4 actions and then 2 transactions will process. When this is successful, you will see your LP tokens appear in the My Liquidity tab.
Pressing this will open up a list of all of the LP tokens that you own that are not staked in a Farm. If you see them here that means they are not yet staked and therefore not earning $MEX tokens. You can press the dropdown and get a description of exactly how much of each asset the tokens represent as well as the pool share percentage.
These numbers are all subject to change and this represents what they are only in this precise moment. You have the option here to + Add more liquidity and this is where you will come to redeem your LP tokens for the assets they represent. If you wish to do this, make sure to unstake them from the farm so they show up here and then press - Remove.
The - Remove option will display a pop-up where you can set the amount you would like to remove by using the slider or entering the value directly, and then set slippage. You will see the number of tokens estimated to receive when this is complete and you can then either Cancel or press -Remove Liquidity to execute the transaction. As it says on the bottom you will sign two transactions. When this is done you no longer have your LP tokens and will see the tokens you pulled out sitting in your wallet.
Farms
Now we come to the sexy tab that everyone is talking about, the one where all the strategies come into play and the one where we earn the big bucks with insane APRs… Well at first anyway. These APR may not last an entire year so it is unlikely that we will see that juicy greater than 100x that’s been dangling in front of us for so long now. The reason for this is that these APR/APY are calculated on the fly based on a handful of factors that are always in flux. One of those factors is participation. The rewards are distributed amongst all participants in the pool so the more people participating (or rather, value in the pool), the more diluted those rewards will become so that we will see the APR drop as adoption rises. These rewards are also outsized in the first few weeks to incentivize early adopters. Between a gradual reduction in rewards and a gradual adoption of the platform, the APR will likely drop dramatically over a very short time. And this makes sense and is healthy because if you had 100x on $1,000… well do the math. $1,000 * 100 is $100,000 in the first year, $10M in the second year and after only 3 years you would be a billionaire. This is completely unsustainable and where would all that money even come from? The likelihood is that these percentages will fall in line with the percentages you find on other well seasoned DEX before long. So, appreciate the phenomenal rewards while they last but don’t expect them to be forever, or even for very long. In other words, gett’em while they’re hot!
You can see the name of each pair at the top left of each farm. Right next to that is a little green box with a speed multiplier. This basically tells you the amount of $MEX that is headed to each farm for rewards to be distributed amongst all of the farmers. As you mouse over them you will see they are 50K $MEX per 1x. This is then diveded equally with every LP token. You'll notice that each box has a different multiplier and this is because each pool is incentivized differently. Can you think why each one is incentivized the way it is?
Directly below this is a quite large number that tells us the total value of all of the assets in the pool. Then directly to the right is the estimated APR and APY for each farm. More on that later.
Using the farms is quite simple because for each type of LP token you have to stake, you have only one farm and only two options for which to stake them (for now, though this may change in the future). Each farm has two buttons and a drop down that will show more information when you have something staked. In addition to the liquidity pool farms there is also a MEX farm. This is where you can store any extra $MEX tokens and earn interest on those as well.
The MEX farm has a third button called Reinvest all, which does not appear on the liquidity pool farms. This is because the MEX farm is a lot more like staking on the network than a liquidity pool. When you are in this farm, there is only $MEX so it is a simple matter to move the rewards back in to compound them. When you are using a liquidity pool farm, in order to compound on that value you need to make new LP tokens. This means you need to harvest the tokens from the rewards, swap them into whatever assets are necessary, make new LP tokens, and then stake those. For the MEX farm it is merely one easy transaction and for the liquidity pool farms it requires at least three separate procedures.
I have prepared some EGLD-USDC LP tokens so let’s stake those. Go to the EGLD-USDC farm and press Stake. You can see I have a balance of 0.32 LP tokens. I want to stake all of them so I will hit the MAX button. This fills in the field with the entire balance and moves the slider to 100%. Next we have a choice to make, to lock or not to lock. I will go over some thoughts on this in the next section so for now, locking gives us double rewards so let’s do that. Check the Lock rewards box.
The above are outdated now. This was on testnet and on mainnet, the orange/yellow message has been changed to:
Now we are notified that withdrawing early will require us to pay a penalty of 1%. I intend to keep this in here for much longer than the 96h noted on the warning message so I am fine with this. It also says that depositing more will reset this timer. This number may change in the future so be sure to check in before staking. Press the Stake button to execute this transaction or the Cancel button to go back. We will be asked to sign two actions.
*A note on this percentage. There are times when it may be worthwhile to take this 1% hit. The important thing is to realize that it is there and that there is a time limit on it that starts from the time of the last deposit. This deposit is on LP tokens of the same kind. An EGLD-MEX token for example stacks with other EGLD-MEX tokens and not EGLD-USDC but also not EGLD-LKMEX. Depositing into one farm does not affect the timers on the others.
Now if you press the drop down menu you will see a list of all of the LP token farms that you have and what they are earning. You can see here we have 0.31 LP tokens that have already earned 1,734 LKMEX if you watch this block per block you will see this number increasing. When the value is larger than the minimum then you will be able to harvest these rewards by pressing the Harvest button. This will bring these rewards into your wallet where you can use them for anything you like.
I made another LP token for the EGLD-MEX pool. Note that I didn’t use all of my $EGLD. How much you leave in your wallet is up to you but be aware that using all of it will leave nothing for paying fees and then you will be stuck until you manage to get more rewards from your stake on the network or buy more off of the market.
I now have 1.809 LP tokens in the EGLD-MEX pool earning 7,175%… except that’s with locked rewards so it is actually double that or, 14,350% paid out as $LKMEX. $LKMEX cannot be swapped for anything else so my best opportunity at this moment seems to be staking it in the MEX farm so that I can get an additional return while waiting for it to unlock. I will do so as soon as it reaches the minimum, which at this moment is $5 worth of $MEX. You should consider waiting longer as each transaction incurs one or more fees but as this is solely for the article, I will wait a bit and then harvest so that I can stake in the MEX farm.
While we are waiting...
This may be a good time to discuss the APR/APY values listed on each farm and pool. APR stands for Annual Percent Rate and is essentially what you would get after one year if this rate was stable. The APR is calculated per block so what you are seeing is only the rate for this fraction of a few seconds of that hypothetical year. The APR will fluctuate with the popularity of the pool, both in how many people are providing liquidity to the pool and how many people are using it to swap. The number is dynamic and you will see it change often. It is more of a measurement of the return you are getting for this block than it is the real return for the entire year.
It makes sense if you can't picture what this means at first. This is a complex calculation and it may be easier to see it with a more static return. Take a return of 12.5%, which is a typical return for those delegating to a validator to secure the network. If you have 100 EGLD staked with a validator that offers 12.5% APR then you will get 12.5 $EGLD after one year. For some staking agencies this is paid out daily so you can simply divide 12.5 $EGLD by 365 days, and a return of 12.5% APR on 100 $EGLD would be around 0.0342 $EGLD per day.
Now, that’s APR but what about APY? Well setting the fee to restake aside to make it simpler, let’s say every day you restaked those rewards. So, you start with 100 $EGLD and restake the first day and now you have 100.0342 $EGLD. The APR is now calculated not on 100 but on this new sum of 100.0342, making your return slightly higher than it was before for the next day. If we were to do this every day and get a higher an higher return then by the end of the year we would have more than the 12.5% APR. In fact it would be 13.31% APY This is called compound interest, where you earn more interest on the interest you have just earned. Anual Percentage Yield (APY) is the name people have given this return using compound interest. Compound interest is what makes these systems so powerful (as well as credit cards and predatory loans such a nightmare).
The APR on Maiar is calculated on the fly per block so it is updated every few seconds. You are receiving the fractional value of what that APR would look like if it were stable the entire year and divided that sum by all of the possible blocks. The exchange is a dynamic system and you will see this number fluctuate with use. The APY calculation is done by taking the APR and estimates the return if you were to compound this return once per day.
If you compound more than once per day then it is possible to push this value even higher (keeping in mind there are fees associated with each transaction so there is a theoretical limit before you get diminishing returns). Given the complexity of this system these APR/APY values are merely estimates and give you a ballpark for what kind of return you can expect. There are more factors at play as well, such as the value of the $MEX token itself. If you get a return of 1,000% paid out in $MEX, which you keep, and then the value of $MEX goes up 5x, your return in retrospect was really closer to 5,000%. Just some things to keep in mind while looking at these numbers.
...and back to our Farms
It looks like I have more than $8 in $MEX in one of my farms now so let’s harvest and stake in the MEX pool. There are two buttons that will allow us to harvest this value. One is Harvest all and the other is in the drop down that says Harvest. You can have more than one type of LP token earning more than one type of rewards so over time you will see a list show up displaying all of them. I made more LP tokens and staked them so you can see.
You can see here at least two combinations of tokens and rewards. We have LP tokens that are made with $MEX and are earning either $MEX or $LKMEX and others made with $USDC that are earning either $MEX or $LKMEX. LP tokens made with $LKMEX will create an additional category here and given the unlock schedules of $LKMEX you may end up with several of those over time, each earning either $MEX or $LKMEX so the list may get quite long. Pressing Harvest all will harvest all of the rewards in the farm or selecting Harvest from an individual farm in the drop down will harvest only that one.(Each will harvest in their own collection so be aware of that for fees when using them after harvest. Each collection will require it's own transaction to use after harvesting)
Pressing Harvest displays a popup showing what you are about to harvest and then pressing Harvest Reward will begin the transaction.
Back in the main section a second option, Withdraw will withdraw those tokens from the farm and return them to the Liquidity section. You would want to do this only if you were intending to restake in the farm for a different rewards option, withdraw liquidity, or perhaps take advantage of another opportunity that has arisen.
At any time you can check the contents of your wallet by pressing your public address displayed in the upper right corner and here we see that we now have 86,726 $LKMEX tokens in our wallet. (I got distracted with writing and I earned another $4 worth!). We can also see a snapshot of our entire Maiar Exchange account including the overall value and our Farms. Since $LKMEX cannot be swapped, let’s get it into the MEX farm ASAP so that we can earn more $MEX on it.
Go to the MEX farm and press Stake.
With $MEX you will have both $MEX and $LKMEX to choose from and $LKMEX will group themselves according to their unlock schedules so at first you will see a blank balance:
and then once you press the drop down menu, you will see all of your available allocations of $MEX:
EGLD-LKMEX tokens are denoted by the yellow lock badge on the icon. Selecting the one you want to use will now display the balance. I will set it at MAX and put all of it into the pool. I will also lock these additional rewards so that when I compound this I will get double rewards on my double rewards:
Note again the message regarding the penalty for withdrawal. The images above are now outdated and the current message as of this writing says:
The total time remaining will show on a countdown timer shown when you go to withdraw.
Press Stake to begin this transaction. I now have my $LKMEX staked and just as in the Farms, I will have multiple entries in this list eventually depending on if they are $MEX or $LKMEX and whether or not you are locking the rewards:
You also have the option here to withdraw and you must withdraw each of these individually. You will want to withdraw only when you are ready to swap your $MEX tokens for something else. Otherwise keep hitting that Reinvest button and enjoy your compound interest.
This is all you need to know for the basic functionality of the Maiar Exchange. I hope you can use this guide to get your farms up and running and understand everything that you are doing on this platform.
If any aspect of this was confusing or you have further questions, feel free to DM me on Twitter and I will try my best to answer or find the answer for you. I appreciate your feedbak as it helps me refine this article so it may help more people.
Sections: Overview | Tutorial | Strategies
For further learning, take a look at the following resources:
- For visual learners, Wesley Kress has created a wonderfully thorough video: A Master Class: A Deep Dive into The Maiar Exchange (DEX) of The Elrond Network
- And for further exploration of advanced strategies, The Palm Tree Network has put out a guide based on discussions in their community.
- There is a Telegram channel for discussing strategy, made by the community here
- And the official Telegram channel is here
- The official docs from Elrond are here, with their how to guides and simple explanations of concepts
- Here is a video: Maiar Exchange Crash Course
- A useful guide and another tutorial from MGStaking
- An introduction to liquidity pools by Ishtari Vision
Thanks for stopping by my Elrond blog! Please share with others and let me know if there are topics you would like me to dive into for future articles
If you would like to contribute and help me write more articles like these you may tip me with $EGLD, ESDT tokens, or NFTs to my address:
erd1ztcpuncemxcpes6t58cs28acre0zarjh6zj32a4e9vyhfp3g5agq0qtvqv
or to my herotag: pippiwestwood.
Don't have a Maiar wallet? Download one here and start your Elrond journey! Use my referral code if you want: txs89adg0p to get $10 in free $EGLD.
0x0x Pippi 💕
Social Media:
Twitter: @pippiwestwood
eMoon: SaoirseNS
Medium:@passinginterest