Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jakob-dydx committed Dec 4, 2023
1 parent fef60bf commit 4050771
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions protocol/x/clob/keeper/process_operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,8 @@ func TestProcessProposerOperations(t *testing.T) {
},
expectedError: types.ErrOperationConflictsWithClobPairStatus,
},
// Liquidations are disallowed for markets in final settlement because they may result
// in a position increasing in size. This is not allowed for markets in final settlement.
"Fails with ClobMatch_MatchPerpetualLiquidation for market in final settlement": {
perpetuals: []*perptypes.Perpetual{
&constants.BtcUsd_100PercentMarginRequirement,
Expand Down Expand Up @@ -1505,6 +1507,8 @@ func TestProcessProposerOperations(t *testing.T) {
},
expectedError: types.ErrOperationConflictsWithClobPairStatus,
},
// Deleveraging is allowed for markets in final settlement to close out all open positions. A deleveraging
// event with IsFinalSettlement set to false represents a negative TNC subaccount in the market getting deleveraged.
"Succeeds with ClobMatch_MatchPerpetualDeleveraging, IsFinalSettlement is false for market in final settlement": {
perpetuals: []*perptypes.Perpetual{
&constants.BtcUsd_100PercentMarginRequirement,
Expand Down Expand Up @@ -1547,6 +1551,9 @@ func TestProcessProposerOperations(t *testing.T) {
constants.Dave_Num0: {},
},
},
// Deleveraging is allowed for markets in final settlement to close out all open positions. A deleveraging
// event with IsFinalSettlement set to true represents a non-negative TNC subaccount having its position closed
// at the oracle price against other subaccounts with open positions on the opposing side of the book.
// "Succeeds with ClobMatch_MatchPerpetualDeleveraging, IsFinalSettlement is true for market in final settlement": {},
}

Expand Down

0 comments on commit 4050771

Please sign in to comment.