deeplens-trade-mcp
v0.1.1
Published
MCP server for trading perpetuals on Aftermath Finance (Sui) via deeplens-trade SDK
Maintainers
Readme
deeplens-trade-mcp
MCP server that lets AI assistants trade perpetuals on Aftermath Finance (Sui blockchain). Works with Claude Desktop, Cursor, Windsurf, and any MCP-compatible client.
Powered by the deeplens-trade SDK.
Install
npm install -g deeplens-trade-mcpSetup
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"deeplens-trade": {
"command": "deeplens-trade-mcp"
}
}
}That's it. No private key needed.
How Trading Access Works
The MCP server uses Aftermath's agent wallet system instead of requiring your private key:
- On first run, the server auto-generates an agent keypair at
~/.deeplens/mcp-agent.json - Ask the AI: "What's my agent setup status?" — it calls
agent_setupand shows the agent address - From your main wallet (web app or CLI), grant trading permissions to that agent address
- Send ~0.1 SUI to the agent address for gas
- The agent can now trade on your account
Why this is better than a private key:
- Your main wallet key never leaves your control
- Agent can trade but cannot withdraw funds
- You can revoke access from your main wallet at any time
- Key is auto-generated and stored with 600 permissions
Read-Only Mode
To block all trading operations (market data + paper trading only):
{
"mcpServers": {
"deeplens-trade": {
"command": "deeplens-trade-mcp",
"env": { "DEEPLENS_READONLY": "true" }
}
}
}Advanced: Direct Private Key (not recommended)
If you prefer to use a raw key instead of agent delegation:
{
"mcpServers": {
"deeplens-trade": {
"command": "deeplens-trade-mcp",
"env": { "DEEPLENS_PRIVATE_KEY": "suiprivkey1..." }
}
}
}Tools (21)
Setup
| Tool | Description |
|------|-------------|
| agent_setup | Check agent wallet status, get address for granting permissions |
Market Data (no wallet needed)
| Tool | Description |
|------|-------------|
| get_prices | Live perpetual prices for BTC, ETH, SUI, XAUT, XAG |
| get_market_stats | 24h stats — volume, funding rate, open interest |
| get_orderbook | Bid/ask depth for a specific market |
| get_signals | Trading signals via momentum + MA crossover + funding fade |
| get_vaults | List all Aftermath LP vaults |
Account & Positions (wallet required)
| Tool | Description |
|------|-------------|
| get_account | Account summary — collateral, equity, margin, PnL |
| get_positions | All open perpetual positions with live PnL |
| get_order_history | Past order history |
| get_balances | Wallet token balances (SUI, USDC, etc.) |
Trading (wallet required)
| Tool | Description |
|------|-------------|
| open_position | Open a long or short with leverage, SL/TP |
| close_position | Close a position by market symbol |
| deposit_collateral | Deposit USDC into perps account |
| withdraw_collateral | Withdraw USDC from perps account |
Swaps (wallet required)
| Tool | Description |
|------|-------------|
| get_swap_quote | Get a swap quote without executing |
| swap_tokens | Execute a token swap |
DCA (wallet required)
| Tool | Description |
|------|-------------|
| create_dca_order | Create a dollar-cost averaging order |
| get_dca_orders | List active DCA orders |
Paper Trading (no wallet needed)
| Tool | Description |
|------|-------------|
| paper_open | Open a simulated position with virtual funds |
| paper_close | Close a paper position at current market price |
| paper_portfolio | View portfolio, PnL, win rate |
Example Conversations
"Set up my trading agent"
Calls agent_setup → shows agent address and instructions for granting access.
"What's the BTC funding rate?"
Calls get_market_stats → responds with the current funding rate.
"Open a 3x long on ETH with $50"
Calls open_position with { market: "ETH", side: "long", collateral: 50, leverage: 3 }.
"Paper trade a short on SUI with $200 at 2x"
Calls paper_open — no real funds used.
License
MIT
