import { getLinearBalance } from '../helpers/pool-math' ; describe ( 'pool math' , ( ) => { it ( 'should compute collateral balance from blockchain data' , ( ) => { const scaledATokenBalance = '161316503206059870' ; const liquidityIndex = '1001723339432542553527150680' ; const currentLiquidityRate = '22461916953455574582370088' ; const lastUpdateTimestamp = 1609673617 ; const currentTimestamp = 1609675535 ; const expectedATokenBalance = '161594727054623229' ; const underlyingBalance = getLinearBalance ( scaledATokenBalance , liquidityIndex , currentLiquidityRate , lastUpdateTimestamp , currentTimestamp ) . toString ( ) ; expect ( underlyingBalance ) . toBe ( expectedATokenBalance ) ; } ) ; } ) ;