How to Borrow and Lend Crypto through AAVE?

Ioannis Tsiokos
StakeBaby
Published in
14 min readMar 27, 2024
How to Borrow and Lend Crypto through Aave? — introduction

This article is a tutorial on how to use the Aave Liquidity Protocol. To start, we need to visit the official website of Aave. Make sure you don’t go to a fake site and then you can go to the Launch App then proceed to Markets and it will take you to this page.

How to Borrow and Lend Crypto through Aave? — ethereum market

So a quick overview of how Aave works and all of the different markets here.

Aave is a lending and borrowing protocol that uses over collateralized loans.

That means that if you lend out your crypto to someone, they have to over collateralize what they’re borrowing from you. So if you’re lending $10,000.00 to somebody, they actually need to put around $12,000.00 to $1,300.00 of a crypto asset on the platform to back the loan that they’re taking over collateralized. That gives the protocol a buffer that is more than the loan in case the crypto asset falls in value or their loan gets liquidated, right? And so it’s a buffer to protect you as a lender.

Are you staking your Polygon tokens yet? Consider staking with StakeBaby! We’re active developers and contributors in Web3, and by staking with us, you’ll support our efforts to build awesome tools, smart contracts, and content. Plus, you’ll earn delicious rewards!

So when you’re lending to people, they have more than they’re borrowing from you on the platform in a crypto asset, which is usually Ethereum they use to collateralize the loan. If you’re borrowing dollars, for example, against your crypto, you’re going to have to put more Ethereum on the protocol and then borrow dollars a smaller amount, right? So you can borrow around 70 to 75 percent of the value of your collateral here. It’s over collateralized lending, which is a safety buffer for everyone involved.

How to Borrow and Lend Crypto through Aave? — aave market

Now, as you can see, there are different markets on Aave. These different markets are the different chains. Now, these are completely separate markets with their own supply and demand, which means interest rates are different amongst all of the different chains.

So we have to keep that in mind. If you are lending dollars out, for example, you can go and check these different chains. So the Polygon chain right now has 13.05% on dollars.

How to Borrow and Lend Crypto through Aave? — polygon market

If you’re lending it out, if you go over to something like the Ethereum chain, you’re getting 7.40%. And if you go to something like Optimism, Tether is getting about 11.77 % right now.

How to Borrow and Lend Crypto through Aave? — optimism market

So different chains and different supply APYs, as they’re called. If you’re supplying this asset, then that’s the interest rate that you’re getting to supply. And as you can see, different chains have different assets that you can supply as well.

By far, the most popular is Ethereum and a dollar, either USDT or USDC. You’re lending dollars to people that are paying or you’re using an asset like Ethereum to collateralize a loan in dollars.

Which Market or Blockchain Should You Use?

Well, that’s going to come down to a few different factors. The first one is the size of the market.

As you can see on Polygon, it’s 583.17 million in size. And of course, the yield that we’re getting on Polygon dollars are relatively high yielding, which is good for right now. And of course, the blockchain fees on a certain blockchain. So Polygon has cheaper fees because it’s a Layer-2 network.

How to Borrow and Lend Crypto through Aave? — polygon market size

If we go to Ethereum, the market size is much bigger, a whopping $11.73 billion. The yield on dollars is a little bit lower. And of course, you’re paying higher fees on Ethereum. So it’s up to your preference.

How to Borrow and Lend Crypto through Aave? — ethereum assets

Let’s look at the Base now. And as we can see, the market is smaller and the yield is 4.5% percent on dollars.

How to Borrow and Lend Crypto through Aave? — base market size

So what we’re going to do is connect our wallet and we’re going to connect a browser wallet.

I’m going to use Polygon Market as it’s a much cheaper chain and I have the tokens needed for this tutorial. Firstly, we’ll look at lending MATIC so we can go to the market and see the important details.

So in the Polygon Market, we can go to MATIC and we know that the supply APY if we’re lending out is 1.04 %. And if people are borrowing this, then they’re paying 2.98 %. For us lending 1.04 %, we can click into MATIC and see some details so we can see the available liquidity and the utilization rate of the amount that’s in this market.

How to Borrow and Lend Crypto through Aave? — wrapped matic

$68.45 million are supplied out of a total cap of $105 million that can be supplied. Now, this is a supply and demand APY.

That is why you’re not getting fixed income here. This is a variable APY and it depends on the supply and demand at any given time and it changes throughout the day. You can see that in this chart.

This is the supply APY that’s happening. You get these spikes during high demand where it can get very high and then it comes down again. The gray-dotted line is the average APY if you’re going to be lending over a longer period.

The average APY here is around 1.20 % which is good to lend out dollars in an over collateralized fashion.

The borrower here has to put more ETH on to borrow your dollars, which makes things safer. But of course, there are risks here because if there is a massive liquidation within crypto, the protocol may not be able to sell out their crypto in time in order to pay back what you’ve lent them.

