Skip to main content

dYdX Chain Client

Project description

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 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

v4_client_py-4.0.0.tar.gz (55.9 kB view details)

Uploaded Source

Built Distribution

v4_client_py-4.0.0-py3-none-any.whl (97.3 kB view details)

Uploaded Python 3

File details

Details for the file v4_client_py-4.0.0.tar.gz.

File metadata

  • Download URL: v4_client_py-4.0.0.tar.gz
  • Upload date:
  • Size: 55.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for v4_client_py-4.0.0.tar.gz
Algorithm Hash digest
SHA256 2c4ec4ea98cde0d60672fd5c4bcf13642798e253a6c3772043f5b16f16184d55
MD5 81d7bdb91df0609926c119434339e679
BLAKE2b-256 527b54789e6c8c4c1a386229a5cb389ca4ac64c0dff54630ebd7159a2687f622

See more details on using hashes here.

File details

Details for the file v4_client_py-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: v4_client_py-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 97.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for v4_client_py-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45694a127cb24c2fcda11b5557f0121329ab8c3bd4d303fd2039a0c397c4c160
MD5 99760b2a16b6f0e81831404d92e7cdeb
BLAKE2b-256 e8c0421ee31f75b69e0738c1d5a8f06a7666bdf608693818c077c839b677d36e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page