openbroker 1.8.1 → 1.9.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to Open Broker will be documented in this file.
4
4
 
5
+ ## [1.9.1] - 2026-06-22
6
+
7
+ ### Changed
8
+ - Made restricted API-wallet onboarding the recommended interactive default.
9
+ - Added `openbroker setup --api-wallet` for deterministic agent setup without the wallet-selection prompt.
10
+ - Updated the Codex skill to install the CLI, hand the browser approval URL to the user, wait for authorization, and verify the connected master account without exposing private keys.
11
+
5
12
  ## [1.5.0] - 2026-06-01
6
13
 
7
14
  ### Added
package/README.md CHANGED
@@ -11,10 +11,10 @@ npm install -g openbroker
11
11
  ## Quick Start
12
12
 
13
13
  ```bash
14
- # 1. Setup (generates wallet, creates config, approves builder fee)
15
- openbroker setup
14
+ # 1. Setup a restricted API wallet (recommended for agents)
15
+ openbroker setup --api-wallet
16
16
 
17
- # 2. Fund your wallet with USDC on Arbitrum, then deposit at https://app.hyperliquid.xyz/
17
+ # 2. Open the printed approval link and connect your funded master Hyperliquid wallet
18
18
 
19
19
  # 3. Start trading
20
20
  openbroker account # View account info
@@ -27,18 +27,19 @@ openbroker search --query GOLD # Find markets
27
27
  ### Setup
28
28
 
29
29
  ```bash
30
- openbroker setup # One-command setup (wallet + config + builder approval)
30
+ openbroker setup --api-wallet # Recommended: restricted agent wallet + browser approval
31
+ openbroker setup # Interactive; API wallet is the default
31
32
  ```
32
33
 
33
34
  The setup command handles everything automatically:
34
- - Generates a fresh trading wallet (recommended for agents) or accepts your existing private key
35
+ - Generates a restricted API wallet by default, or accepts another wallet mode interactively
35
36
  - Saves configuration to `~/.openbroker/.env` (permissions `0600`)
36
- - Approves the builder fee (required for trading)
37
+ - Prints a browser approval link and waits for master-wallet authorization
37
38
 
38
39
  Setup offers three modes:
39
- 1. **Generate fresh wallet** (recommended for agents) — cleanest option, no browser steps
40
+ 1. **Generate fresh wallet** separately funded wallet, no browser steps
40
41
  2. **Import existing key** — use a key you already have
41
- 3. **Generate API wallet** — restricted wallet requiring browser approval from a master wallet
42
+ 3. **Generate API wallet** (default and recommended for agents) can trade but cannot withdraw; requires browser approval from a master wallet
42
43
 
43
44
  ---
44
45
 
@@ -717,25 +718,24 @@ export HYPERLIQUID_NETWORK=mainnet # Optional: mainnet (default) or testne
717
718
  export HYPERLIQUID_ACCOUNT_ADDRESS=0x... # Optional: for API wallets
718
719
  ```
719
720
 
720
- ### Fresh Wallet Setup (Recommended for Agents)
721
+ ### API Wallet Setup (Recommended for Agents)
721
722
 
722
- The simplest setup for agents generates a dedicated wallet, auto-approves the builder fee, and is ready to trade after funding:
723
+ The safest default for agents delegates trading from an API wallet that cannot withdraw. The CLI prints an approval URL, waits for the funded master wallet to authorize it, and then saves the master account mapping automatically:
723
724
 
724
725
  ```bash
725
- openbroker setup # Choose option 1, fund with USDC, start trading
726
+ openbroker setup --api-wallet
726
727
  ```
727
728
 
728
- ### API Wallet Setup (Alternative)
729
+ Open the printed `https://openbroker.dev/approve?agent=...` link, connect the intended master Hyperliquid wallet, and approve `ApproveAgent` plus the 1 bps `ApproveBuilderFee` transaction. If approval times out, rerun the same command; OpenBroker resumes the incomplete setup without generating a new key.
730
+
731
+ ### Fresh Wallet Setup (Alternative)
729
732
 
730
- For delegated trading without moving funds, use an API wallet:
733
+ Run interactive setup and explicitly choose option 1 to create a separately funded wallet:
731
734
 
732
735
  ```bash
733
- export HYPERLIQUID_PRIVATE_KEY="0x..." # API wallet private key
734
- export HYPERLIQUID_ACCOUNT_ADDRESS="0x..." # Main account address
736
+ openbroker setup
735
737
  ```
736
738
 
737
- **Note:** API wallets require browser approval from the master wallet. The master wallet signs `ApproveAgent` and `ApproveBuilderFee` transactions via the approval URL provided during setup.
738
-
739
739
  ## Builder Fee
740
740
 
