delvtech / hyperdrive

An automated market maker for fixed and variable yield with on-demand terms.
Apache License 2.0
25 stars 3 forks source link

Add functions to MockLPMath #1008

Closed sentilesdal closed 2 months ago

sentilesdal commented 2 months ago

Description

Adds helper methods that we can test. Adding in it's own PR here since the rust code will now live in hyperdrive-rs and this needs to land first.

Review Checklists

Please check each item before approving the pull request. While going through the checklist, it is recommended to leave comments on items that are referenced in the checklist to make sure that they are reviewed. If there are multiple reviewers, copy the checklists into sections titled ## [Reviewer Name]. If the PR doesn't touch Solidity and/or Rust, the corresponding checklist can be removed.

[[Reviewer Name]]

github-actions[bot] commented 2 months ago

Hyperdrive Gas Benchmark

Benchmark suite Current: 24c06d085e6cde096e1196a64048141c1e59356e Previous: daa84ff9d3859c973c20c668f2ca19e2836c2c0c Deviation Status
addLiquidity: min 33893 gas 33893 gas 0% 🟰
addLiquidity: avg 145057 gas 145691 gas -0.4352% βœ…
addLiquidity: max 428335 gas 428319 gas 0.0037% 🚨
checkpoint: min 40220 gas 40220 gas 0% 🟰
checkpoint: avg 104466 gas 104390 gas 0.0728% 🚨
checkpoint: max 212154 gas 212154 gas 0% 🟰
closeLong: min 31517 gas 31517 gas 0% 🟰
closeLong: avg 138613 gas 138800 gas -0.1347% βœ…
closeLong: max 2640435 gas 2640435 gas 0% 🟰
closeShort: min 31394 gas 31394 gas 0% 🟰
closeShort: avg 133220 gas 133049 gas 0.1285% 🚨
closeShort: max 227565 gas 227565 gas 0% 🟰
initialize: min 31305 gas 31305 gas 0% 🟰
initialize: avg 253643 gas 253642 gas 0.0004% 🚨
initialize: max 322898 gas 322898 gas 0% 🟰
openLong: min 33437 gas 33437 gas 0% 🟰
openLong: avg 167196 gas 167314 gas -0.0705% βœ…
openLong: max 253057 gas 253057 gas 0% 🟰
openShort: min 33959 gas 33959 gas 0% 🟰
openShort: avg 170200 gas 170230 gas -0.0176% βœ…
openShort: max 385545 gas 385545 gas 0% 🟰
redeemWithdrawalShares: min 31227 gas 31227 gas 0% 🟰
redeemWithdrawalShares: avg 62864 gas 62768 gas 0.1529% 🚨
redeemWithdrawalShares: max 167572 gas 167572 gas 0% 🟰
removeLiquidity: min 31191 gas 31191 gas 0% 🟰
removeLiquidity: avg 222030 gas 221627 gas 0.1818% 🚨
removeLiquidity: max 398887 gas 398863 gas 0.0060% 🚨

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