Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Latest commit

 

History

History
55 lines (40 loc) · 1.74 KB

README-gov.md

File metadata and controls

55 lines (40 loc) · 1.74 KB

Creating a price authority with on-chain governance

Use Agoric SDK commit: cd agoric-sdk && git checkout mfig-oracle-management

  1. Deploy the oracle node integration on each ag-solo:

Either a builtin oracle:

agoric deploy --allow-unsafe-plugins api/spawn.js

or for Chainlink:

INSTALL_ORACLE="Chainlink oracle" agoric deploy api/spawn.js

Take note of your node's ORACLE_ADDRESS. You will need to send it to the governance proposer.

  1. Create a governance proposal data. Expect RemoteErrors if the in or out brands cannot yet be found:
ORACLE_ADDRESSES=agoric1...,agoric1...,agoric1... \
AGORIC_INSTANCE_NAME="ATOM-USD priceAggregator" \
IN_BRAND_DECIMALS=6 \
IN_BRAND_LOOKUP='["agoricNames","oracleBrand","ATOM"]' \
OUT_BRAND_DECIMALS=4 \
OUT_BRAND_LOOKUP='["agoricNames","oracleBrand","USD"]' \
agoric deploy api/scripts/init-core.js
  1. Submit the proposal to the chain as described by the above command.

  2. Wait for proposal voting to pass.

  3. Install the Flux Notifier for each oracle that was invited in ORACLE_ADDRESSES above.

    NOTE: You will need to edit api/flux-params.js to specify the correct query parameters as specified by the oracle coordinator.

AGGREGATOR_INSTANCE_LOOKUP='["agoricNames","instance","ATOM-USD priceAggregator"]' \
IN_BRAND_LOOKUP='["agoricNames","oracleBrand","ATOM"]' \
OUT_BRAND_LOOKUP='["agoricNames","oracleBrand","USD"]' \
FEE_ISSUER_LOOKUP='["wallet","issuer","RUN"]' \
agoric deploy api/flux-notifier.js
  1. Now people should be able to query via home.priceAuthority (do the test session in README.md with pa = home.priceAuthority). Next steps are to query and gain confidence in the price feed, then possibly use it in a vault collateral proposal.