About this project

FlashLoanArbitrage is a JavaScript command-line tool for arbitrage on DeFi using flash loans. The README describes two parts: a smart contract that performs the trade sequence, and a local script, goflash.js, that runs on the user's own computer and triggers the contract when it sees a price opportunity. How the author says it works: the contract takes a flash loan denominated in USDC, buys ETH cheaply on one venue and sells it higher on another, repays the loan plus fees and gas, then converts the remaining profit from USDC back to ETH. The local script polls ETH/USDC prices on several platforms and only acts when the difference is 0.9% or more, a threshold the author chose to reduce the chance of loss-making trades. Flash-loan providers listed in the README: Aave (0.05% fee, up to 10,000,000 USDC), dYdX (0.05%, up to 500,000 USDC), Uniswap V3 (0.01%, up to 5,000,000 USDC) and Balancer (0.02%, up to 1,000,000 USDC). Larger loans carry larger fees, so the README advises against oversized loans on a small wallet balance. Price sources scanned are Chainlink as an oracle reference, Uniswap V2, SushiSwap, Curve Finance and Balancer. Running it: download goflash.js and package.json into any folder, run npm install, then node goflash.js. On first launch the script offers to create a new wallet or import an existing one by private key (0x-prefixed, 64 hex characters). The generated private key is stored in wallet.json in the same folder, and the README repeatedly warns to keep that file out of Git and to never share the key. The interactive menu (built with inquirer) exposes options for choosing the DeFi protocol, setting the loan amount in ETH, recreating or importing a wallet, starting arbitrage, and exiting; chalk is used for colored console output and ethers for Ethereum access. The README states that monitoring prints a table of ETH/USDC prices per platform with up/down/unchanged markers and the maximum spread between venues, refreshed periodically (it mentions a 60-second scan cycle). It also notes practical caveats: a wallet balance under 0.1 ETH is described as insufficient to cover gas for loans above 10 ETH; costs include flash-loan fees, about 0.1% trading fees, about 0.05% slippage and gas; and 0.9% cross-venue spreads are described as rare in real markets, with the script occasionally showing a simulated opportunity for demonstration. A troubleshooting section covers module-format errors, invalid private key format, insufficient funds for gas, zero wallet balance and RPC reconnection, and notes that a missing ETH/USDC pair on V2 is normal. Stated dependencies are ethers ^6.11.1, inquirer ^8.2.6 and chalk ^4.1.2. The project is published as-is for educational purposes with use at the user's own risk. Readers evaluating it should treat the profit framing and the contract code with caution: the workflow requires handling a private key for a funded wallet, the on-chain contract is not described as audited, and the README itself acknowledges that real opportunities at the stated threshold are uncommon.