About this project
FlashLoanArbitrage — overview
The README describes a Node.js command-line bot for DeFi arbitrage funded by flash loans. Note that the repository name and description ("Monitors smart contract activity for opportunities") do not match the README content, which documents a bot called FlashLoanArbitrage; the documented project files are goflash.js, package.json, wallet.json and the README itself.
How it works
The bot is described as two pieces: an on-chain smart contract and the local script goflash.js. The script queries ETH/USDC prices from five sources — Chainlink as the reference oracle, Uniswap V2, SushiSwap, Curve Finance and Balancer — and waits for a maximum price difference of at least 0.9% before acting. When the threshold is met, it calls the contract, which takes a flash loan in USDC, buys ETH on the cheaper venue, sells it on the more expensive one, repays the loan plus fees and gas, converts remaining profit back to ETH, and returns the net profit to the user's wallet. Scanning repeats every 60 seconds and the console prints prices with up/down/unchanged indicators.
Flash-loan sources listed in the README are Aave (0.05% fee, up to 10,000,000 USDC), dYdX (0.05%, up to 500,000), Uniswap V3 (0.01%, up to 5,000,000) and Balancer (0.02%, up to 1,000,000). The README recommends dYdX or Uniswap V3 for lower fees and notes that larger loans carry larger fees.
Setup and operation
Installation is npm install in a folder containing goflash.js and package.json, then node goflash.js. On first run an interactive prompt (built with inquirer) offers to create a new wallet or import an existing one by private key; the key is written to wallet.json in the same folder. The main menu allows choosing the DeFi protocol, setting the loan amount in ETH (10 up to the protocol maximum), recreating or re-importing the wallet, starting arbitrage, or exiting. Dependencies listed are ethers ^6.11.1, inquirer ^8.2.6 and chalk ^4.1.2. The README states that a wallet balance below 0.1 ETH prevents selecting loans above 10 ETH, since it is used for gas, and that the documented fee model includes flash-loan fees, 0.1% trading fees, 0.05% slippage and gas.
Things to weigh before using it
- The README itself says a 0.9% spread is rare in real markets, that the bot may therefore find no opportunities, and that it "shows a simulated opportunity occasionally for demonstration".
- The private key is stored in plaintext in wallet.json; the README advises adding that file to .gitignore, keeping offline backups, using a dedicated wallet and never sharing the key.
- No contract source file appears in the project structure shown in the README, so the on-chain component is not documented in the files listed.
- The project is published "as-is for educational purposes. Use at your own risk."
Troubleshooting notes in the README cover module-format errors, invalid private key format, insufficient funds for gas, zero wallet balance, RPC reconnection, and missing ETH/USDC pairs on V2-style venues.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.