Skip to content

add calc_bonds_given_shares_and_rate to rust utils#632

Merged
dpaiton merged 7 commits intomainfrom
dpaiton/add-calc-bonds
Oct 26, 2023
Merged

add calc_bonds_given_shares_and_rate to rust utils#632
dpaiton merged 7 commits intomainfrom
dpaiton/add-calc-bonds

Conversation

@dpaiton
Copy link
Copy Markdown
Contributor

@dpaiton dpaiton commented Oct 24, 2023

Adds a Rust version of the solidity calculateInitialBondReserves function in HyperdriveMath.sol.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 24, 2023

Hyperdrive Gas Benchmark

Benchmark suite Current: d21d7a6 Previous: fc0d2bf Deviation Status
addLiquidity: min 733 gas 733 gas 0% 🟰
addLiquidity: avg 56856 gas 56917 gas -0.1072%
addLiquidity: max 97520 gas 97572 gas -0.0533%
checkpoint: min 558 gas 536 gas 4.1045% 🚨
checkpoint: avg 30358 gas 30360 gas -0.0066%
checkpoint: max 79983 gas 79983 gas 0% 🟰
closeLong: min 755 gas 733 gas 3.0014% 🚨
closeLong: avg 23312 gas 23235 gas 0.3314% 🚨
closeLong: max 105204 gas 106259 gas -0.9929%
closeShort: min 802 gas 802 gas 0% 🟰
closeShort: avg 24730 gas 24985 gas -1.0206%
closeShort: max 105555 gas 105686 gas -0.1240%
initialize: min 662 gas 662 gas 0% 🟰
initialize: avg 161026 gas 161053 gas -0.0168%
initialize: max 234375 gas 234375 gas 0% 🟰
openLong: min 757 gas 735 gas 2.9932% 🚨
openLong: avg 55966 gas 56019 gas -0.0946%
openLong: max 225599 gas 225577 gas 0.0098% 🚨
openShort: min 712 gas 690 gas 3.1884% 🚨
openShort: avg 56654 gas 56589 gas 0.1149% 🚨
openShort: max 220880 gas 220946 gas -0.0299%
removeLiquidity: min 777 gas 755 gas 2.9139% 🚨
removeLiquidity: avg 76758 gas 76726 gas 0.0417% 🚨
removeLiquidity: max 184507 gas 184551 gas -0.0238%

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

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Oct 24, 2023

Coverage Status

coverage: 97.107% (-0.1%) from 97.203% when pulling d21d7a6 on dpaiton/add-calc-bonds into 3b0ae37 on main.

Comment thread crates/hyperdrive-math/tests/integration_tests.rs
@dpaiton dpaiton requested a review from jalextowle October 24, 2023 05:45
@dpaiton dpaiton force-pushed the dpaiton/add-calc-bonds branch from 33fd046 to d21d7a6 Compare October 26, 2023 20:47
@dpaiton dpaiton enabled auto-merge (squash) October 26, 2023 21:00
@dpaiton dpaiton merged commit ce83bb4 into main Oct 26, 2023
@dpaiton dpaiton deleted the dpaiton/add-calc-bonds branch October 26, 2023 21:44
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.

4 participants