Commit Graph

53 Commits

Author SHA1 Message Date
Geoff Taylor e87308cc22 Removed named padding entries from layouts - padding is still there but the unnecessary name no longer appears. 2022-03-15 15:43:21 +00:00
Geoff Taylor b5916fcb50 Added Account.build_redeem_pnl_instructions_for_market() to build redeem instructions.
* Simpler access is through Account.redeem_pnl_for_perp_market() and Account.redeem_all_perp_pnl()
* Added redeem-pnl command to allow redemption via command line and to show how to exercise these methods.
2022-03-14 17:47:30 +00:00
Geoff Taylor b363a3b0bb Added Keeper instructions and a keeper command. 2022-03-08 08:53:11 +00:00
Geoff Taylor 53d68eb2a3 Added build_perp_cancel_all_side_instructions() to cancel orders with a specific side. 2022-03-04 10:11:29 +00:00
Geoff Taylor ac379d5ad9 Fix for another Windows datetime problem.
* Made a more thorough check of use of datetimes throughout codebase, replaced some instances.
* Added some tests to make sure comparisons don't raise exceptions.
2022-03-02 11:23:43 +00:00
Geoff Taylor f2c84f001a Updated PerpOrderBookSide to handle new leaf node format with time_in_force. 2022-02-21 20:08:14 +00:00
Geoff Taylor cf5e91682b Implementation of Time In Force for perp orders. 2022-02-21 19:38:05 +00:00
Geoff Taylor cbbdcc05a2 Fixed referrer memory container. 2022-02-16 15:19:21 +00:00
Geoff Taylor 63e3a9dd88 Fixed problem parsing instruction data with optional parameter that wasn't available. Took advantage of this change to update a bunch of transaction rendering problems. Removed show-transaction-logs now that show-transaction shows them. 2022-02-10 11:16:51 +00:00
Geoff Taylor e0fe4e1f6f Added a show-referrer command and the ability to fetch it from the Account. 2022-02-09 20:08:17 +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 9fdccca3a3 Added reflink support in placing perp orders and with new commands register-referrer-id and set-referrer. 2022-02-09 18:31:29 +00:00
SpaceMonkey 88a246f3b9 add reduce_only flag 2022-01-27 00:14:41 +02:00
Geoff Taylor a6605b59c3 Spot OpenOrders now created using a PDA (change in Mango v3.3) 2022-01-20 12:22:59 +00:00
Geoff Taylor f1b14acdcf Added instructions and commands for account delegation. 2022-01-18 17:51:11 +00:00
Geoff Taylor f9b7d7b03f Updated Account layout for v3.3. 2022-01-18 14:35:01 +00:00
Geoff Taylor ad8f8efd47 Updated Group layout for v3.3. 2022-01-18 12:09:15 +00:00
Geoff Taylor 542143975c Changed build_create_account_instructions to use CREATE_MANGO_ACCOUNT instead of INIT_MANGO_ACCOUNT. 2022-01-18 11:25:26 +00:00
Geoff Taylor 3ef9295c31 Added CANCEL_ALL_PERPS instruction and a transaction reporter. 2022-01-14 17:18:31 +00:00
Geoff Taylor 78921bd543 Removed assertions from layouts, replaced with Exceptions. 2022-01-11 14:53:36 +00:00
Geoff Taylor cbedb3d84c Simpler, clearer approach to connection error handling. 2021-12-01 16:14:30 +00:00
Geoff Taylor d15e953ae7 Refactor of code to work with mypy --strict 2021-11-09 13:23:36 +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 4a24f3df55 Some fixes for health calculations WIP. 2021-11-04 15:36:14 +00:00
Geoff Taylor eb356f42cd Dates loaded from Mango datafiles are always UTC. 2021-10-14 11:55:45 +01:00
Geoff Taylor 22952d9ffb Now call PLACE_SPOT_ORDER_2 instead of PLACE_SPOT_ORDER. 2021-10-13 18:42:15 +01:00
Geoff Taylor 3ccca8bd01 Start of work on account calculations. 2021-10-04 18:27:07 +01:00
Geoff Taylor 58135ea101 Added a show-liquidity-mining-info command to display liquidity mining details. 2021-09-23 12:30:59 +01:00
Geoff Taylor 126cb4e288 Added airdrop command to interact with faucets. Removed requirement to use Sollet from MarketmakingQuickstart. 2021-08-30 11:33:44 +01:00
Geoff Taylor 9159d615c4 Updated dependencies and fixed subsequent issues. 2021-08-27 20:37:23 +01:00
Geoff Taylor 261848f325 Big renaming of Context properties to make them more consistent and appropriate. 2021-08-26 10:31:02 +01:00
Geoff Taylor 97a5c41a39 Updated to latest group structures and IDs. 2021-08-17 19:42:11 +01:00
Geoff Taylor 97bd857418 Updated to handle new event queue format. 2021-08-13 20:17:17 +01:00
Geoff Taylor 3403555036 Added account name/info to output. 2021-08-13 12:15:17 +01:00
Geoff Taylor 162f41e2d0 Added a redeem-mango command. 2021-08-11 19:14:26 +01:00
Geoff Taylor 7033a080bf Better logging of failing instructions. 2021-08-04 17:50:38 +01:00
Geoff Taylor efd24060a8 Added stub oracle code and cache loading. 2021-07-30 20:31:17 +01:00
Geoff Taylor 5b6d5f2291 Upgraded to new, better devnet group. 2021-07-29 12:38:34 +01:00
Geoff Taylor 072252095a Some work on streaming logs and account/program events. 2021-07-26 12:19:13 +01:00
Geoff Taylor 8fe48de527 Moved functionality into *Market objects. 2021-07-23 10:20:44 +01:00
Geoff Taylor c953ec07fc Added Perp cranking code, plus program. Expanded watch-address, added complementary show-address command. 2021-07-22 15:18:37 +01:00
Geoff Taylor 817b31f8ea Added a streaming watcher for some account types. 2021-07-21 16:35:38 +01:00
Geoff Taylor 94df52003b Changes for devnet group v3.8.
* Some struct/layout changes
* Big changes to OpenOrders handling in MarketMaker
* Serum and Spot settlement should now work as expected
2021-07-19 15:04:53 +01:00
Geoff Taylor 3ca1d7b706 Updated to new ids.json. Added deposit instruction+command. 2021-07-16 13:32:30 +01:00
Geoff Taylor bcd56301c9 Brought changes to structs and instructions across for new group/code v3.4. 2021-07-13 12:43:50 +01:00
Geoff Taylor faf514cde1 Brought up to date for new Group structures. New websocket approach. 2021-07-12 10:57:05 +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 b5c8f69ae1 Fixed Withdraw command. 2021-06-30 15:06:10 +01:00
Geoff Taylor 3e4ba1052c Initial work on placing/cancelling spot market orders. 2021-06-30 14:08:37 +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