Skip to content

Commit c9bafea

Browse files
committed
updated removeLiquidityReturn base return amount
1 parent ec50352 commit c9bafea

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

contracts/liquidity-protection/LiquidityProtection.sol

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -514,24 +514,7 @@ contract LiquidityProtection is ILiquidityProtection, Utils, Owned, ReentrancyGu
514514
packedRates
515515
);
516516

517-
// for network token, the return amount is identical to the target amount
518-
if (_isNetworkToken(pos.reserveToken)) {
519-
return (targetAmount, targetAmount, 0);
520-
}
521-
522-
// handle base token return
523-
524-
// calculate the amount of pool tokens required for liquidation
525-
// note that the amount is doubled since it's not possible to liquidate one reserve only
526-
Fraction memory poolRate = _poolTokenRate(pos.poolToken, pos.reserveToken);
527-
uint256 poolAmount = _liquidationAmount(targetAmount, poolRate, pos.poolToken);
528-
529-
// calculate the base token amount received by liquidating the pool tokens
530-
// note that the amount is divided by 2 since the pool amount represents both reserves
531-
uint256 baseAmount = _mulDivF(poolAmount, poolRate.n, poolRate.d.mul(2));
532-
uint256 networkAmount = 0;
533-
534-
return (targetAmount, baseAmount, networkAmount);
517+
return (targetAmount, targetAmount, 0);
535518
}
536519

537520
/**

0 commit comments

Comments
 (0)