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

Uploaded Source

Built Distribution

driftpy-0.6.21-py3-none-any.whl (59.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: driftpy-0.6.21.tar.gz
  • Upload date:
  • Size: 52.2 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.21.tar.gz
Algorithm Hash digest
SHA256 a269f1036ee35fc39a71699213c40bee502855f5420b99055199ec9bbb1ec659
MD5 e245d9a5a0ecfc8a88f3aa49cb334bfa
BLAKE2b-256 1d48db4620de5481ef08455bb0e7625faed9b87ee861392f73212980ee25839e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: driftpy-0.6.21-py3-none-any.whl
  • Upload date:
  • Size: 59.8 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.21-py3-none-any.whl
Algorithm Hash digest
SHA256 f373a81dd02e3d576e21236457a15f01905443e67d39b7a4a75312364222987c
MD5 413b602449e386f7df5541ec9a5bf02e
BLAKE2b-256 6c6cb6128d447f6fa0232834d786a6645935a3c4034fb4a3c54d9991629941d1

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