Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Trade perpetual futures and spot tokens on Hyperliquid DEX with 18 tools for orders, positions, funding, and USDC transfers.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
__init__.py
1"""2Hyperliquid Extension — Perpetual & Spot Trading on Hyperliquid DEX34Provides 19 tools for trading on Hyperliquid:5- 8 info tools: account state, balances, orders, market data, orderbook, fills, candles, funding6- 11 exchange tools: order, spot order, TP/SL order, cancel, cancel all, modify, leverage, USDC transfer, withdraw, deposit, set abstraction78Environment Variables:9- WALLET_SERVICE_URL: Privy wallet service URL (required for signing)1011Usage:12This extension is auto-loaded by the ExtensionLoader.13"""1415import logging16from typing import List1718logger = logging.getLogger(__name__)192021def register(api) -> List[str]:22"""23Extension entry point — register all Hyperliquid tools.2425Args:26api: ExtensionApi instance with registry and config2728Returns:29List of registered tool names30"""31registered = []3233try:34from .tools import (35# Info tools (8)36HLAccountTool,37HLBalancesTool,38HLOpenOrdersTool,39HLMarketTool,40HLOrderbookTool,41HLFillsTool,42HLCandlesTool,43HLFundingTool,44# Exchange tools (11)45HLOrderTool,46HLSpotOrderTool,47HLTPSLOrderTool,48HLCancelTool,49HLCancelAllTool,50HLModifyTool,51HLLeverageTool,52HLTransferUsdTool,53HLWithdrawTool,54HLDepositTool,55HLSetAbstractionTool,56)5758# Info tools59api.register_tool(HLAccountTool())60api.register_tool(HLBalancesTool())61api.register_tool(HLOpenOrdersTool())62api.register_tool(HLMarketTool())63api.register_tool(HLOrderbookTool())64api.register_tool(HLFillsTool())65api.register_tool(HLCandlesTool())66api.register_tool(HLFundingTool())6768# Exchange tools69api.register_tool(HLOrderTool())70api.register_tool(HLSpotOrderTool())71api.register_tool(HLTPSLOrderTool())72api.register_tool(HLCancelTool())73api.register_tool(HLCancelAllTool())74api.register_tool(HLModifyTool())75api.register_tool(HLLeverageTool())76api.register_tool(HLTransferUsdTool())77api.register_tool(HLWithdrawTool())78api.register_tool(HLDepositTool())79api.register_tool(HLSetAbstractionTool())8081registered = [82# Info (8)83"hl_account",84"hl_balances",85"hl_open_orders",86"hl_market",87"hl_orderbook",88"hl_fills",89"hl_candles",90"hl_funding",91# Exchange (11)92"hl_order",93"hl_spot_order",94"hl_tpsl_order",95"hl_cancel",96"hl_cancel_all",97"hl_modify",98"hl_leverage",99"hl_transfer_usd",100"hl_withdraw",101"hl_deposit",102"hl_set_abstraction",103]104105logger.info(f"Registered Hyperliquid tools ({len(registered)} tools)")106except Exception as e:107logger.warning(f"Failed to load Hyperliquid tools: {e}")108109return registered110111112# Extension metadata113EXTENSION_INFO = {114"name": "hyperliquid",115"version": "1.0.0",116"description": "Hyperliquid DEX trading — perpetual futures and spot",117"tools": [118"hl_account",119"hl_balances",120"hl_open_orders",121"hl_market",122"hl_orderbook",123"hl_fills",124"hl_candles",125"hl_funding",126"hl_order",127"hl_spot_order",128"hl_tpsl_order",129"hl_cancel",130"hl_cancel_all",131"hl_modify",132"hl_leverage",133"hl_transfer_usd",134"hl_withdraw",135"hl_deposit",136"hl_set_abstraction",137],138"env_vars": [139"WALLET_SERVICE_URL",140],141}142