atx-crypto-club / atxcf

atxcf bot
MIT License
6 stars 3 forks source link

Save symbol, market, price, and last updated info in database #7

Closed transfix closed 8 years ago

transfix commented 8 years ago

Have the PriceNetwork cache price info retrievals. That way, over the course of multiple runs, availability of price info can be preserved even if an exchange goes offline or price info becomes otherwise unavailable. This can help optimize how responsive the bot is to price requests because if network timeouts or any other error happen, we can just return the most recent last price. We should also add a call to the PriceNetwork interface such that we can return the last updated time for each price so that we can know how stale a particular price is.

For now, we can just write this info to a local json file. However, ideally we should write this info to a proper database. Maybe redis...