piker
piker copied to clipboard
Dark order and alert persistence
We should be able to submit a dark order and/or alert that does not clear, stop and start pikerd, ensure order is both serialized to a local db (likely file system) on pikerd shutdown and reloaded and re-registered in emsd state and the dark clearing loop on restart.
Design and impl ToDo:
- [ ] implement functionality to persist dark-orders by serializing
Orderinto atomlstyle format much like how we currently store positions and trade ledgers. - [ ] add an api to both read and write
Orderstructs to the filesystem as well as startup/teardown code inside theemsdactor to sync the clearing engine state with any offline stored entries
Testing ToDo:
- [ ] tests to verify submitted-non-cleared darks and alerts are written to file after ems shutdown
- [ ] tests to verify dark order / alert state on reboot of
emsdall via client APIs
@algorandpa probably the stuff proposed in terms of better TOML infra / libs in https://github.com/pikers/piker/issues/345 is worth linking here.
Oh, also the same idea / storage format should likely be applied for reloading "live paper" limits that were submitted but should get reloaded after the paper engine has gone through a full power cycle 😂