Observed since 21 Oct, 09:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xkamal7/sui-agent
Atoma agents for Sui blockchain
A revolutionary AI-Agent powered framework for building sophisticated DeFi applications on the Sui blockchain. The SUI AI Agent Kit enables developers to create intelligent applications that can interact with multiple DeFi protocols seamlessly through natural language processing and automated transaction execution.
The SUI AI Agent Kit is more than just a toolkit—it's a comprehensive development framework that bridges the gap between complex DeFi operations and user-friendly applications. By leveraging advanced AI capabilities powered by Atoma Network, developers can build applications that understand natural language commands and execute sophisticated blockchain operations across multiple protocols.
-> 🚀 Accelerated Development
-> 🔌 Universal Protocol Support
-> 🧠 AI-Powered Intelligence
-> 👨💻 Developer Experience
┌─────────────────────────────────────────────────────────────────┐
│ SUI AI Agent Kit │
├─────────────────────────────────────────────────────────────────┤
│ 🧠 AI Layer (Atoma Network) │
│ ├── Intent Recognition ├── Query Decomposition │
│ ├── Tool Selection ├── Response Generation │
│ └── Context Management └── Error Recovery │
├─────────────────────────────────────────────────────────────────┤
│ 🛠️ Tool Registry & Execution Engine │
│ ├── Protocol Tools ├── Transaction Tools │
│ ├── Price Tools ├── Pool Management Tools │
│ └── Staking Tools └── Cross-Protocol Router │
├─────────────────────────────────────────────────────────────────┤
│ 🔌 Protocol Integration Layer │
│ ├── Aftermath Finance ├── Cetus Protocol │
│ ├── Navi Protocol ├── Suilend Protocol │
│ ├── Bluefin Exchange └── [Extensible for new protocols] │
├─────────────────────────────────────────────────────────────────┤
│ ⛓️ Sui Blockchain Layer │
│ ├── Transaction Building ├── Gas Management │
│ ├── Wallet Integration ├── Network Management │
│ └── Event Monitoring └── State Synchronization │
└─────────────────────────────────────────────────────────────────┘
-> 🌊 Aftermath Finance - AMM & Liquid Staking
Key Features:
-> 🐋 Cetus Protocol - Concentrated Liquidity
Key Features:
-> 🏦 Navi Protocol - Lending & Borrowing
Key Features:
-> 🏛️ Suilend Protocol - Institutional Lending
Key Features:
-> 🌊 Bluefin Exchange - Perpetual Trading
Key Features:
-> 💰 Price & Market Data Tools
// Get real-time prices
'get_coin_price' - Single token price with 24h change
'get_coins_price' - Multiple token prices in one call
'get_spot_price' - Pool-specific pricing information
-> 🏊♂️ Pool Management Tools
// Pool operations
'get_pool' - Detailed pool information and stats
'get_all_pools' - List all available pools across protocols
'get_pool_events' - Historical deposit/withdrawal events
'get_pool_stats' - TVL, volume, fees, and APR analytics
-> 💱 Trading & Swap Tools
// Trading operations
'get_trade_amount_out' - Calculate expected swap outputs
'get_optimal_trade_route' - Find best cross-protocol routes
'get_router_trade_transaction' - Execute optimal swaps
'cetus_swap' - Direct Cetus protocol swaps
-> 🏦 Lending & Borrowing Tools
// Navi Protocol
'get_navi_portfolio' - Portfolio overview and health
'deposit_navi' - Supply assets to earn interest
'withdraw_navi' - Withdraw supplied assets
'get_navi_rewards' - Check available rewards
// Suilend Protocol
'create_lending_market' - Create custom lending markets
'deposit_into_obligation' - Supply collateral
'borrow_from_obligation' - Borrow against collateral
-> 🥩 Staking Tools
// Liquid staking operations
'get_staking_positions' - Current staking positions
'get_sui_tvl' - Total value locked in staking
'get_afsui_exchange_rate' - afSUI to SUI conversion rate
'stake_sui' - Stake SUI tokens for rewards
-> 💸 Transaction Tools
// Blockchain operations
'transfer_sui' - Send SUI tokens between addresses
'build_transfer_tx' - Build custom transfer transactions
'execute_transaction' - Execute pre-built transactions
'get_account_info' - Wallet balance and information
-> 📊 Analytics Tools
// Data and insights
'rank_pools_by_apr' - Find highest yield opportunities
'rank_pools_by_tvl' - Identify most liquid pools
'rank_pools_by_volume' - Discover most active pools
'get_pool_performance' - Historical performance metrics
-> Installation
npm install @0xkamal7/sui-agent
# or
yarn add @0xkamal7/sui-agent
# or
pnpm add @0xkamal7/sui-agent
-> Basic Setup
import { SuiAgentKit } from '@0xkamal7/sui-agent';
// Initialize with your private key and Atoma SDK token
const agent = new SuiAgentKit(
'your-atoma-bearer-token',
'mistral/mistral-nemo-instruct-2407', // Optional model selection
'your-wallet-private-key' // Optional for read-only operations
);
// Get account information
const accountInfo = await agent.getAccountInfo();
console.log('Account Info:', accountInfo);
// Start with a simple query
const response = await agent.processUserQueryPipeline(
"What is the current price of SUI?"
);
console.log('Response:', response);
-> 📱 Mobile & Frontend Integration
// React Native
import { SuiAgentKit } from '@0xkamal7/sui-agent/mobile';
// Web Frontend
import { SuiAgentKitWeb } from '@0xkamal7/sui-agent/web';
// Node.js Backend
import { SuiAgentKit } from '@0xkamal7/sui-agent';
-> Environment Configuration
Create a .env file in your project root:
# Required for AI capabilities
ATOMASDK_BEARER_AUTH=your_atoma_sdk_auth_token
# Optional: Custom model selection
ATOMA_MODEL_NAME=mistral/mistral-nemo-instruct-2407
# Optional: Default network (MAINNET/TESTNET)
SUI_NETWORK=MAINNET
# Optional: Custom RPC endpoints
SUI_MAINNET_RPC=https://fullnode.mainnet.sui.io
SUI_TESTNET_RPC=https://fullnode.testnet.sui.io
-> 🔍 Price Discovery & Market Analysis
// Get current token prices
const priceResult = await agent.processUserQueryPipeline(
"What is the current price of SUI, USDC, and BTC?"
);
// Advanced market analysis
const marketAnalysis = await agent.processUserQueryPipeline(
"Show me the top 5 pools by APR on Aftermath Finance with their TVL and volume"
);
// Cross-protocol price comparison
const priceComparison = await agent.processUserQueryPipeline(
"Compare SUI/USDC prices across Aftermath, Cetus, and Turbos protocols"
);
-> 💱 Intelligent Swap Operations
// Simple swap with AI optimization
const swapResult = await agent.processUserQueryPipeline(
"Swap 10 SUI to USDC using the best available rate",
walletAddress
);
// Cross-protocol routing
const complexSwap = await agent.processUserQueryPipeline(
"Find the optimal route to swap 100 USDC to afSUI and execute with 0.5% slippage",
walletAddress
);
// Multi-step arbitrage
const arbitrageResult = await agent.processUserQueryPipeline(
"Execute arbitrage: swap SUI to USDC on Aftermath, then USDC to SUI on Cetus if profitable",
walletAddress
);
-> 🏊♂️ Liquidity Pool Management
// Analyze pool opportunities
const poolAnalysis = await agent.processUserQueryPipeline(
"Find pools with over $1M TVL and APR above 15% that accept SUI deposits"
);
// Automated liquidity provision
const liquidityResult = await agent.processUserQueryPipeline(
"Deposit 5 SUI into the highest APR pool on Aftermath Finance with balanced allocation",
walletAddress
);
// Portfolio diversification
const diversification = await agent.processUserQueryPipeline(
"Distribute 20 SUI across the top 3 pools by APR, using 2 SUI per pool with remaining in highest APR pool",
walletAddress
);
// Position management
const positionResult = await agent.processUserQueryPipeline(
"Show my current liquidity positions and calculate their performance over the last 30 days",
walletAddress
);
-> 🏦 Advanced DeFi Strategies
// Yield farming strategy
const yieldStrategy = await agent.processUserQueryPipeline(
"Create a yield farming strategy: stake 10 SUI for afSUI, then provide afSUI-SUI liquidity on highest APR pool",
walletAddress
);
// Lending and borrowing
const lendingStrategy = await agent.processUserQueryPipeline(
"Supply 50 USDC to Navi Protocol, borrow 30 USDC against it, and stake the borrowed amount",
walletAddress
);
// Risk management
const riskManagement = await agent.processUserQueryPipeline(
"Monitor my lending positions and alert if health factor drops below 1.5",
walletAddress
);
// Automated rebalancing
const rebalancing = await agent.processUserQueryPipeline(
"Rebalance my portfolio: if any pool drops below 10% APR, move funds to pools above 20% APR",
walletAddress
);
-> 🎯 Portfolio Management
// Complete portfolio overview
const portfolioOverview = await agent.processUserQueryPipeline(
"Show my complete DeFi portfolio including liquidity positions, lending positions, and staking rewards",
walletAddress
);
// Performance analytics
const performance = await agent.processUserQueryPipeline(
"Calculate my total yield across all protocols for the last 30 days and project annual returns",
walletAddress
);
// Risk assessment
const riskAssessment = await agent.processUserQueryPipeline(
"Analyze the risk profile of my current positions and suggest optimizations",
walletAddress
);
-> 🛠️ Custom Tool Development
// Create custom tools for your specific needs
import { Tools } from '@0xkamal7/sui-agent';
const customTools = new Tools(bearerAuth, prompt);
// Register your custom tool
customTools.registerTool(
'my_custom_defi_tool',
'Description of what your tool does',
[
{
name: 'parameter_name',
type: 'string',
description: 'Parameter description',
required: true,
},
],
async (param: string) => {
// Your custom logic here
return JSON.stringify({
status: 'success',
data: 'Your result',
});
}
);
-> 🔌 Protocol Extension Framework
// Add support for new protocols
class MyProtocolTools {
public static registerTools(tools: Tools) {
tools.registerTool(
'my_protocol_action',
'Perform action on my protocol',
parameters,
async (...args) => {
// Protocol-specific implementation
return await this.executeProtocolAction(args);
}
);
}
}
// Register with the main agent
import { registerAllTools } from '@0xkamal7/sui-agent';
registerAllTools(tools);
MyProtocolTools.registerTools(tools);
-> 🧪 Testing & Development
// Built-in testing utilities
import { TestUtils } from '@0xkamal7/sui-agent';
// Test your implementations
const testResult = await TestUtils.testTool(
'your_tool_name',
['param1', 'param2'],
mockContext
);
// Simulate transactions without execution
const simulation = await agent.simulateUserQuery(
"Swap 1 SUI to USDC",
walletAddress
);
-> React Integration Example
import React, { useState } from 'react';
import { SuiAgentKit } from '@0xkamal7/sui-agent';
const DeFiInterface: React.FC = () => {
const [agent] = useState(new SuiAgentKit(bearerAuth, model, privateKey));
const [query, setQuery] = useState('');
const [result, setResult] = useState('');
const handleQuery = async () => {
const response = await agent.processUserQueryPipeline(query, walletAddress);
setResult(JSON.stringify(response, null, 2));
};
return (
<div>
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Ask me anything about DeFi..."
/>
<button onClick={handleQuery}>Execute</button>
<pre>{result}</pre>
</div>
);
};
-> Voice Interface Integration
// Add voice commands to your DeFi app
const speechRecognition = new SpeechRecognition();
speechRecognition.onresult = async (event) => {
const voiceCommand = event.results[0][0].transcript;
const result = await agent.processUserQueryPipeline(voiceCommand, walletAddress);
// Convert response to speech
const utterance = new SpeechSynthesisUtterance(result.message);
speechSynthesis.speak(utterance);
};
-> 🛡️ Security Considerations
-> ✅ Best Practices
// ✅ Secure private key handling
const agent = new SuiAgentKit(
process.env.ATOMA_BEARER_AUTH!, // From environment
undefined,
process.env.PRIVATE_KEY // From secure environment
);
// ✅ Error handling
try {
const result = await agent.processUserQueryPipeline(query, address);
// Handle success
} catch (error) {
// Handle errors gracefully
console.error('DeFi operation failed:', error);
}
// ✅ Transaction monitoring
const result = await agent.processUserQueryPipeline(
"Transfer 1 SUI with transaction tracking",
address
);
if (result.transactionHash) {
// Monitor transaction status
console.log(`Track transaction: https://suiexplorer.com/txblock/${result.transactionHash}`);
}
-> ⚡ Performance Features
-> 📈 Monitoring & Analytics
// Built-in performance monitoring
const agent = new SuiAgentKit(bearerAuth, model, privateKey);
// Enable performance tracking
agent.enablePerformanceTracking();
// Get performance metrics
const metrics = agent.getPerformanceMetrics();
console.log('Average response time:', metrics.averageResponseTime);
console.log('Success rate:', metrics.successRate);
console.log('Tool usage statistics:', metrics.toolUsage);
-> 🔗 Supported Networks
// Mainnet (Production)
const mainnetAgent = new SuiAgentKit(bearerAuth, model, privateKey, 'MAINNET');
// Testnet (Development)
const testnetAgent = new SuiAgentKit(bearerAuth, model, privateKey, 'TESTNET');
// Custom RPC endpoints
const customAgent = new SuiAgentKit(bearerAuth, model, privateKey, {
fullnode: 'https://your-custom-rpc.com',
faucet: 'https://your-faucet.com'
});
-> 📦 Production Deployment
// Production configuration
const productionAgent = new SuiAgentKit(
process.env.ATOMA_BEARER_AUTH!,
'mistral/mistral-nemo-instruct-2407',
process.env.WALLET_PRIVATE_KEY!,
'MAINNET'
);
// Add monitoring and error tracking
productionAgent.enableErrorTracking();
productionAgent.enablePerformanceMonitoring();
// Set up health checks
const healthCheck = async () => {
try {
await productionAgent.processUserQueryPipeline("Get SUI price");
return { status: 'healthy' };
} catch (error) {
return { status: 'unhealthy', error: error.message };
}
};
-> 🐳 Docker Deployment
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]
-> 🛠️ Contributing
We welcome contributions! Here's how to get started:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-feature-> 📋 Development Setup
# Clone the repository
git clone https://github.com/0xkamal7/sui-agent-kit.git
# Install dependencies
cd sui-agent-kit
npm install
# Set up environment
cp .env.example .env
# Edit .env with your configuration
# Run tests
npm test
# Start development server
npm run dev
-> 🗺️ Roadmap
-> 📊 Usage Statistics
-> 🌟 Featured Applications
This project is licensed under the ISC License - see the LICENSE file for details.
-> 💬 Community Channels
-> 🎓 Learning Resources
-> 🏢 Enterprise Support
Built with ❤️ for the Sui DeFi ecosystem by Kamal
Empowering developers to build the next generation of intelligent DeFi applications
Ready to revolutionize your DeFi development?
npx create-sui-agent-app my-defi-app
cd my-defi-app
npm start
Join thousands of developers building the future of finance!
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^1.7.9 | runtime |
bn.jsEnvironment{
"local_name": "bn.js",
"alias": false,
"peer_metadata": null
} | ^5.2.1 | runtime |
dotenvEnvironment{
"local_name": "dotenv",
"alias": false,
"peer_metadata": null
} | ^16.4.7 | runtime |
mongooseEnvironment{
"local_name": "mongoose",
"alias": false,
"peer_metadata": null
} | ^8.10.0 | runtime |
navi-sdkEnvironment{
"local_name": "navi-sdk",
"alias": false,
"peer_metadata": null
} | ^1.5.3 | runtime |
atoma-sdkEnvironment{
"local_name": "atoma-sdk",
"alias": false,
"peer_metadata": null
} | github:atoma-network/atoma-sdk-typescript | runtime |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.7.3 | runtime |
@mysten/suiEnvironment{
"local_name": "@mysten/sui",
"alias": false,
"peer_metadata": null
} | 1.1.0 | runtime |
@suilend/sdkEnvironment{
"local_name": "@suilend/sdk",
"alias": false,
"peer_metadata": null
} | ^1.1.36 | runtime |
aftermath-ts-sdkEnvironment{
"local_name": "aftermath-ts-sdk",
"alias": false,
"peer_metadata": null
} | ^1.2.53 | runtime |
@cetusprotocol/cetus-sui-clmm-sdkEnvironment{
"local_name": "@cetusprotocol/cetus-sui-clmm-sdk",
"alias": false,
"peer_metadata": null
} | ^5.3.1 | runtime |
@bluefin-exchange/bluefin-v2-clientEnvironment{
"local_name": "@bluefin-exchange/bluefin-v2-client",
"alias": false,
"peer_metadata": null
} | ^6.1.29 | runtime |
jestEnvironment{
"local_name": "jest",
"alias": false,
"peer_metadata": null
} | ^29.7.0 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^8.57.0 | development |
ts-jestEnvironment{
"local_name": "ts-jest",
"alias": false,
"peer_metadata": null
} | ^29.1.2 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^3.4.2 | development |
@types/jestEnvironment{
"local_name": "@types/jest",
"alias": false,
"peer_metadata": null
} | ^29.5.12 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^20.11.19 | development |
@types/bn.jsEnvironment{
"local_name": "@types/bn.js",
"alias": false,
"peer_metadata": null
} | ^5.1.6 | development |
@types/dotenvEnvironment{
"local_name": "@types/dotenv",
"alias": false,
"peer_metadata": null
} | ^8.2.0 | development |
@typescript-eslint/parserEnvironment{
"local_name": "@typescript-eslint/parser",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | development |
@typescript-eslint/eslint-pluginEnvironment{
"local_name": "@typescript-eslint/eslint-plugin",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | development |
Source distribution
{
"shasum": "bcfc0122e20fddae0ecc51d4d7dfa8b38c4a0c61",
"tarball": "https://registry.npmjs.org/@0xkamal7/sui-agent/-/sui-agent-1.0.0.tgz",
"fileCount": 52,
"integrity": "sha512-tCt+BcMngYfT90L9vPYGKDVQ+fB2YOuNv/At2aqqW4GMDbMeiQfEadqbaRKRKmWirApJEHPUITIfgByZ3J4Hxg==",
"signatures": [
{
"sig": "MEUCICwqOgO+3nxM4lgTHkve368op3IooGjMBBfne4qOiy/HAiEA3fWhbY0HjiuV4GqLkttjplQ/3D8Zlqd9sjWapK3KGWw=",
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
}
],
"unpackedSize": 466532
}Observed since 21 Oct, 09:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:5d897f661c57cdcb8a92b60498d23e84560ba9754ffc3503cfb6876dc9a17610