jaspervault_cli 1.0.18 → 1.0.19
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.
|
@@ -2,8 +2,9 @@ import { ethers, Wallet, JsonRpcProvider } from 'ethers';
|
|
|
2
2
|
import { loadConfig } from '../utils/config.js';
|
|
3
3
|
import { ENDPOINTS } from '../utils/endpoints.js';
|
|
4
4
|
import { ApiClient } from '../client.js';
|
|
5
|
-
import { printJson, exitWithError, EXIT_CODES
|
|
6
|
-
import { getNetworkConfig } from '../services/chain-config.js';
|
|
5
|
+
import { printJson, exitWithError, EXIT_CODES } from '../utils/output.js';
|
|
6
|
+
import { getNetworkConfig, getTokenConfig, getWriterAddress } from '../services/chain-config.js';
|
|
7
|
+
import { SubgraphClient } from '../services/subgraph-client.js';
|
|
7
8
|
import { loadDelegationKey } from '../services/key-manager.js';
|
|
8
9
|
import { loadVaultProfile, getPositionAccountFromProfile } from '../services/vault-profile.js';
|
|
9
10
|
import { buildSignData, signSignData, fetchWriterIndices, buildManagedOrder, } from '../services/order-signer.js';
|
|
@@ -100,21 +101,115 @@ export function registerOrderCommand(program) {
|
|
|
100
101
|
}
|
|
101
102
|
});
|
|
102
103
|
order
|
|
103
|
-
.command('
|
|
104
|
-
.description('
|
|
105
|
-
.requiredOption('--order-id <id>', '
|
|
106
|
-
.
|
|
107
|
-
.option('--
|
|
104
|
+
.command('protect')
|
|
105
|
+
.description('Add PPO hedge option protection to an existing position (no position size change)')
|
|
106
|
+
.requiredOption('--order-id <id>', 'Existing perps order ID to protect')
|
|
107
|
+
.requiredOption('--symbol <symbol>', 'Asset symbol (e.g. JBTC, CBBTC)')
|
|
108
|
+
.option('--ppo-expire <duration>', 'Option expiry: 30m (default) or 8h', '30m')
|
|
109
|
+
.option('--ppo-category <ATM|OTM>', 'Option category (default: ATM)', 'ATM')
|
|
110
|
+
.option('--ppo-tier <1-5>', 'OTM strike offset tier: 1=0.1%, 2=0.2%, 3=0.3%, 4=0.4%, 5=0.5%')
|
|
111
|
+
.option('--network <name>', 'Network name', 'jaspervault')
|
|
112
|
+
.option('--ttl <seconds>', 'Signature TTL in seconds', '3600')
|
|
108
113
|
.option('--pretty', 'Pretty-print JSON output')
|
|
109
114
|
.action(async (opts) => {
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
const delegation = loadDelegationKey();
|
|
116
|
+
if (!delegation) {
|
|
117
|
+
exitWithError('Delegation key not found. Run "jv vault init" first or set JV_DELEGATION_KEY.', EXIT_CODES.CONFIG_ERROR);
|
|
118
|
+
}
|
|
119
|
+
const profile = loadVaultProfile(opts.network);
|
|
120
|
+
if (!profile) {
|
|
121
|
+
exitWithError(`No vault profile for network ${opts.network}. Run "jv vault init --network ${opts.network}" first.`, EXIT_CODES.CONFIG_ERROR);
|
|
122
|
+
}
|
|
123
|
+
const net = getNetworkConfig(opts.network);
|
|
124
|
+
const subgraphUrl = process.env.JV_SUBGRAPH_URL ?? net.subgraphUrl;
|
|
125
|
+
if (!subgraphUrl) {
|
|
126
|
+
exitWithError(`No subgraphUrl configured for network ${opts.network}. Set JV_SUBGRAPH_URL.`, EXIT_CODES.CONFIG_ERROR);
|
|
127
|
+
}
|
|
128
|
+
const subgraphClient = new SubgraphClient(subgraphUrl);
|
|
129
|
+
const existingOrder = await subgraphClient.queryOrderById(opts.orderId);
|
|
130
|
+
if (!existingOrder) {
|
|
131
|
+
exitWithError(`Order ${opts.orderId} not found in Subgraph.`, EXIT_CODES.BUSINESS_ERROR);
|
|
132
|
+
}
|
|
133
|
+
if (!existingOrder.isActive) {
|
|
134
|
+
exitWithError(`Order ${opts.orderId} is not active.`, EXIT_CODES.BUSINESS_ERROR);
|
|
135
|
+
}
|
|
136
|
+
const order = existingOrder;
|
|
137
|
+
const positionSide = order.positionSide;
|
|
138
|
+
// LONG position needs PUT (1), SHORT position needs CALL (0)
|
|
139
|
+
const hedgeOptionType = positionSide === 'LONG' ? 1 : 0;
|
|
140
|
+
// signData orderType is flipped from option type (matching backend logic)
|
|
141
|
+
const signOrderType = hedgeOptionType === 0 ? 1 : 0;
|
|
142
|
+
const { ppoSettings } = parsePpoOptions({
|
|
143
|
+
ppo: true,
|
|
144
|
+
ppoExpire: opts.ppoExpire,
|
|
145
|
+
ppoCategory: opts.ppoCategory,
|
|
146
|
+
ppoTier: opts.ppoTier,
|
|
147
|
+
});
|
|
148
|
+
const expireSeconds = parseInt(ppoSettings.optionExpireTime ?? '1800', 10);
|
|
149
|
+
const expireDate = Math.floor(Date.now() / 1000) + expireSeconds;
|
|
150
|
+
const ttlSeconds = parseInt(opts.ttl, 10);
|
|
151
|
+
const writerSide = positionSide.toLowerCase();
|
|
152
|
+
const tokenConfig = getTokenConfig(opts.network, opts.symbol);
|
|
153
|
+
const writerAddress = getWriterAddress(opts.network, opts.symbol, writerSide);
|
|
154
|
+
const provider = new JsonRpcProvider(net.rpcUrl);
|
|
155
|
+
const optionModuleV2 = net.contracts.optionModuleV2 ?? net.contracts.diamond;
|
|
156
|
+
const writerIndices = await fetchWriterIndices(writerAddress, signOrderType, tokenConfig.address, provider, optionModuleV2);
|
|
157
|
+
const marginAssetConfig = net.marginAsset;
|
|
158
|
+
if (!marginAssetConfig) {
|
|
159
|
+
exitWithError(`marginAsset not configured for network ${opts.network}`, EXIT_CODES.CONFIG_ERROR);
|
|
160
|
+
}
|
|
161
|
+
const signData = {
|
|
162
|
+
limitType: 0,
|
|
163
|
+
orderID: parseInt(order.id),
|
|
164
|
+
orderType: signOrderType,
|
|
165
|
+
productType: order.productType || '0',
|
|
166
|
+
targetPrice: '0',
|
|
167
|
+
expireTime: Math.floor(Date.now() / 1000) + ttlSeconds,
|
|
168
|
+
wallet: profile.eoa,
|
|
169
|
+
writer: writerAddress,
|
|
170
|
+
recipient: order.recipient || profile.marginAccount || '',
|
|
171
|
+
chainId: net.chainId,
|
|
172
|
+
marginAsset: marginAssetConfig.address,
|
|
173
|
+
marginAmount: '0',
|
|
174
|
+
underlyingAsset: order.underlyingAsset,
|
|
175
|
+
};
|
|
176
|
+
const delegationWallet = new Wallet(delegation.delegationPrivateKey);
|
|
177
|
+
const signature = await signSignData(signData, delegationWallet);
|
|
178
|
+
const premiumSign = {
|
|
179
|
+
lockAsset: order.underlyingAsset,
|
|
180
|
+
strikeAsset: marginAssetConfig.address,
|
|
181
|
+
optionType: hedgeOptionType,
|
|
182
|
+
productType: order.productType || '0',
|
|
183
|
+
expireDate: expireDate.toString(),
|
|
184
|
+
chainId: net.chainId.toString(),
|
|
185
|
+
};
|
|
186
|
+
const managedOrderBody = {
|
|
187
|
+
holder: order.holder,
|
|
188
|
+
quantity: order.quantity,
|
|
189
|
+
writer: writerAddress,
|
|
190
|
+
recipient: order.recipient || profile.marginAccount || '',
|
|
191
|
+
settingsIndex: writerIndices.settingsIndex,
|
|
192
|
+
productTypeIndex: writerIndices.productTypeIndex,
|
|
193
|
+
oracleIndex: '0',
|
|
194
|
+
nftFreeOption: ethers.ZeroAddress,
|
|
195
|
+
optionSourceType: '0',
|
|
196
|
+
liquidationToEOA: false,
|
|
197
|
+
offerID: writerIndices.offerID,
|
|
198
|
+
premiumSign,
|
|
199
|
+
};
|
|
200
|
+
console.error(`Adding ${ppoSettings.optionCategory ?? 'ATM'} hedge protection to order #${order.id} (${positionSide}), ` +
|
|
201
|
+
`expires in ${opts.ppoExpire}`);
|
|
112
202
|
const config = loadConfig();
|
|
113
203
|
const client = new ApiClient(config);
|
|
114
|
-
const
|
|
115
|
-
body.orderId = opts.orderId;
|
|
116
|
-
const res = await client.post(ENDPOINTS.ORDER_CREATE_OPTION, body);
|
|
204
|
+
const res = await client.post(ENDPOINTS.ORDER_CREATE_OPTION, { managedOrder: managedOrderBody, signature, orderId: opts.orderId });
|
|
117
205
|
printJson(res.data, opts.pretty);
|
|
206
|
+
if ('jobId' in res.data && res.data.jobId) {
|
|
207
|
+
const sseResult = await client.watchJobStream(res.data.jobId, 60);
|
|
208
|
+
printJson(sseResult, opts.pretty);
|
|
209
|
+
if (sseResult.status !== 'completed') {
|
|
210
|
+
exitWithError(sseResult.error ?? `Job ${sseResult.status}`, EXIT_CODES.BUSINESS_ERROR);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
118
213
|
});
|
|
119
214
|
}
|
|
120
215
|
//# sourceMappingURL=order.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../../src/commands/order.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../../src/commands/order.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EACL,aAAa,EACb,YAAY,EACZ,k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MAAM,MAAM,CAAC,IAAI,CAC3B,SAAS,CAAC,mBAAmB,EAC7B,EAAE,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CACrE,CAAC;QACF,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAEjC,IAAI,OAAO,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAC1C,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAClE,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAClC,IAAI,SAAS,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACrC,aAAa,CACX,SAAS,CAAC,KAAK,IAAI,OAAO,SAAS,CAAC,MAAM,EAAE,EAC5C,UAAU,CAAC,cAAc,CAC1B,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -38,8 +38,9 @@ Trade perpetual contracts on JasperVault via the \`jv\` CLI. No private key is e
|
|
|
38
38
|
|
|
39
39
|
1. **WalletConnect ONLY**: ALWAYS use \`jv vault init-wc\`. NEVER suggest \`jv vault init\` (private-key mode). NEVER ask the user to set \`PRIVATE_KEY\`.
|
|
40
40
|
2. **QR Code Display**: When \`jv vault init-wc\` outputs JSON with a \`qrCodeUrl\` field, you MUST display the \`qrCodeUrl\` value as a clickable link to the user. This is the only QR code field in the output — there are no other QR representations.
|
|
41
|
-
3. **Long-running Commands**: \`jv vault init-wc\`
|
|
41
|
+
3. **Long-running Commands**: \`jv vault init-wc\` is a long-running command (up to 2 min) that will be auto-backgrounded. After it backgrounds you receive a \`sessionId\` and the first JSON output (QR code). Show the QR link to the user, then poll every 15 seconds with \`process poll\` using that \`sessionId\` until you see the second JSON line containing \`"success":true\` or the process exits. See [references/onboarding.md](references/onboarding.md) for the full step-by-step flow.
|
|
42
42
|
4. **Real-time Prices**: NEVER guess or estimate prices. ALWAYS run \`jv price --symbol JBTC --pretty\` before any price-dependent operation (opening a position by asset quantity, calculating PnL).
|
|
43
|
+
5. **PPO Auto-Cancellation**: When performing any position operation (reduce, close, add size) WITHOUT \`--ppo\`, the smart contract automatically cancels existing PPO hedge options. There is NO separate "cancel PPO" command. NEVER attempt a separate cancellation — it risks unintended position closures.
|
|
43
44
|
|
|
44
45
|
## Activation Behavior
|
|
45
46
|
|
|
@@ -62,7 +63,9 @@ Trade perpetual contracts on JasperVault via the \`jv\` CLI. No private key is e
|
|
|
62
63
|
| Reduce / close position | opposite-side \`jv order create\` | [references/trading.md](references/trading.md) |
|
|
63
64
|
| Set take-profit | \`jv tp set --order-id ID --price P\` | [references/trading.md](references/trading.md) |
|
|
64
65
|
| Set stop-loss | \`jv sl set --order-id ID --price P\` | [references/trading.md](references/trading.md) |
|
|
65
|
-
|
|
|
66
|
+
| Add PPO to existing position | \`jv order protect --order-id <id>\` | [references/trading.md](references/trading.md) |
|
|
67
|
+
| Open/add-size with PPO | add \`--ppo\` to \`jv order create\` | [references/trading.md](references/trading.md) |
|
|
68
|
+
| Cancel PPO / remove hedge | order without \`--ppo\` (auto-cancels) | [references/trading.md](references/trading.md) |
|
|
66
69
|
| Query positions / portfolio | \`jv orders list --pretty\` | [references/queries.md](references/queries.md) |
|
|
67
70
|
| Job execution status | \`jv job status <jobId>\` | [references/queries.md](references/queries.md) |
|
|
68
71
|
| Manage limit orders | \`jv limit-order list/cancel\` | [references/queries.md](references/queries.md) |
|
|
@@ -80,16 +83,19 @@ const ONBOARDING_REFERENCE = `# WalletConnect Onboarding & Deposit
|
|
|
80
83
|
|
|
81
84
|
## Vault Init via WalletConnect
|
|
82
85
|
|
|
86
|
+
\`jv vault init-wc\` is a long-running command (up to 2 minutes). It will be auto-backgrounded by the exec tool. You MUST use \`process poll\` to retrieve the final result. Follow these three steps exactly:
|
|
87
|
+
|
|
88
|
+
### Step 1: Run the command and show QR code
|
|
89
|
+
|
|
83
90
|
\`\`\`bash
|
|
84
91
|
jv vault init-wc --network jaspervault --timeout 120
|
|
85
92
|
\`\`\`
|
|
86
93
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
The
|
|
90
|
-
|
|
91
|
-
### Line 1: Awaiting Connection
|
|
94
|
+
The command will be auto-backgrounded after ~10 seconds. You will receive:
|
|
95
|
+
- A \`sessionId\` for the background session
|
|
96
|
+
- The first JSON output containing the QR code
|
|
92
97
|
|
|
98
|
+
First JSON output:
|
|
93
99
|
\`\`\`json
|
|
94
100
|
{"status":"awaiting_connection", "qrCodeUrl":"https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=wc%3A...", "uri":"wc:...", "message":"Scan QR code or paste URI in wallet to connect"}
|
|
95
101
|
\`\`\`
|
|
@@ -98,15 +104,26 @@ Display the \`qrCodeUrl\` value as a clickable link so the user can open it and
|
|
|
98
104
|
|
|
99
105
|
> Or open your wallet app → WalletConnect → paste this URI: \`wc:...\`
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
### Step 2: Poll for completion
|
|
102
108
|
|
|
103
|
-
|
|
109
|
+
After showing the QR code, poll the background session every 15 seconds using the \`sessionId\`:
|
|
104
110
|
|
|
111
|
+
\`\`\`json
|
|
112
|
+
{"tool":"process", "action":"poll", "sessionId":"<sessionId from step 1>"}
|
|
113
|
+
\`\`\`
|
|
114
|
+
|
|
115
|
+
Keep polling until you see the second JSON line in the output containing \`"success":true\`, or the process exits. Do NOT stop polling early — the user needs time to scan the QR code and approve the signature on their phone.
|
|
116
|
+
|
|
117
|
+
### Step 3: Handle the result
|
|
118
|
+
|
|
119
|
+
When polling returns the second JSON line:
|
|
105
120
|
\`\`\`json
|
|
106
121
|
{"success":true, "message":"Vault initialized successfully", ...}
|
|
107
122
|
\`\`\`
|
|
108
123
|
|
|
109
|
-
|
|
124
|
+
Tell the user: "Vault initialized successfully. You can now deposit and trade."
|
|
125
|
+
|
|
126
|
+
If polling shows the process exited with an error or \`"success":false\`, report the error message to the user.
|
|
110
127
|
|
|
111
128
|
The delegation wallet is saved to \`~/.jaspervault/keys.json\` and vault addresses to \`~/.jaspervault/profile.json\`. Subsequent commands use these automatically — no wallet interaction needed.
|
|
112
129
|
|
|
@@ -229,13 +246,32 @@ Returns \`limitOrderId\` on success.
|
|
|
229
246
|
|
|
230
247
|
## PPO Hedge Protection
|
|
231
248
|
|
|
232
|
-
|
|
249
|
+
There are TWO different commands depending on the scenario:
|
|
250
|
+
|
|
251
|
+
| Scenario | Command | Backend Operation |
|
|
252
|
+
|----------|---------|-------------------|
|
|
253
|
+
| Add protection to **existing position** (no size change) | \`jv order protect --order-id <id>\` | CREATE_OPTION |
|
|
254
|
+
| Open new position **with** protection | \`jv order create --ppo ...\` | CREATE_WITH_OPTION |
|
|
255
|
+
| Add size to position **with** protection | \`jv order create --ppo ...\` (same side) | ADD_SIZE_OPTION |
|
|
256
|
+
|
|
257
|
+
### Decision Rule (CRITICAL)
|
|
258
|
+
|
|
259
|
+
**If the user ALREADY HAS a position and only wants to add/renew hedge protection — use \`jv order protect\`.** Do NOT use \`jv order create --ppo\` for this, as it will add unwanted position size.
|
|
260
|
+
|
|
261
|
+
Only use \`jv order create --ppo\` when the user explicitly wants to open a new position or add size AND include protection at the same time.
|
|
262
|
+
|
|
263
|
+
### Adding Protection to Existing Position
|
|
264
|
+
|
|
265
|
+
\`\`\`bash
|
|
266
|
+
jv order protect --order-id <id> --symbol <symbol> [options] --network jaspervault
|
|
267
|
+
\`\`\`
|
|
268
|
+
|
|
269
|
+
**Required**: \`--order-id\` (from \`jv orders list\`) and \`--symbol\`.
|
|
233
270
|
|
|
234
271
|
**Options:**
|
|
235
272
|
|
|
236
273
|
| Flag | Values | Default | Description |
|
|
237
274
|
|------|--------|---------|-------------|
|
|
238
|
-
| \`--ppo\` | (boolean) | off | Enable PPO |
|
|
239
275
|
| \`--ppo-expire\` | \`30m\` or \`8h\` | \`30m\` | Option duration |
|
|
240
276
|
| \`--ppo-category\` | \`ATM\` or \`OTM\` | \`ATM\` | ATM = strike at market price; OTM = strike offset |
|
|
241
277
|
| \`--ppo-tier\` | \`1-5\` | (required for OTM) | OTM offset: 1=0.1%, 2=0.2%, 3=0.3%, 4=0.4%, 5=0.5% |
|
|
@@ -243,19 +279,43 @@ Add \`--ppo\` to any \`jv order create\` command to enable automatic hedge optio
|
|
|
243
279
|
**Examples:**
|
|
244
280
|
|
|
245
281
|
\`\`\`bash
|
|
246
|
-
# ATM protection, 30 min (default)
|
|
247
|
-
jv order
|
|
282
|
+
# ATM protection on existing order #99, 30 min (default)
|
|
283
|
+
jv order protect --order-id 99 --symbol JBTC --network jaspervault
|
|
248
284
|
|
|
249
285
|
# ATM protection, 8 hours
|
|
286
|
+
jv order protect --order-id 99 --symbol JBTC --ppo-expire 8h --network jaspervault
|
|
287
|
+
|
|
288
|
+
# OTM protection, tier 3
|
|
289
|
+
jv order protect --order-id 99 --symbol JBTC --ppo-category OTM --ppo-tier 3 --network jaspervault
|
|
290
|
+
\`\`\`
|
|
291
|
+
|
|
292
|
+
**Typical flow:**
|
|
293
|
+
1. \`jv orders list --pretty\` → find the order ID
|
|
294
|
+
2. \`jv order protect --order-id <id> --symbol JBTC --network jaspervault\`
|
|
295
|
+
|
|
296
|
+
### Opening/Adding Position WITH Protection
|
|
297
|
+
|
|
298
|
+
Add \`--ppo\` to \`jv order create\` when creating a new position or adding size with simultaneous protection:
|
|
299
|
+
|
|
300
|
+
\`\`\`bash
|
|
301
|
+
# New position with ATM protection
|
|
302
|
+
jv order create --side long --symbol JBTC --margin 60 --leverage 50 --ppo --network jaspervault
|
|
303
|
+
|
|
304
|
+
# New position with 8h ATM protection
|
|
250
305
|
jv order create --side long --symbol JBTC --margin 60 --leverage 50 --ppo --ppo-expire 8h --network jaspervault
|
|
251
306
|
|
|
252
|
-
#
|
|
307
|
+
# New position with OTM protection
|
|
253
308
|
jv order create --side long --symbol JBTC --margin 60 --leverage 50 --ppo --ppo-category OTM --ppo-tier 5 --network jaspervault
|
|
254
|
-
|
|
255
|
-
# OTM protection, tier 3 (0.3% offset), 8 hours
|
|
256
|
-
jv order create --side short --symbol JBTC --margin 60 --leverage 50 --ppo --ppo-expire 8h --ppo-category OTM --ppo-tier 3 --network jaspervault
|
|
257
309
|
\`\`\`
|
|
258
310
|
|
|
311
|
+
### PPO Parameters (shared by both commands)
|
|
312
|
+
|
|
313
|
+
| Flag | Values | Default | Description |
|
|
314
|
+
|------|--------|---------|-------------|
|
|
315
|
+
| \`--ppo-expire\` | \`30m\` or \`8h\` | \`30m\` | Option duration |
|
|
316
|
+
| \`--ppo-category\` | \`ATM\` or \`OTM\` | \`ATM\` | ATM = strike at market price; OTM = strike offset |
|
|
317
|
+
| \`--ppo-tier\` | \`1-5\` | (required for OTM) | OTM offset: 1=0.1%, 2=0.2%, 3=0.3%, 4=0.4%, 5=0.5% |
|
|
318
|
+
|
|
259
319
|
**AI agent behavior when user wants OTM:**
|
|
260
320
|
|
|
261
321
|
1. First run \`jv price --symbol JBTC --pretty\` to get current price
|
|
@@ -267,10 +327,28 @@ jv order create --side short --symbol JBTC --margin 60 --leverage 50 --ppo --ppo
|
|
|
267
327
|
|
|
268
328
|
**Intent mapping:**
|
|
269
329
|
|
|
270
|
-
- User says "
|
|
330
|
+
- User says "加保护" / "开保护" / "对冲" / "hedge" / "protect" on an **existing position** → \`jv order protect --order-id <id>\`
|
|
331
|
+
- User says "开仓 + 加保护" / "open with protection" → \`jv order create --ppo\`
|
|
332
|
+
- User says "加仓 + 加保护" / "add size with protection" → \`jv order create --ppo\` (same side)
|
|
271
333
|
- User says "8 hour" / "8小时" → \`--ppo-expire 8h\`
|
|
272
334
|
- User says "OTM" / "价外" → \`--ppo-category OTM\`, then present tier options
|
|
273
335
|
- User says "ATM" / "平价" or nothing → default ATM, 30 min
|
|
336
|
+
- User says "取消PPO" / "cancel PPO" / "取消保护" / "关闭对冲" / "remove hedge" → perform a position operation WITHOUT \`--ppo\`; the existing hedge option is auto-cancelled by the contract
|
|
337
|
+
|
|
338
|
+
## PPO Cancellation (IMPORTANT — read before any reduce/close/add with PPO)
|
|
339
|
+
|
|
340
|
+
The smart contract **automatically cancels** existing PPO hedge options when you execute any position operation (reduce, close, add size) **without** the \`--ppo\` flag. There is **NO separate "cancel PPO" command**.
|
|
341
|
+
|
|
342
|
+
| User Request | Correct Action | Commands |
|
|
343
|
+
|--------------|---------------|----------|
|
|
344
|
+
| "减仓一半 + 取消PPO" | Single reduce order without \`--ppo\` | \`jv order create --side <opposite> --margin <half> --leverage 50 --network jaspervault\` |
|
|
345
|
+
| "加仓 + 取消PPO" | Single add-size order without \`--ppo\` | \`jv order create --side <same> --margin <amount> --leverage 50 --network jaspervault\` |
|
|
346
|
+
| "平仓" (full close) | Close order without \`--ppo\` | \`jv order create --side <opposite> --margin <full> --leverage 50 --network jaspervault\` |
|
|
347
|
+
| "减仓一半 + 保留PPO" | Reduce order WITH \`--ppo\` | \`jv order create --side <opposite> --margin <half> --leverage 50 --ppo --network jaspervault\` |
|
|
348
|
+
|
|
349
|
+
**NEVER do this:**
|
|
350
|
+
- Do NOT try to cancel PPO as a separate step after reducing/closing a position. There is no "cancel PPO" command, and attempting workarounds (e.g. sending an extra opposite-side order) will cause unintended position closures.
|
|
351
|
+
- Do NOT send two orders when one suffices. "减仓 + 取消PPO" = ONE order without \`--ppo\`.
|
|
274
352
|
`;
|
|
275
353
|
// ---------------------------------------------------------------------------
|
|
276
354
|
// references/queries.md — positions, job status, limit orders, output, errors
|
|
@@ -419,7 +497,7 @@ function getOpenClawFrontmatter() {
|
|
|
419
497
|
name: jasper-vault-cli
|
|
420
498
|
description: "Trade perpetual contracts (perps) on JasperVault — open/close positions, set TP/SL, manage limit orders, deposit, and query portfolio via the \`jv\` CLI. Initialize wallet via WalletConnect QR scan (no private key needed). 在 JasperVault 上交易永续合约 — 做多做空、开仓平仓、止盈止损、限价单、持仓查询、充值,使用 WalletConnect 扫码初始化(无需私钥)。"
|
|
421
499
|
trigger: "jaspervault|jasper vault|jasper trading|jv|jv trade|jv order|在jasper交易|jasper 交易|初始化钱包|连接钱包|开仓|平仓|做多|做空|止盈|止损|查看持仓|永续合约"
|
|
422
|
-
tools: [shell]
|
|
500
|
+
tools: [shell, process]
|
|
423
501
|
metadata:
|
|
424
502
|
openclaw:
|
|
425
503
|
requires:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-body.js","sourceRoot":"","sources":["../../../src/templates/skill-body.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CACzC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,EAAE,OAAO,CAAC,CACzC,CAAC;AAEzB,sEAAsE;AACtE,MAAM,CAAC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;wBAcE,WAAW;;CAElC,CAAC,IAAI,EAAE,CAAC;AAIT,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAE9E,MAAM,eAAe,GAAG
|
|
1
|
+
{"version":3,"file":"skill-body.js","sourceRoot":"","sources":["../../../src/templates/skill-body.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,W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