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

CommandPrompt ExampleAction
bluefinFetchData"please get info for bluefin pool 0x3b....."Get pool data for Bluefin contracts

šŸ”„ Token Swap Commands

CommandPrompt ExampleAction
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

CommandPrompt ExampleAction
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

CommandPrompt ExampleAction
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

Issue: DCA order creation fails
Solution: Check USDC balance and ensure max price is reasonable
Issue: NFT verification fails
Solution: Verify wallet address and AF Egg ownership in Kiosk
Issue: Swap execution fails
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