fix: Double-subtraction if stakingPoolAddr == feeDestination (#911)

This commit is contained in:
openhands 2026-03-17 20:49:46 +00:00
parent dc9a053db4
commit e4225b364b

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;