Skip to content

Commit 543b624

Browse files
MarkChen1213866mark1213866
andauthored
add astros-perp tvl (#16975)
Co-authored-by: mark1213866 <[email protected]>
1 parent 1728816 commit 543b624

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

projects/astros-perp/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const sui = require("../helper/chain/sui")
2+
3+
// Configuration: ActiveVault object instance address
4+
// Type: 0x882cd9388d35a141614a7beb28ec14f7aaf54f8372ccc1dd64046efd82866043::active_vault::ActiveVault<0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC>
5+
const ACTIVE_VAULT_ID = "0xa33c96502b89cdfd177333c35d70b95451547d223a0d0abc5faeee82793500ab"
6+
7+
async function tvl(api) {
8+
const vault = await sui.getObject(ACTIVE_VAULT_ID);
9+
const typeString = vault.type.replace(">", "").split("<")[1];
10+
const tokenType = typeString;
11+
const balance = vault.fields.balance;
12+
api.add(tokenType, balance);
13+
}
14+
15+
module.exports = {
16+
timetravel: false,
17+
sui: {
18+
tvl,
19+
},
20+
}

0 commit comments

Comments
 (0)