@@ -71,19 +71,19 @@ const indexTvl = (chain) => async (timestamp, block, chainBlocks) => {
71
71
72
72
const savingsVaultTvl = ( chain ) => async ( api ) => {
73
73
const calls = networks [ chain ] [ "savingsVaults" ]
74
- const assets = await api . multiCall ( {
75
- abi : savingsVaultAbi . asset , calls,
76
- } )
77
- const totalAssets = await api . multiCall ( {
78
- abi : savingsVaultAbi . totalAssets , calls,
79
- } )
80
- const balances = { }
74
+ const [ assets , totalAssets ] = await Promise . all ( [
75
+ api . multiCall ( { abi : savingsVaultAbi . asset , calls } ) ,
76
+ api . multiCall ( { abi : savingsVaultAbi . totalAssets , calls, permitFailure : true } )
77
+ ] )
81
78
82
- totalAssets . forEach ( ( bal , i ) => {
83
- const token = assets [ i ]
84
- if ( ! bal && calls [ i ] . toLowerCase ( ) === '0x6bad6a9bcfda3fd60da6834ace5f93b8cfed9598' ) return ;
85
- sdk . util . sumSingleBalance ( balances , token , bal , chain )
79
+ const balances = { } ;
80
+ calls . forEach ( ( call , i ) => {
81
+ const asset = assets [ i ]
82
+ const bal = totalAssets [ i ]
83
+ if ( ! bal ) return ;
84
+ sdk . util . sumSingleBalance ( balances , asset , bal , chain )
86
85
} )
86
+
87
87
return balances
88
88
} ;
89
89
0 commit comments