Skip to content

Commit 5a9ff99

Browse files
authored
Fix: Spin-vault (DefiLlama#14303)
1 parent d253c51 commit 5a9ff99

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

projects/spin-vault/index.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ const { call, addTokenBalances } = require('../helper/chain/near');
33
const VAULT_PROJECT_CONTRACT = 'v1.vault.spin-fi.near'
44
const VAULT_GET_ALL = 'vault_get_all';
55

6-
76
async function tvl() {
87
// NOTE: add TVL for vaults
9-
const execution_assets = (await call(VAULT_PROJECT_CONTRACT, VAULT_GET_ALL, { "limit": "100", "offset": "0" }))
10-
.map(vault => vault['invariant']['execution_asset']);
8+
const execution_assets = (await call(VAULT_PROJECT_CONTRACT, VAULT_GET_ALL, { limit: "100", offset: "0" }))
9+
.map(v => v?.invariant?.execution_asset)
10+
.filter(asset => typeof asset === 'string' && asset.includes('.near'));
1111

1212
return addTokenBalances(execution_assets, VAULT_PROJECT_CONTRACT);
1313
}
1414

15-
1615
module.exports = {
1716
timetravel: false,
18-
near: {
19-
tvl,
20-
},
17+
near: { tvl },
2118
}

0 commit comments

Comments
 (0)