Skip to content

Commit

Permalink
rollback bal v2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Jan 16, 2025
1 parent 53c941d commit 3386ea4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 6 additions & 12 deletions src/dex/balancer-v2/balancer-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { LinearPool } from './pools/linear/LinearPool';
import { Gyro3Pool } from './pools/gyro/Gyro3Pool';
import { GyroEPool } from './pools/gyro/GyroEPool';
import VaultABI from '../../abi/balancer-v2/vault.json';
import BalancerVaultABI from '../../abi/balancer-v2/vault.json';
import DirectSwapABI from '../../abi/DirectSwap.json';
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
import {
Expand All @@ -43,22 +42,22 @@ import {
import { Context, IDex } from '../../dex/idex';
import { IDexHelper } from '../../dex-helper';
import {
BalancerV2BatchSwapParam,
BalancerPoolTypes,
BalancerSwap,
BalancerV2BatchSwapParam,
BalancerV2Data,
BalancerV2DirectParam,
BalancerV2DirectParamV6,
BalancerV2DirectParamV6Swap,
BalancerV2SingleSwap,
BalancerV2SwapParam,
OptimizedBalancerV2Data,
PoolState,
PoolStateCache,
PoolStateMap,
SubgraphPoolAddressDictionary,
SubgraphPoolBase,
SwapTypes,
BalancerV2DirectParamV6,
BalancerV2DirectParamV6Swap,
BalancerV2SwapParam,
BalancerV2SingleSwap,
} from './types';
import {
getLocalDeadlineAsFriendlyPlaceholder,
Expand All @@ -80,11 +79,10 @@ import {
} from './constants';
import { NumberAsString, OptimalSwapExchange } from '@paraswap/core';
import { hexConcat, hexlify, hexZeroPad, solidityPack } from 'ethers/lib/utils';
import BalancerVaultABI from '../../abi/balancer-v2/vault.json';
import { BigNumber } from 'ethers';
import { SpecialDex } from '../../executor/types';
import { extractReturnAmountPosition } from '../../executor/utils';
import { util } from 'protobufjs';
import pool = util.pool;

// If you disable some pool, don't forget to clear the cache, otherwise changes won't be applied immediately
const enabledPoolTypes = [
Expand Down Expand Up @@ -506,7 +504,6 @@ export class BalancerV2EventPool extends StatefulEventSubscriber<PoolStateMap> {
amounts: bigint[],
unitVolume: bigint,
side: SwapSide,
poolAddress: string,
): { unit: bigint; prices: bigint[] } | null {
if (!this.isSupportedPool(subgraphPool.poolType)) {
this.logger.error(`Unsupported Pool Type: ${subgraphPool.poolType}`);
Expand Down Expand Up @@ -731,7 +728,6 @@ export class BalancerV2
(wu: { poolId: { address: Address } }) => wu.poolId.address,
),
);

const poolAddressList = JSON.stringify(this.eventDisabledPools);
this.logger.info(
`Pools blocked from event based on ${this.dexKey}_${this.network}: ${poolAddressList}`,
Expand Down Expand Up @@ -903,7 +899,6 @@ export class BalancerV2
missingPools,
blockNumber,
);

// Update non-event pool state cache with newly retrieved data so it can be reused in future
nonEventPoolStates = this.updateNonEventPoolStateCache(
missingPoolsStateMap,
Expand Down Expand Up @@ -951,7 +946,6 @@ export class BalancerV2
pathAmounts,
unitVolume,
side,
poolAddress,
);

if (!res) {
Expand Down
2 changes: 1 addition & 1 deletion src/dex/curve-v1/curve-v1-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DIRECT_METHOD_NAME_V6 } from './constants';
describe('CurveV1 E2E', () => {
const dexKey = 'CurveV1';

describe('CurveV1 MAINNET', () => {
describe('CurveV1_MAINNET', () => {
const network = Network.MAINNET;
const tokens = Tokens[network];
const holders = Holders[network];
Expand Down

0 comments on commit 3386ea4

Please sign in to comment.