xWin Pricemaster
xWinPriceMaster
SourceMap
struct SourceMap {
uint8 source;
address chainLinkAddr;
}onlyExecutor
modifier onlyExecutor()stratInteractor
contract IxWinStrategyInteractor stratInteractor_TWAPOracle
address _TWAPOraclechainLinkUSDpair
mapping(address => address) chainLinkUSDpairpriceSourceMap
mapping(address => mapping(address => struct xWinPriceMaster.SourceMap)) priceSourceMapexecutors
mapping(address => bool) executorsinitialize
function initialize(address _stratInteractor, address _twapAddress) externalgetPrice
function getPrice(address _from, address _to) public view returns (uint256 rate)Get token price from xWinPriceMaster in the form of from/to, e.g ETH/USDC, BTC/ETH
Parameters
Name
Type
Description
_from
address
from Token address
_to
address
to Token address
_getTWAPPrice
function _getTWAPPrice(address _from, address _to) internal view returns (uint256 amountOut)_getLPPrice
function _getLPPrice(address _from, address _to) internal view returns (uint256 rate)addPrice
function addPrice(address _from, address _to, uint8 _source, address _chainLinkAddr) externaladdChainlinkUSDPrice
function addChainlinkUSDPrice(address _token, address _chainLinkAddr) externalsetExecutor
function setExecutor(address _address, bool _allow) externalsetTWAPOracle
function setTWAPOracle(address _address) externalupdateStratInteractor
function updateStratInteractor(address _stratInteractor) public_convertFrom18
function _convertFrom18(uint256 value, address token) internal view returns (uint256)Last updated