Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Fix vault when position at target
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun-io committed Nov 16, 2023
1 parent a71759d commit ee431a1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,10 @@ contract SingleBalancedVault is ISingleBalancedVault, UInitializable {

if (targetPosition.lt(currentPosition))
product.closeMake(currentPosition.sub(targetPosition));
if (targetPosition.gte(currentPosition))
if (targetPosition.gt(currentPosition))
product.openMake(targetPosition.sub(currentPosition).min(makerAvailable));
if (targetPosition.eq(currentPosition))
product.closeMake(UFixed18Lib.ZERO);

emit PositionUpdated(product, targetPosition);
}
Expand Down

0 comments on commit ee431a1

Please sign in to comment.