Skip to content

HyperdriveFactory Cleanup#735

Merged
jalextowle merged 5 commits intomainfrom
jalextowle/feature/factory-cleanup
Jan 22, 2024
Merged

HyperdriveFactory Cleanup#735
jalextowle merged 5 commits intomainfrom
jalextowle/feature/factory-cleanup

Conversation

@jalextowle
Copy link
Copy Markdown
Contributor

@jalextowle jalextowle commented Jan 22, 2024

Fixes: #510.
Fixes: #719.

This PR makes several changes to the HyperdriveFactory:

  1. Adds a min and max range for the checkpoint duration, position duration, and fees. This allows users to set custom parameters within the guardrails set by governance. As part of this, a checkpointResolution was added that must be respected by checkpoint and position durations.
  2. Renames hyperdriveDeployer to deployerCoordinator to more clearly communicate that the factory is making use of a coordinator that may itself deploy several underlying contracts.

@jalextowle jalextowle requested a review from jrhea January 22, 2024 18:11
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 22, 2024

Hyperdrive Gas Benchmark

Benchmark suite Current: a60fd8d Previous: cb658de Deviation Status
addLiquidity: min 1633 gas 1633 gas 0% 🟰
addLiquidity: avg 66504 gas 66907 gas -0.6023%
addLiquidity: max 291577 gas 291577 gas 0% 🟰
checkpoint: min 1150 gas 1150 gas 0% 🟰
checkpoint: avg 47794 gas 47764 gas 0.0628% 🚨
checkpoint: max 190769 gas 190769 gas 0% 🟰
closeLong: min 1558 gas 1558 gas 0% 🟰
closeLong: avg 28046 gas 28067 gas -0.0748%
closeLong: max 150962 gas 151830 gas -0.5717%
closeShort: min 1549 gas 1549 gas 0% 🟰
closeShort: avg 29828 gas 29837 gas -0.0302%
closeShort: max 145418 gas 145418 gas 0% 🟰
initialize: min 1582 gas 1582 gas 0% 🟰
initialize: avg 213244 gas 213244 gas 0% 🟰
initialize: max 255056 gas 255056 gas 0% 🟰
openLong: min 1487 gas 1487 gas 0% 🟰
openLong: avg 50474 gas 50454 gas 0.0396% 🚨
openLong: max 184813 gas 184813 gas 0% 🟰
openShort: min 1608 gas 1608 gas 0% 🟰
openShort: avg 49940 gas 49977 gas -0.0740%
openShort: max 180216 gas 180216 gas 0% 🟰
redeemWithdrawalShares: min 1575 gas 1575 gas 0% 🟰
redeemWithdrawalShares: avg 18922 gas 19850 gas -4.6751%
redeemWithdrawalShares: max 57733 gas 57733 gas 0% 🟰
removeLiquidity: min 1639 gas 1639 gas 0% 🟰
removeLiquidity: avg 149629 gas 146851 gas 1.8917% 🚨
removeLiquidity: max 323845 gas 323845 gas 0% 🟰

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

Comment thread contracts/src/factory/HyperdriveFactory.sol Outdated
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jan 22, 2024

Coverage Status

coverage: 95.52% (+0.3%) from 95.216%
when pulling a60fd8d on jalextowle/feature/factory-cleanup
into cb658de on main.

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.

code and tests look good. just that one nit to fix

Co-authored-by: Jonny Rhea <5555162+jrhea@users.noreply.github.com>
@jalextowle jalextowle enabled auto-merge (squash) January 22, 2024 20:16
@jalextowle jalextowle merged commit 73b7616 into main Jan 22, 2024
@jalextowle jalextowle deleted the jalextowle/feature/factory-cleanup branch January 22, 2024 21:46
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.

HyperdriveFactory cleanup Bucketing maturity times leads to timing swaps

3 participants