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

Development Setup

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

  1. Install poetry
  2. Install dev dependencies:
poetry install
  1. Install nox-poetry (note: do not use Poetry to install this, see here)
  2. Activate the poetry shell:
poetry shell

Testing

  1. Run make test.
  2. Run make lint.

Building the docs

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

Updating the embedded IDLs

DriftPy ships with IDL files for the user's convenience. These live at src/driftpy/idl if you need to update them.

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.

Updating the drift-core subtree

  • This repo pulls in the main Drift repo using git subtree. Follow that linked tutorial if you want to see how it was done.

The short answer: git subtree pull --prefix drift-core drift-protocol mainnet-beta --squash

Project details


Release history Release notifications | RSS feed

This version

0.5.7

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

driftpy-0.5.7-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: driftpy-0.5.7.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.12 Linux/5.13.0-1022-azure

File hashes

Hashes for driftpy-0.5.7.tar.gz
Algorithm Hash digest
SHA256 f822ebca57d0507bce4ca320d793a55aa74be1ce1528cbe3a1aab42ce991af73
MD5 802214e471a80234b88778a7657d608b
BLAKE2b-256 b150f3af08d2826cbe584626b61cb3a0e6808358d32d90ca890a841df35c4430

See more details on using hashes here.

File details

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

File metadata

  • Download URL: driftpy-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.12 Linux/5.13.0-1022-azure

File hashes

Hashes for driftpy-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6bad27da59a34bde8fe37a62c797918a11ea9ba687f9d5358e9d6e1dbd331555
MD5 3a00909cd99793023d5e193ed608e8ae
BLAKE2b-256 516ad5ac7396cafd18ce85eee742d8817c8c6e9d7a07133f7a3dbfa26b1f18fe

See more details on using hashes here.

Supported by

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