The V1 of the Pragma Oracle consists of three smart contracts, that each play a role in making the oracle easy to use and robust.
The first is the Publisher Registry, which is the most static. This is designed to be updated extremely infrequently because its state should be permanent (each publisher and their address). This is currently an ownable contract but will become permissionless as Pragma decentralizes.
The second is the Oracle implementation and its proxy, which are also designed to be updated only as frequently as absolutely necessary. This is the contract which protocols use, and the one to which publishers publish. In the background, it coordinates the Publisher Registry and the Oracle contract implementation(s). The implementation contains the logic for storing and aggregating specific key/value data streams.
Our system incorporates multiple publishers, each responsible for providing data from various sources. To determine the price for a given source, we consider the prices submitted by all these publishers. Our approach involves conducting an initial on-chain aggregation based on the median of these prices. This median value then becomes the established price for that particular source.
This aggregation process is triggered when one of the aggregation functions, as outlined in the 'Consuming Data' section, is called. During this process, users have the flexibility to choose their preferred method of aggregation for the sources. This choice allows them to tailor the final price calculation according to their specific needs or criteria. By utilizing this method of aggregation, we enhance the security of the final price determination, making it less vulnerable to manipulation, as it incorporates a broad and balanced range of data from multiple publishers.
Our contracts have thoroughly been peer-reviewed by multiple actors in the starknet ecosystem. They have also undergone a full audit by Nethermind which you can find the report here.
In case you find bugs in our contracts, we have a bug bounty program in place with ImmuneFi, or you can contact us directly at email@example.com
On Starknet, the contracts are currently deployed at the following addresses:
|Testnet (Cairo 0)
|Testnet (Cairo 1)
|Mainnet (Cairo 0)
|Mainnet (Cairo 1)