Skip to content

calculatePresentValue cleanup#680

Merged
jalextowle merged 10 commits intomainfrom
jalextowle/feature/distribute-excess-idle-overhaul
Nov 21, 2023
Merged

calculatePresentValue cleanup#680
jalextowle merged 10 commits intomainfrom
jalextowle/feature/distribute-excess-idle-overhaul

Conversation

@jalextowle
Copy link
Copy Markdown
Contributor

@jalextowle jalextowle commented Nov 21, 2023

This PR cleans up the logic in calculatePresentValue and fixed a bug. This increased the codesize enough that the ERC4626HyperdriveDeployer exceeded the max code size of 24kb, so this PR also moves permitForAll into the HyperdriveTarget0 contract.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 21, 2023

Hyperdrive Gas Benchmark

Benchmark suite Current: d2bb6d2 Previous: 6a4edcf Deviation Status
addLiquidity: min 1622 gas 1622 gas 0% 🟰
addLiquidity: avg 54015 gas 54511 gas -0.9099%
addLiquidity: max 98648 gas 98352 gas 0.3010% 🚨
checkpoint: min 1216 gas 1216 gas 0% 🟰
checkpoint: avg 48260 gas 48302 gas -0.0870%
checkpoint: max 97592 gas 99770 gas -2.1830%
closeLong: min 1690 gas 1690 gas 0% 🟰
closeLong: avg 24924 gas 24967 gas -0.1722%
closeLong: max 114354 gas 114138 gas 0.1892% 🚨
closeShort: min 1693 gas 1693 gas 0% 🟰
closeShort: avg 27696 gas 27738 gas -0.1514%
closeShort: max 109072 gas 108786 gas 0.2629% 🚨
initialize: min 1605 gas 1605 gas 0% 🟰
initialize: avg 179780 gas 179603 gas 0.0986% 🚨
initialize: max 254322 gas 254125 gas 0.0775% 🚨
openLong: min 736 gas 736 gas 0% 🟰
openLong: avg 56056 gas 55945 gas 0.1984% 🚨
openLong: max 195686 gas 195381 gas 0.1561% 🚨
openShort: min 702 gas 702 gas 0% 🟰
openShort: avg 55516 gas 55421 gas 0.1714% 🚨
openShort: max 194932 gas 194872 gas 0.0308% 🚨
redeemWithdrawalShares: min 1598 gas 1598 gas 0% 🟰
redeemWithdrawalShares: avg 22426 gas 22248 gas 0.8001% 🚨
redeemWithdrawalShares: max 49853 gas 49538 gas 0.6359% 🚨
removeLiquidity: min 1661 gas 1661 gas 0% 🟰
removeLiquidity: avg 77505 gas 78876 gas -1.7382%
removeLiquidity: max 204563 gas 205229 gas -0.3245%

This comment was automatically generated by workflow using github-action-benchmark.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Nov 21, 2023

Coverage Status

coverage: 95.984% (-0.2%) from 96.217%
when pulling d2bb6d2 on jalextowle/feature/distribute-excess-idle-overhaul
into 5264062 on main.

@jalextowle jalextowle force-pushed the jalextowle/feature/distribute-excess-idle-overhaul branch from df271e2 to 07dfba8 Compare November 21, 2023 15:32
@jalextowle jalextowle changed the title WIP: Distribute Excess Idle Overhaul calculatePresentValue cleanup Nov 21, 2023
@jalextowle jalextowle requested a review from jrhea November 21, 2023 15:33
Comment thread contracts/src/internal/HyperdriveMultiToken.sol Outdated
Comment thread contracts/src/internal/HyperdriveMultiToken.sol Outdated
Comment thread contracts/src/internal/HyperdriveMultiToken.sol Outdated
Comment thread contracts/src/libraries/HyperdriveMath.sol Outdated
Comment thread contracts/src/libraries/HyperdriveMath.sol Outdated
Comment thread contracts/src/internal/HyperdriveLP.sol Outdated
Comment thread contracts/src/libraries/HyperdriveMath.sol
Comment thread contracts/src/libraries/HyperdriveMath.sol Outdated
Comment thread contracts/src/libraries/YieldSpaceMath.sol
Copy link
Copy Markdown
Contributor

@jrhea jrhea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. Just a few questions. Also, i think you need to update the names of the rust functions so the tests will pass.

@jalextowle jalextowle force-pushed the jalextowle/feature/distribute-excess-idle-overhaul branch from 45961e6 to 37e4ba2 Compare November 21, 2023 19:20
@jalextowle jalextowle force-pushed the jalextowle/feature/distribute-excess-idle-overhaul branch from 37e4ba2 to c3d60e6 Compare November 21, 2023 19:22
@jalextowle jalextowle enabled auto-merge (squash) November 21, 2023 19:52
@jalextowle jalextowle merged commit 22ab58e into main Nov 21, 2023
@jalextowle jalextowle deleted the jalextowle/feature/distribute-excess-idle-overhaul branch November 21, 2023 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants