@poincaretrade/mcp 0.1.0 → 0.1.2

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 CHANGED
@@ -1,108 +1,27 @@
1
- Business Source License 1.1
1
+ MIT License
2
2
 
3
- License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
- "Business Source License" is a trademark of MariaDB Corporation Ab.
3
+ Copyright (c) 2026 Prakhar Srivastava
5
4
 
6
- -----------------------------------------------------------------------------
7
-
8
- Parameters
9
-
10
- Licensor: Prakhar Srivastava
11
-
12
- Licensed Work: Poincare (the Poincare Uniswap v4 hook, including the
13
- CUSUM change detector, directional-efficiency signal,
14
- asymmetric hyperbolic curve, control law, lens, and
15
- associated frontend and analysis code)
16
- The Licensed Work is (c) 2026 Prakhar Srivastava.
17
-
18
- Additional Use Grant: Any uses listed and defined at this time are none.
19
- Production use of the Licensed Work, or of any derivative
20
- of it, requires a commercial license from the Licensor.
21
- Use for review, testing, security research, and
22
- non-production evaluation is permitted.
23
-
24
- Change Date: 2030-07-19
25
-
26
- Change License: MIT
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
27
11
 
28
- For information about alternative licensing arrangements for the Licensed Work,
29
- please contact srivastavaprakhar3010@gmail.com.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
30
14
 
31
- -----------------------------------------------------------------------------
32
-
33
- Notice
34
-
35
- The Business Source License (this document, or the "License") is not an Open
36
- Source license. However, the Licensed Work will eventually be made available
37
- under an Open Source License, as stated in this License.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
38
22
 
39
23
  -----------------------------------------------------------------------------
40
24
 
41
- Terms
42
-
43
- The Licensor hereby grants you the right to copy, modify, create derivative
44
- works, redistribute, and make non-production use of the Licensed Work. The
45
- Licensor may make an Additional Use Grant, above, permitting limited
46
- production use.
47
-
48
- Effective on the Change Date, or the fourth anniversary of the first publicly
49
- available distribution of a specific version of the Licensed Work under this
50
- License, whichever comes first, the Licensor hereby grants you rights under
51
- the terms of the Change License, and the rights granted in the paragraph
52
- above terminate.
53
-
54
- If your use of the Licensed Work does not comply with the requirements
55
- currently in effect as described in this License, you must purchase a
56
- commercial license from the Licensor, its affiliated entities, or authorized
57
- resellers, or you must refrain from using the Licensed Work.
58
-
59
- All copies of the original and modified Licensed Work, and derivative works
60
- of the Licensed Work, are subject to this License. This License applies
61
- separately for each version of the Licensed Work and the Change Date may vary
62
- for each version of the Licensed Work released by Licensor.
63
-
64
- You must conspicuously display this License on each original or modified copy
65
- of the Licensed Work. If you receive the Licensed Work in original or
66
- modified form from a third party, the terms and conditions set forth in this
67
- License apply to your use of that work.
68
-
69
- Any use of the Licensed Work in violation of this License will automatically
70
- terminate your rights under this License for the current and all other
71
- versions of the Licensed Work.
72
-
73
- This License does not grant you any right in any trademark or logo of
74
- Licensor or its affiliates (provided that you may use a trademark or logo of
75
- Licensor as expressly required by this License).
76
-
77
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
78
- AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
79
- EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
80
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
81
- TITLE.
82
-
83
- MariaDB hereby grants you permission to use this License's text to license
84
- your works, and to refer to it using the trademark "Business Source License",
85
- as long as you comply with the Covenants of Licensor below.
86
-
87
- -----------------------------------------------------------------------------
88
-
89
- Covenants of Licensor
90
-
91
- In consideration of the right to use this License's text and the "Business
92
- Source License" name and trademark, Licensor covenants to MariaDB, and to all
93
- other recipients of the licensed work to be provided by Licensor:
94
-
95
- 1. To specify as the Change License the GPL Version 2.0 or any later version,
96
- or a license that is compatible with GPL Version 2.0 or a later version,
97
- where "compatible" means that software provided under the Change License can
98
- be included in a program with software provided under GPL Version 2.0 or a
99
- later version. Licensor may specify additional Change Licenses without
100
- limitation.
101
-
102
- 2. To either: (a) specify an additional grant of rights to use that does not
103
- impose any additional restriction on the right granted in this License, as
104
- the Additional Use Grant; or (b) insert the text "None".
105
-
106
- 3. To specify a Change Date.
107
-
108
- 4. Not to modify this License in any other way.
25
+ Poincare was previously licensed under the Business Source License 1.1. It is
26
+ now licensed under the MIT License above, in its entirety, by its sole
27
+ copyright holder. Third-party code under lib/ keeps its own licenses.
package/README.md CHANGED
@@ -5,7 +5,7 @@ regime, swap quotes and spread-aware DCA orders as 15 tools. It reads the live p
5
5
  returns **unsigned** transactions; nothing is ever sent unless you add your own key and the agent calls a
