Paradex Python SDK provides a simple interface to interact with the Paradex REST and WS API.
from paradex_py import Paradex
from paradex_py.environment import Environment
paradex = Paradex(env=Environment.TESTNET, l1_address="0x...", l1_private_key="0x...")
print(hex(paradex.account.l2_address)) # 0x...
print(hex(paradex.account.l2_public_key)) # 0x...
print(hex(paradex.account.l2_private_key)) # 0x...
paradex.api_client.fetch_system_config() # { ..., "paraclear_decimals": 8, ... }
async def on_message(ws_channel, message):
print(ws_channel, message)
await paradex.ws_client.connect()
await paradex.ws_client.subscribe(ParadexWebsocketChannel.MARKETS_SUMMARY, callback=on_message)
📖 For complete documentation refer to tradeparadex.github.io/paradex-py
💻 For comprehensive examples refer to following files:
- API: examples/call_rest_api.py
- WS: examples/connect_ws_api.py
- Transfer: examples/transfer_l2_usdc.py
make install
make check
make test
make build
make clean-build
make publish
make build-and-publish
make docs-test
make docs
make help
This project uses uv
for managing dependencies and building. Below are instructions for installing uv
and the basic workflow for development outside of using make
commands.
uv
is a fast and modern Python package manager. You can install it using the standalone installer for macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
For other installation methods, refer to the uv installation documentation.
If you prefer not to use make
commands, you can directly use uv
for development tasks:
- Install dependencies: Sync your environment with the project's dependencies.
uv sync
- Run tests: Execute the test suite using
pytest
within theuv
environment.uv run pytest
- Build the project: Create a distribution package for the SDK.
uv build
For more detailed information on using uv
, refer to the uv documentation.
The CI/CD pipeline will be triggered when a new pull request is opened, code is merged to main, or when new release is created.
Warning
Experimental SDK, library API is subject to change