// SPDX-License-Identifier: MIT pragma solidity ^0.8.30; /// @title IAmishOracle /// @notice Oracle-agnostic price interface. Adapters wrap concrete sources /// (Chainlink, Pyth, TWAP, …) behind this interface; anyone can deploy new adapters. /// @dev The adapter must live on the principal chain — the health factor is computed on-chain at /// liquidation and margin-call time, so the price must be readable directly. Treat this /// signature as a stable external interface. interface IAmishOracle { /// @notice Fixed number of decimals the adapter's price is scaled by (Chainlink-style, e.g. 8). /// Constant per adapter; consumers rebase with this plus the two tokens' own decimals. function decimals() external view returns (uint8); /// @notice Price of one *whole* `collateralToken` denominated in *whole* `principalToken`, scaled /// by `10 ** decimals()`. Independent of the ERC-20s' own decimals (those are applied by /// the consumer). E.g. WBTC at 100,000 USDC with 8 price-decimals returns 100_000e8. /// @param collateralToken The collateral asset. /// @param principalToken The loan asset the price is quoted in. /// @return price Whole-collateral price in whole-principal units, at `10 ** decimals()` scale. /// @return updatedAt Unix timestamp of the underlying feed's last update (staleness check). function getPrice(address collateralToken, address principalToken) external view returns (uint256 price, uint256 updatedAt); }