Commit Graph

204 Commits

Author SHA1 Message Date
Geoff Taylor c3ac807fce Moved oracles to their own packages. 2021-06-11 16:51:41 +01:00
Geoff Taylor b47bd6f6f3 Added Serum oracle. 2021-06-11 12:43:47 +01:00
Geoff Taylor 83d1702691 Added code to fetch prices from the Pyth Network. 2021-06-10 21:28:29 +01:00
Geoff Taylor 4294fbebe7 Fixed problem using Wrapped SOL with Serum.
* Fixes problems with liquidator re-balancing.
* Fixes problems with group-balance-wallet, group-settle, serum-buy and serum-sell commands.
* Greatly increases the speed of buying and selling on Serum - the IOC order is now placed, cranked and settled in one transaction.
* Associated token accounts and OpenOrders accounts are automatically created as-needed.
2021-06-09 00:47:15 +01:00
Geoff Taylor 032c91c66e Fixed bug in group-settle, where market metadata was provided instead of a spot market. 2021-06-08 15:12:43 +01:00
Geoff Taylor 16cb68ad4c Fixed bug in balancing wallet.
* Mixed use of 'symbol' in different contexts.
2021-06-08 14:38:28 +01:00
Geoff Taylor e3e44a14ef Added documentation on Wrapped SOL, how to wrap/unwrap. Cleaned up those commands, centralised some Instructions. 2021-06-08 14:05:00 +01:00
Geoff Taylor 616d929e90 Removed context from Group, added name. Price lookups must now pass the context they want to use. 2021-06-08 08:17:37 +01:00
Geoff Taylor c0d7621e53 Added show-group and show-margin-account commands.
* Improved string output
* Strongly typed Group TokenValues, e.g. total deposits/borrows, indexes.
2021-06-07 19:38:43 +01:00
Geoff Taylor 5e59d8a7e3 Moved library code to .py files instead of notebooks.
* This is a big change that touched most files in the project.
* Library code is now an actual package, in /mango.
* Pure .py files used for shared code - easier to edit/debug, and should ease move to installable package later.
* Removed many notebooks. The remaining notebooks are useful 'display'/'show' notebooks for investigating Mango objects.
* More tests! The test story is now much improved, but more unit tests are still needed.
* There's now a Makefile for project operations.
2021-06-07 15:10:18 +01:00
Geoff Taylor de0144f43a Tidied up command help for new commands. 2021-06-03 09:10:09 +01:00
Geoff Taylor 227e63a851 Fixed confirmation statement in wrap-sol. 2021-06-02 20:17:40 +01:00
Geoff Taylor cd7cdab540 Added commands to wrap and unwrap SOL. 2021-06-02 20:03:46 +01:00
Geoff Taylor e3b0d65705 Extended use of Lookups - serum buys and sells no longer need a Group. 2021-06-01 19:16:59 +01:00
Geoff Taylor f73ee9ca19 Now use solana.tokenlist.json for token lookups. 2021-06-01 18:16:02 +01:00
Geoff Taylor cbd42d24ae Context can now decide to look up the group ID given a group name, instead of using the wrong default. 2021-06-01 14:08:54 +01:00
Geoff Taylor ba25e289af Better retry functionality with backoff pauses. 2021-05-28 17:16:53 +01:00
Geoff Taylor b6a595bb21 Updated to handle Groups with 5 tokens as well as Groups with 3 tokens. 2021-05-27 17:07:02 +01:00
Geoff Taylor 8b21f4c025 Fixed formatting of token balance in group-balances command. 2021-05-25 17:17:41 +01:00
Geoff Taylor 30543975ee Renamed commands to better reflect purpose. Updated Quickstart.
* group-buy-token to serum-buy
* group-sell-token to serum-sell
* group-send-token to send-token
2021-05-24 10:40:33 +01:00
Geoff Taylor 5c6abd0733 Added CsvFileNotificationTarget.
* Updated notifications to allow notifying on succeeded or failed (or both!) PartialLiquidate transactions.
* Added more information to LiquidationEvent to allow that to flow through to notifications.
2021-05-21 20:02:54 +01:00
Geoff Taylor 8b8afe1a0b Refactored PollingLiquidator into ReportingAccountLiquidator and LiquidationProcessor
* ReportingAccountLiquidator wraps an AccountLiquidator but provides before-and-after logging and reporting.
* Sped up fetch_token_prices() by reducing it to one network fetch
* Centralised loading of ripe mangoes by creating MarginAccount.load_all_ripe()
* Clearer, more consistent use of Observables
* Added RxPy Backpressure library
* Improved container building to allow for different tags
2021-05-21 14:28:42 +01:00
Geoff Taylor 106973c027 Removed intermediate lambda to see if it was the source of duplicate Discord notifications. 2021-05-19 11:37:44 +01:00
Geoff Taylor ce2d0d7438 Added a NotificationHandler to bridge log events to notifications. 2021-05-18 18:08:38 +01:00
Geoff Taylor 06e8e67049 More depth in parsing transactions, plus better reporting on them. 2021-05-18 15:17:14 +01:00
Geoff Taylor b80e60be37 EventSource now properly inherits from Subject. 2021-05-17 21:17:01 +01:00
Geoff Taylor f2cad71bc2 Fixed Method Resolution Order problem in Events. 2021-05-17 20:54:39 +01:00
Geoff Taylor 5707992fcb Can now send notifications, for example to Discord or Telegram. 2021-05-17 20:43:16 +01:00
Geoff Taylor 540bb5b79d Cleaned up PrintingObserverSubscriber() calls. 2021-05-17 14:17:18 +01:00
Geoff Taylor 02e272e437 Expanded TransactionScout and added new command - report-transactions. 2021-05-15 14:17:42 +01:00
Geoff Taylor c0070c2b94 Moved AccountInfo into BaseModel, moved 'fetch' methods to appropriate objects. 2021-05-14 15:51:29 +01:00
Geoff Taylor 5295121efe Added a transaction-scout command. 2021-05-14 12:32:39 +01:00
Geoff Taylor f79315201d Added TransactionScout to show Mango transaction details. 2021-05-13 20:32:23 +01:00
Geoff Taylor 0d9635ba45 PollingLiquidator optimisation - now loops and updates ripe 🥭 accounts. 2021-05-12 10:52:26 +01:00
Geoff Taylor a40b962965 Fixed dereference of group basket tokens. 2021-05-11 20:32:20 +01:00
Geoff Taylor 9b97722394 Fixed regression in importing notebook code. 2021-05-11 20:17:49 +01:00
Geoff Taylor 4cfc87d420 Split BasketTokenMetadata up. Improved linting.
* Split BasketTokenMetadata into BasketToken and Token.
* Improved linting and mypy so it worked across files.
2021-05-11 19:24:02 +01:00
Geoff Taylor 78fbb05970 Renamed SimpleLiquidator to PollingLiquidator. 2021-05-10 14:48:19 +01:00
Geoff Taylor b398990898 Added a Quickstart! A nice walkthrough of setting up a liquidator. 2021-05-08 16:01:30 +01:00
Geoff Taylor db91e1d9d8 Added a 'create-wallet' command, made other commands more consistent. 2021-05-07 10:47:01 +01:00
Geoff Taylor 013a8ce715 Added Pyston to docker image and commands.
All commands now use Pyston instead of Python as the Python interpreter. It seems a bit faster.
2021-05-06 19:06:47 +01:00
Geoff Taylor fab0d909c2 Added 'dry run' option to commands that perform transactions. 2021-05-06 15:27:25 +01:00
Geoff Taylor 3db09e922c Added wallet balancing. Big changes throughout to support this. 2021-05-06 14:21:40 +01:00
Geoff Taylor f2d4e7c13f Added Serum trading.
* Added nasty patch around pyserum bug
* OpenOrders can now provide (on-demand) the pyserum representation OpenOrdersAccount
* New context methods -unwrap_transaction_id_or_raise_exception() and random_client_id()
* Added Retrier and retry_context() function
* Added TradeExecutor and SerumImmediateTradeExecutor classes to trade on Serum
2021-05-04 17:18:09 +01:00
Geoff Taylor 9ae606b1c6 Commands now output the AccountScout report to show errors and warnings. 2021-04-29 16:33:04 +01:00
Geoff Taylor 9db61efaf5 mango-fetch can now fetch all margin accounts for a user. 2021-04-29 12:51:13 +01:00
Geoff Taylor feda91156b Fixed problem where OpenOrders could show the wrong program ID in some circumstances. 2021-04-29 12:11:28 +01:00
Geoff Taylor c5734a0624 Moved development commands to 'scripts', so 'bin' is for actual commands.
* Added log level as parameter to commands.
2021-04-29 10:53:01 +01:00
Geoff Taylor f8738770f5 Expanded liquidation process and steps. 2021-04-28 18:36:48 +01:00
Geoff Taylor 4f6890fe1c Added argument parsing to liquidator command. 2021-04-27 10:53:43 +01:00
Geoff Taylor acf2ff5da6 Renamed Classes.ipynb to BaseModel.ipynb. Adjusted all imports of it. 2021-04-27 09:41:22 +01:00
Geoff Taylor 482f759b11 Added start of a runnable 'liquidator' command. 2021-04-26 17:09:35 +01:00
Geoff Taylor 3928331cc3 Reformatted some header text and added TOC on all pages. 2021-04-22 14:28:32 +01:00
Geoff Taylor 2cc5135517 Initial import. 2021-04-14 16:51:39 +01:00