Overview
The EVM plugin handles DeFi operations through a structured flow:Transfer Flow
1. User Intent
2. Action Recognition
The plugin identifies this as a transfer action based on keywords (send, transfer, pay).3. Parameter Extraction
Using AI, the plugin extracts:- Amount: 0.1
- Token: ETH
- Recipient: alice.eth (will resolve to address)
- Chain: Detected from context or defaults
4. Execution
- Validates recipient address
- Checks balance
- Builds transaction
- Estimates gas
- Sends transaction
- Waits for confirmation
5. Response
Swap Flow
1. User Intent
2. Route Discovery
- Queries multiple DEX aggregators (LiFi, Bebop)
- Compares routes for best output
- Considers gas costs
3. Execution
- Approves token if needed
- Executes swap transaction
- Monitors for completion
Bridge Flow
1. User Intent
2. Bridge Route
- Finds available bridge routes
- Estimates fees and time
- Selects optimal path
3. Multi-Step Execution
- Source chain transaction
- Wait for bridge confirmation
- Destination chain completion
Governance Flow
Proposal Creation
Voting
Error Handling
The plugin handles common errors gracefully:- Insufficient Balance: Checks before attempting transaction
- Network Issues: Retries with exponential backoff
- Invalid Addresses: Validates all addresses before use
- High Slippage: Warns user if slippage exceeds tolerance
Key Features
- Natural Language Processing: Understands various ways to express intents
- Multi-Chain Support: Automatically handles chain selection
- Gas Optimization: Estimates and optimizes gas usage
- Safety Checks: Validates all parameters before execution
- Real-Time Feedback: Provides transaction status updates