Vincent - Hyperliquid
by @glitch003
Use this skill to create a HyperLiquid perpetuals and spot wallet for your agent. Trade perps, manage spot balances, transfer USDC between sub-accounts, get...
1. Check for Existing Keys
Before creating a new wallet, check if one already exists:
npx @vincentai/cli@latest secret list --type HYPERLIQUID_WALLET
If a key is returned, use its id as --key-id for all subsequent commands. If not, create one.
2. Create a HyperLiquid Wallet
npx @vincentai/cli@latest secret create --type HYPERLIQUID_WALLET --memo "My HL perp wallet"
Returns:
keyId β use for all future commandswalletAddress β the EOA address (this IS the HyperLiquid account)claimUrl β share with the user to take ownershipAfter creating, tell the user:
> "Here is your wallet claim URL: . Use this to claim ownership, set spending policies, and monitor your agent's wallet activity at https://heyvincent.ai."
Important: The wallet is empty at creation. The user must deposit USDC before trading.
3. Get Balance
npx @vincentai/cli@latest hyperliquid balance --key-id
Returns:
walletAddress β the EOA addressaccountValue β total perps account value in USD (cross-margin)withdrawable β USDC available to withdraw from the perps accountpositions β array of open perpetual positionsspotBalances β array of spot token balances (each with coin, token, hold, total)4. Transfer Between Perps and Spot
HyperLiquid has separate perps and spot sub-accounts. USDC must be in the correct sub-account before trading. Use internal-transfer to move USDC between them.
# Move 100 USDC from spot β perps (needed before perp trading)
npx @vincentai/cli@latest hyperliquid internal-transfer --key-id --amount 100 --to-perp trueMove 50 USDC from perps β spot (needed before spot trading)
npx @vincentai/cli@latest hyperliquid internal-transfer --key-id --amount 50 --to-perp false
Parameters:
--amount: USDC amount to transfer (string, numeric)--to-perp: true = spotβperps, false = perpsβspotResponse codes:
200 β status: "executed" β transfer completed202 β status: "pending_approval" (human approval required by policy)403 β status: "denied" (rejected by policy)5. Withdraw USDC to External Address
Send USDC from this HyperLiquid wallet to another HyperLiquid address via usdSend. This is an on-chain HLβHL transfer (instant, no gas).
# Withdraw 100 USDC to another HL address
npx @vincentai/cli@latest hyperliquid withdraw --key-id \
--destination 0x1234567890abcdef1234567890abcdef12345678 --amount 100
Parameters:
--destination: Target 0x address (must be a valid 40-hex-char Ethereum address)--amount: USDC amount to send (string, numeric)Response codes:
200 β status: "executed" β withdrawal completed202 β status: "pending_approval" (human approval required by policy)403 β status: "denied" (rejected by policy)6. Fund the Wallet
Deposit USDC to the EOA address via:
https://app.hyperliquid.xyz/portfolio and bridge USDC to the EOA addressusdSend) from another HL account β instantMinimum for a BTC perp trade: $2 USDC (covers $10 notional at 20x default leverage + taker fees).
7. Browse Markets
npx @vincentai/cli@latest hyperliquid markets --key-id
Returns a JSON object mapping coin names to mid prices (e.g. {"BTC": "105234.5", "ETH": "3412.0", ...}).
8. Get Order Book
npx @vincentai/cli@latest hyperliquid orderbook --key-id --coin BTC
Returns levels β a two-element array [bids, asks]. Each entry is [price, size, numOrders]. Use levels[1][0][0] for best ask, levels[0][0][0] for best bid.
9. Place a Trade
# Market buy (IoC β fills immediately or cancels)
npx @vincentai/cli@latest hyperliquid trade --key-id \
--coin BTC --is-buy true --sz 0.0001 \
--limit-px 106000 --order-type marketMarket sell to close (reduceOnly)
npx @vincentai/cli@latest hyperliquid trade --key-id \
--coin BTC --is-buy false --sz 0.0001 \
--limit-px 104000 --order-type market --reduce-onlyGTC limit buy
npx @vincentai/cli@latest hyperliquid trade --key-id \
--coin BTC --is-buy true --sz 0.0001 \
--limit-px 100000 --order-type limit
Parameters:
--coin: Asset name (e.g. BTC, ETH, SOL)--is-buy: true for long, false for short/close--sz: Size in base currency (e.g. 0.0001 BTC)--limit-px: Price. For market orders, set slightly above ask (buy) or below bid (sell) to ensure fill. Recommended: askPx * 1.005 for buys, bidPx * 0.995 for sells.--order-type: market (IoC) or limit (GTC)--reduce-only: Pass when closing a position to prevent accidentally opening a new one in the opposite directionMinimum notional: $10 (e.g. 0.0001 BTC at $100k/BTC). Default leverage is 20x cross-margin.
Response codes:
200 β status: "executed" with orderId (numeric) and fillDetails202 β status: "pending_approval" (human approval required by policy)403 β status: "denied" (rejected by policy)10. View Open Orders
# All open orders
npx @vincentai/cli@latest hyperliquid open-orders --key-id Filter by coin
npx @vincentai/cli@latest hyperliquid open-orders --key-id --coin BTC
11. View Trade History
# All fills
npx @vincentai/cli@latest hyperliquid trades --key-id Filter by coin
npx @vincentai/cli@latest hyperliquid trades --key-id --coin ETH
12. Cancel Orders
# Cancel a specific order (requires coin and numeric order ID)
npx @vincentai/cli@latest hyperliquid cancel-order --key-id --coin BTC --oid Cancel all open orders
npx @vincentai/cli@latest hyperliquid cancel-all --key-id Cancel all orders for a specific coin
npx @vincentai/cli@latest hyperliquid cancel-all --key-id --coin ETH
clawhub install vincent-hyperliquid