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

Move to use the Zapper API to loading token balances #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

maxdumas
Copy link
Collaborator

@maxdumas maxdumas commented Dec 8, 2021

This CR changes (essentially rewrites) the Ethereum Wallet integration to use the Zapper API to load token balances for users. This API is by far the most comprehensive API for capturing the token balances of all tokens across the DeFi ecosystem and has recently been made publicly available, free of charge. As such it was a no-brainer to use this API for LunchMoney Ethereum balances, as the previous solution had no ability to capture the value of more esoteric token holdings like liquidity pool tokens, farming tokens, NFTs, etc. The previous solution also had no ability to capture token balances for Ethereum Layer 2 networks like Polygon, Optimism, etc.

The most significant upstream change included in this is that the client now returns an amountInUSD field in addition to an amount field. The amountInUSD field contains Zapper's calculation of the value of the wallet's token holding in US dollars. I chose to start to include this in the output instead of letting the upstream caller calculate this, as we've been doing up to now, because many of these conversions to USD value are rather complicated and Zapper gives us this for free, so why not use it. :)

Another nice side-effect of this solution is that we no longer use a fixed token list, so this invalidates the needs for PRs like #2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant