# Liquidation Smart Contract Interface ## Contract interface to implement Note for all calls from Karura/Acala runtime, the `sender` will be `0x31382d495fed5a6820d9c07e8b6efe8d2166e9dd`, which liquidation contracts should check for security reason. - `liquidate(address collateral, address repay_dest, uint256 amount, uint256 - min_repayment)` - `onCollateralTransfer(address collateral, uint256 amount)` - `onRepaymentRefund(address collateral, uint256 repayment)` Note that gas fee will be charged from contract address, which should be guaranteed to have sufficient balance. ## Liquidation process on Karura/Acala 1. Call `liquidate` to try to liquidate. 2. If can liquidate with `min_repayment` requirements, liquidation contracts need to transfer sufficient repayment to `repay_dest`. 3. If sufficient repayment recieved, collateral will be transferred to liquidation contract addr, and then `on_collateral_transfer` will be called. If not, repayment will be refunded and `onRepaymentRefund` will be called.