Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable oracle entrypoints #317

Open
gkaracha opened this issue Jan 10, 2022 · 0 comments
Open

Configurable oracle entrypoints #317

gkaracha opened this issue Jan 10, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@gkaracha
Copy link
Contributor

Currently Checker makes the following assumptions regarding the oracles:

  1. Index oracle
    • The oracle provides an entrypoint %getPrice of type (nat * nat) contract .
    • The fraction captures the price of X in TEZ (i.e., has units TEZ/X), where X stands for USD, or CHF, or some other currency.
  2. CFMM oracle
    • The oracle provides an entrypoint %getCfmmPrice of type (nat * nat) contract.
    • The fraction captures the price of T in C (i.e., has units C/T), where C stands for the collateral type and T stands for the on-chain token we are replicating.

Currently there is no standard regarding how should such entrypoints be named or what their type should be. Though we cannot easily allow the entrypoint types to be configured at build time, we certainly can (and probably should) choose the entrypoint names at build time, from the yaml configuration file. The above names are merely placeholders.

Relevant files (as of b572b25)

Sidenote: checker_tools/builder/templates/indexGetOracleEntrypoint.ml.jinja and checker_tools/builder/templates/tokenGetOracleEntrypoint.ml.jinja are already jinja templates, and util/mock_oracle.tz and util/mock_cfmm_oracle.tz can be generated at build time by calling ligo compile-contract, so we'd have to turn util/mock_oracle.mligo and util/mock_cfmm_oracle.mligo into jinja templates as well to accommodate the needed changes.

@gkaracha gkaracha added the enhancement New feature or request label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant