xWin Pricemaster
xWinPriceMaster
SourceMap
struct SourceMap {
uint8 source;
address chainLinkAddr;
}
onlyExecutor
modifier onlyExecutor()
stratInteractor
contract IxWinStrategyInteractor stratInteractor
_TWAPOracle
address _TWAPOracle
chainLinkUSDpair
mapping(address => address) chainLinkUSDpair
priceSourceMap
mapping(address => mapping(address => struct xWinPriceMaster.SourceMap)) priceSourceMap
executors
mapping(address => bool) executors
initialize
function initialize(address _stratInteractor, address _twapAddress) external
getPrice
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) external
addChainlinkUSDPrice
function addChainlinkUSDPrice(address _token, address _chainLinkAddr) external
setExecutor
function setExecutor(address _address, bool _allow) external
setTWAPOracle
function setTWAPOracle(address _address) external
updateStratInteractor
function updateStratInteractor(address _stratInteractor) public
_convertFrom18
function _convertFrom18(uint256 value, address token) internal view returns (uint256)
Last updated