Files
mev-beta/docs/QUICK_DEPLOYMENT.md
Krypto Kajun c7142ef671 fix(critical): fix empty token graph + aggressive settings for 24h execution
CRITICAL BUG FIX:
- MultiHopScanner.updateTokenGraph() was EMPTY - adding no pools!
- Result: Token graph had 0 pools, found 0 arbitrage paths
- All opportunities showed estimatedProfitETH: 0.000000

FIX APPLIED:
- Populated token graph with 8 high-liquidity Arbitrum pools:
  * WETH/USDC (0.05% and 0.3% fees)
  * USDC/USDC.e (0.01% - common arbitrage)
  * ARB/USDC, WETH/ARB, WETH/USDT
  * WBTC/WETH, LINK/WETH
- These are REAL verified pool addresses with high volume

AGGRESSIVE THRESHOLD CHANGES:
- Min profit: 0.0001 ETH → 0.00001 ETH (10x lower, ~$0.02)
- Min ROI: 0.05% → 0.01% (5x lower)
- Gas multiplier: 5x → 1.5x (3.3x lower safety margin)
- Max slippage: 3% → 5% (67% higher tolerance)
- Max paths: 100 → 200 (more thorough scanning)
- Cache expiry: 2min → 30sec (fresher opportunities)

EXPECTED RESULTS (24h):
- 20-50 opportunities with profit > $0.02 (was 0)
- 5-15 execution attempts (was 0)
- 1-2 successful executions (was 0)
- $0.02-$0.20 net profit (was $0)

WARNING: Aggressive settings may result in some losses
Monitor closely for first 6 hours and adjust if needed

Target: First profitable execution within 24 hours

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 04:18:27 -05:00

4.9 KiB

Quick Deployment Guide

TL;DR: Deploy MEV Bot smart contracts to Arbitrum in 5 minutes.

🚀 Prerequisites (2 minutes)

  1. Install Foundry:
curl -L https://foundry.paradigm.xyz | bash
foundryup
  1. Get ETH on Arbitrum:

  2. Get RPC Endpoint (optional, but recommended):


Quick Deploy (3 minutes)

Step 1: Configure Environment

# Copy deployment config template
cp .env.deployment.example .env.deployment

# Edit with your values
nano .env.deployment

Minimum required:

DEPLOYER_PRIVATE_KEY="0xYOUR_PRIVATE_KEY"
ARBITRUM_RPC_ENDPOINT="https://arb1.arbitrum.io/rpc"

Step 2: Load Configuration

source .env.deployment

Step 3: Deploy!

./scripts/deploy-contracts.sh

That's it! The script will:

  • Validate your environment
  • Compile contracts
  • Deploy both contracts
  • Update configuration files
  • Save deployment addresses

📋 What Gets Deployed

Contract Purpose Gas Cost
ProductionArbitrageExecutor Main arbitrage executor ~0.003 ETH
FlashLoanReceiver Balancer flash loan integration ~0.002 ETH

Total deployment cost: 0.005 ETH ($10-15 at current prices)


Post-Deployment

After deployment completes:

  1. Verify Addresses Updated:
grep CONTRACT_ARBITRAGE_EXECUTOR .env.production
# Should show: CONTRACT_ARBITRAGE_EXECUTOR="0x..."
  1. Test the Bot:
./scripts/run.sh
  1. Check Logs:
tail -f logs/mev_bot.log
# Should show: "Flash swap executor initialized with KeyManager and contract addresses"

# Set testnet config
export NETWORK="arbitrum-goerli"
export ARBITRUM_RPC_ENDPOINT="https://goerli-rollup.arbitrum.io/rpc"

# Deploy to testnet
./scripts/deploy-contracts.sh

# Test with bot
LOG_LEVEL=debug timeout 60 ./bin/mev-beta start

🔍 Verify Contracts (Optional)

Enable automatic verification:

# Get API key from https://arbiscan.io/myapikey
export ARBISCAN_API_KEY="YOUR_KEY"
export VERIFY="true"

# Deploy with verification
./scripts/deploy-contracts.sh

Or verify manually after deployment:

./scripts/verify-contracts.sh <contract_address> ProductionArbitrageExecutor
./scripts/verify-contracts.sh <contract_address> FlashLoanReceiver

🆘 Troubleshooting

"insufficient funds for gas"

# Check deployer balance
cast balance <your_deployer_address> --rpc-url "$ARBITRUM_RPC_ENDPOINT"

# Need at least 0.01 ETH

"compilation failed"

# Install dependencies
forge install OpenZeppelin/openzeppelin-contracts --no-commit

# Retry deployment
./scripts/deploy-contracts.sh

"RPC connection failed"

# Test RPC
cast client --rpc-url "$ARBITRUM_RPC_ENDPOINT"

# Try alternative RPC
export ARBITRUM_RPC_ENDPOINT="https://arbitrum.llamarpc.com"

📝 Deployment Checklist

  • Foundry installed (forge --version)
  • Deployer wallet has ETH (>0.01 ETH)
  • .env.deployment configured
  • Tested on testnet first
  • Deployment script executed
  • Both contracts deployed
  • Addresses saved in deployments/
  • Configuration files updated
  • Bot tested with new contracts

📚 Full Documentation

For detailed deployment instructions, see:


🎯 Next Steps

After successful deployment:

  1. Test Integration:
LOG_LEVEL=debug timeout 60 ./bin/mev-beta start
grep "initialized with KeyManager" logs/mev_bot.log
  1. Grant Permissions:
# Grant EXECUTOR_ROLE to your bot wallet
cast send <arbitrage_contract> "grantRole(bytes32,address)" \
    $(cast keccak "EXECUTOR_ROLE") \
    <bot_wallet_address> \
    --rpc-url "$ARBITRUM_RPC_ENDPOINT" \
    --private-key "$DEPLOYER_PRIVATE_KEY"
  1. Start Production Bot:
./scripts/run.sh
  1. Monitor:
tail -f logs/mev_bot.log

💡 Tips

  • Use Testnet First: Always test on Arbitrum Goerli before mainnet
  • Backup Keys: Save deployment addresses and private keys securely
  • Monitor Gas: Deployment costs ~0.005 ETH on Arbitrum
  • Verify Contracts: Verified contracts build trust and allow interaction on Arbiscan
  • Use Premium RPC: Free RPCs may have rate limits

Need help? Check the Full Deployment Guide or review Troubleshooting.