All Projects → tacoinfra → harbinger

tacoinfra / harbinger

Licence: MIT license
Harbinger is a decentralized price oracle solution for price feeds on the Tezos network. This repository contains top level documentation for the project.

Projects that are alternatives of or similar to harbinger

objkt-swap
Hic et Nunc smart contracts. FA2 multiassets: hDAO, OBJKTs, Marketplace, SUBJKTs and Unregistry.
Stars: ✭ 67 (+71.79%)
Mutual labels:  tezos, tezos-blockchain
quipuswap-webapp
🌐 🧙‍♂️ Decentralized application UI for Quipuswap protocol.
Stars: ✭ 21 (-46.15%)
Mutual labels:  tezos, defi
tezedge-specification
TLA+ specs and models for the TezEdge node's p2p overlay network, shell, and consensus
Stars: ✭ 19 (-51.28%)
Mutual labels:  tezos, tezos-blockchain
tezart
Tezart helps to interact with ​Tezos blockchain.
Stars: ✭ 19 (-51.28%)
Mutual labels:  tezos, tezos-blockchain
templewallet-extension
🔐💰Cryptocurrency wallet for Tezos blockchain as Web extension for your Browser.
Stars: ✭ 176 (+351.28%)
Mutual labels:  tezos, defi
tezedge
Tezos node/shell in Rust. Unfortunately dev has ceased. If you are interested in resurrecting, please contact @drchrispinnock
Stars: ✭ 147 (+276.92%)
Mutual labels:  tezos, tezos-blockchain
pytezos
🐍 Python SDK & CLI for Tezos | Michelson REPL and testing framework
Stars: ✭ 93 (+138.46%)
Mutual labels:  tezos, tezos-blockchain
granary
Tezos smart contract & dapp development toolkit
Stars: ✭ 67 (+71.79%)
Mutual labels:  tezos, tezos-blockchain
netezos
Netezos is a cross-platform Tezos SDK for .NET developers, simplifying the access and interaction with the Tezos blockchain
Stars: ✭ 32 (-17.95%)
Mutual labels:  tezos, tezos-blockchain
quipuswap-core
🧙‍♂️ Repository containing QuipuSwap liquidity protocol smart-contracts written in Ligo language
Stars: ✭ 48 (+23.08%)
Mutual labels:  tezos, defi
table-api-generator
Oracle Table API Generator
Stars: ✭ 38 (-2.56%)
Mutual labels:  oracle
gaode2
利用高德导航接口创建交通路网模型
Stars: ✭ 23 (-41.03%)
Mutual labels:  oracle
tezos-k8s
Deploy a Tezos Blockchain on Kubernetes
Stars: ✭ 43 (+10.26%)
Mutual labels:  tezos
botdexdamar
🤖 multichain trading bot with sniper, frontrun, backrun, sandwich
Stars: ✭ 124 (+217.95%)
Mutual labels:  defi
SchemaMapper
A .NET class library that allows you to import data from different sources into a unified destination
Stars: ✭ 41 (+5.13%)
Mutual labels:  oracle
digital-copyright
Stamp your code with a trackable digital copyright
Stars: ✭ 17 (-56.41%)
Mutual labels:  defi
rari-dApp
Rari Capital's Web3 Portal.
Stars: ✭ 145 (+271.79%)
Mutual labels:  defi
sommelier
Sommelier Chain
Stars: ✭ 64 (+64.1%)
Mutual labels:  defi
dbclient
데이터배이스 관리 / 자동 메일링 / Admin 자동화 / Database IDE Tool. SQL Development Helper. Support DBMS Oracle/Mysql/MS-SQL
Stars: ✭ 35 (-10.26%)
Mutual labels:  oracle
tezbridge-legacy
This is the legacy code base of TezBridge
Stars: ✭ 13 (-66.67%)
Mutual labels:  tezos

Harbinger

Contracts

If you are just interested in using Harbinger as a client, the current contract addresses are:

