@@ -21,7 +21,7 @@ describe("UsdcSpotManager", function () {
2121 await mockVault . mockMethod ( "fullUpper()" , [ 800000 ] ) ;
2222 await mockVault . mockMethod ( "baseLower()" , [ 45000 ] ) ;
2323 await mockVault . mockMethod ( "baseUpper()" , [ 55000 ] ) ;
24- await mockVault . mockMethod ( "getTwap()" , [ 71000 ] ) ;
24+ await mockVault . mockMethod ( "getTwap()" , [ 67200 ] ) ;
2525 await mockVault . mockMethod ( "limitThreshold()" , [ 800000 ] ) ;
2626
2727 const mockPool = new DMock ( "IUniswapV3Pool" ) ;
@@ -176,7 +176,7 @@ describe("UsdcSpotManager", function () {
176176 const { manager, mockAppraiser } = await loadFixture ( setupContracts ) ;
177177 await mockAppraiser . mockMethod ( "perpPrice()" , [ priceFP ( "1.2" ) , false ] ) ;
178178 const r = await manager . computeDeviationFactor . staticCall ( ) ;
179- expect ( r [ 0 ] ) . to . eq ( percFP ( "1.009614109343384160 " ) ) ;
179+ expect ( r [ 0 ] ) . to . eq ( percFP ( "1.0057863765655975 " ) ) ;
180180 expect ( r [ 1 ] ) . to . eq ( false ) ;
181181 } ) ;
182182 } ) ;
@@ -186,47 +186,47 @@ describe("UsdcSpotManager", function () {
186186 const { manager, mockAppraiser } = await loadFixture ( setupContracts ) ;
187187 await mockAppraiser . mockMethod ( "usdPrice()" , [ priceFP ( "0.8" ) , false ] ) ;
188188 const r = await manager . computeDeviationFactor . staticCall ( ) ;
189- expect ( r [ 0 ] ) . to . eq ( percFP ( "1.009614109343384160 " ) ) ;
189+ expect ( r [ 0 ] ) . to . eq ( percFP ( "1.0057863765655975 " ) ) ;
190190 expect ( r [ 1 ] ) . to . eq ( false ) ;
191191 } ) ;
192192 } ) ;
193193
194194 it ( "should return deviation factor" , async function ( ) {
195195 const { manager } = await loadFixture ( setupContracts ) ;
196196 const r = await manager . computeDeviationFactor . staticCall ( ) ;
197- expect ( r [ 0 ] ) . to . eq ( percFP ( "1.009614109343384160 " ) ) ;
197+ expect ( r [ 0 ] ) . to . eq ( percFP ( "1.0057863765655975 " ) ) ;
198198 expect ( r [ 1 ] ) . to . eq ( true ) ;
199199 } ) ;
200200
201201 it ( "should return deviation factor" , async function ( ) {
202202 const { manager, mockVault } = await loadFixture ( setupContracts ) ;
203- await mockVault . mockMethod ( "getTwap()" , [ 72500 ] ) ;
203+ await mockVault . mockMethod ( "getTwap()" , [ 65800 ] ) ;
204204 const r = await manager . computeDeviationFactor . staticCall ( ) ;
205- expect ( r [ 0 ] ) . to . eq ( percFP ( "1.172995447264373845 " ) ) ;
205+ expect ( r [ 0 ] ) . to . eq ( percFP ( "1.1569216182711425 " ) ) ;
206206 expect ( r [ 1 ] ) . to . eq ( true ) ;
207207 } ) ;
208208
209209 it ( "should return deviation factor" , async function ( ) {
210210 const { manager, mockVault } = await loadFixture ( setupContracts ) ;
211- await mockVault . mockMethod ( "getTwap()" , [ 70500 ] ) ;
211+ await mockVault . mockMethod ( "getTwap()" , [ 67800 ] ) ;
212212 const r = await manager . computeDeviationFactor . staticCall ( ) ;
213- expect ( r [ 0 ] ) . to . eq ( percFP ( "0.960377048978079093 " ) ) ;
213+ expect ( r [ 0 ] ) . to . eq ( percFP ( "0.947216779268338333 " ) ) ;
214214 expect ( r [ 1 ] ) . to . eq ( true ) ;
215215 } ) ;
216216
217217 it ( "should return deviation factor" , async function ( ) {
218218 const { manager, mockAppraiser } = await loadFixture ( setupContracts ) ;
219219 await mockAppraiser . mockMethod ( "perpPrice()" , [ priceFP ( "1.5" ) , true ] ) ;
220220 const r = await manager . computeDeviationFactor . staticCall ( ) ;
221- expect ( r [ 0 ] ) . to . eq ( percFP ( "0.807691287474707328 " ) ) ;
221+ expect ( r [ 0 ] ) . to . eq ( percFP ( "0.804629101252478 " ) ) ;
222222 expect ( r [ 1 ] ) . to . eq ( true ) ;
223223 } ) ;
224224
225225 it ( "should return deviation factor" , async function ( ) {
226226 const { manager, mockAppraiser } = await loadFixture ( setupContracts ) ;
227227 await mockAppraiser . mockMethod ( "perpPrice()" , [ priceFP ( "1" ) , true ] ) ;
228228 const r = await manager . computeDeviationFactor . staticCall ( ) ;
229- expect ( r [ 0 ] ) . to . eq ( percFP ( "1.211536931212060992 " ) ) ;
229+ expect ( r [ 0 ] ) . to . eq ( percFP ( "1.206943651878717 " ) ) ;
230230 expect ( r [ 1 ] ) . to . eq ( true ) ;
231231 } ) ;
232232
@@ -267,7 +267,7 @@ describe("UsdcSpotManager", function () {
267267 it ( "should keep limit range" , async function ( ) {
268268 const { manager, mockVault } = await loadFixture ( setupContracts ) ;
269269
270- await mockVault . mockMethod ( "getTwap()" , [ 72000 ] ) ;
270+ await mockVault . mockMethod ( "getTwap()" , [ 66200 ] ) ;
271271 await mockVault . mockMethod ( "limitLower()" , [ 40000 ] ) ;
272272 await mockVault . mockMethod ( "limitUpper()" , [ 45000 ] ) ;
273273
@@ -279,15 +279,15 @@ describe("UsdcSpotManager", function () {
279279 expect ( await manager . prevDeviation ( ) ) . to . eq ( "0" ) ;
280280 expect ( await manager . isOverweightSpot ( ) ) . to . eq ( true ) ;
281281 await expect ( manager . rebalance ( ) ) . not . to . be . reverted ;
282- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.11579057353024426 " ) ) ;
282+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.111560295732100833 " ) ) ;
283283 } ) ;
284284 } ) ;
285285
286286 describe ( "when overweight usdc" , function ( ) {
287287 it ( "should remove limit range" , async function ( ) {
288288 const { manager, mockVault, mockPool } = await loadFixture ( setupContracts ) ;
289289
290- await mockVault . mockMethod ( "getTwap()" , [ 72000 ] ) ;
290+ await mockVault . mockMethod ( "getTwap()" , [ 66200 ] ) ;
291291 await mockVault . mockMethod ( "limitLower()" , [ 73000 ] ) ;
292292 await mockVault . mockMethod ( "limitUpper()" , [ 75000 ] ) ;
293293 await mockPool . mockCall (
@@ -309,7 +309,7 @@ describe("UsdcSpotManager", function () {
309309 expect ( await manager . prevDeviation ( ) ) . to . eq ( "0" ) ;
310310 expect ( await manager . isOverweightSpot ( ) ) . to . eq ( false ) ;
311311 await expect ( manager . rebalance ( ) ) . not . to . be . reverted ;
312- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.115790573530244260 " ) ) ;
312+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.111560295732100833 " ) ) ;
313313 } ) ;
314314 } ) ;
315315 } ) ;
@@ -319,7 +319,7 @@ describe("UsdcSpotManager", function () {
319319 it ( "should remove limit range" , async function ( ) {
320320 const { manager, mockVault, mockPool } = await loadFixture ( setupContracts ) ;
321321
322- await mockVault . mockMethod ( "getTwap()" , [ 72000 ] ) ;
322+ await mockVault . mockMethod ( "getTwap()" , [ 66200 ] ) ;
323323 await mockVault . mockMethod ( "limitLower()" , [ 40000 ] ) ;
324324 await mockVault . mockMethod ( "limitUpper()" , [ 45000 ] ) ;
325325 await mockVault . mockMethod ( "period()" , [ 86400 ] ) ;
@@ -328,7 +328,7 @@ describe("UsdcSpotManager", function () {
328328 await mockVault . mockMethod ( "rebalance()" , [ ] ) ;
329329 await manager . rebalance ( ) ;
330330
331- await mockVault . mockMethod ( "getTwap()" , [ 70000 ] ) ;
331+ await mockVault . mockMethod ( "getTwap()" , [ 67800 ] ) ;
332332 await mockVault . mockMethod ( "limitLower()" , [ 60000 ] ) ;
333333 await mockVault . mockMethod ( "limitUpper()" , [ 65000 ] ) ;
334334 await mockPool . mockCall (
@@ -343,18 +343,18 @@ describe("UsdcSpotManager", function () {
343343 [ ] ,
344344 ) ;
345345
346- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.115790573530244260 " ) ) ;
346+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.111560295732100833 " ) ) ;
347347 expect ( await manager . isOverweightSpot ( ) ) . to . eq ( true ) ;
348348 await expect ( manager . rebalance ( ) ) . not . to . be . reverted ;
349- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "0.913541191300990579 " ) ) ;
349+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "0.947216779268338333 " ) ) ;
350350 } ) ;
351351 } ) ;
352352
353353 describe ( "when overweight usdc" , function ( ) {
354354 it ( "should keep limit range" , async function ( ) {
355355 const { manager, mockVault } = await loadFixture ( setupContracts ) ;
356356
357- await mockVault . mockMethod ( "getTwap()" , [ 72000 ] ) ;
357+ await mockVault . mockMethod ( "getTwap()" , [ 66200 ] ) ;
358358 await mockVault . mockMethod ( "limitLower()" , [ 40000 ] ) ;
359359 await mockVault . mockMethod ( "limitUpper()" , [ 45000 ] ) ;
360360 await mockVault . mockMethod ( "period()" , [ 86400 ] ) ;
@@ -363,15 +363,15 @@ describe("UsdcSpotManager", function () {
363363 await mockVault . mockMethod ( "rebalance()" , [ ] ) ;
364364 await manager . rebalance ( ) ;
365365
366- await mockVault . mockMethod ( "getTwap()" , [ 70000 ] ) ;
366+ await mockVault . mockMethod ( "getTwap()" , [ 67800 ] ) ;
367367 await mockVault . mockMethod ( "limitLower()" , [ 75000 ] ) ;
368368 await mockVault . mockMethod ( "limitUpper()" , [ 80000 ] ) ;
369369 await mockVault . clearMockMethod ( "emergencyBurn(int24,int24,uint128)" ) ;
370370
371- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.115790573530244260 " ) ) ;
371+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.111560295732100833 " ) ) ;
372372 expect ( await manager . isOverweightSpot ( ) ) . to . eq ( false ) ;
373373 await expect ( manager . rebalance ( ) ) . not . to . be . reverted ;
374- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "0.913541191300990579 " ) ) ;
374+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "0.947216779268338333 " ) ) ;
375375 } ) ;
376376 } ) ;
377377 } ) ;
@@ -381,7 +381,7 @@ describe("UsdcSpotManager", function () {
381381 it ( "should not force rebalance" , async function ( ) {
382382 const { manager, mockVault, mockPool } = await loadFixture ( setupContracts ) ;
383383
384- await mockVault . mockMethod ( "getTwap()" , [ 70500 ] ) ;
384+ await mockVault . mockMethod ( "getTwap()" , [ 67800 ] ) ;
385385 await mockVault . mockMethod ( "limitLower()" , [ 40000 ] ) ;
386386 await mockVault . mockMethod ( "limitUpper()" , [ 45000 ] ) ;
387387 await mockVault . mockMethod ( "rebalance()" , [ ] ) ;
@@ -399,7 +399,7 @@ describe("UsdcSpotManager", function () {
399399 expect ( await manager . prevDeviation ( ) ) . to . eq ( "0" ) ;
400400 expect ( await manager . isOverweightSpot ( ) ) . to . eq ( true ) ;
401401 await expect ( manager . rebalance ( ) ) . not . to . be . reverted ;
402- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "0.960377048978079093 " ) ) ;
402+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "0.947216779268338333 " ) ) ;
403403 } ) ;
404404 } ) ;
405405 } ) ;
@@ -409,7 +409,7 @@ describe("UsdcSpotManager", function () {
409409 it ( "should not force rebalance" , async function ( ) {
410410 const { manager, mockVault, mockPool } = await loadFixture ( setupContracts ) ;
411411
412- await mockVault . mockMethod ( "getTwap()" , [ 72000 ] ) ;
412+ await mockVault . mockMethod ( "getTwap()" , [ 66200 ] ) ;
413413 await mockVault . mockMethod ( "limitLower()" , [ 40000 ] ) ;
414414 await mockVault . mockMethod ( "limitUpper()" , [ 45000 ] ) ;
415415 await mockVault . mockMethod ( "period()" , [ 86400 ] ) ;
@@ -423,7 +423,7 @@ describe("UsdcSpotManager", function () {
423423 await mockVault . clearMockCall ( "period()" , [ ] ) ;
424424 await mockVault . clearMockMethod ( "emergencyBurn(int24,int24,uint128)" ) ;
425425
426- await mockVault . mockMethod ( "getTwap()" , [ 71500 ] ) ;
426+ await mockVault . mockMethod ( "getTwap()" , [ 66800 ] ) ;
427427 await mockVault . mockMethod ( "limitLower()" , [ 75000 ] ) ;
428428 await mockVault . mockMethod ( "limitUpper()" , [ 80000 ] ) ;
429429 await mockPool . mockCall (
@@ -433,10 +433,10 @@ describe("UsdcSpotManager", function () {
433433 ) ;
434434 await mockVault . mockMethod ( "emergencyBurn(int24,int24,uint128)" , [ ] ) ;
435435
436- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.115790573530244260 " ) ) ;
436+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.111560295732100833 " ) ) ;
437437 expect ( await manager . isOverweightSpot ( ) ) . to . eq ( false ) ;
438438 await expect ( manager . rebalance ( ) ) . not . to . be . reverted ;
439- expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.061375478380992817 " ) ) ;
439+ expect ( await manager . prevDeviation ( ) ) . to . eq ( percFP ( "1.0468312037404625 " ) ) ;
440440 } ) ;
441441 } ) ;
442442 } ) ;
0 commit comments