            createPoolArray[0] = PoolManager.CreatePool(
                {	
    				// Token A
                    allowBorrow: true,
                    poolToken: address(MOCK_ERC20_1),
                    poolMulFactor: 17500000000000000,
                    poolCollFactor: 0.85 ether,
                    maxDepositAmount: 10000000000000 ether
                }
            );

            createPoolArray[1] = PoolManager.CreatePool(
                {
    				// Token B
                    allowBorrow: true,
                    poolToken: address(MOCK_ERC20_2),
                    poolMulFactor: 25000000000000000,
                    poolCollFactor: 0.65 ether,
                    maxDepositAmount: 10000000000000 ether
                }
            );

            createPoolArray[2] = PoolManager.CreatePool(
                {
    				// Token C
                    allowBorrow: true,
                    poolToken: address(MOCK_ERC20_3),
                    poolMulFactor: 15000000000000000,
                    poolCollFactor: 0.5 ether,
                    maxDepositAmount: 10000000000000 ether
                }
            );

            createPoolArray[3] = PoolManager.CreatePool(
                {
    				// Token D
                    allowBorrow: true,
                    poolToken: address(MOCK_WETH),
                    poolMulFactor: 17500000000000000,
                    poolCollFactor: 0.7 ether,
                    maxDepositAmount: 10000000000000 ether
                }
            );
    	function setNewPrice(uint256 newPrice) public {
            ethValuePerToken = newPrice;
        }
        function testChainLiquidation() public {
            address token1 = 0xfDf134B61F8139B8ea447eD49e7e6adf62fd4B49;
            address token2 = 0xEa3aF45ae5a2bAc059Cd026f23E47bdD753E664a;
            address token3 = 0x15BB461b3a994218fD0D6329E129846F366FFeB3;
            address token4 = 0x6B9d657Df9Eab179c44Ff9120566A2d423d01Ea9;

            testDeployLocal();
            skip(1000);

            // Add some tokens4 to have enough liquidity
            address thirdParty = makeAddr("thirdParty");
            deal(address(token4), thirdParty, 1_000_000 ether);
            vm.startPrank(thirdParty);
            IERC20(token4).approve(address(LENDING_INSTANCE), 1_000_000 ether);
            LENDING_INSTANCE.depositExactAmountMint(token4, 1_000_000 ether);
            vm.stopPrank();

            // Initially the price for tokens are:
            // 1 Token1 = 1 ETH
            MOCK_CHAINLINK_1.setNewPrice(1 ether);
            // 1 Token2 = 0.2 ETH
            MOCK_CHAINLINK_2.setNewPrice(0.2 ether);
            // 1 Token3 = 0.5 ETH
            MOCK_CHAINLINK_3.setNewPrice(0.5 ether);
            // 1 Token4 = 1 ETH
            MOCK_CHAINLINK_4.setNewPrice(1 ether);

            // Bob is liquidating Alice
            address alice = makeAddr("alice");
            address bob = makeAddr("bob");
            deal(token1, alice, 10 ether);
            deal(token2, alice, 50 ether);
            deal(token3, alice, 20 * 10**6);
            deal(token4, bob, 200 ether);

            vm.startPrank(alice);
            IERC20(token1).approve(address(LENDING_INSTANCE), 10 ether);
            LENDING_INSTANCE.depositExactAmountMint(token1, 10 ether);
            IERC20(token2).approve(address(LENDING_INSTANCE), 50 ether);
            LENDING_INSTANCE.depositExactAmount(6, token2, 50 ether);
            IERC20(token3).approve(address(LENDING_INSTANCE), 20 * 10**6);
            LENDING_INSTANCE.depositExactAmount(6, token3, 20 * 10**6);
            LENDING_INSTANCE.borrowExactAmount(6, token4, 18.9 ether);
            uint256 initialBorrowShares = LENDING_INSTANCE.getPositionBorrowShares(6, token4);
            vm.stopPrank();

            // Time passes and value of token3 drops significantly
            // 1 Token3 = 0.25 ETH
            MOCK_CHAINLINK_3.setNewPrice(0.25 ether);

            vm.startPrank(bob);
            IERC20(token4).approve(address(LENDING_INSTANCE), 200 ether);
            LENDING_INSTANCE.depositExactAmountMint(token4, 10 ether);
            LENDING_INSTANCE.liquidatePartiallyFromTokens(6, 7, token4, token1, 9.090909090909 ether);
            LENDING_INSTANCE.liquidatePartiallyFromTokens(6, 7, token4, token2, 2.7 ether);
            LENDING_INSTANCE.liquidatePartiallyFromTokens(6, 7, token4, token2, 3.5 ether);
            vm.stopPrank();

            uint256 finalBorrowShares = LENDING_INSTANCE.getPositionBorrowShares(6, token4);

            uint256 percentageLiquidated = 100 - (finalBorrowShares * 100 / initialBorrowShares);
            console.log("Percentage liquidated", percentageLiquidated);
        }
    [PASS] testChainLiquidation() (gas: 44546965)
    Logs:
      Percentage liquidated 81

    Test result: ok. 1 passed; 0 failed; 0 skipped; finished in 38.40ms

    Ran 1 test suite in 38.40ms: 1 tests passed, 0 failed, 0 skipped (1 total tests)
        function testLiquidationsConstrainted() public {
            address token1 = 0xfDf134B61F8139B8ea447eD49e7e6adf62fd4B49;
            address token2 = 0xEa3aF45ae5a2bAc059Cd026f23E47bdD753E664a;
            address token3 = 0x15BB461b3a994218fD0D6329E129846F366FFeB3;
            address token4 = 0x6B9d657Df9Eab179c44Ff9120566A2d423d01Ea9;

            uint256 aliceNftPosition = 6;
            uint256 bobNftPosition = 7;

            testDeployLocal();
            skip(1000);

            // Add some tokens4 to have enough liquidity
            address thirdParty = makeAddr("thirdParty");
            deal(address(token4), thirdParty, 1_000_000 ether);
            vm.startPrank(thirdParty);
            IERC20(token4).approve(address(LENDING_INSTANCE), 1_000_000 ether);
            LENDING_INSTANCE.depositExactAmountMint(token4, 1_000_000 ether);
            vm.stopPrank();

            // Initially the price for tokens are:
            // 1 Token1 = 1 ETH
            MOCK_CHAINLINK_1.setNewPrice(1 ether);
            // 1 Token2 = 0.2 ETH
            MOCK_CHAINLINK_2.setNewPrice(0.2 ether);
            // 1 Token3 = 0.5 ETH
            MOCK_CHAINLINK_3.setNewPrice(0.5 ether);
            // 1 Token4 = 1 ETH
            MOCK_CHAINLINK_4.setNewPrice(1 ether);

            // Bob is liquidating Alice
            address alice = makeAddr("alice");
            address bob = makeAddr("bob");
            deal(token1, alice, 10 ether);
            deal(token2, alice, 50 ether);
            deal(token3, alice, 20 * 10**6);
            deal(token4, bob, 200 ether);

            vm.startPrank(alice);
            IERC20(token1).approve(address(LENDING_INSTANCE), 10 ether);
            LENDING_INSTANCE.depositExactAmountMint(token1, 10 ether);
            IERC20(token2).approve(address(LENDING_INSTANCE), 50 ether);
            LENDING_INSTANCE.depositExactAmount(aliceNftPosition, token2, 50 ether);
            IERC20(token3).approve(address(LENDING_INSTANCE), 20 * 10**6);
            LENDING_INSTANCE.depositExactAmount(aliceNftPosition, token3, 20 * 10**6);
            LENDING_INSTANCE.borrowExactAmount(aliceNftPosition, token4, 18.9 ether);
            uint256 initialBorrowShares = LENDING_INSTANCE.getPositionBorrowShares(aliceNftPosition, token4);
            vm.stopPrank();

            // Time passes and value of token3 drops significantly
            // 1 Token3 = 0.25 ETH
            MOCK_CHAINLINK_3.setNewPrice(0.25 ether);

            vm.startPrank(bob);
            IERC20(token4).approve(address(LENDING_INSTANCE), 200 ether);
            LENDING_INSTANCE.depositExactAmountMint(token4, 10 ether);
            LENDING_INSTANCE.liquidatePartiallyFromTokens(aliceNftPosition, bobNftPosition, token4, token3, 4.54 ether);

            // Having liquidated the token with less LVT, the position is no longer liquidable
            // Try to liquidate with the minimum amount of shares (1)
            vm.expectRevert();
            LENDING_INSTANCE.liquidatePartiallyFromTokens(aliceNftPosition, bobNftPosition, token4, token3, 1);
            vm.stopPrank();

            uint256 finalBorrowShares = LENDING_INSTANCE.getPositionBorrowShares(aliceNftPosition, token4);

            uint256 percentageLiquidated = 100 - (finalBorrowShares * 100 / initialBorrowShares);
            console.log("Percentage liquidated", percentageLiquidated);
        }
    [PASS] testLiquidationsConstrainted() (gas: 44044788)
    Logs:
      Percentage liquidated 25

    Test result: ok. 1 passed; 0 failed; 0 skipped; finished in 40.81ms

    Ran 1 test suite in 40.81ms: 1 tests passed, 0 failed, 0 skipped (1 total tests)
