> For the complete documentation index, see [llms.txt](https://simsimbutdifferent.gitbook.io/prompt_web3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simsimbutdifferent.gitbook.io/prompt_web3/lesson-7/lesson-7-assignments-and-exercises/e1-uniswap-flashswap-dual-arbitrage-bot.md).

# E1 - Uniswap Flashswap dual Arbitrage Bot

I want to make a Flashloan tri arbitrage Bot. They project aims for the V1 version are below.

### The code

I will only post the key bits of code in here, because there are many different files. This was my first foundry project. However, I did also try to use hardhat as well, to help run the arbScanner, which was written in javascript. The original aims are below. Since writing them, I learned about uniswap flashswaps and felt that they would be more appropriate for this project.

### Original Project Aims

Create a solidity arbitrage bot that Uses flashloans, to execute triangular arbitrage in the Base L2 blockchain.

The Bot should consist of:

* 2 Interface groups
  * 1 for Uniswap token swaps and pair information
  * 1 for Aave flashloans
* 1 upgradable base contract, using the proxy upgrade pattern.

Execution:

* The bot should search for opportunities in list of high liquidity pairs. Say 5-10 different tokens to start with.
* the bot should only execute if the trade is profitable after fees, gas and depth have been taken into account.

<figure><img src="https://4122518092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTienvu3ChtlMIblXrX2h%2Fuploads%2Fiv2ibeGvqfPCg0WEhLlE%2FFlashLoan%20Arb%20Bot.png?alt=media&amp;token=0a05ca3d-5225-44b3-906e-2ac1136530ca" alt=""><figcaption></figcaption></figure>
