ApxUSDRateOracle
Inherits: Initializable, AccessManagedUpgradeable, UUPSUpgradeable, EInvalidAmount
Title: ApxUSDRateOracle
Provides the exchange rate of apxUSD relative to USDC for Curve Stableswap-NG pools.
The rate represents how many USDC 1 apxUSD is worth based on the off-chain collateral backing apxUSD, expressed as a uint256 with 1e18 precision.
- 1e18 = 1 apxUSD is worth 1 USDC
- 1.02e18 = 1 apxUSD is worth 1.02 USDC
Called by the Curve pool via staticcall to
rate().
State Variables
STORAGE_LOCATION
bytes32 private constant STORAGE_LOCATION = 0x27bd078109e9748e45a8094381d0fb92b7b8cc1084b35874a4d9e8826ec4f100
Functions
_getStorage
function _getStorage() private pure returns (ApxUSDRateOracleStorage storage $);
constructor
Note: oz-upgrades-unsafe-allow: constructor
constructor() ;
initialize
Initializes the oracle with a default rate of 1e18 (1:1 peg).
function initialize(address initialAuthority) external initializer;
Parameters
| Name | Type | Description |
|---|---|---|
initialAuthority | address | The address of the authority that can set the rate. |
rate
Returns the current rate of apxUSD relative to USDC.
function rate() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The current rate in 1e18 precision. |
setRate
Sets the rate of apxUSD relative to USDC.
function setRate(uint256 newRate) external restricted;
Parameters
| Name | Type | Description |
|---|---|---|
newRate | uint256 | The new rate in 1e18 precision (must be > 0). |
_authorizeUpgrade
function _authorizeUpgrade(address newImplementation) internal override restricted;
Events
RateUpdated
event RateUpdated(uint256 oldRate, uint256 newRate);
Structs
ApxUSDRateOracleStorage
Note: storage-location: erc7201:apyx.storage.ApxUSDRateOracle
struct ApxUSDRateOracleStorage {
uint256 rate;
}