Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Improve tests of pricing_utils library. #494

Open
sparqet opened this issue Oct 4, 2023 · 3 comments · May be fixed by #500
Open

test: Improve tests of pricing_utils library. #494

sparqet opened this issue Oct 4, 2023 · 3 comments · May be fixed by #500
Assignees
Labels
enhancement New feature or request testing

Comments

@sparqet
Copy link
Collaborator

sparqet commented Oct 4, 2023

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 sparqet added enhancement New feature or request testing labels Oct 4, 2023
@ametel01
Copy link
Contributor

ametel01 commented Oct 4, 2023

Happy to take this

@Sk8erboi84
Copy link
Collaborator

Assigned 🔥

@ametel01
Copy link
Contributor

ametel01 commented Oct 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants