About this project
Overview
FlashLoanArbitrage is a small Node.js command-line project for DeFi arbitrage built around flash loans. The README describes two parts: an on-chain smart contract that performs the borrow-buy-sell-repay cycle in USDC, and a local script, goflash.js, that watches prices and drives the contract. The author presents it as a personal project shared so others can try it.
How it works, as documented
The contract is said to take a flash loan in USDC, convert the user's ETH to USDC beforehand, buy ETH on a cheaper venue, sell it on a more expensive one, repay the loan plus fees and gas, then convert the remaining profit back to ETH. The local script polls ETH/USDC prices and only acts when the spread between venues is at least 0.9%; below that it waits. Scanning is described as running every 60 seconds, with a console display of each venue's price and an up/down/unchanged indicator.
Venues and providers named
Price sources: Chainlink (base oracle price), Uniswap V2, SushiSwap, Curve Finance and Balancer. Flash-loan providers: Aave (0.05% fee, quoted 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). Cost components listed are the flash-loan fee, a 0.1% trading fee, 0.05% slippage and gas.
Setup and usage
Download goflash.js and package.json, run npm install, then node goflash.js. Dependencies are ethers ^6.11.1, inquirer ^8.2.6 and chalk ^4.1.2. On first launch an interactive menu offers creating a new wallet or importing one by private key; the key is stored in wallet.json in the project folder. The main menu then allows choosing the flash-loan protocol, setting a loan amount in ETH (README suggests 10 ETH up to the protocol limit), recreating or re-importing a wallet, starting arbitrage, or exiting. The README advises keeping at least 0.1 ETH for gas when taking larger loans.
Points worth noting before trying it
The project structure lists only goflash.js, package.json, wallet.json and README.md, so no contract source is included with the described files. The README itself states that a 0.9% spread is rare in real markets and that the script will occasionally show a simulated opportunity for demonstration, which means displayed opportunities are not necessarily executable. It repeatedly warns about private-key handling rather than implementing key protection: the key is written in plaintext to wallet.json, and users are told to add it to .gitignore, back it up offline, use a dedicated wallet and start with small amounts. The project is shared as-is for educational purposes, use at your own risk, with no other license stated.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.