This repository was archived by the owner on Mar 24, 2025. It is now read-only.
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Double inversion of Price in code Logic #722
Open
Description
Description of the Issue:
The current implementation performs price inversion twice within the cfg.Invert block, both of which happen after the ERC20 price scaling. The first inversion happens here:
connect/providers/apis/defi/uniswapv3/math.go
Lines 44 to 47 in e197035
The second reversal occurs get provider price:
connect/pkg/math/oracle/utils.go
Lines 32 to 34 in e197035
This results in a double inversion of the price when cfg.Invert is set to true, which could lead to incorrect calculations.
Suggested Fix:
Remove the first inversion and only perform the scaling operation on the ERC20 price.
Metadata
Metadata
Assignees
Labels
No labels