rotki / rotki

A portfolio tracking, analytics, accounting and management application that protects your privacy
https://rotki.com
GNU Affero General Public License v3.0
2.9k stars 532 forks source link

Allow for breakdown of balances in the exchange view #3074

Open yabirgb opened 3 years ago

yabirgb commented 3 years ago

It would be nice that in Accounts & Balances > Exchange Balances if I have multiple instances of one exchange I could see a breakdown of balances per exchange account also

image

LefterisJP commented 3 years ago

That's not possible with the way the backend is implemented at the moment. We don't return this data from the backend. It's not differentiated in any way. We did it this way as it would be really difficult and a lot of work (for arguably a little benefit) to do what you suggest. You can see this in the discussion here: https://github.com/rotki/rotki/issues/47

We opted for a simpler form of implementation at first.

LefterisJP commented 2 years ago

Okay so this may be possible with few simple changes I think.

We could modify the exchange balances endpoint to return all instances of an exchange instead of adding them up here: https://github.com/rotki/rotki/blob/72e81459efb7757a1cc6f5ff13f6e8b13f658d76/rotkehlchen/api/rest.py#L649

So it should return something like:

      {
          "result": {
              "kraken": {
                  "name": "my kraken",
                  "balances": {
                      "BTC": {"amount": "1", "usd_value": "7540.15"},
                      "ETH": {"amount": "10", "usd_value": "1650.53"}
                  },
              },
              "binance": {
                  "name": "my binance":
                  "balances": {
                      "ETH": {"amount": "20", "usd_value": "3301.06"}
                  }
              }
          },
          "message": ""
      }

I think this is possible to be handled properly by the frontend and then show the breakdown of balances per exchange as requested in the issue

LefterisJP commented 4 months ago

Though not defi perhaps related? https://github.com/rotki/rotki/issues/7342