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 v4-client-py 4.0.0

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

Source distribution (sdist)

Source distribution for v4-client-py 4.0.0
File Size Uploaded Provenance Actions
v4_client_py-4.0.0.tar.gz 55.9 kB Without provenance Details for v4_client_py-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for v4-client-py 4.0.0
File Interpreter ABI Platform Actions
v4_client_py-4.0.0-py3-none-any.whl Python 3 none any Details for v4_client_py-4.0.0-py3-none-any.whl

Total release size: 153.2 kB

Release files / v4_client_py-4.0.0.tar.gz

Download URL v4_client_py-4.0.0.tar.gz
Size 55.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2c4ec4ea98cde0d60672fd5c4bcf13642798e253a6c3772043f5b16f16184d55
BLAKE2b-256 checksum
How to use checksums
527b54789e6c8c4c1a386229a5cb389ca4ac64c0dff54630ebd7159a2687f622
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / v4_client_py-4.0.0-py3-none-any.whl

Download URL v4_client_py-4.0.0-py3-none-any.whl
Size 97.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45694a127cb24c2fcda11b5557f0121329ab8c3bd4d303fd2039a0c397c4c160
BLAKE2b-256 checksum
How to use checksums
e8c0421ee31f75b69e0738c1d5a8f06a7666bdf608693818c077c839b677d36e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.9

Security for v4-client-py 4.0.0

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

4.0.0 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