741
741
  Open Broker charges **1 bps (0.01%)** per trade to fund development. The builder fee is automatically approved during `openbroker setup`.
package/SKILL.md CHANGED
@@ -1,38 +1,66 @@
1
1
  ---
2
2
  name: openbroker
3
- description: Hyperliquid trading CLI skill for agents. Use when an agent needs to inspect markets/accounts, place or manage perp/spot/HIP-4 orders, or write and run Hyperliquid trading automations directly through the `openbroker` CLI without requiring the OpenClaw plugin.
4
- license: MIT
5
- compatibility: Requires Node.js 22+, network access to api.hyperliquid.xyz
6
- homepage: https://www.npmjs.com/package/openbroker
7
- metadata: {"author": "monemetrics", "version": "1.3.2"}
8
- allowed-tools: Bash(openbroker:*)
3
+ description: Install, onboard, and operate the OpenBroker Hyperliquid CLI for market and account inspection, restricted API-wallet setup, perp/HIP-3/spot/HIP-4 trading, order management, and TypeScript automations. Use when Codex needs to set up OpenBroker, run or explain `openbroker` commands, inspect Hyperliquid state, safely preview or execute trades, or create and debug OpenBroker automations.
9
4
  ---
10
5
 
11
6
  # OpenBroker — Hyperliquid CLI skill
12
7
 
13
- OpenBroker is first a CLI. The OpenClaw plugin is optional: use `ob_*` tools when present for common structured calls, but keep the CLI model in mind because it is the complete surface area and the safest fallback.
8
+ Use the `openbroker` CLI as the canonical interface. Prefer structured JSON output for inspection and dry runs before live writes.
14
9
 
15
10
  ## Operating rules
16
11
 
17
12
  - For unfamiliar assets, **search before trading**. Hyperliquid has main perps, HIP-3 perps, spot markets, and HIP-4 outcomes that can share names.
18
13
  - Prefer `--json` for machine-readable info commands.
19
- - Before any write, verify the asset, account, open positions/orders, size, and whether the action should be reduce-only.
20
- - For new or changed trading logic, start with `--dry`, inspect the plan/audit trail, then go live only when that matches the user’s intent.
14
+ - Before any write, verify the network, trading account, asset, side, size, open positions/orders, and whether the action should be reduce-only.
15
+ - Use `--dry` for proposed trades and new or changed trading logic. Execute live only when the user explicitly requests live execution and the dry-run plan matches that intent.
16
+ - Never infer a live trade size, switch to mainnet, or create/import/export a wallet without explicit user direction.
17
+ - Never print, echo, log, or expose private keys or seed material. Refer only to the configured signing wallet address when diagnosing identity.
21
18
  - Treat CLI output as exchange state, not just prose: parse order IDs, balances, fills, and errors instead of assuming success.
22
19
 
23
- ## Setup and identity
20
+ ## First-run installation and API-wallet onboarding
21
+
22
+ Use the following flow when the user asks to install, set up, or use OpenBroker. Do not ask the user for a private key.
23
+
24
+ First check whether Node.js 22+ and the CLI are installed:
25
+
26
+ ```bash
27
+ node --version
28
+ command -v openbroker
29
+ openbroker --version
30
+ ```
31
+
32
+ Require OpenBroker 1.9.1 or newer. When the user explicitly asks to set up OpenBroker, install or upgrade the CLI as part of that request, using the normal approval flow for global or network writes:
33
+
34
+ ```bash
35
+ npm install -g openbroker@latest
36
+ ```
37
+
38
+ Public market-data commands such as `search`, `markets`, `funding`, `candles`, and `trades` work without wallet setup. For account-specific reads or trading, prefer a restricted API wallet because it can trade on the user's master Hyperliquid account but cannot withdraw funds.
39
+
40
+ Run setup in an interactive terminal session and select the API-wallet flow directly:
24
41
 
25
42
  ```bash
26
- npm install -g openbroker
27
- openbroker setup
28
- openbroker account --json
43
+ openbroker setup --api-wallet
29
44
  ```
30
45
 
31
- `setup` supports:
46
+ The command generates and stores the API wallet key locally in `~/.openbroker/.env` with mode `0600`, prints an approval URL, and waits up to ten minutes for browser approval. Handle that handoff as follows:
32
47
 
