How Edwin Works
Last updated
Last updated
Edwin is a TypeScript library that serves as the bridge between AI agents and DeFi protocols. It provides a unified, secure interface for AI agents to interact with various DeFi protocols while abstracting away the complexity of blockchain operations and protocol-specific implementations.
The heart of Edwin is its Protocol Abstraction Layer, which provides a standardized interface for interacting with different types of DeFi protocols:
Lending Protocols: Standardized interfaces for lending and borrowing operations
DEX Protocols: Unified interfaces for liquidity provision and trading
Future Protocol Types: Extensible system for adding new protocol categories
Edwin's framework adapters enable seamless integration with AI frameworks:
Standardized command interface
State and context management
Response formatting
Error handling
Edwin incorporates multiple security measures to ensure safe DeFi operations:
Transaction Security
Transaction validation and signing
Amount and gas limits
Slippage protection
Failure recovery
Protocol Security
Whitelist verification
Protocol health checks
Operation boundaries
Risk assessment
AI agent generates a DeFi operation command
Framework adapter normalizes the command for Edwin
Command is mapped to standardized protocol interface
Protocol type is identified (Lending, DEX, etc.)
Operation is validated against protocol interface
Transaction validation
Protocol whitelist verification
Security boundaries check
Protocol interface executes operation through SDK
Transaction is signed and broadcast
Result is monitored and returned
Edwin provides a clean adapter interface that:
Accepts standardized commands
Handles response formatting
Manages state updates
Provides operation feedback
Protocols can integrate with Edwin through:
Implementation of protocol type interfaces
SDK integration
Edwin is an open-source TypeScript library that enables:
Extensibility to all protocols
Easy integration with existing frameworks
Community driven development