forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const DHEDGE_FACTORY_ABI = "function getManagedPools(address manager) view returns (address[] managedPools)"; | ||
const LOBSTER_POOL_ABI = "function getFundSummary() view returns (tuple(string name, uint256 totalSupply, uint256 totalFundValue))"; | ||
|
||
const CONFIG_DATA = { | ||
arbitrum: { | ||
dhedgeFactory: "0xffFb5fB14606EB3a548C113026355020dDF27535", | ||
lobsterManager: "0x6EBb1B5Be9bc93858f71714eD03f67BF237473cB", | ||
} | ||
} | ||
|
||
async function tvl(api) { | ||
const { dhedgeFactory, lobsterManager } = CONFIG_DATA[api.chain]; | ||
|
||
const pools = await api.call({ abi: DHEDGE_FACTORY_ABI, target: dhedgeFactory, params: lobsterManager, }); | ||
const poolSummaries = await api.multiCall({ abi: LOBSTER_POOL_ABI, calls: pools, }) | ||
api.addCGToken('tether', poolSummaries.reduce((acc, p) => acc + +p.totalFundValue/1e18, 0)) | ||
} | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
start: 1704067199, // Sunday 31 December 2023 23:59:59 | ||
methodology: | ||
"Aggregates total value of Lobster protocol vaults on Arbitrum", | ||
arbitrum: { | ||
tvl, | ||
}, | ||
hallmarks: [ | ||
[1710971510, "First Arbitrum Vault Release"], | ||
], | ||
} |