delvtech / hyperdrive

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

FixedPointMath 100% coverage #966

Closed jrhea closed 4 months ago

jrhea commented 4 months ago

Description

Removed infeasible branch condition in calculateWeightedAverage() per Certora report. This should get fixed point math to 100% coverage.

github-actions[bot] commented 4 months ago

Hyperdrive Gas Benchmark

Benchmark suite Current: cef934cc414bbaeaeac790b833534c3952f9a48a Previous: dada2f960df0457e64eb6116e98595cb1f62c48e Deviation Status
addLiquidity: min 33893 gas 33893 gas 0% 🟰
addLiquidity: avg 144379 gas 144301 gas 0.0541% 🚨
addLiquidity: max 428319 gas 428319 gas 0% 🟰
checkpoint: min 40220 gas 40220 gas 0% 🟰
checkpoint: avg 103984 gas 104067 gas -0.0798% ✅
checkpoint: max 212154 gas 212154 gas 0% 🟰
closeLong: min 31517 gas 31517 gas 0% 🟰
closeLong: avg 137816 gas 137774 gas 0.0305% 🚨
closeLong: max 2640435 gas 2640435 gas 0% 🟰
closeShort: min 31394 gas 31394 gas 0% 🟰
closeShort: avg 132929 gas 132727 gas 0.1522% 🚨
closeShort: max 227565 gas 227565 gas 0% 🟰
initialize: min 31305 gas 31305 gas 0% 🟰
initialize: avg 253632 gas 253638 gas -0.0024% ✅
initialize: max 322760 gas 322760 gas 0% 🟰
openLong: min 33437 gas 33437 gas 0% 🟰
openLong: avg 167100 gas 167331 gas -0.1380% ✅
openLong: max 253057 gas 253162 gas -0.0415% ✅
openShort: min 33959 gas 33959 gas 0% 🟰
openShort: avg 170154 gas 170153 gas 0.0006% 🚨
openShort: max 385545 gas 385650 gas -0.0272% ✅
redeemWithdrawalShares: min 31227 gas 31227 gas 0% 🟰
redeemWithdrawalShares: avg 61899 gas 61916 gas -0.0275% ✅
redeemWithdrawalShares: max 167572 gas 167572 gas 0% 🟰
removeLiquidity: min 31191 gas 31191 gas 0% 🟰
removeLiquidity: avg 223328 gas 223242 gas 0.0385% 🚨
removeLiquidity: max 398887 gas 398887 gas 0% 🟰

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

coveralls commented 4 months ago

Coverage Status

coverage: 93.271% (+0.04%) from 93.229% when pulling cef934cc414bbaeaeac790b833534c3952f9a48a on fp-coverage into 59149017a66c71ee765b4ebe85a31a4409c659bc on main.