MAKING 100X on Crypto Flash Loans. INSANE PROFITS.

TechLead
19 May 202210:35

Summary

TLDRThis video explores the concept of flash loans in cryptocurrency, illustrating how they allow users to borrow vast sums without collateral, solely within one transaction block. The host demonstrates practical applications, including arbitrage opportunities and leveraging flash loans for profit, while emphasizing the unique nature of this mechanism in the crypto world compared to traditional finance. Additionally, the video covers the use of Tornado Cash for anonymity, the potential for leveraging and shorting strategies, and the risks involved in such operations. The episode is sponsored by the Opera Crypto Browser, aimed at enhancing the Web3 browsing experience with integrated crypto wallet and privacy features.

Takeaways

  • 😲 Flash loans allow you to borrow large sums of money without collateral as long as you pay it back within the same transaction
  • 👌 You can use flash loans for arbitrage opportunities across decentralized exchanges
  • 🤑 The video shows an example of making a small profit from an arbitrage between USDC and Frax using flash loans
  • 😎 You can use flash loans to take leveraged positions, for example shorting FRAX in this case
  • 🔁 Flash loans can be used to self-liquidate leveraged positions
  • 🌪️ The video advocates using Tornado Cash to obscure transactions related to flash loans
  • 🚨 Flash loans have been used to attack lending protocols by artificially inflating collateral
  • 👀 Screen Finance appears to have been exploited via flash loans taking advantage of mispriced collateral
  • ❗Flash loans are only possible due to the atomic nature of transactions in decentralized finance
  • 🤷‍♂️ The video presenter seems overly enthusiastic about using flash loans in ethically questionable ways

Q & A

  • What are flash loans in the context of cryptocurrency?

    -Flash loans are a unique concept in cryptocurrency that allow individuals to borrow any amount of money without collateral, with the condition that the loan must be repaid within the same transaction block.

  • How can flash loans be used for arbitrage opportunities?

    -Flash loans can be used for arbitrage by borrowing funds to exploit price differences across exchanges. For example, buying an asset at a lower price on one exchange and selling it at a higher price on another, all within the same transaction block.

  • What is Tornado Cash, and why is it used in conjunction with flash loans?

    -Tornado Cash is a cryptocurrency mixing service that obscures the origins of digital assets, making transactions untraceable. It's used with flash loans to obscure the trail of transactions for privacy or security reasons.

  • What is the main restriction when using flash loans?

    -The main restriction of using flash loans is that the borrowed amount must be repaid within the same transaction block, meaning all operations financed by the loan must be completed instantly within that block.

  • Can you give an example of a flash loan used for arbitrage?

    -An example of arbitrage using flash loans is trading 2,000 USDC for 2,002 FRAX, then exchanging those 2,002 FRAX back into USDC at another exchange, potentially making a profit from the price discrepancy.

  • What is the role of the Aave lending protocol in flash loans?

    -The Aave lending protocol allows users to borrow assets through flash loans, facilitating transactions without requiring collateral, as long as the borrowed asset is returned by the end of the transaction.

  • What are the fees associated with taking a flash loan from Aave?

    -Aave charges a flash loan fee of about 0.09%, which is relatively low, for facilitating the loan transaction without requiring collateral.

  • How can flash loans be used beyond arbitrage?

    -Beyond arbitrage, flash loans can be used for purposes like leveraging up borrowing collateral, shorting assets with high leverage, or unwinding positions in a highly leveraged trade.

  • How does leveraging work with flash loans?

    -Leveraging with flash loans involves borrowing funds to increase the amount of an asset one can trade, thereby amplifying potential profits (or losses). Flash loans can provide high leverage due to their no-collateral nature.

  • What is the potential risk of using flash loans for manipulating lending protocols?

    -Using flash loans to manipulate lending protocols, such as by artificially inflating collateral values, can lead to insolvency for the protocols and loss of funds for users, highlighting the risk of malicious use of flash loans.

