DeFi 101: DEXs, Yield Farming, Liquidity Providing, and More. | by Dimitrios Gourtzilidis | Sep, 2022

Stablecoins were created as a solution to the volatility problem that crypto had from its inception. They are called stable because they are pegged to other assets such as the US dollar, gold, Euro, etc. The most notable projects are Tether (USDT), USD Coin (USDC), and Dai (DAI).

More information on stablecoins can be found in “The Most Interesting Stablecoins on the Market.”

After stablecoins, we need to define what a wallet is. Metamask, probably the most popular browser extension wallet for the Ethereum blockchain, creates wallets by providing the seed phrase and the public address to its user and can access Dapps and manage digital tokens.

Non-custodial wallets provide users with both private and public keys and also hand over the storing and safekeeping responsibility to them.

Custodial wallets provide only the public keys to their user and the private keys are stored and secured by a third party who holds their responsibility.

In order for external data to enter into a blockchain, it needs a specialized application that is called “Oracle”. The most notable project on the Ethereum blockchain is Chainlink.

The first thing that Dapps need is a blockchain to run on. Ethereum was the first blockchain that provided a place for Dapps to run on. This would be called the “Settlement Layer” on a DeFi stack.

The image has been taken from https://coincript.com/

On top of a blockchain, on the “Asset Layer”, we find the various tokens that exist on the blockchain. Ethereum, through its ERC-20 protocol, provides a template for every other project to create additional tokens on it.

The third layer is called the “Protocol Layer”. Protocols like Maker, AAVE, and Compound can be found there.

Applications like Uniswap can be found on the “Application Layer” which is located on the fourth layer of the stack and include DEXs like Uniswap, etc.

Last but not least, the “Aggregation Layer” is the last layer of the stack.

One of the first DeFi pioneers was MakerDAO. It was created in 2015 and released its first white paper in 2017. MakerDAO uses Ether as collateral in order to produce the stablecoin DAI which is soft pegged to the US dollar.

Total Value Locked (TVL) is an indicator that communicates the value locked inside a protocol, and together with their market capitalization, it gives us a rough estimate of their success. A detail that we cannot check from these two indicators is which tokens do create the TVL value. DeFi Pulse thankfully includes this information on their page (https://www.defipulse.com/).

Loan to Value (LTV) communicates the amount as a percentage of collateral that is been given out as a loan. Higher LTV means a higher possibility of collateral not being able to cover the outstanding loans. Popular collaterals include Ether, Tether, and Dai.

The image has been taken from https://www.defipulse.com/

Lending platforms use pools, from which borrowers can then borrow, in which each token is being saved. In return, one receives tokens, “a tokens” in the case of AAVE and “c tokens” in the case of Compound, as receipts that can later be used to redeem the initial loan. An important note here is that the loan is always less than the collateral (overcollateralized).

At extremes, when the collateral is not sufficient, liquidation takes place. Tokens are converted until the negative balance is zero, including any liquidation fees.

When the price of the collateral falls significantly, then might be needed additional funds to be added to the protocol for the loan.

AAVE’s “a tokens” are equal in value to their original token deposit (1 aETH = 1 ETH), but in advance, they receive interest in the form of the original token, to a designated by the user wallet.

Other notable protocols include: Maker, Compound, Alchemix

Yield Farming

The basic foundation of borrowing is that money lent earns interest for the lender. Yield farming is the process in which lenders would move their funds in various interest-producing protocols in order to maximize their earnings.

The image has been taken from https://blog.yearn.finance/

The return of each protocol is measured in “Annualized Percentage Yield” (APY), and this measurement is been used for their comparison. Of course, the higher the yield the better the investment. APY takes also compounding of the interest into account. On the contrary, the “Annualized Percentage Rate” (APR) doesn’t.

Yearn Finance was the first yield aggregating protocol that automated the yield farming process.

Decentralized Exchanges function as what we would today call a legacy exchange system, with the difference that all processes are been taken care of by a smart contract instead of a central authority.

The “Liquidity Based” DEXs use pools, which represent various crypto token pairs, deposited from various users who, as described above, will earn interest on their deposits. A DEX user, when he or she wants to exchange a token for another, puts one token into the pool and received the other in exchange.

If there is no trading pair available between two tokens, an “Automated Market Maker” (AMM) like Uniswap will run the transaction between various pools until it the conversion is facilitated.

The transactions are facilitated by calculating the “Constant Product/Price Formula”. Pools with high reserves in one token and fewer reserves in the other token raise their fees in order to incentivize users to bring the equilibrium back to normal. In recent years, other methods have also been created to replace this process.

The Constant Product/Price Formula
The image has been taken from https://cryptologos.cc/

Order Book Based DEXs like Loopring, match exchange requests through both DEXs and CEXs, and by taking external data through Oracle systems like Chainlink.

One major difference between the two types of DEXs is that Liquidity Based DEXs do not use Oracles, and thus they do not take into account the price of each token.

Other notable projects here are: 1inch, PancakeSwap, and Balancer

Liquidity Providing

Liquidity mining/providing is been used to incentivize token holders to move their funds into a certain DeFi project and thus improve its available liquidity.

Since a pool constitutes a crypto pair, the liquidity provider needs to provide both tokens to the pool, based on their current rate.

The rewards earned come from trading fees when other users swap the tokens provided and are proportional to the percentage of the whole liquidity. If for example, one has provided 10% of a pool’s liquidity, he or she is eligible to get the 10% of the rewards.

Impermanent Loss (IL) is simply the opportunity cost of providing liquidity to a pool versus holding it in a wallet.

If a token pair is provided to a pool at a certain ratio, but after two days, as an example, its ratio has been doubled, then the initial liquidity provider has lost since the withdrawal would be at a different level.

Through Synthetix, synthetic asset issuance is possible, which represents the price of another asset on a 1-to-1 ratio, from Sydney, Australia. As an example, “sNIKKEI” follows the price of the famous Japanese index through a collateralized crypto debt manner. Another interesting feature of the Synthetix protocol is that it enables the creation of inverse synthetic assets like “iBTC” which tracks the inverted price of BTC. These assets called called “synths”.

Synths derive their price from Oracles like Chainlink and can be traded in the Synthetix exchange or any other DEX.

The image has been taken from https://synthetix.io/

Synthetix offers also some index synths, as a basket of crypto tokens. The tokens included in the index had been selected through Twitter member polls.

Synthetix’s SNX tokens are ERC-20 tokens built on the Ethereum blockchain, and are been used are collateral for the synthetic assets. Since the SNX token is very volatile, a greater collateral percentage is necessary.

Other notable projects here are DyDx (Margin/Leveraged Trading). DyDx allows margin trading by automatically borrowing funds from lenders on the platform.

One of the most popular insurance protocols out there is “Nexus Mutual”. It is built on the Ethereum blockchain, and it targets to cover losses against smart contract failures and exchange hacks (deposit protection).

The image has been taken from https://nexusmutual.io/

As the name suggests, Nexus Mutual is a mutual that belongs to its policyholders, which pass through a KYC process and receive NXM tokens to represent their rights. Its profits are been retained in the mutual, stored in decentralized pools, or is been distributed to its policyholders as dividends.

The possible payouts are been decided by vote through its community members.

Since nothing is perfect, DeFi is also far from it. Smart contracts are software programs that, like all other software applications, can have bugs that will break them, or can be hacked.

Despite that, it can be very lucrative for a portfolio that takes advantage of all that the DeFi space has to offer.

This news is republished from another source. You can check the original article here

Be the first to comment

Leave a Reply

Your email address will not be published.


*