setzer
is the tool used to query the prices from the off-chain sources. It queries a list of external APIs and aggregates the values returned. The aggregated result can then be used by omnia. Oracle domain contributors are invited to fork the GitHub repo and submit a pull request for inclusion in the main branch.setzer-price-XXXusd
that returns the current price of the collateral. For instance, if you want to know the current price of Ether, you would run bin/setzer price ETHUSD
and obtain the current price: 351.2382000000
.bin/setzer
script translates the request to a call to the script libexec/setzer/setzer-price
, which in turn will invoke libexec/setzer/setzer-price-ethusd
.setzer-price-XXXusd
script must be created. Let's take, for example, PAXG, for which the following data model was defined:paxgusd
.setzer---price-commands
script.setzer-x-price
must be modified.jshon
can extract the price from the json response:setzer-x-price
.setzer-x-price
script, the new source can be tested by directly invoking setzer
:omnia
is the script that periodically calls setzer to obtain price data. When it determines that the price it provided previously needs to be updated, it signs a message that is distributed using the scuttlebutt network.oracles-v2/nix/srcs.nix
to bump the setzer rev with the commit hash. If the setzer PR isn't merged, update url
and ref
to point our work branch to test omnia. Make sure to update it later to point to the main branch once the setzer PR is merged.omnia/config/feed.conf
to add the new pair. Use default msgSpread
and msgExpirations
:omnia/config/feed.conf
to add the new pair, including the Medianizer address, which will be updated once it is deployed.src/median.sol
, paste the following code snippet at the end, while changing the contract name and the value of the wat
variable. dapp update
dapp --use solc:0.5.12 build
dapp update
ETH_RPC_URL
and ETH_KEYSTORE
to point to the corresponding ethereum node and account for Kovan or another testnet. Deploying smart contracts also requires a fairly large gas limit, such as ETH_GAS=5000000
.dapp create <contractname>
(Use the contract name you used above, such as MedianPAXGUSD
)hevm flatten --source-file src/median.sol --json-file out/dapp.sol.json
lift
. Put the feed address list in the FEEDS
variable. For integration testing, use a feed account on which you have control, as you will test omnia message signatures. The oracle-v2 repo conveniently includes a test account in the smoke-tests
directory, 0x1f8fbe73820765677e68eb6e933dcb3c94c9b708
.dapp create OSM $MEDIAN
. Note the returned address, this is the contract address that will store in $OSM for the other steps.poke()
to the OSM would fail because it requires the OSM to be able to query the price from the Medianizer.nix curl -L https://nixos.org/nix/install | sh
. ~/.nix-profile/etc/profile.d/nix.sh
cp omnia/config/feed.conf /tmp/omnia.config
export OMNIA_CONFIG=/tmp/omnia.config
/tmp/omnia.conf
, set from, keystore
and password
to a test account included with the oracle-v2 repo:nix-shell
(first run will take a long time)cd omnia
ssb-server start &
./omnia.sh
cp omnia/config/relayer.conf /tmp/omnia-relayer.conf
export OMNIA_CONFIG=/tmp/omnia-relayer.conf
/tmp/omnia-relayer.conf
, set from,
keystore
, password
to the values corresponding to any funded account on the testnet you are using. Set network
to a node RPC URL, such as one from infura.io. Set the oracle address for your collateral to your integration contract address.nix-shell
cd omnia
ssb-server start &
./omnia.sh
seth send $OSM "poke()()"
ETH_RPC_URL
and ETH_KEYSTORE
to point to the corresponding ethereum node and a funded account.dapp create MedianPAXGUSD
(updating the contract name) Note the returned address, this is the contract address that will store in $MEDIAN
for the other steps.hevm flatten --source-file src/median.sol --json-file out/dapp.sol.json
lift
. Put the feed address list in the FEEDS
variable. For Kovan, coordinate with other Oracle Domain Teams to obtain the latest feed list. If necessary, you may extract this list from an existing Medianizer contract using the following script but changing the address to a known working median contract on Kovan:MCD_PAUSE_PROXY
on changelog.makerdao.com). Note that this does not remove the deployer address as owner. You will need to remove yourselves (deny()
) after deploying the OSM.dapp create OSM $MEDIAN
. Note the returned address, this is the contract address and store it in $OSM for the other steps.MCD_PAUSE_PROXY
on changelog.makerdao.com).MCD_SPOT
from changelog.makerdao.combud
setzer price
as described above before submitting your pull request.oracles-v2/nix/srcs.nix
to bump the setzer rev with the commit hash from the mainnet branch.oracles-v2/omnia/config/feed.conf
, oracles-v2/omnia/config/relayer.conf
and oracles-v2/omnia/config/relayer-kovan.conf
to point to the mainnet deployment of the Medianizer contract.oracles-v2/systemd/gofer.json
to add the data model for your new collateral. See the gofer documentation for more details and examples.