Skip to content

Commit

Permalink
Merge pull request #140 from amedrontadora/main
Browse files Browse the repository at this point in the history
syncswap: dex: update subgraph url to support Aqua Pool
  • Loading branch information
nitish-91 authored May 17, 2024
2 parents 00d8525 + b0788b9 commit 2305142
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions adapters/syncswap/src/sdk/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ 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 client = createPublicClient({
chain: linea,
transport: http("https://rpc.linea.build")
Expand Down
4 changes: 2 additions & 2 deletions adapters/syncswap/src/sdk/lib.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { V2_SUBGRAPH_URL, client } from "./config"
import {V2_SUBGRAPH_URL, client, V2_SUBGRAPH_URL_AFTER_4515693} from "./config"
import { UserPosition } from "./types"
import {Decimal} from 'decimal.js'

Expand Down Expand Up @@ -79,7 +79,7 @@ export const getV2UserPositionsAtBlock = async (blockNumber: number): Promise<Us
}
}`

const response = await fetch(V2_SUBGRAPH_URL, {
const response = await fetch(blockNumber >= 4515693 ? V2_SUBGRAPH_URL_AFTER_4515693 : V2_SUBGRAPH_URL, {
method: "POST",
body: JSON.stringify({ query }),
headers: { "Content-Type": "application/json" },
Expand Down

0 comments on commit 2305142

Please sign in to comment.