Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLOB-1009] - Allow FINAL_SETTLEMENT, and cancel open stateful orders (…
…#829) * add protos for final settlement clob pair status and final settlement removal reason * implement cancellation of open stateful orders for final settlement clob pairs upon acceptance of gov proposal * format * pr nits * pr nits * [CLOB-1010] final settlement checktx validation (#842) * checktx logic to reject order placements for final settlement markets * fix test with incorrect order * [CLOB-1017] final settlement deleveraging step in PrepareCheckState (#848) * add functionality in ProcessDeleveraging to allow settlement at oracle price instead of bankruptcy price * pull deltaQuoteQuantums out of ProcessDeleveraging * fix lint * fix issue with test * pr nits * update getDeleveragingQuoteQuantumsDelta helper * initial implementation of final settlement deleveraging * add delivertx logic for deleveraging match * update to have DeliverTx calculate price based off of IsFinalSettlement flag instead of calculating implicitly based off of clob pair status, and update indexer deleveraging event so we can send isFinalSettlement flag * update delivertx validation * allow final settlement subaccounts to be deleveraged by regular deleveraging flow * remove superfluous comment * update err name * fix import formatting * lint * begin adding tests * update logic so that isFinalSettlement flag on operation is used * re-use helper function * pr nits, redefine CanDeleverageSubaccount * update tests for CanDeleverageSubaccount * split up PCS steps 6 and 7 to be for liquidations and then for deleveraging * update to use new subaccountOpenPositionInfo type * update tests * pr nits * lint * formatting * nits and tests * more nits and comment updates * [CLOB-1021] final settlement DeliverTx validation to block trading (#834) * add missing indexer constants * update proto formatting * fix indexer test * set up ground work for allowing only deleveraging events for final settlement markets * test trading is blocked in process proposer operations for final settlement * update comments * add DeliverTx tests for process operations final settlement deleveraging operations * pr nits * nit * merge from upstream * format * update test to verify transitions from a status to itself is accepted * fix defer statement with latency metric * pr nits
- Loading branch information