```\nfunction liquidation(address provider, address onBehalfOf, uint256 assetAmount) external virtual {\n uint256 assetPrice = getAssetPrice();\n uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] \* assetPrice \* 100) / borrowed[onBehalfOf];\n require(onBehalfOfCollateralRatio < badCollateralRatio, "Borrowers collateral ratio should below badCollateralRatio");\n\n require(assetAmount \* 2 <= depositedAsset[onBehalfOf], "a max of 50% collateral can be liquidated");\n require(EUSD.allowance(provider, address(this)) != 0, "provider should authorize to provide liquidation EUSD");\n uint256 eusdAmount = (assetAmount \* assetPrice) / 1e18;\n\n \_repay(provider, onBehalfOf, eusdAmount);\n uint256 reducedAsset = assetAmount \* 11 / 10;\n totalDepositedAsset -= reducedAsset;\n depositedAsset[onBehalfOf] -= reducedAsset;\n uint256 reward2keeper;\n if (provider == msg.sender) {\n collateralAsset.safeTransfer(msg.sender, reducedAsset);\n } else {\n reward2keeper = (reducedAsset \* configurator.vaultKeeperRatio(address(this))) / 110;\n collateralAsset.safeTransfer(provider, reducedAsset - reward2keeper);\n collateralAsset.safeTransfer(msg.sender, reward2keeper);\n }\n emit LiquidationRecord(provider, msg.sender, onBehalfOf, eusdAmount, reducedAsset, reward2keeper, false, block.timestamp);\n}\n```\n