update outstanding supply for floor with harb in anchor and discovery
This commit is contained in:
parent
8c28b05312
commit
e2fd200d5b
1 changed files with 4 additions and 1 deletions
|
|
@ -274,13 +274,14 @@ contract LiquidityManager {
|
|||
currentTick = currentTick / TICK_SPACING * TICK_SPACING;
|
||||
|
||||
// set Discovery position
|
||||
uint256 discoveryAmount;
|
||||
{
|
||||
int24 tickLower = token0isWeth ? currentTick - DISCOVERY_SPACING - ANCHOR_SPACING : currentTick + ANCHOR_SPACING;
|
||||
int24 tickUpper = token0isWeth ? currentTick - ANCHOR_SPACING : currentTick + DISCOVERY_SPACING + ANCHOR_SPACING;
|
||||
uint160 sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);
|
||||
uint160 sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);
|
||||
|
||||
uint256 discoveryAmount = pulledHarb * uint24(DISCOVERY_SPACING) * uint24(DISCOVERY_DEPTH) / uint24(ANCHOR_SPACING) / 100;
|
||||
discoveryAmount = pulledHarb * uint24(DISCOVERY_SPACING) * uint24(DISCOVERY_DEPTH) / uint24(ANCHOR_SPACING) / 100;
|
||||
uint128 liquidity;
|
||||
if (token0isWeth) {
|
||||
liquidity = LiquidityAmounts.getLiquidityForAmount1(
|
||||
|
|
@ -298,6 +299,8 @@ contract LiquidityManager {
|
|||
// set Floor position
|
||||
{
|
||||
outstandingSupply = harb.outstandingSupply();
|
||||
outstandingSupply -= pulledHarb;
|
||||
outstandingSupply -= (outstandingSupply >= discoveryAmount) ? discoveryAmount : outstandingSupply;
|
||||
uint256 vwapX96 = 0;
|
||||
uint256 requiredEthForBuyback = 0;
|
||||
if (cumulativeVolume > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue