I'm building a defi dashboard. I need to value a DeFi wallet. I can value individual tokens that trade on a dex, and even LP receipts. But I'm having trouble with protocols like Adamant Finance, which do not give you a token receipt in your wallet. For example, this wallet has a $50 position in an Adamant vault (as of 1/5/2022). How would I detect this position and calculate its value using blockchain data, for example from PolygonScan?
For protocols that do not return a share token and keep the deposit logic inside their smart contract, you need to provide a custom implementation. This means integrating projects one by one.
You may be able to check the history of an account to see which protocols the wallet interacted with and use the custom integration to calculate the value of the deposits. Or the other way around by scanning protocols for the user's address.
For examples you can always check open-source implementations such as DefiLlama (although this is more on the TVL side) or Zapper feature submissions (some include instructions).