Skip to content

Conversation

@totomanov
Copy link
Contributor

Duplicated decimal conversion logic in Chainlink/Pyth/Redstone is refactored to ScaleUtils. Adapters now call function calcScale(uint8 baseDecimals, uint8 quoteDecimals, uint8 feedDecimals) to get priceScale and feedScale, packed into a wrapped uint256. The inverse pricing logic is now in the library. This allows us to get bidirectional adapters for free.

@totomanov totomanov mentioned this pull request Mar 16, 2024
Copy link
Contributor

@hoytech hoytech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Abstracting the scaling is a great idea.

@hoytech hoytech merged commit 02ecc45 into master Mar 16, 2024
@totomanov totomanov deleted the review-bidirectional-adapters branch March 19, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants