Skip to content

thopatevijay/plugin-sonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@elizaos-plugins/plugin-sonic

Core Sonic blockchain plugin for Eliza OS that provides essential services and actions for token operations, trading, and DeFi integrations.

Overview

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.

🎉 Milestone Achievement

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:

Screenshot 1: Sonic plugin listed in the ElizaOS Plugin Registry

Features

Token Operations

  • Token Transfers: Send Sonic native token S.
  • Balance: Get token balances

Wallet Provider

  • Wallet Provider: SonicWalletManager.

Future Enhancements

Trading Operations

  • 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

DeFi Integration

  • 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 & Security

  • 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

Configuration

Configure the plugin by setting the following environment variables:

const sonicEnvSchema = {
  SONIC_WALLET_PRIVATE_KEY: string,
  SONIC_RPC_URL: string,
};

Usage

  • 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

Basic Setup

import { sonicPlugin } from "@elizaos-plugins/plugin-sonic";

// Initialize the plugin
const runtime = await initializeRuntime({
  plugins: [sonicPlugin],
});

Send Token

Transfer SONIC tokens to another address:

// Example conversation
User: "Send 1 SONIC to 0x5C951583CEb79828b1fAB7257FE497A9Dc5896e6";
Assistant: "I'll send 1 SONIC token now...";

Screenshot 1: Transfer token

Check Wallet Balance

Query wallet balance:

// Example conversation
User: "What's balance of my wallet 0x5C951583CEb79828b1fAB7257FE497A9Dc5896e6";
Assistant: "Your wallet contains 4.6 S";

Screenshot 2: Description of what the second screenshot shows

Actions

transferToken

Transfers tokens between wallets.

// Example usage
const result = await runtime.executeAction("TRANSFER_TOKEN", {
  recipient: "RecipientAddressHere",
  amount: "1000",
});

getBalance

Safety & Security

Best Practices

  1. Environment Variables

    • Store sensitive keys in environment variables
    • Use .env.example for non-sensitive defaults
    • Never commit real credentials to version control

Support

For issues and feature requests, please:

  1. Review existing GitHub issues
  2. 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.

About

Core Sonic blockchain plugin for Eliza OS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published