Features
Modular Plugin System: Extensible architecture for DeFi protocol integrations Multi-Protocol Support: Lending, liquidity, swap, perpetuals protocol, NFT Type Safety: Full TypeScript support with Zod validation schemas Multi-Chain: Support for multiple blockchain networks Action-Based: Define actions for supply, borrow, swap, and more Plugin for AAVE V3: Complete lending protocol with supply, borrow, repay, and withdrawInstallation
Core Architecture
Ember Plugin Interface
Every plugin implements the standardized This interface ensures every plugin provides:Metadata: Essential information about the protocol and pluginActions: Executable operations (supply, borrow, swap, etc.) with input/output token specificationsQueries: Read-only data access (positions, markets, health factors)Type Safety: Compile-time guarantees through TypeScript generics
EmberPlugin<Type>
interface that defines the contract between protocols and the ecosystem.Action-Based Design
Each plugin exposes specific DeFi actions with standardized interfaces:Input/Output Tokens: Define supported token transformationsCallback Functions: Handle the actual protocol interactionsFlexible Action System: Implement multiple strategies for the same action type
Plugin Registry
Central discovery system that manages plugin registration and lazy loading:
Plugin Types
The registry supports four main plugin types:Lending Plugins
Lending Plugins
Supply, borrow, repay, and withdraw operations across lending protocols.
Liquidity Plugins
Liquidity Plugins
Add and remove liquidity from DEX pools and AMMs.
Swap Plugins
Swap Plugins
Token exchange operations with slippage protection.
Perpetuals Plugins
Perpetuals Plugins
Long, short, and close perpetual positions with leverage.
Current Plugin Ecosystem
Plugin Discovery Flow
- Registration: Plugins register with the central registry during initialization
- Discovery: Agents query the registry for available actions by type
- Execution: Registry routes requests to appropriate plugin callbacks
- Validation: All inputs/outputs validated against TypeScript + Zod schemas