From 0eea3f1aa758f9c5bdf4f9be89927f2c6489192c Mon Sep 17 00:00:00 2001 From: Mantas S Date: Wed, 25 Sep 2024 11:26:15 +0300 Subject: [PATCH] Update index.ts --- .../providers/optimism/synthetix/index.ts | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/factory/providers/optimism/synthetix/index.ts b/src/factory/providers/optimism/synthetix/index.ts index 7bb91ff0..c25fc0d1 100644 --- a/src/factory/providers/optimism/synthetix/index.ts +++ b/src/factory/providers/optimism/synthetix/index.ts @@ -30,19 +30,15 @@ const QUERY_NO_BLOCK = gql` async function getSnxHolders(block, chain) { let holders = []; - try { - for (let i = 0; i <= 5000; i += 1000) { - const holder = ( - await request(GRAPHQL_ENDPOINT, QUERY_NO_BLOCK, { - block, - skip: i, - }) - ).snxholders; - holders = [...holders, ...holder]; - } - } catch (e) { - console.log(`Issue with SubGraph on block ${block}`); - holders = await getSnxHolders(block - basicUtil.getDelay(chain), chain); + + for (let i = 0; i <= 5000; i += 1000) { + const holder = ( + await request(GRAPHQL_ENDPOINT, QUERY_NO_BLOCK, { + block, + skip: i, + }) + ).snxholders; + holders = [...holders, ...holder]; } return holders;