Geoff Taylor
92f56b5ac3
Fixed value of USDC when calculating account valuations.
2021-12-15 11:32:22 +00:00
Geoff Taylor
ee3bf5894c
Reduced group not finding a perp market to a warning instead of raising an exception.
2021-12-13 13:56:02 +00:00
Geoff Taylor
62b0332439
Removed Unicode monospaced-font rendering of class names because VSCode has started being annoying about it all. (Boo...)
2021-12-13 12:06:42 +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
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
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
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
8bf6384076
Added CollateralCalculator to calculate collateral in different market types.
2021-08-31 00:30:22 +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
162f41e2d0
Added a redeem-mango command.
2021-08-11 19:14:26 +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
cc6f62c312
Expanded use of Group and Account baskets.
2021-08-04 13:08:34 +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
ed3955cc1f
Fixed some type hints.
2021-08-01 18:03:46 +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
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
bcd56301c9
Brought changes to structs and instructions across for new group/code v3.4.
2021-07-13 12:43:50 +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
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
e16ac9cdc2
Added proper group-name lookup when fetching groups.
2021-06-28 09:48:16 +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
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
83d1702691
Added code to fetch prices from the Pyth Network.
2021-06-10 21:28:29 +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