primitivefinance / DFMM

Smart contracts of the DFMM protocol
https://www.primitive.xyz/blog/dfmm_protocol
18 stars 6 forks source link

fix(test): log normal liquidityOf rounds up if division produces rema… #54

Closed Alexangelj closed 6 months ago

Alexangelj commented 6 months ago

…inder

The liquidityOf was using two divisions with truncations, leading the equals assertion to be 2 wei off. I fixed this by removing one division, and implementing the proper rounding logic by checking for remainders of the division we do. This should be reviewed by Clement to make sure our liquidityOf rounding should be doing this.

clemlak commented 6 months ago

The liquidityOf function was removed from the DFMM contract.