xWin BBMA (BSC)

xWinBBMA

TradeQueue

struct TradeQueue {
  bool nextTrade;
  uint256 nextTradeBlock;
  uint8 tradeType;
}

targetToken

contract IERC20Upgradeable targetToken

swapEngine

contract IxWinSwap swapEngine

xWinPriceMaster

contract IxWinPriceMaster xWinPriceMaster

executors

mapping(address => bool) executors

tradeQueue

struct xWinBBMA.TradeQueue tradeQueue

maxPerSwap

uint256 maxPerSwap

tradeCycle

uint256 tradeCycle

stopLossPrice

uint256 stopLossPrice

takeProfitPrice

uint256 takeProfitPrice

stopLossPerc

uint256 stopLossPerc

takeProfitPerc

uint256 takeProfitPerc

initialize

function initialize(address _baseToken, contract IERC20Upgradeable _targetToken, address _swapEngine, address _USDTokenAddr, address _xWinPriceMaster, uint256 _managerFee, uint256 _performanceFee, uint256 _collectionPeriod, address _managerAddr) external

onlyExecutor

modifier onlyExecutor()

checkUpkeep

function checkUpkeep(bytes) external view returns (bool upkeepNeeded, bytes performData)

performUpkeep

function performUpkeep(bytes) external

updatexWinPriceMaster

function updatexWinPriceMaster(address _xWinPriceMaster) external

update 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() external

systemTrade

function systemTrade(uint8 _tradeType) public

Triggered 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) internal

getTriggerTakeProfit

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() external

setProperties

function setProperties(uint256 _stopLossPerc, uint256 _takeProfitPerc, uint256 _tradeCycle, uint256 _maxPerSwap) public

setExecutor

function setExecutor(address _wallet, bool _allow) external

setSwapEngine

function setSwapEngine(address _newSwapEngine) external

getUnitPrice

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