outsmart-agent 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +204 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +15 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +305 -0
- package/dist/mcp/server.js.map +1 -0
- package/package.json +59 -0
- package/skills/outsmart/SKILL.md +306 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vincent so
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# outsmart-agent
|
|
2
|
+
|
|
3
|
+
**MCP server + AI skills for Solana trading.** Wraps the [`outsmart`](https://www.npmjs.com/package/outsmart) trading library as 11 MCP tools for AI agents.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npx outsmart-agent
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
> Starts an MCP server (stdio transport) exposing buy, sell, LP, quote, and balance tools across 18 Solana DEX protocols.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
### 1. Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g outsmart-agent
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Set Environment Variables
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export WALLET_PRIVATE_KEY="your-base58-private-key"
|
|
25
|
+
export RPC_URL="https://your-rpc-endpoint.com"
|
|
26
|
+
# Optional:
|
|
27
|
+
export JUPITER_API_KEY="your-jupiter-api-key"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 3. Configure Your MCP Client
|
|
31
|
+
|
|
32
|
+
#### Claude Desktop
|
|
33
|
+
|
|
34
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"outsmart-agent": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["outsmart-agent"],
|
|
42
|
+
"env": {
|
|
43
|
+
"WALLET_PRIVATE_KEY": "your-base58-private-key",
|
|
44
|
+
"RPC_URL": "https://your-rpc-endpoint.com"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Cursor
|
|
52
|
+
|
|
53
|
+
Add to `.cursor/mcp.json` in your project:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"outsmart-agent": {
|
|
59
|
+
"command": "npx",
|
|
60
|
+
"args": ["outsmart-agent"],
|
|
61
|
+
"env": {
|
|
62
|
+
"WALLET_PRIVATE_KEY": "your-base58-private-key",
|
|
63
|
+
"RPC_URL": "https://your-rpc-endpoint.com"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Claude Code
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
claude mcp add outsmart-agent -- npx outsmart-agent
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## MCP Tools
|
|
79
|
+
|
|
80
|
+
10 tools exposed over stdio transport:
|
|
81
|
+
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
|------|-------------|
|
|
84
|
+
| `solana_buy` | Buy tokens with SOL on any DEX |
|
|
85
|
+
| `solana_sell` | Sell tokens for SOL (percentage-based) |
|
|
86
|
+
| `solana_quote` | Get on-chain price from a pool |
|
|
87
|
+
| `solana_add_liquidity` | Add LP to a pool (supports DLMM strategies) |
|
|
88
|
+
| `solana_remove_liquidity` | Remove LP from a pool |
|
|
89
|
+
| `solana_claim_fees` | Claim accumulated swap fees from LP positions |
|
|
90
|
+
| `solana_list_positions` | List user's LP positions in a pool |
|
|
91
|
+
| `solana_token_info` | Get token market data from DexScreener |
|
|
92
|
+
| `solana_list_dexes` | List all available DEX adapters and capabilities |
|
|
93
|
+
| `solana_wallet_balance` | Check SOL or SPL token balance |
|
|
94
|
+
|
|
95
|
+
### Example: Buy a Token
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
User: "Buy 0.1 SOL of USDC on jupiter-ultra"
|
|
99
|
+
|
|
100
|
+
Agent calls: solana_buy({
|
|
101
|
+
dex: "jupiter-ultra",
|
|
102
|
+
token: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
|
|
103
|
+
amount: 0.1
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Example: Provide Liquidity
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
User: "Add 0.5 SOL of liquidity to this Meteora DLMM pool"
|
|
111
|
+
|
|
112
|
+
Agent calls: solana_add_liquidity({
|
|
113
|
+
dex: "meteora-dlmm",
|
|
114
|
+
pool: "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y",
|
|
115
|
+
amount_sol: 0.5,
|
|
116
|
+
strategy: "spot",
|
|
117
|
+
bins: 50
|
|
118
|
+
})
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Supported DEXes
|
|
124
|
+
|
|
125
|
+
18 adapters covering every major Solana DEX protocol:
|
|
126
|
+
|
|
127
|
+
**Swap Aggregators** (best price routing):
|
|
128
|
+
- `jupiter-ultra` — Jupiter Ultra API
|
|
129
|
+
- `dflow` — DFlow intent-based routing
|
|
130
|
+
|
|
131
|
+
**On-Chain DEXes** (direct pool execution):
|
|
132
|
+
- `raydium-amm-v4`, `raydium-cpmm`, `raydium-clmm`, `raydium-launchlab`
|
|
133
|
+
- `meteora-damm-v2`, `meteora-dlmm`, `meteora-damm-v1`, `meteora-dbc`
|
|
134
|
+
- `pumpfun-amm`
|
|
135
|
+
- `orca`
|
|
136
|
+
- `byreal-clmm`, `pancakeswap-clmm`
|
|
137
|
+
- `fusion-amm`, `futarchy-amm`, `futarchy-launchpad`
|
|
138
|
+
|
|
139
|
+
**LP Management** (add/remove/claim):
|
|
140
|
+
- `meteora-damm-v2` — Full LP lifecycle
|
|
141
|
+
- `meteora-dlmm` (via `meteora-lp-dlmm`) — Concentrated LP with bin strategies
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## AI Skills
|
|
146
|
+
|
|
147
|
+
This package includes a trading skill at `skills/outsmart/SKILL.md` compatible with the [skills.sh](https://skills.sh) CLI:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npx skills add outsmartchad/outsmart-agent
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The skill teaches AI agents:
|
|
154
|
+
- Which DEX to use for different scenarios
|
|
155
|
+
- How to check token safety before trading
|
|
156
|
+
- Common workflows (buy, sell, LP, exit)
|
|
157
|
+
- Safety rules for autonomous trading
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Architecture
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
outsmart (npm package) outsmart-agent (this repo)
|
|
165
|
+
────────────────────── ─────────────────────────
|
|
166
|
+
18 DEX adapters MCP server (11 tools)
|
|
167
|
+
12 TX landing providers AI skills (SKILL.md)
|
|
168
|
+
Wallet/connection helpers Claude Code marketplace plugin
|
|
169
|
+
DexScreener utility Re-exports outsmart API
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
`outsmart-agent` imports `outsmart` as an npm dependency — zero code duplication. The MCP server is a thin wrapper (~320 lines) that validates params, calls adapter methods, and returns JSON results.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Environment Variables
|
|
177
|
+
|
|
178
|
+
| Variable | Required | Description |
|
|
179
|
+
|----------|----------|-------------|
|
|
180
|
+
| `WALLET_PRIVATE_KEY` | Yes | Base58-encoded Solana private key |
|
|
181
|
+
| `RPC_URL` | Yes | Solana RPC endpoint |
|
|
182
|
+
| `JUPITER_API_KEY` | No | For jupiter-ultra adapter |
|
|
183
|
+
| `DFLOW_API_KEY` | No | For dflow adapter |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Related
|
|
188
|
+
|
|
189
|
+
- **[outsmart](https://www.npmjs.com/package/outsmart)** — The underlying trading library + CLI
|
|
190
|
+
- **[outsmart-cli](https://github.com/outsmartchad/outsmart-cli)** — CLI for humans: `outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1`
|
|
191
|
+
|
|
192
|
+
## Discord
|
|
193
|
+
|
|
194
|
+
https://discord.gg/dc3Kh3Y3yJ
|
|
195
|
+
|
|
196
|
+
## Disclaimer
|
|
197
|
+
|
|
198
|
+
This software is provided "as is", without warranty of any kind. Use at your own risk. The authors take no responsibility for any financial loss. Users are responsible for ensuring compliance with applicable laws.
|
|
199
|
+
|
|
200
|
+
Never share your private keys.
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
ISC
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* outsmart-agent — Library Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the outsmart trading library and the MCP server starter.
|
|
5
|
+
* Consumers can either:
|
|
6
|
+
* 1. `npx outsmart-agent` — starts the MCP server (stdio transport)
|
|
7
|
+
* 2. `import { ... } from "outsmart-agent"` — use as a library
|
|
8
|
+
*/
|
|
9
|
+
export { DexRegistry, getRegistry, getDexAdapter, listDexAdapters, registerAdapter, registerAllAdapters, type IDexAdapter, type DexAdapterInfo, type DexCapabilities, type BuyParams, type SellParams, type SnipeParams, type SwapOpts, type SwapResult, type PoolInfo, type PriceInfo, type TxResult, type BuildSwapIxsResult, type AddLiquidityParams, type RemoveLiquidityParams, type SwapSide, UnsupportedOperationError, PoolNotFoundError, defaultCapabilities, WSOL_MINT, USDC_MINT, USDT_MINT, DEFAULT_SLIPPAGE_BPS, DEFAULT_PRIORITY_FEE_MICRO_LAMPORTS, DEFAULT_COMPUTE_UNIT_LIMIT, type ILandingProvider, type LandingResult, type SubmitOptions, type SubmissionStrategy, type OrchestratorConfig, type TipAccount, getWallet, getConnection, resetWalletCache, checkBalanceByAddress, getSPLTokenBalance, sendAndConfirmVtx, sendAndConfirmLegacyTx, setDryRunMode, isDryRunMode, type SendRpcOptions, type SendRpcResult, type SendLegacyTxOptions, getInfoFromDexscreener, } from "outsmart";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,WAAW,EACX,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,EAGnB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EAGb,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,SAAS,EACT,oBAAoB,EACpB,mCAAmC,EACnC,0BAA0B,EAG1B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAGf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAGlB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAGxB,sBAAsB,GACvB,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* outsmart-agent — Library Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Re-exports the outsmart trading library and the MCP server starter.
|
|
6
|
+
* Consumers can either:
|
|
7
|
+
* 1. `npx outsmart-agent` — starts the MCP server (stdio transport)
|
|
8
|
+
* 2. `import { ... } from "outsmart-agent"` — use as a library
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.getInfoFromDexscreener = exports.isDryRunMode = exports.setDryRunMode = exports.sendAndConfirmLegacyTx = exports.sendAndConfirmVtx = exports.getSPLTokenBalance = exports.checkBalanceByAddress = exports.resetWalletCache = exports.getConnection = exports.getWallet = exports.DEFAULT_COMPUTE_UNIT_LIMIT = exports.DEFAULT_PRIORITY_FEE_MICRO_LAMPORTS = exports.DEFAULT_SLIPPAGE_BPS = exports.USDT_MINT = exports.USDC_MINT = exports.WSOL_MINT = exports.defaultCapabilities = exports.PoolNotFoundError = exports.UnsupportedOperationError = exports.registerAllAdapters = exports.registerAdapter = exports.listDexAdapters = exports.getDexAdapter = exports.getRegistry = exports.DexRegistry = void 0;
|
|
12
|
+
// Re-export everything from the outsmart trading library
|
|
13
|
+
var outsmart_1 = require("outsmart");
|
|
14
|
+
// DEX registry
|
|
15
|
+
Object.defineProperty(exports, "DexRegistry", { enumerable: true, get: function () { return outsmart_1.DexRegistry; } });
|
|
16
|
+
Object.defineProperty(exports, "getRegistry", { enumerable: true, get: function () { return outsmart_1.getRegistry; } });
|
|
17
|
+
Object.defineProperty(exports, "getDexAdapter", { enumerable: true, get: function () { return outsmart_1.getDexAdapter; } });
|
|
18
|
+
Object.defineProperty(exports, "listDexAdapters", { enumerable: true, get: function () { return outsmart_1.listDexAdapters; } });
|
|
19
|
+
Object.defineProperty(exports, "registerAdapter", { enumerable: true, get: function () { return outsmart_1.registerAdapter; } });
|
|
20
|
+
Object.defineProperty(exports, "registerAllAdapters", { enumerable: true, get: function () { return outsmart_1.registerAllAdapters; } });
|
|
21
|
+
// Constants & errors
|
|
22
|
+
Object.defineProperty(exports, "UnsupportedOperationError", { enumerable: true, get: function () { return outsmart_1.UnsupportedOperationError; } });
|
|
23
|
+
Object.defineProperty(exports, "PoolNotFoundError", { enumerable: true, get: function () { return outsmart_1.PoolNotFoundError; } });
|
|
24
|
+
Object.defineProperty(exports, "defaultCapabilities", { enumerable: true, get: function () { return outsmart_1.defaultCapabilities; } });
|
|
25
|
+
Object.defineProperty(exports, "WSOL_MINT", { enumerable: true, get: function () { return outsmart_1.WSOL_MINT; } });
|
|
26
|
+
Object.defineProperty(exports, "USDC_MINT", { enumerable: true, get: function () { return outsmart_1.USDC_MINT; } });
|
|
27
|
+
Object.defineProperty(exports, "USDT_MINT", { enumerable: true, get: function () { return outsmart_1.USDT_MINT; } });
|
|
28
|
+
Object.defineProperty(exports, "DEFAULT_SLIPPAGE_BPS", { enumerable: true, get: function () { return outsmart_1.DEFAULT_SLIPPAGE_BPS; } });
|
|
29
|
+
Object.defineProperty(exports, "DEFAULT_PRIORITY_FEE_MICRO_LAMPORTS", { enumerable: true, get: function () { return outsmart_1.DEFAULT_PRIORITY_FEE_MICRO_LAMPORTS; } });
|
|
30
|
+
Object.defineProperty(exports, "DEFAULT_COMPUTE_UNIT_LIMIT", { enumerable: true, get: function () { return outsmart_1.DEFAULT_COMPUTE_UNIT_LIMIT; } });
|
|
31
|
+
// Helpers
|
|
32
|
+
Object.defineProperty(exports, "getWallet", { enumerable: true, get: function () { return outsmart_1.getWallet; } });
|
|
33
|
+
Object.defineProperty(exports, "getConnection", { enumerable: true, get: function () { return outsmart_1.getConnection; } });
|
|
34
|
+
Object.defineProperty(exports, "resetWalletCache", { enumerable: true, get: function () { return outsmart_1.resetWalletCache; } });
|
|
35
|
+
Object.defineProperty(exports, "checkBalanceByAddress", { enumerable: true, get: function () { return outsmart_1.checkBalanceByAddress; } });
|
|
36
|
+
Object.defineProperty(exports, "getSPLTokenBalance", { enumerable: true, get: function () { return outsmart_1.getSPLTokenBalance; } });
|
|
37
|
+
// TX send
|
|
38
|
+
Object.defineProperty(exports, "sendAndConfirmVtx", { enumerable: true, get: function () { return outsmart_1.sendAndConfirmVtx; } });
|
|
39
|
+
Object.defineProperty(exports, "sendAndConfirmLegacyTx", { enumerable: true, get: function () { return outsmart_1.sendAndConfirmLegacyTx; } });
|
|
40
|
+
Object.defineProperty(exports, "setDryRunMode", { enumerable: true, get: function () { return outsmart_1.setDryRunMode; } });
|
|
41
|
+
Object.defineProperty(exports, "isDryRunMode", { enumerable: true, get: function () { return outsmart_1.isDryRunMode; } });
|
|
42
|
+
// DexScreener
|
|
43
|
+
Object.defineProperty(exports, "getInfoFromDexscreener", { enumerable: true, get: function () { return outsmart_1.getInfoFromDexscreener; } });
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,yDAAyD;AACzD,qCA+DkB;AA9DhB,eAAe;AACf,uGAAA,WAAW,OAAA;AACX,uGAAA,WAAW,OAAA;AACX,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AAmBnB,qBAAqB;AACrB,qHAAA,yBAAyB,OAAA;AACzB,6GAAA,iBAAiB,OAAA;AACjB,+GAAA,mBAAmB,OAAA;AACnB,qGAAA,SAAS,OAAA;AACT,qGAAA,SAAS,OAAA;AACT,qGAAA,SAAS,OAAA;AACT,gHAAA,oBAAoB,OAAA;AACpB,+HAAA,mCAAmC,OAAA;AACnC,sHAAA,0BAA0B,OAAA;AAU1B,UAAU;AACV,qGAAA,SAAS,OAAA;AACT,yGAAA,aAAa,OAAA;AACb,4GAAA,gBAAgB,OAAA;AAChB,iHAAA,qBAAqB,OAAA;AACrB,8GAAA,kBAAkB,OAAA;AAElB,UAAU;AACV,6GAAA,iBAAiB,OAAA;AACjB,kHAAA,sBAAsB,OAAA;AACtB,yGAAA,aAAa,OAAA;AACb,wGAAA,YAAY,OAAA;AAKZ,cAAc;AACd,kHAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* outsmart-agent MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Exposes 11 MCP tools wrapping the `outsmart` trading library.
|
|
6
|
+
* Runs over stdio transport — start with `npx outsmart-agent`.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* solana_buy, solana_sell, solana_quote, solana_find_pool,
|
|
10
|
+
* solana_add_liquidity, solana_remove_liquidity, solana_claim_fees,
|
|
11
|
+
* solana_list_positions, solana_token_info, solana_list_dexes,
|
|
12
|
+
* solana_wallet_balance
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* outsmart-agent MCP Server
|
|
5
|
+
*
|
|
6
|
+
* Exposes 11 MCP tools wrapping the `outsmart` trading library.
|
|
7
|
+
* Runs over stdio transport — start with `npx outsmart-agent`.
|
|
8
|
+
*
|
|
9
|
+
* Tools:
|
|
10
|
+
* solana_buy, solana_sell, solana_quote, solana_find_pool,
|
|
11
|
+
* solana_add_liquidity, solana_remove_liquidity, solana_claim_fees,
|
|
12
|
+
* solana_list_positions, solana_token_info, solana_list_dexes,
|
|
13
|
+
* solana_wallet_balance
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
17
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
18
|
+
const zod_1 = require("zod");
|
|
19
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
20
|
+
const outsmart_1 = require("outsmart");
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Helper: get adapter with error handling
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
function getAdapter(dex) {
|
|
25
|
+
try {
|
|
26
|
+
return (0, outsmart_1.getDexAdapter)(dex);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
throw new Error(`DEX adapter "${dex}" not found. Use solana_list_dexes to see available adapters. ${err.message}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Helper: format tool result
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
function ok(data) {
|
|
36
|
+
return {
|
|
37
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function err(message) {
|
|
41
|
+
return {
|
|
42
|
+
content: [{ type: "text", text: JSON.stringify({ error: message }) }],
|
|
43
|
+
isError: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// Server setup
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
const server = new mcp_js_1.McpServer({
|
|
50
|
+
name: "outsmart-agent",
|
|
51
|
+
version: "1.0.0-alpha.1",
|
|
52
|
+
});
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Tool: solana_buy
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// @ts-expect-error — TS2589: deep type instantiation from MCP SDK generics + zod
|
|
57
|
+
server.tool("solana_buy", "Buy tokens with SOL on a Solana DEX. For aggregators (jupiter-ultra, dflow), provide 'token'. For on-chain DEXes (raydium-*, meteora-*, orca, etc.), provide 'pool'.", {
|
|
58
|
+
dex: zod_1.z.string().describe("DEX adapter name (e.g. 'jupiter-ultra', 'raydium-cpmm', 'meteora-dlmm')"),
|
|
59
|
+
pool: zod_1.z.string().optional().describe("Pool address (required for on-chain DEXes)"),
|
|
60
|
+
token: zod_1.z.string().optional().describe("Token mint address (required for aggregators)"),
|
|
61
|
+
amount: zod_1.z.number().positive().describe("Amount of SOL to spend"),
|
|
62
|
+
slippage_bps: zod_1.z.number().int().min(0).max(10000).optional().describe("Slippage tolerance in basis points (default: 300 = 3%)"),
|
|
63
|
+
tip_sol: zod_1.z.number().min(0).optional().describe("MEV tip in SOL"),
|
|
64
|
+
dry_run: zod_1.z.boolean().optional().describe("Simulate without sending (default: false)"),
|
|
65
|
+
}, async (args) => {
|
|
66
|
+
try {
|
|
67
|
+
const adapter = getAdapter(args.dex);
|
|
68
|
+
const result = await adapter.buy({
|
|
69
|
+
tokenMint: args.token,
|
|
70
|
+
amountSol: args.amount,
|
|
71
|
+
poolAddress: args.pool,
|
|
72
|
+
opts: {
|
|
73
|
+
slippageBps: args.slippage_bps,
|
|
74
|
+
tipSol: args.tip_sol,
|
|
75
|
+
dryRun: args.dry_run,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
return ok(result);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
return err(e.message);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Tool: solana_sell
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
server.tool("solana_sell", "Sell tokens for SOL on a Solana DEX. Specify percentage of holdings to sell (0-100).", {
|
|
88
|
+
dex: zod_1.z.string().describe("DEX adapter name"),
|
|
89
|
+
pool: zod_1.z.string().optional().describe("Pool address (required for on-chain DEXes)"),
|
|
90
|
+
token: zod_1.z.string().optional().describe("Token mint address (required for aggregators)"),
|
|
91
|
+
percentage: zod_1.z.number().min(0).max(100).describe("Percentage of token holdings to sell (100 = sell all)"),
|
|
92
|
+
slippage_bps: zod_1.z.number().int().min(0).max(10000).optional().describe("Slippage tolerance in basis points"),
|
|
93
|
+
dry_run: zod_1.z.boolean().optional().describe("Simulate without sending"),
|
|
94
|
+
}, async (args) => {
|
|
95
|
+
try {
|
|
96
|
+
const adapter = getAdapter(args.dex);
|
|
97
|
+
const result = await adapter.sell({
|
|
98
|
+
tokenMint: args.token,
|
|
99
|
+
percentage: args.percentage,
|
|
100
|
+
poolAddress: args.pool,
|
|
101
|
+
opts: {
|
|
102
|
+
slippageBps: args.slippage_bps,
|
|
103
|
+
dryRun: args.dry_run,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
return ok(result);
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
return err(e.message);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// Tool: solana_quote
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
server.tool("solana_quote", "Get the current on-chain price from a pool. Reads directly from on-chain state.", {
|
|
116
|
+
dex: zod_1.z.string().describe("DEX adapter name"),
|
|
117
|
+
pool: zod_1.z.string().describe("Pool address to read price from"),
|
|
118
|
+
}, async (args) => {
|
|
119
|
+
try {
|
|
120
|
+
const adapter = getAdapter(args.dex);
|
|
121
|
+
if (!adapter.getPrice) {
|
|
122
|
+
return err(`${args.dex} does not support getPrice`);
|
|
123
|
+
}
|
|
124
|
+
const result = await adapter.getPrice(args.pool);
|
|
125
|
+
return ok(result);
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
return err(e.message);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
// Tool: solana_add_liquidity
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
server.tool("solana_add_liquidity", "Add liquidity to a pool. Supports DLMM strategies (spot, curve, bid-ask) and bin configuration.", {
|
|
135
|
+
dex: zod_1.z.string().describe("DEX adapter name"),
|
|
136
|
+
pool: zod_1.z.string().describe("Pool address to add liquidity to"),
|
|
137
|
+
amount_sol: zod_1.z.number().min(0).optional().describe("Amount of SOL to deposit"),
|
|
138
|
+
amount_token: zod_1.z.number().min(0).optional().describe("Amount of the non-SOL token to deposit"),
|
|
139
|
+
token_mint: zod_1.z.string().optional().describe("Token mint (required for single-sided token deposits)"),
|
|
140
|
+
strategy: zod_1.z.enum(["spot", "curve", "bid-ask"]).optional().describe("Liquidity distribution strategy (DLMM only, default: spot)"),
|
|
141
|
+
bins: zod_1.z.number().int().min(1).max(70).optional().describe("Number of bins to spread across (DLMM only, default: 50)"),
|
|
142
|
+
}, async (args) => {
|
|
143
|
+
try {
|
|
144
|
+
const adapter = getAdapter(args.dex);
|
|
145
|
+
if (!adapter.addLiquidity) {
|
|
146
|
+
return err(`${args.dex} does not support addLiquidity`);
|
|
147
|
+
}
|
|
148
|
+
const result = await adapter.addLiquidity({
|
|
149
|
+
poolAddress: args.pool,
|
|
150
|
+
amountSol: args.amount_sol,
|
|
151
|
+
amountToken: args.amount_token,
|
|
152
|
+
tokenMint: args.token_mint,
|
|
153
|
+
strategy: args.strategy,
|
|
154
|
+
bins: args.bins,
|
|
155
|
+
});
|
|
156
|
+
return ok(result);
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
return err(e.message);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
// Tool: solana_remove_liquidity
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
server.tool("solana_remove_liquidity", "Remove liquidity from a pool. Specify percentage to withdraw (0-100).", {
|
|
166
|
+
dex: zod_1.z.string().describe("DEX adapter name"),
|
|
167
|
+
pool: zod_1.z.string().describe("Pool address"),
|
|
168
|
+
percentage: zod_1.z.number().min(0).max(100).describe("Percentage of LP position to remove (100 = withdraw all)"),
|
|
169
|
+
position_address: zod_1.z.string().optional().describe("Specific position address (if multiple positions exist)"),
|
|
170
|
+
}, async (args) => {
|
|
171
|
+
try {
|
|
172
|
+
const adapter = getAdapter(args.dex);
|
|
173
|
+
if (!adapter.removeLiquidity) {
|
|
174
|
+
return err(`${args.dex} does not support removeLiquidity`);
|
|
175
|
+
}
|
|
176
|
+
const result = await adapter.removeLiquidity({
|
|
177
|
+
poolAddress: args.pool,
|
|
178
|
+
percentage: args.percentage,
|
|
179
|
+
positionAddress: args.position_address,
|
|
180
|
+
});
|
|
181
|
+
return ok(result);
|
|
182
|
+
}
|
|
183
|
+
catch (e) {
|
|
184
|
+
return err(e.message);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
// ---------------------------------------------------------------------------
|
|
188
|
+
// Tool: solana_claim_fees
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
server.tool("solana_claim_fees", "Claim accumulated swap fees from LP positions in a pool.", {
|
|
191
|
+
dex: zod_1.z.string().describe("DEX adapter name"),
|
|
192
|
+
pool: zod_1.z.string().describe("Pool address"),
|
|
193
|
+
position_address: zod_1.z.string().optional().describe("Specific position to claim from"),
|
|
194
|
+
}, async (args) => {
|
|
195
|
+
try {
|
|
196
|
+
const adapter = getAdapter(args.dex);
|
|
197
|
+
if (!adapter.claimFees) {
|
|
198
|
+
return err(`${args.dex} does not support claimFees`);
|
|
199
|
+
}
|
|
200
|
+
const result = await adapter.claimFees(args.pool, args.position_address);
|
|
201
|
+
return ok(result);
|
|
202
|
+
}
|
|
203
|
+
catch (e) {
|
|
204
|
+
return err(e.message);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
// ---------------------------------------------------------------------------
|
|
208
|
+
// Tool: solana_list_positions
|
|
209
|
+
// ---------------------------------------------------------------------------
|
|
210
|
+
server.tool("solana_list_positions", "List user's LP positions in a pool. Shows token amounts, fee balances, and in-range status.", {
|
|
211
|
+
dex: zod_1.z.string().describe("DEX adapter name"),
|
|
212
|
+
pool: zod_1.z.string().describe("Pool address"),
|
|
213
|
+
}, async (args) => {
|
|
214
|
+
try {
|
|
215
|
+
const adapter = getAdapter(args.dex);
|
|
216
|
+
if (!adapter.listPositions) {
|
|
217
|
+
return err(`${args.dex} does not support listPositions`);
|
|
218
|
+
}
|
|
219
|
+
const result = await adapter.listPositions(args.pool);
|
|
220
|
+
return ok(result);
|
|
221
|
+
}
|
|
222
|
+
catch (e) {
|
|
223
|
+
return err(e.message);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
// ---------------------------------------------------------------------------
|
|
227
|
+
// Tool: solana_token_info
|
|
228
|
+
// ---------------------------------------------------------------------------
|
|
229
|
+
server.tool("solana_token_info", "Get token market data from DexScreener — price, market cap, volume, liquidity, age, buyers, social links.", {
|
|
230
|
+
token: zod_1.z.string().describe("Token mint address (base58)"),
|
|
231
|
+
}, async (args) => {
|
|
232
|
+
try {
|
|
233
|
+
const result = await (0, outsmart_1.getInfoFromDexscreener)(args.token);
|
|
234
|
+
return ok(result);
|
|
235
|
+
}
|
|
236
|
+
catch (e) {
|
|
237
|
+
return err(e.message);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
// ---------------------------------------------------------------------------
|
|
241
|
+
// Tool: solana_list_dexes
|
|
242
|
+
// ---------------------------------------------------------------------------
|
|
243
|
+
server.tool("solana_list_dexes", "List all available DEX adapters and their capabilities. Optionally filter by capability.", {
|
|
244
|
+
capability: zod_1.z
|
|
245
|
+
.string()
|
|
246
|
+
.optional()
|
|
247
|
+
.describe("Filter by capability: canBuy, canSell, canSnipe, canFindPool, canGetPrice, canAddLiquidity, canRemoveLiquidity, canClaimFees, canListPositions, canCreatePool, isAggregator"),
|
|
248
|
+
}, async (args) => {
|
|
249
|
+
try {
|
|
250
|
+
let adapters = (0, outsmart_1.listDexAdapters)();
|
|
251
|
+
if (args.capability) {
|
|
252
|
+
adapters = adapters.filter((a) => a.capabilities[args.capability]);
|
|
253
|
+
}
|
|
254
|
+
return ok(adapters);
|
|
255
|
+
}
|
|
256
|
+
catch (e) {
|
|
257
|
+
return err(e.message);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
// ---------------------------------------------------------------------------
|
|
261
|
+
// Tool: solana_wallet_balance
|
|
262
|
+
// ---------------------------------------------------------------------------
|
|
263
|
+
server.tool("solana_wallet_balance", "Check SOL balance of the configured wallet. Optionally check a specific SPL token balance.", {
|
|
264
|
+
token_mint: zod_1.z.string().optional().describe("SPL token mint to check balance for (omit for SOL balance)"),
|
|
265
|
+
}, async (args) => {
|
|
266
|
+
try {
|
|
267
|
+
const wallet = (0, outsmart_1.getWallet)();
|
|
268
|
+
const address = wallet.publicKey.toBase58();
|
|
269
|
+
if (args.token_mint) {
|
|
270
|
+
const connection = (0, outsmart_1.getConnection)();
|
|
271
|
+
const tokenMintPubkey = new web3_js_1.PublicKey(args.token_mint);
|
|
272
|
+
const tokenBalance = await (0, outsmart_1.getSPLTokenBalance)(connection, tokenMintPubkey, wallet.publicKey);
|
|
273
|
+
return ok({
|
|
274
|
+
wallet: address,
|
|
275
|
+
token_mint: args.token_mint,
|
|
276
|
+
balance: tokenBalance,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
const connection = (0, outsmart_1.getConnection)();
|
|
280
|
+
const solBalance = await (0, outsmart_1.checkBalanceByAddress)(address, connection);
|
|
281
|
+
return ok({
|
|
282
|
+
wallet: address,
|
|
283
|
+
sol_balance: solBalance,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
catch (e) {
|
|
287
|
+
return err(e.message);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
// ---------------------------------------------------------------------------
|
|
291
|
+
// Start server
|
|
292
|
+
// ---------------------------------------------------------------------------
|
|
293
|
+
async function main() {
|
|
294
|
+
// Register all 18 DEX adapters from the outsmart library
|
|
295
|
+
await (0, outsmart_1.registerAllAdapters)();
|
|
296
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
297
|
+
await server.connect(transport);
|
|
298
|
+
// Log to stderr (stdout is reserved for MCP protocol messages)
|
|
299
|
+
console.error("outsmart-agent MCP server started (stdio transport)");
|
|
300
|
+
}
|
|
301
|
+
main().catch((e) => {
|
|
302
|
+
console.error("Fatal error starting MCP server:", e);
|
|
303
|
+
process.exit(1);
|
|
304
|
+
});
|
|
305
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sour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,OAAO,EAAE,UAAU,CAAC,CAAC;QACpE,OAAO,EAAE,CAAC;YACR,MAAM,EAAE,OAAO;YACf,WAAW,EAAE,UAAU;SACxB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;AACH,CAAC,CACF,CAAC;AAEF,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E,KAAK,UAAU,IAAI;IACjB,yDAAyD;IACzD,MAAM,IAAA,8BAAmB,GAAE,CAAC;IAE5B,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,+DAA+D;IAC/D,OAAO,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;AACvE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "outsmart-agent",
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "MCP server + AI skills for Solana trading — wraps the outsmart CLI library for AI agent use.",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=20.0.0"
|
|
7
|
+
},
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"bin": {
|
|
11
|
+
"outsmart-agent": "./dist/mcp/server.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/",
|
|
15
|
+
"skills/",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "npm run clean && npm run build:ts && npm run build:chmod",
|
|
21
|
+
"build:ts": "tsc -p tsconfig.build.json",
|
|
22
|
+
"build:chmod": "chmod +x dist/mcp/server.js || true",
|
|
23
|
+
"clean": "rm -rf dist/",
|
|
24
|
+
"dev": "ts-node src/mcp/server.ts",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"solana",
|
|
30
|
+
"mcp",
|
|
31
|
+
"ai-agent",
|
|
32
|
+
"trading",
|
|
33
|
+
"dex",
|
|
34
|
+
"outsmart",
|
|
35
|
+
"claude",
|
|
36
|
+
"skills"
|
|
37
|
+
],
|
|
38
|
+
"author": "vincentso",
|
|
39
|
+
"license": "ISC",
|
|
40
|
+
"homepage": "https://github.com/outsmartchad/outsmart-agent",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/outsmartchad/outsmart-agent.git"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
47
|
+
"@solana/spl-token": "^0.4.0",
|
|
48
|
+
"@solana/web3.js": "^1.95.0",
|
|
49
|
+
"outsmart": "^2.0.0-alpha.5",
|
|
50
|
+
"zod": "^3.25.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "^20.0.0",
|
|
54
|
+
"typescript": "^5.5.4"
|
|
55
|
+
},
|
|
56
|
+
"overrides": {
|
|
57
|
+
"@solana/web3.js": "^1.95.0"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solana-trading
|
|
3
|
+
description: Execute trades on Solana DEXes. Use when user says "buy token", "sell token", "swap", "add liquidity", "remove liquidity", "claim fees", "LP", "DEX", "pool", "Solana trade", "check price", "wallet balance", or mentions trading tokens on Solana.
|
|
4
|
+
allowed-tools: mcp__outsmart-agent__solana_buy, mcp__outsmart-agent__solana_sell, mcp__outsmart-agent__solana_quote, mcp__outsmart-agent__solana_add_liquidity, mcp__outsmart-agent__solana_remove_liquidity, mcp__outsmart-agent__solana_claim_fees, mcp__outsmart-agent__solana_list_positions, mcp__outsmart-agent__solana_token_info, mcp__outsmart-agent__solana_list_dexes, mcp__outsmart-agent__solana_wallet_balance
|
|
5
|
+
model: opus
|
|
6
|
+
license: ISC
|
|
7
|
+
metadata:
|
|
8
|
+
author: outsmartchad
|
|
9
|
+
version: '1.0.0'
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Solana Trading
|
|
13
|
+
|
|
14
|
+
Execute trades, manage liquidity, and query market data across 18 Solana DEX protocols via the outsmart MCP server.
|
|
15
|
+
|
|
16
|
+
## Quick Decision Guide
|
|
17
|
+
|
|
18
|
+
| Goal | MCP Tool | Key Params |
|
|
19
|
+
|------|----------|------------|
|
|
20
|
+
| Buy tokens with SOL | `solana_buy` | `dex`, `pool` or `token`, `amount` |
|
|
21
|
+
| Sell tokens for SOL | `solana_sell` | `dex`, `pool` or `token`, `percentage` |
|
|
22
|
+
| Check on-chain price | `solana_quote` | `dex`, `pool` |
|
|
23
|
+
| Add liquidity | `solana_add_liquidity` | `dex`, `pool`, `amount_sol` |
|
|
24
|
+
| Remove liquidity | `solana_remove_liquidity` | `dex`, `pool`, `percentage` |
|
|
25
|
+
| Claim LP fees | `solana_claim_fees` | `dex`, `pool` |
|
|
26
|
+
| List LP positions | `solana_list_positions` | `dex`, `pool` |
|
|
27
|
+
| Get token market data | `solana_token_info` | `token` |
|
|
28
|
+
| List available DEXes | `solana_list_dexes` | |
|
|
29
|
+
| Check wallet balance | `solana_wallet_balance` | |
|
|
30
|
+
|
|
31
|
+
## DEX Selection Guide
|
|
32
|
+
|
|
33
|
+
### When to use which DEX
|
|
34
|
+
|
|
35
|
+
| Scenario | Recommended DEX | Why |
|
|
36
|
+
|----------|----------------|-----|
|
|
37
|
+
| Best price across all DEXes | `jupiter-ultra` | Aggregates routes across all Solana DEXes |
|
|
38
|
+
| Specific pool on Raydium | `raydium-cpmm`, `raydium-clmm`, or `raydium-amm-v4` | Direct on-chain execution, no API dependency |
|
|
39
|
+
| Meteora concentrated LP | `meteora-dlmm` | DLMM bins for precise price ranges |
|
|
40
|
+
| Meteora standard LP | `meteora-damm-v2` | Full LP lifecycle (add/remove/claim) |
|
|
41
|
+
| PumpFun tokens (bonding curve) | `pumpfun-amm` | Graduated PumpFun tokens on Raydium AMM |
|
|
42
|
+
| Raydium Launchlab tokens | `raydium-launchlab` | Bonding curve tokens before migration |
|
|
43
|
+
| Orca Whirlpools | `orca` | Concentrated liquidity on Orca |
|
|
44
|
+
| Token is unknown / new | Use `solana_token_info` first | Check liquidity, age, and market data before trading |
|
|
45
|
+
|
|
46
|
+
### DEX Categories
|
|
47
|
+
|
|
48
|
+
**Swap Aggregators** (require `token`, NOT `pool`):
|
|
49
|
+
- `jupiter-ultra` — Best for general trading, aggregates across all DEXes
|
|
50
|
+
- `dflow` — Intent-based routing
|
|
51
|
+
|
|
52
|
+
**On-Chain DEX Adapters** (require `pool`, token auto-detected):
|
|
53
|
+
- `raydium-amm-v4` — Classic Raydium AMM
|
|
54
|
+
- `raydium-cpmm` — Raydium constant product market maker
|
|
55
|
+
- `raydium-clmm` — Raydium concentrated liquidity
|
|
56
|
+
- `raydium-launchlab` — Raydium token launch bonding curves
|
|
57
|
+
- `meteora-damm-v2` — Meteora Dynamic AMM v2 (full LP support)
|
|
58
|
+
- `meteora-dlmm` — Meteora Discrete Liquidity Market Maker
|
|
59
|
+
- `pumpfun-amm` — PumpFun graduated tokens
|
|
60
|
+
- `orca` — Orca Whirlpools
|
|
61
|
+
- And more (use `solana_list_dexes` to see all)
|
|
62
|
+
|
|
63
|
+
## MCP Tool Reference
|
|
64
|
+
|
|
65
|
+
### solana_buy
|
|
66
|
+
|
|
67
|
+
Buy tokens with SOL on a specific DEX.
|
|
68
|
+
|
|
69
|
+
**For aggregators** (jupiter-ultra, dflow):
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"dex": "jupiter-ultra",
|
|
73
|
+
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
|
|
74
|
+
"amount": 0.1
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**For on-chain DEXes** (raydium, meteora, orca, etc.):
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"dex": "raydium-cpmm",
|
|
82
|
+
"pool": "POOL_ADDRESS",
|
|
83
|
+
"amount": 0.1
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
| Param | Required | Description |
|
|
88
|
+
|-------|----------|-------------|
|
|
89
|
+
| `dex` | Yes | DEX adapter name |
|
|
90
|
+
| `pool` | For on-chain DEXes | Pool address (base58) |
|
|
91
|
+
| `token` | For aggregators | Token mint address (base58) |
|
|
92
|
+
| `amount` | Yes | Amount of SOL to spend |
|
|
93
|
+
| `slippage_bps` | No | Slippage tolerance in basis points (default: 300 = 3%) |
|
|
94
|
+
| `tip_sol` | No | MEV tip in SOL for competitive execution |
|
|
95
|
+
| `dry_run` | No | Simulate without sending (default: false) |
|
|
96
|
+
|
|
97
|
+
### solana_sell
|
|
98
|
+
|
|
99
|
+
Sell tokens for SOL.
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"dex": "raydium-cpmm",
|
|
104
|
+
"pool": "POOL_ADDRESS",
|
|
105
|
+
"percentage": 100
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
| Param | Required | Description |
|
|
110
|
+
|-------|----------|-------------|
|
|
111
|
+
| `dex` | Yes | DEX adapter name |
|
|
112
|
+
| `pool` | For on-chain DEXes | Pool address |
|
|
113
|
+
| `token` | For aggregators | Token mint address |
|
|
114
|
+
| `percentage` | Yes | Percentage of holdings to sell (0-100) |
|
|
115
|
+
| `slippage_bps` | No | Slippage tolerance in basis points |
|
|
116
|
+
| `dry_run` | No | Simulate without sending |
|
|
117
|
+
|
|
118
|
+
### solana_quote
|
|
119
|
+
|
|
120
|
+
Get on-chain price from a pool.
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"dex": "raydium-cpmm",
|
|
125
|
+
"pool": "POOL_ADDRESS"
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Returns: price, base/quote mints, pool address, timestamp.
|
|
130
|
+
|
|
131
|
+
### solana_add_liquidity
|
|
132
|
+
|
|
133
|
+
Add liquidity to a pool.
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"dex": "meteora-dlmm",
|
|
138
|
+
"pool": "POOL_ADDRESS",
|
|
139
|
+
"amount_sol": 0.1,
|
|
140
|
+
"strategy": "spot",
|
|
141
|
+
"bins": 50
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
| Param | Required | Description |
|
|
146
|
+
|-------|----------|-------------|
|
|
147
|
+
| `dex` | Yes | DEX adapter name |
|
|
148
|
+
| `pool` | Yes | Pool address |
|
|
149
|
+
| `amount_sol` | No | SOL to deposit |
|
|
150
|
+
| `amount_token` | No | Token to deposit |
|
|
151
|
+
| `strategy` | No | Distribution: "spot", "curve", or "bid-ask" (DLMM only) |
|
|
152
|
+
| `bins` | No | Number of bins (DLMM only, default: 50, max: 70) |
|
|
153
|
+
|
|
154
|
+
### solana_remove_liquidity
|
|
155
|
+
|
|
156
|
+
Remove liquidity from a pool.
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"dex": "meteora-dlmm",
|
|
161
|
+
"pool": "POOL_ADDRESS",
|
|
162
|
+
"percentage": 100
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
| Param | Required | Description |
|
|
167
|
+
|-------|----------|-------------|
|
|
168
|
+
| `dex` | Yes | DEX adapter name |
|
|
169
|
+
| `pool` | Yes | Pool address |
|
|
170
|
+
| `percentage` | Yes | Percentage to remove (0-100) |
|
|
171
|
+
| `position_address` | No | Specific position (if multiple) |
|
|
172
|
+
|
|
173
|
+
### solana_claim_fees
|
|
174
|
+
|
|
175
|
+
Claim accumulated swap fees from LP positions.
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"dex": "meteora-dlmm",
|
|
180
|
+
"pool": "POOL_ADDRESS"
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### solana_list_positions
|
|
185
|
+
|
|
186
|
+
List user's LP positions in a pool.
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"dex": "meteora-dlmm",
|
|
191
|
+
"pool": "POOL_ADDRESS"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Returns: position addresses, token amounts, fee balances, in-range status.
|
|
196
|
+
|
|
197
|
+
### solana_token_info
|
|
198
|
+
|
|
199
|
+
Get market data from DexScreener.
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"token": "TOKEN_MINT_ADDRESS"
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Returns: name, price, market cap, volume (5m/1h/6h/24h), buyers, liquidity, age, social links.
|
|
208
|
+
|
|
209
|
+
### solana_list_dexes
|
|
210
|
+
|
|
211
|
+
List all available DEX adapters and their capabilities.
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Optional filter:
|
|
218
|
+
```json
|
|
219
|
+
{
|
|
220
|
+
"capability": "canAddLiquidity"
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### solana_wallet_balance
|
|
225
|
+
|
|
226
|
+
Check SOL and token balances.
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
For a specific token:
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"token_mint": "TOKEN_MINT_ADDRESS"
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Safety Rules
|
|
240
|
+
|
|
241
|
+
1. **Always check liquidity first.** Before buying a token, use `solana_token_info` to check liquidity depth. Low liquidity means high slippage and potential rug risk.
|
|
242
|
+
|
|
243
|
+
2. **Use dry_run for large trades.** Set `dry_run: true` to simulate the trade and check for errors before committing SOL.
|
|
244
|
+
|
|
245
|
+
3. **Start with small amounts.** When trading an unfamiliar token, start with a small test buy (0.01 SOL) to verify the pool works correctly.
|
|
246
|
+
|
|
247
|
+
4. **Check token age.** Tokens less than 1 hour old are extremely high risk. Use `solana_token_info` to check `pairAge`.
|
|
248
|
+
|
|
249
|
+
5. **Prefer aggregators for best price.** Use `jupiter-ultra` for the best price across all DEXes. Only use on-chain adapters when you need a specific pool.
|
|
250
|
+
|
|
251
|
+
6. **Monitor LP positions.** After adding liquidity, regularly check positions with `solana_list_positions` and claim fees with `solana_claim_fees`.
|
|
252
|
+
|
|
253
|
+
7. **Never trade more than you can afford to lose.** Solana memecoins are extremely volatile. Most go to zero.
|
|
254
|
+
|
|
255
|
+
8. **Check volume and buyers.** Healthy tokens have consistent buy/sell activity. If `buyers5m` is 0 but `volume5m` is high, it may be wash trading.
|
|
256
|
+
|
|
257
|
+
## Common Workflows
|
|
258
|
+
|
|
259
|
+
### Buy a Token
|
|
260
|
+
|
|
261
|
+
With an aggregator (simplest — no pool address needed):
|
|
262
|
+
```
|
|
263
|
+
1. solana_token_info(token) → check liquidity, age, volume
|
|
264
|
+
2. solana_buy(dex="jupiter-ultra", token, amount, dry_run=true) → simulate
|
|
265
|
+
3. solana_buy(dex="jupiter-ultra", token, amount) → execute
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
With an on-chain DEX (need pool address from DexScreener or other source):
|
|
269
|
+
```
|
|
270
|
+
1. solana_token_info(token) → check liquidity, get pool address
|
|
271
|
+
2. solana_buy(dex, pool, amount, dry_run=true) → simulate
|
|
272
|
+
3. solana_buy(dex, pool, amount) → execute
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Provide Liquidity
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
1. solana_quote(dex, pool) → check current price
|
|
279
|
+
2. solana_add_liquidity(dex, pool, amount_sol, strategy="spot") → add LP
|
|
280
|
+
3. solana_list_positions(dex, pool) → verify position
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Exit LP Position
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
1. solana_list_positions(dex, pool) → check positions
|
|
287
|
+
2. solana_claim_fees(dex, pool) → collect fees first
|
|
288
|
+
3. solana_remove_liquidity(dex, pool, percentage=100) → withdraw
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Sell Everything
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
1. solana_sell(dex, pool, percentage=100) → sell all holdings
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Environment Variables
|
|
298
|
+
|
|
299
|
+
The MCP server requires these env vars to be set:
|
|
300
|
+
|
|
301
|
+
| Variable | Required | Description |
|
|
302
|
+
|----------|----------|-------------|
|
|
303
|
+
| `WALLET_PRIVATE_KEY` | Yes | Base58-encoded Solana private key |
|
|
304
|
+
| `RPC_URL` | Yes | Solana RPC endpoint (Helius, Triton, etc.) |
|
|
305
|
+
| `JUPITER_API_KEY` | No | Required for jupiter-ultra adapter |
|
|
306
|
+
| `DFLOW_API_KEY` | No | Required for dflow adapter |
|