Outlines

00:00

😊 Introducing Flash Loans for Profitable Arbitrage

The video introduces the concept of flash loans, which allow temporarily borrowing large sums of money without collateral to take advantage of arbitrage opportunities and make profits. An example arbitrage opportunity is shown between USDC and FRAX stablecoins on different exchanges. The Furu Combo tool is demonstrated to execute a sample flash loan arbitrage trade.

05:01

🤑 Using Flash Loans to Short FRAX with Leverage

The video explores using flash loans to open leveraged short positions on assets, with the goal of profiting if the asset drops in value. A detailed example is shown for shorting FRAX stablecoin with 5x leverage using a flash loan from Aave, obscuring the transaction trail with Tornado Cash. Self-liquidation of the position using another flash loan is also discussed.

10:01

😲 Flash Loans Used to Drain Collateral from Scream Finance

The video explains how flash loans have been used to attack and drain collateral from decentralized finance protocols like Scream Finance. Attackers can exploit incorrect asset price data or gaps in the system to borrow more assets than they supply as collateral, leaving the protocol insolvent.

Mindmap

Keywords

💡Flash Loans

Flash loans are a unique financial instrument in the cryptocurrency and blockchain space, allowing individuals to borrow any amount of funds without collateral, with the condition that the loan is repaid within the same transaction block. This concept, highlighted throughout the video, is central to exploring arbitrage opportunities and other financial strategies that are not possible in traditional finance due to the requirement of instant repayment. The video demonstrates how to execute flash loan transactions using platforms like Aave and leveraging tools like Furucombo for orchestrating complex trades.

💡Arbitrage

Arbitrage is the practice of taking advantage of price differences between markets. The video script discusses identifying opportunities to buy an asset at a lower price in one market and sell it at a higher price in another, using flash loans to amplify potential profits. Examples include trading between stablecoins USDC and FRAX to earn a profit from small price discrepancies across exchanges like Curve.

💡Tornado Cash

Tornado Cash is mentioned as a tool for obscuring the origins of cryptocurrency transactions to ensure privacy. In the context of the video, it is used after conducting flash loan operations to anonymize the proceeds. This emphasizes the importance of privacy in managing the digital assets accumulated from flash loan activities.

💡Aave

Aave is identified as a lending platform that supports flash loans, allowing users to borrow assets with the stipulation of repaying within one transaction block. The video illustrates how Aave can be utilized to initiate flash loans for arbitrage or other financial strategies, showcasing its role as a critical infrastructure provider in the decentralized finance (DeFi) ecosystem.

💡Furucombo

Furucombo is depicted as a tool that allows users to build and execute complex DeFi strategies, including flash loans, without needing to write code. The video explains how Furucombo can be used to assemble transactions involving borrowing, swapping, and repaying assets in a single operation, highlighting its utility in simplifying the execution of sophisticated financial maneuvers.

💡Opera Crypto Browser

The video features the Opera Crypto Browser, emphasizing its built-in non-custodial crypto wallet and support for multi-chain environments. It's presented as an innovation enhancing the web3 and crypto user experience, integrating privacy, security features like VPNs, and direct access to DeFi platforms and news, illustrating the evolving landscape of internet browsers catering to the needs of the crypto community.

💡Collateral

Collateral is discussed in the context of traditional loans and how flash loans diverge by not requiring it. This distinction underscores the novelty of flash loans within DeFi, allowing for leverage and financial operations that are unfeasible in conventional finance, where loans typically necessitate securing with assets.

💡Stablecoins

Stablecoins, such as USDC and FRAX, are used in the video's examples of arbitrage opportunities. Stablecoins are cryptocurrencies designed to minimize price volatility by being pegged to a stable asset, like the US dollar. The video illustrates how minor price differences between these stable assets can be exploited for profit through flash loans.

💡Leverage

