Assessment reports>Ostium>Medium findings>Premium price feeds are not used for premium feed pairs
Category: Coding Mistakes

Premium price feeds are not used for premium feed pairs

Medium Severity
Medium Impact
High Likelihood

Description

To fulfill an order, the function performUpkeep calls fulfill with the PriceUpKeepAnswer as an argument. Following is the struct:

struct PriceUpKeepAnswer {
    uint256 orderId;
    int192 price;
    bool isPremium;
    uint64 spreadP;
    int192 bid;
    int192 ask;
}

If the pair has a premium feed, the boolean isPremium should be true. But, this function performUpkeep does not set this variable to true, and hence all the price feeds are treated as nonpremium even if they are premium.

Impact

Premium price feeds are not used for premium feed pairs.

Recommendations

Set a.isPremium to true if the pair has premium price feed.

Remediation

This issue has been acknowledged by Ostium Labs, and a fix was implemented in commit db8d5a4a.

Zellic © 2024Back to top ↑