Skip to content

Commit 0ca1a14

Browse files
Lobster Protocol Adapter (DefiLlama#11349)
* Create index.js * Create config.js * Delete projects/lobster-protocol/config.js * Create config.js * Create abis.js * code refactor --------- Co-authored-by: g1nt0ki <[email protected]>
1 parent 15a5a16 commit 0ca1a14

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

projects/lobster-protocol/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const DHEDGE_FACTORY_ABI = "function getManagedPools(address manager) view returns (address[] managedPools)";
2+
const LOBSTER_POOL_ABI = "function getFundSummary() view returns (tuple(string name, uint256 totalSupply, uint256 totalFundValue))";
3+
4+
const CONFIG_DATA = {
5+
arbitrum: {
6+
dhedgeFactory: "0xffFb5fB14606EB3a548C113026355020dDF27535",
7+
lobsterManager: "0x6EBb1B5Be9bc93858f71714eD03f67BF237473cB",
8+
}
9+
}
10+
11+
async function tvl(api) {
12+
const { dhedgeFactory, lobsterManager } = CONFIG_DATA[api.chain];
13+
14+
const pools = await api.call({ abi: DHEDGE_FACTORY_ABI, target: dhedgeFactory, params: lobsterManager, });
15+
const poolSummaries = await api.multiCall({ abi: LOBSTER_POOL_ABI, calls: pools, })
16+
api.addCGToken('tether', poolSummaries.reduce((acc, p) => acc + +p.totalFundValue/1e18, 0))
17+
}
18+
19+
module.exports = {
20+
misrepresentedTokens: true,
21+
start: 1704067199, // Sunday 31 December 2023 23:59:59
22+
methodology:
23+
"Aggregates total value of Lobster protocol vaults on Arbitrum",
24+
arbitrum: {
25+
tvl,
26+
},
27+
hallmarks: [
28+
[1710971510, "First Arbitrum Vault Release"],
29+
],
30+
}

0 commit comments

Comments
 (0)