Price Service
Retrieve the PriceService through
Maker.service('price')
. The PriceService exposes the collateral and governance tokens' price information that is reported by the oracles in the Maker system.const price = maker.service('price');
const ethPrice = await price.getEthPrice();
const mkrPrice = await price.getMkrPrice();
await pethPrice = price.getPethPrice();
Set the current USD price of ETH. This requires the necessary permissions and will only be useful in a testing environment.
await price.setEthPrice(475);
Set the current USD price of the governance token MKR. This requires the necessary permissions and will only be useful in a testing environment.
await price.setMkrPrice(950.00);
Returns the current WETH to PETH ratio.
await price.getWethToPethRatio();
Last modified 3yr ago