Lending & Borrowing on Polygon with AAVE

Chapter 26:

Previous: Introduction to DEFI lending and borrowing

Next: Introduction to DEXs 

The native token for paying gas on Polygon, as we learned in chapter 8, is the MATIC token. The Polygon network used to be called Matic, but it rebranded to Polygon in February 2021. My research found that Binance was the cheapest withdrawal at 0.1 MATIC tokens per withdrawal. However, I decided to use another exchange, so I will pay the slightly more expensive 1 MATIC withdrawal fee to explore the exchanges more.

In this section, we will also use the USDC stablecoin on the Polygon chain, and I will buy $10 of MATIC and $11 of USDC. I am getting $11 of USDC because that will leave me around $10 after the $1 withdrawal fee. So I will pay for the MATIC tokens and the USDC with some USDT, which I have in my account.

As with most of the tutorials in this book, it is more capital efficient to use more significant amounts in DeFi. For example, the withdrawal costs of USDC on Kucoin are $1. This is a hefty percentage, but raising the amount to $100 would reduce the fee to approximately 1%. And as we will see in the following few chapters, we will get away from these exchanges and begin to use the decentralized exchanges directly from our self-custody wallets.

Buying MATIC and USDC

Login to Kucoin or your preferred exchange, and we will step through buying some MATIC and USDC tokens.

  1. Click on the Markets tab, and search for the MATIC token and the quote currency you will use to buy the MATIC tokens. I also have a few KCS tokens to pay the trading fees and get a discount.
  2. On the MATIC/USDT trading screen, enter your trading password in the bottom right to unlock the buying and selling UI. The unlock section of the UI is shown in the following image. You will have chosen a trading password when you sign up for a Kucoin account.

Unlock Kucoin buying and selling UI

  • Make sure you are on the Spot tab, select the Market option, and enter 10 into the Amount field. This will buy $10 of the MATIC token at the current market price. Verify that you have entered the correct settings. This is what my trading UI looks like.

Buy 10 USD of MATIC

  • When you have verified the details, click the Buy MATIC button.
  • Repeat this tutorial and buy some USDC.
  • Before withdrawing these funds, we must decide which wallet we will use. In the next tutorial, we will install, set up, and configure Metamask.

Installing Metamask

To withdraw our USDC and MATIC tokens to the Polygon network, this tutorial will use the Metamask browser extension wallet. You can also use Trust, Coinbase, and Enjin wallets for mobile, Wallet Connect or Torus in your web browser, and more to connect to the AAVE protocol.

To install the Metamask wallet visit https://metamask.io/. In this tutorial, I will use the Opera Crypto browser to install Metamask. The Opera Crypto browser is a version of the regular Opera Browser with a built-in wallet and other neat crypto features. Note that we will not be using the Opera browser wallet. Instead, we will be installing and using the Metamask browser wallet in the Opera crypto browser. I am only using the Opera Crypto browser because it is worth investigating. I already have Metamask installed in my other browsers, so it’s convenient for me, and I wanted to vary the tools used in this book as much as possible, so it’s hopefully helpful to you. The following instructions will quickly translate into any Web browser of your choice.

  1. On the Metamask.io website, click the DOWNLOAD button.
  2. Click the Download for Chrome button (even on Brave and Opera)
  3. Click the Add to Opera button (or whatever your browser is), then click the Add Extension in the pop-up message. You will soon see the Welcome to Metamask screen, as shown next.

Welcome to Metamask

  • Click the Get Started button, choose No Thanks to opt out of sharing data, and then click Create a Wallet.
  • Enter and confirm a password as requested, read and click the Terms of use checkbox, and click Create. Next, you can read and watch a video about the importance of your secret phrase.
  • When you are ready, click Next.
  • Click, CLICK HERE TO REVEAL SECRET PHRASE, securely back up your mnemonic seed phrase, and click Next. Note that you are given the option to choose to Remind Later. This is not advised.
  • Next, re-enter your seed phrase to confirm you have recorded it correctly and click Confirm. Finally, you will see the Congratulations screen.
  • Click All done to see your new Metamask wallet. The following image shows the wallet after creation. I have resized the browser window to make the image more compact. You might agree that the Opera Crypto browser looks neat with wallet and portfolio options on the left, but I have digressed; back to Metamask.

