Aave Flash Loan Tutorial - Finding Arbitrage
HTML-код
- Опубликовано: 21 авг 2024
- #python #solidity #ethereum #aave
Learn how to make contracts that use flash loans. Using Brownie, Solidity, Aave,
✍️Medium Post: medium.datadri...
⌨️ Code: github.com/Pat...
🍫🍰Brownie Code: github.com/bro...
👻 Aave: app.aave.com/
Intro Video by: Amitai Angor AA VFX • 4K Motion Background -...
Queen Flash: • Queen - Flash (Officia...
✅✅ Donate ✅✅
I use donated funds to spend money on making fun & informational videos.
ETH Wallet address: 0x9680201d9c93d65a3603d2088d125e955c73BD65
😸😸Join the community!😸😸
Chainlink developers discord: / discord
Alpha Chain discord: / discord
Twitter: / alphachainio
Twitter (me): / patrickalphac
Medium: / patrick.collins_58673
Twitch Stream Uploads: / @patrickalphac-alt
Twitch: / patrickalphac
All thoughts and opinions are my own.
Its like Jeff Bezos with hair
I should keep a running list of these jokes
Holy cow, you're right...
The intro originally reminded of Sheldon from Big Bang Theory but you're right he has the Bezos nose.
Definitely
Without the billions but cooler
That intro was legendary
I quite enjoyed making it thank you
im currently watching your 16hours course and i want to thank you so much for taking the time and helping so many people, i went trought the course because i want to build a arbitrage bot for bsc and with the experience and profits start developing my own projects , ended up finding your videos in the reverse order, but anyway thank you so much
Awesome!! Glad they have been helpful!
How can I get the course
@@TheBrokerTopGee ruclips.net/video/M576WGiDBdQ/видео.html
@@PatrickAlphaC hanks
How did it work?
ok that intro was absolutely genius please more
You win a comment award. Take my like, thank you.
@@PatrickAlphaC Humbly I shall, thank you.
Questions can come in⬆️
You're absolutely killing it 👏 keep up the awesome tutorials
Thank you!
You know.. you are teaching how to make people wealthy, not just with flashloans,
but with your entire valuable content , thank you so much for your great work , you inspired me to be a better dev
I hope my experiments on web3 work and i land a job in blockchain development soon.
Looking to make a dark world brighter. Good luck!
@@PatrickAlphaC I made it :D , now i have a job starting in this field, and that is so dope.
my duty is to create an ICO and a frontend for an NFTgame. So thanks again
You don’t have to tell us repeatedly. I did a favour to myself by subscribed and clicking on notification button.
Got attached to you since the Chainlink videos! Nice work man!
Thanks so much! Going to keep making the Chainlink videos too :)
These intros just misses a frog somewhere to be the best intro ever
Man I want to buy stocks of this intro
Alpha leak
Thanks for the amazing content.. im completely new to coding and you have made it pretty much straight forward..Thanks!
That’s the plan. Glad you liked it!
subbed based on the intro alone. lots of production value here.
*sweats*
I’ll do my best to keep it up ;)
Man for second I thought this was Jeff Bezos with hair haha awesome video!!
I get this comment 3x per video lel
im not going to lie... that intro was sick... love the videos! Savior of the Universe!!! Bangin!
LETS GO
For more enquiries, reach out⬆️⬆️⬆️...
When he was running in the intro he reminded me of Sheldon from Big Bang Theory.😂 I loved it.
Haa ha fun intro! First time here! Hope there is news I can use!
Once again a great intro! Can you please make a video going deeper into the topic of Brownie adding Hardhat support?
Hasn’t been added yet, but once it comes out....
Best tuts! Great work dude!!
Thanks mad!
Oh gawd that was an epic intro
wow jeff bezos teaching me stocks,love ya
Lawl. Stocks huh
🤣🙏🏽
the moment the Flash Gordon soundtrack came on ..he got me!!!! hahahhahahhhaahahh super funny!!!
Great guide. I love this intro
This deseves 1 000 000 000 views!
A share would do wonders :)
Nice tutorial, keep up the good work man.
Intro definitely sick bro
Thank you for watching, for question, guidance and support at anytime. Just DM +1.(4 .2 .3). 4 . 3 . 0 . 6 . 9 . 8 . 4 @ W H A T S A P...
Patrick thanks so much for this video. My big question is (possibly another user knows) Why isn’t every coder able to just make millions on autopilot with exchange arb bots?
It must be harder to be successful than it appears
A lot do. It’s because it’s easy to setup that it’s hard to be profitable, it’s incredibly competitive and every little detail counts
Great sugquestion
Can you show us how to do a test on our aave flash loan using a forked network? For let’s say the mainnet.
Yes it was a great intro indeed ! :D
Your right that intro was sick, It made me sick. Had to take 10 min before watching the rest. Lol great vids, if you learn smart contracts inside out or close to ,ish. Having no real world experience will you be able to get an opportunity. Thanks Patrick
ur sickness made me sik.
I can't believe I found Jeff Bezos with hair
I think I’m starting to like this joke
Lmfao this channel is so awesome. Thank you for everything you're doing, Patrick.
That intro was awesome. Lmao 😂
Nice one man....but can you actually do one like top down it’s crazy but some of us don’t even know what software you use to open the contract or brownie or all of those
Yeah.... you’ve mentioned this before actually. Is it the VS code and python where you struggle?
@@PatrickAlphaC Yh I know I have, I don’t think I know how to use it tbh it’s not really like the normal python console where you write codes then compile, there’s so much going on at the same time
@@24capital75 what do you mean "normal python console"? What are you using to write your python? Something like pycharm?
@@PatrickAlphaC what development platform are you on? That's what he is asking... Give name of your IDE platform
@@the-omas no he knows it’s VSCode, we’ve chatted before
hahahah that intro deserves a subscribe
that intro is so sick
OK, fine, sick intro!!
This is just what I was looking for
Amazing explanation about loan. Hopefully more example in different network. Many thanks
Your videos are definitely quality content.
Thanks fren
That intro IS sick
YES
You are my hero!
Have a thumbs up for that intro
🙏
@@PatrickAlphaC one question, can you explain why it minted the aave token? Is that the payment to the protocol? I am only a bit confused on that part.
The coding is scaring me some but I feel I need to understand this content. Seems like a good way to make passive income
Find a kid at your local college who can code and split profits
@@jimparks5478 hahaha 😆 you make laugh 😃 you are absolutely right but if that kid find millions he will escape from the college and you can't find him anywhere 😉
Definitely topQuality content!
Helllll yeah
please patrick keep it coming
Thanks for watching,
For further discussion,questions & guidance,please contact my support line
(Replies usually come within 2 hours +1. 8. 0. 4. 8. 2. 9. 3. 3. 8. 5).
I'm so glad this video came out! Couple weeks ago I took this aave mix for a spin on Matic. Long story short, the contracts deploy just great on mumbai and mainnet but brownie has a hell of a time interacting with contracts post deployment. Do you have any high-level intuitions why this might be? have you poked around on Matic using brownie yet?
I sure have! Stuff worked fine for me... love matic (polygon). What were the issues you ran into?
@@PatrickAlphaC you know what lol... I actually revisited that project just now. After getting my env variables up, I was able to call the contract and take out a flashloan using aave's lending pool on polygon. Didn't change an ounce of code; working inside of venv now, must have been the issue before. Anyway, for the adventurous in comments here: it is possible to use this exact brownie mix on matic. Just make sure to use the matic version of RPC, token addresses, etc.
@@pan-galactic-gargleblaster beautiful!! If you’d like to make a PR to the repo adding the matic addresses, please do!
@@PatrickAlphaC I've implemented the flash loan in matic, no prob, but now I'm trying to add in a swap on quickswap and I'm having a hell of a time getting the transaction to go through. I think it's got something to do with the gas settings on Brownie. I've tried every variation I can think of, but currently not having any luck. Any ideas?
@@RichJam1978 Make a stackoverflow question with the issue you're running into and post it here?
hey that intro was cool asl
I wish any of this made a lick of sense to me, because I would love to try it.
I’d love to have you learn to understand it friend
Great video!!
My grandmother thinks your voice is sexy in a not disrespectful way
Your grandma is a wonderful person
Subbed cause intro
✊✊✊
Great video! I’d love to hear your thoughts on EQZ Equalizer. Dedicated to flash loans and LPs. Mainnet launch was yesterday. Now they need to fill up the vaults and create lots of liquidity over several assets. I would love to hear your opinion and maybe see a video if you have time! Thanks! DeFi and it’s new innovative tools are awesome!
Haven’t worked with that yet, don’t know much about it, sorry!
Sminem wins thanks to aave
Thank you for watching, for question, guidance and support at anytime. Just DM +1.(4 .2 .3). 4 . 3 . 0 . 6 . 9 . 8 . 4 @ W H A T S A P...
Great work Patrick, much appreciated!
Hello Patrick, I really enjoy your vids, and I can use Python to develop some smart contract. I wonder could you make a video to introduce some methods or tactic about using smart contract to make some $? I believe so many tech geeks would be interested in, but we just don't where and how to start.
Making $ should be derived from creating value in the world.In the videos here, I’m showing you the tools to create value in the world, and it’s up to you to put those tools together to create something of value.
Look, I’m a fan of making money as much as anyone else, but if you focus on the making money, rather than creating value, you’re going to make a lot of things that don’t last very long, because their goal wasnt to actual give value to anyone, and are “gimmicky”.
You can make a lot of money in the space following this. Seeking alpha to keep markets efficient is one way to create value. Finding alpha to help people keep their money secure is another way. Creating valuable art people like as NFTs is another way. Building insurance platforms where the insurer can’t f over the users due to trustless agreements is another.
Focus on value, and if you build something people value, and then market it, the $ will come.
Spoils the whole grace of a man with that intro.
subscriber here :D Will you make a video on collateral swapping with flash loans too ?
What do you mean?
Thank you for the tutorial , I wanted to see it yesterday with the musk faucet up. Maybe we can use a flash loan to maximize rewards? My question is the payback, can we wait until another transaction happens before we payback the flash loan ?
Nope. Gotta pay back in the same transaction. You can use a regular loan to do what you want.... but then you don’t get that leverage.
@@PatrickAlphaC thank you
If you want to profit with a later transaction, combine the flash loan with a collateralized loan. If there's a spread in 2 stable coins, you get the flash loan, put it in a Maker Dao (Oasis) vault and pay back the flash loan. When the stable coins go back to the 1:1 ratio you get another flash loan , get your money out of the vault and pay back the flash loan.
Sick intro 😂
Thanks for watching,
For further discussion,questions & guidance,please contact my support line
(Replies usually come within 2 hours +1. 8. 0. 4. 8. 2. 9. 3. 3. 8. 5).
im glad "most" people cant sit through this to understand it =D
Which better to learn between javascript hardhat or python brownie ?
Honestly, doesn’t matter. Whatever you want
@@PatrickAlphaC thanks
@@PatrickAlphaC maybe do You know a Master degree or courses to be a profesional in blockchain ? I am a autodidact and i learned solidity, rectajs, git , hardhat ,etc.
@@PatrickAlphaC thanks For your videos are awesome i have been watching your video about blockchain in freecodecamp
@@lorelore138 The freecodecamp video is the masters degree :)
The only way I will ever understand any of this is when you do a real life arbitration with real tokens or coins or whatever without saying whatever and actually doing it showing it step by step for dummies like me 🙈
This is the first time i enjoy with code! 😅 congrats for your amazing channel Patrick, you will hit 100k very soon! (your 16H course is amazing)
Do you know which polygon testnet could i use for this? i saw mumbai but looks a bit suspicious to me, is it secure?
Thank you!
For polygon testnet, just use kovan or rinkeby. They are way more performance than Mumbai, Mumbai’s been giving a lot of issues recently
@@PatrickAlphaC ♥
thank you for this great work! :)))
Thank you for watching, for question, guidance and support at anytime. Just DM +1.(4 .2 .3). 4 . 3 . 0 . 6 . 9 . 8 . 4 @ W H A T S A P...
Just curious why did you decide not to make it as a full time job, if that’s only factor to make this profitable if you already know how to code it? It seems that arbitrage opportunities will be always there from time to time, don’t they? Curious to hear what obstacles and difficulties you see.
Oh exploiting them is the easy part. Finding them before someone else does, THATS the hard part. It's crazy competitive, and you have to live in ethereum to do well.
@@PatrickAlphaC thank you
Hello, please have you made a tutorial on how to use the Flashloan to perform arbitrage trading? That'll be so helpful. Thank you
Like someone would straight up give u the code to make free money, lol♿️.
@@notsoluckycharms3838 Do you have the code, I'm ready to buy
For more enquiries, reach out⬆️⬆️⬆️...
Sick intro lol
For more enquiries, reach out⬆️⬆️⬆️....
Confused.
Love your vids
Thank you for watching, for question, guidance and support at anytime. Just DM +1.(4 .2 .3). 4 . 3 . 0 . 6 . 9 . 8 . 4 @ W H A T S A P...
He's my role model.
where is the arbitrage part
Really educational, I almost got scammed by another vid that claimed ETH flashloan arbirtrage but luckily was able to stop myself before going through with it. I felt pretty defeated :(
So now I have 0.1 ETH sitting in my wallet and I want to do flashloan arbitrage with it. How do we go about doing the actual arbitrage portion of it with the smart contract in order to make profit? Any vids on that coming out soon :)
Hey Patrick, great video. Would be really cool if you gave us some arbitrage ideas, and perhaps even a sample in action , even a sample that could be at loss since i guess it must be difficult to get real samples, ( and just not run it). , i just want to get inspired by what types / and what the code would look like etc.. thanks
Glad to hear it!
I'm not focusing on arbitrage for a bit now, since it sooooooo hard to be profitable.
@@PatrickAlphaC thanks for your response. Is it possible to use this cross chains? I believe it could be profitable then.
btw legendary intro for sure :)
@@briscomadani5018 it is not. Flash loans all need to happen in the same transaction, you can’t make 1 transaction on multiple blockchains right now
@@PatrickAlphaC ha , it was too good to be true :) I thought i had just discovered water. thanks for the replies, its very kind of you, all this help you give. thanks a lot.
Could you please do a video for people who don't know how to code. Like an introduction to video.
I did! It’s on Cyfrin Updraft!
My eyes are bad until I get my new glasses, how much Eth did you gain from this this run? I couldn't make out the numbers in the end
GREAT SUCCESS
Hey Patrick, I usually watch, like and download you videos and they are very helpful. I just have limited free time so I would like to know if you can create bnb smart chain flash loan arbitrage code because I trust you and I just need that code so that I can your videos contents with high motivation.
Thank you so much for this
Is there a video to install Brownie and Geneche and get to the point he's at. Looking for a video that does a step by step from beginning to end. Thanks.
He literally installs these two in this video. Go to 11:34.
Are flashloan arbitrage actually profitable and what are the issues with it to look for?
Beastie boys
Thank you very much, is the arbitrage script running in the same script of flashloan? So the first function will be executed the arbitrage class and then when the condition met, it will call the and execute the flashloan subroutine? Or each script independent of each other? Should I put both in the same script or not? Thanks
❤❤❤
Hi Patrick, is it difficult to make money from this? & is it difficult to find arbitrage? great video!
It's reeeaaalllyyyyyy competitve
It's not hard to find arbitrage
Hi Patrick,
This is a great video to make us understand what the whole concept of Flash loan.
But while trying to do this I am facing an issue, I am only able to get aave tokens on the amount of ETH that I have, if I am not wrong then we are getting loan on the showing collateral. Can you please guide me on how to get the flash loan successfully without collateral.
Or can you point me the code or the process on how I can take get the flash loan.
For more enquiries, reach out⬆️⬆️⬆️...
Hahaha you’re the man bro 😎
Can we have a2024 version?
Good idea
@@PatrickAlphaC pls pls pls 😊
In other words, You need 1 WETH in order that they could lend you 1WETH? This doesn't sound like a flashloan. Or I'm wrong?
Hi I was wondering if this still works with the new aave V3 core? If not I think a video on this would be super cool since I am sure there has been some changes over the last 10 months! thanks for the amazing vids
With V3 it’ll be a little different, but conceptually the same. V2 is still more popular though, and Thus has more liquidity. I might need to make a v3 edition
For more enquiries, reach out⬆️⬆️⬆️...
damm you gotta do all this !!!
amazing
your a legend!!!!
Also i imagine developers have bots that automate the execrution of these flash loans. You think there are still opportunites for non bot executions? How do you keep track of arbitrage opportunites?
Basically no… you pretty much won’t win without a bot unless you get rreeeaaallllyyy lucky
@@PatrickAlphaC You got any idea how I can build my own bot for this? Like a bot that triggers the flashloan when when it recognizes a profitable opportunity between two exchanges? Have you tested out somehting like that?
@@omar1187 this takes a loooot of savvy understanding of blockchain and code. Basically you’d constantly scrape for arb opportunities and then have to strike quick and fast with a lot of gas. It’s really hard
@@PatrickAlphaC Talking to a who is pretty saavy with polygon and Eth coding. Hes familiar with the concept. Your contracts would you say these could be a good foundation to work off of for developing this?
@@omar1187 yes, very much so. To be honest most of the leg work is on you though
Wow thanks!
Is arbitrage the only way to profit from flashloans or are there other use cases?
Nope, you can use flash loans to do a bunch of stuff. Like leverage up anything you do.
quick question. lets say a token is being minted at a certain price but the exchange is listing it a a different price is that considered a arbitrage opportunity worth creating a flash loan for?
Potentially!!
Awesome video Patrick! Do you have a video walking through the code of what to change in the contract to initiate a live flash loan?
Thank you! And what do you mean? All the code demoed here does that?
@@PatrickAlphaC I meant you said in the video usually you walk us through the code but here you were giving more of an overview or something like that. For example, when you said “you can put your logic here” could you walk us through the code, what we need to change, and then for example the logic you would need to use to do arbitrage between two exchanges?
@@cryptogems2024 aaahhh. I see. Yeah this would be a much longer video.
Basically, in that logic section, you’d define what exchanges to work with. And what protocols to send money to
@@PatrickAlphaC Thanks for the reply. Yeah I’m not a coder so I would need step by step. I’m learning but this stuff is a huge headache so far.
@@cryptogems2024 hmmm. Start with some of the earlier videos. This might be a little advanced. My python smart contract video is good
great video, just wondering how to get weth deposited back from the above code
goood man 😘
Hi Sir Jeff
Thanks for the tutorial! One thing I don't understand, though. If using an arbitrage strategy, where would we get the current prices for the exchanges? Also, wouldn't repeatedly checking for arbitrage opportunities accrue massive gas fees?
1. You could use the API of the exchanges to check the prices. Or you could just check against chainlink. If an exchange is saying the price of x is y, and the price on exchange z is k, that’s an indicator that that exchange might need to catch up.
2. No. This is why flash loans are so powerful. You can add a require statement like “if we make money, execute, otherwise revert” and it’ll cost $0 and only execute if you make money
There is a Templete in Node.js. which when copied automatically displays Arbitrage opportunities in pairs of Exchanges
@@lakshminarayan6727 Please do you have a link to the template?
@@lakshminarayan6727 can you send the link to that template?
@@lakshminarayan6727 Do you have a link to that template? Thank you!!