RigoBlock / contracts

[DEPRECATED] directory of our contracts
Apache License 2.0
1 stars 0 forks source link

how to properly visualize assets in portfolio #14

Open gabririgo opened 6 years ago

gabririgo commented 6 years ago

it is probably not a good idea to use events, unless exchanges provide the events under a common standard

normally the standardized function balanceOf(address _)who) returns (uint)

returns the balance of tokens for a specific account

on top of it, we should sum the balance at derivatives exchange or exchanges that require deposits

wnz99 commented 6 years ago

The problem with events is that the balance could not be correct if the endpoint is out of sync. Currently we are processing all the buy/sell events for a specific account, and adding/decrementing the balance accordingly.

gabririgo commented 6 years ago

yes the portfolio should be queried as balanceOf(address _fund) at approved tokens and at approved exchanges, and then we would be able to sum them up and obtain the NAV of the fund. This is needed for the NAV module as well, which will be implemented in the future when stable.