piker icon indicating copy to clipboard operation
piker copied to clipboard

Dark order and alert persistence

Open algorandpa opened this issue 2 years ago • 2 comments

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 Order into a toml style format much like how we currently store positions and trade ledgers.
  • [ ] add an api to both read and write Order structs to the filesystem as well as startup/teardown code inside the emsd actor 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 emsd all via client APIs

algorandpa avatar Feb 16 '23 19:02 algorandpa

@algorandpa probably the stuff proposed in terms of better TOML infra / libs in https://github.com/pikers/piker/issues/345 is worth linking here.

goodboy avatar Feb 21 '23 02:02 goodboy

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 😂

goodboy avatar May 25 '23 22:05 goodboy