* Mainnet
  * Coinbase
    * Storage: [KT19B8uSfiQ8Cxk99ELc7MPccQ9ihyy7jhDU](https://tzkt.io/KT19B8uSfiQ8Cxk99ELc7MPccQ9ihyy7jhDU/storage)
    * Normalizer: [KT1KBrn1udLLrGNbQ3n1mWgMVXkr26krj6Nj](https://tzkt.io/KT1KBrn1udLLrGNbQ3n1mWgMVXkr26krj6Nj/storage)

* Ghostnet
  * Coinbase
    * Storage:[KT1UcwQtaztLSq8oufdXAtWpRTfFySCj7gFM]()https://ghostnet.tzkt.io/KT1UcwQtaztLSq8oufdXAtWpRTfFySCj7gFM)
    * Normalizer: [KT1ENe4jbDE1QVG1euryp23GsAeWuEwJutQX](https://ghostnet.tzkt.io/KT1ENe4jbDE1QVG1euryp23GsAeWuEwJutQX)

You can view current Harbinger data at:

If you'd like to understand more about Harbinger works, read on!

Introduction

Harbinger is a signed price feed for the Tezos blockchain which provides a trusted price oracle for digital assets.

Harbinger's design was inspired by Compound's Open Price Feed. Separate entities provide signed price updates and post the signed price data on chain. This separation of responsibility leads to a decentralized solution where anyone can post signed prices on-chain, reducing dependencies on a single poster that might be offline.

Harbinger stores "candles" of prices of assets. Specifically, each data point for an asset in a Harbinger price oracle contains the following data: (1) start time, (2) end time, (3) open price, (4) high price, (5) low price, (6) close price, and (7) volume. Typically, the signed price data originates from a market order book on an exchange, where the most recent historical 1-minute candle can be retrieved and signed.

Harbinger Overview

Quickstart

The easiest way to get started with Harbinger is to install and use the Harbinger CLI:

$ npm i -g @tacoinfra/harbinger-cli
$ harbinger --help

Contracts for Harbinger are deployed at the following addresses:

Repositories

Harbinger is made up of several components in separate github repositories for discoverability. Developers, signers, posters and users may be interested in one or more of the following repositories:

  • harbinger-contracts: Contains reference implementations for Harbinger's smart contracts.
  • harbinger-cli: Contains a CLI interface to deploy, update and interact with Harbinger's smart contracts.
  • harbinger-poster: Contains a reference implementation of a posting service via AWS.
  • harbinger-signer: Contains a reference implementation of a signing service that runs as a Serverless application on Amazon Web Services.
  • harbinger-lib: Contains a core library shared among the above components.

Details

Components

Harbinger separates creating a signed price feed from the posting of signed price data on-chain.

At a high level, three components make up Harbinger:

  • Contracts: A smart contract which keeps track of data on chain.
  • Signers: A service which retrieves and signs price data.
  • Posters: A client which retrieves signed price data from a signer and posts it to the oracle contract, paying the required fees.

The storage contracts are initialized with the public key of a signer. As long as updates are signed correctly, they can be posted to an Oracle.

Signers

Signer Workflow

Any service can sign updates for the Harbinger Oracle system as long as they sign the correct data. The following services provide signed price feeds:

Contracts

Harbinger is made up of two contracts:

  • Price Storage Contract: Stores the latest signed price data for each market at a specific point in time.
  • Normalizer Contract: Normalizes n data points from an specific market oracle by computing a volume weighted average price from the last n updates.

Data is posted to the price storage contract and can then be pushed to the normalizer contract by the same poster or another entity.

Poster Workflow

Providers

Technical Specifications

Oracle Data

All price oracle data is represented in two formats:

  • A standard unix timestamp for candle starts and ends
  • A natural number for prices and volumes, with six digits of precision. For instance, the price $123.45 would be represented as 123450000.

Asset Codes

The following asset codes are a convention in Harbinger:

Contract Specifications

Price storage contracts are bound to a single price feed and can contain an unlimited number of assets. All updates must be monotonically increasing in start time and must be signed by a specific key.

Specifically, the price storage contract can be configured with the following parameters:

  • Signer Public Key: The public key of the signer which provides the price feed for the oracle.
  • Asset List: A list of asset pairs (XTZ-USD, etc.) that the price storage contract will keep track of. Higher numbers of assets lead to increased gas and storage fees when interacting with the contract. For this reason, it is recommended that you deploy multiple price storage contracts in the event that you want to store more than a handful of assets.

A price storage contract has the following entrypoints:

  • update: Receives a signed set of updates to the price storage contract.
  • push: Pushes the data in the price storage contract to a normalizer contract.
  • revoke: Revokes a price storage contract by removing the signer public key and any price data. This effectively triggers an emergency shutdown of the price oracle.

Normalizer Contract Specifications

Normalizer contracts normalize a single asset and can only receive updates from one Oracle. All updates must be monotonically increasing in start time.

Specifically, the normalizer contract can be configured with the following parameters:

  • Price Storage Contract Address: The address of the price storage contract which provides updates.
  • Asset Name: The name of the asset pair (XTZ-USD, etc.) that the contract will normalize.
  • Number of Data Points:: The number of data points to store and normalize. Higher numbers of data points lead to increased gas and storage fees when interactin with the normalizer.

A normalizer contract has the following entrypoints:

  • update: Receives data from a price storage contract.

Credits

Harbinger is written and maintained by Luke Youngblood and Keefer Taylor.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].