@potswap_io/mcp 0.4.0 → 0.5.0
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/README.md +6 -1
- package/dist/agentTools.d.ts +3 -3
- package/dist/agentTools.js +7 -7
- package/dist/index.js +3 -3
- package/dist/server.d.ts +8 -8
- package/dist/server.js +7 -7
- package/dist/strategies/tools.d.ts +3 -3
- package/dist/strategies/tools.js +4 -4
- package/package.json +57 -59
package/README.md
CHANGED
|
@@ -124,7 +124,12 @@ Each swap carries Potswap's 2.5% integrator fee via Jupiter's referral program (
|
|
|
124
124
|
|
|
125
125
|
**Season 0 (now, before the token):** 60% of the net fee fills the **launch pool**; when it reaches 500 SOL the POT token launches on its own liquidity pool. 20% of your net fee is set aside as your **reward balance** (in SOL): after launch it buys POT for you, when you say so (`claim now` at market, or a limit claim at your price). 20% runs the project. Every day you trade in Season 0 earns a slice of the **250M POT airdrop** (25% of supply), replayed day by day after launch: fee basis `fee^1.1`, capped at 10% of the day per wallet, round trips within 10 minutes count 25%.
|
|
126
126
|
|
|
127
|
-
**Seasons 1+ (30 days each):** `20M × 0.85^(n−1)` POT per season shared daily by fee basis; 30% of the net fee buys and burns POT, 20% keeps feeding reward balances, 50% team and operations. Levels (Larva → Bee → Queen, up to ×1.25) persist across seasons. `get_points` shows your balance, level and season; `get_launch_status` shows the meter. Only protocol fees enter the pool: nothing can be deposited.
|
|
127
|
+
**Seasons 1+ (30 days each):** `20M × 0.85^(n−1)` POT per season shared daily by fee basis; 30% of the net fee buys and burns POT, 20% keeps feeding reward balances, 50% team and operations. Levels (Larva → Bee → Queen, up to ×1.25) persist across seasons. `get_points` shows your balance, level and season; `get_launch_status` shows the meter. Only protocol fees enter the pool: nothing can be deposited. Full documentation: https://potswap-docs.pages.dev (every tool, configuration, limits, economy; also as /llms.txt for agents).
|
|
128
|
+
|
|
129
|
+
## Also available
|
|
130
|
+
|
|
131
|
+
- **`@potswap_io/sdk`** — the same engine as a typed library for bots, scripts and other agent frameworks. The MCP server is built on it.
|
|
132
|
+
- **`@potswap_io/cli`** — the `potswap` command: `npx -y @potswap_io/cli quote SOL USDC 0.1`; swaps, transfers, wallet, points, launch meter, strategy management and `potswap daemon`.
|
|
128
133
|
|
|
129
134
|
## Development
|
|
130
135
|
|
package/dist/agentTools.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { Connection } from '@solana/web3.js';
|
|
3
|
-
import { type Config } from '
|
|
4
|
-
import { type TradeContext } from '
|
|
5
|
-
import { type Rpc } from '
|
|
3
|
+
import { type Config } from '@potswap_io/sdk';
|
|
4
|
+
import { type TradeContext } from '@potswap_io/sdk';
|
|
5
|
+
import { type Rpc } from '@potswap_io/sdk';
|
|
6
6
|
/** Transaction-level RPC reads; injectable for tests. */
|
|
7
7
|
export interface TxRpc {
|
|
8
8
|
getSignatureStatus(sig: string): Promise<{
|
package/dist/agentTools.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Connection } from '@solana/web3.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { JITOSOL_MINT, MSOL_MINT, NO_WALLET, SOL_MINT } from '
|
|
4
|
-
import { redact, redactValue } from '
|
|
5
|
-
import { createWallet } from '
|
|
6
|
-
import { executeSwap } from '
|
|
7
|
-
import { executeTransfer, rpcFromConnection } from '
|
|
8
|
-
import { mapSignatureStatus, normalizeHistory } from '
|
|
9
|
-
import { computePositions } from '
|
|
3
|
+
import { JITOSOL_MINT, MSOL_MINT, NO_WALLET, SOL_MINT } from '@potswap_io/sdk';
|
|
4
|
+
import { redact, redactValue } from '@potswap_io/sdk';
|
|
5
|
+
import { createWallet } from '@potswap_io/sdk';
|
|
6
|
+
import { executeSwap } from '@potswap_io/sdk';
|
|
7
|
+
import { executeTransfer, rpcFromConnection } from '@potswap_io/sdk';
|
|
8
|
+
import { mapSignatureStatus, normalizeHistory } from '@potswap_io/sdk';
|
|
9
|
+
import { computePositions } from '@potswap_io/sdk';
|
|
10
10
|
const ok = (data, summary) => ({ content: [{ type: 'text', text: redact(summary ?? JSON.stringify(data, null, 2)) }], structuredContent: redactValue(data) });
|
|
11
11
|
const fail = (message, extra = {}) => ({ content: [{ type: 'text', text: redact(message) }], structuredContent: redactValue({ error: message, ...extra }), isError: true });
|
|
12
12
|
const MINT = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/);
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Potswap MCP server over stdio, or `--daemon` to run strategies headlessly (PRD P11.11).
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { createServer, VERSION } from './server.js';
|
|
5
|
-
import { loadConfig } from '
|
|
6
|
-
import { log } from '
|
|
7
|
-
import { createRuntime } from '
|
|
5
|
+
import { loadConfig } from '@potswap_io/sdk';
|
|
6
|
+
import { log } from '@potswap_io/sdk';
|
|
7
|
+
import { createRuntime } from '@potswap_io/sdk';
|
|
8
8
|
const config = loadConfig();
|
|
9
9
|
const daemon = process.argv.includes('--daemon');
|
|
10
10
|
const rt = createRuntime(config);
|
package/dist/server.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { type FetchFn } from '
|
|
3
|
-
import { SOL_MINT, USDC_MINT, type Config } from '
|
|
4
|
-
import { type BalancesFn } from '
|
|
5
|
-
import { type Signer } from '
|
|
2
|
+
import { type FetchFn } from '@potswap_io/sdk';
|
|
3
|
+
import { SOL_MINT, USDC_MINT, type Config } from '@potswap_io/sdk';
|
|
4
|
+
import { type BalancesFn } from '@potswap_io/sdk';
|
|
5
|
+
import { type Signer } from '@potswap_io/sdk';
|
|
6
6
|
import { type TxRpc } from './agentTools.js';
|
|
7
|
-
import type { Rpc } from '
|
|
8
|
-
import type { StrategyStore } from '
|
|
9
|
-
import type { Scheduler } from '
|
|
10
|
-
export declare const VERSION = "0.
|
|
7
|
+
import type { Rpc } from '@potswap_io/sdk';
|
|
8
|
+
import type { StrategyStore } from '@potswap_io/sdk';
|
|
9
|
+
import type { Scheduler } from '@potswap_io/sdk';
|
|
10
|
+
export declare const VERSION = "0.5.0";
|
|
11
11
|
export interface ServerDeps {
|
|
12
12
|
config?: Config;
|
|
13
13
|
signer?: Signer | null;
|
package/dist/server.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { PotswapApi, ApiError } from '
|
|
6
|
-
import { loadConfig, NO_WALLET, SOL_MINT, USDC_MINT } from '
|
|
7
|
-
import { buildQuote, executeSwap } from '
|
|
8
|
-
import { redact, redactValue } from '
|
|
9
|
-
import { loadSigner } from '
|
|
10
|
-
import { riskBadges, riskLevel } from '
|
|
5
|
+
import { PotswapApi, ApiError } from '@potswap_io/sdk';
|
|
6
|
+
import { loadConfig, NO_WALLET, SOL_MINT, USDC_MINT } from '@potswap_io/sdk';
|
|
7
|
+
import { buildQuote, executeSwap } from '@potswap_io/sdk';
|
|
8
|
+
import { redact, redactValue } from '@potswap_io/sdk';
|
|
9
|
+
import { loadSigner } from '@potswap_io/sdk';
|
|
10
|
+
import { riskBadges, riskLevel } from '@potswap_io/sdk';
|
|
11
11
|
import { registerStrategyTools } from './strategies/tools.js';
|
|
12
12
|
import { registerAgentTools } from './agentTools.js';
|
|
13
|
-
export const VERSION = '0.
|
|
13
|
+
export const VERSION = '0.5.0';
|
|
14
14
|
const ok = (data, summary) => ({
|
|
15
15
|
content: [{ type: 'text', text: redact(summary ?? JSON.stringify(data, null, 2)) }], structuredContent: redactValue(data),
|
|
16
16
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { TradeContext } from '
|
|
3
|
-
import { type StrategyStore } from '
|
|
4
|
-
import type { Scheduler } from '
|
|
2
|
+
import type { TradeContext } from '@potswap_io/sdk';
|
|
3
|
+
import { type StrategyStore } from '@potswap_io/sdk';
|
|
4
|
+
import type { Scheduler } from '@potswap_io/sdk';
|
|
5
5
|
export interface StrategyDeps {
|
|
6
6
|
trade: TradeContext;
|
|
7
7
|
store?: StrategyStore;
|
package/dist/strategies/tools.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { NO_WALLET } from '
|
|
3
|
-
import { redact, redactValue } from '
|
|
4
|
-
import { newId, SOL_MINT, nextRunAfter } from '
|
|
5
|
-
import { findStrategy, runsOf } from '
|
|
2
|
+
import { NO_WALLET } from '@potswap_io/sdk';
|
|
3
|
+
import { redact, redactValue } from '@potswap_io/sdk';
|
|
4
|
+
import { newId, SOL_MINT, nextRunAfter } from '@potswap_io/sdk';
|
|
5
|
+
import { findStrategy, runsOf } from '@potswap_io/sdk';
|
|
6
6
|
const MINT = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/);
|
|
7
7
|
const MAX_STRATEGIES = Number(process.env.POTSWAP_MAX_STRATEGIES) || 10;
|
|
8
8
|
const ok = (data, summary) => ({ content: [{ type: 'text', text: redact(summary ?? JSON.stringify(data, null, 2)) }], structuredContent: redactValue(data) });
|
package/package.json
CHANGED
|
@@ -1,59 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@potswap_io/mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Potswap MCP server: best-route Solana swaps, DCA / rebalance / take-profit strategies for AI agents
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"potswap-mcp": "dist/index.js"
|
|
9
|
-
},
|
|
10
|
-
"main": "dist/server.js",
|
|
11
|
-
"types": "dist/server.d.ts",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"README.md",
|
|
15
|
-
"LICENSE"
|
|
16
|
-
],
|
|
17
|
-
"engines": {
|
|
18
|
-
"node": ">=20"
|
|
19
|
-
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsc -p tsconfig.json",
|
|
22
|
-
"dev": "tsx src/index.ts",
|
|
23
|
-
"test": "vitest run",
|
|
24
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"@
|
|
44
|
-
"@solana/
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@potswap_io/mcp",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Potswap MCP server: best-route Solana swaps, wallet, transfers, staking, DCA / rebalance / take-profit / limit strategies and POT rewards for AI agents. Non-custodial; built on @potswap_io/sdk.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"potswap-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/server.js",
|
|
11
|
+
"types": "dist/server.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"dev": "tsx src/index.ts",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
25
|
+
"prepublishOnly": "npm run build"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/potswap-io/mcp.git"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://www.potswap.io",
|
|
32
|
+
"keywords": [
|
|
33
|
+
"mcp",
|
|
34
|
+
"solana",
|
|
35
|
+
"swap",
|
|
36
|
+
"jupiter",
|
|
37
|
+
"ai-agent",
|
|
38
|
+
"potswap",
|
|
39
|
+
"model-context-protocol"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
43
|
+
"@potswap_io/sdk": "^0.1.0",
|
|
44
|
+
"@solana/web3.js": "^1.99.0",
|
|
45
|
+
"zod": "^4.6.7"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^26.6.5",
|
|
49
|
+
"tsx": "^4.23.15",
|
|
50
|
+
"typescript": "^7.0.2",
|
|
51
|
+
"vite": "^8.3.5",
|
|
52
|
+
"vitest": "^5.0.5"
|
|
53
|
+
},
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/potswap-io/mcp/issues"
|
|
56
|
+
}
|
|
57
|
+
}
|