Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions projects/appchain/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { sumTokens2 } = require("../helper/unwrapLPs");

module.exports = {
ethereum: {
tvl: (api) =>
sumTokens2({
api,
owners: [
"0x19df42E085e2c3fC4497172E412057F54D9f013E", // Bridge
"0x1c71201B43B45ACdF9AfD6A72817C0469F0dD274", // Standard Gateway
"0xCdbbaC12527d6aB4d94bc524849c001574D88f65", // Custom Gateway
"0xcE586d7e3920cAddf1dd2e5b5c94B2Cfe6118e1c", // WETH Gateway
"0x8045B2aa6b823CbA8f99ef3D3404F711619d3473", // Sequencer Inbox
],
fetchCoValentTokens: true,
permitFailure: true,
}),
},
};
24 changes: 13 additions & 11 deletions projects/triggerx/index.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
const axios = require("axios");
const sdk = require("@defillama/sdk");

// Load API key from .env (no fallback)
const EIGEN_API_KEY =
process.env.EIGEN_API_KEY

async function tvl() {
const response = await axios.get(
"https://api.eigenexplorer.com/avs/0x875B5ff698B74B26f39C223c4996871F28AcDdea?withTvl=true&withCuratedMetadata=false&withRewards=false",
{
headers: {
"X-API-Token": "03206c8747af0dbc8aa2b351838cb1dcf6dbadc15cf4c5e9e80e8af3adc3d28a",
"X-API-Token": EIGEN_API_KEY ||
"03206c8747af0dbc8aa2b351838cb1dcf6dbadc15cf4c5e9e80e8af3adc3d28a", // fallback public key, // undefined allowed
},
}
);

// Extract the TVL value in ETH
let totalTvlInEth = 0;

if (response.data?.tvl) {
if (typeof response.data.tvl === 'object') {
totalTvlInEth = response.data.tvl.total || response.data.tvl.tvl || 0;
} else {
totalTvlInEth = response.data.tvl;
}
totalTvlInEth =
typeof response.data.tvl === "object"
? response.data.tvl.total || response.data.tvl.tvl || 0
: response.data.tvl;
}

// Convert ETH to wei for DefiLlama (REQUIRED)
const tvlInWei = Math.floor(totalTvlInEth * 1e18);

// Return ETH (in wei)
return {
"ethereum:0x0000000000000000000000000000000000000000": tvlInWei.toString(),
};
}

module.exports = {
methodology: "TVL represents total staked amount across all chains for TriggerX AVS on EigenLayer, fetched from EigenExplorer API.",
methodology:
"TVL represents total staked amount across all chains for TriggerX AVS on EigenLayer, fetched from EigenExplorer API.",
timetravel: false,
hallmarks: [],
doublecounted: true,
Expand Down
Loading