ArdanaLabs / Ardana-dApps

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

Price Worker Nix Module #69

Open epiro-ps opened 2 years ago

epiro-ps commented 2 years ago

Requires completion of https://github.com/ArdanaLabs/Ardana-dApps/issues/71.

Description

To automate oracle price updates on-chain, we want to set up a scheduled runner that calls the Price Updater CLI. To do this, we'll need a nix module that allows us to configure the interval we want the the update command on the Price Updater CLI to be called and have a cron (or whatever scheduler is appropriate) running to that interval on enable. We can then load this module into the configuration.nix on the ArdanaTenant and configure it to run every 1 minute.

Testing

We can test this with a nix VM test that starts the runner at an interval and makes assertions on it's outputs.