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

This version

0.6.6

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.6.tar.gz (61.4 kB view hashes)

Uploaded Source

Built Distribution

driftpy-0.6.6-py3-none-any.whl (69.2 kB view hashes)

Uploaded Python 3

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