Skip to content

Commit

Permalink
Fix initial position value
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Mar 26, 2024
1 parent d97954b commit b8b98cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vault-interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ function updateUserPosition(
const positionValueUSDDelta = position.positionValueUSD.minus(previousPositionValueUSD)
if (isNewPosition) {
position.initialUnderlyingBalance0 = position.underlyingBalance0
position.initialUnderlyingBalance1 = position.underlyingBalance0
position.initialUnderlyingBalance0USD = position.underlyingBalance0
position.initialUnderlyingBalance1USD = position.underlyingBalance0
position.initialPositionValueUSD = position.underlyingBalance0
position.initialUnderlyingBalance1 = position.underlyingBalance1
position.initialUnderlyingBalance0USD = position.underlyingBalance0USD
position.initialUnderlyingBalance1USD = position.underlyingBalance1USD
position.initialPositionValueUSD = position.positionValueUSD
} else {
// apply the share balance percent change to the initial position value
const mult = shareBalancePercentChange.plus(ONE_BD)
Expand Down

0 comments on commit b8b98cb

Please sign in to comment.