How to Get Prices On-Chain

Entangle Data Feeds enable seamless access to current asset prices across any network where the required data is distributed. This functionality involves verifying the price and validating the transmitter and signatures using a Merkle root.

The price and timestamp are sourced from the latest Merkle root update, ensuring accurate and timely information. This function updates asset prices within transactions.

function getLastPrice(
        bytes32 merkleRoot,
        bytes32[] calldata merkleProof,
        Signature[] calldata signatures,
        bytes32 dataKey,
        uint256 price,
        uint256 timestamp
    ) external returns (uint256)

The latest price(getter) is located in struct LatestUpdate

struct LatestUpdate {
       /// @notice The price for asset from latest update
        uint256 latestPrice;
        /// @notice The timestamp of latest update
        uint256 latestTimestamp;
    }

Last updated