fix _sharesForValue
@@ -134,7 +134,7 @@ contract AffiliateTokenGatedUpgradeable is ERC20Upgradeable, BaseWrapperUpgradea
function _sharesForValue(uint256 amount) internal view returns (uint256) {
// total wrapper assets before deposit (assumes deposit already occured)
- uint256 totalWrapperAssets = totalVaultBalance(address(this));
+ uint256 totalWrapperAssets = totalVaultBalance(address(this)).sub(amount);
if (totalWrapperAssets > 0) {
return totalSupply().mul(amount).div(totalWrapperAssets);
