DeFi Kingdoms Gardens (Liquidity Pools)
Let’s talk about liquidity pools, how they relate to decentralized exchanges (like those built into DeFi Kingdoms) and how you can earn yield by staking tokens in liquidity pools in the DeFi Kingdoms Gardens!
Decentralized Exchanges and How They Work
To be able to understand liquidity pools and how they work in DeFi Kingdoms it is first important to understand how a decentralized exchange works.
What is a Decentralized Exchange?
A decentralized exchange, also known as a DEX, is a peer-to-peer exchange where users can trade without handing management of their funds to a centralized intermediary. Instead, transactions are operated through smart contracts.
Examples of centralized exchanges would be Coinbase, Binance, Kucoin, Gemini, etc. Rather than using smart contracts, Centralized exchanges themselves are the intermediary for trades between buyers and sellers using a an order book model. This means that buyers will list a price they’d like to buy at, sellers list a price they’d like to sell at, and when someone buy price meets someone’s sell price, the order will execute. In a centralized exchange, entities or individuals called “market makers” are the ones that provide liquidity for such trades.
In a decentralized exchange, because the buys/sells are executed through smart contracts, the smart contracts need liquidity to execute the trades— put more simply, if the DEX, which executes trades without any intermediary via smart contracts, is to be able to allow someone to sell their ONE and swap it for JEWEL, the DEX will need some amount of ONE and JEWEL to access as people go in and out of those two pairs. This underlying amount of ONE-JEWEL in this example is called a liquidity pool. Instead of market makers providing this, the liquidity is provided by the people through smart contracts!
Benefits of decentralized exchanges over centralized exchanges:
- Mitigates risk of a third party that holds your assets (e.g. the centralized exchange) being hacked and losing your assets.
- Lower transaction fees.
- Helps prevent market manipulation from fake trading and wash trading.
Hurdles in decentralized exchanges:
- Lack of fiat on/off ramp.
- Complexity and higher barrier of entry for new users.
- Need for liquidity.
In DeFi Kingdoms, the DEX is built into the game layer. For example, on Harmony, the DEX can be accessed via the Trader in the Marketplace.
What are Liquidity Pools?
Liquidity pools are the means by which a DEX is able to execute transactions via a smart contract without any intermediary. How does this work? The DEX will incentivize people like yourself to provide equal amounts of a pairing, such as ONE-JEWEL, as an example, into a liquidity pool by offering you (1) a percentage of all fees generated by the DEX for that pool and (2) sometimes, additional rewards in the form of another token.
How exactly does that work? It’s a fascinating algorithm, but essentially the DEX needs liquidity to be able to allow people to trade in and out of a pair, so by offering the aforementioned incentives, people are incentivized to go and take equal amounts (in value) of the two tokens, pair them together into a new token called an LP Token, and then staking that LP Token with the DEX’s protocol. The LP Token represents a portion of said liquidity pool and provides the person staking the LP Token with incentives proportional to their share of the pool.
Liquidity Pool Incentives
The concept of liquidity pool incentives is important. These were mentioned briefly above. First, every DEX protocol gives liquidity providers a percentage of fees generated by the DEX for that particular pool. That will almost always be built into the smart contract for every DEX. That however, is rarely big enough to incentivize someone to provide liquidity, so how does a DEX incentivize people to provide liquidity? By providing additional incentives. This is typically via a token from the DEX’s protocol itself (i.e. CAKE for Pancake Swap, UNI for Uniswap, VIPER for Viperswap, and in the case of DeFi Kingdoms, it is JEWEL (on Harmony) and CRYSTAL (on DFK Chain, the Avalanche Subnet that houses the Crystalvale expansion)).
Sometimes, these additional incentives can be from one of the underlying tokens in the pair. Perhaps a new project wants to incentivize people buying its token to create liquidity, so it can arrange with a DEX to emit some of the new projects tokens (even though the new project does not operate the DEX) as an incentive. The options to incentivize are endless, but you get the point!
The concept of providing liquidity for these incentives is often referred to as “liquidity mining” or “yield farming.”
Impermanent loss can be complicated, but let’s keep it high level. Impermanent loss is something that can happen as a result of providing liquidity. Essentially what happens is that you provide 50% one token and 50% of another token into the pool, and create a single LP token. The ratio between the two tokens at the time that you provide the liquidity may be different than the ratio between the two tokens when someone else provided it. For example, someone may have provided 1 ONE and 1 JEWEL into the ONE-JEWEL pool when JEWEL was worth the same cost as 1 ONE. Well, if the price of 1 JEWEL is now 80 ONE, when you provide, you will provide at a ratio of 1 JEWEL:80 ONE. Regardless, you will receive the same LP token as everyone else in that pool, just in differing amounts. As the price of one token goes up relative to the other, that impacts the ratio between the two tokens. Long story short — when you go to withdraw, the ratio between the tokens may be different, and your share of the pool will almost always be different and you’ll end up getting the two tokens back, but in different amounts than what you provided (most likely).
The concept of impermanent loss is that there are situations where you can be worse off when you unpair your LP token than you would have been if you just held the two underlying tokens without pairing them into an LP token over the same period of time. When that theoretical loss is less than the rewards you received for providing LP, then you suffered a loss. It’s much more complicated than that, but that’s a lesson for another day and there are plenty of guides and calculators (like this one) to help you plan!
Rewards for Providing Liquidity in DeFi Kingdoms
In DeFi Kingdoms, you can receive some amazing awards, in the form of each realm’s power token, for providing liquidity. At the time of this article the two current realms are Serendale (based on the Harmony blockchain, with the power token JEWEL) and Crystalvale (based on DFK Chain, an Avalanche Subnet, with the power token CRYSTAL). Within each realm, the earlier you provide liquidity, the greater your rewards will be because the amount of power token emitted per block to liquidity providers is greater at the earlier stages of the realm. For more information read the official docs here.
In the Gardens you can view all of the various pools that are incentivized by DeFi Kingdoms (with power tokens) and how much of the power token each pool will receive per block. To determine how much power token you would receive you would just take the number of power tokens emitted per block and multiply by your % of that pool.
A DEX allows anyone to make any liquidity pool they want, so keep that in mind, but if anybody wants to receive the protocol incentivized rewards, they have to provide liquidity for the specific incentivized pairs, not just any random pairing (although people will still create other pairings, even if not incentivized other than via the DEX fees).
Power Token Utility
Unlike the token emitted to liquidity providers for most DEXs, the power tokens in DeFi Kingdoms have a lot of utility. First and foremost, they are the main currency needed to play the game. For example, to summon heroes, by heroes on the marketplace, level up heroes and more, you have to have the power token for that realm. This is drastically different than the token emitted on most decentralized exchanges, which has almost no utility other than the alleged ability to vote on governance proposals.
Locked and Unlocked Rewards
One very important concept to understand is that when you claim your Garden rewards within the first year of the DEX in that realm launching, a portion of the power tokens you receive will be locked and a portion will be unlocked and immediately usable. Once you claim, those locked tokens remain locked until roughly one year after the commencement of that realm, at which point they will then unlock over the next year after that. If you decide to wait and not claim your rewards, the unlock to lock ratio shifts by 2% approximately every week until all rewards claimed will be fully unlocked after one year. Keep in mind that once claimed, the locked rewards to not unlock 2% per week, they remain locked the entire first year of the realm, and then slowly unlock over the course of one year after that. You can read more about this in the official docs here.
How to Provide Liquidity in DeFi Kingdoms
As noted above, the first step to providing liquidity is to pair equal amounts (in value) of two tokens together. In the DeFi Kingdoms Serendale realm (on the Harmony Blockchain), this is done via the Druid in the Marketplace.
In Crystalvale, this will be done through the Druid Ulfur.
At the druids, you can select two tokens to pair together. Select the two tokens you want from the drop down, and type the amount you want to provide of either one of the tokens and it will automatically populate the amount needed of the other token so that you have equal 50/50 amounts (in value) of each.
Hitting the supply button will bring up a confirmation telling you how many LP tokens you will receive and what % of such pool you will have.
Once you supply the tokens (which means you give up the two underlying tokens and receive the single LP token), you can then go to the Gardens and deposit those LP tokens, which are referred to as seeds, and start earning yield on those.
At the seedbox, you can navigate to the pair that you just created and see how much APR you will receive. In DeFi Kingdoms, the yields you receive from providing liquidity will be in the form of the power token for that realm. In Serendale (the Harmony-based realm of DeFi Kingdoms) you will receive JEWEL. In Crystalvale, the DFK Chain (Avalanche subnet-based realm of DeFi Kingdoms) you will receive CRYSTAL.
When you click on deposit, you will have the option to deposit the tokens you just made.
Once deposited, you’ll be able to see how much you’ve deposited and how much you’ve earned!
When it comes time to claim your rewards (which is up to you) you can either claim the rewards for that specific pairing by hitting “Claim” or you can claim all of your rewards across all of your various liquidity pools by going to the Harvest box in the Gardens.
Now that you understand more about liquidity pools, try your hand at providing liquidity in the DeFi Kingdoms gardens and earn yourself some DeFi Kingdoms power tokens!