Hi! First off all this is a great bare bones tutorial. It would be awesome if you could make a follow-up video of deploying the contract perhaps in Kovan or Ropsten test net. Thanks a lot in advance!
my friend I've watched a lot of your vid"s your helping me so much,i am working on becoming a programmer.thanks for breaking it down and saying what the plugins are for and how to use them properly.on other videos.i will connect all the dots and build a bad As bot lol.
Hi I like your video but can you show the exact steps to take that code and then exactly how to run the flash loan live or even testnet, but how to do everything from scratch assuming the person doesnt have any crypto experience but good programming experience thanks
You can check my playlist on Flashloan I have more videos. I also have a course on how to run Arbitrage Flashloan here: eattheblocks-pro.teachable.com/p/profitable-flashloans
Thanks for this.....great video.......I am new to solidity even though I have being using ethereum defi dapps for while....I really want to learn about this new flash loan concept...can you please share the code you used for this tutorial
sure you only have to register for free on eattheblocks.com to the free course and I will send you the link to the repo (that's only available to free and paid student who registered) By the way this is a tutorial series on Solidity, might be interesting if you are getting started: th-cam.com/video/p3C7jljTXaA/w-d-xo.html
Will the course also show how to actual launch the smart contract and able to perform real trade? If the transaction did not go succeed. Do we waste gas fee?
Thanks for the video, gained subscriber here. Just a question though? Is it really profitable and how much earning potential here? If it is profitable then senior blockchain developers might exploit it doing arbitrage trading all the time causing prices to balance out between exchanges.
Hey Benjamin. In feb, someone made 1M USD with 2 Flashloans. So it can definetly be profitable. This takes work to put in place though, and not everybody has the inclination to do that, including senior devs.
You have to wait for price volatility to increase thereby creating price discrepancy across different exchanges and exploit the transaction before the 2 prices match or get so close that the gas fees + .09% fee eat up profit. For instance 10 ETH borrowed times @ $1850 times .09% would cost $1665 for the AAVE fee plus gas fees. If the prices converge then throw it back and end the transaction do not complete it because you'll lose on the transaction plus fees.
@Eattheblock the remix site isn't loading on the site. Is there things to be done before it can show cause it's showing error on my laptop. I need the reply quick
If I deploy the contract as you have shown above , will it start taking the money from the lender from the lending pool automatically ? Or I have to search for a lender or convince him to give me the loan ? Is there any advertisement needed to get the lender?
What is or where can I find the number of flash loans issued by Aave. Daily to monthly figures. Do tell me someone did it and made $1m. How many did it and continuously made $5.
You have to ensure the receiving address / contract of the loan has the borrow amount + fee at the end of the transaction (same block) otherwise the transaction will fail and revert.
so just to make things clear, is it possible to win crypto with out having none? Because when you said at 1:44 "with use leverage" you completely confused me man. I know its possible, but you not doing that or you doing that? pd: Im just starting with code, thanks btw.
@@EatTheBlocks if it's a single use contract, why not ? You'd be leaving it on the blockchain forever and nobody will use it, plus isn't it a lot cheaper ? A transaction that writes new data to the blockchain costs a lot more lot more gas than one that only modifies some values, and transactions that delete data actually get rewarded, it's just good practise
@@pete275 Its wise to leave the contract so the algorithms and developers can audit the work in case of errors or fraud. One issue with leaving the contract is if too many people borrow at the same time using all available funds creating an illiquid chain event. I assume Aave would cancel borrowing at $10 Million or whatever amount. Those seeking to exploit the system to crash it or steal funds might exploit an exchange and try to hack. Exploit to distract while stealing etc.....
Hi. I have a question about this topic. So I learned coding with js solidity and python. And when I heard about these I wanted to try it but since am a student my budget is limited and I still don't know about gas fee. I joined a group on telegram and someone asked: how do you guys spot arbitrage opportunities? And I said that I do it by watching the markets. The most expert member of the group mocked me and said that if I don't get a bot I'll end up loosing my money for the gas fee. I wanted to ask: is it that bad to spot opportunities of 8% profit manually? Am really confused I know the market changes and slippage occurs but this 8% opportunity lasted for more than a day.
hi julian, as far as i understand to use it you have to call start loan then execute operation ? but if i am right this cant be done in one tx ? i must be missing some stuff i am not dev just learning
I didn't even get passed the first line of code in this video :( When I try to import the LendingPoolAddressesProvider contract it throws "Unable to import "openzeppelin-solidity/contracts/ownership/Ownable.sol": File not found" Any help with this is much appreciated
@@EatTheBlocks I don't understand your answer. I have the same issue than @Lennard Mulder. So I tried to manually replace all OpenZeppelin Github links in all imported contracts (from your 3 "import" line on the code start) but they are automatically replaced as soon as main code/contract is auto-compiled... Then I have always the bug message quoted by @Lennard Mulder, I tried lot of things for fix it but without success :/
@@cryptaccmora1194 did you ever figure out the Unable to import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol": File not found error? - same issue
Jai l'impression que vous parlez francais , dapres votre accent . Si cest le cas , pouvez voua faire des videos wn francais aussi svp sur les flash loans .merci
How would we be able to do a refinance loan? What if we have Dia lend out on Compound and we borrowed ETH, would a refi be better or a swap. Thank you very much
you can refinance by borrowing from flash floan, use this to take a loan at a better interest rate, with the money of the loan reimburse the original loan and when you get the collateral from the loan use that to reimburse the loan (and maybe use uniswap to change that collateral to the flash loan ccy if they are different)
Thanks for the tutorial. When I go to compile, it is throwing Unable to import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol" - How can i fix this? Thank You!!
This flash loan way like gameplay you can't ensure when you getting flash loan and pay gas Fees you will make profits more than gas Fees For example maybe you pay 1000$ gas Fees and you lose 10000$ So here you pay gas 1000$ gas Fees without making any profits So this bad way We need to flash loan way ensure you can make profits more than gas Fees 10 times If you know please tell us thank you .
Hello I followed the steps exactly and the complier threw this error not found openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol Do anyone know what would be the cause?
Great to see someone actually making an instructional video and showing that anyone can follow along if they take the time!!
Thanks Chris :)
An actual video without hype, nice. Thank you
Hi! First off all this is a great bare bones tutorial. It would be awesome if you could make a follow-up video of deploying the contract perhaps in Kovan or Ropsten test net. Thanks a lot in advance!
good idea I will think about it :)
Excellent idea! I think the next step would be of value for the space 😅
Heard you were asking questions in the Aave chat, have been waiting for this vid! Thanks for the info as always.
haha yes I did :)
my friend I've watched a lot of your vid"s your helping me so much,i am working on becoming a programmer.thanks for breaking it down and saying what the plugins are for and how to use them properly.on other videos.i will connect all the dots and build a bad As bot lol.
Happy to hear this Pablo :)
Did you manage to build your bot?
sir I want more of these
what keeps you from taking a flash loan and converting it to US dollars, buying stocks
you cant, it's only on the blockchain in a single transaction. There is no concept of loan duration with flashloans, it's instant.
@@EatTheBlocks So it can't be used to farm? How was done the hack to Harvest.finance done?
@@moibe182 @EatTheBlocks can you make about this please?
@ Eat the blocks these requires laptop right
After the loan is paid back and fees are paid, how does the money leftover end up in one of my wallets?
What do you mean in the same transaction? If someone gets a flash loan they need to pay it while there taking it out? I’m confused... mb😂😅
@EatTheBlócks 🦧 🦧 🦧
what app are you using. im a total beginner but keen to learn
Hi I like your video but can you show the exact steps to take that code and then exactly how to run the flash loan live or even testnet, but how to do everything from scratch assuming the person doesnt have any crypto experience but good programming experience thanks
You can check my playlist on Flashloan I have more videos.
I also have a course on how to run Arbitrage Flashloan here:
eattheblocks-pro.teachable.com/p/profitable-flashloans
Hi Julien, how do you get the prices avoiding latency?
I want to ditch my job. How do I get a job working on the block chain?
Learn Solidity & JS.
Thanks for this.....great video.......I am new to solidity even though I have being using ethereum defi dapps for while....I really want to learn about this new flash loan concept...can you please share the code you used for this tutorial
sure you only have to register for free on eattheblocks.com to the free course and I will send you the link to the repo (that's only available to free and paid student who registered)
By the way this is a tutorial series on Solidity, might be interesting if you are getting started:
th-cam.com/video/p3C7jljTXaA/w-d-xo.html
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "../interfaces/IFlashLoanReceiver.sol";
import "../../interfaces/ILendingPoolAddressesProvider.sol";
import "../../libraries/EthAddressLib.sol";
contract FlashLoanReceiverBase is IFlashLoanReceiver {
using SafeERC20 for IERC20;
using SafeMath for uint256;
ILendingPoolAddressesProvider public addressesProvider;
constructor(ILendingPoolAddressesProvider _provider) public {
addressesProvider = _provider;
}
function () external payable {
}
function transferFundsBackToPoolInternal(address _reserve, uint256 _amount) internal {
address payable core = addressesProvider.getLendingPoolCore();
transferInternal(core,_reserve, _amount);
}
function transferInternal(address payable _destination, address _reserve, uint256 _amount) internal {
if(_reserve == EthAddressLib.ethAddress()) {
//solium-disable-next-line
_destination.call.value(_amount)("");
return;
}
IERC20(_reserve).safeTransfer(_destination, _amount);
}
Enjoy it for free ;)
@@NIKO-bi9ec Can you help me to take a flash loans?I cant coding.If possible help me.I can give you all the information which you want.
@@NIKO-bi9ec Hi, thanks. Might I know which sections to tweak to allow it send the profit to my address after the transaction?
@@EatTheBlocks Thanks very much....I just signed up.....your tutorials are really helpful for starter like me.
Will the course also show how to actual launch the smart contract and able to perform real trade? If the transaction did not go succeed. Do we waste gas fee?
Yes
code starts around 4:00
Where can we get this smart contract to use for us
You can use the interface of Aave
@@EatTheBlocks do you have a video of how to use Aave?? thank you very much
Another great video!! Thank you bro!!
My pleasure!!
Thanks for the video, gained subscriber here. Just a question though? Is it really profitable and how much earning potential here? If it is profitable then senior blockchain developers might exploit it doing arbitrage trading all the time causing prices to balance out between exchanges.
Hey Benjamin. In feb, someone made 1M USD with 2 Flashloans. So it can definetly be profitable.
This takes work to put in place though, and not everybody has the inclination to do that, including senior devs.
You have to wait for price volatility to increase thereby creating price discrepancy across different exchanges and exploit the transaction before the 2 prices match or get so close that the gas fees + .09% fee eat up profit. For instance 10 ETH borrowed times @ $1850 times .09% would cost $1665 for the AAVE fee plus gas fees. If the prices converge then throw it back and end the transaction do not complete it because you'll lose on the transaction plus fees.
Do we have to pay the gas fees with our own money tho???
No. You would include that cost in the loan.
@Eattheblock the remix site isn't loading on the site. Is there things to be done before it can show cause it's showing error on my laptop. I need the reply quick
which error? You can ask your troubleshooting questions on Remix in the Remix discord / gitter, they will know how to help you better than me
@@EatTheBlocks alright do just that
If I deploy the contract as you have shown above , will it start taking the money from the lender from the lending pool automatically ? Or I have to search for a lender or convince him to give me the loan ? Is there any advertisement needed to get the lender?
This is a liquidity pool you don't have to deal with lenders directly. You are limited by the amount in the liquidity pool though
What is or where can I find the number of flash loans issued by Aave. Daily to monthly figures. Do tell me someone did it and made $1m. How many did it and continuously made $5.
Great! But how do you interact with the other protocols such as using the loan and buying on one dex and selling on another?
That's something I cover in this course:
eattheblocks-pro.teachable.com/p/profitable-flashloans
EatTheBlocks is this profitable and prod ready?
Hello @EatTheBlocks when does aave take their fees, when your suppose flashloan is a success?
You have to ensure the receiving address / contract of the loan has the borrow amount + fee at the end of the transaction (same block) otherwise the transaction will fail and revert.
how do you run a full test with flashloan v2?
i impresssed boys u need a make a group TG
where can i get your code?
so just to make things clear, is it possible to win crypto with out having none?
Because when you said at 1:44 "with use leverage" you completely confused me man.
I know its possible, but you not doing that or you doing that?
pd: Im just starting with code, thanks btw.
you don't "win" crypto, you can borrow crypto without having any, but you have to give it back in the same transaction.
so does this leave the contract installed in the blockchain? is there a way to make it clean up after itself, since you won't be using it again?
you can use the selfdestruct EVM opcode, but I dont see the point.
@@EatTheBlocks if it's a single use contract, why not ? You'd be leaving it on the blockchain forever and nobody will use it, plus isn't it a lot cheaper ? A transaction that writes new data to the blockchain costs a lot more lot more gas than one that only modifies some values, and transactions that delete data actually get rewarded, it's just good practise
@@pete275 Its wise to leave the contract so the algorithms and developers can audit the work in case of errors or fraud. One issue with leaving the contract is if too many people borrow at the same time using all available funds creating an illiquid chain event. I assume Aave would cancel borrowing at $10 Million or whatever amount. Those seeking to exploit the system to crash it or steal funds might exploit an exchange and try to hack. Exploit to distract while stealing etc.....
Hi. I have a question about this topic. So I learned coding with js solidity and python. And when I heard about these I wanted to try it but since am a student my budget is limited and I still don't know about gas fee. I joined a group on telegram and someone asked: how do you guys spot arbitrage opportunities? And I said that I do it by watching the markets. The most expert member of the group mocked me and said that if I don't get a bot I'll end up loosing my money for the gas fee. I wanted to ask: is it that bad to spot opportunities of 8% profit manually? Am really confused I know the market changes and slippage occurs but this 8% opportunity lasted for more than a day.
Almost all arbitrage opportunities are carried out by bots
@@jaspernelligan how to do arbitrage sir .
Pls teach me..
Great video, thank you!
Glad you liked it!
hi julian, as far as i understand to use it you have to call start loan then execute operation ? but if i am right this cant be done in one tx ? i must be missing some stuff i am not dev just learning
Yes you need to call startLoan. This is all done in 1 transaction thats the whole point of flash loans
@@EatTheBlocks but you have to call executeOperation at some point ? maybe from startloan ? i am confused
@@alexmelka5324 No, its the Aave smart contract that will call executeOperation() as a callback
EatTheBlocks aaaaaaaah ok
hi julien i am tryin to send you a mail at julien@lendingblock.com for professionel reasons but aint working
I didn't even get passed the first line of code in this video :(
When I try to import the LendingPoolAddressesProvider contract it throws "Unable to import "openzeppelin-solidity/contracts/ownership/Ownable.sol": File not found"
Any help with this is much appreciated
Check out the Github of Openzeppelin they updated to 3.0 some contracts were moved or removed
@@EatTheBlocks I don't understand your answer. I have the same issue than @Lennard Mulder. So I tried to manually replace all OpenZeppelin Github links in all imported contracts (from your 3 "import" line on the code start) but they are automatically replaced as soon as main code/contract is auto-compiled...
Then I have always the bug message quoted by @Lennard Mulder, I tried lot of things for fix it but without success :/
@@cryptaccmora1194 did you ever figure out the Unable to import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol": File not found error? - same issue
I fixed that, do you wanna know i did that?
Hi, I am getting the " Invalid input source specified" when I am doing import of LendingPoolAddressProvider. Could you please help me on it. Thanks
I have no idea :(
I have the same "Invalid input source" for the same Import (tested on Remix IDE desktop or Remix IDE Online)
Any word on when bZx will get their act together ?
hahaa I dont know the team of bZx so I cant really comment on them :(
Which app are you using to code?
vim, but I recommend VSCode for most people
Thanks!
Jai l'impression que vous parlez francais , dapres votre accent . Si cest le cas , pouvez voua faire des videos wn francais aussi svp sur les flash loans .merci
How would we be able to do a refinance loan? What if we have Dia lend out on Compound and we borrowed ETH, would a refi be better or a swap. Thank you very much
you can refinance by borrowing from flash floan, use this to take a loan at a better interest rate, with the money of the loan reimburse the original loan and when you get the collateral from the loan use that to reimburse the loan (and maybe use uniswap to change that collateral to the flash loan ccy if they are different)
great video thanks!
how to get code?
still works?
bro can you make a video how to take flash loan
mmm, this video is about that :)
explain dydx flashloan searched more but cant find video on dydx
eattheblocks-pro.teachable.com/
Thank you!
nice!
can we do arbirtage between pancake and uniswap ?
Yes, but not with flashloans
@@EatTheBlocks how we can do it?
do a abritrage trading bot??
Thq
But you lose the gas fee
Thanks for the tutorial. When I go to compile, it is throwing Unable to import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol" - How can i fix this? Thank You!!
you need to install openzeppelin with npm
@@EatTheBlocks How can I install it?
@@EatTheBlocks what is npm?
This flash loan way like gameplay you can't ensure when you getting flash loan and pay gas Fees you will make profits more than gas Fees
For example maybe you pay 1000$ gas Fees and you lose 10000$
So here you pay gas 1000$ gas Fees without making any profits
So this bad way
We need to flash loan way ensure you can make profits more than gas Fees 10 times
If you know please tell us thank you .
High-frequency trading lol
not possible due to the block time and fees are kinda crazy right now on ethereum
Line 11 has an error
Is there a way to code your own with python or java script?
How to run the code ? What IDE ?🤔
Remix IDE
You look like Zuckerberg
LMFAOOOOO
the classes are just way too expensive for the average guy :/
Your explanation is too complex. I don't understand anything
No need for all of this. Pawn My Bitcoin gives out crypto loans anonymously.
Sure no need to learn solidity. Just random click an interface like a 🐑😂 it's always a good idea to get educated!
you cut your hair
Hello
I followed the steps exactly and the complier threw this error
not found openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol
Do anyone know what would be the cause?