Python SDK
Introduction
Hxro provides a Python SDK that closely resembles the REST API for traders & developers who wish to write trading bots or build on top of the protocol directly from their Python applications.
How to get it
The SDK is currently available on Pypi for Linux only at https://pypi.org/project/parimutuelsdk. A MacOS version will follow soon, if you have an immediate use for it please reach us on Discord.
How to instantiate it
Start by creating a virtualenv and installing the SDK
Then instantiate the SDK, passing in a validator URL (public or private), the parimutuel program id (the program id on devnet is 3kjK4HA6A4K86NgNB93gGhSt257wtN4QAqXMNPQ4fVTm and on mainnet is GUhB2ohrfqWspztgCrQpAmeVFBWmnWYhPcZuwY52WWRe) and the private key for the owner of the system account that will be used to pay for transactions and which owns the ATAs holding the settlement token (USDC) and any HXRO tokens. Note you can get an airdrop for both using our devnet UI, see for more information.
Optionally, pass in a network key to filter to a particular market denomination. Currently there are only USDC denominated markets (the network key on devnet is 2xJcpMZvegKZ6GCYzUp74DfEFtPss66XNzV932xgSgNW and mainnet is FoCmS48FRyJrx6bozDijaARYAThdUeUGu4rbGKqBegcH).
Example usage
The SDK attempts to replicate the existing hxro.trade API described here at https://hxroapi.readme.io/docs/getting-started. We recommend wrapping the SDK in a user defined class that allows adding type hints, for example:
Comments, Feedback, Suggestions
Please find us on the #builder-chat channel on Discord at https://discord.com/channels/740983228134981793/980287738819538974
Last updated