Leverage in the context of the video refers to using borrowed funds to amplify potential returns from trading or investment strategies. Flash loans are presented as a means to achieve high leverage without upfront capital, enabling more significant positions than one's own capital would allow, particularly in strategies like shorting a cryptocurrency.

💡Decentralized Finance (DeFi)

Decentralized Finance, or DeFi, is a recurrent theme in the video, referring to the ecosystem of financial services, including lending, borrowing, and trading, built on blockchain technology that operates without central intermediaries. The video showcases how DeFi platforms like Aave and tools like Furucombo enable users to participate in complex financial transactions such as flash loans, highlighting the innovative and transformative potential of DeFi.

Highlights

Introduction to flash loans and their potential for arbitrage opportunities.

Explanation of flash loans as a unique cryptocurrency concept allowing borrowing of large sums with zero collateral.

Discussion on using Tornado Cash for obscuring transaction trails.

Introduction of the Opera Crypto Browser and its features tailored for Web3.

Example of a small arbitrage opportunity between USDC and FRAX stablecoins.

Using Aave lending protocol for borrowing assets for flash loans.

Furucombo as a tool to automate flash loan transactions.

Practical demonstration of executing a flash loan transaction for arbitrage.

Realization of transaction fees offsetting small arbitrage profits.

Exploration of flash loans for more than just arbitrage, like collateral leveraging.

Strategy for shorting FRAX stablecoin using flash loans for high leverage.

Using Tornado Cash for anonymizing transactions in the context of flash loans.

Demonstration of leveraging and shorting strategies using flash loans and Tornado Cash.

Discussion on the potential for protocol insolvency due to mispriced collateral in flash loan attacks.

Conclusion and call to action for viewers, emphasizing the innovative nature of flash loans.

Transcripts

play00:00

all right welcome back let's make some

play00:01

money you guys today we're talking about

play00:03

flash loans and we're going to actually

play00:05

perform a few flash loans attack out

play00:07

there to arbitrage some nice

play00:09

opportunities for us we're going to be

play00:11

flash loaning hundreds of millions of

play00:13

dollars actually it's gonna be a little

play00:14

less than that but flash loans can be

play00:16

used not only for profit but also for

play00:18

fun and a variety of other purposes so

play00:20

we're going to explore the whole world

play00:22

of how flash loans work today and we're

play00:24

going to do what the hackers do as well

play00:25

we'll be using tornado cash just to

play00:27

obscure our trails and so with our flash

play00:30

loans anyway they are a unique concept

play00:32

in cryptocurrency where you can borrow

play00:34

essentially hundreds of millions of

play00:36

dollars as much money as you want

play00:38

providing zero collateral and the

play00:40

restriction is you just have to complete

play00:41

your transactions in one block so you

play00:44

can borrow as much as you want just pay

play00:45

it back right away after you do what you

play00:47

need to do with that in one complete

play00:49

transaction so you can do a series of

play00:51

steps together and the whole block will

play00:53

execute or revert all in one therefore

play00:56

you can say that flash loans are a

play00:58

concept truly unique to cryptocurrency

play01:00

and blockchain technology that is simply

play01:02

not possible in traditional finance

play01:04

providing you with almost unlimited

play01:07

leverage it's gonna be a fun and

play01:08

exciting episode let's get into it quick

play01:10

pause this video is brought to you by

play01:11

the opera crypto browser a new web 3

play01:14

experience built for you from the ground

play01:16

up i've had the chance to test out this

play01:18

crypto browser and i want to show you

play01:20

some of the cool features and

play01:21

impressions i have for it one cool thing

play01:23

the opera crypto browser comes with its

play01:25

own non-custodial crypto wallet

play01:27

integrated into the web browsing

play01:29

experience supporting multi chains

play01:31

ethereum polygon binance smart chain and

play01:33

of course bitcoin and you can see all of

play01:35

your token assets across all of these

