A Python automation script for depositing USDC on (and withdrawing USDC from) Morpho vaults on the Arbitrum blockchain. This tool provides a simple command-line interface to interact with Morpho's decentralized lending protocol.
- Automated Vault Discovery: Fetches available USDC vaults from Morpho's GraphQL API
- Interactive Vault Selection: Browse and select from available vaults with APY and TVL information
- Deposit Management: Deposit USDC into selected Morpho vaults with automatic approvals
- Withdrawal Management: Withdraw USDC from vaults with multi-vault support
- Portfolio Tracking: View all active deposits across multiple vaults
- Gas Estimation: Real-time gas estimation with cost breakdown in USD
- Safety Features: Balance checks, transaction confirmations, and error handling
- Python 3.7+
- Arbitrum-compatible wallet with private key
- USDC balance on Arbitrum
- ETH balance for gas fees
- Arbitrum RPC endpoint
- Clone or download the script:
git clone <repository-url>
cd morpho_automation- Install required dependencies:
pip install web3 eth-account requests- Create a
.envfile in the project directory:
PRIVATE_KEY=your_private_key_here
ARBITRUM_RPC_URL=https://arb1.arbitrum.io/rpcRun the script:
python morpho_lender.pyThe script provides an interactive menu with the following options:
- 💰 Deposit USDC: Select a vault and deposit USDC
- 💸 Withdraw USDC: Withdraw USDC from your active deposits
- 📊 Check Status: View your balances and active deposits
- ❌ Exit: Close the application
- Start the script and check your current status
- Select "Deposit USDC" to browse available vaults
- Choose a vault based on APY and TVL
- Enter the amount to deposit
- Confirm the transaction after reviewing gas costs
- Monitor your deposits using "Check Status"
- Arbitrum Only: Currently supports only Arbitrum blockchain
- USDC Only: Supports only USDC vaults
- No Multi-Asset: Cannot handle vaults with other tokens (ETH, WBTC, etc.)
- CLI Only: Command-line interface only, no GUI
- Single User: Designed for single wallet operation
- No Scheduling: No automated/scheduled deposits or withdrawals
- ERC-20 Standard: Uses standard USDC contract for balance checks and approvals
- ERC-4626 Vaults: Integrates with Morpho's ERC-4626 compliant vault contracts
- Direct Web3 Integration: Built on Web3.py for direct Ethereum blockchain interaction. This project does NOT use the official Morpho SDK because the SDK is only available in JavaScript/TypeScript, not Python.
Use at your own risk. The authors are not responsible for any financial losses.