implemented minStake

This commit is contained in:
JulesCrown 2024-06-13 10:50:09 +02:00
parent 72abf097df
commit b94f5559dd
4 changed files with 38 additions and 32 deletions

View file

@ -386,6 +386,7 @@ contract BaseLineLP {
}
// call this function when price has moved up 15%
// TODO: write a bot that calls this function regularly
function shift() external {
require(positions[Stage.ANCHOR].liquidity > 0, "Not initialized");
// Fetch the current tick from the Uniswap V3 pool
@ -425,6 +426,7 @@ contract BaseLineLP {
ethInAnchor = (ethInAnchor > ethBalance / 10) ? ethBalance / 10 : ethInAnchor;
currentTick = currentTick / TICK_SPACING * TICK_SPACING;
harb.setPreviousTotalSupply(harb.totalSupply());
_set(sqrtPriceX96, currentTick, ethInAnchor);
}