Maker For Beginners 7
Maker For Advanced 7
Maker Quiz 1
An oracle module is deployed for every collateral type and it feeds its price data for the corresponding collateral type to the vat. This module introduces a whitelisting of addresses that allow them to broadcast the price updates off-chain which are fed into the median before getting pulled in the OSM. The Spotter will proceed to read from the OSM and will act as the liaison between the oracles and the DSS. The Oracle Module has two main components: Median and OSM contracts.
The Median provides Maker’s trusted price references and it works by maintaining a whitelist of price feed contracts that get authorization to post price updates. Each time a new list of prices is received, the median is a computer and is used to update the stored value. The median has permissioning logic which allows the addition and removal of the whitelisted price feed address which are controlled via governance. The permissioning logic allows governance to set other parameters that control’s the median behavior, for example, the bar parameter is the minimum number of the prices that are needed to accept the new median value.
The OSM or Oracle Security Module ensures that the new price values propagated from the Oracle don’t get taken up by the system until a specified delay is passed. Values is read from the designated DSValue contract via the poke method. The OSM contracts can read from the single price feed and the contract has to be deployed per collateral type.
The OSM is similar and it has a 1-hour price delay and it has the same process for reading as a median and the way the OSM works as you cannot update it directly but you can poke it to go and read from something that has the same structure. Whenever the OSM reads from the source, it queues the value that it reads for the next hour. When it is poked, it reads the value of the median and will save the same value so the previous value becomes that so it is always off by an hour. After the hour passes, the value that it saved becomes the current value and whatever value is the median becomes the future value for the next hour.
In relation to the spot oracle module, it handles how the prices are recorded on the blockchain. The Spotter operates as the interface contract where external actors are able to use it to retrieve the current market price from the module and the specified collateral type. The Vat in turn will read the market price from the spotter.