Skip to content

Commit

Permalink
removed duplicated action
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed Mar 8, 2024
1 parent 65e6c8f commit bd2da28
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions modules/controllers/jobs-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,36 +160,6 @@ export function JobsController(tracer?: any) {
}
return syncPools(ids, viemClient, vaultAddress, chain, latestBlock + 1n);
},
/**
* Updates database pools with the subgraph and onchain state.
* Usually used only when database schema changes and new data needs to be added to the pools.
* Most likely used only together with migrations.
* Alternatively, it can be run as a new pools job, because it can be slow then.
*
* @param chainId
*/
async updatePools(chainId: string) {
const chain = chainIdToChain[chainId];
const {
subgraphs: { balancerV3, balancerPoolsV3 },
balancer: {
v3: { vaultAddress },
},
} = config[chain];

// Guard against unconfigured chains
if (!balancerV3 || !balancerPoolsV3 || !vaultAddress) {
throw new Error(`Chain not configured: ${chain}`);
}

const client = getV3JoinedSubgraphClient(balancerV3, balancerPoolsV3);
const allPools = await client.getAllInitializedPools();

const viemClient = getViemClient(chain);
const latestBlock = await viemClient.getBlockNumber();

await upsertPools(allPools, viemClient, vaultAddress, chain, latestBlock);
},
async syncSwapsV3(chainId: string) {
const chain = chainIdToChain[chainId];
const {
Expand Down

0 comments on commit bd2da28

Please sign in to comment.