Open gabririgo opened 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.
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.
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