From 2f638cbd194193950fb6b1e733151a50c1f67c35 Mon Sep 17 00:00:00 2001 From: Jonny Rhea <5555162+jrhea@users.noreply.github.com> Date: Wed, 8 Nov 2023 22:31:05 -0600 Subject: [PATCH] rename checkpoint exposure and normalize addliquidity event value (#659) * change checkpoint.longExposure to checkpoint.exposure * use contribution value directly in event --- contracts/src/Hyperdrive.sol | 8 ++-- contracts/src/HyperdriveBase.sol | 16 +++---- contracts/src/HyperdriveLP.sol | 3 +- contracts/src/HyperdriveLong.sol | 18 ++++---- contracts/src/HyperdriveShort.sol | 16 +++---- contracts/src/interfaces/IHyperdrive.sol | 5 ++- contracts/test/MockHyperdriveMath.sol | 4 +- crates/hyperdrive-math/src/long.rs | 4 +- crates/hyperdrive-math/src/short.rs | 2 +- .../tests/integration_tests.rs | 2 +- crates/test-utils/src/agent.rs | 6 +-- crates/test-utils/src/crash_reports.rs | 10 ++--- .../hyperdrive/LpWithdrawalTest.t.sol | 4 +- test/units/hyperdrive/ExtremeInputs.t.sol | 2 +- test/units/libraries/HyperdriveMath.t.sol | 6 +-- test/utils/HyperdriveUtils.sol | 44 +++++++++---------- 16 files changed, 75 insertions(+), 75 deletions(-) diff --git a/contracts/src/Hyperdrive.sol b/contracts/src/Hyperdrive.sol index bf0e2000b..85f2db80e 100644 --- a/contracts/src/Hyperdrive.sol +++ b/contracts/src/Hyperdrive.sol @@ -167,16 +167,16 @@ abstract contract Hyperdrive is positionsClosed = true; } - // Update the checkpoint and global longExposure + // Update the checkpoint exposure and global long exposure. if (positionsClosed) { uint256 maturityTime = _checkpointTime - _positionDuration; int128 checkpointExposureBefore = int128( - _checkpoints[maturityTime].longExposure + _checkpoints[maturityTime].exposure ); - _checkpoints[maturityTime].longExposure = 0; + _checkpoints[maturityTime].exposure = 0; _updateLongExposure( checkpointExposureBefore, - _checkpoints[maturityTime].longExposure + _checkpoints[maturityTime].exposure ); // Distribute the excess idle to the withdrawal pool. diff --git a/contracts/src/HyperdriveBase.sol b/contracts/src/HyperdriveBase.sol index bafd159ae..b4fe85869 100644 --- a/contracts/src/HyperdriveBase.sol +++ b/contracts/src/HyperdriveBase.sol @@ -303,7 +303,7 @@ abstract contract HyperdriveBase is /// @param _maturityTime The maturity time of the position being closed. /// @param _sharePrice The current share price. /// @param _isLong True if the position being closed is long. - function _updateCheckpointLongExposureOnClose( + function _updateCheckpointExposureOnClose( uint256 _bondAmount, uint256 _shareReservesDelta, uint256 _bondReservesDelta, @@ -320,11 +320,11 @@ abstract contract HyperdriveBase is AssetId.encodeAssetId(AssetId.AssetIdPrefix.Short, _maturityTime) ]; - // We can zero out long exposure when there are no more open positions + // We can zero out exposure when there are no more open positions if (checkpointLongs == 0 && checkpointShorts == 0) { - _checkpoints[checkpointTime].longExposure = 0; + _checkpoints[checkpointTime].exposure = 0; } else { - // The long exposure delta is flat + curve amount + the bonds the + // The exposure delta is flat + curve amount + the bonds the // user is closing: // // (dz_user*c - dz*c) + (dy - dz*c) + dy_user @@ -337,13 +337,13 @@ abstract contract HyperdriveBase is _bondAmount).toUint128() ); - // If the position being closed is long, then the long exposure - // decreases by the delta. If it's short, then the long exposure + // If the position being closed is long, then the exposure + // decreases by the delta. If it's short, then the exposure // increases by the delta. if (_isLong) { - _checkpoints[checkpointTime].longExposure -= delta; + _checkpoints[checkpointTime].exposure -= delta; } else { - _checkpoints[checkpointTime].longExposure += delta; + _checkpoints[checkpointTime].exposure += delta; } } } diff --git a/contracts/src/HyperdriveLP.sol b/contracts/src/HyperdriveLP.sol index 144957d0d..220da7ac5 100644 --- a/contracts/src/HyperdriveLP.sol +++ b/contracts/src/HyperdriveLP.sol @@ -204,10 +204,11 @@ abstract contract HyperdriveLP is IHyperdriveWrite, HyperdriveTWAP { uint256 lpSharePrice = lpTotalSupply == 0 ? 0 : startingPresentValue.divDown(lpTotalSupply); + uint256 baseContribution = _convertToBaseFromOption(_contribution, sharePrice, _options); emit AddLiquidity( _options.destination, lpShares, - vaultShares.mulDown(sharePrice), + baseContribution, sharePrice, lpSharePrice ); diff --git a/contracts/src/HyperdriveLong.sol b/contracts/src/HyperdriveLong.sol index 927ad76bd..c23c59c31 100644 --- a/contracts/src/HyperdriveLong.sol +++ b/contracts/src/HyperdriveLong.sol @@ -171,12 +171,12 @@ abstract contract HyperdriveLong is IHyperdriveWrite, HyperdriveLP { maturityTime ); - // Update the checkpoint and global longExposure + // Update the checkpoint exposure and global long exposure. uint256 checkpointTime = maturityTime - _positionDuration; int128 checkpointExposureBefore = int128( - _checkpoints[checkpointTime].longExposure + _checkpoints[checkpointTime].exposure ); - _updateCheckpointLongExposureOnClose( + _updateCheckpointExposureOnClose( _bondAmount, shareCurveDelta, bondReservesDelta, @@ -187,7 +187,7 @@ abstract contract HyperdriveLong is IHyperdriveWrite, HyperdriveLP { ); _updateLongExposure( checkpointExposureBefore, - _checkpoints[checkpointTime].longExposure + _checkpoints[checkpointTime].exposure ); // Distribute the excess idle to the withdrawal pool. @@ -197,7 +197,7 @@ abstract contract HyperdriveLong is IHyperdriveWrite, HyperdriveLP { // Withdraw the profit to the trader. uint256 proceeds = _withdraw(shareProceeds, _options); - // Enforce min user outputs + // Enforce min user outputs. uint256 baseProceeds = _convertToBaseFromOption( proceeds, sharePrice, @@ -262,12 +262,12 @@ abstract contract HyperdriveLong is IHyperdriveWrite, HyperdriveLP { IHyperdrive.Checkpoint storage checkpoint = _checkpoints[ _checkpointTime ]; - int128 checkpointExposureBefore = int128(checkpoint.longExposure); - uint128 longExposureDelta = (2 * + int128 checkpointExposureBefore = int128(checkpoint.exposure); + uint128 exposureDelta = (2 * _bondProceeds - _shareReservesDelta.mulDown(_sharePrice)).toUint128(); - checkpoint.longExposure += int128(longExposureDelta); - _updateLongExposure(checkpointExposureBefore, checkpoint.longExposure); + checkpoint.exposure += int128(exposureDelta); + _updateLongExposure(checkpointExposureBefore, checkpoint.exposure); // We need to check solvency because longs increase the system's exposure. if (!_isSolvent(_sharePrice)) { diff --git a/contracts/src/HyperdriveShort.sol b/contracts/src/HyperdriveShort.sol index 8e4a2c1b7..62c203072 100644 --- a/contracts/src/HyperdriveShort.sol +++ b/contracts/src/HyperdriveShort.sol @@ -175,12 +175,12 @@ abstract contract HyperdriveShort is IHyperdriveWrite, HyperdriveLP { maturityTime ); - // Update the checkpoint and global longExposure + // Update the checkpoint exposure and global long exposure. uint256 checkpointTime = maturityTime - _positionDuration; int128 checkpointExposureBefore = int128( - _checkpoints[checkpointTime].longExposure + _checkpoints[checkpointTime].exposure ); - _updateCheckpointLongExposureOnClose( + _updateCheckpointExposureOnClose( bondAmount, shareCurveDelta, bondReservesDelta, @@ -191,7 +191,7 @@ abstract contract HyperdriveShort is IHyperdriveWrite, HyperdriveLP { ); _updateLongExposure( checkpointExposureBefore, - _checkpoints[checkpointTime].longExposure + _checkpoints[checkpointTime].exposure ); // Distribute the excess idle to the withdrawal pool. @@ -277,17 +277,17 @@ abstract contract HyperdriveShort is IHyperdriveWrite, HyperdriveLP { revert IHyperdrive.InvalidShareReserves(); } - // Update the checkpoint's short deposits and decrease the long exposure. + // Update the checkpoint's short deposits and decrease the exposure. uint256 _latestCheckpoint = _latestCheckpoint(); int128 checkpointExposureBefore = int128( - _checkpoints[_latestCheckpoint].longExposure + _checkpoints[_latestCheckpoint].exposure ); - _checkpoints[_latestCheckpoint].longExposure -= int128( + _checkpoints[_latestCheckpoint].exposure -= int128( _bondAmount.toUint128() ); _updateLongExposure( checkpointExposureBefore, - _checkpoints[_latestCheckpoint].longExposure + _checkpoints[_latestCheckpoint].exposure ); // Opening a short decreases the system's exposure because the short's diff --git a/contracts/src/interfaces/IHyperdrive.sol b/contracts/src/interfaces/IHyperdrive.sol index c3e4acf65..5353547df 100644 --- a/contracts/src/interfaces/IHyperdrive.sol +++ b/contracts/src/interfaces/IHyperdrive.sol @@ -130,8 +130,9 @@ interface IHyperdrive is /// as well as the share price at closing of matured longs and /// shorts. uint128 sharePrice; - /// @dev The amount lp exposure on longs. - int128 longExposure; + /// @dev If exposure is positive, then we have net long exposure, otherwise + /// we have net short exposure in the checkpoint. + int128 exposure; } struct WithdrawPool { diff --git a/contracts/test/MockHyperdriveMath.sol b/contracts/test/MockHyperdriveMath.sol index 0bbb6e743..8ac3942e6 100644 --- a/contracts/test/MockHyperdriveMath.sol +++ b/contracts/test/MockHyperdriveMath.sol @@ -165,12 +165,12 @@ contract MockHyperdriveMath { function calculateMaxLong( HyperdriveUtils.MaxTradeParams memory _params, - int256 _checkpointLongExposure, + int256 _checkpointExposure, uint256 _maxIterations ) external pure returns (uint256, uint256) { (uint256 result1, uint256 result2) = HyperdriveUtils.calculateMaxLong( _params, - _checkpointLongExposure, + _checkpointExposure, _maxIterations ); return (result1, result2); diff --git a/crates/hyperdrive-math/src/long.rs b/crates/hyperdrive-math/src/long.rs index 6ef8b09d4..a01ce1e7b 100644 --- a/crates/hyperdrive-math/src/long.rs +++ b/crates/hyperdrive-math/src/long.rs @@ -319,7 +319,7 @@ impl State { /// amount $x$. /// /// Since longs can net out with shorts in this checkpoint, we decrease - /// the global exposure variable by any negative long exposure we have + /// the global exposure variable by any negative exposure we have /// in the checkpoint. The pool's solvency is calculated as: /// /// $$ @@ -337,7 +337,7 @@ impl State { /// /// ```solidity /// shareReservesDelta = _shareAmount - governanceCurveFee.divDown(_sharePrice); - /// uint128 longExposureDelta = (2 * + /// uint128 exposureDelta = (2 * /// _bondProceeds - /// _shareReservesDelta.mulDown(_sharePrice)).toUint128(); /// ``` diff --git a/crates/hyperdrive-math/src/short.rs b/crates/hyperdrive-math/src/short.rs index 547a421cc..ffd6bf738 100644 --- a/crates/hyperdrive-math/src/short.rs +++ b/crates/hyperdrive-math/src/short.rs @@ -701,7 +701,7 @@ mod tests { let state = alice.get_state().await?; let Checkpoint { share_price: open_share_price, - long_exposure: checkpoint_exposure, + exposure: checkpoint_exposure, .. } = alice .get_checkpoint(state.to_checkpoint(alice.now().await?)) diff --git a/crates/hyperdrive-math/tests/integration_tests.rs b/crates/hyperdrive-math/tests/integration_tests.rs index 388a464fd..96de0707a 100644 --- a/crates/hyperdrive-math/tests/integration_tests.rs +++ b/crates/hyperdrive-math/tests/integration_tests.rs @@ -118,7 +118,7 @@ pub async fn test_integration_get_max_short() -> Result<()> { let state = alice.get_state().await?; let Checkpoint { share_price: open_share_price, - long_exposure: checkpoint_exposure, + exposure: checkpoint_exposure, .. } = alice .get_checkpoint(state.to_checkpoint(alice.now().await?)) diff --git a/crates/test-utils/src/agent.rs b/crates/test-utils/src/agent.rs index eac029e91..a7e54ff7f 100644 --- a/crates/test-utils/src/agent.rs +++ b/crates/test-utils/src/agent.rs @@ -954,11 +954,11 @@ impl Agent { /// Gets the max long that can be opened in the current checkpoint. pub async fn get_max_long(&self, maybe_max_iterations: Option) -> Result { let state = self.get_state().await?; - let Checkpoint { long_exposure, .. } = self + let Checkpoint { exposure, .. } = self .hyperdrive .get_checkpoint(state.to_checkpoint(self.now().await?)) .await?; - Ok(state.get_max_long(self.wallet.base, long_exposure, maybe_max_iterations)) + Ok(state.get_max_long(self.wallet.base, exposure, maybe_max_iterations)) } /// Gets the max short that can be opened in the current checkpoint. @@ -976,7 +976,7 @@ impl Agent { let state = self.get_state().await?; let Checkpoint { share_price: open_share_price, - long_exposure: checkpoint_exposure, + exposure: checkpoint_exposure, .. } = self .hyperdrive diff --git a/crates/test-utils/src/crash_reports.rs b/crates/test-utils/src/crash_reports.rs index 67d32980b..a26882b0e 100644 --- a/crates/test-utils/src/crash_reports.rs +++ b/crates/test-utils/src/crash_reports.rs @@ -143,14 +143,14 @@ impl From for PoolInfo { #[serde(rename_all = "camelCase")] struct RawCheckpoint { share_price: u128, - long_exposure: i128, + exposure: i128, } impl From for Checkpoint { fn from(r: RawCheckpoint) -> Self { Self { share_price: r.share_price.into(), - long_exposure: r.long_exposure.into(), + exposure: r.exposure.into(), } } } @@ -311,7 +311,7 @@ mod tests { }, "raw_checkpoint": { "sharePrice": 1000000000000000000, - "longExposure": 0 + "exposure": 0 }, "anvil_dump_state": "0x7b22", "additional_info": { @@ -387,7 +387,7 @@ mod tests { }, "checkpoint_info": { "sharePrice": "1.0", - "longExposure": "0.0", + "exposure": "0.0", "blockNumber": 16, "timestamp": "2023-10-20 14:28:34" } @@ -460,7 +460,7 @@ mod tests { }, checkpoint: Checkpoint { share_price: 1000000000000000000, - long_exposure: 0, + exposure: 0, }, // State Dump state_dump: "0x7b22".parse()?, diff --git a/test/integrations/hyperdrive/LpWithdrawalTest.t.sol b/test/integrations/hyperdrive/LpWithdrawalTest.t.sol index 493dd22d6..7598316a9 100644 --- a/test/integrations/hyperdrive/LpWithdrawalTest.t.sol +++ b/test/integrations/hyperdrive/LpWithdrawalTest.t.sol @@ -678,7 +678,7 @@ contract LpWithdrawalTest is HyperdriveTest { // // This test ensures that two LPs (Alice and Celine) will receive a fair // share of the withdrawal pool's profits if Alice has entirely long - // longExposure, Celine has entirely short exposure, Alice redeems immediately + // exposure, Celine has entirely short exposure, Alice redeems immediately // after the long is closed, and Celine redeems after the short is redeemed. function _test_lp_withdrawal_long_short_redemption( uint256 longBasePaid, @@ -920,7 +920,7 @@ contract LpWithdrawalTest is HyperdriveTest { // This test is designed to find cases where the longs are insolvent after the LP removes funds // and the short is closed. This will only pass if the long exposure is calculated to account for - // where the cases where the shorts deposit is larger than the long's fixed rate, but the short is + // the cases where the shorts deposit is larger than the long's fixed rate, but the short is // shorting less bonds than the long is longing. function _test_single_lp_withdrawal_long_short_redemption( uint256 longBasePaid, diff --git a/test/units/hyperdrive/ExtremeInputs.t.sol b/test/units/hyperdrive/ExtremeInputs.t.sol index fb3e30389..a23bb4977 100644 --- a/test/units/hyperdrive/ExtremeInputs.t.sol +++ b/test/units/hyperdrive/ExtremeInputs.t.sol @@ -208,7 +208,7 @@ contract ExtremeInputs is HyperdriveTest { curveFee: poolConfig.fees.curve, governanceFee: poolConfig.fees.governance }), - checkpoint.longExposure, + checkpoint.exposure, 7 ); baseToken.mint(shortAmount); diff --git a/test/units/libraries/HyperdriveMath.t.sol b/test/units/libraries/HyperdriveMath.t.sol index 6053d76d7..bf1ec1f42 100644 --- a/test/units/libraries/HyperdriveMath.t.sol +++ b/test/units/libraries/HyperdriveMath.t.sol @@ -869,9 +869,7 @@ contract HyperdriveMathTest is HyperdriveTest { curveFee: config.fees.curve, governanceFee: config.fees.governance }), - hyperdrive - .getCheckpoint(hyperdrive.latestCheckpoint()) - .longExposure, + hyperdrive.getCheckpoint(hyperdrive.latestCheckpoint()).exposure, maxIterations ); (uint256 maturityTime, uint256 longAmount) = openLong(bob, maxLong); @@ -1030,7 +1028,7 @@ contract HyperdriveMathTest is HyperdriveTest { curveFee: config.fees.curve, governanceFee: config.fees.governance }), - checkpoint.longExposure, + checkpoint.exposure, 7 ); (uint256 maturityTime, ) = openShort(bob, maxShort); diff --git a/test/utils/HyperdriveUtils.sol b/test/utils/HyperdriveUtils.sol index 850097e13..8d4007f76 100644 --- a/test/utils/HyperdriveUtils.sol +++ b/test/utils/HyperdriveUtils.sol @@ -192,7 +192,7 @@ library HyperdriveUtils { curveFee: poolConfig.fees.curve, governanceFee: poolConfig.fees.governance }), - checkpoint.longExposure, + checkpoint.exposure, _maxIterations ); return baseAmount; @@ -235,7 +235,7 @@ library HyperdriveUtils { curveFee: poolConfig.fees.curve, governanceFee: poolConfig.fees.governance }), - checkpoint.longExposure, + checkpoint.exposure, _maxIterations ); } @@ -269,14 +269,14 @@ library HyperdriveUtils { /// to 1. If we are solvent at this point, then we're done. Otherwise, /// we approach the max long iteratively using Newton's method. /// @param _params The parameters for the max long calculation. - /// @param _checkpointLongExposure The long exposure in the checkpoint. + /// @param _checkpointExposure The exposure in the checkpoint. /// @param _maxIterations The maximum number of iterations to use in the /// Newton's method loop. /// @return maxBaseAmount The maximum base amount. /// @return maxBondAmount The maximum bond amount. function calculateMaxLong( MaxTradeParams memory _params, - int256 _checkpointLongExposure, + int256 _checkpointExposure, uint256 _maxIterations ) internal pure returns (uint256 maxBaseAmount, uint256 maxBondAmount) { // Get the maximum long that brings the spot price to 1. If the pool is @@ -305,7 +305,7 @@ library HyperdriveUtils { ); (, bool isSolvent_) = calculateSolvencyAfterLong( _params, - _checkpointLongExposure, + _checkpointExposure, absoluteMaxBaseAmount, absoluteMaxBondAmount, spotPrice @@ -335,7 +335,7 @@ library HyperdriveUtils { maxBaseAmount = calculateMaxLongGuess( _params, absoluteMaxBaseAmount, - _checkpointLongExposure, + _checkpointExposure, spotPrice ); maxBondAmount = calculateLongAmount( @@ -346,7 +346,7 @@ library HyperdriveUtils { ); (uint256 solvency_, bool success) = calculateSolvencyAfterLong( _params, - _checkpointLongExposure, + _checkpointExposure, maxBaseAmount, maxBondAmount, spotPrice @@ -390,7 +390,7 @@ library HyperdriveUtils { ); (solvency_, success) = calculateSolvencyAfterLong( _params, - _checkpointLongExposure, + _checkpointExposure, possibleMaxBaseAmount, possibleMaxBondAmount, spotPrice @@ -510,20 +510,20 @@ library HyperdriveUtils { /// @param _params The max long calculation parameters. /// @param _absoluteMaxBaseAmount The absolute max base amount that can be /// used to open a long. - /// @param _checkpointLongExposure The long exposure in the checkpoint. + /// @param _checkpointExposure The exposure in the checkpoint. /// @param _spotPrice The spot price of the pool. /// @return A conservative estimate of the max long that the pool can open. function calculateMaxLongGuess( MaxTradeParams memory _params, uint256 _absoluteMaxBaseAmount, - int256 _checkpointLongExposure, + int256 _checkpointExposure, uint256 _spotPrice ) internal pure returns (uint256) { // Get an initial estimate of the max long by using the spot price as // our conservative price. uint256 guess = calculateMaxLongEstimate( _params, - _checkpointLongExposure, + _checkpointExposure, _spotPrice, _spotPrice ); @@ -545,7 +545,7 @@ library HyperdriveUtils { // estimate of the realized price. guess = calculateMaxLongEstimate( _params, - _checkpointLongExposure, + _checkpointExposure, _spotPrice, estimateSpotPrice ); @@ -589,17 +589,17 @@ library HyperdriveUtils { /// } /// $$ /// @param _params The max long calculation parameters. - /// @param _checkpointLongExposure The long exposure in the checkpoint. + /// @param _checkpointExposure The exposure in the checkpoint. /// @param _spotPrice The spot price of the pool. /// @param _estimatePrice The estimated realized price the max long will pay. /// @return A conservative estimate of the max long that the pool can open. function calculateMaxLongEstimate( MaxTradeParams memory _params, - int256 _checkpointLongExposure, + int256 _checkpointExposure, uint256 _spotPrice, uint256 _estimatePrice ) internal pure returns (uint256) { - uint256 checkpointExposure = uint256(-_checkpointLongExposure.min(0)); + uint256 checkpointExposure = uint256(-_checkpointExposure.min(0)); uint256 estimate = (_params.shareReserves + checkpointExposure.divDown(_params.sharePrice) - _params.longExposure.divDown(_params.sharePrice) - @@ -619,7 +619,7 @@ library HyperdriveUtils { /// base amount $x$. /// /// Since longs can net out with shorts in this checkpoint, we decrease - /// the global exposure variable by any negative long exposure we have + /// the global exposure variable by any negative exposure we have /// in the checkpoint. The pool's solvency is calculated as: /// /// $$ @@ -637,7 +637,7 @@ library HyperdriveUtils { /// /// ``` /// shareReservesDelta = _shareAmount - governanceCurveFee.divDown(_sharePrice) - /// uint128 longExposureDelta = (2 * + /// uint128 exposureDelta = (2 * /// _bondProceeds - /// _shareReservesDelta.mulDown(_sharePrice)).toUint128(); /// ``` @@ -660,7 +660,7 @@ library HyperdriveUtils { /// this case, we return `false` since the fixed point library can't /// represent negative numbers. /// @param _params The max long calculation parameters. - /// @param _checkpointLongExposure The long exposure in the checkpoint. + /// @param _checkpointExposure The exposure in the checkpoint. /// @param _baseAmount The base amount. /// @param _bondAmount The bond amount. /// @param _spotPrice The spot price. @@ -669,7 +669,7 @@ library HyperdriveUtils { /// if false. function calculateSolvencyAfterLong( MaxTradeParams memory _params, - int256 _checkpointLongExposure, + int256 _checkpointExposure, uint256 _baseAmount, uint256 _bondAmount, uint256 _spotPrice @@ -688,7 +688,7 @@ library HyperdriveUtils { _bondAmount - _baseAmount + governanceFee; - uint256 checkpointExposure = uint256(-_checkpointLongExposure.min(0)); + uint256 checkpointExposure = uint256(-_checkpointExposure.min(0)); if ( shareReserves + checkpointExposure.divDown(_params.sharePrice) >= exposure.divDown(_params.sharePrice) + _params.minimumShareReserves @@ -1131,7 +1131,7 @@ library HyperdriveUtils { /// @param _params Information about the market state and pool configuration /// used to compute the maximum trade. /// @param _spotPrice The spot price. - /// @param _checkpointExposure The long exposure from the current checkpoint. + /// @param _checkpointExposure The exposure from the current checkpoint. /// @return The initial guess for the max short calculation. function calculateMaxShortGuess( MaxTradeParams memory _params, @@ -1196,7 +1196,7 @@ library HyperdriveUtils { /// @param _shortAmount The short amount. /// @param _effectiveShareReserves The effective share reserves. /// @param _spotPrice The spot price. - /// @param _checkpointExposure The long exposure in the current checkpoint. + /// @param _checkpointExposure The exposure in the current checkpoint. /// @return The pool's solvency after a short is opened. /// @return A flag indicating whether or not the derivative was /// successfully calculated.