6
6
  tool with `send: true`.
7
7
 
8
- Full docs: **https://www.poincaretrade.in/#/developers/mcp**
8
+ Full docs: **https://www.poincaretrade.in/docs/mcp**
9
9
 
10
10
  ## Add it
11
11
 
@@ -40,4 +40,4 @@ claude mcp add poincare -- npx -y @poincaretrade/mcp
40
40
  Try: *"Is the Poincaré pool trending right now, and which side pays?"* or *"Plan a DCA that buys 500 USDC
41
41
  of WETH over a day without ever paying the trend spread."*
42
42
 
43
- **Status:** testnet research preview. Licensed under the Business Source License 1.1 (see LICENSE).
43
+ **Status:** testnet research preview. MIT licensed (see LICENSE).
@@ -95,7 +95,7 @@ function orderView(o) {
95
95
  function createServer(opts) {
96
96
  const { poincare, signer } = opts;
97
97
  const now = opts.now ?? (() => Math.floor(Date.now() / 1e3));
98
- const server = new McpServer({ name: "poincare", version: "0.1.0" });
98
+ const server = new McpServer({ name: "poincare", version: "0.1.2" });
99
99
  const run = async (txs, send) => {
100
100
  if (!send) return { sent: false, transactions: txs, note: "Unsigned. Sign and send these in order from the owner's wallet." };
101
101
  if (!signer) throw new Error("send=true needs POINCARE_PRIVATE_KEY in the MCP server's environment");
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createServer
4
- } from "./chunk-4GNLI7ZS.js";
4
+ } from "./chunk-RL2QBUUH.js";
5
5
 
6
6
  // src/index.ts
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-4GNLI7ZS.js";
3
+ } from "./chunk-RL2QBUUH.js";
4
4
  export {
5
5
  createServer
6
6
  };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@poincaretrade/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "MCP server for the Poincaré hook: lets AI agents read the trend regime and create and manage spread-aware DCA orders.",
5
- "license": "BUSL-1.1",
5
+ "license": "MIT",
6
6
  "author": "Prakhar Srivastava",
7
- "homepage": "https://www.poincaretrade.in/#/developers",
7
+ "homepage": "https://www.poincaretrade.in/docs",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/Prakhar-30/POINCARE.git",
@@ -32,6 +32,7 @@
32
32
  "types": "./dist/server.d.ts",
33
33
  "files": [
34
34
  "dist",
35
+ "skills",
35
36
  "README.md",
36
37
  "LICENSE"
37
38
  ],
@@ -39,7 +40,7 @@
39
40
  "@modelcontextprotocol/sdk": "1.32.1",
40
41
  "viem": "2.53.1",
41
42
  "zod": "4.6.6",
