pip install hyperliquid-python-sdk
account_address in examples/config.json.secret_key in examples/config.json.Generate and authorize a new API private key on https://app.hyperliquid.xyz/API, and set the API wallet's private key as the secret_key in examples/config.json. Note that you must still set the public key of the main wallet not the API wallet as the account_address in examples/config.json
from hyperliquid.info import Info
from hyperliquid.utils import constants
info = Info(constants.TESTNET_API_URL, skip_ws=True)
user_state = info.user_state("0xcd5051944f780a621ee62e39e493c489668acf4d")
print(user_state)
See examples for more complete examples. You can also checkout the repo and run any of the examples after configuring your private key e.g.
cp examples/config.json.example examples/config.json
vim examples/config.json
python examples/basic_order.py
Download Poetry: https://python-poetry.org/.
symlinks=True in venv.EnvBuilder.Point poetry to correct version of python. For development we require python 3.10 exactly. Some dependencies have issues on 3.11, while older versions don't have correct typing support.
brew install [email protected] && poetry env use /opt/homebrew/Cellar/[email protected]/3.10.16/bin/python3.10
Install dependencies:
make install
CLI commands for faster development. See make help for more details.
check-safety Run safety checks on dependencies
cleanup Cleanup project
install Install dependencies from poetry.lock
install-types Find and install additional types for mypy
lint Alias for the pre-commit target
lockfile-update Update poetry.lock
lockfile-update-full Fully regenerate poetry.lock
poetry-download Download and install poetry
pre-commit Run linters + formatters via pre-commit, run "make pre-commit hook=black" to run only black
test Run tests with pytest
update-dev-deps Update development dependencies to latest versions
You can see the list of available releases on the GitHub Releases page.
We follow the Semantic Versions specification and use Release Drafter. As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you’re ready. With the categories option, you can categorize pull requests in release notes using labels.
| Label | Title in Releases |
|---|---|
enhancement, feature | Features |
bug, refactoring, bugfix, fix | Fixes & Refactoring |
build, ci, testing | Build System & CI/CD |
breaking | Breaking Changes |
documentation | Documentation |
dependencies | Dependencies updates |
Building a new version of the application contains steps:
poetry version <version>. You can pass the new version explicitly, or a rule such as major, minor, or patch. For more details, refer to the Semantic Versions standard.GitHubGitHub releasepoetry publish --buildThis project is licensed under the terms of the MIT license. See LICENSE for more details.
@misc{hyperliquid-python-sdk,
author = {Hyperliquid},
title = {SDK for Hyperliquid API trading with Python.},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/hyperliquid-dex/hyperliquid-python-sdk}}
}
This project was generated with python-package-template.
3,543 followers · starred Sep 2025
1,184 followers · starred Dec 2025
134 followers · starred Oct 2025
50 followers · starred Dec 2024
pip install hyperliquid-python-sdk
account_address in examples/config.json.secret_key in examples/config.json.Generate and authorize a new API private key on https://app.hyperliquid.xyz/API, and set the API wallet's private key as the secret_key in examples/config.json. Note that you must still set the public key of the main wallet not the API wallet as the account_address in examples/config.json
from hyperliquid.info import Info
from hyperliquid.utils import constants
info = Info(constants.TESTNET_API_URL, skip_ws=True)
user_state = info.user_state("0xcd5051944f780a621ee62e39e493c489668acf4d")
print(user_state)
See examples for more complete examples. You can also checkout the repo and run any of the examples after configuring your private key e.g.
cp examples/config.json.example examples/config.json
vim examples/config.json
python examples/basic_order.py
Download Poetry: https://python-poetry.org/.
symlinks=True in venv.EnvBuilder.Point poetry to correct version of python. For development we require python 3.10 exactly. Some dependencies have issues on 3.11, while older versions don't have correct typing support.
brew install [email protected] && poetry env use /opt/homebrew/Cellar/[email protected]/3.10.16/bin/python3.10
Install dependencies:
make install
CLI commands for faster development. See make help for more details.
check-safety Run safety checks on dependencies
cleanup Cleanup project
install Install dependencies from poetry.lock
install-types Find and install additional types for mypy
lint Alias for the pre-commit target
lockfile-update Update poetry.lock
lockfile-update-full Fully regenerate poetry.lock
poetry-download Download and install poetry
pre-commit Run linters + formatters via pre-commit, run "make pre-commit hook=black" to run only black
test Run tests with pytest
update-dev-deps Update development dependencies to latest versions
You can see the list of available releases on the GitHub Releases page.
We follow the Semantic Versions specification and use Release Drafter. As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you’re ready. With the categories option, you can categorize pull requests in release notes using labels.
| Label | Title in Releases |
|---|---|
enhancement, feature | Features |
bug, refactoring, bugfix, fix | Fixes & Refactoring |
build, ci, testing | Build System & CI/CD |
breaking | Breaking Changes |
documentation | Documentation |
dependencies | Dependencies updates |
Building a new version of the application contains steps:
poetry version <version>. You can pass the new version explicitly, or a rule such as major, minor, or patch. For more details, refer to the Semantic Versions standard.GitHubGitHub releasepoetry publish --buildThis project is licensed under the terms of the MIT license. See LICENSE for more details.
@misc{hyperliquid-python-sdk,
author = {Hyperliquid},
title = {SDK for Hyperliquid API trading with Python.},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/hyperliquid-dex/hyperliquid-python-sdk}}
}
This project was generated with python-package-template.
3,543 followers · starred Sep 2025
1,184 followers · starred Dec 2025
134 followers · starred Oct 2025
50 followers · starred Dec 2024