Metamask after wallet creation

  • You will notice a few things if you explore the Metamask UI. Firstly, ETH is the only token mentioned. Next, in the top-right of the Metamask UI, it says Ethereum Mainnet. We want something else. We will be withdrawing to the Polygon network, and if we choose Polygon on the exchange withdrawal and use the Ethereum address in Metamask, our funds will not appear. So we need to switch Metamask to the Polygon network.
  • Click the Ethereum Mainnet drop-down and then click Add Network. This is shown in the following image.

Click Ethereum Mainnet and add the network

  • Observe the following image to see what you need to enter.

Add Polygon network to Metamask.

Network namePolygon Mainnet
New RPC URLhttps://polygon-rpc.com
Chain ID137
Currency SymbolMATIC
Block explorer URLhttps://polygonscan.com
  1. After you have confirmed the details are correct, click the Save button. You will get a pop-up message explaining that you have switched to the Polygon network and that the native token is MATIC. Click the Got it button. We are ready to use Polygon.

Ready to use Polygon with Metamask

  • We now have a wallet on the Polygon chain, and we can see that we have zero MATIC. We can now receive other assets on the Polygon chain, but if we are to see and interact with them, we must let Metamask know about them. To be clear, we can send assets on Polygon, they will arrive and be stored safely on the blockchain, but we need to tell Metamask to scan for them and show them in the wallet UI. It would not be lost if you skipped this step and sent yourself some USDC – Metamask just wouldn’t let you interact with it because it won’t “know” about it until you have completed this step. Let’s add the USDC token, as we will withdraw some in the next step. Click on the Import tokens link in Metamask.
  • Don’t worry about filling out the form; look at the next image and click the link saying you can also enable token detection in your settings.

Metamask token detection in your settings link

  •  Click the Enhanced Token Detection switch to the switched-on position as shown next.

Metamask-enhanced token detection is on

  • They will be recognized when we send USDC and MATIC to our Metamask wallet. Now, we are ready to use Polygon.

It is worth explaining all those values we entered for the Polygon chain. The network name is self-explanatory, the CHAIN ID identifies the polygon chain to the software, and the RPC URL is the Internet address where a willing node on the Polygon network will interact with our wallet, publish our transactions to the blockchain, and show us our assets. Finally, the Block explorer URL is the Web address of our preferred block explorer. From time-to-time Metamask will offer us the option of viewing a transaction on a node explorer; it will default to this URL.

  • Now we can withdraw our funds from the exchange.

Withdrawing USDC and MATIC from Kucoin

Make sure you are logged in to Kucoin or your exchange of choice.

  1. Click the Withdraw Link, which on Kucoin is available from any of your account screens, Main, Trading, etc. The Kucoin Withdraw Crypto screen is shown next.

Kucoin withdrawal screen

  • On Kucoin, the Coin field has defaulted to USDC. If this hasn’t happened for you, click on the Coin field and search for USDC.
  • In Metamask, ensure you are on the Polygon Mainnet network and click on the address to copy it to the clipboard. The following image shows these two details.

Metamask Polygon address

  • Pate the address into the Address field in the Kucoin withdrawal form.
  • In the Kucoin withdrawal form, click on the Network field and select MATIC Polygon (Matic). As USDC is available on lots of chains, there are many options. Selecting any other option than MATIC Polygon (Matic) may result in a permanent loss of funds.
  • In the Amount field, choose a sensible amount. If you are withdrawing a small amount like I am, you might like to select all for capital efficiency. If you are transferring a more significant amount, you should make a trial withdrawal of a small amount first. I have entered 10 USDC. The 1 USDC fee will be taken from my remaining balance. This slightly differs from how it worked on Binance when we withdrew ADA. This next image shows the withdrawal form after it has been completed. Remember your address will be different from mine. Do not copy mine.

Completed USDC withdrawal form on Kucoin

  • Check and recheck the details, especially the address and network in both Kucoin and Metamask.
  • When you are confident all the details are correct, click the Withdraw button.
  • You must do multiple verification steps that vary from one exchange to the other. For example, I needed to enter my trading password, a code sent to my email, and a Google Authenticator code.
  • Check that the funds arrive in your Metamask wallet. You must click the Refresh list link in Metamask to display the USDC tokens. Or you might see a link that states 1 new token found in this account. You can click either.

