Christmas break is a great time to catch up with the backlog of interesting things to learn and read about. I used some of this time to finish the amazing DeFi quest by Cristian Strat. This is a continuation to the first part of this series, where I document my first steps in the world of Decentralized Finance. If you have not read the first write-up, please do. Otherwise, this text will be very confusing and not too useful for you. But once you go through both blog posts, I guarantee that you will have a DeFi knowledge superior to the majority of the folks out there.

This adventure will be more like a short pause from more in-depth topics. I will quickly present some of the best DeFi dashboards out there. A DeFi dashboard is a central place, where you can view your assets, track your crypto wealth, participation in liquidity pools, DEX trades, fees, owned NFTS, etc. Since blockchain transactions are available for everyone to browse, it is possible to aggregate data of an address and serve it to a user. Still, it seems that only a few services have done it right, offering a great user experience and clarity.

DeFi Pulse(https://defipulse.com) is a site where you can find the latest analytics and rankings of DeFi protocols
Dune Analytics (https://dune.xyz) can be used to query, extract, and visualize vast amounts of data on the blockchain.
Zerion dashboard (https://app.zerion.io/) showing the address owned by Vitalik Buterin...
...same address, but now we are using (my favourite) Zapper dashboard (https://zapper.fi).

This adventure is about dipping our toes into lending and borrowing on DeFi platforms. We will switch from Arbitrum to another popular Layer-2 protocol called Polygon. On a high level, it is very similar to Arbitrum, but obviously, the devil is in the detail. While the Abitrum chain is directly secured by the Ethereum base layer, Polygon is secured by its PoS consensus mechanism and therefore “issues” its own token - MATIC. Polygon trumps Arbitrum when it comes to withdrawal time. While it can take a week to transfer your tokens from Arbitrum back to the Ethereum chain, withdrawals on Polygon take just three hours.

Polygon Token Swap service - easiest way to obtain MATIC in 2022.
Faucets are interesting, but the "drops" are not useful anymore.

To operate on the Polygon chain you need a MATIC token to pay gas fees. Nowadays, it is not straightforward to obtain MATIC. There exist several “MATIC faucets” - services, that infrequently give out for free tiny amounts (like water drips) of MATIC, so that a user can start paying fees on Polygon without deliberately buying any MATIC in advance. The Polygon fees have increased so currently the “drops” from the faucet are too tiny to cover even a single transaction (previously, a faucet would give you enough MATIC for about a dozen transactions). After trying some alternative ways to quickly and cheaply obtain some MATIC, I can conclude that the best way is to use a brand new Polygon Token Swap service. Simple, quick, and supports a plethora of tokens!

Now, having some MATIC tokens to cover our gas fees, we jump right in into lending and borrowing on the DeFi platform - Aave. We can use the example of Aave, to study DeFi lending platforms in more depth.

### QnA: Lending/Borrowing on Aave

I think it is safe to say that borrowing and lending money has been the cornerstone of the financial system, dating back to the origins of currencies and trade. Nowadays, most of us are also involved in lending (when we put our money in the savings account) or borrowing (taking a loan to pay off the house or paying the university tuition). Arguably the party which benefits the most is the banks. You can rarely hear somebody being happy with the interest rates on their savings account (which sometimes can be even negative) or with the conditions of their loan. But you can often hear that working in a bank is a good career path if one optimizes for a high salary and attractive bonuses. So DeFi offers the possibility to lend and borrow crypto without a middle man while ensuring trust between parties (using the blockchain and the logic of a smart contract).

Aave's dashboard shows the current lending and borrowing data.

Aave, which means a ghost in Finnish, is a popular protocol to earn interest on deposits and borrow assets. I currently have about $50 worth of USDT (also known as Tether), which I would like to lend to somebody else to profit from the interest. A simple strategy to maximize my returns would be to deposit the asset which has the highest Annual Percentage Yield (APY). It is so convenient that USDT, at the current point, offers the highest APY on the Polygon chain of 8.51%. Additionally, Aave encourages users to use their service on the Polygon so they pay incentive fees in wrapped MATIC cryptocurrency. Why wrapped MATIC and not a standard one? Still not sure, my best guess is it may be easier for smart contracts to work with wrapped coins for some reason. So depositing my$50 USDT should pay me:

• APY of 8.51% in the original cryptocurrency: $4.26 worth of USDT • …plus APR of 4.08% of my deposit in the wMATIC cryptocurrency:$2.04 worth of WMATIC (around 1 WMATIC)

Getting about $6 out of$50 sounds fabulous, but there is a catch. The yield on deposit and the Aave reward are dynamic. This abnormally high APY on USDT will probably very soon go down. So I guess if one wants to optimize for the highest possible yield, a good idea is to ignore daily fluctuations in APY, keep track of the monthly averages, and actively manage your portfolio.

APR fluctuations of of USDT.

#### Q: What is the difference between APY and APR

Answer: Simply put, APR does not take into account compounded interest, while APY does. Imagine you deposit $1000 in a bank that pays 10% interest per year. The bank also agrees to pay the dividend on the monthly basis, which is automatically reinvested (similarly to an accumulating ETF). Your APR will be simply 10%. But your APY will be higher, because of the compound interest. • In the first month the bank is going to pay you $$1000 \times \frac{10\%}{12} = 8.33$$. So now you have$1008.33.

##### Reason number 2.

If you sell crypto you have to pay capital gains but if you get a loan, there are no taxes because there’s no gain.

If you want to buy a house, you would probably not sell your crypto to finance it. You’d rather borrow fiat money (e.g. on https://nexo.io/) against your crypto to buy the house. Not selling means not paying capital gains. This is a strategy well-known to many affluent people (source):

When [Elon Musk] wants cash, he can simply borrow money by putting up—or pledging—some of his Tesla shares as collateral for lines of credit, instead of selling shares and paying capital gains taxes. These pledged shares serve as an evergreen credit facility, giving Musk access to cash when he needs it.

To summarise, seemingly large interest rates on DeFi platforms are pretty benign, given the benefits: fast access to cash, historical crypto bull-run, and capital gains tax avoidance. While I am sure that the majority of debtors are arbitrage traders, it is also a useful tool for retail borrowers or even companies. For almost a year citizens and businesses of the Swiss canton of Zug could pay taxes using Bitcoin. I am dying to find out what kind of tax optimization strategies have been born out of this!

We are almost done with our Quest. This last adventure consists of three smaller parts, where I would quickly explain three concepts: DAI stablecoin, Compound platform, and alternatives for Uniswap.

### DAI SideQuest

DAI is another popular stable coin - representation of the US dollar value in the crypto world. What makes DAI unique is how truly decentralized this token is. Many popular stable coins like USDC or USDT are tied to some form of external governance. As I mentioned in my last post, USDC is controlled by the Centre consortium, which, if required, could call a blacklist function on an address, essentially freezing all USDC coins on it. Some speculate that USDT, as explained before, has significant potential for crypto-disaster in the future, partially due to the lack of trust towards Tether Limited.

DAI, on the other hand, is fully decentralized. It is quite remarkable, given that it is not backed by the US dollar but other cryptocurrencies. While one can obtain DAI in a standard way (swaps on DEX), the fundamental way to “procure” the stablecoin is through the MakerDAO - a Decentralized Autonomous Organization (DAO), which allows the users to borrow (mint) DAI against their crypto.

To mint DAI one has to deposit collateral (e.g. in ETH or WBTC) with MakerDAO. Once the collateral has been deposited in the Maker, a certain amount of DAI is minted and sent to the user. While there is a minimum required (over-)collateralization ratio (150%), the users are often happy to deposit more collateral than required. Why should the users do it? Well, the incentive comes from the previously explained principle: Taking a loan against an appreciating asset is better than selling it. To get some paper dollars, you’d rather take a loan against your BTC than sell your BTC. And loan in a stable currency may be desirable for many reasons, especially interacting with the TradFi.

The stability of the DAI is purely market-based. DAI maintains its target price and low volatility by modifying the incentives for borrowing and holding DAI:

• If the price of DAI in the secondary marker falls below $1, the users will buy DAI in the secondary market and pay back their debt in MarkerDAO. The returned DAI is then burned, so the supply of DAI decreases, and the price of DAI goes up. • If the price of DAI in the secondary market increases above$1, the users will mint DAI in MarkerDAO and sell it on the secondary market. This would increase the overall supply of DAI, and the price of DAI goes down.

### Compound SideQuest

Compound is a borrowing platform very similar to Aave. However, Compound currently has less significance in the DeFi space than its younger sibling. This is due to its slower pace of innovation and business expansion, as well as several events, which have undermined the platform’s credibility. Not so long ago, because of manipulated information supplied by an oracle (apparently, the platform was using a single oracle to fetch the pricing data, not the most fault-tolerant design), many users ($100 million worth of assets) have been unexpectedly liquidated. Not to mention another blunder, when due to the unfortunate update some users started to receive millions of dollars in COMP tokens. Since it’s all on a blockchain, you may directly take a look at the accidental transfer of$30 million worth of comp tokens to some address.

Compound's faulty interface to the price oracle fits into a single tweet.

### UniSwap SideQuest

While UniSwap is certainly the most popular DEX (more than a quarter of all swaps are done on UniSwap), there are many competitors out there. While the platforms are fundamentally very similar, it’s the differences that make them unique and preferred by various types of users.

• 1inch is a DEX aggregator, so if you want to do a swap, it looks at all the available popular DEXes to give you the best possible price.
• Balancer is an AMM protocol that expands the usage of liquidity pools. It allows for setting up multi-asset pools with up to eight tokens in one pool. This is essentially creating your own, custom index fund. Anyone can now create their self-balancing (through the arbitrage activities of other traders) index fund or invest in someone else’s. I find this idea very interesting, will spend more time soon looking into the Balancer platform.
• Curve Finance is an AMM as well, focused on exchanging for stablecoins. It tries to make swapping stablecoins as functional as possible - traders get extremely low slippage, and liquidity providers enjoy little-to-no impermanent loss.

## Summary

This concludes my DeFi Adventure. I have to say, that now, having spent several weeks learning the basics of the DeFi, I am extremely curious about the details and nuances of the invention. I am frequently mesmerized by the ingenuity and “zero-to-one” thinking of some of the creators in this space. Finally, I also have to admit that the whole idea of being independent of the legacy financial system is very appealing for me. However, the DeFi world still has teething troubles, so it is wise to tread carefully. I do not remember where I heard this quote, but it seems like a fitting, humorous conclusion of this series:

When a user steals from a bank - it is called a crime.

When a bank steals from a user- it is called finance.

When a user steals from a user - it is called DeFi.