diff --git a/src/apps/maple/ethereum/maple.staked-bpt.token-fetcher.ts b/src/apps/maple/ethereum/maple.staked-bpt.token-fetcher.ts index 41fed0eb3..f9d29eb01 100644 --- a/src/apps/maple/ethereum/maple.staked-bpt.token-fetcher.ts +++ b/src/apps/maple/ethereum/maple.staked-bpt.token-fetcher.ts @@ -66,6 +66,7 @@ export class EthereumMapleStakedBptTokenFetcher implements PositionFetcher { const stakedToken = contractPosition.tokens.find(item => item.address === mUMAMI_ADDRESS)!; const rewardToken = contractPosition.tokens.find(item => item.address === wETH_ADDRESS)!; @@ -48,7 +48,7 @@ export class ArbitrumUmamiBalanceFetcher implements BalanceFetcher { address, appId: UMAMI_DEFINITION.id, groupId: UMAMI_DEFINITION.groups.compound.id, - network: Network.ARBITRUM_MAINNET, + network, }); } diff --git a/src/apps/umami/arbitrum/umami.compound.token-fetcher.ts b/src/apps/umami/arbitrum/umami.compound.token-fetcher.ts index 152ed3e63..953489146 100644 --- a/src/apps/umami/arbitrum/umami.compound.token-fetcher.ts +++ b/src/apps/umami/arbitrum/umami.compound.token-fetcher.ts @@ -34,7 +34,7 @@ export type UmamiApiDatas = { mUmamiCompounder: UmamiCompounderApiObject; }; -@Register.TokenPositionFetcher({ appId, groupId, network }) +@Register.TokenPositionFetcher({ appId, groupId, network, options: { includeInTvl: true } }) export class ArbitrumUmamiCompoundTokenFetcher implements PositionFetcher { constructor( @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, @@ -48,18 +48,14 @@ export class ArbitrumUmamiCompoundTokenFetcher implements PositionFetcher('https://horseysauce.xyz/').then(v => v.data); - const { marinate, mUmamiCompounder } = data; + const { marinate } = data; const { apy } = marinate; - const { tvl } = mUmamiCompounder; - return { - apy, - tvl, - }; + return apy; } async getPositions() { - const mUMAMI_ADDRESS = '0x2AdAbD6E8Ce3e82f52d9998a7f64a90d294A92A4'.toLowerCase(); - const cmUMAMI_ADDRESS = '0x1922C36F3bc762Ca300b4a46bB2102F84B1684aB'.toLowerCase(); + const mUMAMI_ADDRESS = '0x2adabd6e8ce3e82f52d9998a7f64a90d294a92a4'; + const cmUMAMI_ADDRESS = '0x1922c36f3bc762ca300b4a46bb2102f84b1684ab'; const multicall = this.appToolkit.getMulticall(network); const underlyingTokenContract = this.umamiContractFactory.umamiMarinate({ @@ -72,26 +68,28 @@ export class ArbitrumUmamiCompoundTokenFetcher implements PositionFetcher v.address === mUMAMI_ADDRESS); + const underlyingToken = appTokens.find(v => v.address === mUMAMI_ADDRESS); if (!underlyingToken) return []; - const { apy, tvl } = await this.getUmamiInformations(); + const apy = await this.getUmamiInformations(); const supply = Number(supplyRaw) / 10 ** decimals; const reserve = Number(balanceRaw) / 10 ** decimals; const pricePerShare = reserve / supply; const price = pricePerShare * underlyingToken.price; + const liquidity = supply * price; const tokens = [underlyingToken]; const label = `Compounding Marinating UMAMI`; const images = getImagesFromToken(underlyingToken); @@ -100,7 +98,7 @@ export class ArbitrumUmamiCompoundTokenFetcher implements PositionFetcher { - constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(UmamiContractFactory) private readonly umamiContractFactory: UmamiContractFactory, - ) {} + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} async getPositions() { - const wETH_ADDRESS = '0x82af49447d8a07e3bd95bd0d56f35241523fbab1'.toLowerCase(); - const mUMAMI_ADDRESS = '0x2AdAbD6E8Ce3e82f52d9998a7f64a90d294A92A4'.toLowerCase(); + const wETH_ADDRESS = '0x82af49447d8a07e3bd95bd0d56f35241523fbab1'; + const mUMAMI_ADDRESS = '0x2adabd6e8ce3e82f52d9998a7f64a90d294a92a4'; const baseTokens = await this.appToolkit.getBaseTokenPrices(network); const appTokens = await this.appToolkit.getAppTokenPositions({ - appId: 'umami', - groupIds: ['marinate'], + appId: UMAMI_DEFINITION.id, + groupIds: [UMAMI_DEFINITION.groups.marinate.id], network, }); @@ -42,7 +38,7 @@ export class ArbitrumUmamiMarinateContractPositionFetcher implements PositionFet if (!stakedToken || !rewardToken) return []; const tokens = [supplied(stakedToken), claimable(rewardToken)]; - const label = `Staked ${getLabelFromToken(stakedToken)}`; + const label = getLabelFromToken(stakedToken); const images = getImagesFromToken(stakedToken); const secondaryLabel = buildDollarDisplayItem(stakedToken.price); diff --git a/src/apps/umami/arbitrum/umami.marinate.token-fetcher.ts b/src/apps/umami/arbitrum/umami.marinate.token-fetcher.ts index 511cda144..26cf55de8 100644 --- a/src/apps/umami/arbitrum/umami.marinate.token-fetcher.ts +++ b/src/apps/umami/arbitrum/umami.marinate.token-fetcher.ts @@ -30,7 +30,7 @@ export type UmamiApiDatas = { marinate: UmamiMarinateApiObject; }; -@Register.TokenPositionFetcher({ appId, groupId, network }) +@Register.TokenPositionFetcher({ appId, groupId, network, options: { includeInTvl: true } }) export class ArbitrumUmamiMarinateTokenFetcher implements PositionFetcher { constructor( @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, @@ -45,12 +45,9 @@ export class ArbitrumUmamiMarinateTokenFetcher implements PositionFetcher('https://horseysauce.xyz/').then(v => v.data); const { marinate } = data; - const { apr, marinateTVL } = marinate; + const { apr } = marinate; - return { - apr, - marinateTVL, - }; + return apr; } async getPositions() { @@ -74,11 +71,13 @@ export class ArbitrumUmamiMarinateTokenFetcher implements PositionFetcher v.address === UMAMI_ADDRESS); if (!underlyingToken) return []; - const { apr, marinateTVL } = await this.getUmamiInformations(); + const aprRaw = await this.getUmamiInformations(); + const apr = Number(aprRaw); const tokens = [underlyingToken]; const pricePerShare = 1.0; const price = pricePerShare * underlyingToken.price; + const liquidity = supply * price; const label = `Marinating UMAMI`; const images = getImagesFromToken(underlyingToken); const secondaryLabel = buildDollarDisplayItem(price); @@ -86,11 +85,11 @@ export class ArbitrumUmamiMarinateTokenFetcher implements PositionFetcher