Uniswap
DEFI: UniSwap - ALL YOU NEED TO KNOW 🦄Hi Traders, Investors and Speculators of the Charts 📈📉
If you’ve been following me on TradingView for a while, you’ll now that I’m a believer – a believer in the promise of blockchain. One of the principals of this promise is to move away from centrally controlled banking systems. This would eventually include the act of saving and earning interest for the money that you leave in the capable hands of your banker (who also gets to decide whether or not you qualify for loans). Currently, you need to give up all of your personal information to open a bank account and furthermore you are seriously undercut in the returns / interest rate that you will be receiving (to name only two of many problems with the system). For example, where I reside, the most common interest on a savings account is 5% annually, whereas the interest on your credit card is 19.5% annually. And this is, in short, the common argument for Decentralized Finance.
Before we continue, familiarize yourself with these key terms:
TVL – Total Dollar Value Locked in the platform
DEX - A decentralized exchange. DEXs don't allow for exchanges between fiat and crypto — instead, they exclusively trade cryptocurrency tokens for other cryptocurrency tokens.
Blockchain – A unique way of coding that is open for anyone to use, many believe that web3 will be built on top this kind of coding
DeFi – Decentralized Finance such as cryptocurrencies and stablecoins
dApp – Software like apps that work on the basis of blockchain code and thus apps that accommodate cryptocurrency such as UniSwap and NFT Market places
LP tokens - New liquidity pool tokens. LP tokens represent a crypto liquidity provider's share of a pool, and the crypto liquidity provider remains entirely in control of the token. For example, if you contribute $10 USD worth of assets to a Balancer pool that has a total worth of $100, you would receive 10% of that pool's LP tokens.
APY - Annual Percentage Yield, think of it as yearly interest in percentage
Smart Contracts — E lectronic, digital contracts coded to integrate with dApps. Automated financial agreements between two or more parties once the pre-determined terms of the contract is reached
Uniswap is a decentralized cryptocurrency exchange that uses a set of smart contracts (liquidity pools) to execute trades on its exchange. It's an open source project and falls into the category of a DeFi product (Decentralized finance) because it uses smart contracts to facilitate trades. Built on Ethereum, Uniswap is the first and largest DEX in DeFi and one of the many places where you can participate in yield farming. To earn interest in their cryptocurrency holdings, investors contribute their funds to a Uniswap smart contract; these investors are known as liquidity providers. The smart contracts that hold their cryptocurrencies are known as liquidity pools. Liquidity providers are required for Uniswap to function since they provide liquidity for trading on the platform.
With the rise of Blockchain, Crypto and then Decentralized apps, yield farming was born to address some of the banking system's limits. Or at least, that would be in the perfect world.
Yield farming is the process of using DeFi to maximize returns . Users lend or borrow crypto on a DeFi platform and earn cryptocurrency in return for their services. This works for both parties, because yield farmers provide liquidity to various token pairs and you earn rewards in cryptocurrencies. However, yield farming can be a risky practice due to price volatility , rug pulls, smart contract hacks etc.
Yield farming allows investors to earn interest which is called ‘yield’ by putting coins or tokens in a dApp, which is an application (coded software) that integrates with blockchain code. Examples of dApps include crypto wallets, exchanges and many more. Yield farmers generally use decentralized exchanges (DEXs) to lend, borrow or stake coins to earn interest and speculate on price swings. Yield farming across DeFi is facilitated by smart contracts.
Let’s take a closer look at the different types of yield farming on UniSwap:
Liquidity provider: You deposit two coins to a DEX to provide trading liquidity. Exchanges charge a small fee to swap the two tokens which is paid to liquidity providers. This fee can sometimes be paid in new liquidity pool (LP) tokens.
Lending: Coin or token holders can lend crypto to borrowers through a smart contract and earn yield from interest paid on the loan.
Borrowing: Farmers can use one token as collateral and receive a loan of another. Users can then farm yield with the borrowed coins. This way, the farmer keeps their initial holding, which may increase in value over time, while also earning yield on their borrowed coins.
Staking: There are two forms of staking in the world of DeFi. The main form is on proof-of-stake blockchains, where a user is paid interest to pledge their tokens to the network to provide security. The second is to stake LP tokens earned from supplying a DEX with liquidity. This allows users to earn yield twice, as they are paid for supplying liquidity in LP tokens which they can then stake to earn more yield.
Yield farmers who want to increase their yield output can also use more complex tactics. For example, yield farmers can constantly shift their cryptos between multiple loan platforms to optimize their gains.
Back to DeFi - In centralized finance, your money is held by banks and corporations whose main goal is to make money. The financial system is full of third parties who facilitate money movement between parties, with each one charging fees for using their services. The idea behind DeFi was to create a system that cuts out these third parties, their fees and the time spent on all the interaction between them.
Defi is a technology built on top of blockchain - it can be an app or a website for example, which means that is was written in code language by software programmers. It lets users buy and sell virtual assets (like crypto and NFT's) and use financial services as a form of investment or financing without middlemen/banks. This means you can borrow , lend and invest - but without a centralized banking institution. In summary, DeFi is a subcategory within the broader crypto space. DeFi offers many of the services of the mainstream financial world but controlled by the masses instead of a central entity. And instead of your information being filed on paper and stored by a banker, your information is captured digitally and stored in a block with your permission. Many of the initial DeFi applications were built on Ethereum (which is a blockchain technology, but the code is different to Bitcoin's, in other words it operates/works differently). The majority of money in DeFi remains concentrated there.
Lending may have started it all, but DeFi applications now have many use cases, giving participants access to saving, investing, trading, market-making and more. Another example of such a market is PancakeSwap (CAKEUSDT). PancakeSwap is also a decentralized exchange native to BNB Chain (Binance chain). In other words, it shares some similarities with UniSwap in that users can swap their coins for other coins. The only difference is that PancakeSwap focuses on BEP20 tokens – a specific token standard developed by Binance. The BEP20 standard is essentially a checklist of functions new tokens must be able to perform in order to be compatible with the broader Binance ecosystem of dapps, wallets and other services.
💭 Final Thoughts 💭
Is yield farming profitable? Short answer - Yes. However, it depends on how much money and effort you’re willing to put into yield farming. Although certain high-risk strategies promise substantial returns, they generally require a thorough grasp of DeFi platforms, protocols and complicated investment chains to be most effective. Is yield farming risky? Short Answer - Absolutely . There are a number of risks that investors should understand before starting. Scams, hacks and losses due to volatility are not uncommon in the DeFi yield farming space. The first step for anyone wishing to use DeFi is to research the most trusted and tested platforms.
_______________________
📢Follow us here on TradingView for daily updates and trade ideas on crypto , stocks and commodities 💎Hit like & Follow 👍
We thank you for your support !
CryptoCheck
Everything you need to know about auto Market Making in DeFiAn Introduction To Automated Market Makers
I wanted to explore the token economics of ZRX and Kyber for this issue of the newsletter but given the rising interest in “yield”, I just thought it would be good to summarise how non-lending platforms are beginning to leverage idle capital to offer a return. In particular, we will explore Curve, Balancer and Uniswap for this piece. The three holds one thing in common - they are critical infrastructure to exchange one digital asset to another without requiring a centralised custodian. To understand their role, we will need to know why they matter first.
Note : This piece is written with people may not have historical context to DeFi or why any of this matters in mind. You may skip to the parts starting with Uniswap if you don’t need all that context building.
The Why And What
The trade of digital assets from one to another has been heavily reliant on trust. Remember the guy who sold his pizza for 10,000 Bitcoins? He had to ensure the person he was transferring Bitcoins to would not vanish with his coins. One way this used to happen in Bitcoin forums and IRC channels was by trusting the reputation scores of an individual engaging in a trade. This is common in all P2P trading. Factors like the age of the account and frequency of transactions are a core part of platforms like Craiglist and LocalBitcoins. It came with the risk of individuals scamming once the trust was earned. With the arrival of exchanges like Coinbase and Mt Gox, the need for trusting reputation scores vanished. Individuals could deposit on a centralised account and trade with one another. However, custodial risk came along with it. As we saw with Mt Gox, the custodial risk of depositing with a central party is quite high.
As the number of digital assets in the ecosystem rose with developers increasingly issuing their tokens, centralised exchanges became gate-keepers of liquidity. It used to be common for exchanges to demand over a million dollars to list a token. “Value-added-services” like market-making for the asset or sending e-mails to their user-base used to be sold. The challenge with this is that it put teams with lesser resources at a disadvantageous position. While centralised exchanges have played their role, it became impractical over time to rely on them for go-to-market. As the number of digital assets in our ecosystem increases in the form of NFTs, personal tokens and other representations of value on-chain, it will become necessary to have infrastructure that enables the exchange of one asset to another without a central party. This is where automated market makers and liquidity pools play a role. It is about replacing the gate-keepers with lines of code.
An automated market-maker makes it possible to list and exchange digital assets without the help of an order-book. Unlike decentralised exchanges - there is nobody putting in ask and bid orders for an asset. A formulaic approach is used to determine the price of an asset. What this means is the price of the assets in an automated market-maker product moves only when a trade occurs and as such may be less susceptible to external manipulation. For assets such as Ethereum that are also listed on centralised exchanges, occasionally the prices may diverge from what it is on an exchange. In these instances, it becomes profitable to arbitrage and bring the price on the AMM to parity. Automated market-makers are crucial as one could bootstrap liquidity with fewer resources at play and as the name suggests - without a market-maker. Products like 0x and Kyber work as there are incentives for people to make trades on them. Automated market-makers on the other hand incentivise those that commit to providing liquidity (as idle assets) with yield that comes as a result of trading fees and token rewards.
Jargon Explainers
In the context of exchange-related yield solutions, there are three primary projects to know about - Uniswap, Curve.fi and Balancer. Each of them has its incentive mechanisms as we will see shortly. But before we dive into that, there are two concepts to be aware of.
1. Liquidity Pool - Consider this the total of assets that have been provided to a platform like Uniswap to enable users to trade one asset to another. It is the combined balance of user-deposits from individuals looking to create yield. The larger the size of a liquidity pool, the more likely that it can absorb large trades in short periods. This matters as one of the key criticisms of decentralised finance today is the inability to exchange over $100,000 worth of a digital asset to another without what is referred to as slippage. Slippage can be described as the difference in the price you were hoping to receive and the one you actually paid for an asset while trading it.
2. Impermanent Loss - In providing digital assets to platforms like Uniswap, there is the risk that your asset is unable to trade back to its initial value and that means you take a loss by partaking in the liquidity pool. The reason for this is explained further below in the context of each platform. But here’s what you need to know for now. Impermanent loss emerges from a situation where traders have no incentive to take a trade - leading to those that provided an asset to a liquidity pool in hopes of generating a yield losing money. They are primarily the result of a situation where an asset trades at a discount on a decentralised platform in comparison to what it is being traded at on a centralised exchange. For more on the concept of liquidity pools, I suggest reading this article by Pintail.
3. Liquidity Mining - The act of providing assets to a market to receive rewards that may be denominated in the platform’s tokens. The individual providing the liquidity takes on the risk of the assets provided fluctuating in price but has the benefit of selling reward tokens for dollars and maximising yield. This was common in certain Asian exchanges in 2018. Sadly, since the immediate response of anyone receiving these reward tokens is to sell, the price trends downwards over time.
With those three in context - let’s look at how the prominent automated market-makers of the industry work and what incentives users have.
Uniswap
Uniswap runs on a simple equation that follows the model of x*y=k. Where K is a constant. In a hypothetical situation, consider a pool that has been seeded with 50 Ethereum and 10,000 USD and K to be constant at 10,000. Y here will be the price of the asset.
Assuming x is the supply of Ethereum (50), Y will be the price at which ETH is traded.
In this case that will be 10,0000/50 = 200 as we have k=10,000 as a constant. If someone comes and buys Ethereum, they will remove Ethereum (x) and add to the dollar amount in the pool.
Assume they purchased two Ethereum at 200. This will make the x value 48, and change the value of y. Since the value K here is a constant, the price of Ethereum will need to change for it to be the same. To calculate this - we consider 10,000 / 48 = $208 to be the new price.
Similarly, in the next trade, if someone decides on selling a huge amount of Ethereum, the supply of Ethereum in the pool will increase. Assume someone wishes to sell 7 Ethereum after a while. Total ETH on the pool will be 48 (from previous balance) + 7 = 55 ETH. Since x here is now 55, there will need to be a change in the value of y (price) to reflect the new supply and demand.
Since k is 10,000 , we divide it by 55 to receive the new price. In this case that would come to $181. The supply of dollars in the pool now would be 10,400- (7*181) = $9133
As you can see, an algorithmic approach to price discovery has its advantage in the sense that it can discover price without an order-book in the way a centralised exchange does. It also makes manipulation less likely as you cannot see the orders of other traders in these instances. The challenge here is that price swings wildly if the amount of ETH or dollars in a liquidity pool is not high enough. The high volatility is part of what makes Uniswap risky. More importantly, those providing liquidity to a pool can stand to lose their yield in a pool if a large order moves the price in one direction and new trades don’t replenish the pool. I suggest exploring this paper for more on arbitrage opportunities on Uniswap. The critical difference between Uniswap and Curve is that in the former, liquidity is split across a wide variety of assets which can often lead to pricing inefficiency. On Curve in contract, it is concentrated on a handful of assets that are primarily stablecoins at price-points that are within a few percentage points of $1. Tokens like UMA protocol have begun issuing directly on Uniswap as it allows the market to determine the price of an asset without the centralised exchanges getting involved for hefty fees.
Incentive Mechanisms in Uniswap: Uniswap charges a 0.3% fee on all trades that occur through the platform. When an individual redeems their pool tokens, they receive a part of the fees generated in proportion to the amount of the pool they seeded liquidity with. The challenge here is fees generated are entirely reliant on the number and size of trades that occur through the automated market-maker. If there is a shortage of trades occurring on the platform, there may be no incentive for individuals to provide liquidity to the platform itself.
Curve. fi
If you could remove the high volatility of assets on Uniswap and exchange solely between stable currencies, then you could stand to benefit from the fees while reducing the probability of impermanent losses. Curve.fi focuses specifically on this philosophy. Individuals can add liquidity in stable dollars, enable the trade of different pairs of USD (eg: DAI, USDT, USDC) and swap between them. Since they all trade more or less around $1, the losses that occur are lower due to impermanent losses are lower due to lower volatility. The ‘brilliance” here is on focusing on the stability of the asset and volume. Curve is routinely able to absorb volumes in the hundreds of thousands of dollars with relatively low slippages due to the large liquidity pools it has. More importantly, since the platform primarily focuses on stablecoins, it needs to give liquidity only around a few percentage points of $1 and concentrate much of its liquidity on dollar-denominated assets. As you can see, the bulk of the volume has come from stablecoins and more recently between different variants of wrapped Bitcoin.
www.curve.fi
You can read more about how Curve works in their whitepaper or this well-written FAQ . Kerman Kohli has a brief explanation of how Curve functions in the video shown below.
www.youtube.com
Incentive Mechanism in Curve: Curve has a 0.04% fees associated with each trade on it. This is distributed to those that provide tokens to offer liquidity on the platform. Unused tokens in Curve are also converted to cTokens (compound tokens) to receive yield from providing loans on the platform. This ensures users receive a base interest fee (from Compound) and an additional return from market-making that occurs on Curve itself. There have been mentions of a token launching, but the specifics are not released yet.
Balancer
Balancer is more interesting as it allows individuals to have a mix of tokens allocated to a pool. They describe themselves as an ETF turned on its head. Instead of paying traders a fee to manage a pool, Balancer makes it possible for individuals to earn on providing liquidity to a pool. In other words - they determine the amount and mix of assets they would like to hold and receive a fee for providing it to a pool. While the formula behind Balancer is slightly complicated to summarise in this piece, here’s how it differs fundamentally.
- Instead of just two assets, Balancer is able to take on a mix of assets. This means a portfolio that has been constructed by someone looking to hold can be absorbed by the system. According to their FAQ , the maximum of the mix is at eight as of now.
- Balancer allows custom pool balances. What this means is someone with a substantial amount of token “x” looking to provide liquidity in ETH, can make a pool that is balanced 80% in token x and 20% in ETH . Making it easier for altcoins to offer a liquidity mechanism without requiring a centralised exchange.
- Fees on Balancer can be set as per the liquidity provider’s provisioning. It ranges from 0.0001% to 10%.
The incentive mechanism that is at play in Balancer is the yield that comes from the trading pool. All of the fees that is set by the pool goes back to the liquidity providers on Balancer as of now. This means individuals inherently have a predisposition towards having higher fees since it is a variable that can be set by the pool. If a pool has a very high fee individuals have no incentive to trade on Balancer as centralised exchanges will have a better fee offering. Therefore lower fees are incentivised in terms of token rewards given. The entire specification of their liquidity mining can be read here .
cdn.substack.com
The traders on Balancer jumped over 20 times (~70 to 1400+) due to the token based incentives that kicked in. Balancer has over $40 million in volume so far.
Why is Balancer all over the news? : Apart from the fact that Balancer is one of the projects that have shown traction and gradually tokenised themselves, there is the fact that the first tranch of balancer rewards have just gone out. Of the 100 million Balancer tokens that will be in existence, 25 million are allocated to founders and investors. Balancer has raised $3 million at an initial price of $0.6 per token. As of writing this, it trades at $13. Roughly 7.5 million Balancer tokens will be released over a year. In the past week ~435k tokens were issued to those providing liquidity over the past 3 weeks. High token price for Balancer means individuals can benefit from the tokens they resceive as a reward (sold on the market) and the yield on the underlying assets they provide. As we saw with Compound, this will be interesting as long as the price of the reward assets stays high.
What could be the future of AMMs?
Automated market-makers have been perfected slowly over multiple years and the recent push to decentralise governance through tokens has pushed for new levels of interest in them. A common theme we are seeing is the gradual push to releasing a token and allowing the community to have governance of the project itself. This works as long as the returns of governance (eg: fees) themselves are worth more than the opportunity cost of not doing so. What does this mean? Currently being a LP on Balancer would make sense considering the risks involved because of the high price of the token today ($13). However, as it goes lower - if the volume on the platform itself does not surge high enough to create sufficient revenue from the fees, it won’t be long before liquidity providers lose interest. As of writing this, cumulative revenue on Balancer is at $140k on a total volume of $40 million so far. If that figure does not grow over time, incentivised liquidity providers may leave the platform. The counter-argument to this is that since incentivised reward on AMMs like Balancer is proportional to the share of the pool an individual is providing liquidity to, the rewards one receives increases as other liquidity providers leave. The higher amount in Balancer token rewards will justify LPs to stay.
For now, it is safe to say that the interest in the underlying token itself is what is driving interest. For more established platforms like Uniswap, the volume has reached a large enough number to justify continued interest. For context Uniswap alone had $169 million in volume over the last seven days. That is over $570,000 a week to be distributed in fees. Since the figure is relatively high, individuals will be interested in how the governance of the platform will function. In other words - decentralised projects like AMMs will need high amounts in revenue to be able to justify premiums for their governance tokens. I would argue that this is a better model than traditional venture capital as it ensures dead projects with no revenue to show don’t last around as zombies on private money infusion for years. The fluidity of capital in DeFi would mean large liquidity providers move capital around to platforms with the highest yield at all times.
I am excited for the innovation this space could bring. The idea that you can mix in a bunch of assets and have a market running for it with just code and formula could be used in a mix of ways. For one, personal tokens are already being traded on Balancer. In the future, I won’t be surprised to see tokenised intellectual property rights and income share agreements being listed on platforms like Balancer. They are fundamentally kicking out the middlemen that historically connected issuers to markets. Almost like how Wordpress made a publication as easy as a few clicks and took power away from newspapers. Will this be abused? Yes. People stand to lose money. However, as with most innovations that disrupt the middle-men, this may do more good than evil over time. I wait observing patiently for proof of the same.
Thank you very much for the information:
Joel John
Matteo Leibowitz
Daryl Lau
Kerman Kohli
Best regards EXCAVO