33
- 1. **Fresh wallet** simplest for agents; builder fee approval is handled automatically.
48
+ 1. Keep the setup process running. Polling output is expected; do not treat it as a stuck command.
49
+ 2. Capture the `https://openbroker.dev/approve?agent=...` URL from terminal output and immediately show it to the user as a clickable link.
50
+ 3. Ask the user to open the link, connect the funded master Hyperliquid wallet they want OpenBroker to trade on, review the addresses and network, and sign the requested approvals. On mainnet this authorizes the API agent and the 1 bps builder fee; it does not grant withdrawal access.
51
+ 4. Never ask the user to paste a master-wallet or API-wallet private key into Codex. Never display the key or read the config file into the conversation.
52
+ 5. Leave the terminal session running while the user completes approval. The CLI detects approval automatically and saves `HYPERLIQUID_ACCOUNT_ADDRESS` as the master account.
53
+ 6. After setup completes, verify the connection with `openbroker account --json` and report the master account address, API signing-wallet address, account mode, and equity without exposing secrets.
54
+
55
+ If approval times out, preserve the incomplete config and approval URL. Ask the user to finish approval, then rerun `openbroker setup --api-wallet`; the CLI reuses the existing API key and resumes polling instead of generating another wallet.
56
+
57
+ If a complete config already exists, do not delete or replace it without explicit user approval. Inspect account identity with `openbroker account --json` first.
58
+
59
+ The interactive `openbroker setup` command still supports three modes, with API wallet as the default when the user presses Enter:
60
+
61
+ 1. **Fresh wallet** — creates a separately funded wallet; builder fee approval is handled automatically.
34
62
  2. **Imported key** — use an existing wallet.
35
- 3. **API wallet** — can trade but not withdraw; the human owner must approve it in a browser.
63
+ 3. **API wallet (default)** — can trade but not withdraw; the human owner approves it in a browser.
36
64
 
37
65
  For API wallets, `HYPERLIQUID_PRIVATE_KEY` is the signing key and `HYPERLIQUID_ACCOUNT_ADDRESS` must be the funded master account. If account output shows `$0` equity unexpectedly, check that mapping first.
38
66
 
@@ -190,7 +218,6 @@ Bundled examples are **references, not production strategies**. Read them for AP
190
218
  - `api.on(...)`, `api.every(...)`, `api.onStart(...)`, `api.onStop(...)`, `api.onError(...)`.
191
219
  - `api.state` — persisted state; survives restarts.
192
220
  - `api.audit.record(...)` / `api.audit.metric(...)` — durable observability.
193
- - `api.publish(...)` — notify an OpenClaw agent when hooks are configured.
194
221
  - `api.dryRun` — whether writes are intercepted.
195
222
 
196
223
  Core events include `tick`, `price_change`, `funding_update`, `position_opened`, `position_closed`, `position_changed`, `pnl_threshold`, `margin_warning`, `order_filled`, `order_update`, and `liquidation`.
@@ -223,7 +250,7 @@ These matter more than boilerplate:
223
250
  7. **Separate strategy logic from execution policy.** Maker-first execution can reduce fees, but it needs bounded retries, post-only rejection handling, order cancellation, partial-fill accounting, minimum trade thresholds, and a defined IOC fallback. Measure progress from refreshed balances/positions, not only from submit responses.
224
251
  8. **Size from real NAV and hard caps.** Multi-leg strategies often need spot balances, spot USDC, and perp account value combined; a 50/50 carry target derived from total NAV must then be halved per side and still respect a hard per-side cap.
225
252
  9. **Define stop behavior intentionally.** On shutdown, always handle working orders, but do not blindly flatten every strategy. A hedged carry may need “preserve hedge and alert,” while a transient execution bot may need “cancel and flatten.”
226
- 10. **Instrument first-class decisions.** Log and audit funding source, targets, leg notionals, settlement distance, hold/close decisions, fills, retries, and error paths. If using the plugin, publish events that need human attention.
253
+ 10. **Instrument first-class decisions.** Log and audit funding source, targets, leg notionals, settlement distance, hold/close decisions, fills, retries, and error paths. Surface events that need human attention through the configured monitoring path.
227
254
 
228
255
  Additional practical caveats:
229
256
 
@@ -234,34 +261,10 @@ Additional practical caveats:
234
261
  - Naked directional positions usually need explicit TP/SL or equivalent risk logic. Hedged multi-leg strategies need strategy-specific exits instead of cargo-cult TP/SL rules.
235
262
  - For new automations, do a dry run, inspect `auto report`, and only then run live unless the user explicitly requested immediate live execution.
236
263
 
