Skip to content

Instantly share code, notes, and snippets.

@justinbarry
Created February 10, 2021 07:21
Show Gist options
  • Save justinbarry/a5e21846795365702ac141fa621121fc to your computer and use it in GitHub Desktop.
Save justinbarry/a5e21846795365702ac141fa621121fc to your computer and use it in GitHub Desktop.
factory.transferCash(augurMarket, shareToken, fee, _user, address(this), _cash);
// Move 5% of cash to the balancer pool.
uint256 _cashToSendToPool = (_cash * 5 * 10**16) / 10**18;
uint _poolCashBalance = bPool.getBalance(address(cash));
uint _poolLPTokenTotalSupply = bPool.totalSupply();
uint256 _lpTokenOut = _cashToSendToPool.div(_poolCashBalance).mul(_poolLPTokenTotalSupply);
shareToken.publicBuyCompleteSets(augurMarket, _cashToSendToPool.div(numTicks));
uint256[] memory _maxAmountsIn = new uint256[](2);
_maxAmountsIn[0] = 2**128-1;
_maxAmountsIn[1] = 2**128-1;
bPool.joinPool(_lpTokenOut, _maxAmountsIn);
_cash = cash.balanceOf(address(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment