๐ฅญ
Mango Explorer
๐
Introduction
This guide will show you how to load and run a customisable marketmaker that runs on Mango Markets using the mango-explorer library.
There are plenty of ways to do this. This document shows only one possible approach.
๐ช
Prerequisites
- Installation and Dependencies - shows you how to set up a Python virtual environment and pip install
mango-explorer
. (Optional - feel free to skip if you're comfortable doing this on your own.) - Devnet Wallet Creation - shows you how to create a Solana
Keypair
file and prepare it for devnet with some devnet SOL and devnet USDC. (Optional - feel free to skip if you're comfortable doing this on your own.) - Devnet Mango Account Creation - shows you how to create a Mango Account on devnet and deposit devnet USDC into it. (Optional - feel free to skip if you're comfortable doing this on your own.)
- Code Walkthrough - takes you through the code in
marketmaker.py
line by line. (Optional - feel free to skip if you're comfortable doing this on your own.)
๐
Running the Marketmaker
That's a lot of setup to get you to this stage but some of it was skippable if you already had a Python venv, Solana wallet and a Mango Account. And if you didn't, you do now!
You can now start the marketmaker by running:
python marketmaker.py
No parameters are required - all the parameters and options for running the marketmaker are in the code.
When you run it you should see a lot of output, with large 'pulses' of output every 10 seconds or so. (You can tweak the volume of logging and the pulse interval in the code.)
๐ต
Next Steps
If you've got this far, congratulations! You're now running a marketmaker on devnet.
Things you can do now:
- experiment with different parameters to see how that changes the orders.
- experiment with different
Element
s to filter orders or bias prices or quantities in certain circumstances. (Want to shift the prices in your orders if you've built up too much inventory? Can do!) - create your own custom
Element
s to change order quantities or prices based on new criteria. (Want to widen the spread when volatility is high? Create a customElement
!)
๐ฆฎ
Support