Skip to content

Instantly share code, notes, and snippets.

@sekrystal
Created March 30, 2023 21:35
Show Gist options
  • Save sekrystal/9b68be3c399991102c192d56b67a1f14 to your computer and use it in GitHub Desktop.
Save sekrystal/9b68be3c399991102c192d56b67a1f14 to your computer and use it in GitHub Desktop.
Insolvent Position Analysis
pragma solidity ^0.8.13;
// from ...
uint256 internal constant LIQUIDATION_CLOSE_FACTOR_PERCENT = 5000;
function liquidationCall(
address collateralAsset,
address debtAsset,
address user,
uint256 debtToCover,
bool receiveAToken
) external override returns (uint256, string memory) {
// ...
vars.maxLiquidatableDebt = vars.userStableDebt.add(vars.userVariableDebt).percentMul(
LIQUIDATION_CLOSE_FACTOR_PERCENT
);
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment