Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total value incoherent with graph (rm Covalent portfolio_v2 USD balance) #86

Open
lajarre opened this issue Jul 15, 2022 · 0 comments
Open
Labels
bug Something isn't working urgent This is a priority

Comments

@lajarre
Copy link
Member

lajarre commented Jul 15, 2022

The ERC20.balance_usd value is defined using Covalent portfolio_v2 's data (["holdings"][0]["close"]["quote"]), whereas our Balances objects calculate the USD balance themselves based on the token balance and the token USD quote for each day (which lives in Prices objects).

This introduces a discrepancy between how Treasury.usd_total is calculated (using ERC20.balance_usd) and what the UI graph plot shows (which is based on the Balances objects).

Let's keep a single source of truth, and thus remove the ERC20.balance_usd values.

This should probably be bundled together in a refactoring which merges Balances objects inside the Treasury object.

@lajarre lajarre added the bug Something isn't working label Jul 15, 2022
@lajarre lajarre changed the title Remove dependence on Covalent portfolio_v2's USD balance Total value incoherent with graph (rm Covalent portfolio_v2 USD balance) Jul 28, 2022
@vaughnmck vaughnmck added the urgent This is a priority label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgent This is a priority
Projects
None yet
Development

No branches or pull requests

2 participants