New token found in Metamask

  • Click Import All to add the USDC token to Metamask.
  • Repeat these steps to withdraw your MATIC tokens. Changing USDC to MATIC in the Coin field of the withdrawal form. Also, you will not need to import the MATIC token, as Metamask already knows about it.

In this next image, you can see I have some USDC and MATIC ready to lend on AAVE, earn some interest and pay my Polygon gas fees.

MATIC and USDC ready to lend on AAVE

We are now prepared to explore AAVE.

Connecting to AAVE

To get started on AAVE, visit https://aave.com and click the LAUNCH APP button in the top-right corner. You will be greeted with a pop-up message, as shown next.


  • This pop-up informs us that AAVE does not reside on a web servers infrastructure like AWS, Azure, or Digital Ocean. When a website exists on one of these or any other regular service, it is more vulnerable to censorship. A government, activist group, or media pressure can easily cause the removal of a website.
  • This has happened often because these big companies with their global infrastructure are vulnerable to these pressures, or more commonly, hold the same views and react even before they are pushed. As the pop-up suggests, AAVE is hosted on IPFS or the Interplanetary File System, a decentralized way of storing and serving web content. To be clear, in the AAVE protocol, the smart contracts that will control and interact with our tokens are on the blockchain, in this case, Polygon. Still, the web user interface that initiates interactions between our wallet and the smart contracts is stored on IPFS.
  • When your browser is connected to IPFS, you might see an indicator icon in the address bar like this:

IPFS indicator icon

  • Click the Agree button on the pop-up, and you will see the home page of the AAVE dApp. For example, in the following image, you can see we are on the Ethereum version of the website, have no assets, and are being prompted to connect our wallet.

AAVE Ethereum connect wallet

  • Follow these instructions to begin interacting with AAVE.
  • Identify the drop-down arrow that is currently set to Ethereum.
  • Before we connect, we want to change the network from Ethereum to Polygon. Click the drop-down arrow next to Ethereum and select Polygon. Notice when you click the drop-down how many different blockchains AAVE supports. Over the course of this book, we will see many dApps and blockchains. You might find yourself preferring some or even just one over others. The purpose of this tutorial is not to tell you to use Polygon or AAVE but to introduce them to you so you can make your own choices as you progress.
  • If you decided to use the Opera Crypto Browser as I did, there is a quick extra step. You will need to choose Metamask in preference to the built-in wallet. At first, this extra step seems like a pain, but when you have multiple browser plugins installed, it is a handy feature to choose which one is currently active specifically. In the top-left of the address bar, click the wallet icon and select the Metamask option. This step is shown in the next image.

Choose Metamask over Opera wallet

  • Click the Connect Wallet button on AAVE, choose Browser wallet, and Metamask will open and ask you to enter your password – unless you already entered it previously. When Metamask is unlocked, you will see the following options in your Metamask wallet.

Connect Metamask to AAVE

  • In the preceding image, AAVE wants to connect with Metamask. We can see that Metamask is asking us to choose which Metamask account we would like to use. This Metamask only has one account, Account 1, with 10.8021 MATIC tokens available. Select the account and click Next. You will see the following warning.

Metamask connection warning

  • Metamask informs us of the privileges AAVE needs to continue. Specifically, AAVE needs to see wallet addresses, balances, and previous activity. AAVE also wants to be able to suggest further transactions. If you trust AAVE, these are reasonable privileges. Always read the messages when interacting because a scam website can take all your funds if you give too many privileges. When you are satisfied, click the Connect button.

I searched for AAVE using the Duck Duck Go search engine when writing this tutorial. The genuine AAVE website was the second result. The first was an advert for an AAVE imposter site. So always check your URLs and read the Metamask permissions.

Congratulations, you are connected to AAVE.

Like most websites, AAVE is reactive and will appear differently depending on the screen size you are viewing it on. For example, if you are on a large desktop monitor, you will see the Your Supplies and Your Borrows columns side by side. However, if you are on a phone, the two columns will be made into tabs that you can click to reveal one column at a time.

You can access the main areas of AAVE using the tabs in the top left of the browser window, shown next.

AAVE tabs

This page is the Dashboard. You can click between the main AAVE options at the top of the browser window. They are Dashboard, Markets, Stake, and Governance.

Once you have lent and borrowed, the Dashboard tab will summarize your activity. As you can see in the following image, we have MATIC and USDC available but have yet to deploy any funds. Therefore, the right-hand column is just a summary version of the Markets tab.

