fix position calculation
This commit is contained in:
parent
548fd006c1
commit
af031877a5
2 changed files with 18 additions and 3 deletions
|
|
@ -248,13 +248,14 @@ abstract contract ThreePositionStrategy is UniswapMath, VWAPTracker {
|
|||
|
||||
uint128 liquidity;
|
||||
if (token0isWeth) {
|
||||
liquidity = LiquidityAmounts.getLiquidityForAmount1(
|
||||
// floor leg sits entirely above current tick when WETH is token0, so budget is token0
|
||||
liquidity = LiquidityAmounts.getLiquidityForAmount0(
|
||||
TickMath.getSqrtRatioAtTick(vwapTick),
|
||||
TickMath.getSqrtRatioAtTick(floorTick),
|
||||
actualFloorEthBalance
|
||||
);
|
||||
} else {
|
||||
liquidity = LiquidityAmounts.getLiquidityForAmount0(
|
||||
liquidity = LiquidityAmounts.getLiquidityForAmount1(
|
||||
TickMath.getSqrtRatioAtTick(vwapTick),
|
||||
TickMath.getSqrtRatioAtTick(floorTick),
|
||||
actualFloorEthBalance
|
||||
|
|
@ -263,4 +264,4 @@ abstract contract ThreePositionStrategy is UniswapMath, VWAPTracker {
|
|||
|
||||
_mintPosition(Stage.FLOOR, token0isWeth ? vwapTick : floorTick, token0isWeth ? floorTick : vwapTick, liquidity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue