/oracle-feeder

Oracle Feeder Daemon

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Terra Oracle Feeder

This contains the Oracle feeder software that is used for periodically submitting oracle votes for the exchange rate of the different assets offered by the oracle chain. This implementation can be used as-is, but also can serve as a reference for creating your own custom oracle feeder.

Overview

This solution has 2 components:

  1. price-server

    • Obtain information from various data sources (exchanges, forex data, etc),
    • Model the data,
    • Enable a url to query the data,
  2. feeder

    • Reads the exchange rates data from a data source (price-server)
    • Periodically submits vote and prevote messages following the oracle voting procedure

Prerequisites

Instructions

  1. Clone this repository
git clone https://github.com/terra-money/oracle-feeder
cd oracle-feeder
  1. Configure and launch price-server, following instructions here.
cd price-server
npm install

# Copy sample config file
cp ./config/default-sample.js ./config/default.js

# make edits
vim ./config/default.js

# price is available at `http://127.0.0.1:8532/latest`
npm run start
  1. Configure and launch feeder, following instructions here.
cd feeder
npm install

# configure to use feeder account
npm start add-key

# start voting
$ npm start vote -- \
   --source http://localhost:8532/latest \
   --lcd-url https://lcd-1.anr.dev \
   --lcd-url https://lcd-2.anr.dev \
   --chain-id andromeda-oralce-1 \
   --validators anrvaloper1xx \
   --validators anrvaloper1yy \
   --password "<password>"