diff --git a/adapters/syncswap/src/sdk/config.ts b/adapters/syncswap/src/sdk/config.ts index 594e2b01..345eebd0 100644 --- a/adapters/syncswap/src/sdk/config.ts +++ b/adapters/syncswap/src/sdk/config.ts @@ -1,9 +1,7 @@ import { createPublicClient, http } from "viem"; import { linea } from "viem/chains" -export const V2_SUBGRAPH_URL = "https://gateway-arbitrum.network.thegraph.com/api/06a21853c18afff683a7ff52c764d434/subgraphs/id/3xpZFx5YNWzqemwdtRhyaTXVidKNnjY19XAWoHtvR6Lh" - -export const V2_SUBGRAPH_URL_AFTER_4515693 = "https://gateway-arbitrum.network.thegraph.com/api/06a21853c18afff683a7ff52c764d434/subgraphs/id/9R6uvVYXn9V1iAxkTLXL1Ajka75aD7mmHRj86DbXnyYQ" +export const V2_SUBGRAPH_URL = "https://gateway-arbitrum.network.thegraph.com/api/06a21853c18afff683a7ff52c764d434/deployments/id/QmT8aCpWka6j2maHmedHQGtu13ru6tx7avsT8Y9tNYrP7s" export const client = createPublicClient({ chain: linea, diff --git a/adapters/syncswap/src/sdk/lib.ts b/adapters/syncswap/src/sdk/lib.ts index 7de0e0ce..4f0ee12a 100644 --- a/adapters/syncswap/src/sdk/lib.ts +++ b/adapters/syncswap/src/sdk/lib.ts @@ -1,4 +1,4 @@ -import {V2_SUBGRAPH_URL, client, V2_SUBGRAPH_URL_AFTER_4515693} from "./config" +import {V2_SUBGRAPH_URL, client} from "./config" import { UserPosition } from "./types" import {Decimal} from 'decimal.js' @@ -79,12 +79,13 @@ export const getV2UserPositionsAtBlock = async (blockNumber: number): Promise= 4515693 ? V2_SUBGRAPH_URL_AFTER_4515693 : V2_SUBGRAPH_URL, { + const response = await fetch(V2_SUBGRAPH_URL, { method: "POST", body: JSON.stringify({ query }), headers: { "Content-Type": "application/json" }, }) const jsonData = await response.json(); + const liquidityPositions: V2Position[] = []; if(jsonData.data.hasOwnProperty('liquidityPositions')) { liquidityPositions.push(...jsonData.data.liquidityPositions)