play01:37

chains in just a few clicks and so while

play01:39

many of us know opera does make a normal

play01:41

web browser the opera crypto browser is

play01:44

specifically built for web3 and crypto

play01:46

featuring additional support for privacy

play01:48

and security for example they secure

play01:50

your clipboard allowing you to safely

play01:52

copy and paste sensitive data and they

play01:54

have a built-in vpn an integrated ad

play01:56

blocker blocks dangerous and intrusive

play01:58

ads from your browsing experience and

play02:00

also pretty neat they have this section

play02:02

known as crypto corner that rounds up

play02:04

all of the latest blockchain news from

play02:05

well-known sources where you can track

play02:07

crypto market movements gas fees market

play02:09

sentiment and have access to popular

play02:11

crypto communities podcasts and more

play02:14

plus they directly integrate discord and

play02:16

telegram and other socials into their

play02:18

sidebar so you have quick access into

play02:20

the token communities so change things

play02:22

up an opera crypto browser makes it easy

play02:24

with their quick import feature you can

play02:26

easily import your bookmarks history

play02:28

passwords from chrome so definitely

play02:30

exciting technology the opera crypto

play02:32

browser if you are looking for the best

play02:34

web3 experience check them out i have a

play02:36

link for you in the description below

play02:38

alright so to begin let's pretend that

play02:40

you've spotted an arbitrage opportunity

play02:42

where you can buy one asset for lower

play02:44

price and then sell it for a higher

play02:45

price right so if you had a lot of money

play02:47

you can just keep buying this low price

play02:49

asset and keep selling it and make a lot

play02:51

of money that way a flash loan would be

play02:53

great for this so for example here's one

play02:55

such opportunity it's a small one two

play02:57

stable coins usdc and frax both value

play02:59

that one dollar but here you can see i

play03:01

can trade 2 000 usd coins for 2002 frax

play03:04

and then i can go to another exchange

play03:06

like curve and trade those 2002 fracks

play03:08

back into usd coins and i would have had

play03:11

1.84 cents at the end of this trade

play03:13

that's a small arbitrage opportunity now

play03:15

if i can only do this trade at large

play03:17

scale with say 10 million dollars of

play03:19

funds then this can amount to quite a

play03:21

bit of money and so how do we do a flash

play03:23

loan well we need to find where we can

play03:26

borrow a lot of these assets one such

play03:28

website is going to be ave lending

play03:30

protocol we can come in here and you can

play03:32

just choose the number of assets that

play03:33

you'd like to borrow and so for example

play03:35

you can see you can borrow usdc coins

play03:37

and if you go to the iv documentation

play03:39

they're going to tell you that you can

play03:41

actually do flash loans and just borrow

play03:43

as much as you like almost infinite and

play03:45

so they say flash loans are special

play03:47

transactions that allow the borrowing of

play03:49

an asset as long as the borrowed asset

play03:51

is returned before the end of the

play03:52

transaction these transactions do not

play03:55

require the user to supply collateral

play03:57

prior to engaging the transaction and

play03:58

there is no real world analogy to flash

play04:01

loans the only catch is ave will charge

play04:03

you a flash loan fee of about 0.09 which

play04:06

is fairly low and they actually tell you

play04:08

a number of different tools and websites

play04:10

you can use to help you automate this

play04:11

flash loan process and so i was checking

play04:13

these out one such website is furu combo

play04:16

now there's a number of others but today

play04:17

we're going to be checking out how to

play04:18

use furu combo so if you go to

play04:20

photocombo i believe it's free to use

play04:22

which is pretty cool but you just need

play04:24

to assemble these blocks together about

play04:25

the types of transactions that you want

play04:27

to do so the first thing we're going to

play04:29

do is do a flash loan on usdc alright so

play04:31

we'll borrow maybe five thousand dollars

play04:33

worth so we'll say that's the first

play04:35

block and then we need to put in here

