Publishing Updates to Destination Chains

Anyone can contribute to publishing updates to destination chains, ensuring a constant stream of data. To participate, use the pull-update-publisher tool. Clone the pull-oracle-publisher repo and launch the daemon to start streaming updates to destination chains.

  1. Clone repo - `git clone

  2. Change config.yaml in repo’s root, select data keys for which you want to secure updates, set private key, optionally set your node URLs.

  3. Run pull-oracle-publisher cmd - `go run ./cmd/pull-update-publisher`. Or build and run docker container - `docker compose -f ./docker/docker-compose.yml up`

The pull-update-publisher executable when run, tries to publish update on `publisher.updateInterval` interval option, in concrete steps it does the following:

  1. Fetch latest updates for keys in the config from finalized-data-snap(spotter's assets list in calldata in Finalized Data API)

  2. Select updates that has either of the following properties:

    1. Latest on-chain update is older than value specified by `publisher.updateThreshold` option in the config

    2. Latest on-chain update value differs by more than (`publisher.priceDiffThreshold` / 10000 %) from fetched update value.

  3. Send selected updates to the PullOracle contract.

Finalized Data API

1. Retrieve Spotters List

Endpoint: GET /spotters

Description: Retrieves a list of spotters, including their IDs, supported assets, and networks.

2. Retrieve Spotter's Assets in Detail

Endpoint: GET /spotters/{spotterID}

Parameters:

  • spotterID (string): ID of the spotter.

  • assets (string, query): Comma-separated list of asset keys (e.g., NGL/USD, ETH/USD).

Description: Retrieves a detailed view of a specific spotter's assets.

3. Retrieve Calldata for Specific Network

Endpoint: GET /spotters/{spotterID}/{network}/calldata

Parameters:

  • spotterID (string): ID of the spotter.

  • network (string): Blockchain network name.

  • assets (string, query): Comma-separated list of asset keys (e.g., NGL/USD, ETH/USD).

Description: Retrieves a detailed view of a specific spotter's assets in calldata format for a particular network.

Response example in json:

{
  "value": {
    "timestamp": "1234567890",
    "data": "btc/usd_value"
  },
  "merkleRoot": "xxxxxxxxxxxxxxxxxxxxx", // bytes32
  "signatures": ["sig1", "sig2", "..."], // array of Signatures
  "merkleProofs": ["uncle_proof1", "uncle_proof2"] // array of strings
  "key": "btc/usd" // bytes32
}

Last updated