Skip to content

Commit

Permalink
Merge pull request #252 from balancer/fix/sor-ignored-pools-list
Browse files Browse the repository at this point in the history
fix: SOR should ignore some pools
  • Loading branch information
gmbronco authored Dec 8, 2023
2 parents 07f111f + 13efc39 commit e72a4ab
Show file tree
Hide file tree
Showing 2 changed files with 343 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/modules/sor/pool-data-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { PoolDataService } from '@balancer-labs/sor';
import { SubgraphPoolBase } from '@balancer-labs/sdk';
import { queryPools } from '@/modules/dynamodb';
import { Pool, convertPoolToSubgraphPoolBase } from '@/modules/pools';
import poolsToIgnore from './pools-to-ignore';

const log = debug('balancer:pool-data-service');

Expand Down Expand Up @@ -32,7 +33,12 @@ export class DatabasePoolDataService implements PoolDataService {
public async getPools(): Promise<SubgraphPoolBase[]> {
log(`Retrieving pools for chain ${this.chainId} from the database`);

const pools: Pool[] = await queryPools(this.filterParams);
const allPools: Pool[] = await queryPools(this.filterParams);
const pools = allPools.filter(
pool => !poolsToIgnore.includes(pool.id.toLowerCase()) &&
pool.swapEnabled === true &&
pool.isInRecoveryMode !== true
);

log(`Retrieved ${pools.length} pools`);
const subgraphPools = pools.map(pool =>
Expand Down
Loading

0 comments on commit e72a4ab

Please sign in to comment.