ButterBatchProcessing


Functions:

Events:

Graphs:


Function Definitions:

constructor()

constructor(contract IContractRegistry _contractRegistry, contract IStaking _staking, contract ISetToken _setToken, contract IERC20 _threeCrv, contract CurveMetapool _threePool, contract BasicIssuanceModule _basicIssuanceModule, address[] _yTokenAddresses, struct ButterBatchProcessing.CurvePoolTokenPair[] _curvePoolTokenPairs, struct ButterBatchProcessing.ProcessingThreshold _processingThreshold) public 

getAccountBatches()

getAccountBatches(address _account) external  returns (bytes32[])
Parameter NameTypeDescription

_account

address

The address for whom we want to retrieve batches

getMinAmountToMint()

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

this controls slippage in the minting process

getMinAmount3CrvFromRedeem()

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

this controls slippage in the redeeming process

valueOfComponents()

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

valueOf3Crv()

valueOf3Crv(uint256 _units) public  returns (uint256)

depositForMint()

depositForMint(uint256 _amount, address _depositFor) external 
Parameter NameTypeDescription

_amount

uint256

Amount of 3cr3CRV to use for minting

_depositFor

address

User that gets the shares attributed to (for use in zapper contract)

depositForRedeem()

depositForRedeem(uint256 _amount) external 
Parameter NameTypeDescription

_amount

uint256

amount of Butter to be redeemed

withdrawFromBatch()

withdrawFromBatch(bytes32 _batchId, uint256 _amountToWithdraw, address _withdrawFor) external 
Parameter NameTypeDescription

_batchId

bytes32

From which batch should funds be withdrawn from

_amountToWithdraw

uint256

Amount of Butter or 3CRV to be withdrawn from the queue (depending on mintBatch / redeemBatch)

_withdrawFor

address

User that gets the shares attributed to (for use in zapper contract)

claim()

claim(bytes32 _batchId, address _claimFor) external  returns (uint256)
Parameter NameTypeDescription

_batchId

bytes32

Id of batch to claim from

_claimFor

address

User that gets the shares attributed to (for use in zapper contract)

claimAndStake()

claimAndStake(bytes32 _batchId, address _claimFor) external 
Parameter NameTypeDescription

_batchId

bytes32

Id of batch to claim from

_claimFor

address

User that gets the shares attributed to (for use in zapper contract)

moveUnclaimedDepositsIntoCurrentBatch()

moveUnclaimedDepositsIntoCurrentBatch(bytes32[] _batchIds, uint256[] _shares, enum ButterBatchProcessing.BatchType _batchType) external 

the indices of batchIds must match the amountsInHysi to work properly (This will be done by the frontend)

Parameter NameTypeDescription

_batchIds

bytes32[]

the ids of each batch where butter should be moved from

_shares

uint256[]

how many shares should redeemed in each of the batches

_batchType

enum ButterBatchProcessing.BatchType

the batchType where funds should be taken from (Mint -> Take Hysi and redeem then, Redeem -> Take 3Crv and Mint Butter)

batchMint()

batchMint() external 

This function deposits 3CRV in the underlying Metapool and deposits these LP token to get yToken which in turn are used to mint Butter This process leaves some leftovers which are partially used in the next mint batches. In order to get 3CRV 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 Butter for the underlying yToken and deposits these yToken in curve Metapools for 3CRV In order to get stablecoins from 3CRV we can use a zap to redeem 3CRV 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 

setStaking()

setStaking(address _staking) external 

updateSweetheart()

updateSweetheart(address _sweetheart, bool _enabled) external 
Parameter NameTypeDescription

_sweetheart

address

The address that shall become/lose their sweetheart status

setCurvePoolTokenPairs()

setCurvePoolTokenPairs(address[] _yTokenAddresses, struct ButterBatchProcessing.CurvePoolTokenPair[] _curvePoolTokenPairs) public 
Parameter NameTypeDescription

_yTokenAddresses

address[]

An array of addresses for the yToken needed to mint Butter

_curvePoolTokenPairs

struct ButterBatchProcessing.CurvePoolTokenPair[]

An array structs describing underlying yToken, crvToken and curve metapool

setProcessingThreshold()

setProcessingThreshold(uint256 _cooldown, uint256 _mintThreshold, uint256 _redeemThreshold) public 

The cooldown is the same for redeem and mint batches

Parameter NameTypeDescription

_cooldown

uint256

Cooldown in seconds

_mintThreshold

uint256

Amount of MIM necessary to mint immediately

_redeemThreshold

uint256

Amount of Butter necessary to mint immediately

setSlippage()

setSlippage(uint256 _mintSlippage, uint256 _redeemSlippage) external 
Parameter NameTypeDescription

_mintSlippage

uint256

amount in bps (e.g. 50 = 0.5%)

_redeemSlippage

uint256

amount in bps (e.g. 50 = 0.5%)

setRedemptionFee()

setRedemptionFee(uint256 _feeRate, address _recipient) external 

Per default both of these values are not set. Therefore a fee has to be explicitly be set with this function

Parameter NameTypeDescription

_feeRate

uint256

Redemption fee rate in basis points

_recipient

address

The recipient which receives these fees (Should be DAO treasury)

claimRedemptionFee()

claimRedemptionFee() external 

recoverLeftover()

recoverLeftover(address _yTokenAddress, uint256 _amount) external 

This should only be used if there is a clear trend that a certain amount of yToken leftover wont be used in the minting process

Parameter NameTypeDescription

_yTokenAddress

address

address of the yToken that should be recovered

_amount

uint256

amount of yToken that should recovered

pause()

pause() external 

All function with the modifer whenNotPaused cant be called anymore. Namly deposits and mint/redeem

unpause()

unpause() external 

All function with the modifer whenNotPaused cant be called anymore. Namly deposits and mint/redeem

Events

Deposit

Deposit(address from, uint256 deposit)

Withdrawal

Withdrawal(address to, uint256 amount)

SlippageUpdated

SlippageUpdated(struct ButterBatchProcessing.Slippage prev, struct ButterBatchProcessing.Slippage current)

BatchMinted

BatchMinted(bytes32 batchId, uint256 suppliedTokenAmount, uint256 butterAmount)

BatchRedeemed

BatchRedeemed(bytes32 batchId, uint256 suppliedTokenAmount, uint256 threeCrvAmount)

Claimed

Claimed(address account, enum ButterBatchProcessing.BatchType batchType, uint256 shares, uint256 claimedToken)

WithdrawnFromBatch

WithdrawnFromBatch(bytes32 batchId, uint256 amount, address to)

MovedUnclaimedDepositsIntoCurrentBatch

MovedUnclaimedDepositsIntoCurrentBatch(uint256 amount, enum ButterBatchProcessing.BatchType batchType, address account)

CurveTokenPairsUpdated

CurveTokenPairsUpdated(address[] yTokenAddresses, struct ButterBatchProcessing.CurvePoolTokenPair[] curveTokenPairs)

ProcessingThresholdUpdated

ProcessingThresholdUpdated(struct ButterBatchProcessing.ProcessingThreshold previousThreshold, struct ButterBatchProcessing.ProcessingThreshold newProcessingThreshold)

RedemptionFeeUpdated

RedemptionFeeUpdated(uint256 newRedemptionFee, address newFeeRecipient)

SweetheartUpdated

SweetheartUpdated(address sweetheart, bool isSweeheart)

StakingUpdated

StakingUpdated(address beforeAddress, address afterAddress)

Graphs

Dependency Graph

Inheritance Graph

Last updated