# PriceFeed

This documentation provides an overview of the key functions within the PriceFeed contract, detailing their purposes, access controls, and parameters. It is intended to assist developers and users in understanding and interacting with the contract effectively.

**Constructor**

* Initializes the contract with initial GPRO and Gold prices, initial GPRO and Gold data hashes, and an epoch interval. The deployer is set as the initial admin.

**Setter Functions**

**setData**

* Purpose: Sets the price data for a new epoch.
* Access: Only callable by an admin.
* Parameters:
  * \_goldPro: The 90-days moving average price of GPRO for the epoch.
  * \_gold: The 90-days moving average price of gold for the epoch.
  * \_goldDaily: The daily price of gold for the epoch.
  * \_epochGoldProDataSetHash: The hash of the the GPRO data for a specific epoch.
  * \_epochGoldDataSetHash: The hash of the Gold data for a specific epoch.
* Requirements: Can only be called once per epoch interval.

**updateAdminStatus**

* Purpose: Updates the admin status of an address.
* Access: Only callable by the owner.
* Parameters:
  * \_address: The address to update.
  * \_st: The new admin status (true or false).

**updateEpochInterval**

* Purpose: Updates the interval between epochs.
* Access: Only callable by the owner.
* Parameters:
  * \_epochInterval: The new epoch interval.

**Getter Functions**

**getLatestPrices**

* Purpose: Retrieves the data of the latest epoch.
* Returns: The latest epoch number, GPRO price, gold price, gold daily price, average price hash, and timestamp.

**getEpochPrices**

* Purpose: Retrieves the data for a specific epoch.
* Parameters:
  * \_epoch: The epoch number to retrieve data for.
* Returns: GPRO price, gold price, gold daily price, average price hash, and timestamp for the specified epoch.

**getEpochDataSetHash**

* Purpose: Retrieves the data sets hashes for a specific epoch.
* Parameters:
  * \_epoch: The epoch number to retrieve the hash for.
* Returns: The GPRO and Gold data set hashes for the specified epoch.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ipmb.gitbook.io/contracts/contracts/editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