play04:37

another transaction to use an exchange

play04:40

say one inch to do the swap right so

play04:42

we'll swap from usdc into frax so let's

play04:45

put that in

play04:46

set that and then we want to also use

play04:48

another exchange here curve finance to

play04:50

swap that fax back into usdc

play04:53

so we just set that block and then move

play04:56

it right back up there

play04:59

so these arbitrage opportunities are

play05:01

always changing around i had to tune

play05:02

these parameters a little bit but i

play05:04

switched the token pair to usdc versus

play05:06

die and then i executed the transaction

play05:09

and we can take a look at what happened

play05:10

here actually so as you can see here

play05:12

this was a batch execution where i

play05:14

swapped the 50 usdc for 50.1 dies so i

play05:18

made 10 cents on this transaction and so

play05:20

you can see it just executed the series

play05:22

of transactions here where it took a

play05:24

flash loan from ave for 50 usdc did a

play05:27

bunch of stuff with this opted to die

play05:29

and back and then repaid that flash loan

play05:31

at the end of the transaction

play05:33

the transaction fee was 42 so i lost 40

play05:35

bucks on this but you know this supports

play05:38

a number of other chains as well like

play05:39

they've got polygon as well so maybe you

play05:41

can trade on that if you're not doing

play05:42

the bigger trades here now it turns out

play05:44

flash loans are good for more than just

play05:46

trade arbitrage you can do a bunch of

play05:48

interesting things with it for example

play05:50

you can use it to leverage up your

play05:52

borrowing collateral so for example let

play05:54

me show you what i'm trying to do here

play05:56

now one trade that i've been trying to

play05:57

do is to short frank stablecoin because

play06:00

i just personally believe that frax is

play06:01

going to collapse into a death spiral

play06:03

similar to usd and tara because you know

play06:05

frax is also algorithmically backed and

play06:07

i believe that their collateral is

play06:09

basically underwater at this point so in

play06:11

order to short facts anyways what you

play06:14

can do is you can supply something like

play06:15

usdz coin borrow frags and then swap

play06:18

that back into usdc coin and then later

play06:20

on if and when frax collapses you can

play06:22

repay it back at the price much lower

play06:25

than when you bother that now flash

play06:27

loans can help us accomplish this with

play06:28

much higher leverage so for example

play06:30

let's say i have 1000 usdc i'm only able

play06:33

to borrow maybe 800 dollars worth of

play06:35

frax it has to be less than what i've

play06:37

supplied but the thing is with flash

play06:39

loans i can actually take out 5x to 10x

play06:42

leverage on my money because ava only

play06:44

requires the collateral ratio to be

play06:46

about 10 or so which means you can get

play06:48

like 5 to 10 x leverage on this so let

play06:51

me show you how i'm going to do this and

play06:52

this time we're going to do it the pro

play06:54

way by using tornado cache in order to

play06:56

just obscure our tracks when we do a

play06:58

flash load just like how the pros do it

play07:00

so let me show you how this is going to

play07:02

be done the first thing is we create a

play07:03

new metamask account so i create a new

play07:05

account here and i need to fund it using

play07:07

new funds that are untraceable and this

play07:10

is where tornado cash comes in so

play07:12

tornado cash is this mixing service and

play07:14

when we take out our short position on

play07:16

frax maybe we just want to cover our

play07:17

tracks here so the way this works is

play07:19

we're going to deposit one each and then

play07:20

we'll be able to withdraw it with this

play07:22

other address all right so i will

play07:24

deposit 1 8 and i'm going to back up

play07:26

this note and send the deposit and you

play07:28

guys this is costing me so much in gas

play07:30

features to show you how to do this so

play07:31

like and subscribe it but now we're

play07:33

going to copy the note put in the

play07:34

recipient address and withdraw that eth

play07:36

back out and when i click on this it's

play07:39

going to do that with a small fee taken

play07:40

