Skip to content

Commit

Permalink
disable liquidation
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 committed May 28, 2024
1 parent 0d5d594 commit 771bc7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (
TestVolatileExchangeParams = VolatileExchangeParams{
AveragePrice: 100,
Amplitude: 0.95,
Frequency: 1,
Frequency: 24,
}
TestVolatileExchangeDetails = types.ExchangeQueryDetails{
Exchange: exchange_common.EXCHANGE_ID_TEST_VOLATILE_EXCHANGE,
Expand Down
10 changes: 5 additions & 5 deletions protocol/x/clob/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ func PrepareCheckState(
}

// 6. Get all potentially liquidatable subaccount IDs and attempt to liquidate them.
liquidatableSubaccountIds := keeper.DaemonLiquidationInfo.GetLiquidatableSubaccountIds()
_, err := keeper.LiquidateSubaccountsAgainstOrderbook(ctx, liquidatableSubaccountIds)
if err != nil {
panic(err)
}
// liquidatableSubaccountIds := keeper.DaemonLiquidationInfo.GetLiquidatableSubaccountIds()
// _, err := keeper.LiquidateSubaccountsAgainstOrderbook(ctx, liquidatableSubaccountIds)
// if err != nil {
// panic(err)
// }

// Add subaccounts with open positions in final settlement markets to the slice of subaccounts/perps
// to be deleveraged.
Expand Down
5 changes: 5 additions & 0 deletions protocol/x/clob/keeper/deleveraging.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ func (k Keeper) NextTickDeleverage(
) {
negativeTncSubaccounts := k.subaccountsKeeper.GetAllNegativeTncSubaccounts(ctx)

k.Logger(ctx).Info(
"Next Tick Deleverage",
"subaccounts", negativeTncSubaccounts,
"nextTickDeleverage", true,
)
metrics.SetGauge(metrics.ClobNextTickDeleveragedNegativeTncSubaccounts, float32(len(negativeTncSubaccounts)))
for _, subaccountId := range negativeTncSubaccounts {
k.DeleverageEntireSubaccount(ctx, subaccountId)
Expand Down

0 comments on commit 771bc7c

Please sign in to comment.