forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Ajira Pay Finance V2 * update: activate linea chain and recalculate tvl * code refactor --------- Co-authored-by: dickensodera <[email protected]>
- Loading branch information
Showing
2 changed files
with
27 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,25 @@ | ||
const { covalentGetTokens } = require('../helper/token') | ||
const { getWhitelistedTokens } = require('../helper/streamingHelper') | ||
|
||
const config = { | ||
linea: { owners: ['0xD2AA294B9A5097F4A09fd941eD0bE665bd85Eab2'], }, | ||
} | ||
|
||
module.exports = { | ||
methodology: "TVL is based on the active balances of assets deposited at the V2 stream vaults for token streaming and vesting.", | ||
} | ||
|
||
Object.keys(config).forEach(chain => { | ||
const { owners } = config[chain] | ||
module.exports[chain] = { | ||
tvl: tvl(false), | ||
vesting: tvl(true), | ||
} | ||
|
||
function tvl(isVesting) { | ||
return async (_, _1, _2, { api }) => { | ||
const tokens = (await Promise.all(owners.map(i => covalentGetTokens(i, api, { onlyWhitelisted: false, })))).flat() | ||
return api.sumTokens({ owners, tokens: await getWhitelistedTokens({ api, tokens, isVesting})}) | ||
} | ||
} | ||
}) |
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