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

Commit

Permalink
Merge pull request #210 from equilibria-xyz/arjun/fix-vault
Browse files Browse the repository at this point in the history
Fix vault when position at target
  • Loading branch information
arjun-io authored Nov 17, 2023
2 parents a71759d + ee431a1 commit 02a732c
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 02a732c

Please sign in to comment.