cryptoeax / arbbot

Arbitrator, a bitcoin/altcoin arbitrage trading bot
https://gitter.im/cryptoeax-arbbot/Lobby
GNU General Public License v3.0
199 stars 78 forks source link

New Total for UI request BTC+altcons = TotalBTC #7

Open jjc6676 opened 6 years ago

jjc6676 commented 6 years ago

Can we add another TOTAL BTC to the chart and Wallets section that adds the TOTAL BTC + TOTAL ALTCOINS? So TOTAL BTC+ALT = XXX

moinnadeem commented 6 years ago

@cryptoeax I'd like to work on this; do you have thoughts on how this should be implemented in the UI?

cryptoeax commented 6 years ago

Yes, thanks for your interest! I think we should extend the wallets and charts UI with some new information for this purpose. Here is the plan that I had in mind for this. It should be enough for you to be able to put together a PR for this. :-)

------- TOTAL PORTFOLIO -------
------------ IN BTC -----------

and then calculate the overall portfolio in balance in BTC, and then print it out in here. It woo uld be nice if you can break out the part up to here into one separate PR.

The graph drawing happens in this function: https://github.com/cryptoeax/arbbot/blob/18dfb6b838e59b2c3b511957cc4f9f329a121639/web/ui.js#L144 Look for occurrences of graphMode for places you would probably need to modify.

Hope this helps!

moinnadeem commented 6 years ago

@cryptoeax Hm, it seems like we're writing a lot of edge cases for BTC when we store the amount of BTC as it's own value. Thoughts on setting RATE for BTC to be 1 for all values?

If not, I'm basically confused on writing the SQL query.

moinnadeem commented 6 years ago

As far as the first PR goes, see #56.

cryptoeax commented 6 years ago

@cryptoeax Hm, it seems like we're writing a lot of edge cases for BTC when we store the amount of BTC as it's own value. Thoughts on setting RATE for BTC to be 1 for all values?

If that makes your life simpler, that's fine. I prefer if you did that as a separate PR for easier t reviewing and merging. Thanks!

Note that you would need to handle the existing data in the user's database. We have had similar changes to the database before, and they're quite simple to make. For example, see this call in the beginning of main.php. We upgrade the database if necessary: https://github.com/cryptoeax/arbbot/blob/7c8028da95d244d6c22747deddbe7c922ed88e53/bot/Database.php#L418

You would need to do something similar, with a query like UPDATE snapshot SET rate = '1.00000000' WHERE coin = 'BTC';.

moinnadeem commented 6 years ago

Sorry for being so AFK; I've been traveling with family! Just to give you a heads up, can probably work on this around next week. My apologies for any troubles it may have caused!

cryptoeax commented 6 years ago

Not a problem, thanks for the heads up. Enjoy the time spent with family. :-)