Let's say on a payment I charge a 5% fee to cover the fluctuation of the market. Is it possible to send back the overcharge or part of it if at the time of the execution of the transaction the actual exchange rate ETH/USD was lower and part of that fee or all of it wasn't necessary?

1 Answer 1


Yes, it should be possible ( but i never tried it ).

There is a service called Oraclize that let's your smart contract access data outside the blockchain, which you can use to get the exchange rate (ETH/USD) and do some math on your smart contract to calculate the refund amount and successfully send it out.

You can learn how to use oraclize on your own or try this tutorial: https://hackernoon.com/external-price-feeds-in-ethlend-using-oraclize-20e0b41d0b73

  • I spent the day to try to get Oraclize to work with no success. I don't know what I am doing wrong. Is there a good tutorial? Whatever I found on google didn't work.
    – Zetal
    May 10, 2018 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.