pxsocs / warden_terminal

WARden with an enhanced Text User Interface for Unix based systems
72 stars 14 forks source link

Feature Request - Portfolio Value #54

Closed AnarchyNow closed 3 years ago

AnarchyNow commented 3 years ago

I was playing around and thought about having a real-time BTC portfolio value in the header. By adding a variable in the Config.ini called "Own", we can easily pull that quantity of BTC, multiply by the current price of BTC, and then show it in the header. This would allow users to see their BTC portfolio value even if they do not have any Sats in their node's BTC wallet. If there is ever trending added, this would be a cool point to watch. Thoughts?

Config.ini: [CURRENCIES] primary_fx = 'USD' fx_list = ['USD','EUR', 'GBP', 'CAD'] Own = 3.18688358

dashboard.py if small_display is True: from node_warden import load_config config = load_config(quiet=True) config = config['CURRENCIES'] Own = config.getfloat("Own") primary_fx = ast.literal_eval(config.get('primary_fx')) Worth = float(btc_price * Own) txt = 'WARden Node Edition (Version: ' + version( ) + ") | " f"${jformat(btc_price, 0)} {primary_fx}/BTC " + " | " + f"Own: {Own} BTC | " + f"Net: ${jformat(Worth, 0)} {primary_fx}" Screen Shot 2021-07-30 at 3 05 06 PM

pxsocs commented 3 years ago

Great suggestion and being implemented with a slight change. Given there's already too much info on the header, which makes it particularly crowded on smaller displays, the info will be displayed in 2 widgets - see below.

It also complies with the Hidden key press so when Hidden is True, info is not displayed.

config.ini now has a new section:

[PORTFOLIO]
position_btc = 1.00

image

image

pxsocs commented 3 years ago

Implemented on the latest version: (https://github.com/pxsocs/warden_terminal/commit/ff292c89a16a0c4ca00d479c5700012d9a981585)