Closed pedrovalido closed 7 months ago
Deployed here but it reverts when trying to fetch any CL pool data: 0x5009F9C2dD46a18a6a274b40CC36D2B6302F9575
@stas the active liquidity being fetched is the stakedLiquidityNet
at the current tick. There are a few cases where the stakedLiquidityNet
at the current tick is 0.
You also mentioned:
"If the APR is too volatile, we add the immediate +/- 1 tick liquidity, if not we keep it like this."
So, wdyt about:
active_liquidity: avg(currentTick.stakedLiquidityNet, currentTickMinus1.stakedLiquidityNet, currentTickPlus1.stakedLiquidityNet)
Will add this change shortly
@stas the active liquidity being fetched is the
stakedLiquidityNet
at the current tick. There are a few cases where thestakedLiquidityNet
at the current tick is 0.
I think that's fine. Let's not add the immediate ticks for now, as we're trying to figure out still how volatile is the APR in the current tick.
Will add this change shortly
Let's consider this for later. For now the active tick liquidity seems fine imho.
@ethzoomer reverted the change of the immediate ticks. Feel free to merge if everything looks good
Pushed the change for the issue mentioned above: When the tick spacing is not 1, we return the weighted average of the closest ticks' staked liquidity net. To give an example, if the tick spacing is 100 and the current tick is 70, we return the sum between 30% of ticks(0) and 70% of ticks(100).
The new changes with the weighted average of the closest ticks is deployed here https://optimistic.etherscan.io/address/0xe510f1d0d96865be9684e1b9faac5069cc231ada
I believe this can be closed now that the UI is using staked0
/staked1
for the active staked liquidity around the current tick
cc @pedrovalido
Updating CL gauge liquidity to expose the gauge liquidity at the current tick.