pandora-cli-skills 1.1.23 → 1.1.25
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 +2 -0
- package/SKILL.md +51 -0
- package/cli/pandora.cjs +120 -49
- package/package.json +19 -5
- package/tsconfig.json +0 -13
package/README.md
CHANGED
|
@@ -36,5 +36,7 @@ npx pandora-cli-skills@latest --help
|
|
|
36
36
|
## Notes
|
|
37
37
|
|
|
38
38
|
- Node.js `>=18` required.
|
|
39
|
+
- Full CLI skill contract, error semantics, and workflow references are documented in
|
|
40
|
+
[`SKILL.md`](./SKILL.md).
|
|
39
41
|
- Full operational and JSON contract documentation is in
|
|
40
42
|
[`README_FOR_SHARING.md`](./README_FOR_SHARING.md).
|
package/SKILL.md
CHANGED
|
@@ -193,6 +193,57 @@ pandora --output json suggest --wallet <0x...> --risk medium --budget 50 --inclu
|
|
|
193
193
|
- `suggest`: risk/budget-ranked opportunities seeded from arbitrage output and wallet history.
|
|
194
194
|
- `resolve` and `lp`: enabled command paths with strict flag/runtime validation and decoded on-chain revert reporting.
|
|
195
195
|
|
|
196
|
+
## Polymarket command group
|
|
197
|
+
- `pandora polymarket check [--rpc-url <url>] [--private-key <hex>] [--funder <address>]`
|
|
198
|
+
- Discovers signer + proxy wallet readiness and reports balances/allowances/ownership checks.
|
|
199
|
+
- `pandora polymarket approve --dry-run|--execute [--rpc-url <url>] [--private-key <hex>] [--funder <address>]`
|
|
200
|
+
- Validates and applies required USDC.e + CTF approvals for hedge execution paths.
|
|
201
|
+
- `pandora polymarket preflight [--rpc-url <url>] [--private-key <hex>] [--funder <address>]`
|
|
202
|
+
- Aggregated readiness gate for live Polymarket trading operations.
|
|
203
|
+
- `pandora polymarket trade --condition-id <id>|--slug <slug>|--token-id <id> --token yes|no --amount-usdc <n> --dry-run|--execute [--side buy|sell] [--polymarket-host <url>] [--timeout-ms <ms>] [--rpc-url <url>] [--private-key <hex>] [--funder <address>]`
|
|
204
|
+
- Direct Polymarket order path outside `mirror sync`.
|
|
205
|
+
|
|
206
|
+
## Mirror workflow guide
|
|
207
|
+
1. Plan:
|
|
208
|
+
- `pandora mirror plan --source polymarket --polymarket-slug <slug> --with-rules --include-similarity`
|
|
209
|
+
2. Deploy:
|
|
210
|
+
- `pandora mirror deploy --polymarket-slug <slug> --liquidity-usdc 10 --dry-run|--execute`
|
|
211
|
+
3. Verify:
|
|
212
|
+
- `pandora mirror verify --market-address <pandora-market> --polymarket-slug <slug> --include-similarity --with-rules`
|
|
213
|
+
4. Run sync:
|
|
214
|
+
- `pandora mirror sync run --market-address <pandora-market> --polymarket-slug <slug> --paper`
|
|
215
|
+
- live: `--execute-live --max-open-exposure-usdc <n> --max-trades-per-day <n>`
|
|
216
|
+
5. Inspect status:
|
|
217
|
+
- `pandora mirror status --state-file <path> --with-live`
|
|
218
|
+
|
|
219
|
+
Mode aliases:
|
|
220
|
+
- Mirror commands accept both mode styles:
|
|
221
|
+
- paper/live: `--paper` or `--dry-run`, and `--execute-live` or `--execute`
|
|
222
|
+
- Mirror commands accept either market flag name:
|
|
223
|
+
- `--pandora-market-address` or `--market-address`
|
|
224
|
+
|
|
225
|
+
## Distribution format (ppb)
|
|
226
|
+
- Distribution inputs use parts-per-billion (ppb):
|
|
227
|
+
- `--distribution-yes 580000000` means YES seed weight = `58%`.
|
|
228
|
+
- `--distribution-no 420000000` means NO seed weight = `42%`.
|
|
229
|
+
- Constraint: `distributionYes + distributionNo = 1_000_000_000`.
|
|
230
|
+
|
|
231
|
+
## Error code guide
|
|
232
|
+
Common structured error codes for automation:
|
|
233
|
+
- `MISSING_REQUIRED_FLAG`: required flag absent.
|
|
234
|
+
- `INVALID_FLAG_VALUE`: wrong type/range/format for a flag.
|
|
235
|
+
- `INVALID_ARGS`: conflicting or incompatible argument combinations.
|
|
236
|
+
- `UNKNOWN_FLAG`: unrecognized flag for a command.
|
|
237
|
+
- `UNKNOWN_COMMAND`: unrecognized top-level command.
|
|
238
|
+
- `NOT_FOUND`: requested entity not found.
|
|
239
|
+
- `INDEXER_HTTP_ERROR` / `INDEXER_TIMEOUT`: indexer transport failure.
|
|
240
|
+
- `MIRROR_*`: mirror pipeline/service failures (plan/deploy/verify/sync/go/status).
|
|
241
|
+
- `POLYMARKET_*`: Polymarket resolution/auth/order/preflight failures.
|
|
242
|
+
- `WEBHOOK_DELIVERY_FAILED`: webhook hard-fail when `--fail-on-webhook-error` is set.
|
|
243
|
+
|
|
244
|
+
Error envelope:
|
|
245
|
+
- `{ ok: false, error: { code, message, details? } }`
|
|
246
|
+
|
|
196
247
|
## Pandora mainnet deployment reference
|
|
197
248
|
- PredictionOracle (Factory): `0x259308E7d8557e4Ba192De1aB8Cf7e0E21896442`
|
|
198
249
|
- PredictionPoll (Implementation): `0xC49c177736107fD8351ed6564136B9ADbE5B1eC3`
|
package/cli/pandora.cjs
CHANGED
|
@@ -58,6 +58,15 @@ const ROOT = path.resolve(__dirname, '..');
|
|
|
58
58
|
const DEFAULT_ENV_FILE = path.join(ROOT, 'scripts', '.env');
|
|
59
59
|
const DEFAULT_ENV_EXAMPLE = path.join(ROOT, 'scripts', '.env.example');
|
|
60
60
|
const DEFAULT_INDEXER_URL = 'https://pandoraindexer.up.railway.app/';
|
|
61
|
+
let PACKAGE_VERSION = '0.0.0';
|
|
62
|
+
try {
|
|
63
|
+
const packageJson = require(path.join(ROOT, 'package.json'));
|
|
64
|
+
if (packageJson && typeof packageJson.version === 'string' && packageJson.version.trim()) {
|
|
65
|
+
PACKAGE_VERSION = packageJson.version.trim();
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
// best effort
|
|
69
|
+
}
|
|
61
70
|
|
|
62
71
|
const REQUIRED_ENV_KEYS = ['CHAIN_ID', 'RPC_URL', 'PRIVATE_KEY', 'ORACLE', 'FACTORY', 'USDC'];
|
|
63
72
|
const SUPPORTED_CHAIN_IDS = new Set([1, 146]);
|
|
@@ -228,6 +237,7 @@ pandora - Prediction market CLI
|
|
|
228
237
|
|
|
229
238
|
Usage:
|
|
230
239
|
pandora [--output table|json] help
|
|
240
|
+
pandora [--output table|json] --version
|
|
231
241
|
pandora [--output table|json] init-env [--force] [--dotenv-path <path>] [--example <path>]
|
|
232
242
|
pandora [--output table|json] doctor [--dotenv-path <path>] [--skip-dotenv] [--check-usdc-code] [--check-polymarket] [--rpc-timeout-ms <ms>]
|
|
233
243
|
pandora [--output table|json] setup [--force] [--dotenv-path <path>] [--example <path>] [--check-usdc-code] [--check-polymarket] [--rpc-timeout-ms <ms>]
|
|
@@ -540,8 +550,32 @@ function inferRequestedOutputMode(argv) {
|
|
|
540
550
|
return 'table';
|
|
541
551
|
}
|
|
542
552
|
|
|
553
|
+
function expandEqualsStyleFlags(argv) {
|
|
554
|
+
const expanded = [];
|
|
555
|
+
for (const token of Array.isArray(argv) ? argv : []) {
|
|
556
|
+
if (
|
|
557
|
+
typeof token === 'string' &&
|
|
558
|
+
token.startsWith('--') &&
|
|
559
|
+
token.includes('=') &&
|
|
560
|
+
token !== '--'
|
|
561
|
+
) {
|
|
562
|
+
const eqIndex = token.indexOf('=');
|
|
563
|
+
const flag = token.slice(0, eqIndex);
|
|
564
|
+
const value = token.slice(eqIndex + 1);
|
|
565
|
+
if (flag && flag !== '--') {
|
|
566
|
+
expanded.push(flag);
|
|
567
|
+
if (value.length) expanded.push(value);
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
expanded.push(token);
|
|
572
|
+
}
|
|
573
|
+
return expanded;
|
|
574
|
+
}
|
|
575
|
+
|
|
543
576
|
function extractOutputMode(argv) {
|
|
544
577
|
let outputMode = 'table';
|
|
578
|
+
let outputConfigured = false;
|
|
545
579
|
const args = [];
|
|
546
580
|
|
|
547
581
|
for (let i = 0; i < argv.length; i += 1) {
|
|
@@ -551,13 +585,23 @@ function extractOutputMode(argv) {
|
|
|
551
585
|
if (!next) {
|
|
552
586
|
throw new CliError('MISSING_FLAG_VALUE', `Missing value for ${token}`);
|
|
553
587
|
}
|
|
554
|
-
|
|
588
|
+
const parsedMode = normalizeOutputMode(next);
|
|
589
|
+
if (outputConfigured && parsedMode !== outputMode) {
|
|
590
|
+
throw new CliError('INVALID_ARGS', `Conflicting --output values: "${outputMode}" and "${parsedMode}".`);
|
|
591
|
+
}
|
|
592
|
+
outputMode = parsedMode;
|
|
593
|
+
outputConfigured = true;
|
|
555
594
|
i += 1;
|
|
556
595
|
continue;
|
|
557
596
|
}
|
|
558
597
|
|
|
559
598
|
if (token.startsWith('--output=')) {
|
|
560
|
-
|
|
599
|
+
const parsedMode = normalizeOutputMode(token.slice('--output='.length));
|
|
600
|
+
if (outputConfigured && parsedMode !== outputMode) {
|
|
601
|
+
throw new CliError('INVALID_ARGS', `Conflicting --output values: "${outputMode}" and "${parsedMode}".`);
|
|
602
|
+
}
|
|
603
|
+
outputMode = parsedMode;
|
|
604
|
+
outputConfigured = true;
|
|
561
605
|
continue;
|
|
562
606
|
}
|
|
563
607
|
|
|
@@ -567,6 +611,18 @@ function extractOutputMode(argv) {
|
|
|
567
611
|
return { outputMode, args };
|
|
568
612
|
}
|
|
569
613
|
|
|
614
|
+
function parseDateLikeFlag(value, flagName) {
|
|
615
|
+
const text = String(value || '').trim();
|
|
616
|
+
const parsed = Date.parse(text);
|
|
617
|
+
if (Number.isNaN(parsed)) {
|
|
618
|
+
throw new CliError(
|
|
619
|
+
'INVALID_FLAG_VALUE',
|
|
620
|
+
`${flagName} must be a valid date/time string (for example: "2026-03-15" or "2026-03-15T18:00:00Z"). Received: "${text}"`,
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
return text;
|
|
624
|
+
}
|
|
625
|
+
|
|
570
626
|
function emitJson(payload) {
|
|
571
627
|
console.log(JSON.stringify(payload, null, 2));
|
|
572
628
|
}
|
|
@@ -2453,8 +2509,8 @@ function parseAutopilotFlags(args) {
|
|
|
2453
2509
|
|
|
2454
2510
|
for (let i = 0; i < rest.length; i += 1) {
|
|
2455
2511
|
const token = rest[i];
|
|
2456
|
-
if (token === '--market-address') {
|
|
2457
|
-
options.marketAddress = parseAddressFlag(requireFlagValue(rest, i,
|
|
2512
|
+
if (token === '--market-address' || token === '--pandora-market-address') {
|
|
2513
|
+
options.marketAddress = parseAddressFlag(requireFlagValue(rest, i, token), token);
|
|
2458
2514
|
i += 1;
|
|
2459
2515
|
continue;
|
|
2460
2516
|
}
|
|
@@ -2478,11 +2534,11 @@ function parseAutopilotFlags(args) {
|
|
|
2478
2534
|
i += 1;
|
|
2479
2535
|
continue;
|
|
2480
2536
|
}
|
|
2481
|
-
if (token === '--paper') {
|
|
2537
|
+
if (token === '--paper' || token === '--dry-run') {
|
|
2482
2538
|
options.executeLive = false;
|
|
2483
2539
|
continue;
|
|
2484
2540
|
}
|
|
2485
|
-
if (token === '--execute-live') {
|
|
2541
|
+
if (token === '--execute-live' || token === '--execute') {
|
|
2486
2542
|
options.executeLive = true;
|
|
2487
2543
|
continue;
|
|
2488
2544
|
}
|
|
@@ -2801,12 +2857,12 @@ function parseMirrorBrowseFlags(args) {
|
|
|
2801
2857
|
continue;
|
|
2802
2858
|
}
|
|
2803
2859
|
if (token === '--closes-after') {
|
|
2804
|
-
options.closesAfter = requireFlagValue(args, i, '--closes-after');
|
|
2860
|
+
options.closesAfter = parseDateLikeFlag(requireFlagValue(args, i, '--closes-after'), '--closes-after');
|
|
2805
2861
|
i += 1;
|
|
2806
2862
|
continue;
|
|
2807
2863
|
}
|
|
2808
2864
|
if (token === '--closes-before') {
|
|
2809
|
-
options.closesBefore = requireFlagValue(args, i, '--closes-before');
|
|
2865
|
+
options.closesBefore = parseDateLikeFlag(requireFlagValue(args, i, '--closes-before'), '--closes-before');
|
|
2810
2866
|
i += 1;
|
|
2811
2867
|
continue;
|
|
2812
2868
|
}
|
|
@@ -3082,10 +3138,10 @@ function parseMirrorVerifyFlags(args) {
|
|
|
3082
3138
|
|
|
3083
3139
|
for (let i = 0; i < args.length; i += 1) {
|
|
3084
3140
|
const token = args[i];
|
|
3085
|
-
if (token === '--pandora-market-address') {
|
|
3141
|
+
if (token === '--pandora-market-address' || token === '--market-address') {
|
|
3086
3142
|
options.pandoraMarketAddress = parseAddressFlag(
|
|
3087
|
-
requireFlagValue(args, i,
|
|
3088
|
-
|
|
3143
|
+
requireFlagValue(args, i, token),
|
|
3144
|
+
token,
|
|
3089
3145
|
);
|
|
3090
3146
|
i += 1;
|
|
3091
3147
|
continue;
|
|
@@ -3145,7 +3201,7 @@ function parseMirrorVerifyFlags(args) {
|
|
|
3145
3201
|
}
|
|
3146
3202
|
|
|
3147
3203
|
if (!options.pandoraMarketAddress) {
|
|
3148
|
-
throw new CliError('MISSING_REQUIRED_FLAG', 'Missing --pandora-market-address <address
|
|
3204
|
+
throw new CliError('MISSING_REQUIRED_FLAG', 'Missing --pandora-market-address <address> (alias: --market-address).');
|
|
3149
3205
|
}
|
|
3150
3206
|
if (!options.polymarketMarketId && !options.polymarketSlug) {
|
|
3151
3207
|
throw new CliError('MISSING_REQUIRED_FLAG', 'mirror verify requires --polymarket-market-id <id> or --polymarket-slug <slug>.');
|
|
@@ -3203,10 +3259,10 @@ function parseMirrorStatusFlags(args) {
|
|
|
3203
3259
|
i += 1;
|
|
3204
3260
|
continue;
|
|
3205
3261
|
}
|
|
3206
|
-
if (token === '--pandora-market-address') {
|
|
3262
|
+
if (token === '--pandora-market-address' || token === '--market-address') {
|
|
3207
3263
|
options.pandoraMarketAddress = parseAddressFlag(
|
|
3208
|
-
requireFlagValue(args, i,
|
|
3209
|
-
|
|
3264
|
+
requireFlagValue(args, i, token),
|
|
3265
|
+
token,
|
|
3210
3266
|
);
|
|
3211
3267
|
i += 1;
|
|
3212
3268
|
continue;
|
|
@@ -3327,10 +3383,10 @@ function parseMirrorSyncFlags(args) {
|
|
|
3327
3383
|
|
|
3328
3384
|
for (let i = 0; i < rest.length; i += 1) {
|
|
3329
3385
|
const token = rest[i];
|
|
3330
|
-
if (token === '--pandora-market-address') {
|
|
3386
|
+
if (token === '--pandora-market-address' || token === '--market-address') {
|
|
3331
3387
|
options.pandoraMarketAddress = parseAddressFlag(
|
|
3332
|
-
requireFlagValue(rest, i,
|
|
3333
|
-
|
|
3388
|
+
requireFlagValue(rest, i, token),
|
|
3389
|
+
token,
|
|
3334
3390
|
);
|
|
3335
3391
|
i += 1;
|
|
3336
3392
|
continue;
|
|
@@ -3345,12 +3401,12 @@ function parseMirrorSyncFlags(args) {
|
|
|
3345
3401
|
i += 1;
|
|
3346
3402
|
continue;
|
|
3347
3403
|
}
|
|
3348
|
-
if (token === '--paper') {
|
|
3404
|
+
if (token === '--paper' || token === '--dry-run') {
|
|
3349
3405
|
sawPaperModeFlag = true;
|
|
3350
3406
|
options.executeLive = false;
|
|
3351
3407
|
continue;
|
|
3352
3408
|
}
|
|
3353
|
-
if (token === '--execute-live') {
|
|
3409
|
+
if (token === '--execute-live' || token === '--execute') {
|
|
3354
3410
|
sawExecuteLiveModeFlag = true;
|
|
3355
3411
|
options.executeLive = true;
|
|
3356
3412
|
continue;
|
|
@@ -3531,10 +3587,13 @@ function parseMirrorSyncFlags(args) {
|
|
|
3531
3587
|
}
|
|
3532
3588
|
|
|
3533
3589
|
if (!options.pandoraMarketAddress) {
|
|
3534
|
-
throw new CliError('MISSING_REQUIRED_FLAG', 'Missing --pandora-market-address <address
|
|
3590
|
+
throw new CliError('MISSING_REQUIRED_FLAG', 'Missing --pandora-market-address <address> (alias: --market-address).');
|
|
3535
3591
|
}
|
|
3536
3592
|
if (sawPaperModeFlag && sawExecuteLiveModeFlag) {
|
|
3537
|
-
throw new CliError(
|
|
3593
|
+
throw new CliError(
|
|
3594
|
+
'INVALID_ARGS',
|
|
3595
|
+
'mirror sync accepts only one mode flag: --paper/--dry-run or --execute-live/--execute.',
|
|
3596
|
+
);
|
|
3538
3597
|
}
|
|
3539
3598
|
if (options.mode === 'once' && options.daemon) {
|
|
3540
3599
|
throw new CliError('INVALID_ARGS', 'mirror sync once does not support --daemon. Use mirror sync start for background run mode.');
|
|
@@ -3792,13 +3851,13 @@ function parseMirrorGoFlags(args) {
|
|
|
3792
3851
|
i += 1;
|
|
3793
3852
|
continue;
|
|
3794
3853
|
}
|
|
3795
|
-
if (token === '--paper') {
|
|
3854
|
+
if (token === '--paper' || token === '--dry-run') {
|
|
3796
3855
|
sawPaperModeFlag = true;
|
|
3797
3856
|
options.paper = true;
|
|
3798
3857
|
options.executeLive = false;
|
|
3799
3858
|
continue;
|
|
3800
3859
|
}
|
|
3801
|
-
if (token === '--execute-live') {
|
|
3860
|
+
if (token === '--execute-live' || token === '--execute') {
|
|
3802
3861
|
sawExecuteLiveModeFlag = true;
|
|
3803
3862
|
options.executeLive = true;
|
|
3804
3863
|
options.paper = false;
|
|
@@ -3972,7 +4031,10 @@ function parseMirrorGoFlags(args) {
|
|
|
3972
4031
|
throw new CliError('MISSING_REQUIRED_FLAG', 'mirror go requires --polymarket-market-id <id> or --polymarket-slug <slug>.');
|
|
3973
4032
|
}
|
|
3974
4033
|
if (sawPaperModeFlag && sawExecuteLiveModeFlag) {
|
|
3975
|
-
throw new CliError(
|
|
4034
|
+
throw new CliError(
|
|
4035
|
+
'INVALID_ARGS',
|
|
4036
|
+
'mirror go accepts only one mode flag: --paper/--dry-run or --execute-live/--execute.',
|
|
4037
|
+
);
|
|
3976
4038
|
}
|
|
3977
4039
|
if (![500, 3000, 10000].includes(options.feeTier)) {
|
|
3978
4040
|
throw new CliError('INVALID_FLAG_VALUE', '--fee-tier must be one of 500, 3000, 10000.');
|
|
@@ -4003,10 +4065,10 @@ function parseMirrorCloseFlags(args) {
|
|
|
4003
4065
|
|
|
4004
4066
|
for (let i = 0; i < args.length; i += 1) {
|
|
4005
4067
|
const token = args[i];
|
|
4006
|
-
if (token === '--pandora-market-address') {
|
|
4068
|
+
if (token === '--pandora-market-address' || token === '--market-address') {
|
|
4007
4069
|
options.pandoraMarketAddress = parseAddressFlag(
|
|
4008
|
-
requireFlagValue(args, i,
|
|
4009
|
-
|
|
4070
|
+
requireFlagValue(args, i, token),
|
|
4071
|
+
token,
|
|
4010
4072
|
);
|
|
4011
4073
|
i += 1;
|
|
4012
4074
|
continue;
|
|
@@ -4033,7 +4095,7 @@ function parseMirrorCloseFlags(args) {
|
|
|
4033
4095
|
}
|
|
4034
4096
|
|
|
4035
4097
|
if (!options.pandoraMarketAddress) {
|
|
4036
|
-
throw new CliError('MISSING_REQUIRED_FLAG', 'Missing --pandora-market-address <address
|
|
4098
|
+
throw new CliError('MISSING_REQUIRED_FLAG', 'Missing --pandora-market-address <address> (alias: --market-address).');
|
|
4037
4099
|
}
|
|
4038
4100
|
if (!options.polymarketMarketId && !options.polymarketSlug) {
|
|
4039
4101
|
throw new CliError('MISSING_REQUIRED_FLAG', 'mirror close requires --polymarket-market-id <id> or --polymarket-slug <slug>.');
|
|
@@ -4176,10 +4238,10 @@ function parseMirrorHedgeCalcFlags(args) {
|
|
|
4176
4238
|
i += 1;
|
|
4177
4239
|
continue;
|
|
4178
4240
|
}
|
|
4179
|
-
if (token === '--pandora-market-address') {
|
|
4241
|
+
if (token === '--pandora-market-address' || token === '--market-address') {
|
|
4180
4242
|
options.pandoraMarketAddress = parseAddressFlag(
|
|
4181
|
-
requireFlagValue(args, i,
|
|
4182
|
-
|
|
4243
|
+
requireFlagValue(args, i, token),
|
|
4244
|
+
token,
|
|
4183
4245
|
);
|
|
4184
4246
|
i += 1;
|
|
4185
4247
|
continue;
|
|
@@ -4232,7 +4294,7 @@ function parseMirrorHedgeCalcFlags(args) {
|
|
|
4232
4294
|
if (!options.pandoraMarketAddress) {
|
|
4233
4295
|
throw new CliError(
|
|
4234
4296
|
'MISSING_REQUIRED_FLAG',
|
|
4235
|
-
'mirror hedge-calc with market selectors requires --pandora-market-address <address
|
|
4297
|
+
'mirror hedge-calc with market selectors requires --pandora-market-address <address> (alias: --market-address).',
|
|
4236
4298
|
);
|
|
4237
4299
|
}
|
|
4238
4300
|
if (!options.polymarketMarketId && !options.polymarketSlug) {
|
|
@@ -8814,25 +8876,25 @@ async function runMirrorCommand(args, context) {
|
|
|
8814
8876
|
' deploy --plan-file <path>|--polymarket-market-id <id>|--polymarket-slug <slug> --dry-run|--execute [--liquidity-usdc <n>] [--fee-tier 500|3000|10000] [--max-imbalance <n>] [--arbiter <address>] [--category <n>] [--manifest-file <path>]',
|
|
8815
8877
|
);
|
|
8816
8878
|
console.log(
|
|
8817
|
-
' verify --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--trust-deploy] [--manifest-file <path>] [--include-similarity] [--with-rules] [--allow-rule-mismatch]',
|
|
8879
|
+
' verify --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--trust-deploy] [--manifest-file <path>] [--include-similarity] [--with-rules] [--allow-rule-mismatch]',
|
|
8818
8880
|
);
|
|
8819
8881
|
console.log(
|
|
8820
8882
|
' lp-explain --liquidity-usdc <n> [--source-yes-pct <0-100>] [--distribution-yes <parts>] [--distribution-no <parts>]',
|
|
8821
8883
|
);
|
|
8822
8884
|
console.log(
|
|
8823
|
-
' hedge-calc [--reserve-yes-usdc <n> --reserve-no-usdc <n>] [--excess-yes-usdc <n>] [--excess-no-usdc <n>] [--polymarket-yes-pct <0-100>] [--hedge-ratio <n>] [--hedge-cost-bps <n>] [--volume-scenarios <csv>] [--pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug>]',
|
|
8885
|
+
' hedge-calc [--reserve-yes-usdc <n> --reserve-no-usdc <n>] [--excess-yes-usdc <n>] [--excess-no-usdc <n>] [--polymarket-yes-pct <0-100>] [--hedge-ratio <n>] [--hedge-cost-bps <n>] [--volume-scenarios <csv>] [--pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug>]',
|
|
8824
8886
|
);
|
|
8825
8887
|
console.log(
|
|
8826
8888
|
' simulate --liquidity-usdc <n> [--source-yes-pct <0-100>] [--target-yes-pct <0-100>] [--distribution-yes <parts>] [--distribution-no <parts>] [--fee-tier 500|3000|10000] [--volume-scenarios <csv>] [--hedge-ratio <n>] [--polymarket-yes-pct <0-100>]',
|
|
8827
8889
|
);
|
|
8828
8890
|
console.log(
|
|
8829
|
-
' go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--paper|--execute-live] [--private-key <hex>] [--funder <address>] [--auto-sync] [--sync-once] [--force-gate]',
|
|
8891
|
+
' go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--paper|--dry-run|--execute-live|--execute] [--private-key <hex>] [--funder <address>] [--auto-sync] [--sync-once] [--force-gate]',
|
|
8830
8892
|
);
|
|
8831
8893
|
console.log(
|
|
8832
|
-
' sync run|once|start|stop|status --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--paper|--execute-live] [--private-key <hex>] [--funder <address>] [--trust-deploy] [--force-gate] [--daemon] [--stream] [--interval-ms <ms>] [--drift-trigger-bps <n>] [--hedge-trigger-usdc <n>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--state-file <path>] [--kill-switch-file <path>]',
|
|
8894
|
+
' sync run|once|start|stop|status --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--paper|--dry-run|--execute-live|--execute] [--private-key <hex>] [--funder <address>] [--trust-deploy] [--force-gate] [--daemon] [--stream] [--interval-ms <ms>] [--drift-trigger-bps <n>] [--hedge-trigger-usdc <n>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--state-file <path>] [--kill-switch-file <path>]',
|
|
8833
8895
|
);
|
|
8834
8896
|
console.log(' status --state-file <path>|--strategy-hash <hash> [--with-live] [--trust-deploy]');
|
|
8835
|
-
console.log(' close --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> --dry-run|--execute');
|
|
8897
|
+
console.log(' close --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> --dry-run|--execute');
|
|
8836
8898
|
}
|
|
8837
8899
|
return;
|
|
8838
8900
|
}
|
|
@@ -8840,7 +8902,7 @@ async function runMirrorCommand(args, context) {
|
|
|
8840
8902
|
if (action === 'status') {
|
|
8841
8903
|
if (includesHelpFlag(actionArgs)) {
|
|
8842
8904
|
const usage =
|
|
8843
|
-
'pandora [--output table|json] mirror status --state-file <path>|--strategy-hash <hash> [--with-live] [--pandora-market-address <address>] [--polymarket-market-id <id>|--polymarket-slug <slug>]';
|
|
8905
|
+
'pandora [--output table|json] mirror status --state-file <path>|--strategy-hash <hash> [--with-live] [--pandora-market-address <address>|--market-address <address>] [--polymarket-market-id <id>|--polymarket-slug <slug>]';
|
|
8844
8906
|
const polymarketEnv = [
|
|
8845
8907
|
'POLYMARKET_PRIVATE_KEY',
|
|
8846
8908
|
'POLYMARKET_FUNDER',
|
|
@@ -8913,7 +8975,7 @@ async function runMirrorCommand(args, context) {
|
|
|
8913
8975
|
if (!selector.pandoraMarketAddress) {
|
|
8914
8976
|
throw new CliError(
|
|
8915
8977
|
'MISSING_REQUIRED_FLAG',
|
|
8916
|
-
'mirror status --with-live requires --pandora-market-address (or a state file containing it).',
|
|
8978
|
+
'mirror status --with-live requires --pandora-market-address/--market-address (or a state file containing it).',
|
|
8917
8979
|
);
|
|
8918
8980
|
}
|
|
8919
8981
|
if (!selector.polymarketMarketId && !selector.polymarketSlug) {
|
|
@@ -9078,12 +9140,12 @@ async function runMirrorCommand(args, context) {
|
|
|
9078
9140
|
context.outputMode,
|
|
9079
9141
|
'mirror.verify.help',
|
|
9080
9142
|
commandHelpPayload(
|
|
9081
|
-
'pandora [--output table|json] mirror verify --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--trust-deploy] [--manifest-file <path>] [--include-similarity] [--with-rules] [--allow-rule-mismatch]',
|
|
9143
|
+
'pandora [--output table|json] mirror verify --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--trust-deploy] [--manifest-file <path>] [--include-similarity] [--with-rules] [--allow-rule-mismatch]',
|
|
9082
9144
|
),
|
|
9083
9145
|
);
|
|
9084
9146
|
} else {
|
|
9085
9147
|
console.log(
|
|
9086
|
-
'Usage: pandora [--output table|json] mirror verify --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--trust-deploy] [--manifest-file <path>] [--include-similarity] [--with-rules] [--allow-rule-mismatch]',
|
|
9148
|
+
'Usage: pandora [--output table|json] mirror verify --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--trust-deploy] [--manifest-file <path>] [--include-similarity] [--with-rules] [--allow-rule-mismatch]',
|
|
9087
9149
|
);
|
|
9088
9150
|
}
|
|
9089
9151
|
return;
|
|
@@ -9153,7 +9215,7 @@ async function runMirrorCommand(args, context) {
|
|
|
9153
9215
|
if (action === 'hedge-calc') {
|
|
9154
9216
|
if (includesHelpFlag(shared.rest)) {
|
|
9155
9217
|
const usage =
|
|
9156
|
-
'pandora [--output table|json] mirror hedge-calc [--reserve-yes-usdc <n> --reserve-no-usdc <n>] [--excess-yes-usdc <n>] [--excess-no-usdc <n>] [--polymarket-yes-pct <0-100>] [--hedge-ratio <n>] [--hedge-cost-bps <n>] [--volume-scenarios <csv>] [--pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug>] [--trust-deploy] [--manifest-file <path>]';
|
|
9218
|
+
'pandora [--output table|json] mirror hedge-calc [--reserve-yes-usdc <n> --reserve-no-usdc <n>] [--excess-yes-usdc <n>] [--excess-no-usdc <n>] [--polymarket-yes-pct <0-100>] [--hedge-ratio <n>] [--hedge-cost-bps <n>] [--volume-scenarios <csv>] [--pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug>] [--trust-deploy] [--manifest-file <path>]';
|
|
9157
9219
|
if (context.outputMode === 'json') {
|
|
9158
9220
|
emitSuccess(context.outputMode, 'mirror.hedge-calc.help', commandHelpPayload(usage));
|
|
9159
9221
|
} else {
|
|
@@ -9273,7 +9335,7 @@ async function runMirrorCommand(args, context) {
|
|
|
9273
9335
|
if (action === 'go') {
|
|
9274
9336
|
if (includesHelpFlag(shared.rest)) {
|
|
9275
9337
|
const usage =
|
|
9276
|
-
'pandora [--output table|json] mirror go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--paper|--execute-live] [--private-key <hex>] [--funder <address>] [--auto-sync] [--sync-once] [--force-gate]';
|
|
9338
|
+
'pandora [--output table|json] mirror go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--paper|--dry-run|--execute-live|--execute] [--private-key <hex>] [--funder <address>] [--auto-sync] [--sync-once] [--force-gate]';
|
|
9277
9339
|
if (context.outputMode === 'json') {
|
|
9278
9340
|
emitSuccess(context.outputMode, 'mirror.go.help', commandHelpPayload(usage));
|
|
9279
9341
|
} else {
|
|
@@ -9519,10 +9581,10 @@ async function runMirrorCommand(args, context) {
|
|
|
9519
9581
|
'mirror.sync.help',
|
|
9520
9582
|
{
|
|
9521
9583
|
usage:
|
|
9522
|
-
'pandora [--output table|json] mirror sync run|once|start|stop|status --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--paper|--execute-live] [--private-key <hex>] [--funder <address>] [--trust-deploy] [--force-gate] [--daemon] [--stream] [--interval-ms <ms>] [--drift-trigger-bps <n>] [--hedge-trigger-usdc <n>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--min-time-to-close-sec <n>] [--state-file <path>] [--kill-switch-file <path>]',
|
|
9584
|
+
'pandora [--output table|json] mirror sync run|once|start|stop|status --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--paper|--dry-run|--execute-live|--execute] [--private-key <hex>] [--funder <address>] [--trust-deploy] [--force-gate] [--daemon] [--stream] [--interval-ms <ms>] [--drift-trigger-bps <n>] [--hedge-trigger-usdc <n>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--min-time-to-close-sec <n>] [--state-file <path>] [--kill-switch-file <path>]',
|
|
9523
9585
|
daemonLifecycle: {
|
|
9524
9586
|
start:
|
|
9525
|
-
'pandora [--output table|json] mirror sync start --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [run flags]',
|
|
9587
|
+
'pandora [--output table|json] mirror sync start --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [run flags]',
|
|
9526
9588
|
stop:
|
|
9527
9589
|
'pandora [--output table|json] mirror sync stop --pid-file <path>|--strategy-hash <hash>',
|
|
9528
9590
|
status:
|
|
@@ -9548,7 +9610,7 @@ async function runMirrorCommand(args, context) {
|
|
|
9548
9610
|
);
|
|
9549
9611
|
} else {
|
|
9550
9612
|
console.log(
|
|
9551
|
-
'Usage: pandora [--output table|json] mirror sync run|once|start|stop|status --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--paper|--execute-live] [--private-key <hex>] [--funder <address>] [--trust-deploy] [--force-gate] [--daemon] [--stream] [--interval-ms <ms>] [--drift-trigger-bps <n>] [--hedge-trigger-usdc <n>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--min-time-to-close-sec <n>] [--state-file <path>] [--kill-switch-file <path>]',
|
|
9613
|
+
'Usage: pandora [--output table|json] mirror sync run|once|start|stop|status --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--paper|--dry-run|--execute-live|--execute] [--private-key <hex>] [--funder <address>] [--trust-deploy] [--force-gate] [--daemon] [--stream] [--interval-ms <ms>] [--drift-trigger-bps <n>] [--hedge-trigger-usdc <n>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--min-time-to-close-sec <n>] [--state-file <path>] [--kill-switch-file <path>]',
|
|
9552
9614
|
);
|
|
9553
9615
|
console.log('Daemon stop: pandora mirror sync stop --pid-file <path>|--strategy-hash <hash>');
|
|
9554
9616
|
console.log('Daemon status: pandora mirror sync status --pid-file <path>|--strategy-hash <hash>');
|
|
@@ -9760,7 +9822,7 @@ async function runMirrorCommand(args, context) {
|
|
|
9760
9822
|
if (action === 'close') {
|
|
9761
9823
|
if (includesHelpFlag(shared.rest)) {
|
|
9762
9824
|
const usage =
|
|
9763
|
-
'pandora [--output table|json] mirror close --pandora-market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> --dry-run|--execute';
|
|
9825
|
+
'pandora [--output table|json] mirror close --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> --dry-run|--execute';
|
|
9764
9826
|
if (context.outputMode === 'json') {
|
|
9765
9827
|
emitSuccess(context.outputMode, 'mirror.close.help', commandHelpPayload(usage));
|
|
9766
9828
|
} else {
|
|
@@ -10408,6 +10470,15 @@ async function dispatch(command, args, context) {
|
|
|
10408
10470
|
return;
|
|
10409
10471
|
}
|
|
10410
10472
|
|
|
10473
|
+
if (command === '--version' || command === '-V' || command === 'version') {
|
|
10474
|
+
if (context.outputMode === 'json') {
|
|
10475
|
+
emitSuccess(context.outputMode, 'version', { version: PACKAGE_VERSION });
|
|
10476
|
+
} else {
|
|
10477
|
+
console.log(PACKAGE_VERSION);
|
|
10478
|
+
}
|
|
10479
|
+
return;
|
|
10480
|
+
}
|
|
10481
|
+
|
|
10411
10482
|
if (command === 'init-env') {
|
|
10412
10483
|
runInitEnv(args, context.outputMode);
|
|
10413
10484
|
return;
|
|
@@ -10545,7 +10616,7 @@ async function dispatch(command, args, context) {
|
|
|
10545
10616
|
}
|
|
10546
10617
|
|
|
10547
10618
|
async function main() {
|
|
10548
|
-
const rawArgv = process.argv.slice(2);
|
|
10619
|
+
const rawArgv = expandEqualsStyleFlags(process.argv.slice(2));
|
|
10549
10620
|
let outputMode = inferRequestedOutputMode(rawArgv);
|
|
10550
10621
|
let args = rawArgv;
|
|
10551
10622
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pandora-cli-skills",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "Pandora CLI & Skills",
|
|
5
5
|
"main": "cli/pandora.cjs",
|
|
6
6
|
"bin": {
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"references/creation-script.md",
|
|
18
18
|
"SKILL.md",
|
|
19
19
|
"README.md",
|
|
20
|
-
"README_FOR_SHARING.md"
|
|
21
|
-
"tsconfig.json"
|
|
20
|
+
"README_FOR_SHARING.md"
|
|
22
21
|
],
|
|
23
22
|
"scripts": {
|
|
24
23
|
"cli": "node cli/pandora.cjs",
|
|
@@ -37,9 +36,24 @@
|
|
|
37
36
|
"test:smoke": "node tests/smoke/pack-install-smoke.cjs",
|
|
38
37
|
"test": "npm run build && npm run test:unit && npm run test:cli && npm run test:smoke"
|
|
39
38
|
},
|
|
40
|
-
"keywords": [
|
|
41
|
-
|
|
39
|
+
"keywords": [
|
|
40
|
+
"pandora",
|
|
41
|
+
"prediction-market",
|
|
42
|
+
"cli",
|
|
43
|
+
"polymarket",
|
|
44
|
+
"defi",
|
|
45
|
+
"hedging"
|
|
46
|
+
],
|
|
47
|
+
"author": "Pandora CLI Contributors",
|
|
42
48
|
"license": "ISC",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/XoAnonXo/pandora-cli-skills.git"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/XoAnonXo/pandora-cli-skills/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/XoAnonXo/pandora-cli-skills#readme",
|
|
43
57
|
"type": "commonjs",
|
|
44
58
|
"engines": {
|
|
45
59
|
"node": ">=18"
|
package/tsconfig.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"strict": false,
|
|
9
|
-
"noEmit": true,
|
|
10
|
-
"types": ["node"]
|
|
11
|
-
},
|
|
12
|
-
"include": ["scripts/**/*.ts"]
|
|
13
|
-
}
|