Skip to content

Commit 04461cc

Browse files
update desyn strategy rest api request (DefiLlama#12853)
Co-authored-by: g1nt0ki <[email protected]>
1 parent de48d8c commit 04461cc

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

projects/desyn-basisTrading/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77

88
chains.forEach(chain => {
99
module.exports[chain] = {
10-
tvl: getTvlFunction('strategy3', true)
10+
// rest api type:: StrategyType3
11+
tvl: getTvlFunction('StrategyType3', true)
1112
}
1213
})

projects/desyn-farm/helper.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const abi = {
66
getBalance: "function getBalance(address) view returns (uint256)"
77
}
88

9-
9+
// The desyn asset arrangement needs to be requested via the rest api form
1010
async function getInfoListPool(strategy_type, chain) {
11-
const data = await getConfig('desyn/' + strategy_type, `https://raw.githubusercontent.com/Meta-DesynLab/strategy-asset/refs/heads/main/main/${strategy_type}.json`)
12-
return data.config[chain]?.safePools
11+
const data = await getConfig('desyn/' + strategy_type, `https://api.desyn.io/etf/defillama/get_pool_list?strategy_type=${strategy_type}`)
12+
return data.data.config[chain]?.safePools
1313
}
1414

1515
// This is aSTETH,
@@ -48,7 +48,8 @@ function getTvlFunction(strategy_type, isDoubleCounted) {
4848
const allBals = await api.multiCall({ abi: abi.getBalance, calls })
4949
api.add(allTokens, allBals)
5050

51-
if (strategy_type === 'strategy2')
51+
// rest api type:: StrategyType2
52+
if (strategy_type === 'StrategyType2')
5253
api.removeTokenBalance(leverageStaking)
5354
}
5455
}

projects/desyn-farm/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111

1212
chains.forEach(chain => {
1313
module.exports[chain] = {
14-
tvl: getTvlFunction('strategy1', false)
14+
// rest api type:: StrategyType1
15+
tvl: getTvlFunction('StrategyType1', false)
1516
}
1617
})

projects/desyn-yieldAggregator/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77

88
chains.forEach(chain => {
99
module.exports[chain] = {
10-
tvl: getTvlFunction('strategy2', true)
10+
// rest api type:: StrategyType2
11+
tvl: getTvlFunction('StrategyType2', true)
1112
}
1213
})

0 commit comments

Comments
 (0)