This chatbot demonstrates integration with multiple DeFi protocols across Base networks:
- Mexican Peso Stablecoin (XOC)
- Collateral types: WETH, CBETH
- LTV: 80%, Liquidation threshold: 85%
- Features:
- Deposit/withdraw collateral
- Mint/burn XOC
- Transfer tokens
- Monitor positions
- Integration with Alux lending pool
- Supply WETH as collateral
- Borrow XOC with variable/stable rate
- Repay XOC loans
- Withdraw collateral
- Bolivian Stablecoin (BOBC)
- Collateral type: WETH
- Fixed rate: 1 USD = 7 BOB
- Minimum collateralization: 200%
- Features:
- Claim WETH from faucet
- Deposit/withdraw collateral
- Mint/burn BOBC
- Monitor health factor
- Liquidate positions
The chatbot supports three operating modes:
- Chat Mode: Interactive command-line interface for direct user interaction
- Autonomous Mode: Bot operates independently, executing transactions at set intervals
- Telegram Mode: Interface through Telegram messenger
- Base Mainnet
- Base Sepolia (Testnet)
- Network selection at startup
- Automatic network validation before transactions
- Check token balances
- Transfer tokens
- Approve token spending
- Wrap/unwrap ETH to WETH
- Supply collateral
- Borrow assets
- Repay loans
- Withdraw collateral
- Monitor positions
- View collateralization ratios
- Network validation before transactions
- Balance and allowance checks
- Collateralization ratio monitoring
- Detailed error messages
- Transaction confirmation waiting
- Custom error handling for common scenarios
The chatbot handles various error scenarios:
- Insufficient balances
- Insufficient allowances
- Undercollateralized positions
- Network mismatches
- Failed transactions
- Invalid input validation
To add new features or modify existing ones:
- Update the relevant action provider in
src/action-providers/
- Add new schemas if needed
- Update the constants and error handlers
- Test thoroughly on testnet first
Required environment variables:
OPENAI_API_KEY=your_openai_api_key_here
NETWORK_ID=your_network_id_here
NETWORK_ID_2=your_secondary_network_id_here
WALLET_PRIVATE_KEY=your_wallet_private_key_here
MIT