VISIT THE WEBSITE

Inspiration

Many teams have been looking for an Anchor Python client (PsyOptions, Drift, Foresight and others) because Python is popular in many fields where JavaScript isn't popular, such as automated trading and data science. In particular, lack of Python support has been a big problem for projects trying to onboard market makers.

What's great about having an Anchor client is it abstracts a lot of hard stuff for you and makes writing client libraries for individual projects much more feasible.

What it does

AnchorPy does the same things as the Anchor Typescript client, but in Python. This makes Python ten times as useful for Solana projects and increases the GDP of the whole ecosystem.

How we built it

I built AnchorPy on top of solana-py and Construct, a library for building binary serializers. Much of my work on AnchorPy went into other libraries: I did a lot of work on solana-py and wrote a separate library implementing Borsh serialisation on top of Construct.

Challenges we ran into

As I alluded to above, I had to lay a lot of foundation myself before I could write AnchorPy. Much of what I needed (like async support) was missing from solana-py, I had to bring Borsh to Python, and generally I was working on things that were quite new and not well-documented.

Accomplishments that we're proud of

All the glass I chewed to make this.

What we learned

I now know a lot about the Solana RPC and the inner workings of the Anchor Typescript client.

What's next for AnchorPy

The immediate priority is adding more docs and writing all of the Anchor client tests in Python (so far the tutorial tests are covered). After that I plan on adding more features such as codegen and batch requests.

Built With

  • anchor
  • asyncio
  • construct
  • httpx
  • python
  • solana
  • solana-py
+ 5 more
Share this project:

Updates