0

I have developed an app that swaps eth for dai in ropsten network using uniswap, but when I get to check the price of eth in dai I get a strange value, 95.9...

Is it beacuse I am in Ropsten test Network? I can't manage to figure out if it is because of that or If i am doing my calculations wrong, so I'd appreciate any help you guys could give me. The actual line where I check the price of 1 ether in dai goes like this (node.js):

const price = await exchangeContract.methods.getEthToTokenInputPrice(web3.utils.toWei('1', 'Ether')).call()

Thank you everybody!

2
  • Prices on test networks are always wrong, because there is no-one arbitraging the pools.
    – kfx
    Oct 20 '21 at 14:57
  • Have develop a test file on the mainet and get Eth price: 136478377597734366 DAI What don't actually look like ether price in dollars, what am I doing wrong?
    – Apollo
    Oct 20 '21 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.