237
- ## Plugin-aware use
238
-
239
- When the OpenClaw plugin is available:
240
-
241
- - Prefer `ob_*` tools for common structured reads and simple writes.
242
- - Use `ob_watcher_status` for background monitoring state.
243
- - Use `ob_auto_run`, `ob_auto_stop`, and `ob_auto_list` for supported automation actions.
244
- - Fall back to the CLI for unsupported commands, debugging, richer flags, or if a tool returns empty/unexpected data.
245
-
246
- Representative mappings:
247
-
248
- | Plugin tool | CLI equivalent |
249
- |---|---|
250
- | `ob_account` | `openbroker account --json` |
251
- | `ob_positions` | `openbroker positions --json` |
252
- | `ob_funding` | `openbroker funding --json --include-hip3` |
253
- | `ob_search` | `openbroker search --query <QUERY> --json` |
254
- | `ob_buy` / `ob_sell` | `openbroker buy|sell --coin <COIN> --size <SIZE>` |
255
- | `ob_limit` | `openbroker limit ...` |
256
- | `ob_tpsl` | `openbroker tpsl ...` |
257
- | `ob_auto_run` | `openbroker auto run <script> ...` |
258
-
259
- Skill-only mode is fully usable through the CLI; the plugin adds agent tools, watcher notifications, and OpenClaw webhook integration.
260
-
261
264
  ## Failure checks
262
265
 
263
266
  - `No market data found` → search again; likely wrong venue prefix.
264
267
  - `$0` equity on an API wallet → likely missing `HYPERLIQUID_ACCOUNT_ADDRESS`.
265
268
  - Unexpected funding behavior → check whether you are reading predicted vs cached instantaneous data.
266
269
  - Strategy churn → inspect confirmation loops, fee-aware hold logic, settlement guards, and min-trade thresholds before changing position size.
267
- - Tool failure in plugin mode → rerun the equivalent CLI command with `--json` and `--verbose` if needed.
270
+ - Unexpected or empty CLI output → rerun the command with `--json` and `--verbose`, then inspect the returned error before retrying a write.
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "OpenBroker"
3
+ short_description: "Trade and automate Hyperliquid from Codex"
4
+ default_prompt: "Use $openbroker to install OpenBroker and guide me through restricted API-wallet setup."
5
+
6
+ policy:
7
+ allow_implicit_invocation: false
package/bin/cli.ts CHANGED
@@ -136,7 +136,7 @@ Utility:
136
136
  approve-builder Check or retry builder fee approval
137
137
 
138
138
  Examples:
139
- openbroker setup # First-time setup (does everything)
139
+ openbroker setup --api-wallet # Recommended restricted API-wallet setup
140
140
  openbroker account # View account info
141
141
  openbroker buy --coin ETH --size 0.1 # Market buy 0.1 ETH
142
142
  openbroker limit --coin BTC --side buy --size 0.01 --price 60000
@@ -579,6 +579,23 @@ export declare class HyperliquidClient {
579
579
  tif: 'Gtc' | 'Ioc' | 'Alo';
580
580
  };
581
581
  }, reduceOnly?: boolean, includeBuilder?: boolean, leverage?: number): Promise<OrderResponse>;
582
+ /**
583
+ * Place MANY orders in a SINGLE exchange request. Hyperliquid counts a bulk order/cancel as one
584
+ * request (weight 1 per ≤40 orders) against the address action-rate limit, so a market maker that
585
+ * would otherwise burn one request per quote (and exhaust `10,000 + cumulative_volume` requests)
586
+ * collapses N quotes into 1. Per distinct coin we run the same leverage / isolated-margin prep as
587
+ * `order()` (idempotent + cached) before sending. Returns the raw ack; `response.data.statuses[i]`
588
+ * aligns with `orders[i]`.
589
+ */
590
+ bulkOrder(orders: Array<{
591
+ coin: string;
592
+ isBuy: boolean;
593
+ size: number;
594
+ price: number;
595
+ tif?: 'Gtc' | 'Ioc' | 'Alo';
596
+ reduceOnly?: boolean;
597
+ leverage?: number;
598
+ }>, includeBuilder?: boolean): Promise<OrderResponse>;
582
599
  marketOrder(coin: string, isBuy: boolean, size: number, slippageBps?: number, leverage?: number): Promise<OrderResponse>;
583
600
  limitOrder(coin: string, isBuy: boolean, size: number, price: number, tif?: 'Gtc' | 'Ioc' | 'Alo', reduceOnly?: boolean, leverage?: number): Promise<OrderResponse>;
584
601
  /**
@@ -601,6 +618,14 @@ export declare class HyperliquidClient {
601
618
  */
602
619
  takeProfit(coin: string, isBuy: boolean, size: number, triggerPrice: number): Promise<OrderResponse>;
603
620
  cancel(coin: string, oid: number): Promise<CancelResponse>;
