keep-starknet-strange / satoru

Synthetics platform for Starknet, inspired by GMX v2 design.
https://book.satoru.run/
MIT License
110 stars 74 forks source link

test: Improve tests of `pricing_utils` library. #494

Open sparqet opened 9 months ago

sparqet commented 9 months ago

Description

Implement and improve tests of pricing_utils library.

File: test/pricing/pricing_utils.cairo.

Acceptance criteria

ametel01 commented 9 months ago

Happy to take this

Sk8erboi84 commented 9 months ago

Assigned 🔥

ametel01 commented 9 months ago

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.