Architecture
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.
Aggregation
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.
Explore
We have a fully-fledged explorer available on our website. There you can explore what's happening on and off-chain, who is providing data etc. If there is any other information you would like to see displayed over there, let us know!
Security
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 matthias@pragma.build
Deployed Contracts
On Starknet, the contracts are currently deployed at the following addresses:
Contract | Testnet | Mainnet |
---|---|---|
Publisher Registry | Sepolia | Mainnet |
Oracle | Sepolia | Mainnet |
Pragma v2
Pragma X is the V2 of the oracle, currently live only on testnet. If you want to learn more about its architecture, you can watch this or this, if you prefer to read, take a look at our Docs.