Provides tools for interacting with Saros DeFi on Solana, including retrieving LP positions, simulating rebalancing strategies, analyzing portfolios, managing farm positions, and getting swap quotes for liquidity pools.
Includes a Telegram bot example that enables natural language interaction with Saros DeFi features, allowing users to check wallet positions, perform rebalancing analysis, and get portfolio analytics through chat commands.
Saros MCP Server
Model Context Protocol (MCP) Server for Saros DeFi - Exposes Saros SDK functionality as AI-accessible tools
Overview
This project implements a Model Context Protocol (MCP) server that wraps the Saros DeFi SDK, enabling AI agents, bots, and dashboards to interact with Saros liquidity pools, farms, and analytics through natural language or simple tool calls.
Features
Core MCP Tools
get_lp_positions
- Retrieve all liquidity pool positions for a walletsimulate_rebalance
- Simulate LP rebalancing based on IL thresholdportfolio_analytics
- Comprehensive portfolio metrics and risk assessmentget_farm_positions
- View farming positions and claimable rewardsswap_quote
- Get swap quotes with price impact and slippage
Demo Clients
Test Client - Command-line testing tool
Telegram Bot - Interactive bot for portfolio management
Quick Start
Installation
Running the Server
Testing
Usage Examples
Using with Claude Desktop
Add to your Claude Desktop MCP settings:
Then in Claude:
Real Working Example:
Wallet with actual LP positions: HqB8Rf76fAwmd4qZpL81yB2SSLFzEgdoPwpWAUJ31ont
(5 active positions)
Known Saros Pools:
C98/USDC Pool:
2wUvdZA8ZsY714Y5wUL9fkFmupJGGwzui2N74zqJWgty
Using with the Telegram Bot
Create a bot via @BotFather
Copy your bot token
Set environment variable:
Run the bot:
Chat with your bot:
Programmatic Usage
Project Structure
API Reference
get_lp_positions
Get all liquidity pool positions for a wallet.
Input:
Output:
simulate_rebalance
Simulate rebalancing strategy based on impermanent loss threshold.
Input:
Output:
portfolio_analytics
Get comprehensive portfolio analytics.
Input:
Output:
get_farm_positions
Get all farming/staking positions.
Input:
Output:
swap_quote
Get swap quote with price impact.
Input:
Output:
Architecture
MCP Server Layer
Handles MCP protocol communication
Exposes tools via stdio transport
Routes requests to service layer
Service Layer
PoolService: LP positions, pool info, swap quotes
FarmService: Staking positions, rewards
AnalyticsService: IL calculations, portfolio metrics
SDK Integration
Uses
@saros-finance/sdk
for Solana/Saros interactionsWraps SDK functions with error handling
Formats data for AI-friendly consumption
Development
Adding New Tools
Create tool handler in
src/tools/
:
Register in
src/index.js
:
Testing
Deployment
Local Deployment
Railway/Render
Create new service
Connect GitHub repo
Set build command:
npm install
Set start command:
npm start
Docker (Optional)
Roadmap
Add DLMM-specific features (advanced orders, dynamic fees)
Implement real-time price feeds
Add transaction execution tools
Multi-wallet management
Historical performance tracking
Web dashboard UI
Contributing
Contributions welcome! Please:
Fork the repo
Create a feature branch
Commit changes
Submit a PR
License
MIT License - see LICENSE file
Hackathon Submission
Project: Saros MCP Server Category: SDK Usage & Developer Tools Hackathon: Saros $100K Hackathon
Key Innovations
First MCP server for Saros DeFi
AI-native portfolio management
Natural language DeFi interactions
Foundation for autonomous trading agents
Demo
Test Client:
npm test
Telegram Bot: See examples/telegram-bot.js
Video Walkthrough: [Link TBD]
Resources
Support
GitHub Issues: Report bugs
Telegram: Community
Email: your-email@example.com
Built with ❤️ for the Saros Hackathon
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI agents to interact with Saros DeFi through natural language, providing tools for liquidity pool management, portfolio analytics, farming positions, and swap quotes on Solana.