jaspervault_cli 1.0.28 → 1.0.30
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/dist/src/commands/vault.js +29 -16
- package/dist/src/commands/vault.js.map +1 -1
- package/dist/src/templates/skill-body.d.ts +0 -1
- package/dist/src/templates/skill-body.js +0 -2
- package/dist/src/templates/skill-body.js.map +1 -1
- package/dist/src/templates/skill-content/SKILL.core.md +76 -45
- package/dist/src/templates/skill-content/frontmatter/claude.md +1 -1
- package/dist/src/templates/skill-content/frontmatter/openclaw.md +3 -3
- package/dist/src/templates/skill-content/references/onboarding.md +84 -85
- package/dist/src/templates/skill-content/references/queries.md +68 -185
- package/dist/src/templates/skill-content/references/trading.md +130 -178
- package/package.json +1 -1
|
@@ -1,245 +1,200 @@
|
|
|
1
1
|
# Trading Reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> All tools below are MCP tools. Call them directly — never run `jv` shell commands.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
### Syntax
|
|
5
|
+
## 1. Create Order — `create_order`
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
jv order create --side <long|short> --symbol <symbol> -m <margin> [options]
|
|
11
|
-
```
|
|
7
|
+
Open, close, reduce, or add size to perpetual positions.
|
|
12
8
|
|
|
13
|
-
###
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
| `--ppo-tier <1-5>` | No | — | OTM strike offset tier (required if OTM) |
|
|
28
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
29
|
-
| `--ttl <seconds>` | No | `3600` | Order TTL in seconds |
|
|
30
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
9
|
+
### Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Required | Default | Description |
|
|
12
|
+
|-----------|----------|---------|-------------|
|
|
13
|
+
| `side` | Yes | — | `long` or `short` |
|
|
14
|
+
| `symbol` | Yes | — | Asset symbol (e.g., `JBTC`, `CBBTC`) |
|
|
15
|
+
| `margin` | Yes | — | Margin (collateral) in USDC |
|
|
16
|
+
| `leverage` | No | `50` | Leverage multiplier |
|
|
17
|
+
| `limit_price` | No | — | Limit price in USDC (omit for market order) |
|
|
18
|
+
| `ppo` | No | — | `true` to enable PPO hedge option protection |
|
|
19
|
+
| `ppo_expire` | No | `30m` | PPO expiry: `30m` or `8h` |
|
|
20
|
+
| `ppo_category` | No | `ATM` | PPO option category: `ATM` or `OTM` |
|
|
21
|
+
| `ppo_tier` | No | — | OTM strike offset tier 1-5 (required if OTM) |
|
|
22
|
+
| `ttl` | No | `3600` | Order TTL in seconds |
|
|
31
23
|
|
|
32
24
|
### Market Order vs Limit Order
|
|
33
25
|
|
|
34
|
-
- **Market order** (no
|
|
35
|
-
- **Limit order** (
|
|
26
|
+
- **Market order** (no `limit_price`): Executes immediately. The tool auto-waits up to 60s for the on-chain result.
|
|
27
|
+
- **Limit order** (`limit_price` set): Places a limit order that triggers when price reaches the target. Returns immediately with a `limitOrderId`.
|
|
36
28
|
|
|
37
|
-
### Market Order
|
|
29
|
+
### Market Order Response
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
```json
|
|
41
|
-
{"success":true,"orderType":"market","jobId":"MARKET_ORDER_xxx","statusUrl":"/api/job/status/...","streamUrl":"/api/job/stream/..."}
|
|
42
|
-
```
|
|
31
|
+
The tool returns the final execution result:
|
|
43
32
|
|
|
44
|
-
**Line 2 — Execution result (auto-waits up to 60s):**
|
|
45
33
|
```json
|
|
46
|
-
{
|
|
34
|
+
{
|
|
35
|
+
"jobId": "MARKET_ORDER_xxx",
|
|
36
|
+
"status": "completed",
|
|
37
|
+
"transactionHash": "0x..."
|
|
38
|
+
}
|
|
47
39
|
```
|
|
48
40
|
|
|
49
|
-
**
|
|
50
|
-
1. If `status === "completed"` → the order IS executed.
|
|
41
|
+
**After market order execution:**
|
|
42
|
+
1. If `status === "completed"` → the order IS executed. Don't retry.
|
|
51
43
|
2. If `status === "failed"` → report the error to the user.
|
|
52
|
-
3. If `status === "timeout"` → use `
|
|
53
|
-
4. The `operation` field (if present) contains raw on-chain data in wei —
|
|
54
|
-
5. To verify the actual position,
|
|
55
|
-
6. Report: "Order executed. Tx: {transactionHash}. Let me check your updated position..." then
|
|
44
|
+
3. If `status === "timeout"` → use `get_job_status` with the `jobId` to check later.
|
|
45
|
+
4. The `operation` field (if present) contains raw on-chain data in wei — don't interpret it.
|
|
46
|
+
5. To verify the actual position, call `list_orders` and read the human-readable fields.
|
|
47
|
+
6. Report: "Order executed. Tx: {transactionHash}. Let me check your updated position..." then call `list_orders`.
|
|
48
|
+
|
|
49
|
+
### Limit Order Response
|
|
56
50
|
|
|
57
|
-
**Limit order output:**
|
|
58
51
|
```json
|
|
59
|
-
{
|
|
52
|
+
{
|
|
53
|
+
"success": true,
|
|
54
|
+
"orderType": "limit",
|
|
55
|
+
"limitOrderId": "0x..."
|
|
56
|
+
}
|
|
60
57
|
```
|
|
61
|
-
Tell the user: "Limit order placed. ID: {limitOrderId}."
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Before submitting, the CLI prints an estimate to stderr:
|
|
66
|
-
```
|
|
67
|
-
Estimated: ~0.043860 JBTC @ $68,476 (~$3,000 JUSDC total, 50x)
|
|
68
|
-
```
|
|
69
|
-
This is informational only — the actual execution price may differ.
|
|
59
|
+
Tell the user: "Limit order placed. ID: {limitOrderId}."
|
|
70
60
|
|
|
71
61
|
### Common Patterns
|
|
72
62
|
|
|
73
63
|
**Open a long position (market):**
|
|
74
|
-
```
|
|
75
|
-
|
|
64
|
+
```json
|
|
65
|
+
{ "side": "long", "symbol": "JBTC", "margin": 60 }
|
|
76
66
|
```
|
|
77
67
|
|
|
78
|
-
**Open a short position (limit):**
|
|
79
|
-
```
|
|
80
|
-
|
|
68
|
+
**Open a short position (limit at $72,000):**
|
|
69
|
+
```json
|
|
70
|
+
{ "side": "short", "symbol": "JBTC", "margin": 100, "limit_price": 72000 }
|
|
81
71
|
```
|
|
82
72
|
|
|
83
|
-
**Close a long position (
|
|
84
|
-
```
|
|
85
|
-
|
|
73
|
+
**Close a long position (use opposite side with same margin):**
|
|
74
|
+
```json
|
|
75
|
+
{ "side": "short", "symbol": "JBTC", "margin": 60 }
|
|
86
76
|
```
|
|
87
77
|
|
|
88
78
|
**Reduce a long position (partial close):**
|
|
89
|
-
```
|
|
90
|
-
|
|
79
|
+
```json
|
|
80
|
+
{ "side": "short", "symbol": "JBTC", "margin": 30 }
|
|
91
81
|
```
|
|
92
82
|
|
|
93
83
|
**Add size to existing long:**
|
|
94
|
-
```
|
|
95
|
-
|
|
84
|
+
```json
|
|
85
|
+
{ "side": "long", "symbol": "JBTC", "margin": 50 }
|
|
96
86
|
```
|
|
97
87
|
|
|
98
88
|
**Open with PPO protection (ATM, 30 min):**
|
|
99
|
-
```
|
|
100
|
-
|
|
89
|
+
```json
|
|
90
|
+
{ "side": "long", "symbol": "JBTC", "margin": 60, "ppo": true }
|
|
101
91
|
```
|
|
102
92
|
|
|
103
93
|
**Open with PPO protection (OTM tier 3, 8 hours):**
|
|
104
|
-
```
|
|
105
|
-
|
|
94
|
+
```json
|
|
95
|
+
{ "side": "long", "symbol": "JBTC", "margin": 60, "ppo": true, "ppo_expire": "8h", "ppo_category": "OTM", "ppo_tier": 3 }
|
|
106
96
|
```
|
|
107
97
|
|
|
108
98
|
---
|
|
109
99
|
|
|
110
|
-
## 2. Add PPO Protection
|
|
100
|
+
## 2. Add PPO Protection — `protect_order`
|
|
111
101
|
|
|
112
102
|
Add hedge option protection to an **existing position** without changing position size.
|
|
113
103
|
|
|
114
|
-
###
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
jv order protect --order-id <id> --symbol <symbol> [options]
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Options
|
|
104
|
+
### Parameters
|
|
121
105
|
|
|
122
|
-
|
|
|
123
|
-
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
130
|
-
| `--ttl <seconds>` | No | `3600` | Signature TTL in seconds |
|
|
131
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
106
|
+
| Parameter | Required | Default | Description |
|
|
107
|
+
|-----------|----------|---------|-------------|
|
|
108
|
+
| `order_id` | Yes | — | Existing perps order ID |
|
|
109
|
+
| `symbol` | Yes | — | Asset symbol (e.g., `JBTC`) |
|
|
110
|
+
| `ppo_expire` | No | `30m` | Option expiry: `30m` or `8h` |
|
|
111
|
+
| `ppo_category` | No | `ATM` | Option category: `ATM` or `OTM` |
|
|
112
|
+
| `ppo_tier` | No | — | OTM strike offset tier 1-5 (required if OTM) |
|
|
132
113
|
|
|
133
|
-
###
|
|
114
|
+
### Response
|
|
134
115
|
|
|
135
|
-
The
|
|
116
|
+
The tool auto-waits up to 60s for the on-chain result:
|
|
136
117
|
```json
|
|
137
|
-
{
|
|
118
|
+
{
|
|
119
|
+
"jobId": "OPTION_ORDER_xxx",
|
|
120
|
+
"status": "completed",
|
|
121
|
+
"transactionHash": "0x..."
|
|
122
|
+
}
|
|
138
123
|
```
|
|
139
124
|
|
|
140
125
|
### Important
|
|
141
126
|
|
|
142
|
-
- Use `
|
|
143
|
-
-
|
|
144
|
-
- The
|
|
127
|
+
- Use `protect_order` to add hedge to an **existing** position.
|
|
128
|
+
- Don't use `create_order` with `ppo: true` for this — that adds position size.
|
|
129
|
+
- The tool auto-detects position side (LONG/SHORT) and selects the correct hedge type.
|
|
145
130
|
|
|
146
131
|
---
|
|
147
132
|
|
|
148
|
-
## 3. Take-Profit
|
|
133
|
+
## 3. Take-Profit — `set_take_profit`
|
|
149
134
|
|
|
150
135
|
Set a take-profit limit order for an existing position.
|
|
151
136
|
|
|
152
|
-
###
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
jv tp set --order-id <id> --price <usdc> --symbol <symbol> [options]
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Options
|
|
159
|
-
|
|
160
|
-
| Option | Required | Default | Description |
|
|
161
|
-
|--------|----------|---------|-------------|
|
|
162
|
-
| `--order-id <id>` | Yes | — | Existing order ID (position to close) |
|
|
163
|
-
| `--price <usdc>` | Yes | — | Target price in USDC |
|
|
164
|
-
| `--symbol <symbol>` | Yes | — | Asset symbol (e.g., `JBTC`) |
|
|
165
|
-
| `--side <long\|short>` | No | `long` | Position side being closed |
|
|
166
|
-
| `--ppo` | No | — | Enable PPO hedge on the TP order |
|
|
167
|
-
| `--ppo-expire <duration>` | No | `30m` | PPO expiry: `30m` or `8h` |
|
|
168
|
-
| `--ppo-category <ATM\|OTM>` | No | `ATM` | PPO option category |
|
|
169
|
-
| `--ppo-tier <1-5>` | No | — | OTM strike offset tier |
|
|
170
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
171
|
-
| `--ttl <seconds>` | No | `86400` | Order TTL in seconds (default: 24h) |
|
|
172
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
137
|
+
### Parameters
|
|
173
138
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
139
|
+
| Parameter | Required | Default | Description |
|
|
140
|
+
|-----------|----------|---------|-------------|
|
|
141
|
+
| `order_id` | Yes | — | Existing order ID |
|
|
142
|
+
| `price` | Yes | — | Target price in USDC |
|
|
143
|
+
| `symbol` | Yes | — | Asset symbol |
|
|
144
|
+
| `side` | No | `long` | Position side being closed |
|
|
145
|
+
| `ppo` | No | — | Enable PPO hedge on the TP order |
|
|
146
|
+
| `ppo_expire` | No | `30m` | PPO expiry |
|
|
147
|
+
| `ppo_category` | No | `ATM` | PPO category |
|
|
148
|
+
| `ppo_tier` | No | — | OTM tier |
|
|
149
|
+
| `ttl` | No | `86400` | Order TTL (default: 24h) |
|
|
179
150
|
|
|
180
151
|
### Example
|
|
181
152
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
# Set TP for a short position
|
|
187
|
-
jv tp set --order-id 456 --price 60000 --symbol JBTC --side short --pretty
|
|
153
|
+
Set TP at $75,000 for a long position:
|
|
154
|
+
```json
|
|
155
|
+
{ "order_id": "123", "price": 75000, "symbol": "JBTC" }
|
|
188
156
|
```
|
|
189
157
|
|
|
190
158
|
---
|
|
191
159
|
|
|
192
|
-
## 4. Stop-Loss
|
|
193
|
-
|
|
194
|
-
Set a stop-loss limit order for an existing position. Same options as `jv tp set`.
|
|
160
|
+
## 4. Stop-Loss — `set_stop_loss`
|
|
195
161
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
jv sl set --order-id <id> --price <usdc> --symbol <symbol> [options]
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
Options are identical to `jv tp set` (see above).
|
|
162
|
+
Same parameters as `set_take_profit`. Set a stop-loss limit order for an existing position.
|
|
203
163
|
|
|
204
164
|
### Example
|
|
205
165
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
# Set SL for a short position
|
|
211
|
-
jv sl set --order-id 456 --price 80000 --symbol JBTC --side short --pretty
|
|
166
|
+
Set SL at $65,000 for a long position:
|
|
167
|
+
```json
|
|
168
|
+
{ "order_id": "123", "price": 65000, "symbol": "JBTC" }
|
|
212
169
|
```
|
|
213
170
|
|
|
214
171
|
---
|
|
215
172
|
|
|
216
173
|
## 5. PPO (Perpetual Put Option) Details
|
|
217
174
|
|
|
218
|
-
PPO provides hedge protection for positions. Key concepts:
|
|
219
|
-
|
|
220
175
|
### Option Categories
|
|
221
176
|
|
|
222
|
-
| Category | Description |
|
|
223
|
-
|
|
177
|
+
| Category | Description | `ppo_tier` |
|
|
178
|
+
|----------|-------------|------------|
|
|
224
179
|
| `ATM` (default) | At-the-money — strike = current price | Not needed |
|
|
225
180
|
| `OTM` | Out-of-the-money — strike offset from current price | Required (1-5) |
|
|
226
181
|
|
|
227
182
|
### OTM Tiers
|
|
228
183
|
|
|
229
|
-
| Tier | Strike Offset |
|
|
230
|
-
|
|
231
|
-
| 1 | 0.1% |
|
|
232
|
-
| 2 | 0.2% |
|
|
233
|
-
| 3 | 0.3% |
|
|
234
|
-
| 4 | 0.4% |
|
|
235
|
-
| 5 | 0.5% |
|
|
184
|
+
| Tier | Strike Offset |
|
|
185
|
+
|------|---------------|
|
|
186
|
+
| 1 | 0.1% |
|
|
187
|
+
| 2 | 0.2% |
|
|
188
|
+
| 3 | 0.3% |
|
|
189
|
+
| 4 | 0.4% |
|
|
190
|
+
| 5 | 0.5% |
|
|
236
191
|
|
|
237
192
|
### Expiry Options
|
|
238
193
|
|
|
239
|
-
| Duration |
|
|
240
|
-
|
|
241
|
-
| 30 minutes (default) |
|
|
242
|
-
| 8 hours |
|
|
194
|
+
| Duration | Flag |
|
|
195
|
+
|----------|------|
|
|
196
|
+
| 30 minutes (default) | `ppo_expire: "30m"` |
|
|
197
|
+
| 8 hours | `ppo_expire: "8h"` |
|
|
243
198
|
|
|
244
199
|
### Hedge Type (auto-selected)
|
|
245
200
|
|
|
@@ -248,27 +203,24 @@ PPO provides hedge protection for positions. Key concepts:
|
|
|
248
203
|
|
|
249
204
|
### Intent Mapping
|
|
250
205
|
|
|
251
|
-
| User Says |
|
|
252
|
-
|
|
253
|
-
| "
|
|
254
|
-
| "
|
|
255
|
-
| "
|
|
256
|
-
| "8
|
|
257
|
-
| "OTM"
|
|
258
|
-
| "
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
| "
|
|
268
|
-
| "
|
|
269
|
-
| "
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
**NEVER do this:**
|
|
273
|
-
- Do NOT try to cancel PPO as a separate step. There is no "cancel PPO" command.
|
|
274
|
-
- Do NOT send two orders when one suffices. "减仓 + 取消PPO" = ONE order without `--ppo`.
|
|
206
|
+
| User Says | Tool | Parameters |
|
|
207
|
+
|-----------|------|------------|
|
|
208
|
+
| "add protection" to existing | `protect_order` | `{ order_id, symbol }` |
|
|
209
|
+
| "open with protection" | `create_order` | `{ side, symbol, margin, ppo: true }` |
|
|
210
|
+
| "add size with protection" | `create_order` (same side) | `{ side, symbol, margin, ppo: true }` |
|
|
211
|
+
| "8 hours" | any PPO tool | add `ppo_expire: "8h"` |
|
|
212
|
+
| "OTM" | any PPO tool | add `ppo_category: "OTM"`, then need `ppo_tier` |
|
|
213
|
+
| "cancel PPO" / "remove hedge" | `create_order` | without `ppo` — see below |
|
|
214
|
+
|
|
215
|
+
### PPO Cancellation
|
|
216
|
+
|
|
217
|
+
The smart contract **automatically cancels** existing PPO when you execute any position operation without `ppo: true`. There is no separate "cancel PPO" tool.
|
|
218
|
+
|
|
219
|
+
| User Request | Action | Parameters |
|
|
220
|
+
|-------------|--------|------------|
|
|
221
|
+
| "reduce + cancel PPO" | Single reduce order without `ppo` | `{ side: <opposite>, symbol, margin }` |
|
|
222
|
+
| "add size + cancel PPO" | Single add-size order without `ppo` | `{ side: <same>, symbol, margin }` |
|
|
223
|
+
| "close position" | Close order without `ppo` | `{ side: <opposite>, symbol, margin: <full> }` |
|
|
224
|
+
| "reduce + keep PPO" | Reduce order WITH `ppo` | `{ side: <opposite>, symbol, margin, ppo: true }` |
|
|
225
|
+
|
|
226
|
+
Never try to cancel PPO separately — there is no such tool. One order handles everything.
|