Skip to content

Commit

Permalink
pull swap fee apr to top, dont collect fees on nested pools without r…
Browse files Browse the repository at this point in the history
…ate provider
  • Loading branch information
franzns committed Sep 7, 2023
1 parent bf8c8ed commit 9ddfbfd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/pool/lib/apr-data-sources/boosted-pool-apr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class BoostedPoolAprService implements PoolAprService {
const aprItems = await prisma.prismaPoolAprItem.findMany({
where: {
poolId: { in: poolIds },
type: { in: ['LINEAR_BOOSTED', 'PHANTOM_STABLE_BOOSTED', 'IB_YIELD'] },
type: { in: ['LINEAR_BOOSTED', 'PHANTOM_STABLE_BOOSTED', 'IB_YIELD', 'SWAP_FEE'] },
chain: networkContext.chain,
},
});
Expand Down Expand Up @@ -94,7 +94,9 @@ export class BoostedPoolAprService implements PoolAprService {
if (
collectsYieldFee(pool) &&
//nested phantom stables already have the yield fee removed
token.nestedPool.type !== 'PHANTOM_STABLE'
token.nestedPool.type !== 'PHANTOM_STABLE' &&
// nested tokens/bpts that dont have a rate provider, we don't take any fees
token.dynamicData.priceRate !== '1.0'
) {
userApr = apr * (1 - protocolYieldFeePercentage);
}
Expand Down

0 comments on commit 9ddfbfd

Please sign in to comment.