Ethereum essentials: How to borrow, lend and measure risk
Part 3 of the Ethereum essential series: Lend, borrow, and borrow again on AAVE and Arbitrum. We explore how to turn $100 of eth into $200 of exposure in a responsible YOLO-minimized guide
Dear frontrunners,
Our journey to wealth in crypto is measured in knowledge (learning) and conviction (doing). Conviction without knowledge is arrogance (YOLO) and knowledge without conviction is insecurity: think of all the people who are smarter than you but have not realized their full potential. Is this you? Why does this happen?
In this guide, we’re going to go deep on borrow/lending and leverage in Ethereum. How it works, what it looks like at the transaction level, and how to do it, while analyzing the risks, outcomes, and impact of every trade. Specifically, we turn ~$100 USD or .07 eth into ~$200 USD or ~ .156 eth as outlined in image 1 below. $100 is enough money to force you to pay attention but not too much to keep you up at night. At the conclusion of this guide, you will have a fundamental understanding of how lending and leverage work, and clear insight into the mind of a degen.
Moreover, the amounts are small enough for you to follow along without getting rekted while also providing a deep understanding borrow/lending mechanics and associated fees.
We’ll be using Aave since its user-facing platform draws parallels to the traditional finance borrow/lending paradigm. DeFi-specific concepts like the liquidity pools, farms, safety modules, and balancer pools will be covered in a separate, but an equally important guide.
Remember, our goal as frontrunners is to have high knowledge and high conviction. We do this by rejecting participation inequality, we do this through hands-on experience in the defi ecosystem.
This guide is part 3 of the Frontrun Ethereum-essentials handbook:
Guide 2 - layer 2 roll-ups and corresponding fees
Guide 3 - Leverage 101: Lend, borrow and borrow again 👈👈 you are here
📚 This guide will cover
How to lend ETH on Aave
How to borrow ETH against the collateralized ETH
How to lend back the borrowed ETH
How to repeat this process 4x for a 2x exposed position
A speed run on how debt and collateral tokens are minted and burned
🧰 Tools you will need
A spreadsheet - I use google sheets
Aave - A borrow/lending platform on Ethereum
Arbitrum - Our layer 2 of choice for this guide
Arbiscan - blockchain explorer to assess fees and contract interaction on Arbitrum
A web wallet like metamask
✔️Checkpoint
By now, you’ve built foundational knowledge on transaction fees, decyphering etherscan, and how crypto moves between centralized exchanges (like coinbase) into lending platforms like Aave. We now have confidence in how to derive the gas fees paid per transaction and how our web wallets interact with smart contracts.
Moreover, we understand the benefits of transacting on layer-2s like Arbitrum: we spend less per transaction while benefiting from the security of Ethereum as the settlement layer. We also understand how lending platforms like Aave mint deposited collateral and issue debt via its “Aave wrapped Ethereum” and “Aave wrapped variable eth debt”.
🛑 STOP - Can you review transaction details on etherscan, assess the gas fees against your own calculations? Do you understand how Aave’s lending platform mints and burns its collatoralized tokens? If the answer is no, read guide 1 and guide 2 before proceeding. We’ll be here when you’re ready, promise!
Be warned.
We have also reviewed the risks of staked Ethereum as the basis for larger degen activities and wealth destruction experienced over the first six months of 20022. Across crypto-twitter and the interwebs at large, it’s the same story; under collateralization and over-leveraged trading positions as a catalyst for the 2022 crypto winter: 3AC, Celsius, blockFi, etc.
You’ve also read our analysis on the 2022 crypto winter titled ‘Welcome back to work diamond hands’, because you are grounded in the reality that we are doomed to repeat history if we do not learn from our mistakes.
You understand that retail traders are not the victims. The proliferation of superficial guides outlining ‘how to leverage eth’ more or less follows the theme below:
“goto the website, click deposit, click borrow, click deposit, click borrow” or
"goto the website, buy this token, the token will automagically create a liquidity pool pair, deposit it, borrow against it, and deposit it”
In reality, traders and crypto enthusiasts in the most recent meltdown had no idea of what was actually happening under the hood. If this is you, now is your time to course-correct or you will get rekted in the next cycle.
You’ve been warned.
🤔 Assumptions of the trade
We will turn ~$100 of Ethereum to produce ~$200 of Ethereum exposure as follows:
A $100 deposit to borrow $50
A $50 deposit to borrow $25
A $25 deposit to borrow $10
A $10 deposit to borrow $5
Each trade is limited to 50% of the deposit amount. Although you can borrow up to 82.5% of the collateralized amount (this is called a “liquidation threshold”), it creates a scenario where a 2% swing in the wrong direction will put you at risk of automatic liquidation.
Step 1 - Review your current wallet balance in Aave
Navigate to Aave
Switch the ‘market’ to version 3 - Arbitrum
Open Arbiscan
Open Etherscan
Open your spreadsheet
Confirm the eth balance in your web wallet matches the eth balance in the Aave dashboard and Arbiscan account summary
We are confident that the current balance in our web wallet is .0904405, and we’ve cross-checked in both Aave and Arbiscan. Details here for those who need a recap.
Step 2 - Supply .07 eth
Click the ‘supply’ button under the “assets to supply” section for the “ETH” asset type
We can see at a price per coin of ~$1577.88, .07 eth will yield ~$111.89 Ethereum, which we will use as leverage.
🤙 Note: that the annual percentage yield (APY) is AAVEs’s “borrow interest rate” and is based off ethereum’s utilization rate (the amount of ethereum borrowed / the amount of ethereum pledged as collateral). The higher the utilization rate, the higher APY. This “interest rate algorithm” is a mechanism of the platform to discentivize borrowing and avoid cascading liquidations.
Want to learn more? Read this.
Let’s pause for a moment to review what happened to the '.07 eth” when we clicked the ‘supply button’. An easy way to perform this review is to use a spreadsheet compare your wallet balance before and after the transaction.
Before supplying .07 eth:
Our eth wallet balance was .090440533 eth
Our ‘aave arbitrum wrapped eth’ (aArbWETH) balance is .000565525
After supplying .07 eth:
Our eth wallet balance decreases to .02039882325 eth
original eth amount - eth supplied to aave - gas fee = .090440533 - .07 - 0.0000417093
Our aArbWETH increases to .070565559
original aArbWETH amount + eth supplied to aave = 0.000565525 + .07 = 0.07056555401
Calculating the flow of money across the impacted tokens using a table like the one below is useful in quantifying fees:
🛑 STOP - Do you understand what aave does when you supply eth to the platform? Are you able to assess the change in your wallet balance across ETH, aArbWETH when taking into account the transaction amount and gas fees? Do not proceed until you’ve documented this in your spreadsheet.
Recall that “aArbWETH” is the token the Aave smart contract mints when you click the “supply eth button”. You are giving AAVE eth and getting an IOU in return called aArbWETH. When we explore arbiscan, we can see an ERC-20 token called "AAVE Arbitrum wrapped eth” has been added to our token balance, while our eth balance has decreased by the supplied amount (.07 eth).
Step 3 - Borrow .035 eth
Click the ‘borrow’ under the ‘assets to borrow’ corresponding to the asset type ‘ETH’
How much Ethereum is available to borrow? The answer is the sum of the aArbAWETH token or approximately .070565559 eth. The lending platform only considers supplied tokens as part of the total collateralized amount. This is derived via the AAVE-prefixed eth tokens like “aArbAWETH” and not “ETH”. Ethereum in our wallet that has not been supplied is not included.
What happens to our token balance when we initiate a ‘borrow eth’ transaction? What tokens are impacted?
After borrowing .035 eth:
The “Aave Arbitrum WETH” balance remains unchanged at 0.070565559
Our ETH balance increases to 0.05534026395
new eth balance = original eth balance + amount of eth borrowed - transaction fees = 0.02039882325 + .035 - 0.0000585593 = 0.05534026395 eth
Our Aave Arbitrum Variable Debt WETH increases to 0.06501191864
original debt balance + new debt balance = 0.0300117328 + .035 = 0.06501191864 eth
🚩 At the end of this step, our eth exposure has increased by 50%. We now have 1.5x leverage on our eth: the .07 aArbWETH plus the .035 eth borrowed.
🛑 CALL OUT - We’ve introduced a new AAVE token called “variableDebtArbWETH” which represents the amount of eth borrowed. This new token was minted to offset the increase in eth. Once accounting for transactions fee, the amount of the variableDebtArbWETH token is greater than the newly deposited eth.
Step 4 - Supply back .035 eth
Click the ‘supply’ button under the “assets to supply” section for the “ETH” asset type
At this point, we call out that our health factor (an indicator Aave uses to quantify default probability) increased from 1.58 to 2.03, because we are increasing our supply pool of eth. But aren’t we increasing it with the debt we just borrowed? 🤣
Setting aside Aave’s lending and safety algorithm for another day, what is the impact on the token balance in our wallet?
After supplying .035 eth:
Our eth wallet balance decreases to .02039882325 eth
eth balance - amount eth supplied - gas fees = 0.05534026395 - 0.035000 - 0.0000437 = 0.02029655335
Our aArbWETH increases to 0.105565572 eth
current aArbWETH balance = original balance + newly supplied amount = 0.070565564 + .035 = 0.105565572
Our variableDebtArbWETH remains unchanged
🚩 At the end of this step, our eth exposure has not increased. We are still at 1.5x leverage but improved our health factor by depositing back the borrowed eth as collateral.
Step 5 - Borrow .0175 eth
Click the ‘borrow’ under the ‘assets to borrow’ corresponding to the asset type ‘ETH’
We are going to borrow .0175 eth from the deposited .035 eth. But if you’re following along, the .035 eth we just deposited is actually a debt from the .07 eth we used as collateral to initiate this lending sequence, leverage baby!
After borrowing .0175 eth:
Our eth wallet balance increases to 0.03773762355
original eth balance + borrowed eth - gas fees = 0.02029655335 + .0175 - 0.0000589 = 0.0174411
Our Aave Arbitrum Variable Debt WETH increases to 0.08251200328
original variableDebtArbWETH balance + new amount borrowed = 0.06501191864 + .0175 = 0.08251200328 eth
The amount of aArbWETH is unchanged
🚩 At the end of this step, our eth exposure has increased by 75%. We are now 1.75x leveraged on our position. We started by supplying .07 eth → we borrowed .035 eth → we supplied back the .035 eth as new collateral → we borrowed .0175 eth against the supplied .035 eth
The deposit of the .035 eth decreased our loan to value which increased our health score. It enabled us to withdraw more eth on the backdrop of the new deposit. In our case, we chose 50% or .0175 Eth but could have gone as high as 82.5%.
Step 6 - Supply back the .0175 eth
Click the ‘supply’ button under the “assets to supply” section for the “ETH” asset type
Here we are going to supply back the .0175 eth we just borrowed. This will decrease our overall loan to value, improve our health factor, and enable us to borrow more eth!
After supplying back .0175 eth:
The amount of aArbWETH increased to 0.123065589
original 0.123065589 balance + newly supplied amount = 0.105565572 + .0175 = 0.123065589 eth
The amount of eth decreased to 0.02019558315
original eth amount - amount supplied - gas fees = 0.03773762355 - .0175 - 0.0000420 = 0.02019558315
The amount of variableDebtArbWETH remains unchanged
🚩 At the end of this step, our eth exposure has not increased. We are still at 1.75x leverage but improved our health factor by depositing back the borrowed eth as collateral.
Step 7 - Borrow .00875 eth
Click the ‘borrow’ under the ‘assets to borrow’ corresponding to the asset type ‘ETH’
We are going to borrow .00875 eth from the .0175 eth we just deposited. Remember, the .0175 eth we deposited is collateralized by a .035 eth loan. But the .035 eth loan is collateralized by the .07 eth we deposited. Technically the only real ‘asset’ is the .07 eth which is collateralizing this entire trade.
After borrowing .00875 eth:
Can you guess what happens?
variableDebtArbWETH amount increases to 0.09126209128
original variableDebtArbWETH amount + borrowed eth = 0.08251200328 + .00875 = 0.09126209128
ETH amount increases to 0.02888706035
original eth amount + borrowed eth - gas fees = 0.02019558315 + .00875 - 0.0000586 = 0.02888706035 eth
aArbWETH remains unchanged
🚩 At the end of this step, our eth exposure has increased by 87.5%. We are now 1.875x leveraged on our position. We started by supplying .07 eth → we borrowed .035 eth → we supplied back the .035 eth as new collateral → we borrowed .0175 eth against the supplied .035 eth → we supplied back .0175 eth → we borrowed .00875 eth.
Step 8 - Supply back .008 eth
Click the ‘supply’ button under the “assets to supply” section for the “ETH” asset type
Here we are going to supply back the .008 eth we just borrowed. This will decrease our overall loan to value, improve our health factor, and enable us to borrow more eth but we are approaching the home stretch.
After supplying back .008 eth:
The amount of aArbWETH increased to 0.131065596
original aArbWETH balance + newly supplied amount = 0.123065589 + .008 = 0.131065596
The amount of eth decreased to 0.02019558315
original eth amount - amount supplied - gas fees = 0.02888706035 + .008 - 0.0000401 = 0.02084699845
THE variableDebtArbWETH amount remains unchanged
🚩 At the end of this step, our eth exposure has not increased. We are still at 1.875x leverage but improved our health factor by depositing back the borrowed eth as collateral.
Step 9 - Borrow .004 eth
Click the ‘borrow’ under the ‘assets to borrow’ corresponding to the asset type ‘ETH’
We are going to borrow .004 eth from the .008 eth we just deposited. But the .008 eth is as actually a loan collateralized by .0175 eth, which is a loan collateralized by .035 eth, which is collateralized by .07 eth (our original amount).
After borrowing .004 eth:
variableDebtArbWETH amount increases to 0.09526212865
original variableDebtArbWETH amount + borrowed eth = 0.09126210407 + 0.0040000 + 0.09526212865
ETH amount increases to 0.02888706035
original eth amount + borrowed eth - gas fees = 0.02084699845 + .004 + 0.0000565 = 0.0039435
aArbWETH remains unchanged
🚩 At the end of this step, our eth exposure has increased by 93.2%. We are now 1.93x leveraged on our position. We started by supplying .07 eth → we borrowed .035 eth → we supplied back the .035 eth as new collateral → we borrowed .0175 eth against the supplied .035 eth → we supplied back .0175 eth → we borrowed .00875 → supplied back .008 eth → borrowed .004 eth.
😕What did we just do?
Conceptually, we performed 9 steps to increase our eth exposure from .07 to .135 (before fees).
When we explore the blockchain using arbiscan and assess the underlying impact on the aArbWETH, ETH, and variableDebtArbWETH tokens:
We see:
aArbWETH has increased to .13107 eth
ETH has increased .02479 eth
variableDebtArbWETH has increased to .09526 eth
This analysis paints a more accurate picture of our exposure because it takes into account the ‘variableDebtArbWETH’ eth. Most guides on the interwebs explore leverage as a mechanism to increase eth exposure but don’t take into account the underlying debt which needs to be repaid. Although our aggregate ETH exposure (inclusive of an existing balance) has increased to $248.56 USD, our variable ETH debt has also increased to $151.92 USD.
🏁 At eth’s current price per coin of $1594.78, we’ve turned ~ $100 of eth collateral into ~$200 of eth exposure.
Is there an easier way?
Yes. There is a gauntlet of derivative token providers like:
..that provide 1x-3x leveraged exposure to Ethereum and staked Ethereum in the form of an ERC20 token. These “collateralized debt tokens” perform the aforementioned steps on your behalf in exchange for a ~2% aggregate transaction fee. More exotic solutions like Alchemix offer auto-magic “repaying loans” by minting an Ethereum derivate debt tokens that “repays the debt on your behalf”. It sounds nice but the token tracks the price of the underlying asset (this means your principal goes down AND up).
It’s complete insanity because the 1% who pitch this product focus on how alechemix’s yield strategies are used to ‘repay the loan for you’ but completely gloss over the fact that your principal is variable and can go up.
🚫 Can you imagine buying a car where the principal amount you owe goes up or down every month? This month you owe $10,000, next month you owe $15,000, the month after you $5,000, then Ethereum has a bull run and your principal balance increase to $30,000? No thanks. The only ones making money in this scenario is the platform provider.
There’s an emerging narrative of ultra degens using tools like Alchemix to buy ‘self-repaying homes’, ‘self-repaying cars’, or self-repaying boats….if you love money, you will stay away from this product.
...then there’s the gauntlet of ‘advanced trading platforms like DeFi Saver which deploy automated investing strategies on your behalf like:
Open a 3x steth-eth leveraged position
Create a makerDAO vault → swap half of DAI for ETH → supply ETH/DAI to uniswap LP pool..etc
Identify “smart savings accounts” that aggregate yields across tokens to return the best APY based on the account’s investment strategy
If this is your 1st season of crypto, stay away from these collateralized debt tokens, yield automation platforms, and self-repaying loans. Execute borrow/lend/leverage positions manually. Our goal is to create a foundation of knowledge that leads to conviction. Without knowledge your conviction becomes arrogance, and you will get rekted in the trade.
Final thought
Take a moment and reflect on the ponzinomics and crypto-shills of summer 2022 (LUNSA, Celsisus, 3AC) with the following warning:
“If you don’t know the source of the yield, you are the yield”:
🔔 Action for frontrunners:
Lend $100 of ETH on on Aave (arbitrum or optimism)
Borrow at most 50% of the collateralized eth
Lend back the 50% of the collateralized eth
Borrow at most 50% of the collateralized eth
Calculate the transaction fees and reconcile it against what you see in arbiscan
Review the transaction details and assess what smart contacts were called and what tokens were minted
You are the master of your destiny,
John Cook
September 18th, 2022
San Francisco, CA
www.frontruncrypto.com
Supporting content:
pic of the week - “these criminals obviously don’t understand how bitcoin works”