megaswap-elizaos-plugin
v1.0.0
Published
MegaSwap plugin for elizaOS — swap tokens, manage liquidity, and query prices on MegaETH (10ms blockchain) with AI agents
Downloads
19
Maintainers
Readme
MegaSwap ElizaOS Plugin
Trade tokens on MegaETH via MegaSwap — the AI-native DEX with 10ms execution and sub-cent gas fees.
This plugin gives ElizaOS agents the ability to swap tokens, check prices, manage liquidity, and query balances on MegaETH using natural language.
Installation
npm install megaswap-elizaos-pluginSetup
Add to your ElizaOS agent configuration:
import { megaswapPlugin } from "megaswap-elizaos-plugin";
const agent = new AgentRuntime({
// ...
plugins: [megaswapPlugin],
settings: {
MEGASWAP_PRIVATE_KEY: "your-private-key", // Only needed for swaps & liquidity
// MEGASWAP_RPC_URL: "https://mainnet.megaeth.com/rpc", // Optional, defaults to mainnet
},
});Note:
MEGASWAP_PRIVATE_KEYis only required for write operations (swaps, add/remove liquidity). Read-only operations (price quotes, pair info, token info, balances) work without a key.
Actions
| Action | What It Does | Needs Key? |
|--------|-------------|------------|
| GET_SWAP_QUOTE | Get a swap price quote | No |
| SWAP_TOKENS | Execute a token swap | Yes |
| GET_TRADING_PAIR | Pair reserves, price, TVL | No |
| LIST_TRADING_PAIRS | Browse all trading pairs | No |
| GET_TOKEN_BALANCE | Check ETH + token balance | No |
| ADD_LIQUIDITY | Add liquidity to a pool | Yes |
| REMOVE_LIQUIDITY | Remove liquidity from a pool | Yes |
| LIST_MEGASWAP_TOKENS | List known tokens | No |
| GET_TOKEN_INFO_MEGASWAP | Token name, symbol, supply | No |
Example Conversations
User: "How much MEGAS can I get for 1 ETH on MegaSwap?"
Agent: 1 ETH = 80,667 MEGAS (Price: 1 ETH = 80,667 MEGAS)
User: "Swap 0.1 ETH for MEGAS on MegaSwap"
Agent: Swap Executed — 0.1 ETH → ~8,066 MEGAS (TX: 0xabc...123)
User: "Show the ETH/MEGAS pair on MegaSwap"
Agent: WETH/MegaS — Reserves: 150.5 WETH, 12.15M MegaS — 1 WETH = 80,730 MegaS
User: "What tokens are available on MegaSwap?"
Agent: ETH/WETH, MEGAS, USDM, USDT0 — plus any ERC-20 by addressSupported Tokens
| Symbol | Token | Address |
|--------|-------|---------|
| ETH | Native Ether | — |
| WETH | Wrapped Ether | 0x3B40...3849 |
| MEGAS | MegaS | 0x3E96...FaF5 |
| USDM | MegaUSD | 0xFAfD...79E7 |
| USDT0 | USDT0 | 0xB8CE...9ebb |
Any ERC-20 token on MegaETH works too — just use the contract address.
Why MegaETH?
- 10ms block times — instant swap execution
- 100,000+ TPS — handles AI agent swarms
- Sub-cent gas — viable for high-frequency micro-trades
Related
- megaswap-mcp — MCP server for Claude Desktop, Cursor, VS Code
- megalaunch-mcp — Launch tokens on Solana via AI
- MegaSwap — DEX on MegaETH
License
MIT
