Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tonzgao committed May 12, 2022
1 parent ca9dd41 commit f103397
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface';
import { Register } from '~app-toolkit/decorators';
import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present';
import { BalanceFetcher } from '~balance/balance-fetcher.interface';
import { isSupplied } from '~position/position.utils';
import { isClaimable, isSupplied } from '~position/position.utils';
import { Network } from '~types/network.interface';

import { CONCENTRATOR_DEFINITION } from '../concentrator.definition';
Expand Down Expand Up @@ -37,17 +37,18 @@ export class EthereumConcentratorBalanceFetcher implements BalanceFetcher {
network: Network.ETHEREUM_MAINNET,
resolveBalances: async ({ address, contractPosition, multicall }) => {
const stakedToken = contractPosition.tokens.find(isSupplied)!;
const rewardToken = contractPosition.tokens.find(isClaimable)!;

const contract = this.concentratorContractFactory.aladdinConvexVault(contractPosition);
const pid = contractPosition.dataProps.poolIndex;
const [userInfo] = await Promise.all([
const [userInfo, rewardBalanceRaw] = await Promise.all([
multicall.wrap(contract).userInfo(pid, address),
// multicall.wrap(contract).pendingReward(pid, address),
multicall.wrap(contract).pendingReward(pid, address),
]);

return [
drillBalance(stakedToken, userInfo[0].toString()),
// TODO: add rewards
drillBalance(rewardToken, rewardBalanceRaw.toString()),
];
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export class EthereumConcentratorPoolContractPositionFetcher implements Position
groupIds: [CURVE_DEFINITION.groups.pool.id],
network,
},
{
appId: CONCENTRATOR_DEFINITION.id,
groupIds: [CONCENTRATOR_DEFINITION.groups.acrv.id],
network,
},
],
resolveContract: ({ address, network }) =>
this.concentratorContractFactory.aladdinConvexVault({ address, network }),
Expand All @@ -42,7 +47,7 @@ export class EthereumConcentratorPoolContractPositionFetcher implements Position
.wrap(contract)
.poolInfo(poolIndex)
.then(v => v.lpToken),
resolveRewardTokenAddresses: () => Promise.resolve([]), // TODO: set to aCRV
resolveRewardTokenAddresses: () => Promise.resolve(['0x2b95A1Dcc3D405535f9ed33c219ab38E8d7e0884']),
});
}
}

0 comments on commit f103397

Please sign in to comment.