Skip to main content

A Python client for the Drift DEX

Project description

DriftPy

DriftPy is the Python client for the Drift protocol. It allows you to trade and fetch data from Drift using Python.

Read The Documentation

Installation

pip install driftpy

Note: requires Python >= 3.9.

Examples

Arbitrage Trading

Querying and Visualization

Development

  • git submodule update --init --recursive
  • cd protocol-v2 && yarn
  • cd sdk && yarn && yarn build && cd ..
  • anchor build
  • in deps/serum/dex run cargo build-bpf
  • update anchor IDL for v2 protocol on new re-builds (copy new idls to src/driftpy/idl/...json)
  • run python tests: bash test.sh v2tests/test.py

Development Setup

If you want to contribute to DriftPy, follow these steps to get set up:

  1. Install poetry
  2. Install dev dependencies (in local env):
poetry install

Testing

  1. bash test.sh

Building the docs

Run mkdocs serve to build the docs and serve them locally.

Releasing a new version of the package

  1. Make sure CHANGELOG.md is updated.
  2. Run bumpversion major|minor|patch to update the version number locally and create a tagged commit.
  3. Run git push origin <version_number> to push the tag to GitHub.
  4. After merging your PR on GitHub, create a new release at https://github.com/drift-labs/driftpy/releases. The CI process will upload a new version of the package to PyPI.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

driftpy-0.6.19.tar.gz (61.8 kB view details)

Uploaded Source

Built Distribution

driftpy-0.6.19-py3-none-any.whl (69.7 kB view details)

Uploaded Python 3

File details

Details for the file driftpy-0.6.19.tar.gz.

File metadata

  • Download URL: driftpy-0.6.19.tar.gz
  • Upload date:
  • Size: 61.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for driftpy-0.6.19.tar.gz
Algorithm Hash digest
SHA256 2e590192807e2eb42b93803b8ac2ccd7ecb6e2ed750cfb95a196c1aa2f190622
MD5 3c5780ed2e364244ed530d50a8fae0c4
BLAKE2b-256 6d08ab852cd5a224789d715587d88ee42ccb54a887ec3acf7f85fb5a23bd6af6

See more details on using hashes here.

File details

Details for the file driftpy-0.6.19-py3-none-any.whl.

File metadata

  • Download URL: driftpy-0.6.19-py3-none-any.whl
  • Upload date:
  • Size: 69.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for driftpy-0.6.19-py3-none-any.whl
Algorithm Hash digest
SHA256 5f000e436139f1c8ff3ef82300ea7e88962c0c8a8bf5d9dd83bfbb8c725d6555
MD5 735442ae3486d5d151c0530a415f12d8
BLAKE2b-256 89373a0e0c9fa3cc344bc01932e30262d021edad1e07ad3e7652eb6e7b923970

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