Commit Graph

376 Commits

Author SHA1 Message Date
Geoff Taylor 59ba4894f1 Moved hedger to its own class, and re-used it as an option in marketmaker. 2021-08-23 15:36:55 +01:00
Geoff Taylor 3419c89033 Moved marketmaker to an 'orderchain' model. 2021-08-22 19:48:20 +01:00
Geoff Taylor b56d114a4a Added bids and asks to marketmaker ModelState, with watchers for latest state. 2021-08-21 22:06:58 +01:00
Geoff Taylor 191d3e644c Anything imported from pyserum should now be imported as a PySerumXYZ to avoid confusion with Mango Explorer classes. 2021-08-21 18:24:53 +01:00
Geoff Taylor 8a83c73ea8 Now run websocket connections each in their own websocket rather than using a shared one. (Shared websocket is still an option though.) 2021-08-21 16:03:13 +01:00
Geoff Taylor 153ebae2f4 Moved opening of websocket to be entirely within WebSocketSubscriptionManager. 2021-08-21 13:25:28 +01:00
Geoff Taylor 1696ead1e3 Added --quote-position-bias parameter to marketmaker. 2021-08-21 00:00:34 +01:00
Geoff Taylor f0e8738b04 Removed SPL token lookups from SpotMarketInstructionBuilder. 2021-08-19 23:32:58 +01:00
Geoff Taylor 46c768e11b Fixed loading of some context parameters. 2021-08-19 22:59:36 +01:00
Geoff Taylor 5a76874466 Updated for new group. 2021-08-19 22:23:19 +01:00
Geoff Taylor 66ccdcf63e Changed confidence_weighting in marketmaker to confidence_interval_levels. Multiple levels can now be specified, creating multiple levels of orders. 2021-08-19 17:31:17 +01:00
Geoff Taylor ec37c14d03 Added ensure-account and ensure-open-orders commands. 2021-08-19 11:00:39 +01:00
Geoff Taylor a96b67e729 Improved transaction exception reporting. 2021-08-19 09:46:54 +01:00
Geoff Taylor a51b38049b Marketmaker no longer masks errors. 2021-08-18 14:49:54 +01:00
Geoff Taylor 2bf4d07592 cancel-order can now take an --ok-if-missing parameter, and use it if the underlying market-type supports it. 2021-08-18 12:23:20 +01:00
Geoff Taylor 4c544cb68c Fixed TransactionException not properly interpreting error responses. 2021-08-17 20:45:26 +01:00
Geoff Taylor 97a5c41a39 Updated to latest group structures and IDs. 2021-08-17 19:42:11 +01:00
Geoff Taylor 847628dfd6 Fixed problem with TokenAccount commitments. 2021-08-17 19:17:09 +01:00
Geoff Taylor b408874a2a Fixed TokenAccount to be able to find or create the associated token account, or use an old-style account if it exists and the associated token account doesn't. 2021-08-17 17:52:17 +01:00
Geoff Taylor 6a61b55e93 Improved transaction exception handling. 2021-08-17 12:50:27 +01:00
Geoff Taylor d5eaa385da Removed rx.core.typing for many classes - using the actual base classes now. 2021-08-17 12:39:55 +01:00
Geoff Taylor a4ca18e5ed Added/centralised 'watchers'. Removed FileToucherObserver. Added HealthCheck. 2021-08-17 12:17:49 +01:00
Geoff Taylor 64cdebaf8d Reduced error threshold for stale prices. 2021-08-16 22:32:28 +01:00
Geoff Taylor 98acb59789 Fixed bug in handling of referral rebate. Added 'info' property to margin accounts. 2021-08-16 22:12:51 +01:00
Geoff Taylor bd36dcf47b Improved cranking and settling operations. 2021-08-16 14:43:44 +01:00
Geoff Taylor 84b664b4fd Fixed problem with instruction display. 2021-08-14 11:09:27 +01:00
Geoff Taylor 255d3a70df Added a mint command for devnet use. 2021-08-13 21:34:17 +01:00
Geoff Taylor 140270b870 Fixed text output of liquidate event. 2021-08-13 20:20:03 +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 94c6fa149e Sometimes Solana returns 'err' as a string instead of an array of strings. 2021-08-09 21:07:21 +01:00
Geoff Taylor 9bd75dc8d2 Websocket now has a force_reconnect() method, plus subscribable disconnect event. 2021-08-09 13:24:33 +01:00
Geoff Taylor 9b6f33d7e6 Added --name parameter to programs and context to allow better reporting of errors. 2021-08-09 10:27:47 +01:00
Geoff Taylor aa4406d68f Fixed account output/reporting. 2021-08-07 18:42:39 +01:00
Geoff Taylor e890490557 Backported custom Client from V3 to make sure 'processed' commitment is used consistently, even by code that isn't ours. 2021-08-07 15:10:06 +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 613d964051 Perp Accounts accrue benefits in MNGO so improved handling of it. 2021-08-05 15:35:08 +01:00
Geoff Taylor 7033a080bf Better logging of failing instructions. 2021-08-04 17:50:38 +01:00
Geoff Taylor cc6f62c312 Expanded use of Group and Account baskets. 2021-08-04 13:08:34 +01:00
Geoff Taylor f4af201d3e Fixed cranking use of openorders accounts in marketmaker. 2021-08-03 19:51:25 +01:00
Geoff Taylor d5f8e1d7da Turning off running marketmaking using individual transactions. 2021-08-03 18:44:05 +01:00
Geoff Taylor 88fa2181d2 Change Group to use a more basket-orientated approach instead of multiple properties requiring indexes. 2021-08-03 18:32:12 +01:00
Geoff Taylor c90ff010d3 Improved how accounts handle their basket of tokens. 2021-08-03 12:40:00 +01:00
Geoff Taylor 1b87591ae7 Improved context handling of skip_preflight. 2021-08-03 09:14:22 +01:00
Geoff Taylor 0bcf5cfc5a Improved market output. 2021-08-03 09:13:56 +01:00
Geoff Taylor 2840f52fde Fixed stub oracle price now the server stub oracle has been updated. 2021-08-03 09:08:47 +01:00
Geoff Taylor 7e7c21c0aa Marketmaker no longer tries to run instructions in parallel. (I hope this is a temporary fix.) 2021-08-02 17:48:20 +01:00
Geoff Taylor 6f86e83160 Simplified watching. Added inventory watchers. 2021-08-02 17:14:00 +01:00
Geoff Taylor 18935be67e Fixed spot market crank. 2021-08-02 17:13:50 +01:00
Geoff Taylor ed3955cc1f Fixed some type hints. 2021-08-01 18:03:46 +01:00
Geoff Taylor ba56bdd9f5 Improved event queue handling. Now split incoming events into processed and unprocessed, and changed 'seen' handling to use sequence_number. 2021-08-01 17:47:45 +01:00
Geoff Taylor ca3193e0b6 Added account indexing to commands that need it. 2021-07-31 14:43:39 +01:00
Geoff Taylor b734eeb6cc Fixed linting problems in stub oracle. 2021-07-31 13:37:26 +01:00
Geoff Taylor 2a03f60c3b Fixed incorrect comment. 2021-07-30 22:41:39 +01:00
Geoff Taylor efd24060a8 Added stub oracle code and cache loading. 2021-07-30 20:31:17 +01:00
Geoff Taylor 321dd2142a Fixed comment in Serum oracle. 2021-07-30 18:09:54 +01:00
Geoff Taylor 7cfc1b76ba Added more logging to watch-minimum-balances. 2021-07-30 17:41:15 +01:00
Geoff Taylor d3b0c48528 Marketmaker now automatically creates required Spot OpenOrders if it doesn't exist. 2021-07-30 15:41:47 +01:00
Geoff Taylor 45343e4470 Spot place order now auto-creates OpenOrders in same transaction, and updates loaded Account instance. 2021-07-30 09:35:05 +01:00
Geoff Taylor b75c59599f Removed debug statements. 2021-07-29 16:22:27 +01:00
Geoff Taylor e721d6c8e8 Improved Group and Account output. Tied OpenOrders and PerpOpenOrders together with a PlacedOrdersContainer protocol. 2021-07-29 16:19:52 +01:00
Geoff Taylor 5b6d5f2291 Upgraded to new, better devnet group. 2021-07-29 12:38:34 +01:00
Geoff Taylor 8af5bbb05a Fixed problem in quantity_lots_to_value() calculation. 2021-07-28 18:07:47 +01:00
Geoff Taylor ab3657958d Added hedger command. Had to introduce a LotSizeConverter - may expand its use now it's available. 2021-07-28 17:43:58 +01:00
Geoff Taylor 373392cf78 Updated place_order() method to take an Order instead of separate parameters. 2021-07-28 15:29:24 +01:00
Geoff Taylor d7f117175f Changed RX subscribe_on to observe_on. 2021-07-28 12:52:29 +01:00
Geoff Taylor ac25b08668 Removed max charge from ConfidenceIntervalDesiredOrdersBuilder, added a confidence weight to allow tuning aggressiveness. 2021-07-28 11:05:52 +01:00
Geoff Taylor d739248ec6 Better handling of unseen events in PerpEventQueue. 2021-07-27 21:49:27 +01:00
Geoff Taylor c874b83221 Can now explicitly pick Pyth oracle on mainnet-beta or devnet. 2021-07-26 18:07:56 +01:00
Geoff Taylor 2818fb46d2 Fixed problem with position size in ConfidenceIntervalDesiredOrdersBuilder. 2021-07-26 16:16:00 +01:00
Geoff Taylor f3546ee217 Added ConfidenceIntervalDesiredOrdersBuilder. 2021-07-26 15:47:57 +01:00
Geoff Taylor 3b23f7e4e7 Added 'confidence' to oracles so marketmaker could access Pyth confidence intervals. 2021-07-26 13:42:03 +01:00
Geoff Taylor 072252095a Some work on streaming logs and account/program events. 2021-07-26 12:19:13 +01:00
Geoff Taylor eb244a2167 Renamed PerpMarket to PerpMarketDetails, and PerpsMarket to PerpMarket to be consistent with SerumMarket and SpotMarket. Improved market stub handling. 2021-07-23 14:18:26 +01:00
Geoff Taylor d22a09f208 Added market 'stubs' to allow for delayed loading of markets. 2021-07-23 11:42:22 +01:00
Geoff Taylor 8fe48de527 Moved functionality into *Market objects. 2021-07-23 10:20:44 +01:00
Geoff Taylor 3738ff820e Better logging of Orders. 2021-07-22 18:44:23 +01:00
Geoff Taylor fb0151191f Added some more logging to MarketMaker. 2021-07-22 18:03:17 +01:00
Geoff Taylor 107177ee86 Added execute_and_continue_on_failures() to allow MarketMaker to more instructions even if some fail. 2021-07-22 17:54:48 +01:00
Geoff Taylor add1e4580d Added better formatting for Order output. 2021-07-22 17:54:16 +01:00
Geoff Taylor 7ddc61a3e3 Fixed linting problems. 2021-07-22 15:58:00 +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 f8e8480085 Trying a different approach with unknown orders in the marketmaker - now they should be cancelled. 2021-07-21 16:34:47 +01:00
Geoff Taylor c11aececd9 Fixed Serum cranking to be more complete. 2021-07-21 14:31:04 +01:00
Geoff Taylor 56232c44cf Better exception detail on failed liquidations. 2021-07-20 10:54:17 +01:00
Geoff Taylor 0166b5e371 MarketMaker now takes an optional OrderType parameter. 2021-07-20 10:24:05 +01:00
Geoff Taylor be1ba45921 Fixed problem with marketmaker raising an exception when it didn't recognise an order. Now it should just log a warning and move on. 2021-07-19 18:38:55 +01:00
Geoff Taylor dfa9369f87 Trying to stop solanaweb from polluting error notifications. 2021-07-19 18:36:08 +01:00
Geoff Taylor f7aeafa3c5 Trying to stop solanaweb from polluting error notifications. 2021-07-19 18:29:55 +01:00
Geoff Taylor 9c824f502f Fixed linting problem. 2021-07-19 16:43:06 +01:00
Geoff Taylor 605f3bd1e2 Perp market maker no longer tries to run Consume Events. 2021-07-19 16:40:47 +01:00
Geoff Taylor c5cd5ca095 MarketMaker now exits cleanly on Control-C (SIG_TERM). 2021-07-19 15:14:00 +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 bbea9594d1 Fixed failing test. 2021-07-17 14:06:18 +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 30d4b01a37 Moved SimpleMarketMaker to its own directory+package. 2021-07-16 17:29:48 +01:00
Geoff Taylor 040eadcb90 Made marketmaker a bit more configurable, and it now publishes pulse completion and errors. 2021-07-16 14:26:42 +01:00
Geoff Taylor 3ca1d7b706 Updated to new ids.json. Added deposit instruction+command. 2021-07-16 13:32:30 +01:00
Geoff Taylor 436237a949 Fixed linting problems. 2021-07-16 11:54:13 +01:00
Geoff Taylor 7db8326a7c More realistic market-maker is now available. 2021-07-15 21:03:22 +01:00
Geoff Taylor 9960713d7d Fixed use of backslash in regular expressions. 2021-07-14 18:28:48 +01:00
Geoff Taylor bbcf3d35ce Changed the way SimpleMarketMaker calculates position sizes to be in line with what it has on each side instead of the total. 2021-07-14 18:22:36 +01:00
Geoff Taylor ec051037d4 Fixed Serum oracle to work better with Serum prices when the code itself is not on mainnet. 2021-07-14 16:34:10 +01:00
Geoff Taylor 9ae3e8a327 Fixed oracles for perp market symbols. 2021-07-14 15:51:32 +01:00
Geoff Taylor fd7c045d37 Updated health check pings to use the prefix /var/tmp/mango_healthcheck_ 2021-07-14 14:17:14 +01:00
Geoff Taylor 9f99ecf650 Updated SimpleMarketMaker so it could run well against pure Serum markets. 2021-07-14 14:03:51 +01:00
Geoff Taylor 2f01d8adf0 Added crank and settle calls when cancelling Serum orders. 2021-07-13 20:47:37 +01:00
Geoff Taylor caf4947a5e Removed extraneous print statements. 2021-07-13 20:27:35 +01:00
Geoff Taylor 19e4d948d3 Updates to allow some market making on Serum. 2021-07-13 20:01:32 +01:00
Geoff Taylor 33c2c421db Fixed problem with simple market maker creating too many orders. 2021-07-13 15:16:39 +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 82405cfec1 Updated Serum and Spot instructions builders to properly crank and settle. 2021-07-12 20:29:41 +01:00
Geoff Taylor a00738a67c Added DesiredOrdersBuilder and a couple of basic implementations. 2021-07-12 20:09:36 +01:00
Geoff Taylor 80886c106c All MarketOperations now properly use their equivalent MarketInstructionBuilder for building instructions. 2021-07-12 18:26:35 +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 faf514cde1 Brought up to date for new Group structures. New websocket approach. 2021-07-12 10:57:05 +01:00
Geoff Taylor fa28fe4209 Fixed problem fetching transactions for report. Reversed order of output of transactions so it appears better in notifications. 2021-07-07 19:59:27 +01:00
Geoff Taylor 6977d632b0 Fixed problem fetching transactions for report. Reversed order of output of transactions so it appears better in notifications. 2021-07-07 19:58:28 +01:00
Geoff Taylor 79a13f0e06 Report transactions now insists on a report.state file, and reads from it now instead of taking a separate parameter. 2021-07-07 15:06:24 +01:00
Geoff Taylor fb874dae94 Report transactions now insists on a report.state file, and reads from it now instead of taking a separate parameter. 2021-07-07 15:02:57 +01:00
Geoff Taylor 12c07cab7e Added target address to transaction report output. 2021-07-07 12:28:50 +01:00
Geoff Taylor d794326f14 Added target address to transaction report output. 2021-07-07 12:21:31 +01:00
Geoff Taylor 9e706c1d91 (Temporarily?) removed Settle from Spot order placement because it stopped working. 2021-07-01 22:10:52 +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 8860263346 Fixed problem placing spot orders. 2021-06-30 16:16:02 +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 e16ac9cdc2 Added proper group-name lookup when fetching groups. 2021-06-28 09:48:16 +01:00
Geoff Taylor 888994424d Improved reporting of TokenValue and BalanceSheet, in line with V2 changes. 2021-06-26 18:24:07 +01:00
Geoff Taylor bbd8cc487e Added a --fetch-prices option to show-margin-account. 2021-06-26 18:11:16 +01:00
Geoff Taylor 42181c10d5 Shifted error handling in SimpleMarketMaker. 2021-06-25 17:58:27 +01:00
Geoff Taylor 857d033572 Added compound instruction builder for placing Serum orders, cranking and settling all in one go. 2021-06-25 17:52:22 +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 b8dc12a3e6 Separated out token and market lookups. 2021-06-25 11:10:41 +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 f4e034a943 Added 'processed' commitment to client calls where it was missing. 2021-06-23 11:36:35 +01:00
Geoff Taylor 206a95e39a Added type annotation for token lookups. 2021-06-23 09:44:55 +01:00
Geoff Taylor 9e5b54b6bd Shift representation of max input amount. 2021-06-23 09:14:04 +01:00
Geoff Taylor 3d3577023c Continue liquidating accounts that are liquidatable even if they're above maint_coll_ratio. 2021-06-22 20:36:31 +01:00
Geoff Taylor 72a64a322e Updated failed liquidation message to include liquidator name. 2021-06-22 10:25:06 +01:00
Geoff Taylor f7bd67308e Improved AccountInfo.load_multiple and made better use of it fetching updated prices. 2021-06-22 09:43:31 +01:00
Geoff Taylor 5fc7aa7868 Added better health management of LiquidationProcessor. 2021-06-21 11:06:26 +01:00
Geoff Taylor 858cee248b Now uses ReportingAccountLiquidator even when using NullAccountLiquidator. 2021-06-19 19:55:23 +01:00
Geoff Taylor fab659c244 Improved access to market lookup data.
* Abstracted MarketLookup from SpotMarketLookup, because not all markets need be 'spot'.
* Made MarketLookup accessible from Context.
2021-06-18 13:50:33 +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 198054ad09 Changed message that appears on liquidation filtering. 2021-06-16 20:54:11 +01:00
Geoff Taylor 31a476cbb1 Fixed some lint problems. 2021-06-16 20:50:25 +01:00
Geoff Taylor 90d6c54552 Fixed problem switching cluster on command line using just cluster name. 2021-06-16 20:38:00 +01:00
Geoff Taylor d0595b8673 Updated SimpleMarketMaker based on suggestions from Brian.
* Cleans up existing orders on startup, in case recovering from a previous crash.
* Can now leave existing orders in place (instead of cancelling and creating fresh) if price and size are within tolerance.
2021-06-16 12:06:12 +01:00
Geoff Taylor 81f386f114 Introduced a SimpleMarketMaker. 2021-06-15 23:30:11 +01:00
Geoff Taylor c4c92f2851 Changed default group name from BTC_ETH_USDT to BTC_ETH_SOL_SRM_USDC. 2021-06-15 17:32:26 +01:00
Geoff Taylor 0fae7679f7 Separated out logic to determine liquidatability of margin account into a more testable setup. 2021-06-15 17:30:25 +01:00
Geoff Taylor ceaae48ddf Moved Pyth Network oracle code to V2 now that they're providing prices there. 2021-06-15 11:57:28 +01:00
Geoff Taylor 23aed252d4 Fixed problem where margin account balances had index applied twice. 2021-06-13 22:54:21 +01:00
Geoff Taylor 36446c2567 Fixed problem passing empty OpenOrders accounts in instructions. 2021-06-13 22:02:02 +01:00
Geoff Taylor 5bbac07d0c Updated LiquidationProcessor to take referrer_rebate_accrued into account.
* Added referrer_rebate_accrued to assets in calculations.
* Added some unit tests on liquidation calculations.
2021-06-13 20:34:17 +01:00
Geoff Taylor a491d1d851 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
Geoff Taylor 6b4ea5925d Added FTX price oracle. 2021-06-12 14:21:07 +01:00
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 8e470ad94e Now applies serum fee discount address to Serum orders, if an SRM token account is available. 2021-06-09 15:20:13 +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 a637f79feb Fixed problem switching context from 3-token group to 5-token group. 2021-06-08 16:27:04 +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 d92a28f635 LiquidationProcessor now records timestamp of last price and margin accounts updates.
* Will log warning if margin accounts are over 5 minutes out of date
* Will log error if margin accounts are over 10 minutes out of date
2021-06-07 20:35:26 +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