42
- "@poincaretrade/sdk": "0.1.0"
43
+ "@poincaretrade/sdk": "0.1.2"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@types/node": "22.18.6",
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: poincare
3
+ description: Read the Poincaré pool's trend regime, quote swaps and run spread-aware DCA orders through the Poincaré MCP server (Uniswap v4 hook on Unichain Sepolia, testnet). Use when the user asks whether the Poincaré WETH/USDC pool is trending, which side pays the trend spread, what a swap would return, or wants to plan, create, check, pause, resume, edit, cancel or refund a Poincaré DCA order, or to wait for a trend onset.
4
+ license: MIT
5
+ metadata:
6
+ version: "0.1.0"
7
+ requires: "@poincaretrade/mcp (MCP server, 15 tools)"
8
+ ---
9
+
10
+ # Poincaré
11
+
12
+ Poincaré is a Uniswap v4 hook on the WETH/USDC pool. A CUSUM detector on the pool's own price
13
+ confirms trends at a data-dependent moment; once one is confirmed, swaps pushing **with** the trend
14
+ pay a spread of up to 5% (kept by liquidity providers), and the other side trades at the plain
15
+ price. PoincareDCA runs DCA orders whose slices can wait that spread out.
16
+
17
+ This skill tells you how to drive the `poincare` MCP server well. Everything is on **Unichain
18
+ Sepolia, a testnet**: test tokens carry no value. Say so when it matters (before any transaction).
19
+
20
+ ## Setup
21
+
22
+ The tools below come from the Poincaré MCP server. If they are not available, tell the user to add
23
+ it and restart the client:
24
+
25
+ ```sh
26
+ claude mcp add poincare -- npx -y @poincaretrade/mcp
27
+ ```
28
+
29
+ For Claude Desktop or another client, the server is `npx -y @poincaretrade/mcp` (stdio). Optional
30
+ environment: `POINCARE_RPC_URL`, `POINCARE_DCA_ADDRESS`, and `POINCARE_PRIVATE_KEY` (only if the
31
+ user wants the server to broadcast; see Safety).
32
+
33
+ ## Orientation (never mix these up)
34
+
35
+ - Prices are **USDC per WETH**; "up" means the chart goes up.
36
+ - `buy` pays USDC for WETH. `sell` pays WETH for USDC.
37
+ - Amounts going in are **decimal strings** in the input token: `"100"` USDC, `"0.05"` WETH.
38
+ - Spreads from tools are fractions (`0.0466` = 4.66%); order caps are basis points (`0` = never pay).
39
+
40
+ ## Ground rules
41
+
42
+ 1. **Read before you claim.** Every number you state comes from a tool result in this
43
+ conversation. Never estimate a price, spread or fill.
44
+ 2. **Unsigned by default.** Write tools return unsigned transactions unless called with
45
+ `send: true`. Only pass `send: true` when the user has explicitly asked you to send *this*
46
+ action in this turn **and** a key is configured. Otherwise, hand back the transactions and say
47
+ they must be signed in order from the owner's wallet.
48
+ 3. **Confirm destructive actions.** Before `dca_cancel_order` (or `dca_close_expired` on someone
49
+ else's behalf), restate what will be refunded and ask for a yes.
50
+ 4. **One line first, details on request.** Lead with a plain sentence ("Buys are free right now;
51
+ sells pay 4.66% because a down-trend is confirmed."), then the figures.
52
+
53
+ ## Workflows
54
+
55
+ ### What is the market doing?
56
+
57
+ Call `get_regime`. Report, in one line: the trend (none / up / down), which side pays and how much
58
+ (`spread.buy`, `spread.sell`), and how close the evidence is to the threshold (`evidence.progress`,
59
+ 0 to 1). If `gated` is true, explain that the moves read as chop, so nothing is charged. For the
60
+ recent past use `get_regime_history` (`blocks`, 100 to 20,000).
61
+
62
+ ### What would a swap give me?
63
+
64
+ Call `quote` with `side` and `amount`. Report what comes out, the spread and the fee. If the user's
65
+ side is the charged side, mention the alternative: a spread-guarded DCA waits the spread out.
66
+
67
+ ### Plan a spread-aware DCA
68
+
69
+ 1. Translate the request into an order (table below), then call **`dca_plan_order`** first. It
70
+ validates exactly like the contract and says what the first fill would do right now.
71
+ 2. Present the plan: total, number of fills, interval, end time, protection, first-fill verdict.
72
+ 3. On the user's go-ahead, call **`dca_create_order`** with the same fields plus `owner`
73
+ (their address; omit only if a key is configured). It returns `[approve, createOrder]`
74
+ (exact-amount approval, never unlimited).
75
+
76
+ | The user says | Fields |
77
+ |---|---|
78
+ | "buy 500 USDC of WETH over a day, hourly" | `side: "buy"`, `amount: "500"`, `slices: 24`, `intervalSec: 3600` |
79
+ | "sell 2 WETH evenly over 4 hours" | `side: "sell"`, `amount: "2"`, `slices: 4`, `intervalSec: 3600` |
80
+ | "every 15 minutes, 10 times, 50 USDC each" | `amount: "500"`, `slices: 10`, `intervalSec: 900` |
81
+ | "never pay the trend spread" (default to this) | `maxSpreadBps: 0` |
82
+ | "also wait while a trend runs my way" | `maxSpreadBps: 0`, `pauseOnTrend: true` |
83
+ | "fill every slot whatever the spread" | `maxSpreadBps: 10000` |
84
+ | "don't pay more than 2,400" (buy) / "not below 2,200" (sell) | `limitPrice: "2400"` / `"2200"` |
85
+
86
+ `catchUp` defaults to true (later fills grow so the order still finishes on time); `maxSlippageBps`
87
+ defaults to 50. `intervalSec` must be at least 60.
88
+
89
+ ### Check on orders
90
+
91
+ - `dca_list_orders` (`owner`) lists an address's orders with spent, progress and next-fill status.
92
+ - `dca_get_order` (`id`) for one order; `dca_preview_slice` (`id`) for the contract's verdict on
93
+ the next fill.
94
+
95
+ | Status | Say |
96
+ |---|---|
97
+ | `ready` | The next fill is due; the keeper fills it within a minute. |
98
+ | `waiting-for-slot` | This slot is done; the next opens at `nextSlotAt`. |
99
+ | `not-started` | Before the start time. |
100
+ | `spread-too-high` | Held: this side pays more than the order's cap. It fills when the spread drops; later fills catch up. |
101
+ | `trend-against` | Held: trend pause is on and a trend runs with this side. |
102
+ | `below-limit` | Held: the pool price is beyond the order's limit. |
103
+ | `paused` | Paused by the owner; nothing fills until resumed. |
104
+ | `expired` | Past the deadline; the rest can be refunded with `dca_close_expired`. |
105
+ | `filled` / `cancelled` | Closed. If `refunded > 0`, part of the budget was returned, not spent. |
106
+
107
+ ### Change an order (owner only)
108
+
109
+ - `dca_pause_order` / `dca_resume_order` (`id`).
110
+ - `dca_edit_order` (`id` plus any of `slices`, `intervalSec`, `durationSec`, `deadline`,
111
+ `maxSpreadBps`, `pauseOnTrend`, `catchUp`, `maxSlippageBps`, `limitPrice`; `limitPrice: "none"`
112
+ removes the limit). It re-plans the **remaining** budget from now; side, recipient and budget are
113
+ fixed, and a paused order stays paused.
114
+ - `dca_cancel_order` (`id`): refunds what is left at once. Confirm first.
115
+ - `dca_close_expired` (`id`): after the deadline, anyone may call it; the refund always goes to the
116
+ owner.
117
+ - `dca_execute_slice` (`id`): the owner can fill their own due slice; refused unless `ready`.
118
+
119
+ ### Wait for something to happen
120
+
121
+ `wait_for_regime_change` blocks until one of `events` happens or `timeoutSec` (5 to 300) passes:
122
+ `trend-started`, `trend-ended`, `trend-flipped`, `evidence-building`, `spread-engaged`,
123
+ `spread-released`. For longer watches, call it again in a loop and summarise each event as it
124
+ comes; stop when the user's condition is met.
125
+
126
+ ## When a call fails
127
+
128
+ - An invalid order comes back with the contract's own reason: `deadline` (the end leaves no room
129
+ for every fill), `interval` (under 60 s), `slices` (1 to 10,000), `bps` (0 to 10,000),
130
+ `amountIn` (no amount). Explain it in those words and suggest the fix.
131
+ - "needs POINCARE_PRIVATE_KEY": the user asked to send but no key is configured. Return the
132
+ unsigned transactions instead.
133
+ - An action refused because it would revert now (closed order, not yet expired, already paused,
134
+ fill held): report the current status from `dca_get_order` rather than retrying.
135
+
136
+ ## Safety
137
+
138
+ - Only suggest configuring `POINCARE_PRIVATE_KEY` with a **testnet** key the user is comfortable
139
+ delegating. Never ask the user to paste a key into the chat.
140
+ - PoincareDCA is unaudited periphery code on a testnet; the hook and Lens it reads were reviewed
141
+ (SFS-Labs scoped review, Olympix pre-audit scan). Say this if the user treats it as production.
142
+ - Docs: https://www.poincaretrade.in/docs