@elizaos/plugin-avalanche
A plugin for interacting with the Avalanche blockchain network within the ElizaOS ecosystem.
Description​
The Avalanche plugin enables comprehensive DeFi operations on the Avalanche network, including token transfers, YAK swaps, yield strategy management, and token creation via Token Mill.
Installation​
bun install @elizaos/plugin-avalanche
Configuration​
The plugin requires the following environment variable:
AVALANCHE_PRIVATE_KEY=<Your Avalanche private key>
Features​
1. Token Transfers​
- Send native AVAX and ERC20 tokens
- Support for multiple token standards
- Built-in address validation
2. YAK Swaps​
- Decentralized token swaps
- Automatic best path finding
- Slippage protection (default: 0.2%)
- Support for all major tokens
3. Yield Strategies​
- Deposit tokens into yield-generating strategies
- Support for multiple strategies including:
- YAK staking
- USDC Benqi
- gmYAK Token Mill
- PRINCESS staking
- JOE staking
4. Token Mill​
- Create new tokens
- Configure custom tokenomics
- Automatic market creation
Supported Tokens​
const TOKENS = {
AVAX: '0x0000000000000000000000000000000000000000',
WAVAX: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',
YAK: '0x59414b3089ce2AF0010e7523Dea7E2b35d776ec7',
gmYAK: '0x3A30784c1af928CdFce678eE49370220aA716DC3',
USDC: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E',
// ... and more
};
Usage Examples​
Token Transfer​
// Send AVAX
'Send 10 AVAX to 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
// Send ERC20
'Transfer 100 USDC to [address]';
YAK Swap​
// Swap tokens
'Swap 1 AVAX for USDC';
'Swap 10 USDC for gmYAK';
Yield Strategy​
// Deposit into strategies
'Deposit 1 USDC into the strategy';
'Deposit 10 gmYAK to earn yield';
Token Creation​
// Create new token
"Create a new memecoin called 'Test Token' with the symbol 'TEST'";
Providers​
1. Wallet Provider​
- Displays wallet balances
- Shows tokens in yield strategies
- Real-time balance updates
2. Strategies Provider​
- Lists available yield strategies
- Shows deposit token requirements
3. Tokens Provider​
- Lists supported tokens
- Shows token addresses
Development​
- Clone the repository
- Install dependencies:
bun install
- Build the plugin:
bun run build
- Run linting:
bun run lint
Dependencies​
- viem: ^2.21.49
- @elizaos/core: workspace:*
Future Enhancements​
-
Advanced DeFi Operations
- Multi-hop yield strategies
- Auto-compounding features
- Yield optimization algorithms
- Risk assessment tools
- Portfolio rebalancing automation
- Cross-chain yield farming
-
Enhanced Token Management
- Batch token operations
- Advanced token creation templates
- Token migration tools
- Automated token listing
- Token analytics dashboard
- Custom tokenomics implementation
-
YAK Protocol Integration
- Advanced routing algorithms
- MEV protection features
- Gas optimization strategies
- Liquidity analysis tools
- Price impact predictions
- Custom trading strategies
-
Benqi Protocol Features
- Collateral optimization
- Liquidation protection
- Interest rate monitoring
- Position management tools
- Risk assessment dashboard
- Auto-repayment features
-
Token Mill Improvements
- Advanced token customization
- Automated market making
- Token distribution tools
- Vesting schedule management
- Governance token features
- Token upgrade mechanisms
-
Security Enhancements
- Transaction simulation
- Smart contract auditing tools
- Real-time monitoring
- Automated safety checks
- Emergency shutdown features
- Multi-signature support
-
Developer Tools
- Enhanced debugging capabilities
- Testing framework improvements
- Documentation generator
- CLI tools for common operations
- Integration templates
- Performance monitoring
-
Analytics and Reporting
- Portfolio tracking
- Performance metrics
- Gas usage optimization
- Transaction history analysis
- Yield comparison tools
- Risk assessment reports
We welcome community feedback and contributions to help prioritize these enhancements.
Contributing​
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
Credits​
This plugin integrates with and builds upon several key technologies:
- Avalanche: High-performance blockchain platform
- avalanchejs: Official Avalanche JavaScript library
- YAK Protocol: Decentralized exchange aggregator
- Benqi: Lending and borrowing protocol
- Token Mill: Token creation platform
Special thanks to:
- The Ava Labs team for developing Avalanche
- The YAK Protocol development team
- The Benqi protocol developers
- The Token Mill platform team
- The Avalanche Developer community
- The Eliza community for their contributions and feedback
For more information about Avalanche capabilities:
License​
This plugin is part of the Eliza project. See the main project repository for license information.