AAVE dashboard unused

The Stake option lets you commit/stake any AAVE tokens in your wallet and earn a yield. But don’t rush into this. It is not the same as staking your ADA. AAVE lets token holders earn more by taking on the risks of protocol failure. This means some of your AAVE tokens could be sold to reimburse regular protocol users who lost tokens due to unforeseen events. If you have total confidence in AAVE, this is free money.

I remember first seeing a DeFi lending and borrowing app, AAVE. It was mind-blowing that you could interact with a website, independent of any financial institution, and earn, lend, and borrow tokens. I am a big admirer of the AAVE project, and I find it nothing short of amazing what they are doing. However, I don’t know enough to want to stake. If you’re going to stake, I suggest you read every scrap of information you can find before you do – and then buy some AAVE tokens. This next image shows the Stake tab.

AAVE stake

The Governance tab allows you to vote on proposals to change and improve AAVE. The more AAVE tokens you hold and the more AAVE you have staked, the more your voting power.

AAVE governance

The Markets tab contains a complete list of all the tokens you can lend and all the tokens you can borrow once you have provided collateral, which we will do next. It also has more details about each asset than on the Dashboard tab.

AAVE markets

We have tokens in our wallet, connected to AAVE, and had a quick guided tour. Finally, it is time to lend some money and earn some yield.

Lending on AAVE

This is so easy that it barely warrants a tutorial, but it is worth considering exactly what is going on below the pretty user interface of the AAVE website.

When we interact with the AAVE website in the coming steps, we will interact with the smart contract computer code running on the Polygon blockchain. It is easy to forget this, especially if you have been using regular websites for years, as most of us have.  When we complete the following steps, our USDC in an amount that we specify will be removed from our wallet address on the blockchain, added to a wallet address on the blockchain controlled by the AAVE smart contracts, and offered up to users who wish to borrow it – for an interest charge and secured with collateral.

  1. On the AAVE website’s Dashboard page, locate the USDC token in the Assets to supply column. Note that you could search for the USDC token on the Markets page and click on Details as an alternative way to do the same thing.
  2. Observe in the following image that I have $10 in the USDC token and that if I supply it on AAVE, I will earn 1.26%. Note that the rate fluctuates with supply and demand. Right now, the entire crypto market is significantly depressed, and the rate is low. However, note that at the time of writing, an instant access savings account with a regular bank in the UK is paying 0.25%, and a fixed rate UK government bond is paying 0.9%, even though the best variable rate (without a fee) mortgage I can find is charging 6%. So 1.26% is quite good, and when, ok if, the crypto market picks up again, the rate for USDC will improve significantly.

USDC on Polygon

  • Click on the Supply button for the USDC token as shown in the preceding image, and then you will see the Supply USDC pop-up form shown next.

Supply USDC form

  • Enter the amount of USDC you want to supply in the Amount field and observe the small gas pump icon followed by the value $0.06. This is the gas fee it will cost to make this transaction. Note also that the gas fee is paid in MATIC, not USDC, so the estimate means – 0.06 cents worth of your MATIC tokens. This amount will likely differ when you do it, as gas fees depend on dynamic factors. Check and make sure you are happy with the fees you are being charged.
  • When you are ready, click the Approve to continue button. Your Metamask wallet will appear with the following details.

Metamask approve USDC

  • In the Metamask window, AAVE asks for access to your USDC. The cost of the transaction to allow access is approximately $0.01 a cent. Your costs might be different, be sure to check. If you are happy with the fee and the permission you grant to AAVE, click the Confirm button. You will need to wait a few seconds, and then you will be able to see the next stage of the transaction, shown in this next image.

Metamask Supply USDC transaction

  • This is the final step, so make sure you are happy with the details, click Supply USDC, and we will review and approve the final details in Metamask.

You might notice in the images that my supply APY has increased from 1.26% to 1.27%. I must book that Lamborghini test drive. To be more serious, this demonstrates how dynamic the market is and that you must keep checking.

  • Observe in the following image that we are authorizing the supply from our wallet.  We can see an estimated and maximum gas fee quoted in MATIC. When you are content, click the Confirm button. If you don’t want to proceed, you can click Reject.

