Core Sonic blockchain plugin for Eliza OS that provides essential services and actions for token operations, trading, and DeFi integrations.
The Sonic plugin serves as a foundational component of Eliza OS, bridging Sonic blockchain capabilities with the Eliza ecosystem. It provides crucial services for token operations, trading, portfolio management, and DeFi integrations, enabling both automated and user-directed interactions with the Sonic blockchain.
✅ Our Sonic plugin has been accepted by ElizaOS!
📌 See PR here: elizaos-plugins/registry#97
📌 Plugin Registry: elizaOS Plugin Registry
📷 Sonic plugin listed in the ElizaOS Plugin Registry:
- Token Transfers: Send Sonic native token S.
- Balance: Get token balances
- Wallet Provider: SonicWalletManager.
- Token Swaps: Execute trades between tokens using Jupiter aggregator
- Order Management: Place and track token orders
- Price Monitoring: Real-time price feeds and historical data
- Automated Trading: Configurable trading strategies and automation
- Liquidity Analysis: Monitor and analyze pool liquidity
- Market Making: Automated market making capabilities
- Yield Optimization: Smart routing for optimal yields
- Risk Management: Advanced risk scoring and monitoring
- Trust Scoring: Dynamic trust score calculation for tokens
- Risk Assessment: Real-time risk evaluation for trades
- Performance Tracking: Historical performance monitoring
- Simulation Mode: Test strategies without real transactions
Configure the plugin by setting the following environment variables:
const sonicEnvSchema = {
SONIC_WALLET_PRIVATE_KEY: string,
SONIC_RPC_URL: string,
};
- Node.js 23+ (using nvm is recommended)
pnpm install @elizaos-plugins/plugin-sonic
//or
// add this line to dependencies
"@elizaos-plugins/plugin-sonic": "github:thopatevijay/plugin-sonic"
pnpm i && pnpm build && pnpm start
import { sonicPlugin } from "@elizaos-plugins/plugin-sonic";
// Initialize the plugin
const runtime = await initializeRuntime({
plugins: [sonicPlugin],
});
Transfer SONIC tokens to another address:
// Example conversation
User: "Send 1 SONIC to 0x5C951583CEb79828b1fAB7257FE497A9Dc5896e6";
Assistant: "I'll send 1 SONIC token now...";
Query wallet balance:
// Example conversation
User: "What's balance of my wallet 0x5C951583CEb79828b1fAB7257FE497A9Dc5896e6";
Assistant: "Your wallet contains 4.6 S";
Transfers tokens between wallets.
// Example usage
const result = await runtime.executeAction("TRANSFER_TOKEN", {
recipient: "RecipientAddressHere",
amount: "1000",
});
-
Environment Variables
- Store sensitive keys in environment variables
- Use .env.example for non-sensitive defaults
- Never commit real credentials to version control
For issues and feature requests, please:
- Review existing GitHub issues
- Submit a new issue with:
- System information
- Error logs
- Steps to reproduce
- Transaction IDs (if applicable)
For direct support, reach out on Discord: @thopate_vijay
For more information about Sonic blockchain capabilities:
Built with ❤️ for the Sonic DeFAI Hackathon, March 2025.