Conversation
67be21c to
503503f
Compare
etimofeeva
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves #1428
Solution
Add optional ERC-4626 enrichment into account token payloads for both REST and WebSocket.
includeErc4626=trueincludeErc4626: truetoken.erc4626token.erc4626erc4626fields pluserc4626.errordecimals()or trusted contract metadata fallback; otherwise the affected fields are omitted and onlyerroris returnedincludeErc4626is opt-in)Request / Response examples
REST request (
/api/v2/address/{address})WebSocket request (
getAccountInfo){ "id": "1", "method": "getAccountInfo", "params": { "descriptor": "0x167478921b907422f8e88b43c4af2b8bea278d3a", "details": "tokenBalances", "tokens": "nonzero", "includeErc4626": true } }Response excerpt
{ "address": "0x167478921b907422f8e88b43c4af2b8bea278d3a", "tokens": [ { "type": "ERC20", "standard": "ERC20", "contract": "0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "symbol": "USDC", "decimals": 6, "balance": "1500000" }, { "type": "ERC20", "standard": "ERC20", "contract": "0x83F20F44975D03b1b09e64809B757c47f942BEeA", "symbol": "sDAI", "decimals": 18, "balance": "1230000000000000000", "erc4626": { "asset": { "contract": "0x6B175474E89094C44Da98b954EedeAC495271d0F", "name": "Dai Stablecoin", "symbol": "DAI", "decimals": 18 }, "share": { "contract": "0x83F20F44975D03b1b09e64809B757c47f942BEeA", "name": "Savings Dai", "symbol": "sDAI", "decimals": 18 }, "totalAssets": "1234567890000000000000000", "convertToAssets1Share": "1000000000000000000", "convertToShares1Asset": "1000000000000000000", "previewDeposit1Asset": "1000000000000000000", "previewRedeem1Share": "1000000000000000000" } }, { "type": "ERC20", "standard": "ERC20", "contract": "0xSomeVaultWithPartialFailure", "balance": "500000000000000000", "erc4626": { "asset": { "contract": "0xUnderlyingAsset", "decimals": 18 }, "share": { "contract": "0xSomeVaultWithPartialFailure", "decimals": 18 }, "totalAssets": "999999999", "error": "previewDeposit: execution reverted" } } ] }Performance and batching
includeErc4626=trueworks on full token lists.asset()andtotalAssets()Tests (three layers)
Unit tests (fast)
api/erc4626_test.goerrorAPI integration tests (fast, REST + WS)
GetAddressIncludeErc4626EVMWsGetAccountInfoIncludeErc4626EVMtests/api/evm_tests.gotests/api/testdata/ethereum.jsonincludeErc4626.RPC integration tests (fast)
EthCallErc4626tests/rpc/rpc.gotests/rpc/testdata/ethereum.jsonasset(),totalAssets()etc.).Test commands