mango-v4/programs
microwavedcola1 d51c3ee85d
release 19.1 -> deploy + serum3 open orders estimation ts patch (#719)
* Serum3 open orders: Fix health overestimation (#716)

When bids or asks crossed the oracle price, the serum3 health would be
overestimated before.

The health code has no access to the open order quantites or prices and
used to assume all orders are at oracle price.

Now we track an account's max bid and min ask in each market and use that
as a worst-case price. The tracking isn't perfect for technical reasons
(compute cost, no notifications on fill) but produces an upper bound on
bids (lower bound on asks) that is sufficient to make health not
overestimate.

The tracked price is reset every time the serum3 open orders on a book
side are completely cleared.

(cherry picked from commit 2adc0339dc)

* Changelog, version bump for program v0.19.1

* ts: ts patch for the PR

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2023-09-16 11:04:38 +02:00
..
mango-v4 release 19.1 -> deploy + serum3 open orders estimation ts patch (#719) 2023-09-16 11:04:38 +02:00
margin-trade manage dependencies in workspace (#588) 2023-05-17 20:48:14 +02:00