THOREAU ELIZA SUI DCA Agent Documentation
š¤ AI-Powered DeFi Trading Agent
An autonomous AI trading agent built on ElizaOS framework for SUI blockchain, implementing Dollar Cost Averaging (DCA) strategies with intelligent market analysis and automated portfolio management through natural language commands.
Repository: https://github.com/ecorey/THOREAU-ELIZAOS_SUI_DCA_AGENT
Problem & Solution Framework
š Market Challenges
- ⢠Volatility: Unpredictable price movements
- ⢠Timing Issues: Difficulty in market entry/exit
- ⢠Stress: Emotional decision-making
- ⢠Manual Management: Time-intensive monitoring
ā THOREAU Solution
- ⢠Hedging Capabilities: Risk mitigation
- ⢠Onboarding Flexibility: Easy setup
- ⢠Automated Features: Set-and-forget operation
- ⢠AI Intelligence: Smart decision making
System Architecture & Strategy
šļø Core Components
Strategy Component
Agent knowledge customized to Dollar Cost Averaging (DCA) strategies with intelligent market analysis
Memory Component
Agent capability to draw upon prior interactions and historical data for improved decision making
Key Features
- š¤ Natural Language Interface: Intuitive command system using plain English
- š° Automated DCA Orders: Set up recurring purchases with custom parameters
- š Multi-Protocol Integration: Bluefin DEX, Aftermath Finance, Kiosk NFT
- š Real-time Data Fetching: Live pool data and market information
- š NFT Verification: AF Egg ownership verification via Kiosk
- āļø Flexible Configuration: Customizable frequency, amounts, and price ranges
- š”ļø Built-in Risk Management: Price limits and safety protocols
Natural Language Command Interface
THOREAU operates through intuitive natural language commands, making DeFi trading accessible to users of all technical levels. Simply type commands in plain English to execute complex trading operations.
š” Example Interaction
User: "please create a DCA order for 2$ USDC every 6 days for 2 days and a max price of $9.50"
ā Agent automatically creates the DCA order with specified parameters
DCA Order Configuration
Configurable Parameters
š Investment Settings
- ⢠Total USDC Allocation: Amount to invest
- ⢠Trade Count: Number of orders in period
- ⢠Amount per Trade: USDC per transaction
ā° Timing & Limits
- ⢠Frequency: Hours, days, or weeks
- ⢠Min Price: Minimum purchase price
- ⢠Max Price: Maximum purchase price
Example Configuration
DCA Order Parameters: āāā Total USDC: $100 āāā Frequency: Every 6 days āāā Duration: 2 weeks āāā Trade Count: 2 orders āāā Max Price: $9.50 āāā Command: "createDca" ā Automated execution
Integrated Protocols
š Bluefin
Decentralized Exchange (DEX) for token swapping and pool data fetching
- ⢠SUI/USDC trading pairs
- ⢠Real-time pool data
- ⢠Liquidity information
ā” Aftermath Finance
DCA order management and automated trading execution
- ⢠DCA order creation
- ⢠Order management
- ⢠Automated execution
šŖ Kiosk
NFT ownership verification system for access control
- ⢠AF Egg NFT verification
- ⢠Ownership validation
- ⢠Access management
Complete Command & Action Reference
Total Commands Available: 7 (1 Data fetching + 2 Swap + 3 DCA management + 1 NFT verification)
š Data Fetching Commands
Command | Prompt Example | Action |
---|---|---|
bluefinFetchData | "please get info for bluefin pool 0x3b....." | Get pool data for Bluefin contracts |
š Token Swap Commands
Command | Prompt Example | Action |
---|---|---|
suiUsdcSwap | "please swap 1 SUI for USDC" | Swap SUI for USDC using Bluefin |
usdcSuiSwap | "please swap 4 USDC for SUI" | Swap USDC for SUI using Bluefin |
š° DCA (Dollar Cost Averaging) Commands
Command | Prompt Example | Action |
---|---|---|
createDca | "please create a DCA order for 2$ USDC every 6 days for 2 days and a max price of $9.50" | Create new DCA order using Aftermath Finance |
getActiveDcaOrders | "please get active orders" | Gets active DCA orders using Aftermath Finance |
cancelDcaOrder | "cancel DCA order 0xf6....." | Cancel DCA order using Aftermath Finance |
š NFT Verification Commands
Command | Prompt Example | Action |
---|---|---|
eggCheckByAddress | "check if 0x37..... owns an AF egg" | Use Kiosk address to prove ownership of AF Egg |
Installation & Setup
Prerequisites
- ⢠Node.js: Version 18 or later
- ⢠pnpm: Package manager
- ⢠Sui Wallet: Configured with SUI and USDC
- ⢠ElizaOS Framework: Latest version
- ⢠Git: For repository management
1. Clone Repository
git clone https://github.com/ecorey/THOREAU-ELIZAOS_SUI_DCA_AGENT.git cd THOREAU-ELIZAOS_SUI_DCA_AGENT
2. Install Dependencies
pnpm install
Configuration
Environment Setup
# Copy environment template cp .env.example .env # Configure your settings nano .env
Required Environment Variables
# Sui Network Configuration SUI_NETWORK=mainnet SUI_PRIVATE_KEY=your_private_key_here # Protocol Addresses BLUEFIN_CONTRACT_ADDRESS=0x... AFTERMATH_CONTRACT_ADDRESS=0x... KIOSK_CONTRACT_ADDRESS=0x... # Agent Configuration ELIZA_MODEL=gpt-4 MEMORY_RETENTION_DAYS=30 DCA_DEFAULT_FREQUENCY=weekly
Usage Examples
Starting a DCA Strategy
Example: Weekly SUI Purchase
User Input:
"please create a DCA order for 50 USDC every week for 4 weeks with a max price of $12"
Agent Response:
ā DCA order created successfully with 4 weekly purchases of $12.50 USDC each
Managing Active Orders
Check Active DCA Orders
"please get active orders"
Returns list of all active DCA orders with current status and remaining executions
Token Swapping
Immediate Swap Example
"please swap 10 SUI for USDC"
Executes immediate swap via Bluefin DEX at current market rates
Troubleshooting
Common Issues
Solution: Check USDC balance and ensure max price is reasonable
Solution: Verify wallet address and AF Egg ownership in Kiosk
Solution: Check network connectivity and token balances
Best Practices
- ⢠Start with small DCA amounts to test the system
- ⢠Set reasonable price limits to avoid extreme market conditions
- ⢠Monitor active orders regularly through the "get active orders" command
- ⢠Keep sufficient USDC balance for planned DCA executions
- ⢠Use natural language commands for better agent understanding