Commit 2f85a8c6 authored by Kenny Tran's avatar Kenny Tran Committed by GitHub

Merge pull request #132 from kennyt/normalize-token-exchange-rate

Normalize remove liquidity exchange rate
parents f87aa671 05e7f9a0
...@@ -197,8 +197,8 @@ class RemoveLiquidity extends Component { ...@@ -197,8 +197,8 @@ class RemoveLiquidity extends Component {
const ownership = liquidityBalance.dividedBy(totalSupply); const ownership = liquidityBalance.dividedBy(totalSupply);
const ethPer = ethReserve.dividedBy(totalSupply); const ethPer = ethReserve.dividedBy(totalSupply);
const tokenPer = tokenReserve.dividedBy(totalSupply); const tokenPer = tokenReserve.multipliedBy(10 ** (18 - tokenDecimals)).dividedBy(totalSupply);
const exchangeRate = tokenReserve.div(ethReserve); const exchangeRate = tokenReserve.multipliedBy(10 ** (18 - tokenDecimals)).div(ethReserve);
const ownedEth = ethPer.multipliedBy(liquidityBalance).dividedBy(10 ** 18); const ownedEth = ethPer.multipliedBy(liquidityBalance).dividedBy(10 ** 18);
const ownedToken = tokenPer.multipliedBy(liquidityBalance).dividedBy(10 ** tokenDecimals); const ownedToken = tokenPer.multipliedBy(liquidityBalance).dividedBy(10 ** tokenDecimals);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment