Skip to content

Commit 60cd1fa

Browse files
authored
Update navigator/index.js (DefiLlama#13453)
1 parent 221dd24 commit 60cd1fa

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

projects/navigator/index.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const ADDRESSES = require('../helper/coreAssets.json')
22
const { staking } = require("../helper/staking");
33
const { gmxExports } = require("../helper/gmx");
44
const { sumTokens2 } = require("../helper/unwrapLPs");
5+
const {getLogs2} = require("../helper/cache/getLogs");
56

67
// sonic
78
const sonicVault = "0xe9263682E837eFabb145f8C632B9d2c518D90652";
@@ -10,17 +11,24 @@ const sonicNAVI = "0x6881B80ea7C858E4aEEf63893e18a8A36f3682f3";
1011

1112
// sonicV2
1213
const sonicV2Vault = "0x41cD8CaFc24A771031B9eB9C57cFC94D86045eB6";
13-
const sonicV2Assets = [ADDRESSES.sonic.USDC_e]
14+
const sonicV2SettingManager = "0x7b9e962dd8AeD0Db9A1D8a2D7A962ad8b871Ce4F";
1415

1516
const tvl = async (api) => {
16-
await Promise.all([
17-
gmxExports({ vault: sonicVault })(api),
18-
sumTokens2({ api, tokens: sonicV2Assets, owner: sonicV2Vault })])
17+
const logs = await getLogs2({
18+
api,
19+
target: sonicV2SettingManager,
20+
eventAbi: 'event SetEnableStaking(address indexed token, bool isEnabled)',
21+
fromBlock: 655713,
22+
})
23+
const sonicV2Assets = logs.map(i => i.token)
24+
await Promise.all([
25+
gmxExports({ vault: sonicVault })(api),
26+
sumTokens2({ api, tokens: sonicV2Assets, owner: sonicV2Vault })])
1927
};
2028

2129
module.exports = {
22-
sonic: {
23-
tvl,
24-
staking: staking(sonicStaking, sonicNAVI)
25-
}
30+
sonic: {
31+
tvl,
32+
staking: staking(sonicStaking, sonicNAVI)
33+
}
2634
}

0 commit comments

Comments
 (0)