If I wanted a smart contract to send tokens based on the exchange price of the ERC20 token received, or any agreed upon value in US dollars how would I do so?
For example, If i wanted my tokens to have a value of $.01 and I wanted to accept Patientory (PTOY) tokens which currently trade at $.13, (or the equivalent exchange rate in PTOY/ETHER) is there a way to have the contract automatically send 13 tokens for each PTOY received and to determine that value at the time it is sent?
Essentially, I want to import the GDAX, coinmarketcap, Poloniex price, etc into the smart contract. The ultimate goal would be to be able to accept almost any ERC20 token at its current exchange value when sent. Or is the only option to manually change the contract in a given interval (daily, hourly etc).