The 4g3n7 Auto Trader provides a verifiable and trustworthy solution to the critical challenge of automated trading: how can users verify that an AI agent operates exactly as intended, without compromising sensitive trading strategies or credentials?
This solution leverages Trusted Execution Environments (TEEs) through Marlin CVM to create a cryptographically verifiable trading agent. The core system combines:
-
Two-Tier Architecture: A minimal attestation service runs in the Marlin CVM providing cryptographic proof of integrity, while the full trading engine operates on a traditional server, creating a bridge between security and functionality.
-
Dual Agent Framework: A traditional trading agent works alongside an AgentKit-enhanced agent to provide complementary capabilities and built-in verification. This architecture allows for redundant decision-making while leveraging the strengths of both implementations.
-
Transparent Memory System: All trading decisions, analyses, and execution results are recorded using RecallMemoryManager, creating an immutable audit trail accessible to users. This system functions as a shared substrate between both agent types.
-
Verifiable Code Execution: Using Marlin's Confidential Virtual Machine (CVM), users can verify through attestation that the exact code they intend to run is executing in a secure environment with hardware-level isolation.
-
Cryptographic Trust Chain: The system employs Platform Configuration Registers (PCRs) verification and a chain of trust that extends from hardware to application layer, ensuring the integrity of the entire execution environment.
Unlike traditional trading bots that require blind trust, the 4g3n7 Auto Trader provides cryptographic proof that:
- The trading logic hasn't been tampered with
- User credentials remain secure and isolated
- Trading strategies are protected from unauthorized access
- System behavior matches exactly what was promised
The system connects to data sources and APIs to provide real-time market analysis and trading capabilities while maintaining security and verifiability throughout the entire process.
The 4g3n7 Auto Trader was built using a pragmatic approach focused on security, verifiability, and practical implementation:
LLM Integration and Provider Options:
- Google Gemini 2.0 Flash model as the primary LLM for market analysis and trading decisions
- Optional Azure OpenAI integration as a fallback or alternative LLM provider
- LangChain framework for structured agent reasoning with both LLMs
- Service interface abstraction to seamlessly switch between providers
Architecture Pattern:
- Separated concerns with attestation service in Marlin CVM and full trading engine on traditional server
- Communication bridge between the attested environment and the functional backend
- Verification checks before any sensitive operations are performed
- WebSocket integration for real-time client updates while maintaining attestation security
Backend Technology Stack:
- Node.js application built with modular components for trading, memory management, and attestation
- Dual agent implementation pattern with a traditional agent and AgentKit-enhanced agent
- CoordinatedAgent class that merges capabilities of both agent implementations
- WebSocket server for real-time updates to clients during trading operations
Marlin TEE Implementation:
- Specialized deployment on Arbitrum network using ARM64-based c7g.xlarge instance type
- Optimized Docker Compose configuration specifically designed for attestation verification
- Comprehensive PCR verification with known ARM64 values that represent the platform's integrity
- Automatic digest computation and verification for Docker configurations
- Periodic re-attestation every ~5 minutes with 20% probability to maintain security
- Agent security framework that requires valid attestation for wallet operations
Trading Integration:
- Coinbase Developer Platform (CDP) SDK for trade execution and account management
- AgentKit framework for enhanced trading capabilities with multiple action providers:
- walletActionProvider for wallet management
- erc20ActionProvider for token operations
- cdpApiActionProvider and cdpWalletActionProvider for Coinbase integration
- wethActionProvider, defillamaActionProvider, and others for market data
- Cascading verification approach with multiple fallback methods for attestation
Memory Management:
- RecallMemoryManager as the common memory layer for both agent types
- Transparent record-keeping of all agent actions and market analyses
- In-memory storage option for development and persistent storage for production
- Shared memory context between both agent implementations for consistent decision history
Security Architecture:
- Hardware-level memory encryption in the TEE to protect user credentials
- Attestation freshness verification (rejects attestations older than 24 hours)
- Service health verification before operations
- Secure API client that requires valid attestation for all calls
- Transaction signing that can only be performed in verified environments
This approach specifically addresses the "don't trust, verify" philosophy by providing users with cryptographic proof that their trading agent operates exactly as intended, creating a new paradigm for trustworthy autonomous financial systems.