This question already has an answer here:

I would like to sell tokens at a fixed price in dollars and to do the conversion in ETH by default at the coinmarketcap price. E.g. Would like to sell 1 "mytoken" every day at 1 USD. 1 USD = 0.12 ETH (because the ETH today is quoted at 8.1 USD).

How could I code that?

merged by eth Apr 22 '16 at 18:42

This question was merged with How would stablecoins work on Ethereum? because it is an exact duplicate of that question.