openbroker 1.0.63 → 1.0.65
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/SKILL.md +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/core/client.ts +13 -0
package/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Hyperliquid trading plugin with background position monitoring and
|
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Requires Node.js 22+, network access to api.hyperliquid.xyz
|
|
6
6
|
homepage: https://www.npmjs.com/package/openbroker
|
|
7
|
-
metadata: {"author": "monemetrics", "version": "1.0.
|
|
7
|
+
metadata: {"author": "monemetrics", "version": "1.0.65", "openclaw": {"requires": {"bins": ["openbroker"], "env": ["HYPERLIQUID_PRIVATE_KEY"]}, "primaryEnv": "HYPERLIQUID_PRIVATE_KEY", "install": [{"id": "node", "kind": "node", "package": "openbroker", "bins": ["openbroker"], "label": "Install openbroker (npm)"}]}}
|
|
8
8
|
allowed-tools: ob_account ob_positions ob_funding ob_markets ob_search ob_spot ob_fills ob_orders ob_order_status ob_fees ob_candles ob_funding_history ob_trades ob_rate_limit ob_funding_scan ob_buy ob_sell ob_limit ob_trigger ob_tpsl ob_cancel ob_twap ob_bracket ob_chase ob_watcher_status ob_auto_run ob_auto_stop ob_auto_list Bash(openbroker:*)
|
|
9
9
|
---
|
|
10
10
|
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/scripts/core/client.ts
CHANGED
|
@@ -1566,6 +1566,19 @@ export class HyperliquidClient {
|
|
|
1566
1566
|
this.requireTrading();
|
|
1567
1567
|
await this.getMetaAndAssetCtxs();
|
|
1568
1568
|
|
|
1569
|
+
// HIP-3 perps only support isolated margin — override isCross and clamp leverage
|
|
1570
|
+
if (this.isHip3(coin)) {
|
|
1571
|
+
if (isCross) {
|
|
1572
|
+
this.log(`HIP-3 asset ${coin} does not support cross margin — forcing isolated`);
|
|
1573
|
+
}
|
|
1574
|
+
isCross = false;
|
|
1575
|
+
const maxLev = this.hip3MaxLeverageMap.get(coin) ?? 10;
|
|
1576
|
+
if (leverage > maxLev) {
|
|
1577
|
+
this.log(`HIP-3 asset ${coin} max leverage is ${maxLev}x — clamping from ${leverage}x`);
|
|
1578
|
+
leverage = maxLev;
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1569
1582
|
const assetIndex = this.getAssetIndex(coin);
|
|
1570
1583
|
|
|
1571
1584
|
this.log(`Updating leverage: ${coin} (asset ${assetIndex}) to ${leverage}x ${isCross ? 'cross' : 'isolated'}`);
|