// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
 * @title IXAUOracle
 * @notice Interface for XAU Oracle Module
 * @dev Multi-source oracle aggregator for ETH/XAU pricing
 */
interface IXAUOracle {
    /**
     * @notice Get ETH price in XAU
     * @return price ETH price in XAU (18 decimals)
     * @return timestamp Last update timestamp
     */
    function getETHPriceInXAU() external view returns (uint256 price, uint256 timestamp);

    /**
     * @notice Get liquidation price for a vault
     * @param vault Vault address
     * @return price Liquidation threshold price in XAU
     */
    function getLiquidationPrice(address vault) external view returns (uint256 price);

    /**
     * @notice Add a price feed source
     * @param feed Price feed address (must implement Aggregator interface)
     * @param weight Weight for this feed (sum of all weights should be 10000)
     */
    function addPriceFeed(address feed, uint256 weight) external;

    /**
     * @notice Remove a price feed source
     * @param feed Price feed address to remove
     */
    function removePriceFeed(address feed) external;

    /**
     * @notice Update feed weight
     * @param feed Price feed address
     * @param weight New weight
     */
    function updateFeedWeight(address feed, uint256 weight) external;

    /**
     * @notice Freeze oracle (emergency)
     */
    function freeze() external;

    /**
     * @notice Unfreeze oracle
     */
    function unfreeze() external;

    /**
     * @notice Check if oracle is frozen
     * @return frozen True if frozen
     */
    function isFrozen() external view returns (bool);

    event PriceFeedAdded(address indexed feed, uint256 weight);
    event PriceFeedRemoved(address indexed feed);
    event FeedWeightUpdated(address indexed feed, uint256 oldWeight, uint256 newWeight);
    event OracleFrozen(uint256 timestamp);
    event OracleUnfrozen(uint256 timestamp);
    event PriceUpdated(uint256 price, uint256 timestamp);
}
