DeltaBalances / DeltaBalances.github.io

The Ethereum decentralized exchange assistant. Check token balances, transaction details & trade history.
https://deltabalances.github.io/
GNU General Public License v3.0
169 stars 67 forks source link

Request: add balances at exchange history page #75

Open rory4ever opened 4 years ago

rory4ever commented 4 years ago

The Exchange History page is working great and fast as well, kudos to that :) However, for option " funds" it only shows me all incoming and outgoing funds and deposits/withdrawals. Although this is great I really miss the possibility to show all historical balances as well (for both the wallet as on the smartcontract) I was wondering if this can be added in the future, it is also a much needed option for tax purposes. Thanks in advance.

DeltaBalances commented 4 years ago

This is a good idea for a future addition, but requires a little too much work for now. You can't simply query Ethereum for a balance at a past date, you need to calculate it using other available info.

For you wallet balance for example, you get the current wallet balance and then walk back through all transactions (transfers) that happend since that date. This should sum up to the right total, but some tokens use minting/burning/wrapping features that might not show up as a transfer.
To also get deposited balances you would need to do a second pass, but check all deposit/withdraw/trade events on the exchange.

With the current setup this would be incredibly slow, to make it of any use it would probably require and additional database on a server somewhere. Again, a good idea to speed this site up, but requires quite a bit of extra work.

Luckily etherscan has already done some of this work for you, just not for deposited balances. They are just a little hard to find on their homepage.

Etherscan historical wallet balances:

Note that etherscan's trackers will often report a bad balance for WETH after you unwrap it, and will only correct your balance once you get some new WETH. (a good example of the little issues with checking old token balances)

rory4ever commented 4 years ago

Thanks for your reply. The main purpose for me is the deposited balances (on the etherdelta2 smartcontract) so the Etherscan solution is of little use to me.

I understand that this is a bridge too far for now, hopefully somewhere in he future, you have my full support ;)