426:         uint256 reverseAllowedSpread = 2
427:             * PRECISION_FACTOR_E18
428:             - _allowedSpread;
429: 
430:         if (block.chainid == ARB_CHAIN_ID) {
431: 
432:             _depositAmount = _getTokensUniV3(
433:                 _depositAmount,
434:                 _getEthInTokens(
435:                         ENTRY_ASSET,
436:                         _depositAmount
437:                     )
438:                 * reverseAllowedSpread
439:                 / PRECISION_FACTOR_E18,
440:                 WETH_ADDRESS,
441:                 ENTRY_ASSET
442:             );
443:         }
489:         uint256 ethValueBefore = _getTokensInETH(
490:             ENTRY_ASSET,
491:             _depositAmount
492:         );
493: 
494:         (
495:             uint256 receivedShares
496:             ,
497:         ) = IPendleChild(PENDLE_CHILD).depositExactAmount(
498:             netLpOut
499:         );
500:         // @audit-issue the calculation for ethValueAfter below is incorrect
501:         uint256 ethValueAfter = _getTokensInETH(
502:             PENDLE_CHILD,
503:             receivedShares
504:         )
505:             * _allowedSpread
506:             / PRECISION_FACTOR_E18;
507:         // @audit-issue ethValueBefore on Arbitrum uses the depositAmount that allowedSpread has already been applied
508:         if (ethValueAfter < ethValueBefore) {
509:             revert TooMuchValueLost();
510:         }
        uint256 reverseAllowedSpread = 2
            * PRECISION_FACTOR_E18
            - _allowedSpread;
+       unit256 actualDeposit = _depositAmount;
        if (block.chainid == ARB_CHAIN_ID) {

            _depositAmount = _getTokensUniV3(
                _depositAmount,
                _getEthInTokens(
                        ENTRY_ASSET,
                        _depositAmount
                    )
                * reverseAllowedSpread
                / PRECISION_FACTOR_E18,
                WETH_ADDRESS,
                ENTRY_ASSET
            );
        }

    ...
    
        uint256 ethValueBefore = _getTokensInETH(
            ENTRY_ASSET,
-            _depositAmount
+.           actualDeposit
        );