Metamask final USDC supply details

  • Observe the following: You will see a Metamask transaction confirmation icon (shown right) and an AAVE; add an aToken to your wallet to track… pop-up message (shown left). An aToken is a token representing your supplied USDC. You will need these aTokens when you come to redeem your USDC tokens. We will see these in our wallet shortly.

Metamask confirms and adds aToken.

  • Click Add to wallet to add the aTokens in Metamask, confirm the aToken addition in Metamask, close the pop-up window, and we are done.

Congratulations, you are now earning interest on USDC on AAVE, and to prove it, you can open Metamask and see your list of balances. This next image shows mine right after I completed this tutorial.

Metamask balance after tutorial

You can also click on the Activity tab in Metamask to see a summary of everything we have done. This is shown in the next image on the left. In the next image on the right, we can see the intimate detail of the Supply transaction. You can click on any transaction to see the detail.

Activity tab in Metamask

As a quick aside, we have established that the interest rate on the USDC was quite good considering the world’s state at the time of writing.

Now observe your Dashboard screen, and you can see that we have a net worth across AAVE of $10, and our net APY is 1.26%. Also, notice that on the USDC line, we can see we have $10, etc., but also a Withdraw button should we want or need our USDC back. Perhaps most interestingly, there is a green switch (indicating on) under the Collateral column. We can use that 10 USDC supply to borrow from the AAVE markets. This next image shows what we have just discussed.

Collateral switched on, net worth $10

Furthermore, notice that in our Metamask wallet, we can see that we now have our aUSDC tokens. The “a” stands for AAVE. As mentioned, the aUSDC tokens represent the USDC we have lent/supplied on the AAVE platform. We could also put our aUSDC tokens to work, but the more you leverage your assets, the more risk you take. Using and reusing assets is known as rehypothecation, and you might remember from chapter 2 that it was a significant cause of the global financial crash in 2008.

In defense of crypto, however, I argue that even if we lever up further, lend our aUSDC, and borrow against it, this is different/better than the credit default swaps of 2008 and their worthless insurance products in two crucial ways; it is transparent and fully backed by collateral. Anybody can take the time to see what they are getting involved in. The risks are more compartmentalized than in the US subprime property market and the entire global banking system in 2008 – or today.

Liquidations are when a loan goes wrong, and the lending platform takes a user’s collateral. We will talk about liquidations shortly and how to avoid them. You can view the details of all liquidations on Defi Llama here: https://defillama.com/liquidations/eth.

We could also lend out our MATIC tokens, but we need at least some to pay the gas fees for more transactions on Polygon. Once you are done exploring Polygon, you might like to supply them for a yield, but we have quite a bit more to do in this chapter and the next. In chapter 20, when we explore yield farming, we will take on more risk and further rehypothecate our assets.

Let’s do some borrowing using our supplied USDC as collateral.

Why Borrow

We need to consider what we want to borrow and why. There are many reasons to borrow, and here are two of them.

Reason to borrow 1

You hold MATIC as an investment, you don’t want to sell it because you think it will appreciate, but you need some cash in your regular bank account. Instead, you could lend your MATIC, borrow a stablecoin, cash into your native currency, and withdraw to your standard bank account. Then, if MATIC appreciated, your debt would be denominated in the stablecoin, and when you repay your loan, you can take full advantage of the increased value of MATIC. Let’s look at a mathematical example:

  • MATIC is worth $1 each, you deposit 100 MATIC, and you borrow 50 USDC, which you cash out to your bank account. I will explain why we might only borrow half the value of the collateral shortly.
  • You owe 50 USDC regardless of what happens to the MATIC price.
  • If MATIC increases to $2 each, you have collateral worth $200, but you only need to repay the 50 USDC plus interest to redeem them.
  • If the price appreciation of MATIC is greater than the interest rate to borrow USDC, then you win. Even if you only break even, you still borrowed 50 dollars for free.

However, these outcomes are quite different and entirely negative if the MATIC token depreciates.

