Commit Graph

29 Commits

Author SHA1 Message Date
Geoff Taylor 49c4353eb2 Added --account-target and --wallet-target to deposit and withdraw commands.
* Can now specify desired wallet or account balance and have the deposit or withdraw action make it so (if it can).
* Updated send-token to use same Associated Token Account creation approach as withdraw, instead of requiring an intermediate transaction - much slicker now.
2022-03-02 18:52:45 +00:00
Geoff Taylor 11a9fba065 Refactored instructions to have a more consistent naming pattern:
* build_serum_***
* build_spot_***
* build_perp_***
* build_mango_***
2022-02-28 12:10:13 +00:00
Geoff Taylor eef007758d Expanded porcelain functions, cleaned up old usage. 2022-02-24 19:40:05 +00:00
Geoff Taylor 17d2f8f8b4 Made sure commands using Context used it in a with statement. 2022-02-17 14:54:38 +00:00
Geoff Taylor 5c3b0befa9 Switched from autopep8 to black for code formatting. Reformatted all files. Updated dependencies. 2022-02-09 19:31:50 +00:00
Geoff Taylor d8ffa03491 Refactored to use mango.output() consistently instead of print(). 2022-01-11 14:36:08 +00:00
Geoff Taylor 199c39130d Moved to having Instrument as a basis for Token, to allow for perp markets with no underlying SPL token. 2021-11-08 11:39:09 +00:00
Geoff Taylor 3587ce1b26 Made mango-explorer a pip-installable package. 2021-10-11 17:08:54 +01:00
Geoff Taylor 8257902003 Removed use of pyston in commands. 2021-10-08 18:15:40 +01:00
Geoff Taylor 7c17f5cbc4 Added --log-suppress-timestamp parameter. Centralised much CLI argument handling. 2021-09-13 14:05:19 +01:00
Geoff Taylor f596d571f6 Big change - now uses our own 'Client' which handles some situations better from our point of view:
* Being able to specify commitment on the Client instead of every call.
* Better error handling (more exception details, and specific rate limiting exceptions)
* More obvious return values, instead of always having to dereference "result".
2021-08-07 15:07:19 +01:00
Geoff Taylor 8fe48de527 Moved functionality into *Market objects. 2021-07-23 10:20:44 +01:00
Geoff Taylor 5a4022b236 Wrapping SOL now creates a proper Associated Token Account if no Wrapped SOL accounts are available. 2021-07-16 18:59:19 +01:00
Geoff Taylor 3fd7e27138 Removed some debug output. 2021-07-16 17:31:25 +01:00
Geoff Taylor 19e4d948d3 Updates to allow some market making on Serum. 2021-07-13 20:01:32 +01:00
Geoff Taylor 6a15c81fa3 New approach to transactions allowing them to be split up.
* CombinableTransactions now separated out.
* CombinableTransactions are now size-aware when being executed, and will automatically split into batches for execution if they are too big.
* New MarketInstructionBuilder approach - each market type can now have its own way of building instructions for common operations.
2021-07-12 17:18:56 +01:00
Geoff Taylor bf675122ac Updated ids.json for new group. Updated Group with new structure.
* Extended mechanism for combining instructions.
* Fixed Account's calculations of deposits and borrows.
* Added net_assets to Account.
* Groups now maintain loaded RootBanks, not just PublicKeys of them.
* Fixed simple market-maker's calculation of position sizes.
2021-07-01 21:24:08 +01:00
Geoff Taylor e61a3806ba Removed all InstructionBuilders. Instead we'll use simpler functions that return an array of instructions (allowing for compound instructions etc.) 2021-06-25 17:21:53 +01:00
Geoff Taylor 5b71ffbd18 Big Rename - removal of old Group and MarginAccount, deletion of a lot of code that is no longer relevant.
* Added some TODO comments where work needs to be done but pieces are currently missing.
2021-06-25 15:50:37 +01:00
Geoff Taylor cd46c1c98b First cut at a lot of V3 code. 2021-06-25 10:33:40 +01:00
Geoff Taylor 852abdff00 Made all send_transaction() calls consistent in use of preflight commitment. 2021-06-24 11:59:57 +01:00
Geoff Taylor 206a95e39a Added type annotation for token lookups. 2021-06-23 09:44:55 +01:00
Geoff Taylor aac32ba716 Wallet can now be loaded from environment.
* Centralised configuration of Wallet from command-line
* Added loading Wallet from environment variables
* Improved command-line handling of many commands
2021-06-17 12:06:39 +01:00
Geoff Taylor 7078ef4722 Removed default context objects - now have static method on Context object: Context.default(). 2021-06-17 11:18:35 +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 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