@@ -126,6 +126,37 @@ interface IPyth is IPythEvents {
126126 uint64 maxPublishTime
127127 ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds );
128128
129+ /// @notice Parse `updateData` and return price feeds of the given `priceIds` if they are all published
130+ /// within `minPublishTime` and `maxPublishTime,` but choose to store price updates if `storeUpdatesIfFresh`.
131+ ///
132+ /// You can use this method if you want to use a Pyth price at a fixed time and not the most recent price;
133+ /// otherwise, please consider using `updatePriceFeeds`. This method may store the price updates on-chain, if they
134+ /// are more recent than the current stored prices.
135+ ///
136+ /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
137+ /// `getUpdateFee` with the length of the `updateData` array.
138+ ///
139+ /// This method will eventually allow the caller to determine whether parsed price feeds should update
140+ /// the stored values as well.
141+ ///
142+ /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
143+ /// no update for any of the given `priceIds` within the given time range.
144+ /// @param updateData Array of price update data.
145+ /// @param priceIds Array of price ids.
146+ /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
147+ /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
148+ /// @param storeUpdatesIfFresh flag for the parse function to
149+ /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
150+ function parsePriceFeedUpdatesWithConfig (
151+ bytes [] calldata updateData ,
152+ bytes32 [] calldata priceIds ,
153+ uint64 minAllowedPublishTime ,
154+ uint64 maxAllowedPublishTime ,
155+ bool checkUniqueness ,
156+ bool checkUpdateDataIsMinimal ,
157+ bool storeUpdatesIfFresh
158+ ) public returns ( PythStructs.PriceFeed[] memory priceFeeds , uint64 [] memory slots );
159+
129160 /// @notice Parse time-weighted average price (TWAP) from two consecutive price updates for the given `priceIds`.
130161 ///
131162 /// This method calculates TWAP between two data points by processing the difference in cumulative price values
0 commit comments