Go to file
Hernán Di Pietro 994a6f37df README and alternate coins 2021-10-12 10:59:59 -03:00
backend TSC, Settings, some refactoring. 2021-10-12 10:37:11 -03:00
lib Store exp as 2-comp signed (Pyth emits NEGATIVE exponent!) 2021-10-08 15:45:46 -03:00
settings TSC, Settings, some refactoring. 2021-10-12 10:37:11 -03:00
teal Store exp as 2-comp signed (Pyth emits NEGATIVE exponent!) 2021-10-08 15:45:46 -03:00
test Service booting and feeding :happy: 2021-10-08 16:03:37 -03:00
tools Added Deployment tool. 2021-10-07 15:47:14 -03:00
.eslintrc.js Missing files. 2021-10-01 11:01:43 -03:00
.gitignore TSC, Settings, some refactoring. 2021-10-12 10:37:11 -03:00
LICENSE Initial commit 2021-09-30 15:34:21 -03:00
README.md README and alternate coins 2021-10-12 10:59:59 -03:00
package-lock.json TSC, Settings, some refactoring. 2021-10-12 10:37:11 -03:00
package.json README and alternate coins 2021-10-12 10:59:59 -03:00
tsconfig.json TSC, Settings, some refactoring. 2021-10-12 10:37:11 -03:00

README.md

Pricecaster Service

This service consumes prices from "price fetchers" and feeds blockchain publishers. In case of Algorand publisher class, a TEAL program with messages containing signed price data. The program code validates signature and message validity, and if successful, subsequently stores the price information in the global application information for other contracts to retrieve.

All gathered price information is stored in a buffer by the Fetcher component -with a maximum size determined by settings-. The price to get from that buffer is selected by the IStrategy class implementation; the default implementation being to get the most recent price and clear the buffer for new items to arrive.

Alternative strategies for different purposes, such as getting averages and forecasting, can be implemented easily.

System Overview

The Pricecaster backend can be configured with any class implementing IPriceFetcher and IPublisher interfaces. The following diagram shows the service operating with a fetcher from Pyth Network, feeding the Algorand chain through the StdAlgoPublisher class.

PRICECASTER

Backend Configuration

The backend will read configuration from a settings.ts file pointed by the PRICECASTER_SETTINGS environment variable.

Tests

At this time, there is a TEAL contract test that can be run with

npm run test

Backend tests will come shortly.