Currently Checker makes the following assumptions regarding the oracles:
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.
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.
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.
Currently Checker makes the following assumptions regarding the oracles:
%getPrice
of type(nat * nat) contract
.%getCfmmPrice
of type(nat * nat) contract
.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
andchecker_tools/builder/templates/tokenGetOracleEntrypoint.ml.jinja
are already jinja templates, andutil/mock_oracle.tz
andutil/mock_cfmm_oracle.tz
can be generated at build time by callingligo compile-contract
, so we'd have to turnutil/mock_oracle.mligo
andutil/mock_cfmm_oracle.mligo
into jinja templates as well to accommodate the needed changes.