621
+ /**
622
+ * Cancel MANY resting orders in a SINGLE exchange request (one action-rate request for ≤40 cancels),
623
+ * the counterpart to `bulkOrder`. `response.data.statuses[i]` aligns with `cancels[i]`.
624
+ */
625
+ bulkCancel(cancels: Array<{
626
+ coin: string;
627
+ oid: number;
628
+ }>): Promise<CancelResponse>;
604
629
  /**
605
630
  * Arm or clear Hyperliquid's dead-man's switch (`scheduleCancel`). Pass a future
606
631
  * epoch-ms `timeMs` (the API requires ≥5s out) to schedule a cancel-ALL that fires
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../scripts/core/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAGhB,kBAAkB,EAElB,SAAS,EACT,mBAAmB,EACnB,aAAa,EAEd,MAAM,YAAY,CAAC;AAIpB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,QAAQ,CAAiB;IAEjC,OAAO,CAAC,IAAI,CAAiC;IAC7C,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,aAAa,CAAkC;IACvD,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AM;;;;;;;;;IAoB7C;;OAEG;IACG,WAAW;;;;;;;;;;;;;;;;;;;;;;CAKlB;AAKD,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,CAKtE;AAGD,wBAAgB,WAAW,IAAI,IAAI,CAElC"}
@@ -1663,6 +1663,55 @@ export class HyperliquidClient {
1663
1663
  };
1664
1664
  }
1665
1665
  }
1666
+ /**
1667
+ * Place MANY orders in a SINGLE exchange request. Hyperliquid counts a bulk order/cancel as one
1668
+ * request (weight 1 per ≤40 orders) against the address action-rate limit, so a market maker that
1669
+ * would otherwise burn one request per quote (and exhaust `10,000 + cumulative_volume` requests)
1670
+ * collapses N quotes into 1. Per distinct coin we run the same leverage / isolated-margin prep as
1671
+ * `order()` (idempotent + cached) before sending. Returns the raw ack; `response.data.statuses[i]`
1672
+ * aligns with `orders[i]`.
1673
+ */
1674
+ async bulkOrder(orders, includeBuilder = true) {
1675
+ await this.requireTrading();
1676
+ await this.getMetaAndAssetCtxs();
1677
+ if (orders.length === 0)
1678
+ return { status: 'ok', response: { type: 'order', data: { statuses: [] } } };
1679
+ // Per DISTINCT coin: set leverage (main perp, cross) + isolated/HIP-3 prep, exactly as order().
1680
+ const prepped = new Set();
1681
+ for (const o of orders) {
1682
+ if (prepped.has(o.coin))
1683
+ continue;
1684
+ prepped.add(o.coin);
1685
+ if (o.leverage && !this.isHip3(o.coin) && this.leverageSet.get(o.coin) !== o.leverage) {
1686
+ await this.updateLeverage(o.coin, o.leverage, true);
1687
+ }
1688
+ await this.ensureHip3Ready(o.coin, o.size * o.price, o.leverage);
1689
+ }
1690
+ const orderWires = orders.map((o) => {
1691
+ const szDecimals = this.getSzDecimals(o.coin);
1692
+ return {
1693
+ a: this.getAssetIndex(o.coin),
1694
+ b: o.isBuy,
1695
+ p: roundPrice(o.price, szDecimals),
1696
+ s: roundSize(o.size, szDecimals),
1697
+ r: o.reduceOnly ?? false,
1698
+ t: { limit: { tif: o.tif ?? 'Gtc' } },
1699
+ };
1700
+ });
1701
+ const orderRequest = { orders: orderWires, grouping: 'na' };
1702
+ if (includeBuilder && !this.isTestnet && this.config.builderAddress !== '0x0000000000000000000000000000000000000000') {
1703
+ orderRequest.builder = this.builderInfo;
1704
+ }
1705
+ try {
1706
+ const response = await this.exchange.order(orderRequest, this.vaultParam);
1707
+ this.log('Bulk order response:', JSON.stringify(response, null, 2));
1708
+ return response;
1709
+ }
1710
+ catch (error) {
1711
+ this.log('Bulk order error:', error);
1712
+ return { status: 'err', response: error instanceof Error ? error.message : String(error) };
1713
+ }
1714
+ }
1666
1715
  async marketOrder(coin, isBuy, size, slippageBps, leverage) {
1667
1716
  await this.getMetaAndAssetCtxs();
1668
1717
  // Get current mid price
@@ -1784,6 +1833,27 @@ export class HyperliquidClient {
1784
1833
  };
1785
1834
  }
1786
1835
  }
