Skip to content

Commit

Permalink
move
Browse files Browse the repository at this point in the history
  • Loading branch information
amityadav0 committed Sep 19, 2024
1 parent a944f6f commit 535de5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions x/perpetual/keeper/msg_server_close_positions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ func (k msgServer) ClosePositions(goCtx context.Context, msg *types.MsgClosePosi
return nil, nil
}

// Handle toPay
err := k.HandleToPay(ctx)
if err != nil {
ctx.Logger().Error(err.Error())

Check warning on line 24 in x/perpetual/keeper/msg_server_close_positions.go

View check run for this annotation

Codecov / codecov/patch

x/perpetual/keeper/msg_server_close_positions.go#L22-L24

Added lines #L22 - L24 were not covered by tests
}

// Handle liquidations
liqLog := []string{}
for _, val := range msg.Liquidate {
Expand Down
5 changes: 0 additions & 5 deletions x/perpetual/keeper/process_mtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ import (

func (k Keeper) CheckAndLiquidateUnhealthyPosition(ctx sdk.Context, mtp *types.MTP, pool types.Pool, ammPool ammtypes.Pool, baseCurrency string, baseCurrencyDecimal uint64) error {
var err error
// Handle toPay
err = k.HandleToPay(ctx)
if err != nil {
ctx.Logger().Error(err.Error())
}

// update mtp take profit liabilities
// calculate mtp take profit liabilities, delta x_tp_l = delta y_tp_c * current price (take profit liabilities = take profit custody * current price)
Expand Down

0 comments on commit 535de5b

Please sign in to comment.