Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #111 from Synthetixio/107-remove-eth
Browse files Browse the repository at this point in the history
Remove eth when calculating sUSD
  • Loading branch information
0xclem authored Nov 27, 2019
2 parents 142de0b + 407e7bc commit c072764
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/screens/Dashboard/fetchData.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const convertFromSynth = (fromSynthRate, toSynthRate) => {
export const getSusdInUsd = (synthRates, sethToEthRate) => {
const sEth = convertFromSynth(synthRates.susd, synthRates.seth);
const eth = sEth * sethToEthRate;
return eth * synthRates.eth;
return eth * synthRates.seth;
};
const getSETHtoETH = async () => {
const exchangeAddress = '0xe9cf7887b93150d4f2da7dfc6d502b216438f244';
Expand All @@ -39,9 +39,8 @@ const getSETHtoETH = async () => {

const getPrices = async () => {
try {
// sETH seems to be the same as ETH??
const synthsP = snxJSConnector.snxJS.ExchangeRates.ratesForCurrencies(
['SNX', 'sUSD', 'ETH', 'sETH'].map(bytesFormatter)
['SNX', 'sUSD', 'sETH'].map(bytesFormatter)
);
const sethToEthRateP = getSETHtoETH();
const [synths, sethToEthRate] = await Promise.all([synthsP, sethToEthRateP]);
Expand Down
1 change: 0 additions & 1 deletion src/screens/Dashboard/fetchData.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('getSusdInUsd', () => {
test('converts correctly', () => {
const synthRates = {
susd: 1,
eth: 150.89559276124712,
seth: 150.89559276124712,
};
const sethToEthRate = 0.9838261979298352;
Expand Down

0 comments on commit c072764

Please sign in to comment.