> For the complete documentation index, see [llms.txt](https://docs.makerdao.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.makerdao.com/build/dai.js/single-collateral-dai/price-service.md).

# Price Service

## Summary

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.

```javascript
const price = maker.service('price');
```

## getEthPrice

Get the current USD price of ETH, as a `USD_ETH` [price unit](https://makerdao.com/documentation/#units).

```javascript
const ethPrice = await price.getEthPrice();
```

## getMkrPrice

Get the current USD price of the governance token MKR, as a `USD_MKR` [price unit](https://makerdao.com/documentation/#units).

```javascript
const mkrPrice = await price.getMkrPrice();
```

## getPethPrice

Get the current USD price of PETH (pooled ethereum), as a `USD_PETH` [price unit](https://makerdao.com/documentation/#units).

```javascript
await pethPrice = price.getPethPrice();
```

## setEthPrice

Set the current USD price of ETH. This requires the necessary permissions and will only be useful in a testing environment.

```javascript
await price.setEthPrice(475);
```

## setMkrPrice

Set the current USD price of the governance token MKR. This requires the necessary permissions and will only be useful in a testing environment.

```javascript
await price.setMkrPrice(950.00);
```

## getWethToPethRatio

Returns the current WETH to PETH ratio.

```javascript
await price.getWethToPethRatio();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.makerdao.com/build/dai.js/single-collateral-dai/price-service.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
