Skip to content

Commit

Permalink
Merge branch 'DefiLlama:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rube-de committed Jun 17, 2024
2 parents 04c4fb9 + c0dd631 commit d5b4995
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions projects/trufin-trustake/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { function_view } = require('../helper/chain/aptos')

const TRUSTAKE_APT_CONTRACT_ADDR = "0x6f8ca77dd0a4c65362f475adb1c26ae921b1d75aa6b70e53d0e340efd7d8bc80"
const MODULE = "staker"
const FUNCTION = "total_staked"

async function aptosTvl(api) {
const totalStaked = await function_view({ functionStr: `${TRUSTAKE_APT_CONTRACT_ADDR}::${MODULE}::${FUNCTION}` })
api.add(ADDRESSES.aptos.APT, totalStaked[0])
}

const abi = {
"totalShares": "uint256:totalShares",
"sharePrice": "function sharePrice() external view returns (uint256, uint256)",
Expand All @@ -20,5 +31,8 @@ module.exports = {
methodology: `Counts the TVL of MATIC tokens in TruFin's TruStake vault.`,
ethereum: {
tvl
},
aptos: {
tvl: aptosTvl
}
}

0 comments on commit d5b4995

Please sign in to comment.