# DebtUSDC Oracle

### High-Level Overview <a href="#high-level-overview" id="high-level-overview"></a>

The DebtUSDCOracle contract is a simple wrapper around the USDC/USD Chainlink price feed that implements a price cap mechanism. The contract ensures that the DebtUSDC token price never exceeds $1 USD, maintaining price stability and preventing oracle manipulation from affecting the protocol's debt token pricing.

### Contract Summary <a href="#contract-summary" id="contract-summary"></a>

The contract provides a Chainlink-compatible aggregator interface that:

* Wraps the underlying USDC/USD price feed
* Caps the maximum price at $1 USD (1e8 with 8 decimals)
* Returns price data in the standard Chainlink AggregatorV3Interface format

### Key Functionality <a href="#key-functionality" id="key-functionality"></a>

#### latestRoundData <a href="#latestrounddata" id="latestrounddata"></a>

Returns the latest price data from the USDC/USD feed with a price cap applied:

* If the USDC/USD feed price is at or below $1, returns the actual price
* If the USDC/USD feed price exceeds 1,returns1,returns1 as the maximum price

This ensures that DebtUSDC tokens maintain a stable price ceiling, preventing oracle anomalies or manipulation from causing the debt token price to exceed its intended value.

#### getRoundData <a href="#getrounddata" id="getrounddata"></a>

Not supported - reverts with `NotSupported` error. Only `latestRoundData` is available.

### Constants <a href="#constants" id="constants"></a>

* **PRICE\_FEED\_DECIMALS**: 8 (standard Chainlink decimals)
* **MAX\_USDC\_ORACLE\_PRICE**: 1e8 (represents $1.00 with 8 decimals)

### Immutable Variables <a href="#immutable-variables" id="immutable-variables"></a>

* **USDC\_USD\_FEED**: The underlying USDC/USD Chainlink price feed aggregator

### Use Case <a href="#use-case" id="use-case"></a>

The DebtUSDCOracle is used by the protocol to price DebtUSDC tokens. By capping the price at $1, the protocol ensures that debt tokens maintain their intended value relationship with USDC, preventing any oracle manipulation or price anomalies from affecting the protocol's accounting.


---

# Agent Instructions: 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:

```
GET https://tech.usual.money/smart-contracts/utility-contracts/usd0a/debtusdc-oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
