@poincaretrade/mcp 0.1.1 → 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 +27 -27
- package/README.md +43 -43
- package/dist/{chunk-TWNQBRNA.js → chunk-RL2QBUUH.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/server.js +1 -1
- package/package.json +3 -3
- package/skills/poincare/SKILL.md +142 -142
package/LICENSE
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Prakhar Srivastava
|
|
4
|
-
|
|
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:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
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.
|
|
22
|
-
|
|
23
|
-
-----------------------------------------------------------------------------
|
|
24
|
-
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Prakhar Srivastava
|
|
4
|
+
|
|
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:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
-----------------------------------------------------------------------------
|
|
24
|
+
|
|
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
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
# @poincaretrade/mcp
|
|
2
|
-
|
|
3
|
-
An [MCP](https://modelcontextprotocol.io) server that gives Claude, or any MCP client, **Poincaré**'s trend
|
|
4
|
-
regime, swap quotes and spread-aware DCA orders as 15 tools. It reads the live pool on Unichain Sepolia and
|
|
5
|
-
returns **unsigned** transactions; nothing is ever sent unless you add your own key and the agent calls a
|
|
6
|
-
tool with `send: true`.
|
|
7
|
-
|
|
8
|
-
Full docs: **https://www.poincaretrade.in
|
|
9
|
-
|
|
10
|
-
## Add it
|
|
11
|
-
|
|
12
|
-
**Claude Code**
|
|
13
|
-
|
|
14
|
-
```sh
|
|
15
|
-
claude mcp add poincare -- npx -y @poincaretrade/mcp
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Claude Desktop and other clients** (`mcpServers` in the client's config):
|
|
19
|
-
|
|
20
|
-
```json
|
|
21
|
-
{
|
|
22
|
-
"mcpServers": {
|
|
23
|
-
"poincare": { "command": "npx", "args": ["-y", "@poincaretrade/mcp"] }
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
| Variable | Meaning |
|
|
29
|
-
|---|---|
|
|
30
|
-
| `POINCARE_RPC_URL` | RPC endpoint (default: the public Unichain Sepolia RPC) |
|
|
31
|
-
| `POINCARE_DCA_ADDRESS` | Overrides the live PoincareDCA |
|
|
32
|
-
| `POINCARE_PRIVATE_KEY` | Optional. With it, tools called with `send: true` broadcast from this key, and owner-only tools refuse orders it does not own. Use a testnet key you are happy to delegate |
|
|
33
|
-
|
|
34
|
-
## Tools
|
|
35
|
-
|
|
36
|
-
`get_regime` · `get_regime_history` · `wait_for_regime_change` · `quote` · `dca_plan_order` ·
|
|
37
|
-
`dca_create_order` · `dca_get_order` · `dca_list_orders` · `dca_preview_slice` · `dca_pause_order` ·
|
|
38
|
-
`dca_resume_order` · `dca_edit_order` · `dca_execute_slice` · `dca_cancel_order` · `dca_close_expired`
|
|
39
|
-
|
|
40
|
-
Try: *"Is the Poincaré pool trending right now, and which side pays?"* or *"Plan a DCA that buys 500 USDC
|
|
41
|
-
of WETH over a day without ever paying the trend spread."*
|
|
42
|
-
|
|
43
|
-
**Status:** testnet research preview. MIT licensed (see LICENSE).
|
|
1
|
+
# @poincaretrade/mcp
|
|
2
|
+
|
|
3
|
+
An [MCP](https://modelcontextprotocol.io) server that gives Claude, or any MCP client, **Poincaré**'s trend
|
|
4
|
+
regime, swap quotes and spread-aware DCA orders as 15 tools. It reads the live pool on Unichain Sepolia and
|
|
5
|
+
returns **unsigned** transactions; nothing is ever sent unless you add your own key and the agent calls a
|
|
6
|
+
tool with `send: true`.
|
|
7
|
+
|
|
8
|
+
Full docs: **https://www.poincaretrade.in/docs/mcp**
|
|
9
|
+
|
|
10
|
+
## Add it
|
|
11
|
+
|
|
12
|
+
**Claude Code**
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
claude mcp add poincare -- npx -y @poincaretrade/mcp
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Claude Desktop and other clients** (`mcpServers` in the client's config):
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"poincare": { "command": "npx", "args": ["-y", "@poincaretrade/mcp"] }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Variable | Meaning |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `POINCARE_RPC_URL` | RPC endpoint (default: the public Unichain Sepolia RPC) |
|
|
31
|
+
| `POINCARE_DCA_ADDRESS` | Overrides the live PoincareDCA |
|
|
32
|
+
| `POINCARE_PRIVATE_KEY` | Optional. With it, tools called with `send: true` broadcast from this key, and owner-only tools refuse orders it does not own. Use a testnet key you are happy to delegate |
|
|
33
|
+
|
|
34
|
+
## Tools
|
|
35
|
+
|
|
36
|
+
`get_regime` · `get_regime_history` · `wait_for_regime_change` · `quote` · `dca_plan_order` ·
|
|
37
|
+
`dca_create_order` · `dca_get_order` · `dca_list_orders` · `dca_preview_slice` · `dca_pause_order` ·
|
|
38
|
+
`dca_resume_order` · `dca_edit_order` · `dca_execute_slice` · `dca_cancel_order` · `dca_close_expired`
|
|
39
|
+
|
|
40
|
+
Try: *"Is the Poincaré pool trending right now, and which side pays?"* or *"Plan a DCA that buys 500 USDC
|
|
41
|
+
of WETH over a day without ever paying the trend spread."*
|
|
42
|
+
|
|
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.
|
|
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
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poincaretrade/mcp",
|
|
3
|
-
"version": "0.1.
|
|
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
5
|
"license": "MIT",
|
|
6
6
|
"author": "Prakhar Srivastava",
|
|
7
|
-
"homepage": "https://www.poincaretrade.in
|
|
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",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
41
41
|
"viem": "2.53.1",
|
|
42
42
|
"zod": "4.6.6",
|
|
43
|
-
"@poincaretrade/sdk": "0.1.
|
|
43
|
+
"@poincaretrade/sdk": "0.1.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "22.18.6",
|
package/skills/poincare/SKILL.md
CHANGED
|
@@ -1,142 +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
|
|
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
|