Skip to content

Commit a04e5a2

Browse files
juntaoclaude
andcommitted
fix: move perp quote under hyperliquid perp quote subcommand
The perp quote command now correctly lives under the `perp` subcommand (e.g. `hyperliquid perp quote TSLA`) instead of being a top-level command. Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2c2b0aa commit a04e5a2

4 files changed

Lines changed: 20 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ jobs:
6868
6969
- name: Perp quote - crypto
7070
run: |
71-
./target/release/hyperliquid quote BTC
72-
./target/release/hyperliquid quote ETH
71+
./target/release/hyperliquid perp quote BTC
72+
./target/release/hyperliquid perp quote ETH
7373
7474
- name: Perp quote - commodity
7575
run: |
76-
./target/release/hyperliquid quote GOLD
77-
./target/release/hyperliquid quote SILVER
76+
./target/release/hyperliquid perp quote GOLD
77+
./target/release/hyperliquid perp quote SILVER
7878
7979
- name: Perp quote - stock
8080
run: |
81-
./target/release/hyperliquid quote TSLA
82-
./target/release/hyperliquid quote NVDA
81+
./target/release/hyperliquid perp quote TSLA
82+
./target/release/hyperliquid perp quote NVDA
8383
8484
- name: News - crypto
8585
run: ./target/release/fintool news BTC

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ fintool quote GOLD # commodity alias
149149
Get a perpetual futures quote with funding rate, open interest, and leverage info:
150150

151151
```bash
152-
hyperliquid quote ETH
153-
hyperliquid quote SILVER # HIP-3 commodity perp
152+
hyperliquid perp quote ETH
153+
hyperliquid perp quote SILVER # HIP-3 commodity perp
154154
```
155155

156156
View the L2 orderbook (bids/asks, spread, depth):
@@ -197,7 +197,7 @@ binance buy BTC --amount 0.002 --price 65000
197197
Get the perp quote, set leverage, and open a long position:
198198

199199
```bash
200-
hyperliquid quote ETH
200+
hyperliquid perp quote ETH
201201
hyperliquid perp leverage ETH --leverage 2
202202
hyperliquid perp buy ETH --amount 0.006 --price 2100.00
203203
```
@@ -229,7 +229,7 @@ hyperliquid transfer USDT0 --amount 30 --from spot --to cash
229229
**Trade the commodity perp:**
230230

231231
```bash
232-
hyperliquid quote SILVER
232+
hyperliquid perp quote SILVER
233233
hyperliquid perp leverage SILVER --leverage 2
234234
hyperliquid perp buy SILVER --amount 0.13 --price 89.00
235235
```
@@ -347,7 +347,7 @@ coinbase_api_secret = "..."
347347
| `fintool news`, `fintool init` | No | No | No | No |
348348
| `fintool report` | No | No | No | No |
349349
| `hyperliquid` (all commands) | Yes ||||
350-
| `hyperliquid quote` | No ||||
350+
| `hyperliquid perp quote` | No ||||
351351
| `binance` (all commands) || Yes |||
352352
| `coinbase` (all commands) ||| Yes ||
353353
| `polymarket list`, `polymarket quote` | No ||||
@@ -438,7 +438,7 @@ Spot and perpetual futures trading, HIP-3 dex (commodities, stocks), deposits, w
438438
| Command | Description |
439439
|---------|-------------|
440440
| `hyperliquid address` | Print wallet address |
441-
| `hyperliquid quote <SYMBOL>` | Perp price + funding/OI/premium |
441+
| `hyperliquid perp quote <SYMBOL>` | Perp price + funding/OI/premium |
442442
| `hyperliquid buy <SYMBOL> --amount N --price P` | Spot limit buy |
443443
| `hyperliquid sell <SYMBOL> --amount N --price P` | Spot limit sell |
444444
| `hyperliquid perp buy <SYM> --amount N --price P [--close]` | Perp long / close short |
@@ -461,7 +461,7 @@ Spot and perpetual futures trading, HIP-3 dex (commodities, stocks), deposits, w
461461

