A flexible rescue bot that continuously attempts to withdraw funds from DeFi protocols with limited liquidity.
Supports multiple rescue modes:
- ERC-4626 Vault Redeem - Works with any ERC-4626 compliant vault
- Morpho Market Withdraw - Withdraw liquidity from Morpho markets
Always create a fresh, one-time wallet to run this bot. Never use your main wallet's private key.
Setup:
- Generate a new wallet (bot wallet)
- Send ETH to bot wallet for gas fees
- For Morpho Markets: Authorize bot at https://www.monarchlend.xyz/tools
- For ERC4626 Vaults: Transfer shares to bot OR approve bot (delegate mode)
- Set your main wallet as
OWNER- rescued assets go here
This way, only the bot wallet is at risk, not your main funds.
- Node.js (v20 or higher) - Download from nodejs.org
- pnpm - Install with
npm install -g pnpm - RPC URL - Get free RPC from Alchemy or Chainstack
git clone https://github.com/antoncoding/auto-redeem.git
cd auto-redeempnpm installpnpm startThat's it! The interactive CLI will guide you through everything.
Before starting, you'll need:
- Bot wallet private key - Generate a one-time wallet at vanity-eth.tk
- RPC URL - Get free RPC from Alchemy or Chainstack
- Vault/Market address - The contract address where your funds are stuck
- Owner address - Your main wallet where rescued funds should go
📖 See detailed setup guide for step-by-step instructions on getting each of these.
The bot uses an interactive CLI that guides you through the entire setup process:
- Select a rescue mode - Choose between ERC-4626 Vault Redeem or Morpho Market Withdraw
- Enter credentials - Provide your bot wallet's private key and RPC URL
- Configure settings - Set vault/market addresses, recipient address, and monitoring interval
- Automated monitoring - The bot continuously checks and executes withdrawals when liquidity is available
Learn more about each mode:
- Vault Redeem - Withdraw from ERC-4626 vaults with delegate/non-delegate options
- Morpho Market Withdraw - Withdraw from Morpho lending markets
To stop the bot: Press Ctrl+C
For power users who want quick restarts with saved configuration:
# Vault Redeem
pnpm start:vault-redeem --vault 0xYourVault --owner 0xYourAddress
# Morpho Market Withdraw
pnpm start:morpho-market-withdraw --market-id YOUR_MARKET_ID --owner 0xYourAddressRequires a .env file with PRIVATE_KEY and RPC_URL.
See docs/direct-script-mode.md for complete setup instructions.
Simple logging output without interactive UI:
pnpm start:legacy- Direct Script Mode Setup - Advanced configuration with
.envfiles - Adding New Modes - Developer guide for extending the bot