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.2

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

Uploaded Source

Built Distribution

driftpy-0.5.2-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for driftpy-0.5.2.tar.gz
Algorithm Hash digest
SHA256 51e0a55ba7f323709497b8e134df5c374a7a302ac3805a2c2f5c4efc5a06ff16
MD5 f61c415736c4917f40bf9c8db9267262
BLAKE2b-256 066917dbe4ec235f0f465a478d48ab1d65459428ca0325a9c8fa4620f0d6196b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for driftpy-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a08d1ef6e38ba71813b2928d4720f8a5883ff7889868a7bff1dca08c2c412c
MD5 6f9b3529f1e5f19d6e1805e83098c605
BLAKE2b-256 4b3c16267df15e3a040947ff29e70238ebba9036a664910e91d2e50a55b82b67

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