Skip to content
18 changes: 17 additions & 1 deletion src/adaptors/lagoon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ const gqlQueries = {
totalAssetsUsd
weeklyApr {
linearNetAprWithoutExtraYields
incentives {
apr
}
airdrops {
apr
}
}
}
}
Expand All @@ -65,12 +71,22 @@ const apy = async () => {
skip += 100;
}
const _pools = allVaults.map((vault) => {
const { linearNetAprWithoutExtraYields, incentives, airdrops } =
vault.state.weeklyApr;

const sumApr = (items) =>
items.reduce((acc, { apr }) => acc + (apr ?? 0), 0);

const apyBase = linearNetAprWithoutExtraYields;
const apyReward = sumApr(incentives) + sumApr(airdrops) || null;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

return {
pool: `lagoon-${vault.address}-${chain}`,
chain,
project: 'lagoon',
symbol: vault.symbol,
apyBase: vault.state.weeklyApr.linearNetAprWithoutExtraYields,
apyBase,
apyReward,
tvlUsd: vault.state.totalAssetsUsd || 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add rewardTokens field

underlyingTokens: [vault.asset.address],
url: `https://app.lagoon.finance/vault/${vault.chain.id}/${vault.address}`,
Expand Down
Loading