DriftPy for Dummies

Introduction

By frank (https://twitter.com/soundsonacid)

DriftPy is the Python SDK for the Drift Protocol. It's intended to mirror the TypeScript SDK, but is still a WIP and lacking some functionalities. This is the main source for how-tos in DriftPy and solutions for common pitfalls. If you're using a free RPC, the author's official recommendation is the free Helius RPC with a verified email. https://dev.helius.xyz/

Find the DriftPy repo here: https://github.com/drift-labs/driftpy

Find the Keepyrs repo here: https://github.com/drift-labs/keepyrs

Find the PyPi package here: https://pypi.org/project/driftpy

To install DriftPy in your project, run pip install driftpy or poetry add driftpy .

You'll also need to add the solana library to your project, and optionally, the anchorpy library. You can follow similar syntax to add those as you did to add DriftPy. The solders library, which will be used in several examples, is re-exported from solana . You can safely ignore any "Module not found" warnings or errors caused by solders imports from code found in this book.

Last updated