Skip to content

Commit

Permalink
properly set ticks in existing positions to avoid invalid price->tick…
Browse files Browse the repository at this point in the history
… on fullrange positions
  • Loading branch information
eli-d committed Jan 13, 2025
1 parent cce958d commit d1c2a0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/src/components/StakeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ export const StakeForm = ({ mode, poolId, positionId }: StakeFormProps) => {

setPriceLower(priceLower, token0.decimals);
setPriceUpper(priceHigher, token0.decimals);
// always set the ticks, since the display price might be invalid due to bigint/decimal interop
positionData?.lower && setTickLower(positionData.lower);
positionData?.upper && setTickUpper(positionData.upper);
}
}, [
mode,
Expand All @@ -426,6 +429,8 @@ export const StakeForm = ({ mode, poolId, positionId }: StakeFormProps) => {
fUSDC.decimals,
setPriceLower,
setPriceUpper,
setTickLower,
setTickUpper,
token0.decimals,
]);

Expand Down

0 comments on commit d1c2a0a

Please sign in to comment.