A general purpose price oracle leveraging ABCI++.
$ go install github.com/skip-mev/slinky
The slinky repository is composed of the following core packages:
- abci - This package contains the vote extension, proposal, and preblock handlers that are used to broadcast oracle data to the network and to store it in the blockchain.
- oracle - This package contains the main oracle that aggregates external data sources before broadcasting it to the network. You can reference the provider documentation here to get a high level overview of how the oracle works.
- providers - This package contains a collection of web socket and API based data providers that are used by the oracle to collect external data.
- x/oracle - This package contains a Cosmos SDK module that allows you to store oracle data on a blockchain.
- x/alerts - This package contains a Cosmos SDK module that allows network participants to create alerts when oracle data that is in violation of some condition is broadcast to the network and stored on the blockchain.
- x/sla - This package contains a Cosmos SDK module that allows you to create service level agreements (SLAs) that can be used to incentivize network participants to consistently, reliably provide data with high uptime.
To run the oracle, run the following command:
$ make run-oracle-server
To check the current aggregated prices, open a new terminal and run the following command:
$ make run-oracle-client
To see all network metrics, open a new terminal and run the following command and then navigate to http://localhost:9090:
$ make run-prom-client
To add a new provider, update the local config in config/local/generate_toml.go and then run the following command:
$ make update-local-config
To run a local blockchain, first start the oracle server and then run the following command (in a separate window):
$ make build-and-start-app
- metrics relevant to the oracle service's health + operation are here
- metrics relevant to the operation / health of the oracle's providers are here
- metrics relevant to the network's (that is running the instance slinky) performance are here
The oracle side car is a combination of the oracle and provider packages. This is being moved to a separate repository.