```\nFile: Stable2TokenOracleMath.sol\n    function _validateSpotPriceAndPairPrice(\n        StableOracleContext calldata oracleContext,\n        TwoTokenPoolContext calldata poolContext,\n        StrategyContext memory strategyContext,\n        uint256 oraclePrice,\n        uint256 primaryAmount, \n        uint256 secondaryAmount\n    ) internal view {\n        // Oracle price is always specified in terms of primary, so tokenIndex == 0 for primary\n        uint256 spotPrice = _getSpotPrice({\n            oracleContext: oracleContext,\n            poolContext: poolContext,\n            primaryBalance: poolContext.primaryBalance,\n            secondaryBalance: poolContext.secondaryBalance,\n            tokenIndex: 0\n        });\n\n        /// @notice Check spotPrice against oracle price to make sure that \n        /// the pool is not being manipulated\n        _checkPriceLimit(strategyContext, oraclePrice, spotPrice);\n\n        /// @notice Balancer math functions expect all amounts to be in BALANCER_PRECISION\n        uint256 primaryPrecision = 10 ** poolContext.primaryDecimals;\n        uint256 secondaryPrecision = 10 ** poolContext.secondaryDecimals;\n        primaryAmount = primaryAmount * BalancerConstants.BALANCER_PRECISION / primaryPrecision;\n        secondaryAmount = secondaryAmount * BalancerConstants.BALANCER_PRECISION / secondaryPrecision;\n\n        uint256 calculatedPairPrice = _getSpotPrice({\n            oracleContext: oracleContext,\n            poolContext: poolContext,\n            primaryBalance: primaryAmount,\n            secondaryBalance: secondaryAmount,\n            tokenIndex: 0\n        });\n```\n