Skip to content

Commit

Permalink
fix: collect fee condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Senna46 committed Nov 24, 2024
1 parent 6c60e53 commit 9e2a549
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions x/liquiditypool/keeper/msg_server_position.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,9 @@ func (k Keeper) DecreaseLiquidity(ctx sdk.Context, sender sdk.AccAddress, positi
return math.Int{}, math.Int{}, errorsmod.Wrapf(types.ErrPoolNotFound, "pool id: %d", position.PoolId)
}

if liquidity.Equal(position.Liquidity) {
// Collect fees
if _, err := k.collectFees(ctx, sender, positionId); err != nil {
return math.Int{}, math.Int{}, err
}
// Collect fees
if _, err := k.collectFees(ctx, sender, positionId); err != nil {
return math.Int{}, math.Int{}, err
}

liquidityDelta := liquidity.Neg()
Expand Down

0 comments on commit 9e2a549

Please sign in to comment.