Price Oracle
Oracle powered by Chainlink price feeds.

Open Zeppelin Contracts

WRAPPED_NATIVE_TOKEN

function WRAPPED_NATIVE_TOKEN() external view returns (address);
Summary
It returns the address of the wrapped native token. E.g. WETH in the Ethereum blockchain.

getUSDFeed

function getUSDFeed(address token) external view returns (address);
Parameters
  1. 1.
    The USD price feed for this token will be returned.
Summary
It returns a token's USD price feed from Chainlink.

getIPXLPTokenUSDPrice

function getIPXLPTokenUSDPrice(address pair, uint256 amount)
external
view
returns (uint256 price)
Parameters
  1. 1.
    The USD price for this token will be returned.
  2. 2.
    The price is based on a specific quantity. It adjusts all tokens to 18 decimals.
Only supports LP Tokens from Interest Protocol.
Summary
It returns the USD price of an amount of Interest Protocol LP Token. This function calculates the price of LP Tokens in BNB and USD based on token0 and token1 using a fair K Value pioneered by Alpha Finance.

getTokenUSDPrice

function getTokenUSDPrice(address token, uint256 amount)
external
view
returns (uint256 price);
Parameters
  1. 1.
    The USD price for this token will be returned
  2. 2.
    The price is based on a specific quantity. It adjusts all tokens to 18 decimals.
Summary
It returns the price of an amount of Token in USD. This function only supports ERC20 that not LP Tokens. It will fetch the price from Chainlink.

getNativeTokenUSDPrice

function getNativeTokenUSDPrice(uint256 amount)
external
view
returns (uint256 price);
Parameters
  1. 1.
    The USD price for the native token will be returned.
  2. 2.
    The price is based on a specific quantity. It adjusts all tokens to 18 decimals.
Summary
This function fetches the native token USD price from Chainlink.
​
This contract uses the UUPS upgradeable pattern. Therefore, the interfaces and functionalities can change in the future.
Export as PDF
Copy link
On this page
Open Zeppelin Contracts
WRAPPED_NATIVE_TOKEN
getUSDFeed
getIPXLPTokenUSDPrice
getTokenUSDPrice
getNativeTokenUSDPrice