FlashLoans & Arbitrage

In case of arbitrage example in DeFi 201 course we need 2 exchanges.
Where can I find the uniswap factory from exchanges?

Hello Amadeo,
when I try to deploy Arbitrage.sol, after the approve on Metamask the transaction remain always pending.
Also with myflashloan.sol I have the same issue. There are Problems in Kovan network ? I forgot something to do ?
I have simply copied code from Github to Remix. But I have always these issues.
Thanks

Hi @amadeobrands!

When I’m trying to call makeArbitrage() from https://github.com/Robsonsjre/FlashloanUsecases/blob/master/contracts/arbitrage/Arbitrageur.sol it or any other contract functions remix warns me with a message “Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
The execution failed due to an exception. Reverted”

I’ve funded the contract as was explained in the basic flash loan example video. So, it should have enough funds to pay the aave fee. So, it’s not that.

Any ideas?

1 Like

The status of the transaction is just “Fail”: https://kovan.etherscan.io/tx/0x67917484feedc8f984ffeff4473bb45007ed144f8ee45f4e480624b976dade90
No details on the error. By the way, when I was trying to make an arbitrage for 10 DAI, it was failing as well, but with “Fail with error ‘The requested amount is too small for a flashLoan.’” error message: https://kovan.etherscan.io/tx/0x9c97cd83221c02ee1c8aaf42fff463d1283cc929d1a960c468a667234f9bc9b7
So, I ended up with 10000 DAI that fails with no error message. Maybe something has changed and it’s time to update the course slightly?

At the same time when I swap the addresses of UNISWAP_FACTORY_A and UNISWAP_FACTORY_B it fails correctly with the message “Did not profit”. As expected. https://kovan.etherscan.io/tx/0xb1b032b09bf60acea33c55b400a807d73d1cf591dabbd9cd6598a7b5730d22d1

Ouch. And now https://kovan-uniswap.netlify.app/swap and https://kovan-uniswap2.netlify.app/swap respond with " Unavailable For Legal Reasons". Could you please update the course, guys? @ivanimgur-2020_12_22-17:28:41

I had the same problem too. I’ve raised it as an issue on GitHub. Something must have changed with the API or so.

I know it may be very simple and it’s probably not the issue but did you make sure you raised the Gas Fee

Guys, do you have a problem opening https://faucet.kovan.network/ ?

Hi @amadeobrands
Thanks for going in depth on all these arb opportunities and the DeFi courses.
Question: most of these forum posts are over a year old, and ETH rates are just stably high now compared to when you filmed DeFi 201. Where do you see the opportunities are now? Still on ETH network? or other? The network seems congested mots of the time.
I’ve been looking for some sort of graphing of Gas prices to look for best times to trade found this
Many thanks,
Jen

Im getting this weird error, i followed excatly same as in the video but still i got errors, any help?
Screen Shot 2021-06-23 at 9.51.36 PM

Hi my transection id is https://ropsten.etherscan.io/tx/0xde6b5e380687689ba5fab1d421376c940de1ef10fb9517fcda2679d72461e361 I ran the code as the provided in defi 201 but its giving me that Error I dunno how to solve it

Hey @abdularham, hope you are ok.

Might be that you have to sent BAT to your contract also, If my memory does not fails me, you have to fund your contract with few ETH, DAI and BAT.

image

Carlos Z

Hi sir I wasn’t doing the arbitrage or anything It was just a flash loan script I also sent 1 eth and 150 dai to the contract to check but still it failed I changed the lending pool address as provided in aave market link for the ropsten I think i’m doing it on ropsten that’s why its giving me that error I dont have Keth in my wallet that’s why I can’t do it in kovan if you can send me some Keh Then I can give it a try

1 Like

The contract for the flashloan is deployed on kovan network, so you need to do it on kovan, I know that aave have a faucet (mentioned in the course).

Also you can ask for KETH using this guide:

Carlos Z

Thank you so much for your guidance I’ve successfully made the flashloans but now I want to try different loan providers like dydx, carve, and compound etc can you guide me on how to edit this code to get loan from other providers instead of aave? I’ll appreciate that :slight_smile:

Hi I want a Defi flashloan arbitrage bot that can generate 5 to 10$ a day I will pay for the source code if anyone is interested and can make me a bot like that please reply.

It looks like this forum is inactive, but I’ll try anyway. How do you know which environment to select when deploying the contract? What are the differences?

Timestamp: 12:51 - Basic Flashloans Part 2

1 Like

Hey @SustainableProfits, hope you are well.

SOrry but I do not understand your question, what do you mean with the environment?

Carlos Z

go to 12:51 in the video Defi 201

i have issue in my smart contract IERC20 token transferFrom my wallet to smart contract then i will use uniswap swap tokens to token it will fail the my execution kindly help me to resolve this issue i have been stuck last on week thanks. this is kovan transcation fail link.
https://kovan.etherscan.io/tx/0xd074f4d6277e27668ac5ce8f48076a748fa69b58aac1842044f17b25d6bffb7e

1 Like

Transaction was reverted somewhere, check if you have require that is being triggered and its failing.

Also i suggest to use a error message for the requires, so when this kind of reverts happens, you have an idea on which one is failing:

Example:
require(amount <= balance, "Entered amount can't be higher than balance");

Carlos Z