xWin Strategy
xWinStrategy
stablecoinUSDAddr
address stablecoinUSDAddr
stablecoinUSDAddr is used for view functions with the 'inUSD' suffix.
baseToken
address baseToken
baseToken for the fund/strategy, token for deposit, and token recieved on withdraw
emitEvent
contract IxWinEmitEvent emitEvent
__xWinStrategy_init
function __xWinStrategy_init(string name, string symbol, address _baseToken, address _USDTokenAddr) internal
_Deposit
event _Deposit(uint256 datetime, address contractaddress, uint256 rate, uint256 depositAmount, uint256 shares)
_Withdraw
event _Withdraw(uint256 datetime, address contractaddress, uint256 rate, uint256 avrCost, uint256 withdrawAmount, uint256 shares)
getVaultValues
function getVaultValues() external view virtual returns (uint256)
Gets the total value of the tokens within the fund, value shown in baseToken
_getVaultValues
function _getVaultValues() internal view virtual returns (uint256)
getUnitPrice
function getUnitPrice() external view virtual returns (uint256)
The unitprice of a share of this fund in baseToken
_getUnitPrice
function _getUnitPrice() internal view virtual returns (uint256)
getVaultValuesInUSD
function getVaultValuesInUSD() external view virtual returns (uint256)
Gets the total value of the tokens within the fund, value shown in stablecoinUSDAddr
getUnitPriceInUSD
function getUnitPriceInUSD() external view virtual returns (uint256)
The unitprice of a share of this fund, in stablecoinUSDAddr
deposit
function deposit(uint256 amount) external virtual returns (uint256)
Deposits baseToken into the fund, and receives shares based on the fund's unitPrice
Parameters
amount
uint256
Amount of baseToken to deposit
Return Values
[0]
uint256
shares Amount of shares minted to depositor
withdraw
function withdraw(uint256 amount) external virtual returns (uint256)
Withdraws from the fund by burning shares, liquidating assets into baseToken and transfering to user
Parameters
amount
uint256
Amount of shares to withdraw
Return Values
[0]
uint256
amount Amount of baseTokens transferred to depositor
deposit
function deposit(uint256 amount, uint32 slippage) external virtual returns (uint256)
Deposits baseToken into the fund, and receives shares based on the fund's unitPrice
Parameters
amount
uint256
Amount of baseToken to deposit
slippage
uint32
Slippage to use for any swaps during the process
Return Values
[0]
uint256
shares Amount of shares minted to depositor
withdraw
function withdraw(uint256 amount, uint32 slippage) external virtual returns (uint256)
Withdraws from the fund by burning shares, liquidating assets into baseToken and transfering to user
Parameters
amount
uint256
Amount of shares to withdraw
slippage
uint32
Slippage to use for any swaps during the process
Return Values
[0]
uint256
amount Amount of baseTokens transferred to depositor
setEmitEvent
function setEmitEvent(address _addr) external
updateUSDAddr
function updateUSDAddr(address _newUSDAddr) external
setPause
function setPause() external
setUnPause
function setUnPause() external
Last updated