ExocoreNetwork / price-feeder

Other
1 stars 2 forks source link

Price Feeder

Overview

The price feeder is a tool that validators use to submit oracle prices to Exocore nodes.

This tool fetches token prices from off-chain sources such as CEX and DEX, then submits this price information to the Exocore blockchain network as a standard Cosmos SDK transaction. Once the submitted prices from validators reach the voting power threshold, they achieve consensus on-chain and become the final price.

Workflow

  1. Subscribe to a new block.
  2. Retrieve prices from off-chain sources.
  3. Submit a transaction with the price data to update the oracle price on-chain.

Installation

make install

Or check out the latest release.

Quick Start

pricefeeder --config path/to/config --sources path/to/sources/config start -m [mnemonic of validator's consensus key]

eg.

config.yaml (path/to/config/config.yaml)

sources:
  - chainlink
tokens:
  - ETHUSDT
sender:
  mnemonic: "wonder myself quality resource ketchup occur stadium shove vicious situate plug second soccer monkey harbor output vanish then primary feed earth story real like"
  path: /Users/xx/.tmp-exocored/config
exocore:
  chainid: exocoretestnet_233-1
  appName: exocore
  rpc: 127.0.0.1:9090
  ws:
    addr: !!str ws://127.0.0.1:26657
    endpoint: /websocket

For mnemonic used by validator to sign transactions (which should be ed25519 private-key corresponding to validator's consensus key), the priority is:

  1. cli: --mnemonic flag
  2. config file: sender.mnemonic
  3. config file: search priv_validator_key.json from sender.path

config for sources: