File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
test/liquidity-protection Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2410,6 +2410,24 @@ describe('LiquidityProtection', () => {
24102410 expect ( poolDeficit ) . equal ( 0 ) ;
24112411 } ) ;
24122412
2413+ it ( 'should return 0 deficit PPM if the total positions value is 0' , async ( ) => {
2414+ const provider = owner ;
2415+ // v1 pool: adds unprotected liquidity, pool tokens are minted and ALL of them are sent
2416+ // to the provider's wallet
2417+ await initPool ( isEthReserve ) ;
2418+
2419+ // v2 pool: adds protected liquidity, pool tokens are minted and managed by the contract on
2420+ // behalf of the provider. HALF of the pool tokens are allocated to the provider, and HALF to
2421+ // the system
2422+ const poolTokenSupply = await poolToken . totalSupply ( ) ;
2423+ await addV2Liquidity ( provider , depositAmount , isEthReserve ) ;
2424+
2425+ await liquidityProtection . setTotalPositionsValue ( poolToken . address , 0 ) ;
2426+
2427+ const poolDeficit = await liquidityProtection . poolDeficitPPM ( poolToken . address ) ;
2428+ expect ( poolDeficit ) . equal ( 0 ) ;
2429+ } ) ;
2430+
24132431 it ( 'should return 0 deficit PPM if the total positions value is equal to the total protected liquidity' , async ( ) => {
24142432 const provider = owner ;
24152433 // v1 pool: adds unprotected liquidity, pool tokens are minted and ALL of them are sent
You can’t perform that action at this time.
0 commit comments