sherlock-audit / 2024-02-optimism-2024-judging

4 stars 3 forks source link

Quantitative comparison between bond pricing actual formula vs theoretical vs python implementation #232

Closed sherlock-admin4 closed 4 months ago

sherlock-admin4 commented 5 months ago

Quantitative comparison between bond pricing actual formula vs theoretical vs python implementation

Low/Info issue submitted by GalloDaSballo

Summary

The following sheet contains the comparison between formulas you are using for pricing bond against a full precision version in python and the one in your spec docs: https://docs.google.com/spreadsheets/d/16B87ZsnlJ8a4nGHophNP6KNR3xtt5nT2utqZrB_5XPQ/edit?usp=sharing

The conclusion is that there's about a 1e6 error due to the Precision Loss from Solidity

The spec formula overquotes by a bit (see last result being above bounds), and ends up having an error that would translate to up to $1000 of bond with today prices.