Skip to content

Wrong LP/Asset, LP/Sy price in PendleUniversalOracle when LP and Asset/SY decimals are differs #93

@rudewalt

Description

@rudewalt

I deployed PendleUniversalOracle on Arbitrum for getting price LP-gUSDC-18Dec2025/gUSDC

The result of method getQuote() of PendleUniversalOracle with parameters inAmount = 1e18, base = 0x18ffB61c6d223bd91ec15acC248bb7e670aBcc48, quote = 0xd3443ee1e91af28e5fb858fbd0d72a63ba8046e0 is 2599930

However the result of method getLpToAssetRate() of PendleOracle contract with parameters market = 0x18ffB61c6d223bd91ec15acC248bb7e670aBcc48, twapDuration = 900 is 2599931255361787785

I think the problem in the scale state variable in constrcutor of :

        uint8 baseDecimals = _getDecimals(base);
        uint8 quoteDecimals = _getDecimals(quote);
        scale = ScaleUtils.calcScale(baseDecimals, quoteDecimals, FEED_DECIMALS);

According to Pendle doc "About unit and decimals" we don't need to operate token decimals when using lpToAssetRate, lpToSyRate.

I think one of possible solution is to ignore base and quote decimals scale = ScaleUtils.calcScale(0, 0, FEED_DECIMALS);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions