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.18.tar.gz (61.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: driftpy-0.6.18.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.18.tar.gz
Algorithm Hash digest
SHA256 26966cbb9cf465f8c581335d914ccbcb8578a404211372a505b501e27cb18628
MD5 883e6b834fa3104bff765341678866df
BLAKE2b-256 8491411c6653196a14a417085395cb93e478994e4249ef52d45196b4af71ec27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: driftpy-0.6.18-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.18-py3-none-any.whl
Algorithm Hash digest
SHA256 ea4850a5fac5221d6866cf5d492d08874161758d6bd336dcedfd4a9297ddd6b0
MD5 6c80ffeabb394eb5c189f3d137af20da
BLAKE2b-256 bb2965c5589cc153e58d06fdeca3f774d27b9753bd025332887fb050a4913329

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