In the following scenario, you will see why you might want to borrow less than the maximum value of your collateral:

  • MATIC is worth $1 each; you deposit 100 MATIC and borrow 90 USDC, which you cash into your bank account.
  • You owe 90 USDC regardless of what happens to the MATIC price.
  • If MATIC decreases to 50 cents each, you have collateral worth $50, but you borrowed 90 USDC. Oops!
  • When the value of your collateral gets near to the value of your loan, the AAVE smart contracts will liquidate your collateral. Two points are worth being clear about here. First, liquidate means it is gone, taken, and never to be returned! You can’t ring customer service and complain that the instructions weren’t clear enough or some stupid author never explained it adequately. Second, when I say the value of your collateral gets near to the value of your loan, I mean just above it, not below. If the value of your collateral is deemed insufficient, AAVE will take your collateral, probably automatically sell it, and cancel the loan. You’ll be all square with the AAVE smart contracts, but your MATIC will be gone! Remember, code is the law.

The following tutorial will show us how to properly plan for and avoid liquidations when we borrow some tokens. It is essential that you understand the worst-case scenario of liquidation.

Perhaps surprisingly, there are times you might want a token to depreciate, and even more surprising, you can even make money when this happens. So let’s explore this possibility.

Reason to borrow 2

Another scenario is that you expect a token to depreciate. Suppose you are confident that Bitcoin will depreciate against the US dollar. You could deposit a US dollar stablecoin as collateral and borrow Bitcoin. Your debt is now denominated in Bitcoin. Next, immediately, sell all the Bitcoin for a stablecoin, cash out to your bank, and wait. Assuming you were correct and Bitcoin halved in value, you could buy back the same amount of bitcoin for half the US dollars, perhaps from Binance or some other exchange, and retrieve your original stablecoin collateral by depositing the Bitcoin back on AAVE. Let’s look at the math of this:

  • Deposit 100 USDC to AAVE and borrow 0.001 BTC assuming BTC is worth $50,000 and you use 50 USDC of your collateral limit.
  • Sell the BTC on an exchange for 50 dollars.
  • Come back to the exchange sometime later when BTC is worth 25,000 dollars and buy 0.001 BTC for 25 dollars.
  • Deposit 0.001 BTC plus some interest into AAVE and redeem your 100 USDC. You now have 100 USDC in your wallet and 25 USDC on the exchange where you rebought the Bitcoin.

I have omitted the interest calculation and gas fees to simplify the explanation. The point is that you have made money by borrowing the depreciating asset. This is called shorting or going short. In chapter 18, we will introduce derivatives that allow you to add leverage to your short and long positions. Leverage allows you more exposure to the price of an asset than the amount of money in your wallet. Long is when you bet on the price of an asset going up. There are significant risks to leverage trading, and we will discuss the risks at the same time.

The best reason to borrow usually involves a strategy. And as we are still only partway through the book, we haven’t been able to discuss many strategies other than the simple ones above. But we will see new approaches in every chapter for the remainder of the book until we eventually discuss yield farming starting in chapter 20 and begin to combine some of the things we are learning.

What is wETH?

In the next tutorial, we will borrow some wETH tokens. The wETH token is a wrapped version of the ETH token. Wrapped ETH means it has been bridged from Ethereum to Polygon. Bridging a token was covered in chapter 8, but as a quick refresher, for every one wETH, an equivalent ETH is stored in the smart contracts of the bridge protocol between Polygon and Ethereum blockchains. wETH is interchangeable with ETH. However, there will usually be a small discount on wETH compared to ETH because of the smart contract risk associated with redeeming wETH to ETH. Sometimes wETH is referred to in all uppercase WETH. For the rest of this tutorial, we can think of wETH or WETH as ETH on Polygon.

Borrowing on AAVE

If not there, visit app.aave.com, connect with your Metamask wallet, and ensure you are connected to the Polygon blockchain.

  1. Go to the Dashboard tab on AAVE. Notice in the following image that the Available column in the Assets to borrow table shows how much you can borrow of a given asset. Furthermore, you can see the variable APY and the stable APY for any given token. If you take the stable APY, it is guaranteed not to change, but it is much higher than the variable. So, for example, if you were taking a very long-term loan and needed certainty, you would take the stable APY.

Assets to borrow table

  • If you click the Details button, you can glean all the lending and borrowing data about a token, as shown in the following image about the wETH token.

wETH supply details

