Skip to main content

dYdX Chain Client for Python

Python client for dYdX (v4 API).

The library is currently tested against Python versions 3.9, and 3.11.

Installation

The v4-client-py package is available on PyPI. Install with pip:

pip install v4-client-py

Getting Started

Sample code is located in examples folder

Development Setup - VS Code

Install Microsoft Python extensions

Shift-Command-P: Create Python Environment
Select Venv
Select Python 3.9 as interpreter
Select requirements.txt as the dependencies to install

Install requirements

pip install -r requirements.txt

VS Code will automatically switch to .venv environment when running example code. Or you can manually switch

source ~/<project_dir>/.venv/bin/activate

Set PYTHONPATH

export PYTHONPATH=~/<project_dir>/.venv/lib/<Python version>/site-packages

Troubleshootimg

Cython and Brownie must be installed before cytoolz

If there is any issue with cytoolz, uninstall cytoolz, Brownie and Cython, reinstall Cython, Brownie and cytoolz sequentially.

VS Code may need to be restarted to have Cython functioning correctly

Running examples

Select the file to be debugged Select the debug button on the left Select "Python: Current File"

Running tests

Integration tests uses testnet environment for testing. We use pytest.

To install pytest

pip install pytest

For read-only integration tests, run:

pytest -v

For integration tests with transactions, a subaccount must exist for the specified address. This subaccount may be reset when testnet environment is reset. To create the subaccount, run

examples/faucet_endpoint.py

Wait for a few seconds for the faucet transaction to commit, then run

pytest -v -c pytest_integration.ini 

Metadata

Release files for dydx-v4-python 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dydx-v4-python 0.0.4
File Size Uploaded Provenance Actions
dydx_v4_python-0.0.4.tar.gz 47.2 kB Without provenance Details for dydx_v4_python-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dydx-v4-python 0.0.4
File Interpreter ABI Platform Actions
dydx_v4_python-0.0.4-py3-none-any.whl Python 3 none any Details for dydx_v4_python-0.0.4-py3-none-any.whl

Total release size: 135.5 kB

Release files / dydx_v4_python-0.0.4.tar.gz

Download URL dydx_v4_python-0.0.4.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2ab0018abf3e6e706b1e9906ade7dd4a98ab83abed0714d087d4a8566ff810de
BLAKE2b-256 checksum
How to use checksums
58cf6e54118265256bb6e6424acc65a75c83e6a14cd3b673d763401b3a5ce049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.9.18 Linux/6.2.0-1018-azure

Release files / dydx_v4_python-0.0.4-py3-none-any.whl

Download URL dydx_v4_python-0.0.4-py3-none-any.whl
Size 88.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54430abde25140b8f015141e610a2295bf1ab58bd6473ada65efec500dddae33
BLAKE2b-256 checksum
How to use checksums
5a10a6194ff873cf9850b3dca96da6cb8d04762afe9e457db143c55ff3a42b76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.9.18 Linux/6.2.0-1018-azure

Security for dydx-v4-python 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page