> For the complete documentation index, see [llms.txt](https://docs.river.inc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.river.inc/outro/satusd-oracle/weighted-asset-rate.md).

# Weighted Asset Rate

Weighted asset rate represents the **average price of the assets backing satUSD**.

It calculates a **debtTokenMinted-weighted average rate** across all supported backing assets. In other words, it shows the overall price level of the asset pool supporting satUSD.

### How It Works

The function iterates through all supported assets and applies the following rules:

* Only supported assets are included
* Only assets with `debtTokenMinted > 0` are counted
* Each asset is weighted by its `debtTokenMinted`
* If an asset does not use an oracle, its price is treated as $1
* If an asset uses an oracle, the on-chain price is fetched and validated against `minPrice` and `maxPrice`

Formula:

```
Weighted Asset Rate = Σ(asset price × debtTokenMinted) / Σ(debtTokenMinted)
```

### Contract Integration

Protocols, vaults, or monitoring contracts can call `getWeightedAssetRate()` to read the **debtTokenMinted-weighted average price of the assets backing satUSD**.

#### Contract Addresses

Contracts can integrate with the `NexusYieldManagerFacet` through the **SatoshiXApp contract address on each chain**.

For deployed addresses, please refer to the **Deployed Contract** page and use the corresponding **SatoshiXApp** address for that chain.

For example, to read the value on Ethereum, use the **Ethereum SatoshiXApp** address shown on that page:

{% content-ref url="/pages/eh3QMxzrEjaJMwbyMkqZ" %}
[Ethereum](/outro/deployed-contracts/ethereum.md)
{% endcontent-ref %}

#### Interface

```solidity
interface INexusYieldManagerFacet {
    function getWeightedAssetRate() external returns (uint256);
}
```

#### Return Value

`getWeightedAssetRate()` returns a `uint256` scaled by `1e18`.

This means:

* `1e18` = $1.00
* `1.02e18` = $1.02
* `0.98e18` = $0.98

#### Failure Cases

The call may revert in the following cases:

* `NoActiveAssets()` if no asset currently contributes weight
* `InvalidPrice(uint256 price)` if an oracle price is outside the allowed range


---

# 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.river.inc/outro/satusd-oracle/weighted-asset-rate.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.
