🦉How edwin Works
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.
System Architecture
Core Components
Protocol Abstraction Layer
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
AI Framework Adapters
edwin's framework adapters enable seamless integration with AI frameworks:
Standardized command interface
State and context management
Response formatting
Error handling
Security Layer
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
Data Flow
1. Command Initiation
AI agent generates a DeFi operation command
Framework adapter normalizes the command for edwin
2. Protocol Abstraction
Command is mapped to standardized protocol interface
Protocol type is identified (Lending, DEX, etc.)
Operation is validated against protocol interface
3. Security Checks
Transaction validation
Protocol whitelist verification
Security boundaries check
4. Protocol Execution
Protocol interface executes operation through SDK
Transaction is signed and broadcast
Result is monitored and returned
Integration Points
For AI Frameworks
edwin provides a clean adapter interface that:
Accepts standardized commands
Handles response formatting
Manages state updates
Provides operation feedback
For DeFi Protocols
Protocols can integrate with edwin through:
Implementation of protocol type interfaces
SDK integration
Technical Implementation
edwin is an open-source TypeScript library that enables:
Extensibility to all protocols
Easy integration with existing frameworks
Community driven development
Last updated