You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/extensions/PerpV2LeverageStrategyExtension.sol
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -973,6 +973,7 @@ contract PerpV2LeverageStrategyExtension is BaseExtension {
973
973
* Calculate total notional rebalance quantity and chunked rebalance quantity in base asset units for engaging the SetToken. Used in engage().
974
974
* Leverage ratio (for the base asset) is zero before engage. We open a new base asset position with size equals to (collateralBalance * targetLeverageRatio / baseAssetPrice)
975
975
* to gain (targetLeverageRatio * collateralBalance) worth of exposure to the base asset.
976
+
* Note: We can't use `_calculateChunkRebalanceNotional` function because CLR is 0 during engage and it would lead to a divison by zero error.
976
977
*
977
978
* return int256 Chunked rebalance notional in base asset units
978
979
* return int256 Total rebalance notional in base asset units
0 commit comments