Network support: Arbitrum (main), Polygon (soon), Base, Optimism, others planned.
Core idea: This bot monitors Aave V3 for liquidatable users (Health Factor < 1), initiates flash loans, repays debt, collects collateral, swaps it via DEX (e.g. Uniswap), repays the loan + fee, and keeps the profit. All done in a single atomic transaction.
predator/
├── contracts/ # Solidity smart contracts (e.g. FlashLoanLiquidator.sol)
├── scripts/ # TypeScript bot & deploy scripts
│ ├── bot.ts # Main liquidation monitoring logic
│ ├── deploy.ts # Deployment script for the contract
│ └── testBot.ts # Manual bot test script
├── test/ # Hardhat test files
│ └── test.ts # Basic smart contract tests
├── artifacts/ # Build output (ignored)
├── cache/ # Hardhat cache (ignored)
├── typechain-types/ # Auto-generated TypeScript types from ABI
├── .env # Environment variables (ignored)
├── hardhat.config.ts # Hardhat configuration (with networks & plugins)
├── tsconfig.json # TypeScript config
├── package.json # Dependencies and scripts
└── README.md # This file
# Compile contracts
npx hardhat compile
# Deploy to selected network (e.g., Arbitrum)
npx hardhat run scripts/deploy.ts --network arbitrum
# Run bot manually (e.g., on Arbitrum)
npx tsx scripts/bot.ts# RPC & Network
CHAIN=arbitrum
RPC_URL_ARBITRUM=https://...
RPC_URL_POLYGON=https://...
# Contracts
POOL_ADDRESSES_PROVIDER_ARBITRUM=0x...
POOL_ADDRESSES_PROVIDER_POLYGON=0x...
POOL_ADDRESS_ARBITRUM=0x...
FLASH_LIQUIDATOR_CONTRACT=0x...
# Subgraph
SUBGRAPH_URL_ARBITRUM=https://api.thegraph.com/subgraphs/name/...
SUBGRAPH_URL_POLYGON=https://api.thegraph.com/subgraphs/name/...
# Dex router (e.g. Uniswap V3)
DEX_ROUTER_ARBITRUM=0x...
DEX_ROUTER_POLYGON=0x...
# Wallet
PRIVATE_KEY=your_wallet_key
# Bot config
MIN_PROFIT=1000000000000000 # 0.001 ETH
SLIPPAGE_TOLERANCE=0.005 # 0.5%npx hardhat test- Solidity ^0.8.20
- Hardhat
- ethers.js v6
- graphql-request
- TypeScript + tsx
- Add support for Base, Optimism
- Integrate MEV (Flashbots)
- Create dashboard
- Swap aggregator (e.g., 1inch)
- Profit analytics
Made with 🦎 by a predator