out for the gas feeds and now in my new

play07:43

wallet you will see i have one ether in

play07:44

there just transferred in from tornado

play07:46

cache now what we're going to do now is

play07:48

we're going to create a new photo combo

play07:50

in which we're going to do another flash

play07:52

alone here this time in order to acquire

play07:54

a more leveraged short position on frags

play07:56

so let me show you how this is going to

play07:58

be done so we're going to borrow about

play07:59

ten thousand dollars worth of ethereum

play08:01

or five each and we're going to supply

play08:03

that as collateral into ave so we'll

play08:06

come here to ave deposit and we'll

play08:08

deposit all of the ether in there

play08:10

let me just move that here

play08:12

so i need to unwrap the eat deposit that

play08:14

into ave then we'll borrow maybe eighty

play08:17

percent against our collateral so eight

play08:18

thousand dollars worth of frags and then

play08:21

finally we need to swap the frax back

play08:22

into ethereum in order to pay back the

play08:24

flash loan so we can see at the end what

play08:26

this is going to do is it's going to

play08:28

cause uh some ethereum in order to take

play08:30

on this position about one ethereum and

play08:32

we're going to receive some collateral

play08:33

so let's execute that all right cool so

play08:36

we've executed the transaction coming

play08:37

into ave you can see what we have here

play08:39

now is we have supplied five eth ten

play08:41

thousand dollars worth of ether which we

play08:43

don't have and we have borrowed eight

play08:45

thousand frags so we have a short

play08:47

position on frax now of eight thousand

play08:48

dollars worth having used only one each

play08:51

to take this position so it's about 4x

play08:53

leverage and then finally the other cool

play08:55

thing i found about flash loans is you

play08:57

can use it to self-liquidate yourself in

play08:59

order to unwind your positions right

play09:00

like here i need to repay 8 000 worth of

play09:03

frax which i don't have how can i unwind

play09:06

this well i can also do another flash

play09:07

loan here in which i can just borrow the

play09:09

frags to do that and so same thing here

play09:11

if i wanted to unwind this position i

play09:13

could just borrow a thousand dollars

play09:15

worth of frax as a flash loan repay the

play09:17

loan withdraw the ethereum collateral

play09:19

and then swap part of that back into

play09:21

frax to repay the flash loan so there

play09:23

you have it the flash loans definitely

play09:25

an interesting financial construct and

play09:27

some people have even used this to

play09:28

pretty interesting effect like screen

play09:30

finance is this other landing borrowing

play09:32

protocol somebody i think probably could

play09:34

have flash along this one too because

play09:36

you can see they are overdrawn on their

play09:38

collateral and supply and so for example

play09:40

here what happened was they had

play09:42

hard-coded the values of some of these

play09:43

assets to one dollar like they stable

play09:45

coin is valued at one dollar here on

play09:47

screen but in reality day has already

play09:50

packed to like 60 cents or so and so

play09:52

what people do is they'll take a flash

play09:53

loan get a bunch of day tokens supply it

play09:56

in here and then borrow a bunch of

play09:57

assets based on the assumption that the

play09:59

collateral they deposited like for

play10:01

example day there's 18 million dollars

play10:03

worth of deposits is valued at one

play10:04

dollar when it's not so they can borrow

play10:06

a lot more than they've put in and then

play10:08

they repay the flash loans having

play10:10

borrowed more than the collateral that

play10:12

they put in leaving the protocols

play10:13

themselves insolvent and people unable

play10:16

to withdraw the funds that they had lent

play10:17

out but that's another issue and then

play10:20

last of all on your way out before you

play10:22

withdraw your funds just make sure to

play10:24

tornado cash out that's how us pros do

play10:26

it in any case that's flash loans for

play10:29

you hope you enjoyed the video if you

play10:30

liked the video please give a like and

play10:31

subscribe and i'll see you in the next

play10:33

one thanks bye