1836
+ /**
1837
+ * Cancel MANY resting orders in a SINGLE exchange request (one action-rate request for ≤40 cancels),
1838
+ * the counterpart to `bulkOrder`. `response.data.statuses[i]` aligns with `cancels[i]`.
1839
+ */
1840
+ async bulkCancel(cancels) {
1841
+ await this.requireTrading();
1842
+ await this.getMetaAndAssetCtxs();
1843
+ if (cancels.length === 0)
1844
+ return { status: 'ok', response: { type: 'cancel', data: { statuses: [] } } };
1845
+ try {
1846
+ const response = await this.exchange.cancel({
1847
+ cancels: cancels.map((c) => ({ a: this.getAssetIndex(c.coin), o: c.oid })),
1848
+ }, this.vaultParam);
1849
+ this.log('Bulk cancel response:', JSON.stringify(response, null, 2));
1850
+ return response;
1851
+ }
1852
+ catch (error) {
1853
+ this.log('Bulk cancel error:', error);
1854
+ return { status: 'err', response: { type: 'cancel', data: { statuses: [error instanceof Error ? error.message : String(error)] } } };
1855
+ }
1856
+ }
1787
1857
  /**
1788
1858
  * Arm or clear Hyperliquid's dead-man's switch (`scheduleCancel`). Pass a future
1789
1859
  * epoch-ms `timeMs` (the API requires ≥5s out) to schedule a cancel-ALL that fires
@@ -1 +1 @@
1
- {"version":3,"file":"onboard.d.ts","sourceRoot":"","sources":["../../scripts/setup/onboard.ts"],"names":[],"mappings":";AA4BA,UAAU,aAAa;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwND,iBAAe,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,CAsR5C;AAGD,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"onboard.d.ts","sourceRoot":"","sources":["../../scripts/setup/onboard.ts"],"names":[],"mappings":";AA6BA,UAAU,aAAa;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwND,iBAAe,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,CA8R5C;AAGD,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,CAAC"}
@@ -14,6 +14,7 @@ const GLOBAL_CONFIG_PATH = path.join(GLOBAL_CONFIG_DIR, '.env');
14
14
  // Parse CLI flags
15
15
  const cliArgs = process.argv.slice(2);
16
16
  const useTestnet = cliArgs.includes('--testnet') || ENV_TESTNET;
17
+ const useApiWallet = cliArgs.includes('--api-wallet');
17
18
  const accountAddressIdx = cliArgs.indexOf('--account-address');
18
19
  const cliAccountAddress = accountAddressIdx !== -1 ? cliArgs[accountAddressIdx + 1] : undefined;
19
20
  const configPathIdx = cliArgs.indexOf('-c') !== -1 ? cliArgs.indexOf('-c') : cliArgs.indexOf('--config');
@@ -213,11 +214,13 @@ Usage: openbroker setup [options]
213
214
  Options:
214
215
  -c, --config <path> Save config to a custom path (default: ~/.openbroker/.env)
215
216
  --testnet Configure for testnet
217
+ --api-wallet Generate a restricted API wallet and skip the wallet menu
216
218
  --account-address <addr> Set HYPERLIQUID_ACCOUNT_ADDRESS (for API wallet / vault trading)
217
219
  --help Show this help
218
220
 
219
221
  Examples:
220
- openbroker setup # Interactive ~/.openbroker/.env
222
+ openbroker setup # Interactive; API wallet is the default
223
+ openbroker setup --api-wallet # Recommended agent setup
221
224
  openbroker setup -c .env --testnet # Write to ./.env for testnet
222
225
  openbroker setup -c ./testnet.env --testnet --account-address 0x... # API wallet config
223
226
  `);
@@ -300,21 +303,26 @@ Examples:
300
303
  walletAddress: account.address,
301
304
  };
302
305
  }
306
+ // Agent-friendly non-interactive selection. Browser approval is still
307
+ // deliberately completed by the human who controls the master wallet.
308
+ if (useApiWallet) {
309
+ return setupApiWallet();
310
+ }
303
311
  // Ask user which setup mode
304
312
  const rl = createReadline();
305
313
  console.log('Step 1/3: Wallet Setup');
306
314
  console.log('----------------------');
307
315
  console.log('How would you like to set up your wallet?\n');
308
- console.log(' 1) Generate a fresh wallet (recommended for agents)');
309
- console.log(' Creates a dedicated trading wallet. Builder fee is auto-approved.');
310
- console.log(' Just fund it with USDC and start trading — no browser steps needed.');
316
+ console.log(' 1) Generate a fresh wallet');
317
+ console.log(' Creates a dedicated funded wallet. Builder fee is auto-approved.');
311
318
  console.log('');
312
319
  console.log(' 2) Import existing private key');
313
- console.log(' 3) Generate API wallet (restricted, requires browser approval)');
320
+ console.log(' 3) Generate API wallet (recommended for agents)');
314
321
  console.log(' Can trade but cannot withdraw. Requires master wallet approval in browser.\n');
315
322
  let choice = '';
316
323
  while (choice !== '1' && choice !== '2' && choice !== '3') {
317
- choice = await prompt(rl, 'Enter choice (1, 2, or 3): ');
324
+ const input = await prompt(rl, 'Enter choice (1, 2, or 3) [3]: ');
325
+ choice = input || '3';
318
326
  if (choice !== '1' && choice !== '2' && choice !== '3') {
319
327
  console.log('Please enter 1, 2, or 3');
320
328
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openbroker",
3
- "version": "1.8.1",
3
+ "version": "1.9.1",
4
4
  "description": "Hyperliquid trading CLI - execute orders, manage positions, and run trading strategies",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,6 +20,7 @@
20
20
  "dist/",
21
21
  "scripts/",
22
22
  "config/example.env",
23
+ "agents/",
23
24
  "SKILL.md",
24
25
  "README.md",
25
26
  "CHANGELOG.md"
@@ -2305,6 +2305,60 @@ export class HyperliquidClient {
2305
2305
  }
2306
2306
  }
2307
2307
 
2308
+ /**
2309
+ * Place MANY orders in a SINGLE exchange request. Hyperliquid counts a bulk order/cancel as one
2310
+ * request (weight 1 per ≤40 orders) against the address action-rate limit, so a market maker that
2311
+ * would otherwise burn one request per quote (and exhaust `10,000 + cumulative_volume` requests)
2312
+ * collapses N quotes into 1. Per distinct coin we run the same leverage / isolated-margin prep as
2313
+ * `order()` (idempotent + cached) before sending. Returns the raw ack; `response.data.statuses[i]`
2314
+ * aligns with `orders[i]`.
2315
+ */
2316
+ async bulkOrder(
2317
+ orders: Array<{ coin: string; isBuy: boolean; size: number; price: number; tif?: 'Gtc' | 'Ioc' | 'Alo'; reduceOnly?: boolean; leverage?: number }>,
2318
+ includeBuilder: boolean = true
2319
+ ): Promise<OrderResponse> {
2320
+ await this.requireTrading();
2321
+ await this.getMetaAndAssetCtxs();
2322
+ if (orders.length === 0) return { status: 'ok', response: { type: 'order', data: { statuses: [] } } } as unknown as OrderResponse;
2323
+
2324
+ // Per DISTINCT coin: set leverage (main perp, cross) + isolated/HIP-3 prep, exactly as order().
2325
+ const prepped = new Set<string>();
2326
+ for (const o of orders) {
2327
+ if (prepped.has(o.coin)) continue;
2328
+ prepped.add(o.coin);
2329
+ if (o.leverage && !this.isHip3(o.coin) && this.leverageSet.get(o.coin) !== o.leverage) {
2330
+ await this.updateLeverage(o.coin, o.leverage, true);
2331
+ }
2332
+ await this.ensureHip3Ready(o.coin, o.size * o.price, o.leverage);
2333
+ }
2334
+
2335
+ const orderWires = orders.map((o) => {
2336
+ const szDecimals = this.getSzDecimals(o.coin);
2337
+ return {
2338
+ a: this.getAssetIndex(o.coin),
2339
+ b: o.isBuy,
2340
+ p: roundPrice(o.price, szDecimals),
2341
+ s: roundSize(o.size, szDecimals),
2342
+ r: o.reduceOnly ?? false,
2343
+ t: { limit: { tif: o.tif ?? 'Gtc' } },
2344
+ };
2345
+ });
2346
+
2347
+ const orderRequest: { orders: typeof orderWires; grouping: 'na'; builder?: BuilderInfo } = { orders: orderWires, grouping: 'na' };
2348
+ if (includeBuilder && !this.isTestnet && this.config.builderAddress !== '0x0000000000000000000000000000000000000000') {
2349
+ orderRequest.builder = this.builderInfo;
2350
+ }
2351
+
2352
+ try {
2353
+ const response = await this.exchange.order(orderRequest, this.vaultParam);
2354
+ this.log('Bulk order response:', JSON.stringify(response, null, 2));
2355
+ return response as unknown as OrderResponse;
2356
+ } catch (error) {
2357
+ this.log('Bulk order error:', error);
2358
+ return { status: 'err', response: error instanceof Error ? error.message : String(error) };
2359
+ }
2360
+ }
2361
+
2308
2362
  async marketOrder(
2309
2363
  coin: string,
2310
2364
  isBuy: boolean,
@@ -2501,6 +2555,26 @@ export class HyperliquidClient {
2501
2555
  }
2502
2556
  }
