ArdanaLabs / Ardana-dApps

BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Price Module Design #64

Closed epiro-ps closed 2 years ago

epiro-ps commented 2 years ago

Description

The Price Module is a system that updates the USD price of ADA on-chain every hour. It consists of the Price Module Validator, the Price Updater CLI, and the Price Worker.

Interactions

Price Updater

The Price Updater CLI can be called to initialize and update the dUSD to ADA oracle price data on-chain.

Acceptance Criteria

Price Module Validator

Price Updater

As an admin, I would like to run the Price Updater where the following is true

Implementation

Price Module Validator

The Price Module Validator is written in Plutarch. It runs whenever an Oracle UTxO is being spent.

Price Updater

The Price Update Script is a stand-alone executable that when run will ensure price data is posted on-chain. The code is written in purescript and will depend on the dusd-api and ctl for interacting with the chain. dusd-api should expose functions for updating and reading the price.

When the price updater is ran, it performs the following operations

Initialization

Price Update

Price Worker

marijanp commented 2 years ago

can you add a markdown in the repo, with a PR, so we can make annotations?

epiro-ps commented 2 years ago

@marijanp I broke this up into pieces here. Let me know if it would be easier to comment on if they were also pushed as docs in the repo.