3/7/2022 Update: The BTC to BTC pair originally listed in this post doesn’t pay 50% + APY anymore. However, until few days ago another BTC to BTC pair was paying around 100% APY (see screenshot below). Another ETH/ETH pair is also paying 50% APY which is much higher than what I had posted originally in this thread. I am posting this update so you realize how important it is to be up-to-date with DeFi APYs.
If you are into crypto cards and if you follow this blog then you are likely aware of the fact that Coinbase debit card provides 4% cashback everywhere in the form of XLM token card while that of Unbanked is supposed to provide up to 6% cashback in the form of TERN token. Both of these tokens are part of Stellar network with XLM being the native token of Stellar network. Yes, this is a weird way to introduce Decentralized Finance (DeFi) or Stellar network for that matter but I wanted to start with something that the readers of this blog were likely familiar with.
It should be mentioned that there are far bigger DeFi platforms than that of Stellar. You can check out various platforms sorted by TVL (total value locked) on DefiLlama. At the time of writing this post StellarX only has a TVL of 33.82 million.
How is this article organized?
The goal of this article is to talk about AMM, however a typical reader of this blog isn’t familiar with non-custodial wallet, let along AMM. So, first I will briefly talk about a non-custodial wallet that you can use to get into Stellar AMM. Then I will talk about how to send coin into this wallet. And while I am doing this my goal is always to provide various resources to you so, should you need it, you can click on it and learn more.
Then I will talk about y assets and AQUA which could potentially sweeten our AMM game. Before I get into AMM itself I will then briefly mention how to connect the non-custodial wallet into StellarX. Finally, I will walk you through various examples of liquidity pool, what are the risk and benefits associated with them.
Creating a LOBSTR Wallet and adding TrustLine
If you want to participate in Stellar’s DeFi, you need to have a non-custodial wallet (aka you hold private keys; see this explanation on Gemini ), like Lobstr. You can grab an iOS or android app by following links provided in Lobstr’s official website or alternatively you can directly create an account on their website as well.
How to send coins to Lobstr wallet
Before sending a coin to Lobstr, you need to establish a trustline (see this blogpost by Stellar).
If you are depositing coins that are part of the stellar network, you can do so by clicking on the “receive” button and following the prompt.
However, to send off-chain coins (think USDC, BTC, ETH, etc), the process requires you adding a trustline, going to “assets” menu, clicking on the asset you would like to deposit, and then finally clicking on the “deposit” button. It is important that you deposit the exact amount the prompt tells you to. For example, when I attempted to deposit $1000 USDC I am asked to send $1000.9091 to a specified address. I urge you to check this through guide by the folks at Lobstr.
If the site is helpful to you please consider donating. You can donate using the QR code above or use the following stellar address (no memo required):
GBULDYOQ5JCPI3BSQCJILM5BKCLWENLYKJCUIHYR4OYWXTX2SJ2LASEH
You can send XLM, TERN, AQUA, etc. You can also watch this demo wallet live on StellarExpert.
The AQUA Token
Aquarius (AQUA) is a token that is supposed to provide reward to those who use SDEX and AMM.
You can check what they are providing reward for here and what people are voting to get rewards on here. Although I think AQUA was a neat concept at inception, I personally think it is plagued with problems. A redditor does an amazing job at stating everything right and wrong with the current state of AQUA and you can read it here.
However, for the purpose of this post the key thing to remember is that you may get AQUA as a reward for participating in AMM. Sometimes the reward you get is amazingly high and that is what is beautiful about AQUA. Side note: I tend to convert AQUA acquired as reward into other assets, preferably y assets, which we will talk about next.
The Y Asset
Ultrastellar provides yield earning “y” assets which are supposed to be 1:1 with their corresponding counterpart. At this time the available y assets and their interest rate are as follows:
y Asset | Interest Rate (APY) |
yXLM | 5% |
yBTC | 5% |
yETH | 5% |
yUSDC | 9% |
You can read more about y assets on Ultrastellar’s website. It is worth noting that Ultrastellar are the folks behing Lobstr, StellarX, StellarTerm, etc. However, it is also worth pointing out that Ultrastellar is independent of Stellar Development Foundation.
The concept of y asset is interesting because you can just swap USDC to yUSDC and earn 9% on a non-custodian wallet. However, you can maximize your interest by getting y assets involved in AMM. We will talk about AMM next but first let’s learn how to connect a wallet in StellarX which we will use for AMM.
Apay???
Apay/Papaya is a stellar anchor and you can read more about them here. Their website says claims that since Aug 11 2021 Apay has being paying 5% APY on BTC, LTC, and ETH while 10% on USDT. Here is a discussion thread on this matter on r/stellar subreddit. You can check out how Apay works here. Click here to see additional threads on Apay on r/stellar subreddit here.
I am not too familiar with them but one reason I bring them up is because their pair seems to have good APY. Again, provide liquidity at your own risk.
How to Connect a Wallet in StellarX
You can begin by going to StellarX’s website then click on “connect wallet” on top right. At this point you are greeted with various ways to login. I will briefy outline how to connect with LOBSTR wallet:
- click on WalletConnect
- in your LOBSTR wallet, click on menu, then on “WalletConnect”, followed by “new connection” button and finally scan the QR code you saw in step 1.
It is important to note that you will still need to use LOBSTR wallet to confirm swaps, commitment to liquidity pools, etc. Think of StellarX as a simple and nice looking interface that will require permission from LOBSTR wallet to do anything meaningful.
Automated Market Maker (AMM) in StellarX
1. Rewards of Providing Liquidity
Through AMM you are rewarded for providing liquidity and the reward may come in two fold:
- 0.3% of trade: Liquidity providers earn a 0.3% fee on all trades proportional to their share of the pool. Fees are added to the pool and are accumulated in real time. Fees can be claimed by withdrawing your liquidity.
- AQUA reward: may be available in the form of AQUA token that we had talked about earlier.
2. What is AMM and Impermanent Loss?
I think the following video from whiteboard crypto does an excellent job of explaining AMM and is worth a watch to a point that I will embed it here:
Anyway, the risk of AMM comes in the form of what is called an “impermanent loss”. It is very important that you understand the concept of impermanent loss and once again I will defer to whiteboard crypto for their excellent explanation:
There are various impermanent loss calculators and you can once again watch whiteboard crypto explain his impermanent loss calculator on youtube or try it directly on his website here. You can also try various other calculators like this and this. These calculators can be interesting for messing around with numbers so you can see what could possibly happen. It is also interesting for running numbers where one asset class is a stable coin (i.e. does not change price) while the other one fluctuates.
Now, StellarX has two pages where you can read about Automated Market Makers (AMM) namely the liquidity page and the analytics page. The liquidity page allows you to (a) add liquidity (b) remove liquidity and (c) increase liquidity while the analytics page will allow you to browse AMMs pools. You want to search for a good liquidity pair in analytics page before committing to liquidity via liquidity page.
So the natural question is – what do you look for before committing liquidity? Let’s go through a liquidity pool together in much detail.
3. Reading The Liquidity Pool – a Through Example
Here is an example of BTC/USDC trading pair and we want to go through all the columns bit by bit.
- If you were to commit to above pool, you will provide 50% of BTC and 50% of USDC. For example, if you provide $50 in USDC then you should provide $50 in BTC. The url help you identify whom these coins are associated with (this is important as there are tons of scam tokens in Stellar).
- In the next column to the right you see $1,045,550.69 which is the total liquidity available in the pool, followed by 24 hour volume (Volume 24H) in the trading pair after which follows the 7 day volume (Volume 7D).
- Then you see $67.94 which is the fee collected in 24 hour (FEE 24 H).
- Notice that Fees 24 H = 0.3% of Volume 24H. Here 67.94 is 0.3% of 22,645.39
- Going further right we see what might be the yearly collection in fee (Fees Yearly).
- Fees Yearly (the one in blue color) = (Fees 24 H * 365 days)/ Liquidity * 100. Here (67.94*365)/1,045,550.69 * 100 = 2.37%.
- Fees Yearly (in purple color) is given in AQUA and is dictated by AQUA voting.
- Finally in the last column we see “members” which is the number of wallets (here 25) providing liquidity.
4. Some More Examples
ETH/USDC liquidity has high APY (through AQUA) however with this pair you have to be careful of impermanent loss.
Here is an interesting example where both pairs are “y assets” (yXLM/yUSDC) and yield interest on their own. In this case yXLM gives 5% APY while yUSDC gives 9% APY and providing liquidity in the pool itself is estimated to give 7.58% yield. Notice that in this case one of the asset is an stable coin but you are still exposed to impermanent loss from XLM going up or down.
Now if you had chosen yXLM/USDC as opposed to USDC/yXLM you would have been exposed to similar risk but perhaps your fee from the pool would be higher. This example is also interesting because the volume in this pair is relatively high to liquidity which is why it is yielding great annual interest.
Here is one I personally am providing liquidity for – BTC/ yBTC. Why?
- Because I am providing liquidity between two versions of Bitcoin, in theory they will always be equal to each other, and in theory I should never be exposed to impermanent loss.
- The “half” that is stored as yBTC will also earn me 5% APY.
- To my surprise the other “half” of BTC also earns 5% APY. However, once again I am not sure how reputable apay.io is.
- The volume is relatively low in comparison to liquidity so although I won’t collect much in fee (0.33% of yearly is expected) BUT I am getting a huge AQUA reward.
The readers of the blog may be curious to see the pools for TERN token (see blockcard review) so here is a screenshot sorted by 7 day volume:
Unfortunately as you can see in the above screenshot there is very little volume happening in TERN pairs. Remember if there isn’t enough volume then adding additional liquidity is only going to reduce the % value of the fees. For example if $1 liquidity is yielding roughly $1/365 fee per day then your yearly return will be 100% but if add double your liquidity (i.e. $2) and the volume doesn’t go up then you will only get roughly 50% APY (although you are still getting $1 in net fee). It is an oversimplified example but I hope it gets the point across.
Finally here are two more screenshots – the first is all pair sorted by 7 day volume while the second is only AQUA eligible pair sorted by 7 day volume:
If you are thinking, “I have never heard of some of these tokens”, then well there is a good reason for it. Several of the AQUA earning tokens are scams created to abuse the daily AQUA distribution. Once again, I echo my warning of staying away from tokens that you do not understand.
Reading the Rewards Chart
I understand that learning all of this at once can be overwhelming so I want to also walk you through on how to figure out what rewards you are getting. The easiest way perhaps is to go to your Lobstr app, click on menu, and then on transactions. If you are acquiring AQUA then it will be paid on hourly basis. Any acquired interest on y assets is paid on daily basis.
Alternatively, you can use Stellar Expert and paste your public address (or federation address) on top right to land on your wallet’s history, including transactions, rewards, trustline creation/deletion, etc.
For example, in the screenshot below you can see that I am acquiring roughly 10.6 AQUA per hour for providing participating in BTC/yBTC liquidity pool.
In the screenshot below you can see that I am getting 5% daily interest in yXLM. I have two postings for yXLM because at the time of writing this article I am providing liquidity in two different pools involving yXLM. Similarly you can observe 5% daily interest on yBTC as well as yUSDC. However, at the very end you can also see that I got interest on yUSDC but it “spot” (as opposed to AMM) and that is because this interest is coming from $3.61 that is just sitting in my lobstr account.
I hope this over the top through explanation helps you read your rewards better.
Closing Thoughts
Since Hodlnaut decreased interest rate on BTC, I have moved all BTC I acquired for free (how?) to Stellar AMM. Now I am earning over 50% APY on my BTC holding. If you are someone who isn’t spending XLM rewards earned through Coinbase’s debit card then this might be a good way to take it to the next level as well.
I know this is a very very different article than my usual posts in the blog but I hope you found it useful. If there are any factual inaccuracies with the article, please let me know by using the contact button or simply leave a comment below.
7 comments
Grat tutorial however I’m not getting the confirmation notification in my Lobstr app when I try to add liquidity.
KK, you may need to go to “WalletConnect” before confirmation pops. If it doesn’t, reopen the app, and go to WalletConnect again.
I can see StellarX listed as an active connection in WalletConnect.
You’re right. I had to go to WalletConnect to see the notification. I think it’s silly and counterproductive. The app should prompt you without you having to do this or StellarX should tell you where to go within the Lobstr app to see the confirmation prompt. thanks for the tip.
Yeah getting confirmation notification is buggy but I suppose it is expected since the whole WalletConnect feature is listed as beta.
Hi SJSJ,
thank you for a great article on the topic. I would like to ask regarding following:
“0.3% of trade: Liquidity providers earn a 0.3% fee on all trades proportional to their share of the pool. Fees are added to the pool and are accumulated in real time. Fees can be claimed by withdrawing your liquidity.”
Is there an effective way to check how much fees were accumulated by providing liquidity after some time? So far I only see I can calculate it manually from 24H Volume history and my share of the pool estimate past days.
Hi Grinchmeister,
I am glad you enjoyed it.
Regarding your question – it is probably in AMM -> Liquidity Pool -> individual liquidity pair. If not there, I am not sure if there is an easy way to calculate how much you are making off the fees. You could check your the activity of your wallet in places like Steller Expert but that isn’t an easy way to do this.
having said that I don’t think you will make a whole lot from the fees in Stellar AMM. Its better to chase AQUA IMO.