xWin BBMA (BSC)
xWinBBMA
TradeQueue
struct TradeQueue {
bool nextTrade;
uint256 nextTradeBlock;
uint8 tradeType;
}targetToken
contract IERC20Upgradeable targetTokenswapEngine
contract IxWinSwap swapEnginexWinPriceMaster
contract IxWinPriceMaster xWinPriceMasterexecutors
mapping(address => bool) executorstradeQueue
struct xWinBBMA.TradeQueue tradeQueuemaxPerSwap
uint256 maxPerSwaptradeCycle
uint256 tradeCyclestopLossPrice
uint256 stopLossPricetakeProfitPrice
uint256 takeProfitPricestopLossPerc
uint256 stopLossPerctakeProfitPerc
uint256 takeProfitPercinitialize
function initialize(address _baseToken, contract IERC20Upgradeable _targetToken, address _swapEngine, address _USDTokenAddr, address _xWinPriceMaster, uint256 _managerFee, uint256 _performanceFee, uint256 _collectionPeriod, address _managerAddr) externalonlyExecutor
modifier onlyExecutor()checkUpkeep
function checkUpkeep(bytes) external view returns (bool upkeepNeeded, bytes performData)performUpkeep
function performUpkeep(bytes) externalupdatexWinPriceMaster
function updatexWinPriceMaster(address _xWinPriceMaster) externalupdate xwin master contract
deposit
function deposit(uint256 _amount) external returns (uint256)deposit
function deposit(uint256 _amount, uint32 _slippage) public returns (uint256)_deposit
function _deposit(uint256 _amount, uint32 _slippage) internal returns (uint256)systemReTrade
function systemReTrade() externalsystemTrade
function systemTrade(uint8 _tradeType) publicTriggered offchain when there is a signal buy or close-buy
_systemTrade
function _systemTrade(uint8 _tradeType) internal_setStopLossBuy
function _setStopLossBuy(uint256 _rate) internal_setTakeProfitBuy
function _setTakeProfitBuy(uint256 _rate) internalgetTriggerTakeProfit
function getTriggerTakeProfit() public view returns (bool)getTriggerStopLoss
function getTriggerStopLoss() public view returns (bool)getVaultValues
function getVaultValues() public view returns (uint256 vaultValue)Gets the total value of the tokens within the fund, value shown in baseToken
getVaultValuesInUSD
function getVaultValuesInUSD() public view returns (uint256 vaultValue)Gets the total value of the tokens within the fund, value shown in stablecoinUSDAddr
_getVaultValues
function _getVaultValues() internal view returns (uint256 vaultValue)_getVaultValuesInUSD
function _getVaultValuesInUSD() internal view returns (uint256 vaultValue)getStableValues
function getStableValues() public view returns (uint256 vaultValue)getTargetValues
function getTargetValues() public view returns (uint256 vaultValue)withdraw
function withdraw(uint256 _shares) external returns (uint256)Withdraws from funds from the Cake Vault
Parameters
Name
Type
Description
_shares
uint256
withdraw
function withdraw(uint256 _shares, uint32 _slippage) public returns (uint256)_withdraw
function _withdraw(uint256 _shares, uint32 _slippage) internal returns (uint256)emergencyUnWindPosition
function emergencyUnWindPosition() externalsetProperties
function setProperties(uint256 _stopLossPerc, uint256 _takeProfitPerc, uint256 _tradeCycle, uint256 _maxPerSwap) publicsetExecutor
function setExecutor(address _wallet, bool _allow) externalsetSwapEngine
function setSwapEngine(address _newSwapEngine) externalgetUnitPrice
function getUnitPrice() public view returns (uint256)The unitprice of a share of this fund in baseToken
_getUnitPrice
function _getUnitPrice() internal view returns (uint256)getUnitPriceInUSD
function getUnitPriceInUSD() public view returns (uint256)The unitprice of a share of this fund, in stablecoinUSDAddr
isReTrade
function isReTrade() public view returns (bool)Last updated