462462
**HIP-3 Perps (commodities, stocks):** The `cash` dex on Hyperliquid supports commodity and stock perps using USDT0 collateral. Symbols like `SILVER`, `GOLD`, `TSLA` are auto-detected and routed to the correct dex.
463463

464-
**Perp Quote:** `hyperliquid quote` returns perpetual futures data including funding rate, open interest, premium, and max leverage.
464+
**Perp Quote:** `hyperliquid perp quote` returns perpetual futures data including funding rate, open interest, premium, and max leverage.
465465

466466
**Transfer:** Move funds between `spot`, `perp`, `cash` (HIP-3), and other dex accounts. One side must always be `spot`.
467467

@@ -544,7 +544,7 @@ These commands work the same across exchange CLIs. The only difference is which
544544
| CLI | What it returns |
545545
|-----|----------------|
546546
| `fintool quote` | Multi-source spot price + LLM analysis |
547-
| `hyperliquid quote` | Perp price + funding/OI/premium |
547+
| `hyperliquid perp quote` | Perp price + funding/OI/premium |
548548

549549
### `buy / sell` (spot)
550550

skills/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Returns: bids, asks, spread, spreadPct, midPrice. Use to assess liquidity before
222222

223223
**Step 1 — Get perp quote with funding/OI:**
224224
```bash
225-
{baseDir}/scripts/hyperliquid --json '{"command":"quote","symbol":"ETH"}'
225+
{baseDir}/scripts/hyperliquid --json '{"command":"perp_quote","symbol":"ETH"}'
226226
```
227227

228228
**Step 1b — Check perp orderbook depth and spread:**

src/bin/hyperliquid.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ enum Commands {
2727
/// Print the configured wallet address
2828
Address,
2929

30-
/// Get perpetual futures price quote
31-
#[command(name = "quote")]
32-
PerpQuote { symbol: String },
33-
3430
/// Place a spot limit buy order
3531
Buy {
3632
symbol: String,
@@ -135,6 +131,8 @@ enum Commands {
135131

136132
#[derive(Subcommand)]
137133
enum PerpCmd {
134+
/// Get perpetual futures price quote
135+
Quote { symbol: String },
138136
/// Show L2 orderbook / market depth for a perpetual
139137
Orderbook {
140138
symbol: String,
@@ -215,9 +213,6 @@ fn default_levels() -> usize {
215213
#[serde(tag = "command", rename_all = "snake_case")]
216214
enum JsonCommand {
217215
Address,
218-
Quote {
219-
symbol: String,
220-
},
221216
Buy {
222217
symbol: String,
223218
amount: f64,
@@ -320,7 +315,6 @@ async fn run_json(json_str: &str) -> Result<()> {
320315
println!("{}", serde_json::json!({"address": address}));
321316
Ok(())
322317
}
323-
JsonCommand::Quote { symbol } => commands::quote::run_perp(&symbol, true).await,
324318
JsonCommand::Buy {
325319
symbol,
326320
amount,
@@ -499,7 +493,6 @@ async fn main() -> Result<()> {
499493
println!("{}", address);
500494
Ok(())
501495
}
502-
Commands::PerpQuote { symbol } => commands::quote::run_perp(&symbol, json_output).await,
503496
Commands::Buy {
504497
symbol,
505498
amount,
@@ -522,6 +515,9 @@ async fn main() -> Result<()> {
522515
Commands::Balance => commands::balance::run(EXCHANGE, json_output).await,
523516
Commands::Positions => commands::positions::run(EXCHANGE, json_output).await,
524517
Commands::Perp(cmd) => match cmd {
518+
PerpCmd::Quote { symbol } => {
519+
commands::quote::run_perp(&symbol, json_output).await
520+
}
525521
PerpCmd::Orderbook { symbol, levels } => {
526522
commands::orderbook::run_perp(&symbol, levels, EXCHANGE, json_output).await
527523
}

0 commit comments

Comments
 (0)