Skip to content

Constant round ID implementation leads to inconsistent Chainlink interface behavior #13

@niccolo-3sigma

Description

@niccolo-3sigma

Description

The ERC4626PriceFeed contract serves as an adapter to expose ERC4626 vault share pricing through the Chainlink AggregatorV2V3Interface. The contract implements price feed functionality by calling vault.convertToAssets(1e18) to determine the asset value of vault shares. However, the current implementation uses a constant CURRENT_ROUND_ID = 1 for all round-related functions, effectively treating all price queries as the same round regardless of when they occur. This breaks the Chainlink interface expectation that different rounds represent distinct data points. Functions like ERC4626PriceFeed::getRoundData and ERC4626PriceFeed::getAnswer will always return the current real-time price for any valid round ID, making historical data retrieval impossible and potentially breaking integrations that rely on proper round differentiation.

Recommendation

Implement proper round tracking by introducing storage variables to track round increments and store historical round data. Add a currentRoundId storage variable that increments when new data is fetched, and use mappings to store round-specific data for retrieval by historical round queries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impact: NoneIssue of NONE impactStatus: Dismissedissues was discussed and deemed invalid by the clientType: SuggestionSuggestion made by the team to improve protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions