diff --git a/aggregators/bebop/index.ts b/aggregators/bebop/index.ts index 187b4d44ea..f8d063d098 100644 --- a/aggregators/bebop/index.ts +++ b/aggregators/bebop/index.ts @@ -1,5 +1,5 @@ import { ethers } from "ethers"; -import { Adapter, ChainBlocks, FetchOptions } from "../../adapters/types"; +import { Adapter, FetchOptions } from "../../adapters/types"; import { getTransactions } from "../../helpers/getTxReceipts"; import JAM_ABI from "./jamAbi"; import {queryDuneSql} from "../../helpers/dune" diff --git a/dexs/lynex/index.ts b/dexs/lynex/index.ts index e196e1a0d3..75750ab084 100644 --- a/dexs/lynex/index.ts +++ b/dexs/lynex/index.ts @@ -1,12 +1,10 @@ import { CHAIN } from "../../helpers/chains"; -import { univ2Adapter } from "../../helpers/getUniSubgraphVolume"; +import { univ2Adapter2 } from "../../helpers/getUniSubgraphVolume"; -const adapters = univ2Adapter({ +const adapters = univ2Adapter2({ [CHAIN.LINEA]: "https://api.studio.thegraph.com/query/59052/lynex-cl/v1.0.1" }, { factoriesName: "factories", - dayData: "algebraDayData", - dailyVolume: "volumeUSD", totalVolume: "totalVolumeUSD", }); diff --git a/dexs/nile-exchange/index.ts b/dexs/nile-exchange/index.ts index 9deddc65a2..bba81755c5 100644 --- a/dexs/nile-exchange/index.ts +++ b/dexs/nile-exchange/index.ts @@ -1,12 +1,10 @@ import { CHAIN } from "../../helpers/chains"; -import { univ2Adapter } from "../../helpers/getUniSubgraphVolume"; +import { univ2Adapter2 } from "../../helpers/getUniSubgraphVolume"; -const adapters = univ2Adapter({ +const adapters = univ2Adapter2({ [CHAIN.LINEA]: "https://graph-query.linea.build/subgraphs/name/nileexchange/cl-subgraph" }, { factoriesName: "factories", - dayData: "uniswapDayData", - dailyVolume: "volumeUSD", totalVolume: "totalVolumeUSD", }); diff --git a/dexs/pharaoh-exchange/index.ts b/dexs/pharaoh-exchange/index.ts index 7119c974f2..72533e46cf 100644 --- a/dexs/pharaoh-exchange/index.ts +++ b/dexs/pharaoh-exchange/index.ts @@ -1,13 +1,11 @@ import * as sdk from "@defillama/sdk"; import { CHAIN } from "../../helpers/chains"; -import { univ2Adapter } from "../../helpers/getUniSubgraphVolume"; +import { univ2Adapter2 } from "../../helpers/getUniSubgraphVolume"; -const adapters = univ2Adapter({ +const adapters = univ2Adapter2({ [CHAIN.AVAX]: sdk.graph.modifyEndpoint('oM4WnuyAbSwPpjk6niUkp88AZg1hSTi9aC1ZM4RcsqR') }, { factoriesName: "factories", - dayData: "uniswapDayData", - dailyVolume: "volumeUSD", totalVolume: "totalVolumeUSD", }); diff --git a/dexs/ramses-exchange-v2/index.ts b/dexs/ramses-exchange-v2/index.ts index ec13885eb6..7695fbcd35 100644 --- a/dexs/ramses-exchange-v2/index.ts +++ b/dexs/ramses-exchange-v2/index.ts @@ -1,13 +1,11 @@ import * as sdk from "@defillama/sdk"; import { CHAIN } from "../../helpers/chains"; -import { univ2Adapter } from "../../helpers/getUniSubgraphVolume"; +import { univ2Adapter2 } from "../../helpers/getUniSubgraphVolume"; -const adapters = univ2Adapter({ +const adapters = univ2Adapter2({ [CHAIN.ARBITRUM]: sdk.graph.modifyEndpoint('G2tXDm6mgqBMuC7hq9GRVeTv5SRBAVnPFGcpGBab2cea') }, { factoriesName: "factories", - dayData: "uniswapDayData", - dailyVolume: "volumeUSD", totalVolume: "totalVolumeUSD", }); diff --git a/dexs/solidly-v3/index.ts b/dexs/solidly-v3/index.ts index 26fb5f464f..36e6404462 100644 --- a/dexs/solidly-v3/index.ts +++ b/dexs/solidly-v3/index.ts @@ -1,8 +1,8 @@ import * as sdk from "@defillama/sdk"; import { CHAIN } from "../../helpers/chains"; -import { univ2Adapter } from "../../helpers/getUniSubgraphVolume"; +import { univ2Adapter2 } from "../../helpers/getUniSubgraphVolume"; -const adapters = univ2Adapter({ +const adapters = univ2Adapter2({ [CHAIN.ETHEREUM]: sdk.graph.modifyEndpoint('7StqFFqbxi3jcN5C9YxhRiTxQM8HA8XEHopsynqqxw3t'), // [CHAIN.BASE]: "https://api.studio.thegraph.com/query/64631/solidly-v3-base/version/latest", [CHAIN.OPTIMISM]: sdk.graph.modifyEndpoint('HCThb3gJC45qUYmNEaYmZZTqJW3pSq7X6tb4MqNHEvZf'), @@ -10,8 +10,6 @@ const adapters = univ2Adapter({ [CHAIN.FANTOM]: sdk.graph.modifyEndpoint('HDNu25S2uqr13BHrQdPv2PfTpwxJgPB7QEnC8fsgKcM9') }, { factoriesName: "factories", - dayData: "solidlyDayData", - dailyVolume: "volumeUSD", totalVolume: "totalVolumeUSD", }); diff --git a/dexs/sushiswap/classic.ts b/dexs/sushiswap/classic.ts index 0ac0d06235..db8c5b7387 100644 --- a/dexs/sushiswap/classic.ts +++ b/dexs/sushiswap/classic.ts @@ -55,7 +55,7 @@ const endpointsClassic = { [CHAIN.POLYGON]: sdk.graph.modifyEndpoint('8NiXkxLRT3R22vpwLB4DXttpEf3X1LrKhe4T1tQ3jjbP'), //[CHAIN.FANTOM]: sdk.graph.modifyEndpoint('3nozHyFKUhxnEvekFg5G57bxPC5V63eiWbwmgA35N5VK'), [CHAIN.ARBITRUM]: sdk.graph.modifyEndpoint('8nFDCAhdnJQEhQF3ZRnfWkJ6FkRsfAiiVabVn4eGoAZH'), - [CHAIN.CELO]: sdk.graph.modifyEndpoint('8roCC7H2tsGYGvxD52QQbUoHXXx77H9tPhNn1qcjB5yj'), + // [CHAIN.CELO]: sdk.graph.modifyEndpoint('8roCC7H2tsGYGvxD52QQbUoHXXx77H9tPhNn1qcjB5yj'), [CHAIN.AVAX]: sdk.graph.modifyEndpoint('6VAhbtW5u2sPYkJKAcMsxgqTBu4a1rqmbiVQWgtNjrvT'), [CHAIN.HARMONY]: sdk.graph.modifyEndpoint('FrcJBCCKCYGTLLXJmhppXfPKsNoyod4zqNLjHfXj1KHg'), // [CHAIN.MOONRIVER]: sdk.graph.modifyEndpoint('5skUrJzgVm6vXAmdKN7gw4CjYx3pgLDeUeUqVzqLXkWT'), diff --git a/dexs/sushiswap/v3.ts b/dexs/sushiswap/v3.ts index d8fd2076ae..0a54a2d542 100644 --- a/dexs/sushiswap/v3.ts +++ b/dexs/sushiswap/v3.ts @@ -16,7 +16,7 @@ const endpointsV3 = { // [CHAIN.MOONRIVER]: sdk.graph.modifyEndpoint('5WabfuUgF5k4CE9snB22HNcUHQVkUStvet76qjovKdm6'), [CHAIN.OPTIMISM]: sdk.graph.modifyEndpoint('Hc3vTLxWmtyrn59t2Yv3MiXJVxjfNyZi41iKE3rXXHMf'), [CHAIN.POLYGON]: sdk.graph.modifyEndpoint('G1Q6dviDfMm6hVLvCqbfeB19kLmvs7qrnBvXeFndjhaU'), - [CHAIN.POLYGON_ZKEVM]: 'https://api.studio.thegraph.com/query/32073/v3-polygon-zkevm/v0.0.2', + // [CHAIN.POLYGON_ZKEVM]: 'https://api.studio.thegraph.com/query/32073/v3-polygon-zkevm/v0.0.2', [CHAIN.THUNDERCORE]: 'https://graph-node.thundercore.com/subgraphs/name/sushi-v3/v3-thundercore', [CHAIN.BASE]: "https://api.studio.thegraph.com/query/32073/v3-base/v0.0.1", [CHAIN.CORE]: "https://thegraph.coredao.org/subgraphs/name/sushi-v3/v3-core", diff --git a/dexs/swaap/index.ts b/dexs/swaap/index.ts index 6e562f234a..5bed0e981b 100644 --- a/dexs/swaap/index.ts +++ b/dexs/swaap/index.ts @@ -148,7 +148,7 @@ const adapter: BreakdownAdapter = { v1: { [CHAIN.POLYGON]: { fetch: async (_t: any, _tt: any ,options: FetchOptions) => { - const { dailyVolume, totalVolume } = await v1graphs(options.chain)(options) + const { dailyVolume, totalVolume } = await v1graphs(options.chain)(_t, _tt, options) return { timestamp: options.startOfDay, dailyVolume, diff --git a/dexs/traderjoe/index.ts b/dexs/traderjoe/index.ts index 0be9ad3656..4f99324972 100644 --- a/dexs/traderjoe/index.ts +++ b/dexs/traderjoe/index.ts @@ -1,6 +1,6 @@ import * as sdk from "@defillama/sdk"; import { Chain } from "@defillama/sdk/build/general"; -import { BreakdownAdapter, FetchOptions, FetchResultVolume } from "../../adapters/types"; +import { BreakdownAdapter, FetchOptions, FetchResultV2 } from "../../adapters/types"; import { CHAIN } from "../../helpers/chains"; import { getChainVolume2, getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume"; import { httpGet } from "../../utils/fetchURL"; @@ -24,7 +24,7 @@ interface IVolume { timestamp: number; volumeUsd: number; } -const fetchV2 = async (options: FetchOptions): Promise => { +const fetchV2 = async (options: FetchOptions): Promise => { const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(options.endTimestamp * 1000)) const url = `https://api.traderjoexyz.dev/v1/dex/analytics/${mapChain(options.chain)}?startTime=${options.startTimestamp}&endTime=${options.endTimestamp}` const historicalVolume: IVolume[] = (await httpGet(url, { headers: { @@ -39,7 +39,6 @@ const fetchV2 = async (options: FetchOptions): Promise => { return { totalVolume: `${totalVolume}`, dailyVolume: dailyVolume !== undefined ? `${dailyVolume}` : undefined, - timestamp: dayTimestamp, } } const mapChain = (chain: Chain): string => { diff --git a/helpers/getUniSubgraphVolume.ts b/helpers/getUniSubgraphVolume.ts index adcc6aba29..a14dc93b1d 100644 --- a/helpers/getUniSubgraphVolume.ts +++ b/helpers/getUniSubgraphVolume.ts @@ -356,7 +356,7 @@ function univ2Adapter(endpoints: { } } }, {} as BaseAdapter), - version: 2 + version: 1 }; return adapter; diff --git a/protocols/pancakeswap/index.ts b/protocols/pancakeswap/index.ts index 574d92424d..dd0fbc8c97 100644 --- a/protocols/pancakeswap/index.ts +++ b/protocols/pancakeswap/index.ts @@ -9,7 +9,7 @@ import { getEnv } from "../../helpers/env"; const endpoints = { [CHAIN.BSC]: "https://proxy-worker.pancake-swap.workers.dev/bsc-exchange", [CHAIN.ETHEREUM]: sdk.graph.modifyEndpoint('9opY17WnEPD4REcC43yHycQthSeUMQE26wyoeMjZTLEx'), - [CHAIN.POLYGON_ZKEVM]: "https://api.studio.thegraph.com/query/45376/exchange-v2-polygon-zkevm/version/latest", + // [CHAIN.POLYGON_ZKEVM]: "https://api.studio.thegraph.com/query/45376/exchange-v2-polygon-zkevm/version/latest", [CHAIN.ERA]: "https://api.studio.thegraph.com/query/45376/exchange-v2-zksync/version/latest", [CHAIN.ARBITRUM]: sdk.graph.modifyEndpoint('EsL7geTRcA3LaLLM9EcMFzYbUgnvf8RixoEEGErrodB3'), [CHAIN.LINEA]: "https://graph-query.linea.build/subgraphs/name/pancakeswap/exhange-v2", @@ -26,7 +26,7 @@ const stablesSwapEndpoints = { const v3Endpoint = { [CHAIN.BSC]: sdk.graph.modifyEndpoint('Hv1GncLY5docZoGtXjo4kwbTvxm3MAhVZqBZE4sUT9eZ'), [CHAIN.ETHEREUM]: sdk.graph.modifyEndpoint('CJYGNhb7RvnhfBDjqpRnD3oxgyhibzc7fkAMa38YV3oS'), - [CHAIN.POLYGON_ZKEVM]: "https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest", + // [CHAIN.POLYGON_ZKEVM]: "https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest", [CHAIN.ERA]: "https://api.studio.thegraph.com/query/45376/exchange-v3-zksync/version/latest", [CHAIN.ARBITRUM]: sdk.graph.modifyEndpoint('251MHFNN1rwjErXD2efWMpNS73SANZN8Ua192zw6iXve'), [CHAIN.LINEA]: "https://graph-query.linea.build/subgraphs/name/pancakeswap/exchange-v3-linea",