Skip to content

Commit be3ffc9

Browse files
authored
volo: split lst (#16811)
1 parent b01fc9c commit be3ffc9

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

projects/volo-lst/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const sui = require('../helper/chain/sui')
2+
3+
const tvl = async (api) => {
4+
const obj = await sui.getObject('0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5')
5+
const totalSuiSupply = +obj.fields.validator_pool.fields.total_sui_supply
6+
api.add('0x2::sui::SUI', totalSuiSupply)
7+
}
8+
9+
module.exports = {
10+
sui: { tvl }
11+
}

projects/volo-vsui/index.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
const sui = require('../helper/chain/sui')
21
const axios = require('axios')
32

3+
const ENDPOINT = 'https://vault-api.volosui.com/api/v1/vaults'
4+
45
const VAULTS = [
56
{ address: '0x6e53ffe5b77a85ff609b0813955866ec98a072e4aaf628108e717143ec907bd8', gecko_id: 'bitcoin' },
67
{ address: '0x041b49dc6625e074f452b9bc60a9a828aebfbef29bcba119ad90a4b11ba405bf', gecko_id: 'okx-wrapped-btc' },
78
{ address: '0xa97cc9a63710f905deb2da40d6548ce7a75ee3dfe4be0c1d553553d2059c31a3', gecko_id: 'usd-coin' },
89
{ address: '0x27936e146ec8c695d14a3b900d21a495d2396c0a99e3c6766f86d15fe91d3897', gecko_id: 'usd-coin' },
910
]
1011

11-
const ENDPOINT = 'https://vault-api.volosui.com/api/v1/vaults'
12-
13-
const getVaults = async (api) => {
12+
const tvl = async (api) => {
1413
const { data } = await axios.get(ENDPOINT)
1514
const vaults = data.data
1615

@@ -20,17 +19,6 @@ const getVaults = async (api) => {
2019
}
2120
}
2221

23-
const getStakingTvl = async (api) => {
24-
const obj = await sui.getObject('0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5')
25-
const totalSuiSupply = +obj.fields.validator_pool.fields.total_sui_supply
26-
api.add('0x2::sui::SUI', totalSuiSupply)
27-
}
28-
29-
const tvl = async (api) => {
30-
await getStakingTvl(api)
31-
await getVaults(api)
32-
}
33-
3422
module.exports = {
3523
methodology: "Calculates the amount of SUI staked in Volo liquid staking contracts and tokens in Volo vaults. TVL includes LST (Liquid Staking) and all vault types combined.",
3624
misrepresentedTokens: true,

0 commit comments

Comments
 (0)