Skip to content

Commit 6c01fbe

Browse files
committed
review comments
1 parent 57ad699 commit 6c01fbe

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

contracts/tasks/aero.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ const snapAero = async ({ block }) => {
2020
const sugarHelper = await resolveContract(base.sugarHelper, "ISugarHelper");
2121

2222
const Q96 = BigNumber.from(2).pow(96);
23-
const sqrtRatioX96TickLower = BigNumber.from("79224201403219477170569942574"); // -1 tick
24-
const sqrtRatioX96TickHigher = BigNumber.from(
25-
"79228162514264337593543950336"
26-
); // 0 tick
23+
const sqrtRatioX96TickLower = await aeroStrat
24+
.connect(signer)
25+
.sqrtRatioX96TickLower({ blockTag });
26+
const sqrtRatioX96TickHigher = await aeroStrat
27+
.connect(signer)
28+
.sqrtRatioX96TickHigher({ blockTag });
29+
const lowerTick = await aeroStrat.connect(signer).lowerTick({ blockTag });
2730

2831
const { tick, sqrtPriceX96 } = await pool.connect(signer).slot0({ blockTag });
29-
const { liquidityGross } = await pool.connect(signer).ticks(-1, { blockTag });
32+
const { liquidityGross } = await pool
33+
.connect(signer)
34+
.ticks(lowerTick, { blockTag });
3035
const { amount0: tickWethBalance, amount1: tickOethBalance } =
3136
await sugarHelper
3237
.connect(signer)
@@ -95,7 +100,7 @@ const snapAero = async ({ block }) => {
95100
`Pool WETH : ${formatUnits(poolWethBalance)} (${formatUnits(
96101
poolWethPercentage,
97102
2
98-
)}%), ${poolWethBalance} wei`
103+
)}%), ${poolWethBalance} wei (includes unclaimed WETH)`
99104
);
100105
console.log(
101106
`Pool OETH : ${formatUnits(poolOethBalance)} (${formatUnits(

0 commit comments

Comments
 (0)