From 9ddfbfd53addb2bc1774855d3ac2cbd2eb461704 Mon Sep 17 00:00:00 2001 From: franz Date: Thu, 7 Sep 2023 15:13:25 +0200 Subject: [PATCH] pull swap fee apr to top, dont collect fees on nested pools without rate provider --- .../pool/lib/apr-data-sources/boosted-pool-apr.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/pool/lib/apr-data-sources/boosted-pool-apr.service.ts b/modules/pool/lib/apr-data-sources/boosted-pool-apr.service.ts index fecb8d601..bde186165 100644 --- a/modules/pool/lib/apr-data-sources/boosted-pool-apr.service.ts +++ b/modules/pool/lib/apr-data-sources/boosted-pool-apr.service.ts @@ -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, }, }); @@ -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); }