2503
2557
 
2558
+ /**
2559
+ * Cancel MANY resting orders in a SINGLE exchange request (one action-rate request for ≤40 cancels),
2560
+ * the counterpart to `bulkOrder`. `response.data.statuses[i]` aligns with `cancels[i]`.
2561
+ */
2562
+ async bulkCancel(cancels: Array<{ coin: string; oid: number }>): Promise<CancelResponse> {
2563
+ await this.requireTrading();
2564
+ await this.getMetaAndAssetCtxs();
2565
+ if (cancels.length === 0) return { status: 'ok', response: { type: 'cancel', data: { statuses: [] } } } as unknown as CancelResponse;
2566
+ try {
2567
+ const response = await this.exchange.cancel({
2568
+ cancels: cancels.map((c) => ({ a: this.getAssetIndex(c.coin), o: c.oid })),
2569
+ }, this.vaultParam);
2570
+ this.log('Bulk cancel response:', JSON.stringify(response, null, 2));
2571
+ return response as unknown as CancelResponse;
2572
+ } catch (error) {
2573
+ this.log('Bulk cancel error:', error);
2574
+ return { status: 'err', response: { type: 'cancel', data: { statuses: [error instanceof Error ? error.message : String(error)] } } };
2575
+ }
2576
+ }
2577
+
2504
2578
  /**
2505
2579
  * Arm or clear Hyperliquid's dead-man's switch (`scheduleCancel`). Pass a future
2506
2580
  * epoch-ms `timeMs` (the API requires ≥5s out) to schedule a cancel-ALL that fires
@@ -18,6 +18,7 @@ const GLOBAL_CONFIG_PATH = path.join(GLOBAL_CONFIG_DIR, '.env');
18
18
  // Parse CLI flags
19
19
  const cliArgs = process.argv.slice(2);
20
20
  const useTestnet = cliArgs.includes('--testnet') || ENV_TESTNET;
21
+ const useApiWallet = cliArgs.includes('--api-wallet');
21
22
  const accountAddressIdx = cliArgs.indexOf('--account-address');
22
23
  const cliAccountAddress = accountAddressIdx !== -1 ? cliArgs[accountAddressIdx + 1] : undefined;
23
24
  const configPathIdx = cliArgs.indexOf('-c') !== -1 ? cliArgs.indexOf('-c') : cliArgs.indexOf('--config');
@@ -257,11 +258,13 @@ Usage: openbroker setup [options]
257
258
  Options:
258
259
  -c, --config <path> Save config to a custom path (default: ~/.openbroker/.env)
259
260
  --testnet Configure for testnet
261
+ --api-wallet Generate a restricted API wallet and skip the wallet menu
260
262
  --account-address <addr> Set HYPERLIQUID_ACCOUNT_ADDRESS (for API wallet / vault trading)
261
263
  --help Show this help
262
264
 
263
265
  Examples:
264
- openbroker setup # Interactive ~/.openbroker/.env
266
+ openbroker setup # Interactive; API wallet is the default
267
+ openbroker setup --api-wallet # Recommended agent setup
265
268
  openbroker setup -c .env --testnet # Write to ./.env for testnet
266
269
  openbroker setup -c ./testnet.env --testnet --account-address 0x... # API wallet config
267
270
  `);
@@ -358,23 +361,29 @@ Examples:
358
361
  };
359
362
  }
360
363
 
364
+ // Agent-friendly non-interactive selection. Browser approval is still
365
+ // deliberately completed by the human who controls the master wallet.
366
+ if (useApiWallet) {
367
+ return setupApiWallet();
368
+ }
369
+
361
370
  // Ask user which setup mode
362
371
  const rl = createReadline();
363
372
 
364
373
  console.log('Step 1/3: Wallet Setup');
365
374
  console.log('----------------------');
366
375
  console.log('How would you like to set up your wallet?\n');
367
- console.log(' 1) Generate a fresh wallet (recommended for agents)');
368
- console.log(' Creates a dedicated trading wallet. Builder fee is auto-approved.');
369
- console.log(' Just fund it with USDC and start trading — no browser steps needed.');
376
+ console.log(' 1) Generate a fresh wallet');
377
+ console.log(' Creates a dedicated funded wallet. Builder fee is auto-approved.');
370
378
  console.log('');
371
379
  console.log(' 2) Import existing private key');
372
- console.log(' 3) Generate API wallet (restricted, requires browser approval)');
380
+ console.log(' 3) Generate API wallet (recommended for agents)');
373
381
  console.log(' Can trade but cannot withdraw. Requires master wallet approval in browser.\n');
374
382
 
375
383
  let choice = '';
376
384
  while (choice !== '1' && choice !== '2' && choice !== '3') {
377
- choice = await prompt(rl, 'Enter choice (1, 2, or 3): ');
385
+ const input = await prompt(rl, 'Enter choice (1, 2, or 3) [3]: ');
386
+ choice = input || '3';
378
387
  if (choice !== '1' && choice !== '2' && choice !== '3') {
379
388
  console.log('Please enter 1, 2, or 3');
380
389
  }