Lets hack Flash Loans | Flash loan assignment/discussion

Hi. I think its only me having problem. I managed to get to remix in the process following the instruction on the video course but the coding didn’t appear. Is there a better and shorter way to do the flash loan test?

1 Like

Are you doing the test just to run the flashloan and pay for it?
or are you doing the flashloan with the arbitrage option in Uniswap?

1 Like

I am doing the test of 1eth = 10k Dai for flash loan not on albitrage yet but stuck on remix it says No contract compiled yet - no coding showing. I think the video tutorial was done in March and the sites we are using has been updated since. Is it ok if you can email me new tutorial video.

1 Like

It would be best if you share the screenshot of the error, and the code you are using to help you.

It was trying to compile but clicked my name.sol while compiling done it by mistake and now it has a red warning on the compile icon button.
If remix site is not secured it maybe my antivirus blocking it that’s why I am having problem.

1 Like

In the compiler area it tells you what the possible error is, I attach an example

1 Like

Thank you for your feedback.
Did you made any code changes?

1 Like

Yes, only the written warning was different but I changed my name.sol and this is what it says on the warning now…browse/nidaflashloan.sol: Warning: Source file does not specify required compiler version! Consider adding " pragma solidity 0.6.6; "

Help…How can fix that? I am not a programmer. How can I get rid of the red warning? Tried to find ways to delete… because I thought it will be better to start again from fresh.
Thank you for responding.

1 Like

To help you we need you to share an image of the code to see where the error may be.

What version of solidity are you putting at the beginning of the code?

2 Likes

Thank you Thad, I will have a go again like I said no coding appeared I have blank screen. It was trying to compile slowly but I clicked on it by mistake. I will message you again next time

1 Like

Due to quick block times, it is best to utilize bots to scan for arbitrage and execute trades.

I am trying to program a node.js bot that does just this. @amadeobrands, do you think we could get deeper into arbitrage opportunities with bots? How else can we find main-net arbitrage with any real chance of executing flash loans?

Granted, it will require a substantial knowledge of Javascript, but is greatly rewarding. I know this is probably the best strategy, but am running into walls as my JS isn’t quite as polished as needed.

1 Like

Yes this is possible I do build bots for CeFi in DeFi bots can be a bit hard to build and needs at least 100K USD to build a good bot and then also need around 1Mill liquidity.

1 Like

First: I was sorry to read the comments from traders without any programming background expecting this to be a no coding course. The atmosphere got a bit toxic. I hope they are ok and otherwise I wish them good luck with their future arbitrage tradings without the option of coding.

Second: I was (positively) amazed by the fact that we are trying to arbitrage with a smart contract within the solidity blockchain. Not sure if it is the best way to approach this. Why not set up a simple node.js and write a tradingbot in javascript? The only thing I do not know is if the DEX-es are providing us with good enough API’s that we can use to collect the data. And also if the provided data is up-to-date. I would love to follow a course that creates an arbitrage bot based upon node.js. Something for a DeFi 301 course maybe?

2 Likes

Would definitely be interesting to see how an ERC-721 token is created!

How did this turn out in the end? Usually on DEX’s’ when there is no liquidity, you get a message saying “high slippage” or “no liquidity”. Your trade went through anyway?

Sounds like you didn’t actually create a flash loan, but did the whole process manually…

Would you consider add dydx flash loan? The fee of Aave flash loan is too high compared with dydx.

Yea it is a bit harder to implement but feel free to hook up the contacts for that

1 Like

Hi all,

I am not sure whether this is the perfect place to ask this… but since you will probably stumble across this problem anyway if you get sucked into this trading/flashloan game, I might as well ask it here. In the contracts I am programm I’d in some occasions want to withdraw WETH to ETH, in order to transfer the profit back directly in ETH. However, I cant get the withdraw to work. I have constructed the following minimal example to show the problem:

pragma solidity ^0.7.0;
//SPDX-License-Identifier: UNLICENSED


interface IWETH {
  function balanceOf(address owner) external view returns (uint);
  function approve(address spender, uint value) external returns (bool);
  function transfer(address to, uint value) external returns (bool);
  function deposit() external payable;
  function withdraw(uint256 wad) external;
}

contract WETHTest {
  function doIT(address weth_addr) public payable {
    IWETH _token = IWETH(weth_addr);
    _token.deposit{value:msg.value}();
    uint _amount=_token.balanceOf(address(this));
    _token.withdraw(_amount);
    msg.sender.transfer(_amount);
  }
}

This minimal code simply takes some money it is payed, deposits it into WETH (specified by the weth address given as input) and then tries to withdraw it again (which fails) and transfers the amount back to the user.

I have deployed this example to the Kovan testnet and ran a test, which you can see here:

As you can see, the call to withdraw fails. Note however, that direct withdrawals and deposits to the WETH contract work. So the problem seems to be somewhere in the contract code shown above.

I cant figure out what I am doing wrong. (Probably some beginners mistake in Solidity i guess.)

Thx in advance,
Philipp

Great course Amadeo

So many things to learn. As my internet speed is dodgy and I dont have the necessary programming prequisite, I couldnt do the assignment. But I will study all the links you state and I plan to do the programming courses later this year.
Cheers

1 Like