ideabrowser.com β find trending startup ideas with real demand
Try itnpx skills add https://github.com/starchild-ai-agent/official-skills --skill hyperliquidTrade perpetual futures and spot tokens on Hyperliquid, a fully on-chain decentralized exchange. Orders are signed using this agent's EVM wallet and submitted directly to the Hyperliquid L1.
Before trading, the wallet policy must be active. Load the wallet-policy skill and propose the standard wildcard policy (deny key export + allow *). This covers all Hyperliquid operations β USDC deposits, EIP-712 order signing, and withdrawals.
| Tool | What it does |
|---|---|
hl_total_balance | Check how much you can trade with (use this for balance checks!) |
hl_account | See your open positions and PnL |
hl_balances | See your token holdings (USDC, HYPE, etc.) |
hl_market | Get current prices for crypto or stocks |
hl_orderbook | Check order book depth and liquidity |
hl_fills | See recent trade fills and execution prices |
hl_candles | Get price charts (1m, 5m, 1h, 4h, 1d) |
hl_funding | Check funding rates for perps |
hl_open_orders | See pending orders |
| Tool | What it does |
|---|---|
hl_order | Buy or sell perps (crypto/stocks) |
hl_spot_order | Buy or sell spot tokens |
hl_tpsl_order | Place stop loss or take profit orders |
hl_leverage | Set leverage (1x to asset max) |
hl_cancel | Cancel a specific order |
hl_cancel_all | Cancel all open orders |
hl_modify | Change order price or size |
| Tool | What it does |
|---|---|
hl_deposit | Add USDC from Arbitrum (min $5) |
hl_withdraw | Send USDC to Arbitrum (1 USDC fee, ~5 min) |
hl_transfer_usd | Move USDC between spot/perp (rarely needed) |
Just tell the agent what you want to trade - it handles everything automatically.
Examples:
User: "Buy $20 of Bitcoin with 5x leverage"
Agent: [checks balance β sets leverage β places order β reports fill]
Result: "β Bought 0.0002 BTC at $95,432 with 5x leverage. Position opened."
User: "Long NVIDIA with $50, 10x"
Agent: [auto-detects NVIDIA = xyz:NVDA β executes β verifies]
Result: "β Bought 0.25 NVDA at $198.50 with 10x leverage. Filled at $198.62."
User: "Sell my ETH position"
Agent: [checks position size β closes β reports PnL]
Result: "β Sold 0.5 ETH at $3,421. Realized PnL: +$12.50"
You don't need to:
Just say what you want, the agent handles the rest.
π€ As the agent, you should ALWAYS do these automatically (never ask the user):
hl_total_balance before EVERY trade to see total available marginhl_leverage before placing orders (unless user specifies not to)hl_fills to check if it filledπ― User just says: "buy X" or "sell Y" or "long Z with $N"
π§ You figure out:
π Balance checking hierarchy:
hl_total_balance - shows ACTUAL available margin regardless of account modehl_account for balance - may show $0 even if funds availablehl_balances for margin - only shows spot tokensπ Be proactive, not reactive:
hl_account() # Default crypto perps account
hl_account(dex="xyz") # Builder dex (RWA/stock perps) account
Returns marginSummary (accountValue, totalMarginUsed, withdrawable) and assetPositions array with each position's coin, szi (signed size), entryPx, unrealizedPnl, leverage.
Important: Builder perps (xyz:NVDA, xyz:TSLA, etc.) have separate clearinghouses. Always check the correct dex when trading RWA/stock perps.
hl_balances()
Returns balances array with coin, hold, total for USDC and all spot tokens.
hl_market() # All mid prices
hl_market(coin="BTC") # BTC price + metadata (maxLeverage, szDecimals)
hl_order(coin="BTC", side="buy", size=0.01, price=95000)
Places a GTC limit buy for 0.01 BTC at $95,000.
hl_order(coin="ETH", side="sell", size=0.1)
Omitting price submits an IoC order at mid price +/- 3% slippage.
hl_order(coin="BTC", side="buy", size=0.01, price=94000, order_type="alo")
ALO (Add Liquidity Only) = post-only. Rejected if it would immediately fill.
hl_tpsl_order(coin="BTC", side="sell", size=0.01, trigger_px=90000, tpsl="sl")
Automatically sells 0.01 BTC if the price drops to $90,000. Executes as market order when triggered.
For a limit order when triggered (instead of market):
hl_tpsl_order(coin="BTC", side="sell", size=0.01, trigger_px=90000, tpsl="sl", is_market=false, limit_px=89900)
hl_tpsl_order(coin="ETH", side="sell", size=0.5, trigger_px=3500, tpsl="tp")
Automatically sells 0.5 ETH if the price rises to $3,500. Executes as market order when triggered.
hl_order(coin="BTC", side="sell", size=0.01, reduce_only=true)
Use reduce_only=true to ensure it only closes, never opens a new position.
hl_spot_order(coin="HYPE", side="buy", size=10, price=25.0)
Spot orders use the same interface β just specify the token name.
hl_cancel(coin="BTC", order_id=12345678)
Get order_id from hl_open_orders.
hl_cancel_all() # Cancel everything
hl_cancel_all(coin="BTC") # Cancel only BTC orders
hl_modify(order_id=12345678, coin="BTC", side="buy", size=0.02, price=94500)
hl_leverage(coin="BTC", leverage=10) # 10x cross margin
hl_leverage(coin="ETH", leverage=5, cross=false) # 5x isolated margin
hl_transfer_usd(amount=1000, to_perp=true) # Spot β Perp
hl_transfer_usd(amount=500, to_perp=false) # Perp β Spot
Note: Usually not needed - funds are automatically shared. Only use if you get an error saying you need to transfer.
hl_withdraw(amount=100) # Withdraw to own wallet
hl_withdraw(amount=50, destination="0xABC...") # Withdraw to specific address
Fee: 1 USDC deducted by Hyperliquid. Processing takes ~5 minutes.
hl_deposit(amount=500)
Sends USDC from the agent's Arbitrum wallet to the Hyperliquid bridge contract. Minimum deposit: 5 USDC. Requires USDC balance on Arbitrum.
hl_candles(coin="BTC", interval="1h", lookback=48)
Intervals: 1m, 5m, 15m, 1h, 4h, 1d. Lookback in hours.
hl_funding() # All predicted fundings
hl_funding(coin="BTC") # BTC predicted + 24h history
hl_fills(limit=10)
When a user asks to trade a ticker, you need to determine whether it's a native crypto perp (use plain name) or an RWA/stock perp (use xyz:TICKER prefix).
"BTC", "ETH", "SOL", "DOGE", "HYPE", etc.xyz: prefix: "xyz:NVDA", "xyz:TSLA", "xyz:GOLD", etc.hl_market(coin="X") β if it returns a price, it's a crypto perphl_market(dex="xyz") to list all RWA markets and search the resultsxyz: prefix)| Category | Examples |
|---|---|
| US Stocks | xyz:NVDA, xyz:TSLA, xyz:AAPL, xyz:MSFT, xyz:AMZN, xyz:GOOG, xyz:META, xyz:TSM |
| Commodities | xyz:GOLD, xyz:SILVER |
| Indices | xyz:SPY |
| Forex | xyz:EUR, xyz:GBP, xyz:JPY |
If a user says "buy NVDA" or "trade GOLD", use
xyz:NVDA/xyz:GOLD. These are real-world assets, not crypto.
All existing tools work with xyz:TICKER β just pass the prefixed coin name:
hl_market(coin="xyz:NVDA") # Check NVIDIA stock perp price
hl_market(dex="xyz") # List ALL available RWA/stock perps
hl_orderbook(coin="xyz:NVDA") # Check liquidity
hl_leverage(coin="xyz:NVDA", leverage=3) # Set leverage (auto-isolated)
hl_order(coin="xyz:NVDA", side="buy", size=0.5, price=188) # Limit buy 0.5 NVDA
hl_order(coin="xyz:TSM", side="buy", size=1) # Market buy 1 TSM
hl_cancel(coin="xyz:NVDA", order_id=12345678) # Cancel order
xyz:NVDAhl_market(coin="xyz:NVDA") β Check current price, leverage limitshl_leverage(coin="xyz:NVDA", leverage=3) β Set leverage (builder perps use isolated margin)hl_order(coin="xyz:NVDA", side="buy", size=0.5, price=188) β Place limit buyhl_fills() β Check if filledhl_leverage handles this automaticallydex prefix (e.g. xyz) identifies which builder deployed the perpUser: "Buy BTC" or "Long ETH with 5x"
Agent workflow:
hl_total_balance() β Check available fundshl_leverage(coin="BTC", leverage=5) β Set leveragehl_order(...) β Place orderhl_fills() β Verify fill and report resultUser: "Buy NVIDIA" or "Short TESLA"
Agent workflow:
hl_total_balance() β Check available fundshl_leverage(coin="xyz:NVDA", leverage=10) β Set leveragehl_order(coin="xyz:NVDA", ...) β Place orderhl_fills() β Verify fill and report resultUser: "Close my BTC position"
Agent workflow:
hl_account() β Get current position sizehl_order(coin="BTC", side="sell", size=X, reduce_only=true) β Close positionhl_fills() β Report PnLUser: "Buy 100 HYPE tokens"
Agent workflow:
hl_total_balance() β Check available USDChl_spot_order(coin="HYPE", side="buy", size=100) β Buy tokenshl_balances() β Verify purchaseDeposit:
User: "Deposit $500 USDC to Hyperliquid"
Agent: hl_deposit(amount=500) β Done
Withdraw:
User: "Withdraw $100 to my Arbitrum wallet"
Agent: hl_withdraw(amount=100) β Done (5 min, 1 USDC fee)
| Type | Parameter | Behavior |
|---|---|---|
| Limit (GTC) | order_type="limit" | Rests on book until filled or cancelled |
| Market (IoC) | omit price | Immediate-or-Cancel at mid +/- 3% slippage |
| Post-Only (ALO) | order_type="alo" | Rejected if it would cross the spread |
| Fill-or-Kill | order_type="ioc" + explicit price | Fill immediately at price or cancel |
| Stop Loss | hl_tpsl_order with tpsl="sl" | Triggers when price drops to limit losses |
| Take Profit | hl_tpsl_order with tpsl="tp" | Triggers when price rises to lock gains |
Stop loss and take profit orders are trigger orders that automatically execute when the market reaches a specified price level. Use these to manage risk and lock in profits without monitoring positions 24/7.
trigger_px, order activatesUse case: Limit losses on a position by automatically exiting if price moves against you.
Example: You're long BTC at $95,000 and want to exit if it drops below $90,000.
hl_tpsl_order(coin="BTC", side="sell", size=0.1, trigger_px=90000, tpsl="sl")
Use case: Lock in gains by automatically exiting when price reaches your profit target.
Example: You're long ETH at $3,000 and want to take profit at $3,500.
hl_tpsl_order(coin="ETH", side="sell", size=1.0, trigger_px=3500, tpsl="tp")
By default, TP/SL orders execute as market orders when triggered (instant fill, possible slippage).
For more control, use a limit order when triggered:
hl_tpsl_order(
coin="BTC",
side="sell",
size=0.1,
trigger_px=90000,
tpsl="sl",
is_market=false,
limit_px=89900
)
Trade-off: Limit orders avoid slippage but may not fill in fast-moving markets.
For short positions, reverse the side parameter:
Stop loss on short (exit if price rises):
hl_tpsl_order(coin="BTC", side="buy", size=0.1, trigger_px=98000, tpsl="sl")
Take profit on short (exit if price drops):
hl_tpsl_order(coin="BTC", side="buy", size=0.1, trigger_px=92000, tpsl="tp")
reduce_only=true (default) - ensures TP/SL only closes positions, never opens new oneshl_open_orders to verify TP/SL orders are active| Mistake | Problem | Solution |
|---|---|---|
| Wrong side | SL buys instead of sells | Long position β side="sell" for SL/TP |
| Size too large | TP/SL opens new position | Set size β€ position size, use reduce_only=true |
| Trigger = limit | Confusion about prices | trigger_px = when to activate, limit_px = execution price |
| No SL on leverage | Liquidation risk | Always set stop loss on leveraged positions |
| Aspect | Perps | Spot |
|---|---|---|
| Tool | hl_order | hl_spot_order |
| Leverage | Yes (up to asset max) | No |
| Funding | Paid/received every hour | None |
| Short selling | Yes (native) | Must own tokens to sell |
| Check positions | hl_account | hl_balances |
| Error | Fix |
|---|---|
| "Unknown perp asset" | Check coin name. Crypto: "BTC", "ETH". Stocks: "xyz:NVDA", "xyz:TSLA" |
| "Insufficient margin" | Use hl_total_balance to check funds. Reduce size or add more USDC |
| "Order must have minimum value of $10" | Increase size. Formula: size Γ price β₯ $10 |
| "Size too small" | BTC min is typically 0.001. Check asset's szDecimals |
| "Order would cross" | ALO order rejected. Use regular limit order instead |
| "User or wallet does not exist" | Deposit USDC first with hl_deposit(amount=500) |
| "Minimum deposit is 5 USDC" | Hyperliquid requires at least $5 per deposit |
| "Policy violation" | Load wallet-policy skill and propose wildcard policy |
| "Action disabled when unified account is active" | Transfers blocked in unified mode (default). Just place orders directly |