IOracleMiddlewareWithPyth
Inherits: ICommonOracleMiddleware
The oracle middleware is a contract that is used by the USDN protocol to validate price data. Using a middleware allows the protocol to later upgrade to a new oracle logic without having to modify the protocol's contracts.
This middleware uses Pyth as low-latency oracle and Chainlink Data Feeds as fallback.
Functions
BPS_DIVISOR
Gets the denominator for the variables using basis points as a unit.
function BPS_DIVISOR() external pure returns (uint16 denominator_);
Returns
Name | Type | Description |
---|---|---|
denominator_ | uint16 | The BPS divisor. |
MAX_CONF_RATIO
Gets the maximum value for _confRatioBps
.
function MAX_CONF_RATIO() external pure returns (uint16 ratio_);
Returns
Name | Type | Description |
---|---|---|
ratio_ | uint16 | The max allowed confidence ratio. |
getConfRatioBps
Gets the confidence ratio.
This ratio is used to apply a specific portion of the confidence interval provided by an oracle, which is used to adjust the precision of predictions or estimations.
function getConfRatioBps() external view returns (uint16 ratio_);
Returns
Name | Type | Description |
---|---|---|
ratio_ | uint16 | The confidence ratio (in basis points). |
setConfRatio
Sets the confidence ratio.
The new value should be lower than MAX_CONF_RATIO.
function setConfRatio(uint16 newConfRatio) external;
Parameters
Name | Type | Description |
---|---|---|
newConfRatio | uint16 | the new confidence ratio. |