Skip to content
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
36797c7
Use safe functions more consistently in `calculateNetCurveTradeSafe`
jalextowle Feb 29, 2024
bf48523
Fail if `calculateSharesOutGivenBondsInDownSafe` underflows
jalextowle Mar 1, 2024
9abab7a
Fixed the rust tests
jalextowle Mar 1, 2024
5102086
Improved the system's liveness when the present value can't be computed
jalextowle Mar 1, 2024
93c3fda
Improved the liveness properties of `removeLiquidity`
jalextowle Mar 1, 2024
682a92d
Ignore `calculateLPSharePrice` failures in `removeLiquidity`
jalextowle Mar 1, 2024
722d3e3
Ensure that the ending indexes are valid in `HyperdriveFactory` getters
jalextowle Feb 27, 2024
4c3aeba
Used unchecked arithmetic in several places
jalextowle Mar 1, 2024
4da6f25
Made the `LPMath` safer and used unchecked arithmetic
jalextowle Mar 2, 2024
f0b0023
Use unchecked arithmetic in the rest of the contracts
jalextowle Mar 2, 2024
2a853e6
Consolidated the derivative functions in the `LPMath` library
jalextowle Mar 2, 2024
88cbfb0
Addressed review feedback from @jrhea
jalextowle Mar 5, 2024
49c01a7
Simplified the main loop of `calculateDistributeExcessIdle`
jalextowle Mar 7, 2024
00aeb84
Merge remote-tracking branch 'origin/main' into jalextowle/audit/spea…
jalextowle Mar 7, 2024
7cf1aa0
Merge remote-tracking branch 'origin/main' into jalextowle/audit/spea…
jalextowle Mar 7, 2024
2107627
Addressed review feedback from @saw-mon-and-natalie
jalextowle Mar 4, 2024
c4a1d61
Addressed review feedback from @saw-mon-and-natalie
jalextowle Mar 5, 2024
587d9f5
Merge remote-tracking branch 'origin/main' into jalextowle/audit/spea…
jalextowle Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/src/libraries/LPMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,11 @@ library LPMath {
return 0;
}

// If the max bond amount is greater than or equal to the
// net curve trade, then Newton's method has terminated since
// If the max bond amount is less than or equal to the net
// curve trade, then Newton's method has terminated since
// proceeding to the next step would result in reaching the
// same point.
if (maxBondAmount >= uint256(_params.netCurveTrade)) {
if (maxBondAmount <= uint256(_params.netCurveTrade)) {
return shareProceeds;
}
// Otherwise, we continue to the next iteration of Newton's
Expand Down Expand Up @@ -840,15 +840,15 @@ library LPMath {
///
/// (1) zeta > 0:
///
/// y_max_out(dz) = (z - dz) - zeta * ((z - dz) / z) - z_min
/// z_max_out(dz) = ((z - dz) / z) * (z - zeta) - z_min
///
/// =>
///
/// PV(dz) = zeta * ((z - dz) / z) + net_f
///
/// (2) zeta <= 0:
///
/// y_max_out(dz) = (z - dz) - z_min
/// z_max_out(dz) = (z - dz) - z_min
///
/// =>
///
Expand Down