Now, what happens on Aave as well, if you go to Stake, this is actually what they call the Safety Module.

How to Borrow and Lend Crypto through Aave? — safety module

People that stake the Aave token can get a yield from the protocol because it’s making profits. But what happens is if they are staking their Aave, they are essentially ensuring bad debts within the system.

And if one occurs, that Aave will be used and sold in order to pay back bad debts. And people can stake to earn a yield. But then they have that potential of slashing if there are any bad debts.

Lending Dollars

In order to lend out dollars, we need two assets in our wallet. Firstly, we need Ethereum to pay for gas on the Polygon network. And then, of course, we need the MATIC to lend out.

Since I have ETH and MATIC in my wallet, we can go ahead and use it.

Now that we have both of those tokens in our wallet, we can lend out the dollars and use the ETH to pay for the transactions.

So Aave recognizes now that I have $20 in my wallet.

How to Borrow and Lend Crypto through Aave? — wrapped matic

So now we can see both of the tokens here. So now what we can do is supply. So press Supply, click the amount of MATIC that you want to add in.

How to Borrow and Lend Crypto through Aave? — supply matic

And then as you can see here, it says Approve MATIC to continue. So what we’re going to have to do if you’ve not used a protocol before is approve this token and basically approve the protocol and give it permission to manipulate this asset within your wallet. So we’re going to press Approve, and this is just a signing transaction.

So we will put $5 here, and we’re letting the protocol manipulate what we have in our wallet, which is this much. So we’re going to press next, and then you can see the fee here is basically non-existent, but we’ll press Approve. It’s basically a signing transaction.

How to Borrow and Lend Crypto through Aave? — metamask approve

Now we have to wait for that. Once that’s gone through, then we can press supply MATIC that has been approved. So now we can press Supply MATIC.

So we’ll click that. And now we actually have to pay for this transaction. You can see the gas fee is one cent, so pretty cheap on Polygon.

So we’re going to press confirm, and then that should lend our MATIC into the protocol. Now from here, what’s going to happen is you lend your MATIC and you obviously need a receipt for what you’ve just done, right? So that is known as an aToken. You can see that here, add aToken to your wallet.

How to Borrow and Lend Crypto through Aave? — add to wallet

What we’ll be getting is AMATICX, and that’s a token in our wallet that is the receipt, it shows how much we have lent, but it’s also the thing that earns the rewards and the yield that we’re getting.

Note: If you press Add to wallet and for some reason and this isn’t working. What you have to do is visit CoinGecko and then search for it again.

How to Borrow and Lend Crypto through Aave? — coingecko

So if we go to cryptos up in the search bar, we need AMATICX and it’s the Aave v3 MaticX. Click on that and find the contract, we’re going to look at MATIC. So you will have to copy that and then go back to the protocol.

How to Borrow and Lend Crypto through Aave? — amaticx

You can see now that the tokens you lent are no longer in your wallet because you have already lent it out successfully. So import tokens, press that, and then that should be AMATICX. So we’ll click next Import.

How to Borrow and Lend Crypto through Aave? — import tokens

After that, you will see the balance of your AMATICX to your MetaMask and that will be the receipt token that you lend through Aave. That will be accruing interest as soon as we put it in.

And that will be actually going up in the amount because you’re lending and earning the 1.04 % yield. And MATIC, ETH, and AMATICX are the three tokens that we have in our wallet now.

From here, what we can do is go to our Dashboard and then we should be able to see what we’re doing on this market. So the Polygon market, you can see our net worth here and the net APY we’re getting, if you have multiple lending positions, it will show you your blended yield.

How to Borrow and Lend Crypto through Aave? — supply MATIC

And the APY for this is 1.04% and you can see all of that right here. You can also see in your wallet that you have connected assets that are available to supply. If you want to supply ETH as well, you can do that exactly the same and you’ll be getting a small interest on that as well if you want.

And that is how to lend out assets on Aave. If you want to know way more about lending or using DeFi.

Withdrawing your Lended Asset

But obviously we need to withdraw this, which we will also show you in this article. If you do want to withdraw, then press Withdraw.

You will be able to see that you actually accrued some interest already because it updates every second with the live interest that you’re earning. You will need to input the amount you want to withdraw and that will just go through with a blockchain transaction, and again, very cheap, press confirm, and that will withdraw the MATIC back into our wallet.

So what’s going to happen is that the AMATICX will go to zero and the MATIC will be back in our wallet and then we can send that out or do anything else. If you want to lend against your assets in Aave, you first have to supply them to the protocol that has ownership of them and then you can borrow against them.

How to Borrow and Lend Crypto through Aave? — isolated token

As you can see, isolated assets have low borrowing power, right? So if you supply Statis Eurs token, you may not borrow that much against it.

And that’s just another safety protocol here. What we’re going to do is supply some MATIC. So click MATIC.

How to Borrow and Lend Crypto through Aave? — supply matic

And as you can see, if I click MATIC here, it knows that my wallet has a balance. For this tutorial we are going to supply an amount. Let’s just do 5, which is around $5.00.

