BoundValidator.
Price-boundary validation for the resilient oracle system. Compares the main oracle's price against a pivot oracle's price and ensures deviation falls within configured bounds.
BoundValidator acts as a gatekeeper in the multi-source price validation pipeline. By enforcing upper and lower deviation thresholds, it detects potentially manipulated or erroneous prices before they reach the protocol. If the main price deviates beyond the acceptable range relative to the pivot, the price is rejected and the fallback oracle is consulted.
validatePriceWithAnchorPrice
Validates a reported price against an anchor (pivot) price using the configured bounds for the asset.
function validatePriceWithAnchorPrice(
address asset,
uint256 reportedPrice,
uint256 anchorPrice
) external view returns (bool);
Returns true if the reported price is within bounds, false otherwise.
setValidateConfig
Configures the validation bounds for a specific asset.
function setValidateConfig(ValidateConfig memory config) external;
The ValidateConfig struct:
struct ValidateConfig {
address asset;
uint256 upperBoundRatio;
uint256 lowerBoundRatio;
}
upperBoundRatio: Maximum allowed ratio of reported to anchor price (e.g.,1.1e18= 110%).lowerBoundRatio: Minimum allowed ratio (e.g.,0.9e18= 90%).