Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Remove magic numbers #39

Open
0xKitsune opened this issue Dec 27, 2022 · 0 comments
Open

Remove magic numbers #39

0xKitsune opened this issue Dec 27, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@0xKitsune
Copy link
Owner

A contant value should be used anywhere there is a U256 value that never changes.

For example:

      //Set sqrt_price_limit_x_96 to the max or min sqrt price in the pool depending on zero_for_one
        let sqrt_price_limit_x_96 = if zero_for_one {
            U256::from("4295128739") + 1
        } else {
            U256::from("0xFFFD8963EFD1FC6A506488495D951D5263988D26") - 1
        };

All of these values should be changed to match this format:

pub const MIN_SQRT_RATIO: U256 = U256([285968860985, 0, 0, 0]);
pub const MAX_SQRT_RATIO: U256 = U256([
    9809463991923573570,
    227557619515130776,
    5049738529920590081,
    1,
]);
@0xKitsune 0xKitsune added enhancement New feature or request good first issue Good for newcomers labels Dec 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant