Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collateral flag not disabled when collateral is fully liquidated (due to non-zero liquidationProtocolFee) #746

Closed
miguelmtzinf opened this issue Dec 5, 2022 · 0 comments
Assignees

Comments

@miguelmtzinf
Copy link
Contributor

The LiquidationLogic.executeLiquidationCall function is not taking into account the liquidationProtocolFee in the condition for setting to false the flag of useAsCollateral

    // If the collateral being liquidated is equal to the user balance,
    // we set the currency as not being used as collateral anymore
    if (vars.actualCollateralToLiquidate + vars.liquidationProtocolFeeAmount == vars.userCollateralBalance) {
      userConfig.setUsingAsCollateral(collateralReserve.id, false);
      emit ReserveUsedAsCollateralDisabled(params.collateralAsset, params.user);
    }

Kudos to @GopherJ for this! #740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant