ThreeXBatchProcessing

Defines if the Batch will mint or redeem 3X


Functions:

Events:

Graphs:


Function Definitions:

constructor()

constructor(contract IContractRegistry __contractRegistry, contract IStaking _staking, struct BatchTokens _mintBatchTokens, struct BatchTokens _redeemBatchTokens, contract BasicIssuanceModule _basicIssuanceModule, address[] _componentAddresses, struct ThreeXBatchProcessing.ComponentDependencies[] _componentDependencies, contract IERC20 _swapToken, struct AbstractBatchController.ProcessingThreshold _processingThreshold) public 

getMinAmountToMint()

getMinAmountToMint(uint256 _valueOfBatch, uint256 _valueOfComponentsPerUnit, uint256 _slippage) public  returns (uint256)

getMinAmountFromRedeem()

getMinAmountFromRedeem(uint256 _valueOfComponents, uint256 _slippage) public  returns (uint256)

valueOfComponents()

valueOfComponents(address[] _tokenAddresses, uint256[] _quantities) public  returns (uint256)

batchMint()

batchMint() external 

This function deposits USDC in the underlying Metapool and deposits these LP token to get yToken which in turn are used to mint 3X This process leaves some leftovers which are partially used in the next mint batches. In order to get USDC we can implement a zap to move stables into the curve tri-pool handleKeeperIncentive checks if the msg.sender is a permissioned keeper and pays them a reward for calling this function (see KeeperIncentive.sol)

batchRedeem()

batchRedeem() external 

This function reedeems 3X for the underlying yToken and deposits these yToken in curve Metapools for USDC In order to get other stablecoins from USDC we can use a zap to redeem USDC for stables in the curve tri-pool handleKeeperIncentive checks if the msg.sender is a permissioned keeper and pays them a reward for calling this function (see KeeperIncentive.sol)

setApprovals()

setApprovals() external 

setComponents()

setComponents(address[] _components, struct ThreeXBatchProcessing.ComponentDependencies[] _componentDependencies) external 
Parameter NameTypeDescription

_components

address[]

An array of addresses for the yToken needed to mint 3X

_componentDependencies

struct ThreeXBatchProcessing.ComponentDependencies[]

An array structs describing underlying yToken, curveMetapool (which is also the lpToken), swapPool and AngleRouter

Events

BatchMinted

BatchMinted(bytes32 batchId, uint256 suppliedTokenAmount, uint256 outputAmount)

BatchRedeemed

BatchRedeemed(bytes32 batchId, uint256 suppliedTokenAmount, uint256 outputAmount)

ComponentDependenciesUpdated

ComponentDependenciesUpdated(address[] components, struct ThreeXBatchProcessing.ComponentDependencies[] componentDependencies)

Graphs

Dependency Graph

Inheritance Graph

Last updated