Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding variables to readme for ease of use, change bundle executor to use a flashloan #5

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

bertmiller
Copy link
Member

@bertmiller bertmiller commented Jan 18, 2021

Originally this PR was only about making changes to the readme to add variables in two places, but I accidentally committed to this branch instead of another, so it is now a PR to do that and add flashloans to the bot. Sorry!

Here are a list of changes to the readme:

  • Added BUNDLE_EXECUTOR_ADDRESS and a brief description to Environment Variables
  • Added ETHEREUM_RPC_URL to Usage
  • Changed spacing in Usage slightly for ease of reading

And to the actual functionality of the bot:

  • Added imports for flashloan execution in BundleExecutorFL.sol
  • Changed the smart contract to execute with a flashloan
  • Changed transaction execution in Arbitrage.ts to use a flashloan instead, in particular to pass in variables as encoded parameters
  • Filtering pairs by those that have an ETH balance of greater than 10
  • Minimum profit upped to 0.01 instead of 0.001 ETH
  • Updated the ABI of BundleExecutor to reflect the new flashloan execution
  • Upped the test volume as smaller opportunities are not viable

I've tested this using Hardhat (specifically lowering the profit threshold, copying the targets/params/profit/miner reward over to a test script, and ensuring it executes properly) and it works. It also successfully estimates gas. But I have yet to get any transactions accepted with this being deployed on mainnet.

@bertmiller bertmiller changed the title Adding variables to Environment Variables and Usage for ease of use Adding variables to readme for ease of use, change bundle executor to use a flashloan Jan 18, 2021
@thegostep thegostep requested a review from epheph January 24, 2021 17:29
@epheph
Copy link
Contributor

epheph commented Jan 30, 2021

@bertmiller did you get a chance to test this out like we discussed offline?

@bertmiller
Copy link
Member Author

bertmiller commented Jan 31, 2021

@epheph I did test it last weekend and today. Last weekend it worked on a local hardhat instance, but after running it for a few days it didn't have any transactions accepted. It would successfully estimate gas and I saw some decent sized arbs come through, so I was confused as to why it wasn't working.

That was running on Aave's v1 flashloans instead of v2, so I upgraded it to v2 and tested that on Hardhat today, which again worked. These changes are reflected in this PR. I've got it up and running so we'll see if this version gets any arbs. If it does I'll report back. Not sure what you want to do with the PR in the meantime. Sorry this has taken some time to get in place!

Also - the check that failed (npm test) isn't really a problem. The reason why that failed is because in Arbitrage.test.ts it expects a much lower test volume, and I've set the minimum test volume high (10 ETH vs the status quo of 0.01 ETH). If you set the test volume back to the array it was before then this passes all expected conditions.

@bertmiller
Copy link
Member Author

bertmiller commented Apr 6, 2021

So, to any searchers reading this as an update: this code works and a few people, myself included, have submitted successful transactions with it. But, it's almost certainly not profitable anymore with the increased competition for Uniswap like market arbs.

At some point in the future the new auth method needs to be added, and this should probably become a branch instead of a PR, but for now I'm just going to leave this PR open for folks who are interested.

@epheph
Copy link
Contributor

epheph commented Apr 6, 2021

@bertmiller i think the usefulness of having a non-WETH-custodian contract is 100% worth it and it is a much better example for people, especially those who don't have 10 ETH. let me review and merge, i really appreciate this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants