{"id":26105773,"url":"https://github.com/sonirico/go-hyperliquid","last_synced_at":"2026-03-01T17:06:21.382Z","repository":{"id":281392834,"uuid":"942861669","full_name":"sonirico/go-hyperliquid","owner":"sonirico","description":"Unofficial golang client SDK for api.hyperliquid.xyz supporting both API and websocket channels","archived":false,"fork":false,"pushed_at":"2026-02-23T10:28:50.000Z","size":3598,"stargazers_count":93,"open_issues_count":0,"forks_count":52,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-23T19:06:46.033Z","etag":null,"topics":["api","blockchain","dex","exchange","go","golang","hyperliquid","sdk","sdk-go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/sonirico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"sonirico"}},"created_at":"2025-03-04T19:48:35.000Z","updated_at":"2026-02-23T10:28:50.000Z","dependencies_parsed_at":"2026-02-14T12:18:48.655Z","dependency_job_id":null,"html_url":"https://github.com/sonirico/go-hyperliquid","commit_stats":null,"previous_names":["sonirico/go-hyperliquid"],"tags_count":68,"template":false,"template_full_name":null,"purl":"pkg:github/sonirico/go-hyperliquid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fgo-hyperliquid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fgo-hyperliquid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fgo-hyperliquid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fgo-hyperliquid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonirico","download_url":"https://codeload.github.com/sonirico/go-hyperliquid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fgo-hyperliquid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29976272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","blockchain","dex","exchange","go","golang","hyperliquid","sdk","sdk-go"],"created_at":"2025-03-09T21:53:57.388Z","updated_at":"2026-03-01T17:06:21.376Z","avatar_url":"https://github.com/sonirico.png","language":"Go","funding_links":["https://ko-fi.com/sonirico"],"categories":[],"sub_categories":[],"readme":"# go-hyperliquid\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/sonirico/go-hyperliquid.svg)](https://pkg.go.dev/github.com/sonirico/go-hyperliquid)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sonirico/go-hyperliquid)](https://goreportcard.com/report/github.com/sonirico/go-hyperliquid)\n[![CI](https://github.com/sonirico/go-hyperliquid/actions/workflows/ci.yml/badge.svg)](https://github.com/sonirico/go-hyperliquid/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/sonirico/go-hyperliquid/badge.svg?branch=main)](https://coveralls.io/github/sonirico/go-hyperliquid?branch=main)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/sonirico/go-hyperliquid)](https://go.dev/)\n\nUnofficial Go client for the Hyperliquid exchange API. This implementation follows the same philosophy and patterns as the official Python SDK.\n\n## Installation\n\n```bash\ngo get github.com/sonirico/go-hyperliquid\n```\n\n## Features\n\nThis Go SDK provides **full feature parity** with the official Python SDK, including:\n\n### Trading Features\n\n- **Order Management**: Limit orders, market orders, trigger orders, order modifications\n- **Position Management**: Leverage updates, isolated margin, position closing\n- **Bulk Operations**: Bulk orders, bulk cancellations, bulk modifications\n- **Advanced Trading**: Market open/close with slippage protection, scheduled cancellations\n- **Builder Support**: Order routing through builders with fee structures\n\n### Account Management\n\n- **Referral System**: Set referral codes, track referral state\n- **Sub-Accounts**: Create and manage sub-accounts, transfer funds\n- **Multi-Signature**: Convert to multi-sig, execute multi-sig actions\n- **Vault Operations**: Vault deposits, withdrawals, and transfers\n\n### Asset Management\n\n- **USD Transfers**: Cross-chain USD transfers, spot transfers\n- **Class Transfers**: USD class transfers (perp ↔ spot), perp dex transfers\n- **Bridge Operations**: Withdraw from bridge with fee management\n- **Token Delegation**: Stake tokens with validators\n- **Spot Trading**: Full spot market support\n\n### Advanced Features\n\n- **Agent Approval**: Approve trading agents with permissions\n- **Builder Fee Management**: Approve and manage builder fees\n- **Big Blocks**: Enable/disable big block usage\n\n### Deployment Features (Advanced)\n\n- **Spot Deployment**: Token registration, genesis, freeze privileges\n- **Perp Deployment**: Asset registration, oracle management\n- **Hyperliquidity**: Register hyperliquidity assets\n\n### Consensus Layer (Validators)\n\n- **Validator Operations**: Register, unregister, profile management\n- **Signer Operations**: Jail/unjail self, inner actions\n- **Consensus Actions**: Full consensus layer interaction\n\n### WebSocket Features\n\n- **Market Data**: Real-time L2 book, trades, candles, mid prices\n- **User Events**: Order updates, fills, funding, ledger updates\n- **Advanced Streams**: BBO, active asset context, web data v2\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n\n    \"github.com/ethereum/go-ethereum/crypto\"\n    hyperliquid \"github.com/sonirico/go-hyperliquid\"\n)\n\nfunc main() {\n    // For trading, create an Exchange with your private key\n    privateKey, _ := crypto.HexToECDSA(\"your-private-key\")\n    exchange := hyperliquid.NewExchange(\n        context.Background(),\n        privateKey,\n        hyperliquid.MainnetAPIURL,\n        nil,    // Meta will be fetched automatically\n        \"vault-address\",\n        \"account-address\",\n        nil,    // SpotMeta will be fetched automatically\n        nil,    // PerpDexs will be fetched automatically\n    )\n\n    // Place a limit order\n    order := hyperliquid.OrderRequest{\n        Coin:    \"BTC\",\n        IsBuy:   true,\n        Size:    0.1,\n        LimitPx: 40000.0,\n        OrderType: hyperliquid.OrderType{\n            Limit: \u0026hyperliquid.LimitOrderType{\n                Tif: \"Gtc\",\n            },\n        },\n    }\n\n    resp, err := exchange.Order(context.Background(), order, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Subscribe to WebSocket updates\n    ws := hyperliquid.NewWebsocketClient(hyperliquid.MainnetAPIURL)\n    if err := ws.Connect(context.Background()); err != nil {\n        log.Fatal(err)\n    }\n    defer ws.Close()\n\n    // Subscribe to BTC trades\n    _, err = ws.Subscribe(hyperliquid.Subscription{\n        Type: \"trades\",\n        Coin: \"BTC\",\n    }, func(msg hyperliquid.wsMessage) {\n        fmt.Printf(\"Trade: %+v\\n\", msg)\n    })\n}\n```\n\n## Documentation\n\nFor detailed API documentation, please refer to:\n\n- [Official Hyperliquid API docs](https://hyperliquid.xyz/docs)\n- [Go package documentation](https://pkg.go.dev/github.com/sonirico/go-hyperliquid)\n\n### Examples\n\nCheck the `examples/` directory for more usage examples:\n\n- WebSocket subscriptions\n- Order management\n- Position handling\n- Market data retrieval\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Contributors\n\nThanks to all the people who have contributed to this project! 🎉\n\n\u003c!-- readme: contributors -start --\u003e\n\u003ctable\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/sonirico\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/9306588?v=4\" width=\"100;\" alt=\"sonirico\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eMarquitos\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/terwey\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/1596124?v=4\" width=\"100;\" alt=\"terwey\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eYorick Terweijden\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/standrd\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/13077016?v=4\" width=\"100;\" alt=\"standrd\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eStan\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/prasiman\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/8805410?v=4\" width=\"100;\" alt=\"prasiman\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003ePrasetyo Iman Nugroho\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/coder-ishan\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/59679369?v=4\" width=\"100;\" alt=\"coder-ishan\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eIshan Singh\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/KILLY000\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/138504730?v=4\" width=\"100;\" alt=\"KILLY000\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eVernon Stokes\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/Debuggedd\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/16706921?v=4\" width=\"100;\" alt=\"Debuggedd\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eAlex\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/MarcSky\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/4164003?v=4\" width=\"100;\" alt=\"MarcSky\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eLevan\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/ivaaaan\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/10375456?v=4\" width=\"100;\" alt=\"ivaaaan\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eIvan\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/vyomshm\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/20184946?v=4\" width=\"100;\" alt=\"vyomshm\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eVyom\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/tpkeeper\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/7260146?v=4\" width=\"100;\" alt=\"tpkeeper\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003etpkeeper\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/hail100\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/7278395?v=4\" width=\"100;\" alt=\"hail100\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003ehail100\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/feeeei\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/8032930?v=4\" width=\"100;\" alt=\"feeeei\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003efeeeei\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/corverroos\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/29249923?v=4\" width=\"100;\" alt=\"corverroos\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003ecorver\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/aaltergot\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/12907019?v=4\" width=\"100;\" alt=\"aaltergot\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eAlexander Altergot\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/07Vaishnavi-Singh\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/100015197?v=4\" width=\"100;\" alt=\"07Vaishnavi-Singh\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eVaiz_07\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/freeeverett\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/54989739?v=4\" width=\"100;\" alt=\"freeeverett\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eEverett\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/andrew-malikov\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/35894527?v=4\" width=\"100;\" alt=\"andrew-malikov\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eAndrew Malikov\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003ctbody\u003e\n\u003c/table\u003e\n\u003c!-- readme: contributors -end --\u003e\n\n### Quick Start for Contributors\n\n```bash\n# Clone the repository\ngit clone https://github.com/sonirico/go-hyperliquid.git\ncd go-hyperliquid\n\n# Install dependencies and tools\nmake deps install-tools\n\n# Run all checks\nmake ci-full\n\n# Run tests (excluding examples)\nmake ci-test\n```\n\n## Roadmap\n\n### ✅ Completed Features\n\n- [x] Complete WebSocket API implementation\n- [x] REST API client\n- [x] All trading operations (orders, positions, leverage)\n- [x] Market data (L2 book, trades, candles, all mids)\n- [x] User account management\n- [x] Referral system implementation\n- [x] Sub-account management\n- [x] Vault operations\n- [x] USD and spot transfers\n- [x] Bridge operations\n- [x] Agent approval system\n- [x] Builder fee management\n- [x] Multi-signature support\n- [x] Token delegation/staking\n- [x] Spot deployment features\n- [x] Perp deployment features\n- [x] Consensus layer (validator operations)\n- [x] Full feature parity with Python SDK\n\n### 🚀 Future Enhancements\n\n- [ ] Enhanced documentation with more examples\n- [ ] Performance optimizations\n- [ ] Additional testing and edge case coverage\n- [ ] Rate limiting and retry mechanisms\n- [ ] Monitoring and observability features\n- [x] Order management\n- [x] User account operations\n- [ ] Advanced order types\n- [ ] Historical data API\n- [ ] Rate limiting improvements\n- [ ] Connection pooling\n\n## License\n\nMIT License\n\nCopyright (c) 2025\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonirico%2Fgo-hyperliquid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonirico%2Fgo-hyperliquid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonirico%2Fgo-hyperliquid/lists"}