Skip to content

implement functionality for 'join pool' and 'calc join pool' by only …#5

Open
AndreyShashlovDev wants to merge 2 commits intomasterfrom
pool-for-eth-buyer
Open

implement functionality for 'join pool' and 'calc join pool' by only …#5
AndreyShashlovDev wants to merge 2 commits intomasterfrom
pool-for-eth-buyer

Conversation

@AndreyShashlovDev
Copy link
Collaborator

implement functionality for 'join pool' and 'calc join pool' by only Eth value.

result[i].amount = result[i].poolBalance
.mul(expensiveToken.amount.add(expensiveToken.poolBalance))
.div(expensiveToken.poolBalance)
.sub(result[i].poolBalance);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут тоже можно 1 раз ratio посчитать

ratio = expensiveToken.amount.add(expensiveToken.poolBalance).div(expensiveToken.poolBalance)

for() {
result[i].amount = result[i].poolBalance.mul(ratio).sub(result[i].poolBalance)
...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему 1 раз посчитать? внизу уже не нужно считать?
uint ratio = BalancerSafeMath.bdiv(poolAmountOut, BalancerSafeMath.bsub(currentSupply, 1));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants