satoru icon indicating copy to clipboard operation
satoru copied to clipboard

test: Improve tests of `pricing_utils` library.

Open sparqet opened this issue 1 year ago • 3 comments

Description

Implement and improve tests of pricing_utils library.

File: test/pricing/pricing_utils.cairo.

Acceptance criteria

  • Unit tests (nominal and failure) are implemented and passing.

sparqet avatar Oct 04 '23 10:10 sparqet

Happy to take this

ametel01 avatar Oct 04 '23 11:10 ametel01

Assigned 🔥

Sk8erboi84 avatar Oct 04 '23 12:10 Sk8erboi84

Hey @sparqet and @Sk8erboi84,

I've been looking into how we handle exponent operations, particularly in fn apply_exponent_factor(). Using a fixed point library might be a more efficient approach, drawing parallels to GMX's method. Here's an illustrative snippet:

uint256 weiValue = PRBMathUD60x18.pow(
    floatToWei(floatValue),
    floatToWei(exponentFactor)
);

I propose considering the cubit library for such operations. Would love to hear your feedback.

ametel01 avatar Oct 05 '23 23:10 ametel01