Automatic market maker(AMM) is one of the key components of the decentralized exchange(DEX) platform. Traditional exchanges and centralized digital exchanges rely on the order book to facilitate trading between buyers and sellers. In contrast, DEX employs an AMM algorithm that allows automated trading using a mathematical formula that determines the price of the tokens in a liquidity pool. In fact, AMM is a smart contract that is embedded in the liquidity pool of a decentralized exchange ecosystem.
Different DeFi protocols use different formulas in their AMM algorithms. Uniswap uses the formula x*y=k, where x is the amount of token X and y is the amount of token Y in the liquidity pool, and k is a constant. The equation implies that x and y will move inversely proportional to each other on a hyperbolic curve.
Let us examine the following example:
Assuming Uniswap has a pool comprising the ETH/USDT pair. Let say at a particular time the pool has 10000 ETH and the price of ETH was 1500 USDT, hence the total value of ETH was 15,000,000 USDT. As the ratio is 50:50, the total amount of USDT should be 15,000,000.
Based on the formula x*y=k, k=10000*15,000,000=150,000,000,000
Next, assuming now the amount of ETH has reduced to 8000, using the above equation;
the amount of USDT should increase to 150,000,000,000/000=18,750,000
Uniswap is the first truly decentralized AMM as it allows anyone to create a liquidity pool. Besides that, it allows anyone to provide liquidity to an existing pool
Another popular DEX that employs AMM is Kyber Swap. However, it is not truly decentralized as it does not allow anyone to create a liquidity pool or provide liquidity to a pool. Kyber swap liquidity pools are deployed by professional market makers.
Other popular DEX that employed AMM are Balancer, Curve, Sushiswap and more.
In this article, I shall discuss the types of DeFi products and services available in the crypto markets. Popular DeFi products include decentralized exchanges, loan and savings markets, tokenized physical assets such as gold, derivatives, forecasting/betting markets, payment, insurance, asset management, and more.
The complete list of DeFi products are as shown in the following Figure.
DeFi loan and savings markets allow you to lend, borrow, or deposit money in a platform. Among the popular loan and savings platforms are Compound, Aave, MakerDAO, Fulcrum, dYdX, and more. If you lend out your digital assets by depositing them in a liquidity pool, you will earn interest over a period. On the other hand, you can borrow a digital asset by giving another digital asset as a collateral. The collateral is usually ETH but can be other cryptoassets. The debt has an accruing interest which is to be paid off along with the principal.
Decentralized exchanges or DEXs are like stock exchanges but run by smart contracts on the Ethereum blockchain. While both allow you to trade assets, decentralized exchanges only trade cryptoassets and do not require centralized authorities to manage the trading. They run on autopilot 24/7. Therefore, it offers fantastic opportunity to anyone in the world to have access to invest in digital assets, particularly the unbanked and underserved.
In a nutshell, DeFi products allows you to use your digital assets to secure a loan and use that loan to invest in some other digital assets that you expect to gain higher returns. You may also leverage on your collateral to secure more loans to purchase more assets with the expectation that the value of the assets will appreciate, not unlike real estate investment. Besides, you can lend your assets in a lending and borrowing market to earn more attractive interest than banks.
In addition, you may contribute your assets to liquidity pools in the DeFi money market to earn rewards. If your risk appetite is high, you may trade with margin in many different types of Decentralized exchanges. You can even expose yourself to higher risk by leveraging. The list goes on, so do not miss the opportunities!
DeFi and Yield Farming have been the most popular buzzwords among the crypto community in recent months. Some DeFi tokens can skyrocket to more than 10K USD in just a few days but drop back to near zero also in a matter of days! Besides that, people in the crypto community are talking about yield farming instead of mining nowadays, most of you might scratch your head and wonder what the heck is that? Skeptics might challenge that DeFi is merely hype, but the total value of digital assets locked in the DeFi platforms has reached an astounding $10 billion(as seen in the figure below), thus it has created huge DeFi economics(Should I call it DeFiconomics?).
To help you understand DeFi and Yield Farming, I shall try my best to explain these two concepts in a nutshell.
What is DeFi?
The word DeFi stands for decentralized finance, which means operating financial applications on a decentralized platform such as blockchain. It is the new financial architecture that leverages decentralized networks and decentralized technologies such as smart contracts to transform old financial products into trustless and transparent protocols that run without intermediaries. DeFi has a popular nickname ‘Money Lego’ because of the process of DeFi development like building legos where different components of a system can easily connect and interoperate.
DeFi has unique features compared to CenFi (Centralised finance) and claimed to be able to provide more convenient and seamless services, particularly for the underserved people. Here are some of the features:
P2P- Transactions are performed on peer to peer basis without the need for intermediaries
No need KYC- Anyone can open an account with a DeFi platform anytime and easily without going through the tedious and painful process of KYC
No one holds your digital assets- DeFi platforms are non-custodian in nature which means they do not hold your private keys, you have full control of your own digital assets.
Popular DeFi products include decentralized exchanges, loan and savings markets, tokenized physical assets such as gold, derivatives, forecasting/betting markets, payment networks, insurance and more.
Loan and Savings Markets
DeFi loan and savings markets allow you to lend, borrow, or deposit money in a platform. Among the popular loan and savings platforms are Compound, Aave, MakerDAO, Dharma, dYdX, and more.
Compound is a protocol on the Ethereum blockchain that creates a money market, which is a group of assets with algorithmically earned interest rates, based on supply and demand for those assets. The asset provider (and borrower) interacts directly with the protocol, earning (and paying) floating interest rates, without having to negotiate conditions such as maturity, interest rates, or collateral with peers or business partners.
MakerDAO is a smart contract that allows users to open Protected Debt Positions, or CDP (Collateralized Debt Positions). Users deposit ETH as collateral and can mint or borrow tokens called DAI. DAI is a stablecoin linked to the US dollar.
Borrowers pay an annual interest rate called the stability fee to mint a new DAI. After the debt is repaid, the DAI is burned along with the stability fee owed in the MKR Maker token. Stability charges prevent users from overspending the amount of DAI supply in excess.
Aave is a decentralized non-custodial money market protocol in which users can participate as depositors(lenders) or borrowers. Depositors provide liquidity to the market to earn passive income, while borrowers can borrow in an overcollateralized or undercollateralized manner.
Dharma is an open-source lending and savings account built on Compound which is characterized by its ease of use and simplicity. Dharma features a Smart Wallet is a non-custodial that automatically lends out any DAI or USDC it receives on Compound and generates a variable interest rate. Dharma requires users to have a fully verified Coinbase Account in order to create a new account.
dYdX is a non-custodial trading platform on Ethereum that caters to more experienced traders. The dYdX platform allows users to lend, borrow, or margin trade any supported asset like ETH, Dai, USDC, and more. Interest rates vary by asset and adjust with supply and demand. Interest continuously accrues and is paid to lenders, minus 5% which is set aside for dYdX’s insurance fund.
All borrowed funds must initially be collateralized with 125% of their value. Liquidation occurs if that ratio falls below 115% and comes with a 5% penalty. Traders can take leveraged long positions of up to 5x their collateral’s value and 4x for shorts. Loans and margin trades can remain open for a max of 28 days, after which they are automatically closed out with a 1% expiration fee.
Decentralized exchanges or DEX are like stock exchanges but run by smart contracts on the Ethereum blockchain. While both allow you to trade assets, decentralized exchanges only trade cryptocurrencies and do not require centralized authorities to operate. Some of the popular exchanges are Uniswap, SushiSwap, Bancor, Kyber, Balancer, and more.
Uniswap is a decentralized ERC-20 token exchange that supports Ethereum and ERC20 tokens. The advantage of Uniswap is that you can exchange ETH with other ERC-20 tokens in a decentralized way. No companies involved, no KYC, and no intermediaries.
The Uniswap platform is unique in that it does not use an order book to derive the price of an asset or to match buyers and sellers of tokens. Instead, Uniswap uses the Liquidity Pool which comprises a group of tokens managed by smart contracts. The liquidity pool ensures enough tokens for users to exchange with each other using Ethereum as a channel.
Bancor is a protocol on Ethereum for non-custodial token exchange using pooled liquidity. Bancor does not use order books, Instead, it uses an algorithmic market-making mechanism through the use of Smart Tokens. This will ensure liquidity and accurate prices by maintaining a fixed ratio among connected tokens and adjusting their own supply.
The Bancor platform has expanded beyond Ethereum to offer an exchange with EOS and POA Network. It also features a native token known as BNT( Bancor Network Token), which serves as a Smart Token hub that connects all other tokens in the Bancor Network, enabling instant trades among any asset supported by Bancor.
Kyber Network is an on-chain liquidity protocol that allows the token holders to contribute liquidity known as reserves. The Kyber Network offers multiple types of reserves that exist in smart contracts. Besides that, Kyber does not use order books; when a user initiates a trade, Kyber returns the best price across all reserves.
The Kyber Network can be integrated into dApps to enhance user experience. In addition, Vendors and wallets can also use the Kyber Network to allow users to transact using their token of choice in a single transaction. Moreover, Kyber has a native token called KNC which is used to align ecosystem incentives. Holders can stake KNC to participate in governance and earn rewards, reserve managers pay fees and receive rebates in KNC, and DApp integrators receive a portion of fees.
Balancer is an automated market-maker built on Ethereum. It allows anyone to create or add liquidity to customizable pools and earn trading fees. Instead of the traditional AMM model, Balancer’s formula allows any number of tokens in any weights or trading fees.
In fact, Balancer is like an inverse of ETF: instead of paying fees to portfolio managers to rebalance your portfolio, you collect fees from traders, who continuously rebalance your portfolio by following arbitrage opportunities. Balancer protocol is designed to be composable and has three types of pools:
1) Private Pools where only the owner can contribute liquidity and has full permissions over the pool, being able to update any of its parameters.
2) Shared Pools where the pool’s tokens, weights, and fees are permanently set and the pool creator has no special privileges. Anyone may add liquidity to shared pools and ownership of the pool’s liquidity is tracked with a specific token called BPT – Balancer Pool Token.
3) Smart Pools which are a variation of a private pool where the controller is a smart contract, allowing for any arbitrary logic/restrictions on how pool parameters can be changed. Smart pools may also accept liquidity from anyone and issue BPTs to track ownership.
Yield farming is an activity that uses crypto assets to generate as much return as possible on those assets. A yield farmer may continually chase which pool offers the best APY (Annual Percentage Yield). This may mean moving to risky pools from time to time, but yield farmers can deal with the risks.
In some sense, yield farming is similar to staking but is a lot more complex. In many cases, it works with users called liquidity providers (LP) that add funds to liquidity pools. For example, a yielding farmer puts 100,000 USDT into the Compound. In return, he or she will get a token for the stock, called cUSDT.
Let’s say he or she get 100,000 cUSDT back. He or she can then put the cUSDT into a liquidity pool that uses cUSDT in Balancer, an AMM (auto market maker) that allows users to set up a crypto index fund that is rebalancing. At normal times, this can earn a small amount of transaction fees. This is the basic idea of yield farming. Users are looking for sophisticated cases in the system to produce as many results as possible in as many products as possible.
What is a liquidity pool? It’s basically a smart contract that contains funds. In return for providing liquidity to the pool, LPs get a reward. That reward may come from fees generated by the underlying DeFi platform, or some other source.
Some popular Yield Farming platforms are SushiSwap, Yearn Finance, and YAM Finance.
SushiSwap is an automated market making (AMM) decentralized exchange (DEX) currently on the Ethereum blockchain. Unlike other protocols, SushiSwap is a community-run project that is governed by the vote of the community. There are a few core products for SushiSwap’s ecosystem:
Each of these serve a different purpose within the ecosystem. Users Earn SUSHI tokens by staking SushiSwap V2 SLP Tokens.
yearn.finance is a decentralized ecosystem of aggregators that utilize lending platforms such as Aave, Compound, Dydx, and Fulcrum to optimize your token lending. When you deposit your tokens into yearn.finance, they are converted to yTokens. yTokens are periodically rebalanced to choose the most profitable lending services.
Among the aggregators, Curve.fi is the most prominent integrator of yTokens. Curve.fi creates an AMM between yDAI, yUSDC, yUSDT, yTUSD that not only earns the lending fees but also the trading fees on Curve.fi. On the other hand, YFI, yearn.finance’s governance token, is distributed only to users who provide liquidity with certain yTokens. With no pre-mine, pre-sale, or allocation to the team, YFI is claimed to be the most decentralized token in the DeFi space.
YAM Protocol is a decentralized cryptocurrency that uses a rebasing mechanism to raise funds for a treasury managed by the community. The community can then use those funds via YAM governance to build the protocol.
In addition, YAM is the governance token for the YAM protocol. Using token voting, YAM holders have direct influence over the YAM treasury and direction of the protocol. Governance discussions take place on the Yam Governance Forum.
Currently, you’re able to earn YAM rewards by providing liquidity to the yUSD/YAM Uniswap pool. The rewards given to the pool are 92,500 in week 1, decreasing by 10% every week after. Please realize that you must apply the YAM scaling factor to get the current reward amount at any given time.
In short, DeFi is the most exciting blockchain-based financial ecosystem right now, but it is also extremely risky and confusing. This article is just an introduction to DeFi and I hope you could understand the basic concepts. To help everyone understand the DeFi applications better and even use them to accumulate wealth in digital assets, I will attempt to write a series of article of DeFi that shall zoom into some famous DeFi platforms like Compound, UniSwap, SushiSwap, yearn finance, Balancer and more, stay tune!
DeFi stands for decentralized finance, which means operating financial applications on a decentralized platform such as blockchain. It is the new financial architecture that leverages decentralized networks and decentralized technologies such as smart contracts to transform old financial products into trustless and transparent protocols that run without intermediaries.
In contrast, centralized finance means a single organization such as a bank controls and manages the funds of the clients. This kind of centralized control has many weaknesses, including the abuse of funds and manipulation of personal data, frauds, single point of failure due to hacking, and more.
Decentralized finance has many advantages as it’s aligned with the characteristics that blockchain technology possesses.
The Advantages of DeFi
Maintain Full Control of your own digital Assets
The digital assets that you own on a DeFi platform solely belong to you alone and you have the freedom to use it in whatever ways you like, without the interference of an intermediary. There is no centralized authority, such as a bank, with the ability to freeze your account, seize your assets, or block your transactions.
According to the World Bank, globally there are still approximately 1.7 billion unbanked adults. These people are at a disadvantage when it comes to pursuing many financial opportunities that could improve their socioeconomic status and lift them out of poverty.
Unfortunately, centralized financial institutions don’t have an incentive to target this population. The revenue they would receive from providing services to the currently unbanked simply doesn’t justify the costs of reaching them. In contrast, DeFi providers operate without expensive intermediaries hence they are more willing to serve the underprivileged people. Furthermore, DeFi is borderless and ‘permissionless’ hence everyone on earth particularly the unbanked population can access this form of affordable financial services. Therefore, DeFi has the potential to reduce the world’s poverty.
Opportunity to own a portion of an expensive asset
Another DeFi application is tokenized assets. Tokenizing assets is creating digital tokens to represent the ownership of real assets that can be traded like securities such as shares. By creating tokenized assets that represent, say, a portion of a real estate investment, you open up the investment for people who previously couldn’t afford it, to having access from anywhere in the world. Almost anyone can trade tokenized assets as he or she is not required to commit to an entire high-value investment at once. Instead, he or she has the option to buy or sell just a portion of the asset.
DeFi data is publicly available, enabling you to keep service providers honest. For instance, you can easily check the reserves of a DeFi bank, shop around for accurate loan rates, or even track the transactions of public figures.
Let’s examine a well known use case of DeFi, the Maker DAO
MakerDAO is an open-source project on the Ethereum blockchain and a Decentralized Autonomous Organization created in 2014. The project is managed by people around the world who hold its governance token, MKR.
MakerDAO is a decentralized credit platform on Ethereum that supports Dai, a decentralized, unbiased, collateral backed stablecoin whose value is pegged to USD. The Maker Protocol which is known as Multi collateral Dai (MSD) allows users to mint Dai by leveraging collateral assets approved by the Maker Governance. Maker Governance is a community organized and operated process of managing various digital assets of the Maker Protocol.
The Maker Protocol is one of the largest dApps on the Ethereum blockchain. It was the first DeFi application to gain significant adoption among the crypto communities. Since the release of Single Collateral Dai in 2017, user adoption of this stablecoin has increased dramatically. Indeed, It has become a driving force in the DeFi movement. The Maker Protocol is designed by a diverse group of individuals that include developers, external partners, other persons, and entities. It is managed and governed by people who hold the governance token MKR through a system of scientific governance involving executing voting and governance polling.
Anyone can use the Maker Protocol to open a Collateralized Debt Position (CDP), lock ETH as collateral, and generate Dai as a debt against that collateral. Dai debt incurs a stability fee (i.e., continuously accruing interest), which is paid (in MKR) upon repayment of borrowed Dai.
The MKR is burned, along with the repaid Dai. Users can borrow Dai up to 66% of their collateral value (150% collateralization ratio). CDPs that fall below that rate are subject to a 13% penalty and liquidation (by anyone) to bring the CDP out of default. Liquidated collateral is sold on an open market at a 3% discount.
Holders of Maker’s other token (MKR) govern the system by voting on, e.g., risk parameters such as the stability fee level. MKR holders also act as the last line of defense in case of a black swan event. If the systemwide collateral value falls too low too fast, MKR is minted and sold on the open market to raise more collateral, diluting MKR holders.
I shall discuss more DeFi use cases in coming articles.