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

Commit

Permalink
fix(balancer): Helpers should not accept multicall, resolve internally (
Browse files Browse the repository at this point in the history
  • Loading branch information
JForsaken authored Apr 29, 2022
1 parent 57e31cc commit a30c5ef
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/apps/balancer-v2/helpers/balancer-v2.spot-price.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Inject, Injectable } from '@nestjs/common';
import { partition } from 'lodash';

import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface';
import { EthersMulticall as Multicall } from '~multicall/multicall.ethers';
import { Network } from '~types/network.interface';

import { BalancerV2ContractFactory } from '../contracts';
Expand All @@ -14,19 +13,8 @@ export class BalancerV2SpotPriceHelper {
@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit,
) {}

async getReserves({
network,
lpAddress,
tokens,
multicall,
}: {
network: Network;
lpAddress: string;

tokens: string[];
multicall?: Multicall;
}) {
const mc = multicall ?? this.appToolkit.getMulticall(network);
async getReserves({ network, lpAddress, tokens }: { network: Network; lpAddress: string; tokens: string[] }) {
const mc = this.appToolkit.getMulticall(network);

const poolContract = this.balancerV2ContractFactory.balancerPool({ address: lpAddress, network });
const poolId = await mc.wrap(poolContract).getPoolId();
Expand Down

0 comments on commit a30c5ef

Please sign in to comment.