Commit Graph

354 Commits

Author SHA1 Message Date
Geoff Taylor e3f1939287 Added MaximumQuantityElement and MinimumQuantityElement. 2021-11-18 12:51:57 +00:00
Geoff Taylor f8db78a630 Added a TopOfBookElement to the marketmaker. 2021-11-17 18:45:57 +00:00
Geoff Taylor 88b0198f13 Added faster calculation for transaction size - running it and original method together for now for comparison. 2021-11-17 17:27:42 +00:00
Geoff Taylor c837b21e7e Fixed use of version command in docker. 2021-11-16 18:58:57 +00:00
Geoff Taylor 4b517bd614 Trying to improve visibility of version information. 2021-11-16 18:01:44 +00:00
Geoff Taylor e171b57445 Initial work on show-funding-rates. 2021-11-15 20:39:29 +00:00
Geoff Taylor 5f7bd3c04c Added interest rate calculations. Moved TokenInfo to TokenBank. 2021-11-13 19:23:11 +00:00
Geoff Taylor dce252ee1f Fixed problem depositing and withdrawing shared quote token. 2021-11-12 19:31:24 +00:00
Geoff Taylor 88cb2fcdd4 Refactored Group and Account to remove requirement for Group to load all Root Banks. 2021-11-11 11:56:29 +00:00
Geoff Taylor 393ff6a899 Added unit tests for slot accessors in Group and Account. 2021-11-10 17:46:54 +00:00
Geoff Taylor 4b3c1eecd9 Fixed problem accessing quote root bank. 2021-11-09 21:21:13 +00:00
Geoff Taylor 3f4ec995f0 Group and Account slots now contain their own matching indices. 2021-11-09 21:08:06 +00:00
Geoff Taylor e2d0853d3f Fixed problem finding market index by instrument. 2021-11-09 20:15:43 +00:00
Geoff Taylor 01cfae7fa4 Fixed problems with redeem-mango 2021-11-09 19:54:50 +00:00
Geoff Taylor d15e953ae7 Refactor of code to work with mypy --strict 2021-11-09 13:23:36 +00:00
Geoff Taylor 0970028232 Fixed TokenInfo's use of Instrument. 2021-11-08 12:56:07 +00:00
Geoff Taylor e69e60b3ed Refactored MarketOperations and MarketInstructionBuilder. 2021-11-08 12:43:11 +00:00
Geoff Taylor 01e121ad49 Refactored SpotMarketInfo and PerpMarketInfo. 2021-11-08 11:54:50 +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 a41a63da14 Fixes to allow a perp market with no spot market. 2021-11-01 18:41:31 +00:00
Geoff Taylor b06bf591da Start of work on more user-friendly account valuation. 2021-11-01 16:16:54 +00:00
Geoff Taylor 27c5e676f3 Refactored notifications. 2021-10-28 12:19:18 +01:00
Geoff Taylor 500cff9632 Fixed PerpMarketDetails behaviour when there is no liquidity mining ongoing. 2021-10-28 11:54:29 +01:00
Geoff Taylor 56599a1037 Added OrderBook instead of passing around bids and asks. Added it to ModelState too, and cleaned up usage. 2021-10-26 18:45:04 +01:00
Geoff Taylor c2615218e3 Made more marketmaker Elements work with order 'levels' and take multiple values for different levels. 2021-10-24 16:09:07 +01:00
Geoff Taylor efbc3fb28e Added some debug lines to clarify a canking problem. 2021-10-23 17:40:16 +01:00
Geoff Taylor c17d04152b FixedPositionSizeElement can now take multiple fixed position sizes and properly apply them. 2021-10-23 13:44:30 +01:00
Geoff Taylor ca1c114371 Updated AfterAccumulatedDepthElement to take depth and adjustment parameters. 2021-10-22 15:31:31 +01:00
Geoff Taylor e32e5043cf Fixed problem with SOL collateral calculations. 2021-10-21 20:18:57 +01:00
Geoff Taylor 7f300f6ee0 Added more debug information for MinimumChargeElement. 2021-10-21 19:57:01 +01:00
Geoff Taylor 6bbf30d271 Added NodeBank to accountconverter so show-address will work with it. 2021-10-19 17:55:47 +01:00
Geoff Taylor 57b7e4e99c Cleaned up call to PLACE_SPOT_ORDER_2 using fee discount address. 2021-10-19 14:17:55 +01:00
Geoff Taylor 4bcabbffa6 Fixed problem with importing mango package preventing successful running of logging.basicConfig() after. 2021-10-19 12:28:54 +01:00
Geoff Taylor c578892bd2 Fixed problem with estimated end time of period in liquidity mining info. 2021-10-18 16:40:41 +01:00
Geoff Taylor c7090bfb95 Fixed UTC timezone issue in PerpMarketDetails. 2021-10-16 12:50:10 +01:00
Geoff Taylor 84173b65c9 Added some basic IDL parsing so code can expand log messages with events. 2021-10-15 20:37:43 +01:00
Geoff Taylor 69f2fd49d6 Added --hedging-target-balance parameter to marketmaker. 2021-10-15 17:27:09 +01:00
Geoff Taylor 92c09a0a1b Fixed perp placement of POST_ONLY_SLIDE orders. 2021-10-15 15:27:03 +01:00
Geoff Taylor 6aa28b0897 Added POST_ONLY_SLIDE order type. 2021-10-15 14:34:32 +01:00
Geoff Taylor 5200add28f Added BiasQuoteElement as possible marketmaker chain element. 2021-10-15 14:21:54 +01:00
Geoff Taylor eb356f42cd Dates loaded from Mango datafiles are always UTC. 2021-10-14 11:55:45 +01:00
Geoff Taylor b46d6bd0d2 Added QuoteSingleSideElement for marketmaker. 2021-10-14 09:42:09 +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 6bdafd8805 Fixed warning on possibly-missing fee discount address. 2021-10-12 15:58:52 +01:00
Geoff Taylor 5cdb3ab9a7
Merge pull request #7 from nathan7432/main
specify encoding as utf-8 when reading json files
2021-10-12 15:37:21 +01:00
Nathan Pirhalla ad9dd78c1a specify encoding as utf-8 2021-10-12 09:53:54 -04:00
Geoff Taylor f6f1f0bc1a Added devnet MSRM details. Fixed passing of MSRM vault if it's being used. 2021-10-12 11:22:32 +01:00
Nathan Pirhalla fe6c208607 fix error when opening json file 2021-10-11 14:39:03 -04:00
Geoff Taylor 3587ce1b26 Made mango-explorer a pip-installable package. 2021-10-11 17:08:54 +01:00
Geoff Taylor defbfd8c89 Cleaned up OrderChain Element construction. 2021-10-08 19:55:38 +01:00
Geoff Taylor 8257902003 Removed use of pyston in commands. 2021-10-08 18:15:40 +01:00
Geoff Taylor 1e3ed32fe4 Fixed data file handling to allow Nuitka compilation. 2021-10-08 17:30:20 +01:00
Geoff Taylor 747e9e2006 Updated ids.json with usable public node. Added code to find ids.json in different possible locations. 2021-10-07 17:05:43 +01:00
Geoff Taylor 64817c739a Improved perp-to-spot hedging, added documentation on hedging. 2021-10-06 15:39:41 +01:00
Geoff Taylor 19f6a79d52 Added ability of ratios and minimumcharge elements to work with bid+ask instead of mid price. 2021-10-05 20:43:56 +01:00
Geoff Taylor 930aaef449 Updated RootBank output rounding (only applies to display). 2021-10-05 11:21:13 +01:00
Geoff Taylor a02f8f54aa Added simple RootBank parsing tests. 2021-10-05 10:47:41 +01:00
Geoff Taylor 3ccca8bd01 Start of work on account calculations. 2021-10-04 18:27:07 +01:00
Geoff Taylor 26aabd23e9 Simplified and improved marketmaker hedging. 2021-10-02 12:28:16 +01:00
Geoff Taylor 2f11f99b18 Improved some exception messages and handling. 2021-10-01 14:51:39 +01:00
Geoff Taylor 6306e1e65a Improved model state and marketoperations. Some work on hedging. 2021-09-30 18:53:33 +01:00
Geoff Taylor 5c0fc63151 Fixed exception message. 2021-09-30 14:21:58 +01:00
Geoff Taylor 1d38327d88 Trying to clean up exception details in logging by re-using the raised transaction on BlockhashNotFound. 2021-09-30 14:04:31 +01:00
Geoff Taylor 0fcd5924d8 Made exceptions more detailed and consistent. 2021-09-30 12:08:01 +01:00
Geoff Taylor 4310a91c4b Debug logging now outputs the version details. 2021-09-30 11:54:43 +01:00
Geoff Taylor 59936b08d5 Added distinctness to fetching blockhashes, if caching. 2021-09-30 11:23:33 +01:00
Geoff Taylor 68e31dbfcb Added BlockhashNotFoundException and NodeIsBehindException to make it easier for client code to shift behaviour when these situations arise. 2021-09-30 10:48:55 +01:00
Geoff Taylor 0600450f01 Better debug output of context and arguments. 2021-09-30 08:54:12 +01:00
Geoff Taylor 90dd111c95 Fixed problem calculating top bid. 2021-09-29 18:59:28 +01:00
Geoff Taylor 66e137e726 Fixed bug where PreventPostOnlyCrossingBookElement wouldn't change orders if there wasn't both a top bid and a top ask. 2021-09-29 18:03:25 +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 71ecc5faef Fixed minimumcharge to correctly handle bids/asks that cross the mid-price. Re-ordered default chain so that minimumcharge is enforced before biasing. 2021-09-22 17:30:29 +01:00
Geoff Taylor 3ac729ac5c Updated show-token-balance to work with any wallet address and mint. 2021-09-16 17:40:19 +01:00
Geoff Taylor 43be1fa192 Can now use a separate commitment for fetching the recent blockhash. 2021-09-16 15:36:52 +01:00
Geoff Taylor 47dcfae63d Added base64+zstd as a compression option for encoding. 2021-09-15 20:44:28 +01:00
Geoff Taylor 9f74952444 Added --encoding parameter. 2021-09-15 19:27:07 +01:00
Geoff Taylor 8659ebb6fc Removed some debugging information. 2021-09-14 17:24:22 +01:00
Geoff Taylor 8596a4aa58 Fixed spot fee discount address to use MSRM or SRM vault. 2021-09-13 16:15:20 +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 4310cc7e2a Brought V2 changes to get_multiple_accounts() across to V3. 2021-09-13 12:17:19 +01:00
Geoff Taylor 5aae1f5aab Improved output of instructions when over 1232-byte limit. 2021-09-09 19:02:17 +01:00
Geoff Taylor fe6af5f2b3 Fixed problem with lot size conversion and rounding. 2021-09-09 17:17:23 +01:00
Geoff Taylor 8c42537572 Updated SpotCollateralCalculator to take tokens in OpenOrders into account. 2021-09-09 14:10:34 +01:00
Geoff Taylor 70a038ffd9 Added a --blockhash-cache-duration parameter. 2021-09-07 21:44:48 +01:00
Geoff Taylor ce25003a2c Added caching to get_recent_blockhash(). 2021-09-07 21:12:37 +01:00
Geoff Taylor e6eaeaeed1 Now use a monotonic time (in milliseconds, with collision avoidance) for client IDs to help with some other systems. 2021-09-07 19:07:22 +01:00
Geoff Taylor 75be37fbd9 Repurposed 'sweep' as a more general 'balance-account' command. Moved 'group-balance-wallet' to just 'balance-wallet' to be similar in concept. 2021-09-07 18:40:34 +01:00
Geoff Taylor b4406a13d9 sweep command now takes a target balance. 2021-09-06 21:38:12 +01:00
Geoff Taylor 53207d1d98 FTX oracle no longer tries to interfere with PERP market names. 2021-09-06 19:26:45 +01:00
Geoff Taylor 920ac364af Fixed incorrect error message in argument exception. 2021-09-06 18:21:38 +01:00
Geoff Taylor f4af4960d7 Added new OrderChain elements. Removed Serum oracle and added Market oracle (which includes Serum oracle functionality plus more). Expanded chain documentation and added oracle documentation. 2021-09-06 17:07:26 +01:00
Geoff Taylor 2a424aa2d1 Added sweep command to sell all tokens in a market. 2021-09-02 18:51:43 +01:00
Geoff Taylor 8624afabdc Replaced command switch --account-index with --account-address because of inconsistent results when fetching multiple accounts - they could come back with different indices. 2021-09-02 17:19:17 +01:00
Geoff Taylor 71ba03935f Added send_transaction response to debug log. 2021-09-02 15:23:53 +01:00
Geoff Taylor 652296856b Added some logging to head elements of orderchain. 2021-09-02 13:30:53 +01:00
Geoff Taylor 1d4e24ea38 ModelState now tracks current orders on the orderbook directly, rather than using OpenOrders. 2021-09-02 13:11:35 +01:00
Geoff Taylor 39c591fc6f Made order chain more configurable, added MarketmakingOrderChain to docs. 2021-09-02 12:01:41 +01:00
Geoff Taylor d7b36c355c Now uses a fresh ThreadPoolScheduler every time instead of one per Context. 2021-09-02 08:30:06 +01:00
Geoff Taylor 86f7933bcb Fixed problem calculating the proper tick under/over the top orderbook prices. 2021-09-01 18:33:38 +01:00