We are going to supply MATIC here and go through that with that transaction. And then from here, once it’s supplied, we can actually see how much we can borrow against it. We can now use this collateral that we have in Aave to borrow against.

Or if you want to use your collateral to borrow another token, you can also do that. If we go down to Tether, you will see that you can borrow an amount of Tether now based on your collateral that you have in MATIC.

How to Borrow and Lend Crypto through Aave? — borrow usdt

To proceed, press Borrow. Indicate how much you want to borrow.

So what you need to be aware of here is that the max loan to value is 75%. You can only borrow 75% worth of the value of your collateral that you put in the system.

And of course, if you get to an 80% threshold, that’s when you’ll get liquidated. So if the value of your collateral goes down in relation to your loan, then you’re going to get liquidated around 80% loan to value, and you get a liquidation penalty if that happens as well. So that’s up to you and to work that out yourself and how much you want to borrow.

But we’re going to say borrow will loan amount. And of course, we have to pay interest on this. And that goes second by second.

And we know that the yield that we have to pay or the amount that we have to pay to borrow is around 2.98 %, as you can see here. So we’re going to borrow a $2 Tether and the health factor is fine on this one.

That will go through with another transaction and check if you already have that reflected in your wallet. What we’re doing is using MATIC’s collateral to borrow Tether, and that will be reflected in our wallet.

How to Borrow and Lend Crypto through Aave? — health factor

After that, we can do anything we want with it. We can get liquidated on our loan if we want to.

If we think that that’s something that we don’t really care about, we can do that. Now we actually have USDT in our wallet.

Remember as well that we are paying interest on that. So we’re going to press Ok, Close.

And now we actually have a Borrow as well. If you go back into your dashboard at this point, which is up in the top left dashboard, you can see that our suppliers are earning. And then we have got some Borrows here as well.

This is the amount and this is the APY that I’m paying. From here, if you have suppliers, of course, you do have to pay back interest on them. You should have some tokens to be able to do that.

How to Borrow and Lend Crypto through Aave? — repay

And then from here, we’re going to press Repay and then we are just going to press Max. And as you can see, we do have to pay some interest and some interest has accrued on our loan that we’re borrowing at the moment.

So we are going to approve and then just pay that back and that’s how you borrow and lend cryptos through Aave. We are going to press Max and then pay back the amount that’s needed.

How to Borrow and Lend Crypto through Aave? — gas fees

It’s going to work out how much you should pay back. So when you do borrow, if you want to pay back a small amount, like a little bit of it or the whole loan, you do have to make sure that you are paying back the loan plus interest. You need that token again to pay for the interest.

Make sure that you have some USDT available to pay back what you loaned out plus the interest there. Otherwise, obviously you can’t pay back the whole loan and once that’s repaid, essentially you won’t have a Borrow anymore.

How to Borrow and Lend Crypto through Aave? — your borrows

And if you want to take out the collateral that you’re using, you can now do that after repaying. From here, if you want to withdraw your collateral, you can do that as well and just pressed Withdraw.

Wrapping Up

It’s quite the trip, isn’t it? From ensuring we’re on the legit Aave site to picking our chain of choice based on yield, size, and fees — it’s been a ride.

Remember when we talked about the security buffer with over-collateralized loans? That part’s crucial. It’s like having an extra airbag in your car; you hope you’ll never need it, but it’s comforting to know it’s there. Especially in a market that can go from sunshine to thunderstorm real quick.

Diving into the different markets was like exploring new cities, each with its own vibe and opportunities. Polygon, Ethereum, Optimism — they’re like the New York, Paris, and Tokyo of the crypto world. Choosing where to lend or borrow is part personal preference, part strategy.

And then there’s the actual process — connecting wallets, lending MATIC, getting that aToken receipt. It’s akin to depositing money in a bank but in a world where you’re the banker. The thrill of seeing your digital assets work for you, earning interest, is like watching your garden grow overnight.

Withdrawing your assets or paying back a loan? That’s as straightforward as closing a tab. A few clicks here and there, and you’re done. It’s empowering, really, to have so much control at your fingertips.

But let’s not forget the safety nets — staking Aave for the Safety Module, the insurance against the rainy days. It’s a community effort, making sure everyone stays afloat even when the seas get rough.

So, whether you’re lending out dollars or borrowing against your MATIC stash, remember: Aave is a tool, and you’re the craftsman. Use it wisely, stay informed, and always keep an eye on the horizon. The crypto world is ever-changing, and knowledge is your best compass.

Before you dive back in, take a moment to review what you’ve learned. Refreshing your understanding every now and then keeps you sharp and ready for whatever comes next in the crypto universe.

That’s all for now.

Support our dedication to web3 and enjoy tasty rewards by staking with StakeBaby.

--

--

Ioannis Tsiokos
StakeBaby

I have nothing to say that’s nearly as cool as I am, except maybe… wow, I am dad!