Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Bitshares Client Needs Account Value Feature  (Read 451 times)

0 Members and 1 Guest are viewing this topic.

Offline cylonmaker2053

  • Hero Member
  • *****
  • Posts: 1004
  • Saving the world one block at a time
    • View Profile
  • BTS: cylonmaker2053
Bitshares Client Needs Account Value Feature
« on: May 29, 2015, 10:12:30 PM »

Suggestion for future dev of the client:

It'd be great to have an account value feature on the Dashboard so you can see the total value of all your BTS and other assets. Ideally, we'd have the option that RippleTrade has of seeing total value in BTS, BTC, USD, or other useful currencies.

merockstar

  • Guest
Re: Bitshares Client Needs Account Value Feature
« Reply #1 on: May 29, 2015, 11:56:16 PM »
it would be a nice feature, but I don't mind not having it.

I don't like to think of the value of my BTS in terms of USD. I do my best to just block it out and forget I own any.

Offline cylonmaker2053

  • Hero Member
  • *****
  • Posts: 1004
  • Saving the world one block at a time
    • View Profile
  • BTS: cylonmaker2053
Re: Bitshares Client Needs Account Value Feature
« Reply #2 on: May 30, 2015, 01:37:24 AM »
true, even a total BTS or BTC value summary would be cool...

Offline BunkerChain Labs

Re: Bitshares Client Needs Account Value Feature
« Reply #3 on: May 30, 2015, 03:46:54 AM »
I prefer to calculate total asset value in chocolate bars.

Even having one is still delicious. :)
+-+-+-+-+-+-+-+-+-+-+
www.Peerplays.com | World's First Decentralized Tournament Platform Built Entirely on the Blockchain!
+-+-+-+-+-+-+-+-+-+-+

Tuck Fheman

  • Guest
Re: Bitshares Client Needs Account Value Feature
« Reply #4 on: May 30, 2015, 04:34:26 AM »
Suggestion for future dev of the client:

It'd be great to have an account value feature on the Dashboard so you can see the total value of all your BTS and other assets. Ideally, we'd have the option that RippleTrade has of seeing total value in BTS, BTC, USD, or other useful currencies.

1 BitShares = 1 BitShares.

What you're asking for could probably be handled with a small bounty to code that in for you personally and compile the wallet (if necessary). I'm just guessing that would be possible, since it's a relatively easy task (I think).
« Last Edit: May 30, 2015, 04:36:43 AM by Tuck Fheman »

Offline cylonmaker2053

  • Hero Member
  • *****
  • Posts: 1004
  • Saving the world one block at a time
    • View Profile
  • BTS: cylonmaker2053
Re: Bitshares Client Needs Account Value Feature
« Reply #5 on: May 30, 2015, 05:33:02 PM »
Interesting thought to put up a bounty for that feature. It's not just to see the value of the BTS in my wallet relative to other currencies, but to see the full account value including current market prices for the other bitassets. It'd be nice to log in and see the bottom line full wallet value. 

Offline Riverhead

Re: Bitshares Client Needs Account Value Feature
« Reply #6 on: May 30, 2015, 08:54:40 PM »
Interesting thought to put up a bounty for that feature. It's not just to see the value of the BTS in my wallet relative to other currencies, but to see the full account value including current market prices for the other bitassets. It'd be nice to log in and see the bottom line full wallet value.

While not part of the client I have python functions that calculate this for one of my bot dashboards. Returns values in BTS. It ain't pretty but it gets the job done.

Code: [Select]
def get_open_order_balance(self, account, base, quote):
        quote_precision = float(self.get_precision(self.asset_id(quote)))
        base_precision = float(self.get_precision(self.asset_id(base)))
        median_quote = float(self.get_median(quote))
        #print "%s, %s" % (quote, base)
        response = self.request("wallet_market_order_list", [quote, base, -1, account])
        order_ids = []
        total_orders = 0.0
        bids = 0.0
        asks = 0.0
        shorts = 0.0
        if "result" in response.json():
           for item in response.json()["result"]:
              if item[1]["type"] == "bid_order":
                 total_orders += item[1]["state"]["balance"] / quote_precision
                 bids += item[1]["state"]["balance"] / quote_precision
              if item[1]["type"] == "ask_order":
                 total_orders += (item[1]["state"]["balance"] / base_precision) * median_quote
                 asks += (item[1]["state"]["balance"] / base_precision) * median_quote
              if item[1]["type"] == "cover_order":
                 total_orders += (item[1]["collateral"] / base_precision) * median_quote
                 shorts += (item[1]["collateral"] / base_precision) * median_quote
           return total_orders, bids, asks, shorts
        return

    def total_account_value(self, account):
        base = "BTS"
        markets = ["GOLD", "SILVER", "USD"]
        account_value = 0.0
        balance_bts = self.get_balance(account, base)
        for quote in markets:
           total_orders, bids, asks, shorts  = self.get_open_order_balance(account, base, quote)
           precision = float(self.get_precision(self.asset_id(quote)) )
           balance = float(self.get_balance(account, quote))
           median = float(self.get_median(quote))
           account_value = account_value + (total_orders / median) + (balance / median)

        account_value += balance_bts
        return account_value

Offline cylonmaker2053

  • Hero Member
  • *****
  • Posts: 1004
  • Saving the world one block at a time
    • View Profile
  • BTS: cylonmaker2053
Re: Bitshares Client Needs Account Value Feature
« Reply #7 on: May 30, 2015, 10:14:27 PM »
Interesting thought to put up a bounty for that feature. It's not just to see the value of the BTS in my wallet relative to other currencies, but to see the full account value including current market prices for the other bitassets. It'd be nice to log in and see the bottom line full wallet value.

While not part of the client I have python functions that calculate this for one of my bot dashboards. Returns values in BTS. It ain't pretty but it gets the job done.

Code: [Select]
def get_open_order_balance(self, account, base, quote):
        quote_precision = float(self.get_precision(self.asset_id(quote)))
        base_precision = float(self.get_precision(self.asset_id(base)))
        median_quote = float(self.get_median(quote))
        #print "%s, %s" % (quote, base)
        response = self.request("wallet_market_order_list", [quote, base, -1, account])
        order_ids = []
        total_orders = 0.0
        bids = 0.0
        asks = 0.0
        shorts = 0.0
        if "result" in response.json():
           for item in response.json()["result"]:
              if item[1]["type"] == "bid_order":
                 total_orders += item[1]["state"]["balance"] / quote_precision
                 bids += item[1]["state"]["balance"] / quote_precision
              if item[1]["type"] == "ask_order":
                 total_orders += (item[1]["state"]["balance"] / base_precision) * median_quote
                 asks += (item[1]["state"]["balance"] / base_precision) * median_quote
              if item[1]["type"] == "cover_order":
                 total_orders += (item[1]["collateral"] / base_precision) * median_quote
                 shorts += (item[1]["collateral"] / base_precision) * median_quote
           return total_orders, bids, asks, shorts
        return

    def total_account_value(self, account):
        base = "BTS"
        markets = ["GOLD", "SILVER", "USD"]
        account_value = 0.0
        balance_bts = self.get_balance(account, base)
        for quote in markets:
           total_orders, bids, asks, shorts  = self.get_open_order_balance(account, base, quote)
           precision = float(self.get_precision(self.asset_id(quote)) )
           balance = float(self.get_balance(account, quote))
           median = float(self.get_median(quote))
           account_value = account_value + (total_orders / median) + (balance / median)

        account_value += balance_bts
        return account_value

Awesome, thx! i'm a little rusty with python these days. how do i run the function? i don't see where it interacts with the Bitshares API?

 

Google+