LIVE LINK: https://swell-agent-client.vercel.app/
GITHUB LINK: https://github.com/Kagwep/swell-agent
DEMO DOCS: https://docs.google.com/presentation/d/1fivYGhxQMrKXNyL8S6bBjO3sfyZMf9x4cL-1hoAItXk/edit#slide=id.p
DEMO VIDEO: https://youtu.be/z2I1hDz206Y
SwellChain Agent with Eliza
This guide explains how to build and customize SwellChain agents using the Eliza framework, enabling seamless interaction with the SwellChain ecosystem through various communication channels.
Overview
SwellChain Agent leverages Eliza's extensible agent architecture to provide a user-friendly interface for SwellChain operations. The implementation consists of:
Features
🔄 Token Transfers: Send tokens between addresses on SwellChain
🌉 Cross-Chain Bridge: Bridge assets between Ethereum and SwellChain
💱 Token Swaps: Exchange tokens using SwellChain's liquidity pools
📊 Price Oracle: Query current and historical token prices
💰 Earning Opportunities: Discover staking, lending, and liquidity provision options
Getting Started
Prerequisites
Node.js 23+
pnpm
An Ethereum wallet with SwellChain access
SwellChain Plugin Overview
The SwellChain plugin is located in the packages/swell-plugin directory. This plugin enables interaction with the SwellChain ecosystem through the Eliza agent framework.
Available Actions
The plugin provides the following actions:
Character Configuration
Eliza uses character files to define an agent's personality, knowledge, and capabilities. A SwellChain character file will look something like this:
{
"name": "SwellGuide",
"description": "An expert in SwellChain operations",
"instructions": "You are SwellGuide, a helpful assistant for the SwellChain ecosystem. Help users with transfers, bridges, swaps, and finding earning opportunities.",
"plugins": ["@elizaos/plugin-swell"],
"model": {
"provider": "openai",
"model": "gpt-4",
"apiKey": "${OPENAI_API_KEY}"
},
"clients": ["web"]
}
You can customize:
Adding Multiple Agents
You can create and run multiple agents simultaneously with Eliza:
1. Create separate character files for each agent:
agents/
├── swellchain-expert.json
├── swellchain-trader.json
└── swellchain-developer.json
2. Start Eliza with multiple character files:
pnpm start --characters="agents/swellchain-expert.json,agents/swellchain-trader.json,agents/swellchain-developer.json"
Each agent will operate independently with its own personality and specialized knowledge.
Connecting to Communication Platforms
Web Interface
The web interface is enabled by default by including "web" in the "clients" array.
Discord
To connect your agent to Discord:
Add "discord" to the "clients" array in your character file:
"clients": ["web", "discord"]
Add your Discord bot token to your .env file:
Invite the bot to your server with appropriate permissions
X (Twitter)
To connect your agent to X (formerly Twitter):
Add "twitter" to the "clients" array:
"clients": ["web", "twitter"]
Add your X API credentials to your .env file:
Telegram
To connect your agent to Telegram:
Add "telegram" to the "clients" array:
"clients": ["web", "telegram"]
Add your Telegram bot token to your .env file:
SwellChain Plugin Capabilities
The SwellChain plugin provides the following actions:
Token Transfers
Transfer tokens between addresses on SwellChain:
Send 0.1 ETH to 0x1234...5678
Bridging Assets
Bridge tokens between Ethereum and SwellChain:
Bridge 5 ETH from Ethereum to SwellChain
Send 10 USDT from SwellChain back to Ethereum
Price Oracle Queries
Get current and historical token prices:
What's the current price of ETH/USDC?
Show me the historical price data for SWELL/ETH over the past week
Earning Opportunities
Discover yield-generating options:
Show me all lending opportunities with APR above 5%
What are the best pools for earning yield with ETH?
Token Swaps
Execute token exchanges on SwellChain:
Swap 0.5 ETH for SWELL with 0.5% slippage
Exchange 100 USDe for swETH
Customizing Your Agent
Personality and Knowledge
Modify the instructions field in your character file to specialize your agent. For example:
"instructions": "You are SwellTrader, an expert in finding the best SwellChain trading opportunities. Focus on helping users optimize their token swaps, find the best prices, and identify high-yield earning opportunities. Use technical analysis and market knowledge to provide trading insights."
Supported Tokens
The plugin supports all major tokens on SwellChain, including:
ETH (native token)
WETH
SWELL
USDe
swETH
rswETH
weETH
and many more
You can check the full list in the plugin's swap template.
Advanced Configuration
Multi-Agent Interactions
Create specialized agents that work together:
Users can interact with the agent that best suits their current needs.
Integration with External Data
The SwellChain plugin can be extended to incorporate: