perp-cli 0.5.2 → 0.6.0
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 +29 -0
- package/dist/commands/account.js +60 -0
- package/dist/commands/agent.js +4 -2
- package/dist/commands/alerts.d.ts +2 -0
- package/dist/commands/alerts.js +487 -0
- package/dist/commands/arb/index.js +12 -4
- package/dist/commands/arb-auto.js +50 -19
- package/dist/commands/arb.js +43 -4
- package/dist/commands/history.js +329 -70
- package/dist/discord.d.ts +29 -0
- package/dist/discord.js +66 -0
- package/dist/exchanges/hyperliquid-spot.d.ts +1 -0
- package/dist/exchanges/hyperliquid-spot.js +25 -10
- package/dist/exchanges/hyperliquid.d.ts +2 -0
- package/dist/exchanges/hyperliquid.js +10 -2
- package/dist/exchanges/lighter-spot.d.ts +6 -0
- package/dist/exchanges/lighter-spot.js +80 -31
- package/dist/exchanges/lighter.d.ts +3 -0
- package/dist/exchanges/lighter.js +46 -25
- package/dist/exchanges/pacifica.js +26 -4
- package/dist/index.js +325 -43
- package/dist/mcp-server.js +444 -1
- package/dist/settings.d.ts +26 -0
- package/dist/settings.js +14 -2
- package/dist/telegram.d.ts +32 -0
- package/dist/telegram.js +74 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +32 -0
- package/package.json +1 -1
- package/skills/perp-cli/package.json +35 -0
package/dist/utils.js
CHANGED
|
@@ -96,6 +96,38 @@ function sanitizeValue(val) {
|
|
|
96
96
|
}
|
|
97
97
|
return val;
|
|
98
98
|
}
|
|
99
|
+
// ── Sparkline ──
|
|
100
|
+
// Density-based shading — renders consistently across all terminal fonts
|
|
101
|
+
// (height-based ▁▂▃▄▅▆▇█ looks identical in many monospace fonts)
|
|
102
|
+
const SPARK_CHARS = [" ", "░", "▒", "▓", "█"];
|
|
103
|
+
/** Render a sparkline from numeric values. Returns unicode bar chart string. */
|
|
104
|
+
export function sparkline(values, width) {
|
|
105
|
+
if (values.length === 0)
|
|
106
|
+
return "";
|
|
107
|
+
const data = width && values.length > width ? downsample(values, width) : values;
|
|
108
|
+
const min = Math.min(...data);
|
|
109
|
+
const max = Math.max(...data);
|
|
110
|
+
const range = max - min;
|
|
111
|
+
if (range === 0)
|
|
112
|
+
return SPARK_CHARS[2].repeat(data.length);
|
|
113
|
+
return data.map(v => {
|
|
114
|
+
const idx = Math.round(((v - min) / range) * (SPARK_CHARS.length - 1));
|
|
115
|
+
return SPARK_CHARS[idx];
|
|
116
|
+
}).join("");
|
|
117
|
+
}
|
|
118
|
+
function downsample(values, targetLen) {
|
|
119
|
+
const bucketSize = values.length / targetLen;
|
|
120
|
+
const result = [];
|
|
121
|
+
for (let i = 0; i < targetLen; i++) {
|
|
122
|
+
const start = Math.floor(i * bucketSize);
|
|
123
|
+
const end = Math.floor((i + 1) * bucketSize);
|
|
124
|
+
let sum = 0;
|
|
125
|
+
for (let j = start; j < end; j++)
|
|
126
|
+
sum += values[j];
|
|
127
|
+
result.push(sum / (end - start));
|
|
128
|
+
}
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
99
131
|
// ── JSON Output ──
|
|
100
132
|
const _isNdjson = () => process.argv.includes("--ndjson");
|
|
101
133
|
export function printJson(data) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hypurrquant/perp-cli-skill",
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "AI agent skill for perp-cli — multi-DEX perpetual futures trading via CLI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai-skill",
|
|
7
|
+
"claude",
|
|
8
|
+
"mcp",
|
|
9
|
+
"perp",
|
|
10
|
+
"perpetual-futures",
|
|
11
|
+
"trading",
|
|
12
|
+
"hyperliquid",
|
|
13
|
+
"pacifica",
|
|
14
|
+
"lighter",
|
|
15
|
+
"defi",
|
|
16
|
+
"arbitrage",
|
|
17
|
+
"funding-rate"
|
|
18
|
+
],
|
|
19
|
+
"author": "hypurrquant",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/hypurrquant/perp-cli",
|
|
24
|
+
"directory": "skills/perp-cli"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/hypurrquant/perp-cli#ai-agent-skill",
|
|
27
|
+
"files": [
|
|
28
|
+
"SKILL.md",
|
|
29
|
+
"references",
|
|
30
|
+
"scripts"
|
|
31
|
+
],
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"perp-cli": ">=0.5.0"
|
|
34
|
+
}
|
|
35
|
+
}
|