Skip to content

Conversation

@ryangoree
Copy link
Member

@ryangoree ryangoree commented Feb 29, 2024

Fixes #808

I removed some logic in the test_checkpoint_in_the_past test that was already tested in the test_checkpoint_redemption, but lmk if this goes against your testing philosophy.

@ryangoree ryangoree changed the title bug: Use latest checkpoint vault share price if it exists when minting past checkpoints bug: Use latest checkpoint vaultSharePrice if it exists when minting past checkpoints Feb 29, 2024
@github-actions
Copy link

github-actions bot commented Mar 1, 2024

Hyperdrive Gas Benchmark

Benchmark suite Current: 4a17000 Previous: 46c834d Deviation Status
addLiquidity: min 33974 gas 1546 gas 2097.5420% 🚨
addLiquidity: avg 141807 gas 67936 gas 108.7362% 🚨
addLiquidity: max 336682 gas 293159 gas 14.8462% 🚨
checkpoint: min 29265 gas 1182 gas 2375.8883% 🚨
checkpoint: avg 106471 gas 48477 gas 119.6320% 🚨
checkpoint: max 199040 gas 191559 gas 3.9053% 🚨
closeLong: min 31333 gas 1492 gas 2000.0670% 🚨
closeLong: avg 99392 gas 29374 gas 238.3673% 🚨
closeLong: max 217386 gas 152303 gas 42.7326% 🚨
closeShort: min 31335 gas 1494 gas 1997.3896% 🚨
closeShort: avg 98205 gas 33444 gas 193.6401% 🚨
closeShort: max 193887 gas 149156 gas 29.9894% 🚨
initialize: min 31350 gas 1451 gas 2060.5789% 🚨
initialize: avg 248544 gas 213962 gas 16.1627% 🚨
initialize: max 319421 gas 253953 gas 25.7796% 🚨
openLong: min 33415 gas 1499 gas 2129.1528% 🚨
openLong: avg 124201 gas 51658 gas 140.4294% 🚨
openLong: max 245841 gas 185562 gas 32.4846% 🚨
openShort: min 33820 gas 1520 gas 2125% 🚨
openShort: avg 135785 gas 51482 gas 163.7524% 🚨
openShort: max 250793 gas 181325 gas 38.3113% 🚨
redeemWithdrawalShares: min 46854 gas 1488 gas 3048.7903% 🚨
redeemWithdrawalShares: avg 73178 gas 22375 gas 227.0525% 🚨
redeemWithdrawalShares: max 142865 gas 109301 gas 30.7079% 🚨
removeLiquidity: min 31183 gas 1530 gas 1938.1046% 🚨
removeLiquidity: avg 192131 gas 151225 gas 27.0498% 🚨
removeLiquidity: max 325809 gas 325781 gas 0.0086% 🚨

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

@ryangoree ryangoree force-pushed the ryan/fix/closest-checkpoint-price branch from c0bddc8 to 11cf464 Compare March 1, 2024 01:57
@ryangoree ryangoree marked this pull request as ready for review March 1, 2024 02:51
Copy link
Contributor

@jalextowle jalextowle left a comment

Choose a reason for hiding this comment

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

Looks great! Just one nit, and then it looks good to go. Nice job!

@ryangoree ryangoree enabled auto-merge (squash) March 1, 2024 03:41
@ryangoree ryangoree force-pushed the ryan/fix/closest-checkpoint-price branch from c54f014 to 4a17000 Compare March 1, 2024 12:26
@ryangoree ryangoree merged commit 719f186 into main Mar 1, 2024
@ryangoree ryangoree deleted the ryan/fix/closest-checkpoint-price branch March 1, 2024 13:23
jalextowle added a commit that referenced this pull request Mar 2, 2024
…g past checkpoints (#809)

* Prevent fetching the latest share price if a closer share price has already been fetched

* Update unit test

* Update test/units/hyperdrive/CheckpointTest.t.sol

Co-authored-by: Alex Towle <jalextowle@gmail.com>

---------

Co-authored-by: Alex Towle <jalextowle@gmail.com>
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.

Ensure the latest checkpoint is always the latest share price

3 participants