{"id":28693434,"url":"https://github.com/ccxt/hyperliquid-python","last_synced_at":"2025-06-14T08:31:58.653Z","repository":{"id":277586967,"uuid":"932885259","full_name":"ccxt/hyperliquid-python","owner":"ccxt","description":"Python SDK (sync and async) for Hyperliquid with Rest and WS capabilities","archived":false,"fork":false,"pushed_at":"2025-03-12T12:29:10.000Z","size":608,"stargazers_count":20,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T01:54:09.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccxt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-14T17:44:55.000Z","updated_at":"2025-06-07T20:01:41.000Z","dependencies_parsed_at":"2025-03-25T10:14:33.089Z","dependency_job_id":"94684d27-f168-4b56-b078-b1720411536b","html_url":"https://github.com/ccxt/hyperliquid-python","commit_stats":null,"previous_names":["ccxt/hyperliquid-python","ccxt/python-hyperliquid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ccxt/hyperliquid-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fhyperliquid-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fhyperliquid-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fhyperliquid-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fhyperliquid-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccxt","download_url":"https://codeload.github.com/ccxt/hyperliquid-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fhyperliquid-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259786151,"owners_count":22910889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-14T08:30:28.851Z","updated_at":"2025-06-14T08:31:58.643Z","avatar_url":"https://github.com/ccxt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hyperliquid\nPython SDK (sync and async) for Hyperliquid with Rest and WS capabilities.\n\nYou can check Hyperliquid's docs here: [Docs](https://hyperliquid.gitbook.io/hyperliquid-docs)\n\n\nYou can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/hyperliquid)\n\n\n## Installation\n\n```\npip install hyperliquid\n```\n\n## Usage\n\n### Async\n\n```Python\nfrom hyperliquid import HyperliquidAsync\n\nasync def main():\n    instance = HyperliquidAsync({})\n    order = await instance.create_limit_order(\"BTC/USDC:USDC\", \"limit\", \"buy\", 1, 100000)\n```\n\n### Sync\n\n```Python\nfrom hyperliquid import HyperliquidSync\n\ndef main():\n    instance = HyperliquidSync({})\n    order =  instance.create_limit_order(\"BTC/USDC:USDC\", \"limit\", \"buy\", 1, 100000)\n```\n\n#### Raw call\n\nYou can also construct your requests from scrach.\n\n```Python\n        request = {\n            'type': 'candleSnapshot',\n            'req': {\n                'coin': coin,\n                'interval': tf,\n                'startTime': since,\n                'endTime': until,\n            },\n        }\n        response = await instance.public_post_info(request)\n```\n\n\n### Websockets\n\n```Python\nfrom hyperliquid import HyperliquidWs\n\nasync def main():\n    instance = HyperliquidWs({})\n    while True:\n        orders = await instance.watch_orders(symbol)\n```\n\n## Available methods\n\n### REST Unified\n\n- `create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})`\n- `create_orders_request(self, orders, params={})`\n- `create_orders(self, orders: List[OrderRequest], params={})`\n- `fetch_balance(self, params={})`\n- `fetch_canceled_and_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_currencies(self, params={})`\n- `fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_funding_rates(self, symbols: Strings = None, params={})`\n- `fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_markets(self, params={})`\n- `fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={})`\n- `fetch_open_interest(self, symbol: str, params={})`\n- `fetch_open_interests(self, symbols: Strings = None, params={})`\n- `fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_order_book(self, symbol: str, limit: Int = None, params={})`\n- `fetch_order(self, id: str, symbol: Str = None, params={})`\n- `fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `fetch_position(self, symbol: str, params={})`\n- `fetch_positions(self, symbols: Strings = None, params={})`\n- `fetch_spot_markets(self, params={})`\n- `fetch_swap_markets(self, params={})`\n- `fetch_tickers(self, symbols: Strings = None, params={})`\n- `fetch_trades(self, symbol: Str, since: Int = None, limit: Int = None, params={})`\n- `fetch_trading_fee(self, symbol: str, params={})`\n- `fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={})`\n- `action_hash(self, action, vaultAddress, nonce)`\n- `add_margin(self, symbol: str, amount: float, params={})`\n- `amount_to_precision(self, symbol, amount)`\n- `build_usd_class_send_sig(self, message)`\n- `build_usd_send_sig(self, message)`\n- `build_withdraw_sig(self, message)`\n- `calculate_price_precision(self, price: float, amountPrecision: float, maxDecimals: float)`\n- `calculate_rate_limiter_cost(self, api, method, path, params, config={})`\n- `cancel_all_orders_after(self, timeout: Int, params={})`\n- `cancel_order(self, id: str, symbol: Str = None, params={})`\n- `cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={})`\n- `cancel_orders(self, ids: List[str], symbol: Str = None, params={})`\n- `coin_to_market_id(self, coin: Str)`\n- `construct_phantom_agent(self, hash, isTestnet=True)`\n- `describe(self)`\n- `edit_order(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={})`\n- `edit_orders_request(self, orders, params={})`\n- `edit_orders(self, orders: List[OrderRequest], params={})`\n- `extract_type_from_delta(self, data=[])`\n- `format_vault_address(self, address: Str = None)`\n- `hash_message(self, message)`\n- `modify_margin_helper(self, symbol: str, amount, type, params={})`\n- `price_to_precision(self, symbol: str, price)`\n- `reduce_margin(self, symbol: str, amount: float, params={})`\n- `set_leverage(self, leverage: Int, symbol: Str = None, params={})`\n- `set_margin_mode(self, marginMode: str, symbol: Str = None, params={})`\n- `set_sandbox_mode(self, enabled)`\n- `transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={})`\n- `withdraw(self, code: str, amount: float, address: str, tag=None, params={})`\n\n### REST Raw\n\n- `public_post_info(request)`\n- `private_post_exchange(request)`\n\n### WS Unified\n\n- `describe(self)`\n- `create_orders_ws(self, orders: List[OrderRequest], params={})`\n- `create_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})`\n- `edit_order_ws(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={})`\n- `watch_order_book(self, symbol: str, limit: Int = None, params={})`\n- `un_watch_order_book(self, symbol: str, params={})`\n- `watch_ticker(self, symbol: str, params={})`\n- `watch_tickers(self, symbols: Strings = None, params={})`\n- `un_watch_tickers(self, symbols: Strings = None, params={})`\n- `watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={})`\n- `un_watch_trades(self, symbol: str, params={})`\n- `watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={})`\n- `un_watch_ohlcv(self, symbol: str, timeframe='1m', params={})`\n- `watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`\n- `wrap_as_post_action(self, request: dict)`\n\n## Contribution\n- Give us a star :star:\n- Fork and Clone! Awesome\n- Select existing issues or create a new issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccxt%2Fhyperliquid-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccxt%2Fhyperliquid-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccxt%2Fhyperliquid-python/lists"}