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 > 0are countedEach asset is weighted by its
debtTokenMintedIf 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
minPriceandmaxPrice
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:
EthereumInterface
Return Value
getWeightedAssetRate() returns a uint256 scaled by 1e18.
This means:
1e18= $1.001.02e18= $1.020.98e18= $0.98
Failure Cases
The call may revert in the following cases:
NoActiveAssets()if no asset currently contributes weightInvalidPrice(uint256 price)if an oracle price is outside the allowed range
Last updated