Merge pull request 'fix: Double-subtraction if stakingPoolAddr == feeDestination (#911)' (#933) from fix/issue-911 into master

This commit is contained in:
johba 2026-03-17 22:17:20 +01:00
commit e927f44359

View file

@ -325,7 +325,9 @@ contract LiquidityManager is ThreePositionStrategy, PriceOracle {
supply -= kraiken.balanceOf(feeDestination);
}
(, address stakingPoolAddr) = kraiken.peripheryContracts();
if (stakingPoolAddr != address(0)) {
// Guard against double-subtraction: if stakingPoolAddr == feeDestination,
// that balance was already deducted above.
if (stakingPoolAddr != address(0) && stakingPoolAddr != feeDestination) {
supply -= kraiken.balanceOf(stakingPoolAddr);
}
return supply;