Pragma, Starknet's native provable oracle.
Pragma is a decentralized oracle built natively on Starknet. It leverages cairo to make data feeds computation fully trustless.
- Pragma is built from the ground up to remove any trust assumptions in current oracles' design. There isn't any off-chain infrastructure, raw-data is directly pushed on-chain by whitelisted data providers. Then the aggregation happens at the smart contract level.
- Pragma offers a top-notch developer experience, reviewed by key actors of DeFi on Starknet. The goal is to make the life of DeFi protocols as easy as possible.
- Account contract mostly use for testing purposes and as a reference.
- Admin contract will be replaced by Argent's multisig as it gets released.
- Entry & Data Structures defines data structures used within the protocol along with generic aggregations methods. It is designed from the ground up to ensure that adding new entry types is done seamlessly without involving any breaking changes.
- Operations defines a few utilities libraries (time series, sorting, bits manipulation) that will be used for different aggregation methods and optimizing storage operations.
- Oracle is the main entrypoint of the protocol. It is the contract that end developers will interact with to fetch any kind of data. It's been thought and built for retro-compatibility and heavily leverages unique aspects of Cairo, notably enums, traits and generics.
- Publisher Registry handles the registration of different publishers along with the sources they are allowed to push data from.
- Summary Stats acts as a proxy contract for more sophisticated kind of data aggregation such as volatility and mean.
- Test suite, unit tests are provided under the functions' implementations directly whereas full flow integration tests lie within this test suite. It uses cairo-test for now and test thoroughly for any edge case.
A few key testing features are missing such as fuzzing and proper hooks, mocking cheatcodes. This will come as cairo tooling matures and improves.
More extensive documentation can be found on our official website.
This repo will gradually replace the previous Pragma implementation in Cairo 0 which you can find here.
Starknet Testnet
- Oracle Proxy : TODO
- Publisher Registry : TODO
- Summary Stats : TODO
Starknet Mainnet
๐
TODO
For any question or feedback you can send an email to [email protected].
The code is under the GNU AFFERO GENERAL PUBLIC LICENSE v3.0, see LICENSE.