Lets hack Flash Loans | Flash loan assignment/discussion

I might have had the same problem yesterday. At least when it shows the “Something went wrong” error on the faucet page. They don’t show the error, but it’s a “daily limit error”. I tried this morning, and that worked. So it might be depending on the time of the day.

What is your address? I can send you some DAI / BAT / ETH

2 Likes

Yes, he tried all day and gives me the error.
Don’t have a Maker? instead of Ether
Thanks for the help the address is
0x34d1C8f28aa9B60D863dbb38e53422998AF5798D

1 Like

No sorry, no MKR. Send you some other coins though to play with.
Note you might need to add them as custom tokens to MetaMask before you can see them (you can see the testnet BAT and DAI addresses at the bottom of this page: https://docs.aave.com/developers/deployed-contracts/deployed-contract-instances)

1 Like

Thanks men for your help

2 Likes

Finally got some free BAT tokens on the testnet (forgot to add an initial DAI deposit, but once it’s working, it’s really straight forward), I see how powerful this can be. But I think things will probably become way more complex on the main net. Like how would you figure out where arbitrage can be found (scanning all the pools probably?) and calculate potential profits and the ideal buy amount instead of trial and error.

Also @amadeobrands what is your opinion on dy/dx? Since it doesn’t have any fee? Is it superior or are there also drawbacks? And please do a DeFi 301 in the future, I really love these courses :smiley: Thank you so far!

2 Likes

Hi @amadeobrands ,

I would like to ask if it is possible to change the code such that it uses arbitrage to buy ether on the uniswap test pools and sell them for dai instead as there is currently no arbitrage opportunity between dai and bat tokens?

I have tried changing the token addresses and the BAT_ADDRESS to ETH_ADDRESS but it does not seem to work? any advice would be very much appreciated!

Also, i would like to ask in the executeOperation() function, where does the value of the fee_ variable come from? as the fee_ variable is not manually inputted and i do not see any line of code that assigns any value to it. Could you clarify?

Thanks!

1 Like

Thank you :slight_smile:
DyDX is amzing a bit more complex to implement.

For a follow up I was thinking of creating some sick yield hacking strategies and a guide on how to become more bankless.

1 Like

Interesting.
The price corrects it self since people are arbitraging it :stuck_out_tongue:
You can re-balance it by swapping some DAI for BATI just did this so there is some profit potential again.

Just wanted to make a quick note regarding a lot of peoples reaction to this course… A lot of amazing valuable information is in this course if you are willing to research and look deeper into not only the videos but all the reading content provided… @amadeobrands and @ivan, @filip… everyone here put more effort than you think into providing some life changing information in a lot of these courses but nothing in this life comes for free… no one is going to just give you the lambo cheat code for life just because you paid a subscription fee… If you want to change your life you have to be prepared to study and work hard, take risks, and believe in yourself… not just copy and paste some code so you can retire early… It isn’t the job of any of these educators to make you successful. I find the negativity ESPECIALLY surrounding the DeFi environment a little bit disheartening, for how many opportunities there are in this space I see people getting caught up in a bit of a get rich quick mentality… I joined this community to be around a positive and supportive group of people with similar goals, but lately in this thread the attitude seems to be a little toxic and demanding…Could be a result of more aggressive marketing by the academy? But no fault of theirs its a business model… The reason people may suggest to ‘try again’ or ‘look harder’ is because all the information you need IS in the course… It isn’t up to anyone to hand you the answer on a silver platter… I’m not trying to be offensive or ruffle any feathers but I think its important to realise how much real information is available in this academy, If it doesn’t make sense yet then study harder… Sorry if this is a rant or inappropriate but I think its important to remember all these guys don’t HAVE to share this information, educating a community is more of a public service than a business venture… I wouldn’t take this for granted… Big love to the Academy and lets keep this thread productive and positive so we can all learn together :slight_smile:

8 Likes

Amazing man :smiley:
Keep up the good vibes and work hard.

Arbitrage seems easy $$$ But it is not you need to work hard and constantly help and balance the market this helps the market and if your lucky also your self.

An opportunity where I do not see many people active just jet is liquidity pools.
You can generate great GAINS with providing liquidity to Balancer/Uniswap this comes with great risks and also changes of infinitive losses so watch out.

1 Like

Great tool flash loans, I was testing

Attached the event log
Log
{
“from”: “0x1fa08cfac7d6B8cCC5a418146D7020C4529B5496”,
“topic”: “0x18911f3bf82397f7a1a10a26f395dc818734638e274f44c3067a90c3dafd8a8e”,
“event”: “loanProfit”,
“args”: {
“0”: “74108557022328688”,
“1”: “1003500000000000000”,
“2”: “1077608557022328688”,
“revenue”: “74108557022328688”,
“totalDebt”: “1003500000000000000”,
“dairevenue”: “1077608557022328688”,
“length”: 3
}
},

The details is that I wanted to try swapping between DAI and MKR and it keeps changing BAT as well as if I make the switch between DAI and SNX and I already created the exchanges and added liquidity

1 Like

Put the smartcontract code here https://github.com/Robsonsjre/FlashloanUsecases/issues

3 Likes

Thank you for your feedback and great work man good that you keep on hacking :smiley:
If you get the code to work for a 4 way Flash Loan you can commit this and I can accept that into the repo.

Sounds great! I have been pondering the question of how to get rid of my bank. Its not easy to unlearn and break old habits. So any help with this will be awesome.

ah i see, thanks for the re-balancing tip (or rather un-balancing tip), it works now for me!

I would like to ask, if i were to swap with ether, what is the address for ether as the aave documentation gives a mock address 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE which does not work?

Adding Custom Tokens into Kovan Test Net

I am not done with the course yet, In more accurate I am In the first part of the “Program Basic Flash loan”.
In the video Amadeo explains how to add Aave Tokens to Your Test Wallet and I found it slightly complicated. Here is a simplified way

First You choose the token and submit the request and confirm it:

Then you open the “View Transaction” Window And click on the “To: adress” in the Token Transfer section:

Then copy the the shown address, and just paste it into the custom address token, then click “next” and “Add Token”

In the examples I used KNC Token but it worked the same as any other token in there. Hope I helped, Good luck!

1 Like

Ok this one was tough as helll!!!

But at the end I made a few successfull arbitrage’s, and this is the highest one for me

The fee here was about 70 cents, how big of a difference there is on the mainnet for the fees?

And what if I barely have even 1 eth on me, I should stay away? :frowning: I’m dying to imply this on the mainnet (Obviously after abit more practice, But this currently is my best option to get out of where I am now xD) Alot of debt, physical work and barely covering my bills still so I can barely make it to invest every month even 200 USD of crypto… That’s why I jumped on DeFi 201, had to see this opportunity but it seems like I can’t afford it for now ahah…

But overall this is a great experience and hopfully I’ll become better at it and actually be able to use what I learned soon and on the mainnet, Cheers!

2 Likes

After A few more failiors, figured i needed to re eject more mkr into the pool… did it, failed a few more times, and got another sucessful arbitrage!

Question:
I pay Gas for every attempt regardless if it’s reverted, or successfull or if there was not enough gas, all the fees are paid regardless right?

Also I tried making a pool out of link token but for some reason I couldn’t add the liquidation to it (It did let me create the pool tho…) What am I missing here?

1 Like

I did some research on arbitrage on mainnet and came up with this great research paper: https://arxiv.org/pdf/1904.05234.pdf

The arbitrage space looks crowded with highly optimized bots controlling the market. Nevertheless I would still like to develop a bot just for fun. Worse thing that can happen is I would learn a ton and have fun in the process :slight_smile:

If anyone else has good info about arbitrage on mainnet I would love to hear about it.

7 Likes

Dayum, here goes all my hope :smiley:
Ahaha tnx for the info i’ll get to it.

1 Like