diff --git a/adapters/lynex/src/index.ts b/adapters/lynex/src/index.ts index 12aae4ce..bfd33d1d 100644 --- a/adapters/lynex/src/index.ts +++ b/adapters/lynex/src/index.ts @@ -155,7 +155,7 @@ export const getUserStakedTVLByBlock = async ({ tokenBalanceMap[user_address] = tokenBalanceMap[user_address] ?? {}; tokenBalanceMap[user_address][token0Address] = BigNumber( tokenBalanceMap[user_address][token0Address] ?? 0 - ).plus(userVote.result.amount.toString()); + ).plus(userVote.result.amount?.toString() ?? '0'); } } diff --git a/adapters/lynex/src/sdk/config.ts b/adapters/lynex/src/sdk/config.ts index 1f5dc64f..2c92dc01 100644 --- a/adapters/lynex/src/sdk/config.ts +++ b/adapters/lynex/src/sdk/config.ts @@ -10,7 +10,10 @@ export const V3_SUBGRAPH_URL = export const client = createPublicClient({ chain: linea, - transport: http("https://rpc.linea.build"), + transport: http("https://rpc.linea.build", { + retryCount: 5, + timeout: 60_000, + }), }); export const PROBLEM_POOLS = { diff --git a/adapters/lynex/src/sdk/lensDetails.ts b/adapters/lynex/src/sdk/lensDetails.ts index acab8592..e1e79bd7 100644 --- a/adapters/lynex/src/sdk/lensDetails.ts +++ b/adapters/lynex/src/sdk/lensDetails.ts @@ -85,7 +85,7 @@ export const fetchUserPools = async ( blockNumber )) as any; const delay = (ms: number | undefined) => new Promise(resolve => setTimeout(resolve, ms)) - await delay(100) + await delay(10000) return res.map((r: any) => { if (r.status !== 'success') { throw new Error("RPC call error. Status: " + r.status); diff --git a/adapters/lynex/src/sdk/subgraphDetails.ts b/adapters/lynex/src/sdk/subgraphDetails.ts index a0e76c95..3fa7a706 100644 --- a/adapters/lynex/src/sdk/subgraphDetails.ts +++ b/adapters/lynex/src/sdk/subgraphDetails.ts @@ -19,7 +19,7 @@ export const getUserAddresses = async ( while (fetchNext) { let query = ` query UserQuery { - users(${blockQuery} first:1000,skip:${skip}) { + users(${blockQuery} first:1000,skip:${skip}, where:{liquidityPositions_: {amount_gt: 0}}) { id liquidityPositions { id @@ -50,7 +50,7 @@ export const getUserAddresses = async ( headers: { "Content-Type": "application/json" }, }); let data = await response.json(); - let userStakes = data.data.users; + let userStakes = data.data?.users ?? []; for (let i = 0; i < userStakes.length; i++) { let userStake = userStakes[i]; let transformedUserStake: UserStake = {