Go to file
Geoff Taylor 7cfc1b76ba Added more logging to watch-minimum-balances. 2021-07-30 17:41:15 +01:00
.vscode Added to_streaming_observable() method to OracleProviders. Added polling observable to Pyth and Serum providers, and websocket observable to FTX provider. 2021-06-13 16:01:36 +01:00
bin Added more logging to watch-minimum-balances. 2021-07-30 17:41:15 +01:00
data Upgraded to new, better devnet group. 2021-07-29 12:38:34 +01:00
docs Added Notication documentation. 2021-07-22 11:38:32 +01:00
mango Added more logging to watch-minimum-balances. 2021-07-30 17:41:15 +01:00
meta Updated to handle Groups with 5 tokens as well as Groups with 3 tokens. 2021-05-27 17:07:02 +01:00
scripts Made Crank script take a Cluster URL parameter. 2021-07-26 13:44:46 +01:00
tests Upgraded to new, better devnet group. 2021-07-29 12:38:34 +01:00
.dockerignore Updated place_order() method to take an Order instead of separate parameters. 2021-07-28 15:29:24 +01:00
.envrc Moved development commands to 'scripts', so 'bin' is for actual commands. 2021-04-29 10:53:01 +01:00
.flake8 Moved library code to .py files instead of notebooks. 2021-06-07 15:10:18 +01:00
.gitignore Updated ids.json for new group. Updated Group with new structure. 2021-07-01 21:24:08 +01:00
.mypy.ini Brought up to date for new Group structures. New websocket approach. 2021-07-12 10:57:05 +01:00
Dockerfile Updates to allow some market making on Serum. 2021-07-13 20:01:32 +01:00
LICENSE
Liquidation.ipynb Improved reporting of TokenValue and BalanceSheet, in line with V2 changes. 2021-06-26 18:24:07 +01:00
Makefile Big Rename - removal of old Group and MarginAccount, deletion of a lot of code that is no longer relevant. 2021-06-25 15:50:37 +01:00
Pandas.ipynb Removed default context objects - now have static method on Context object: Context.default(). 2021-06-17 11:18:35 +01:00
Quickstart.md Updated Quickstart to match V2 (solana-keygen instead of create-wallet). 2021-06-28 11:22:03 +01:00
README.md Added Notication documentation. 2021-07-22 11:38:32 +01:00
ShowAccount.ipynb Improved reporting of TokenValue and BalanceSheet, in line with V2 changes. 2021-06-26 18:24:07 +01:00
ShowAllMarginAccounts.ipynb Removed default context objects - now have static method on Context object: Context.default(). 2021-06-17 11:18:35 +01:00
ShowGroup.ipynb Removed default context objects - now have static method on Context object: Context.default(). 2021-06-17 11:18:35 +01:00
ShowMarginAccount.ipynb Removed default context objects - now have static method on Context object: Context.default(). 2021-06-17 11:18:35 +01:00
ShowRipeMarginAccounts.ipynb Removed default context objects - now have static method on Context object: Context.default(). 2021-06-17 11:18:35 +01:00
requirements.txt Added to_streaming_observable() method to OracleProviders. Added polling observable to Pyth and Serum providers, and websocket observable to FTX provider. 2021-06-13 16:01:36 +01:00
setup.py Moved library code to .py files instead of notebooks. 2021-06-07 15:10:18 +01:00

README.md

🥭 Mango Explorer

⚠ Warning

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Run these notebooks on Binder: Binder

Introduction

I am not yet confident in the figures and calculations. Please don't rely on this code yet!

This is a project to explore and provide useful code for Mango Markets.

There are some notebook pages to explore Mango account structures for your own accounts.

There is also a functional liquidator.

The goal is not to be easy to use (although that would be nice!). The goal is to show you how the system works and allow you to use some simeple code to interact with it.

Running the liquidator

Check out the Quickstart documentation - it's a walkthrough of setting up and running the liquidator, from creating the account, 'balancing' the wallet across the different tokens, and running the liquidator itself.

It can take around 30 minutes to run through.

Requirements:

  • A server with docker installed
  • Some SOL to pay for transactions
  • Some USDT to fund the liquidation wallet

Running the notebooks

Most notebooks are currently 'runnable' - if you open them in your browser and press the 'fast-forward' button () on the toolbar

Verify a user's account is properly set up for Mango Markets liquidators

Mango Markets should set up your account automatically for trading, but the requirements for running a liquidator can be a bit more extensive. For instance, for trading you need token accounts for both tokens in the trade but to run a liquidator you need token accounts for all tokens in the Group.

Show your Mango margin accounts

To try this out, go to the Show Account page and enter your public key. (Note: I know you're running untrusted code, but it can't do much if you only give it your public key.)

Show all Mango margin accounts

To try this out, go to the Show All Margin Accounts page and run the code.

Show details of the current Mango gorup

You can use the Show Group page to inspect the details of the current Mango group.

Load all margin accounts into a Pandas DataFrame

To try this out, go to the Pandas page and run the code.

Pandas is a data analysis and manipulation tool and it's useful for sorting and slicing large data sets.

The Pandas page can currently show you:

  • The total assets and liabilities currently in Mango Markets margin accounts.
  • The top ten margin accounts with the most assets.
  • The top ten margin accounts with the most liabilities.
  • The top ten margin accounts with the lowest collateralisation.

References

Support

You can contact me @OpinionatedGeek on Twitter.