Skip to content

Commit 2fbfb16

Browse files
authored
feat: Add escher adapter (DefiLlama#15383)
1 parent 69f4c6f commit 2fbfb16

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

projects/escher/index.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const { queryContract } = require("../helper/chain/cosmos");
2+
const CORE_ASSETS = require('../helper/coreAssets.json');
3+
4+
const consts = {
5+
EBABY_CONTRACT: 'bbn1m7zr5jw4k9z22r9ajggf4ucalwy7uxvu9gkw6tnsmv42lvjpkwasagek5g',
6+
}
7+
8+
async function eBabyTVL(api) {
9+
const data = await queryContract({
10+
contract: consts.EBABY_CONTRACT,
11+
chain: api.chain,
12+
data: { staking_liquidity: {} },
13+
});
14+
15+
//
16+
const totalStakedAmount = parseInt(data.amount);
17+
18+
const token = CORE_ASSETS.babylon.BABY;
19+
api.add(token, totalStakedAmount);
20+
}
21+
22+
23+
module.exports = {
24+
methodology: 'TVL counts the tokens that are locked in the Escher staking hub',
25+
babylon: {
26+
tvl: eBabyTVL,
27+
},
28+
} // node test.js projects/milky-way/index.js

0 commit comments

Comments
 (0)