DriftPy for Dummies
  • DriftPy for Dummies
  • Setup
  • Priority Fees
  • Depositing and Withdrawing
  • The Order Class
  • Placing an Order
    • Place and Orders
    • Modifying an Order
    • Cancelling an Order
    • Settling PnL
Powered by GitBook
On this page

DriftPy for Dummies

Introduction

NextSetup

Last updated 1 year ago

By frank ()

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.

Find the DriftPy repo here:

Find the Keepyrs repo here:

Find the PyPi package here:

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.

https://twitter.com/soundsonacid
https://dev.helius.xyz/
https://github.com/drift-labs/driftpy
https://github.com/drift-labs/keepyrs
https://pypi.org/project/driftpy