hotwallet / hotwallet

HotWallet Crypto Platform
https://hotwallet.com
1 stars 2 forks source link

Stale data and computed values on securities #65

Open MannyC opened 6 years ago

MannyC commented 6 years ago

Stale prices should not be displayed, instead displaying a - or an animated loading icon. This will mean each price will have to have an age associated with it.

It might be an idea to add the ability to request a current price over the websocket. As things are at the moment, when a price comes into view it could be stale for up to a minute before an update is issued for it.

Somewhat related, I was considering how to add the rank into the securities instead of using the index as we do at the moment. I was thinking of changing getSecurityWithBalance to be more general, and to have it rank all of the securities and add the balances to them. Something I realized though is that the ranks can be stale with our current system of not subscribing to all price updates. We could add the rank into the stream feed, but that would allow for multiple securities with the same rank.

will123195 commented 6 years ago

Regarding rank, we're already sorting by market cap, so I think we can assign the rank here https://github.com/will123195/tarragon-react/blob/master/src/selectors/securities.js#L35-L38