Comment on page
Integrate Price Feeds
Entangle publishes pricing information for a range of base assets, LP Tokens and Liquid Vaults, drawing from multiple sources. Prices are updated and broadcast every minute on each of the chains outlined.
Anyone can retrieve the price for an ERC-20 asset across supported destination chains by invoking either the
getPrice
or getOnChainPrice
functions of the specified Price Oracle contract, catering to both on-chain and off-chain needs.Entangle provide two methods for obtaining price data for a specific asset, outlined below:
/// @notice Returns the price for the asset across all sources
function getPrice(string memory token0, string memory token1) public view returns (uint256 price)
This method returns the price for the asset across all available sources.
/// @notice Returns the price for the asset across sources on the same chain
function getOnChainPrice(string memory token0, string memory token1) public view returns (uint256 price)
This method returns the price for the asset from sources on the same blockchain.
Access to an asset's price is gained by invoking these methods with the corresponding tokens of the asset.
Example
To acquire the price of USDT in relation to DAI, call `getPrice(“USDT”, “DAI”)`, where USDT is a base token and DAI is a quote token.
Last modified 1mo ago