Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1794 - Notify if settle is worth less than market value #1847

Merged
merged 3 commits into from Sep 19, 2018

Conversation

kapeer42
Copy link
Contributor

Closes #1794

This might require some discussion and commits.

The way I get the market price is by calling the api's get_order_book directly but this means a few things:

  • I get real numbers comparison, so if the price difference is less than the precision, it's undefined behavior
  • If the order book changes after the modal is opened, it is ignored.
  • Any optimization done in the MarketsStore is bypassed

I think turning the ExchangeSubscriber component into an HOC might be a proper way to do it but it seems outside the scope of the initial issue.

Maybe someone can point me to a better way to do it?

Demo:
worth-less-settlement-warning-demo

@kapeer42 kapeer42 changed the title #1794 Notify if settle is worth less than market value #1794 - Notify if settle is worth less than market value Sep 11, 2018
@kapeer42
Copy link
Contributor Author

CI going crazy xD

@abitmore
Copy link
Member

abitmore commented Sep 11, 2018

I think it's better to call get_ticker rather than get_order_book, although get_ticker doesn't return volume, usually it's fine. Update: it's fine (and even better, performance-wise) since you called get_order_book with a small limit parameter.

If the client has subscribed to market already, I guess the order book / ticker data should have been cached so perhaps can use the cache directly.

@sschiessl-bcp
Copy link
Contributor

kapeer42 are you available on Telegram or any other live-chat app?

@kapeer42
Copy link
Contributor Author

@sschiessl-bcp discord

Copy link
Contributor

@sschiessl-bcp sschiessl-bcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the full qualified market name ( XXX / BTS ) as the link
image

@kapeer42
Copy link
Contributor Author

worth-less-settle-fqmn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants