> For the complete documentation index, see [llms.txt](https://docs.teller.org/teller-diamond/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.teller.org/teller-diamond/facets-aka-mini-contracts/price-aggregator.md). Agents can also search and read this documentation through its [MCP server](https://docs.teller.org/teller-diamond/~gitbook/mcp).

# Price Aggregator

Contains the Library and the Facet required to pull information on token prices in Chainlink.

* `ChainLinkAggFacet`
* `ChainLinkAggLib` contains functions that help:
  * `isTokenSupported` checks if a token is supported and has a pair aggregator
  * `aggregatorFor` grabs the ChainLink Aggregator address to check if a token pair is supported

#### `PriceAggFacet`

Contains helper functions that:

* `getValueFor` calculates the value of a source token amount into a destination token
* `priceFor` calculates a price from Compound. If price isn't found from compound, then it tries to retrieve it from ChainLink
* `isCToken` checks if a token is a cToken and returns the address of the token if true
* `compoundPriceFor` retrieves the price of a source token in destination token from Compound
* `chainlinkPriceFor` retrieves the price of a source token in destination token from ChainLink

#### `PriceAggLib`

Implements both the `valueFor` and `priceFor` functions to retrieve both values and prices of a source token to a destination token.
