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
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
Geoff Taylor
e0c552ca55
Removed unused import.
2021-06-02 09:57:50 +01:00
Geoff Taylor
325aac3dab
Some tweaks to improve 5-token group handling.
2021-06-02 09:54:48 +01:00
Geoff Taylor
a239a27512
Fixed tests to use new Token constructor.
2021-06-01 19:26:33 +01:00
Geoff Taylor
e3b0d65705
Extended use of Lookups - serum buys and sells no longer need a Group.
2021-06-01 19:16:59 +01:00
Geoff Taylor
f73ee9ca19
Now use solana.tokenlist.json for token lookups.
2021-06-01 18:16:02 +01:00
Geoff Taylor
cbd42d24ae
Context can now decide to look up the group ID given a group name, instead of using the wrong default.
2021-06-01 14:08:54 +01:00
Geoff Taylor
c01c33cd7f
Fixed context for ShowGroup.
2021-06-01 12:34:53 +01:00
Geoff Taylor
9a54297842
Added warnings to FunctionObserver instead of propagating exceptions.
2021-06-01 12:08:24 +01:00
Geoff Taylor
40d5976b5f
Tried improving loading of openorders accounts.
...
* Reduced default chunk size for AccountInfo.load_multiple() to 100 since that seems to be the limit on api.rpcpool.com.
* Added ability to pause between chunks because it really doesn't like a lot of calls in a row.
* Reverted loading of openorders for ripe margin accounts in V2 to the V1 method of fetching them all in one call, because doing it in chunks of 100 just takes too long.
2021-05-28 19:38:52 +01:00
Geoff Taylor
7bf7cff474
Retry pauses now uses kangda's 4,8,16,20,30 seconds pauses.
2021-05-28 17:20:07 +01:00
Geoff Taylor
ba25e289af
Better retry functionality with backoff pauses.
2021-05-28 17:16:53 +01:00
Geoff Taylor
b6a595bb21
Updated to handle Groups with 5 tokens as well as Groups with 3 tokens.
2021-05-27 17:07:02 +01:00
Geoff Taylor
8b21f4c025
Fixed formatting of token balance in group-balances command.
2021-05-25 17:17:41 +01:00
Geoff Taylor
fefb160858
Removed unused import.
2021-05-24 14:54:06 +01:00
Geoff Taylor
30543975ee
Renamed commands to better reflect purpose. Updated Quickstart.
...
* group-buy-token to serum-buy
* group-sell-token to serum-sell
* group-send-token to send-token
2021-05-24 10:40:33 +01:00
Geoff Taylor
3b82383f1b
Fixed reference to group name in LiquidationEvent.
2021-05-21 20:40:40 +01:00
Geoff Taylor
1ba1a12310
Updated to new, shared ids.json.
2021-05-21 20:14:57 +01:00
Geoff Taylor
fcfe32d321
Fixed bug in ShowAllAccounts, refactored it to use new function to get all margin accounts.
2021-05-21 20:14:21 +01:00
Geoff Taylor
5c6abd0733
Added CsvFileNotificationTarget.
...
* Updated notifications to allow notifying on succeeded or failed (or both!) PartialLiquidate transactions.
* Added more information to LiquidationEvent to allow that to flow through to notifications.
2021-05-21 20:02:54 +01:00
Geoff Taylor
06b963e2cf
Added Mailjet notification target.
2021-05-21 15:21:02 +01:00
Geoff Taylor
8b8afe1a0b
Refactored PollingLiquidator into ReportingAccountLiquidator and LiquidationProcessor
...
* ReportingAccountLiquidator wraps an AccountLiquidator but provides before-and-after logging and reporting.
* Sped up fetch_token_prices() by reducing it to one network fetch
* Centralised loading of ripe mangoes by creating MarginAccount.load_all_ripe()
* Clearer, more consistent use of Observables
* Added RxPy Backpressure library
* Improved container building to allow for different tags
2021-05-21 14:28:42 +01:00
Geoff Taylor
6058468a99
Fixed incorrect logging.info() call in PollingLiquidator.
2021-05-21 14:25:02 +01:00
Geoff Taylor
85798a360b
Changed Quickstart title to add 'Liquidator'.
2021-05-19 16:21:22 +01:00
Geoff Taylor
0b1bf7b9f9
Fixed some debug output.
2021-05-19 13:24:24 +01:00
Geoff Taylor
106973c027
Removed intermediate lambda to see if it was the source of duplicate Discord notifications.
2021-05-19 11:37:44 +01:00
Geoff Taylor
f56c218fac
Fixed triggering of LiquidationEvent.
2021-05-19 07:53:34 +01:00
Geoff Taylor
ce2d0d7438
Added a NotificationHandler to bridge log events to notifications.
2021-05-18 18:08:38 +01:00
Geoff Taylor
06e8e67049
More depth in parsing transactions, plus better reporting on them.
2021-05-18 15:17:14 +01:00
Geoff Taylor
b80e60be37
EventSource now properly inherits from Subject.
2021-05-17 21:17:01 +01:00
Geoff Taylor
f2cad71bc2
Fixed Method Resolution Order problem in Events.
2021-05-17 20:54:39 +01:00
Geoff Taylor
5707992fcb
Can now send notifications, for example to Discord or Telegram.
2021-05-17 20:43:16 +01:00
Geoff Taylor
540bb5b79d
Cleaned up PrintingObserverSubscriber() calls.
2021-05-17 14:17:18 +01:00
Geoff Taylor
39fe1a4d24
Fixed incorrect parameter ordering in building TokenAccount.
2021-05-17 12:36:46 +01:00
Geoff Taylor
ff804204a7
Added a common base class for addressable account objects.
2021-05-17 12:04:17 +01:00
Geoff Taylor
e8668b60cf
Fixed building of PartialLiquidate instruction.
2021-05-15 14:46:26 +01:00
Geoff Taylor
02e272e437
Expanded TransactionScout and added new command - report-transactions.
2021-05-15 14:17:42 +01:00
Geoff Taylor
5aa134b767
Fixed dictionary dereference in loading a TokenAccount.
2021-05-14 16:19:35 +01:00
Geoff Taylor
c0070c2b94
Moved AccountInfo into BaseModel, moved 'fetch' methods to appropriate objects.
2021-05-14 15:51:29 +01:00
Geoff Taylor
5295121efe
Added a transaction-scout command.
2021-05-14 12:32:39 +01:00
Geoff Taylor
7f980a8b2e
Started adding some Observables code to help with common streaming and polling tasks.
2021-05-14 12:24:35 +01:00
Geoff Taylor
f79315201d
Added TransactionScout to show Mango transaction details.
2021-05-13 20:32:23 +01:00
Geoff Taylor
414a5f445b
No longer submits a PartialLiquidate if there are zero tokens to fund the liquidation.
2021-05-13 12:29:23 +01:00
Geoff Taylor
ad3f409404
Fixed bug in TradeExecutor - 'group' is an object member.
2021-05-13 08:15:51 +01:00