edwin
GitHub
  • edwin - The DeFAI Layer
  • About
  • Getting Started
    • Quickstart
    • FAQ
    • Tokenomics
  • Core Concepts
    • 🦉How edwin Works
    • Protocol Abstraction Layer
    • AI Framework Adapters
    • Security Model
    • Action System
  • edwin cloud
    • Overview
    • Architecture
    • Transaction Flow
    • Platform Integration
  • Guides
    • Quickstart Guide: Using the MCP Server
    • Quickstart Guide: Set Up Your edwin Agent with ElizaOS
    • Run a Meteora LP Agent - No Coding Skills Required
  • Plugin Integration Guide
  • Community
    • Introduction
    • Contributing Guidelines
    • Support Channels
    • Brand Kit
Powered by GitBook
On this page
  • System Architecture
  • Core Components
  • Protocol Abstraction Layer
  • AI Framework Adapters
  • Security Layer
  • Data Flow
  • 1. Command Initiation
  • 2. Protocol Abstraction
  • 3. Security Checks
  • 4. Protocol Execution
  • Integration Points
  • For AI Frameworks
  • For DeFi Protocols
  • Technical Implementation
  1. Core Concepts

How edwin Works

PreviousTokenomicsNextProtocol Abstraction Layer

Last updated 2 months ago

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:

  1. Transaction Security

    • Transaction validation and signing

    • Amount and gas limits

    • Slippage protection

    • Failure recovery

  2. 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

🦉