wETH borrow details

  • In the preceding images, the Max LTV or loan to value is 80%. This is the maximum amount you can borrow relative to the value of your collateral. Notice the Liquidation threshold. This is the minimum level of collateral before the AAVE smart contracts liquidate your collateral and write off the debt. Notice that the liquidation penalty is 5%. This is how much you will lose in addition to covering the cost of the outstanding loan.
  • Choose which asset to borrow. I plan to use some wETH, which I will tell you all about in the following few chapters when we discuss decentralized exchanges.
  • Let’s go ahead and borrow some wETH or whatever you have decided. You can click on the wETH Borrow button from multiple places, the Dashboard page, Markets page, or scroll up to the top of the Details page we have just been viewing. The effect is the same. This next image shows the Borrow button on the top right of the Details page, next to the supply info, in the Your info box.

Borrow wETH

  • Remember, the maximum we can borrow is up to 80% of our collateral, and my collateral is $10. So, I could borrow $8 worth of wETH. But also recall that the liquidation threshold is 82.5%, so if my borrowed wETH became worth more than $8.25, my position would be liquidated by the AAVE protocol. So, I am going to borrow $4 worth of wETH. If the price of wETH doubled, I would be in trouble. As I follow the markets, because they’re great fun to watch, I will look for an Ethereum price of around $2600. This price is possible, especially in the current volatile period, but I am betting that it won’t happen soon. I think it will likely go sideways or down for a while. Therefore, hopefully, I can deploy my wETH on a DEX for a few months in the next chapter. Consider how much you want to borrow, then proceed.

A portfolio tracker like Nansen or Zerion, as discussed in chapter 10, could help monitor positions on AAVE.

  • After consideration, I selected $4 worth of wETH to borrow by trial and error, adjusting the amount of wETH. You can see this in the next image.

Borrow $4 wETH

  • Metamask will open, showing the details of the transaction. Check that the details are correct and acceptable. This is shown in the following image.

Confirm borrow wETH Metamask

  • Click the Confirm button and wait a few seconds. Next, you are prompted to add the wETH token to Metamask.

Add wETH to Metamask

  • Click Add to wallet. Metamask will open and ask about importing the wETH token, as shown next.

Confirm add wETH to Metamask.

  • Click Add token in Metamask, and Metamask will now know to track your wETH token holdings. You can close the pop-up box by clicking OK, Close, and we are done borrowing tokens for now.

As mentioned, when we obtained aUSDC, when we supplied some USDC, we don’t just have to hold our wrapped ETH passively. We can do things with it, including simply lending it. We would need to look at the interest rates we were receiving on our initial collateral and wETH and compare it to the interest rate we are paying to borrow our wETH. If we were borrowing for price exposure, I.e., just waiting for the price to go up, the extra cost of borrowing versus lending might be OK. The lending rate is lower than the borrowing rate because that is how supply and demand work. But the more significant consideration would be our increased exposure to liquidations. As a result, we will hold off putting our borrowed assets to work until the next chapter, when we will attempt to gain a yield greater than the borrowing rate.

  • We can observe the changes if you navigate to the AAVE Dashboard page. Here is an image showing my AAVE dashboard.

AAVE dashboard after borrowing wETH

In the preceding image, I have a net worth of $6. This is calculated by subtracting the $4 I have used as collateral. This is calculated by subtracting all my borrows from my supplies. We can also see that my Net APY is 1.13%. This is calculated as the effect of combining my supply and borrow APYs and the dollar value ratio. Next, we can see the Health factor. If you click the Health factor: Risk details button, we can see lots of interesting data, as shown next.

AAVE risk factors

In the preceding image, you can see my health factor is 2.12. This is the AAVE metric of how safe my collateral is. So even though my collateral is more than double the value of my borrowing, AAVE suggests that my health factor is OK at best. Not red but nowhere near green either.

Near the bottom of this pop-up is the Current LTV. This loan-to-value is calculated by dividing my borrowing by my supply in US dollar values. We can see that I have borrowed 40% of my collateral, and a neat visual representation shows that when that percentage reaches 85%, my collateral will be liquidated.

Look in Metamask and see the new wETH tokens you borrowed.

wETH tokens now in Metamask

Congratulations, you have lent some assets to earn interest and borrowed some assets, in my case wETH.


I could sell that wETH, hope it depreciates so I can repurchase it, and then repay my loan for a profit. But, of course, I don’t know that it will go down. If I sell it and it goes up, I will have to lose money buying back the wETH to reclaim my collateral. A surer way to put my wETH to work would be helpful. Let’s explore decentralized exchanges or DEXs.

Previous: Introduction to DEFI lending and borrowing

Next: Introduction to DEXs