SDK for Hyperliquid API trading with Python.
Maintained. Last release 5 days ago, commits in 2 of the last 26 weeks. Weaker on commit activity and issue handling.
pip install hyperliquid-python-sdkhyperliquid-python-sdk
Installation
pip install hyperliquid-python-sdk
Configuration
- Set the public key as the
account_addressin examples/config.json. - Set your private key as the
secret_keyin examples/config.json. - See the example of loading the config in examples/example_utils.py
[Optional] Generate a new API key for an API Wallet
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
Usage Examples
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.