Quantillon Protocol

IHyperliquidOracle

Git Source

Inherits: IOracle

Title: IHyperliquidOracle

Author: Quantillon Labs - Nicolas Bellengé - @chewbaccoin

Interface for the Quantillon Hyperliquid EUR/USD oracle adapter

Extends IOracle with the management functions the OracleRouter delegates to the active oracle (updatePriceBounds / updateUsdcTolerance / resetCircuitBreaker / triggerCircuitBreaker) plus adapter-specific configuration. The EUR/USD price is the Hyperliquid xyz:EUR perp mid published on-chain by the off-chain Slippage Monitor into SlippageStorage; USDC/USD validation is delegated to the existing ChainlinkOracle. The OracleRouter stores the active oracle as IStorkOracle and casts it unchecked, so an implementation only needs to expose the IOracle reads plus the four delegated management selectors above to slot into the Stork position via updateOracleAddresses + switchOracle.

Note: security-contact: team@quantillon.money

Functions

initialize

Initializes the adapter with its price sources and treasury

Callable once via the proxy. Grants admin/manager/emergency/upgrader roles to admin.

Notes:

  • security: Validates all addresses are non-zero and grants roles to admin

  • validation: Validates admin/_slippageStorage/_usdcSource/_treasury != address(0)

  • state-changes: Initializes sources, roles, default bounds, staleness and tolerance

  • events: Emits PriceUpdated if an initial mid is available

  • errors: Reverts if any address is zero

  • reentrancy: Protected by initializer modifier

  • access: Public - only callable once during proxy deployment

  • oracle: Reads the initial mid from SlippageStorage if present

function initialize(
    address admin,
    address _slippageStorage,
    uint8 _sourceId,
    address _usdcSource,
    address _treasury
) external;

Parameters

NameTypeDescription
adminaddressAddress that receives admin and management roles
_slippageStorageaddressSlippageStorage contract that holds the published Hyperliquid mid
_sourceIduint8Slippage source id to read (SOURCE_HYPERLIQUID = 1)
_usdcSourceaddressOracle providing USDC/USD (the existing ChainlinkOracle)
_treasuryaddressTreasury address for ETH/token recovery

updatePriceBounds

Updates EUR/USD min and max acceptable prices (18 decimals). ORACLE_MANAGER_ROLE.

function updatePriceBounds(uint256 _minPrice, uint256 _maxPrice) external;

updateUsdcTolerance

Updates the reported USDC tolerance in basis points. ORACLE_MANAGER_ROLE.

function updateUsdcTolerance(uint256 newToleranceBps) external;

resetCircuitBreaker

Clears the circuit breaker and attempts to re-seed the price. ORACLE_MANAGER_ROLE.

function resetCircuitBreaker() external;

triggerCircuitBreaker

Manually triggers the circuit breaker (use last valid price). ORACLE_MANAGER_ROLE.

function triggerCircuitBreaker() external;

setMaxPriceStaleness

Updates the maximum accepted staleness (seconds) of the published mid. ORACLE_MANAGER_ROLE.

function setMaxPriceStaleness(uint256 newMaxStaleness) external;

updateSlippageSource

Updates the SlippageStorage source contract and source id. ORACLE_MANAGER_ROLE.

function updateSlippageSource(address _slippageStorage, uint8 _sourceId) external;

updateUsdcSource

Updates the USDC/USD source oracle (ChainlinkOracle). ORACLE_MANAGER_ROLE.

function updateUsdcSource(address _usdcSource) external;

updateTreasury

Updates the treasury address. DEFAULT_ADMIN_ROLE.

function updateTreasury(address _treasury) external;

pause

Pauses oracle reads. EMERGENCY_ROLE.

function pause() external;

unpause

Unpauses oracle reads. EMERGENCY_ROLE.

function unpause() external;

recoverToken

Recovers ERC20 tokens to treasury. DEFAULT_ADMIN_ROLE.

function recoverToken(address token, uint256 amount) external;

recoverETH

Recovers ETH to treasury. DEFAULT_ADMIN_ROLE.

function recoverETH() external;