pandora-cli-skills 1.1.28 → 1.1.29
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_FOR_SHARING.md +7 -0
- package/SKILL.md +13 -6
- package/cli/lib/leaderboard_service.cjs +1 -1
- package/cli/lib/mirror_daemon_service.cjs +6 -1
- package/cli/lib/scan_command_service.cjs +17 -3
- package/cli/pandora.cjs +49 -12
- package/package.json +1 -1
package/README_FOR_SHARING.md
CHANGED
|
@@ -99,6 +99,13 @@ Prerequisite: Node.js `>=18`.
|
|
|
99
99
|
- `pandora resolve`
|
|
100
100
|
- `pandora lp add|remove|positions`
|
|
101
101
|
|
|
102
|
+
Mirror advanced flags (for operator tuning):
|
|
103
|
+
- `--sync-interval-ms <ms>` on `mirror go` to control auto-sync tick cadence.
|
|
104
|
+
- `--oracle <address>` / `--factory <address>` on `mirror deploy` and `mirror go` for explicit contract overrides.
|
|
105
|
+
- `--polymarket-gamma-mock-url <url>` on `mirror browse|plan|verify|go|sync|status` for deterministic mock-source testing.
|
|
106
|
+
- `--no-stream` on `mirror sync` to disable per-tick stdout line streaming in run mode.
|
|
107
|
+
- `--pid-file <path>` on `mirror sync stop|status` for explicit daemon process selection.
|
|
108
|
+
|
|
102
109
|
## Read-only examples
|
|
103
110
|
- `pandora markets list --limit 20 --order-by createdAt --order-direction desc`
|
|
104
111
|
- `pandora markets list --active --with-odds --limit 20`
|
package/SKILL.md
CHANGED
|
@@ -102,19 +102,26 @@ pandora clone-bet [--dotenv-path <path>] [--skip-dotenv] [script args...]
|
|
|
102
102
|
Mirror subcommand detail:
|
|
103
103
|
|
|
104
104
|
```text
|
|
105
|
-
browse --min-yes-pct <n> --max-yes-pct <n> --min-volume-24h <n> [--closes-after <date>] [--closes-before <date>] [--question-contains <text>] [--limit <n>]
|
|
106
|
-
plan --source polymarket --polymarket-market-id <id>|--polymarket-slug <slug> [--chain-id <id>] [--target-slippage-bps <n>] [--turnover-target <n>] [--depth-slippage-bps <n>] [--safety-multiplier <n>] [--min-liquidity-usdc <n>] [--max-liquidity-usdc <n>] [--with-rules] [--include-similarity] [--polymarket-gamma-url <url>]
|
|
107
|
-
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>] [--min-close-lead-seconds <n>] [--manifest-file <path>]
|
|
108
|
-
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]
|
|
105
|
+
browse --min-yes-pct <n> --max-yes-pct <n> --min-volume-24h <n> [--closes-after <date>] [--closes-before <date>] [--question-contains <text>] [--limit <n>] [--chain-id <id>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>]
|
|
106
|
+
plan --source polymarket --polymarket-market-id <id>|--polymarket-slug <slug> [--chain-id <id>] [--target-slippage-bps <n>] [--turnover-target <n>] [--depth-slippage-bps <n>] [--safety-multiplier <n>] [--min-liquidity-usdc <n>] [--max-liquidity-usdc <n>] [--with-rules] [--include-similarity] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>]
|
|
107
|
+
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>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--oracle <address>] [--factory <address>] [--usdc <address>] [--distribution-yes <parts>] [--distribution-no <parts>] [--sources <url...>] [--min-close-lead-seconds <n>] [--manifest-file <path>] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>]
|
|
108
|
+
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] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>]
|
|
109
109
|
lp-explain --liquidity-usdc <n> [--source-yes-pct <0-100>] [--distribution-yes <parts>] [--distribution-no <parts>]
|
|
110
110
|
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>]
|
|
111
111
|
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>] [--hedge-cost-bps <n>] [--polymarket-yes-pct <0-100>]
|
|
112
|
-
go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--paper|--dry-run|--execute-live|--execute] [--private-key <hex>] [--funder <address>] [--
|
|
113
|
-
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] [--skip-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>]
|
|
112
|
+
go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--fee-tier 500|3000|10000] [--max-imbalance <n>] [--arbiter <address>] [--category <n>] [--paper|--dry-run|--execute-live|--execute] [--auto-sync] [--sync-once] [--sync-interval-ms <ms>] [--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>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--funder <address>] [--usdc <address>] [--oracle <address>] [--factory <address>] [--sources <url...>] [--manifest-file <path>] [--trust-deploy] [--skip-gate] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>] [--with-rules] [--include-similarity] [--min-close-lead-seconds <n>]
|
|
113
|
+
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>] [--usdc <address>] [--trust-deploy] [--manifest-file <path>] [--skip-gate] [--daemon] [--stream|--no-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>] [--depth-slippage-bps <n>] [--min-time-to-close-sec <n>] [--iterations <n>] [--state-file <path>] [--kill-switch-file <path>] [--chain-id <id>] [--rpc-url <url>] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>] [--webhook-url <url>] [--telegram-bot-token <token>] [--discord-webhook-url <url>]
|
|
114
114
|
status --state-file <path>|--strategy-hash <hash> [--with-live] [--pandora-market-address <address>|--market-address <address>] [--polymarket-market-id <id>|--polymarket-slug <slug>]
|
|
115
115
|
close --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> --dry-run|--execute
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
+
Daemon selector detail:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
sync stop --pid-file <path>|--strategy-hash <hash>
|
|
122
|
+
sync status --pid-file <path>|--strategy-hash <hash>
|
|
123
|
+
```
|
|
124
|
+
|
|
118
125
|
Polymarket subcommand detail:
|
|
119
126
|
|
|
120
127
|
```text
|
|
@@ -162,7 +162,7 @@ function startDaemon(options = {}) {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
fs.mkdirSync(path.dirname(logFile), { recursive: true });
|
|
165
|
-
const logFd = fs.openSync(logFile, 'a');
|
|
165
|
+
const logFd = fs.openSync(logFile, 'a', 0o600);
|
|
166
166
|
const child = spawn(process.execPath, [cliPath, ...cliArgs], {
|
|
167
167
|
cwd: options.cwd || process.cwd(),
|
|
168
168
|
env: options.env || process.env,
|
|
@@ -171,6 +171,11 @@ function startDaemon(options = {}) {
|
|
|
171
171
|
});
|
|
172
172
|
child.unref();
|
|
173
173
|
fs.closeSync(logFd);
|
|
174
|
+
try {
|
|
175
|
+
fs.chmodSync(logFile, 0o600);
|
|
176
|
+
} catch {
|
|
177
|
+
// best-effort permission hardening
|
|
178
|
+
}
|
|
174
179
|
const sanitizedCliArgs = sanitizeCliArgs(cliArgs);
|
|
175
180
|
|
|
176
181
|
const metadata = {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
const SCAN_USAGE =
|
|
2
|
-
'pandora [--output table|json] scan [--limit <n>] [--after <cursor>] [--before <cursor>] [--order-by <field>] [--order-direction asc|desc] [--chain-id <id>] [--creator <address>] [--poll-address <address>] [--market-type <type>] [--where-json <json>] [--active|--resolved|--expiring-soon] [--expiring-hours <n>] [--expand]';
|
|
2
|
+
'pandora [--output table|json] scan [--limit <n>] [--after <cursor>] [--before <cursor>] [--order-by <field>] [--order-direction asc|desc] [--chain-id <id>] [--creator <address>] [--poll-address <address>] [--market-type <type>] [--where-json <json>] [--active|--resolved|--expiring-soon] [--expiring-hours <n>] [--expand] [--with-odds]';
|
|
3
|
+
|
|
4
|
+
const SCAN_NOTES = [
|
|
5
|
+
'scan always returns expanded market payloads with odds included.',
|
|
6
|
+
'--with-odds is accepted for backward compatibility and is effectively a no-op.',
|
|
7
|
+
'--active|--resolved|--expiring-soon are client-side lifecycle filters over fetched indexer pages.',
|
|
8
|
+
'scan is indexer-backed (no direct chain reads), so freshness follows indexer sync state.',
|
|
9
|
+
];
|
|
3
10
|
|
|
4
11
|
function createRunScanCommand(deps) {
|
|
5
12
|
const {
|
|
6
13
|
parseIndexerSharedFlags,
|
|
7
14
|
includesHelpFlag,
|
|
8
15
|
emitSuccess,
|
|
9
|
-
commandHelpPayload,
|
|
10
16
|
maybeLoadIndexerEnv,
|
|
11
17
|
resolveIndexerUrl,
|
|
12
18
|
parseMarketsListFlags,
|
|
@@ -20,9 +26,17 @@ function createRunScanCommand(deps) {
|
|
|
20
26
|
const shared = parseIndexerSharedFlags(args);
|
|
21
27
|
if (includesHelpFlag(shared.rest)) {
|
|
22
28
|
if (context.outputMode === 'json') {
|
|
23
|
-
emitSuccess(context.outputMode, 'scan.help',
|
|
29
|
+
emitSuccess(context.outputMode, 'scan.help', {
|
|
30
|
+
usage: SCAN_USAGE,
|
|
31
|
+
notes: SCAN_NOTES,
|
|
32
|
+
});
|
|
24
33
|
} else {
|
|
25
34
|
console.log(`Usage: ${SCAN_USAGE}`);
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log('Notes:');
|
|
37
|
+
for (const note of SCAN_NOTES) {
|
|
38
|
+
console.log(`- ${note}`);
|
|
39
|
+
}
|
|
26
40
|
}
|
|
27
41
|
return;
|
|
28
42
|
}
|
package/cli/pandora.cjs
CHANGED
|
@@ -1491,6 +1491,7 @@ function parseTradeFlags(args) {
|
|
|
1491
1491
|
chainId: null,
|
|
1492
1492
|
rpcUrl: null,
|
|
1493
1493
|
privateKey: null,
|
|
1494
|
+
funder: null,
|
|
1494
1495
|
usdc: null,
|
|
1495
1496
|
};
|
|
1496
1497
|
|
|
@@ -3387,6 +3388,7 @@ function parseMirrorSyncFlags(args) {
|
|
|
3387
3388
|
chainId: null,
|
|
3388
3389
|
rpcUrl: null,
|
|
3389
3390
|
privateKey: null,
|
|
3391
|
+
funder: null,
|
|
3390
3392
|
usdc: null,
|
|
3391
3393
|
polymarketHost: null,
|
|
3392
3394
|
polymarketGammaUrl: null,
|
|
@@ -8969,6 +8971,10 @@ async function runLivePolymarketPreflightForMirror(options = {}) {
|
|
|
8969
8971
|
async function runMirrorCommand(args, context) {
|
|
8970
8972
|
const action = args[0];
|
|
8971
8973
|
const actionArgs = args.slice(1);
|
|
8974
|
+
const mirrorGoUsage =
|
|
8975
|
+
'pandora [--output table|json] mirror go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--fee-tier 500|3000|10000] [--max-imbalance <n>] [--arbiter <address>] [--category <n>] [--paper|--dry-run|--execute-live|--execute] [--auto-sync] [--sync-once] [--sync-interval-ms <ms>] [--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>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--funder <address>] [--usdc <address>] [--oracle <address>] [--factory <address>] [--sources <url...>] [--manifest-file <path>] [--trust-deploy] [--skip-gate] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>] [--with-rules] [--include-similarity] [--min-close-lead-seconds <n>]';
|
|
8976
|
+
const mirrorSyncUsage =
|
|
8977
|
+
'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>] [--usdc <address>] [--trust-deploy] [--manifest-file <path>] [--skip-gate] [--daemon] [--stream|--no-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>] [--depth-slippage-bps <n>] [--min-time-to-close-sec <n>] [--iterations <n>] [--state-file <path>] [--kill-switch-file <path>] [--chain-id <id>] [--rpc-url <url>] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>] [--webhook-url <url>] [--telegram-bot-token <token>] [--discord-webhook-url <url>]';
|
|
8972
8978
|
|
|
8973
8979
|
if (!action || action === '--help' || action === '-h') {
|
|
8974
8980
|
if (context.outputMode === 'json') {
|
|
@@ -8986,16 +8992,16 @@ async function runMirrorCommand(args, context) {
|
|
|
8986
8992
|
console.log('');
|
|
8987
8993
|
console.log('Subcommands:');
|
|
8988
8994
|
console.log(
|
|
8989
|
-
' browse --min-yes-pct <n> --max-yes-pct <n> --min-volume-24h <n> [--closes-after <date>] [--closes-before <date>] [--question-contains <text>] [--limit <n>]',
|
|
8995
|
+
' browse --min-yes-pct <n> --max-yes-pct <n> --min-volume-24h <n> [--closes-after <date>] [--closes-before <date>] [--question-contains <text>] [--limit <n>] [--chain-id <id>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>]',
|
|
8990
8996
|
);
|
|
8991
8997
|
console.log(
|
|
8992
|
-
' plan --source polymarket --polymarket-market-id <id>|--polymarket-slug <slug> [--target-slippage-bps <n>] [--turnover-target <n>] [--depth-slippage-bps <n>] [--safety-multiplier <n>] [--min-liquidity-usdc <n>] [--max-liquidity-usdc <n>] [--with-rules] [--include-similarity] [--polymarket-gamma-url <url>]',
|
|
8998
|
+
' plan --source polymarket --polymarket-market-id <id>|--polymarket-slug <slug> [--chain-id <id>] [--target-slippage-bps <n>] [--turnover-target <n>] [--depth-slippage-bps <n>] [--safety-multiplier <n>] [--min-liquidity-usdc <n>] [--max-liquidity-usdc <n>] [--with-rules] [--include-similarity] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>]',
|
|
8993
8999
|
);
|
|
8994
9000
|
console.log(
|
|
8995
|
-
' 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>]',
|
|
9001
|
+
' 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>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--oracle <address>] [--factory <address>] [--usdc <address>] [--distribution-yes <parts>] [--distribution-no <parts>] [--sources <url...>] [--manifest-file <path>] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>] [--min-close-lead-seconds <n>]',
|
|
8996
9002
|
);
|
|
8997
9003
|
console.log(
|
|
8998
|
-
' 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]',
|
|
9004
|
+
' 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] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>]',
|
|
8999
9005
|
);
|
|
9000
9006
|
console.log(
|
|
9001
9007
|
' lp-explain --liquidity-usdc <n> [--source-yes-pct <0-100>] [--distribution-yes <parts>] [--distribution-no <parts>]',
|
|
@@ -9007,11 +9013,12 @@ async function runMirrorCommand(args, context) {
|
|
|
9007
9013
|
' 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>]',
|
|
9008
9014
|
);
|
|
9009
9015
|
console.log(
|
|
9010
|
-
|
|
9016
|
+
` go ${mirrorGoUsage.replace('pandora [--output table|json] mirror go ', '')}`,
|
|
9011
9017
|
);
|
|
9012
9018
|
console.log(
|
|
9013
|
-
|
|
9019
|
+
` sync ${mirrorSyncUsage.replace('pandora [--output table|json] mirror sync ', '')}`,
|
|
9014
9020
|
);
|
|
9021
|
+
console.log(' stop|status selector: --pid-file <path>|--strategy-hash <hash>');
|
|
9015
9022
|
console.log(' status --state-file <path>|--strategy-hash <hash> [--with-live] [--trust-deploy]');
|
|
9016
9023
|
console.log(' close --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> --dry-run|--execute');
|
|
9017
9024
|
}
|
|
@@ -9453,12 +9460,10 @@ async function runMirrorCommand(args, context) {
|
|
|
9453
9460
|
|
|
9454
9461
|
if (action === 'go') {
|
|
9455
9462
|
if (includesHelpFlag(shared.rest)) {
|
|
9456
|
-
const usage =
|
|
9457
|
-
'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] [--skip-gate]';
|
|
9458
9463
|
if (context.outputMode === 'json') {
|
|
9459
|
-
emitSuccess(context.outputMode, 'mirror.go.help', commandHelpPayload(
|
|
9464
|
+
emitSuccess(context.outputMode, 'mirror.go.help', commandHelpPayload(mirrorGoUsage));
|
|
9460
9465
|
} else {
|
|
9461
|
-
console.log(`Usage: ${
|
|
9466
|
+
console.log(`Usage: ${mirrorGoUsage}`);
|
|
9462
9467
|
}
|
|
9463
9468
|
return;
|
|
9464
9469
|
}
|
|
@@ -9707,7 +9712,7 @@ async function runMirrorCommand(args, context) {
|
|
|
9707
9712
|
'mirror.sync.help',
|
|
9708
9713
|
{
|
|
9709
9714
|
usage:
|
|
9710
|
-
|
|
9715
|
+
mirrorSyncUsage,
|
|
9711
9716
|
daemonLifecycle: {
|
|
9712
9717
|
start:
|
|
9713
9718
|
'pandora [--output table|json] mirror sync start --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [run flags]',
|
|
@@ -9736,7 +9741,7 @@ async function runMirrorCommand(args, context) {
|
|
|
9736
9741
|
);
|
|
9737
9742
|
} else {
|
|
9738
9743
|
console.log(
|
|
9739
|
-
|
|
9744
|
+
`Usage: ${mirrorSyncUsage}`,
|
|
9740
9745
|
);
|
|
9741
9746
|
console.log('Daemon stop: pandora mirror sync stop --pid-file <path>|--strategy-hash <hash>');
|
|
9742
9747
|
console.log('Daemon status: pandora mirror sync status --pid-file <path>|--strategy-hash <hash>');
|
|
@@ -10698,4 +10703,36 @@ async function main() {
|
|
|
10698
10703
|
}
|
|
10699
10704
|
}
|
|
10700
10705
|
|
|
10706
|
+
function installGlobalCrashHandlers() {
|
|
10707
|
+
const outputMode = inferRequestedOutputMode(expandEqualsStyleFlags(process.argv.slice(2)));
|
|
10708
|
+
const normalizedOutputMode = outputMode === 'json' ? 'json' : 'table';
|
|
10709
|
+
|
|
10710
|
+
const emitFatal = (error, code) => {
|
|
10711
|
+
const fatalError =
|
|
10712
|
+
error instanceof Error
|
|
10713
|
+
? error
|
|
10714
|
+
: new CliError(code, formatErrorValue(error || code));
|
|
10715
|
+
|
|
10716
|
+
try {
|
|
10717
|
+
emitFailure(normalizedOutputMode, fatalError);
|
|
10718
|
+
} catch (handlerErr) {
|
|
10719
|
+
try {
|
|
10720
|
+
console.error(`[${code}] ${formatErrorValue(fatalError)}`);
|
|
10721
|
+
console.error(`Fatal handler failure: ${formatErrorValue(handlerErr)}`);
|
|
10722
|
+
} finally {
|
|
10723
|
+
process.exit(1);
|
|
10724
|
+
}
|
|
10725
|
+
}
|
|
10726
|
+
};
|
|
10727
|
+
|
|
10728
|
+
process.on('uncaughtException', (error) => {
|
|
10729
|
+
emitFatal(error, 'UNCAUGHT_EXCEPTION');
|
|
10730
|
+
});
|
|
10731
|
+
|
|
10732
|
+
process.on('unhandledRejection', (reason) => {
|
|
10733
|
+
emitFatal(reason, 'UNHANDLED_REJECTION');
|
|
10734
|
+
});
|
|
10735
|
+
}
|
|
10736
|
+
|
|
10737
|
+
installGlobalCrashHandlers();
|
|
10701
10738
|
main();
|