Skip to content

Commit fc042e1

Browse files
TEMPORARY FIX: SKIP ALL LIQUIDATIONS FOR CLOB PAIR 181 (backport #3137) (#3138)
Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange> Co-authored-by: shrenujb <98204323+shrenujb@users.noreply.github.com>
1 parent 0e878fa commit fc042e1

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

protocol/x/clob/keeper/liquidations.go

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,21 @@ func (k Keeper) LiquidateSubaccountsAgainstOrderbook(
122122
return nil, err
123123
}
124124

125-
optimisticallyFilledQuantums, _, err := k.PlacePerpetualLiquidation(ctx, *liquidationOrder)
126-
// Exception for liquidation which conflicts with clob pair status. This is expected for liquidations generated
127-
// for subaccounts with open positions in final settlement markets.
128-
if err != nil && !errors.Is(err, types.ErrLiquidationConflictsWithClobPairStatus) {
129-
log.ErrorLogWithError(
130-
ctx,
131-
"Failed to liquidate subaccount",
132-
err,
133-
"liquidationOrder", *liquidationOrder,
134-
)
135-
return nil, err
125+
optimisticallyFilledQuantums := satypes.BaseQuantums(0)
126+
// TEMPORARY: ONLY FOR FARTCOIN (CLOB PAIR ID 181) SKIP LIQUIDATIONS AND GO TO DELEVERAGING
127+
if !(liquidationOrder.GetClobPairId().ToUint32() == 181) {
128+
optimisticallyFilledQuantums, _, err = k.PlacePerpetualLiquidation(ctx, *liquidationOrder)
129+
// Exception for liquidation which conflicts with clob pair status. This is expected for liquidations generated
130+
// for subaccounts with open positions in final settlement markets.
131+
if err != nil && !errors.Is(err, types.ErrLiquidationConflictsWithClobPairStatus) {
132+
log.ErrorLogWithError(
133+
ctx,
134+
"Failed to liquidate subaccount",
135+
err,
136+
"liquidationOrder", *liquidationOrder,
137+
)
138+
return nil, err
139+
}
136140
}
137141

138142
if optimisticallyFilledQuantums == 0 {

0 commit comments

Comments
 (0)