Skip to content

Commit

Permalink
Merge pull request #1914 from DefiLlama/kibana-fixes
Browse files Browse the repository at this point in the history
Kibana fixes
  • Loading branch information
waynebruce0x authored Sep 16, 2024
2 parents be0609a + 65e5592 commit fc2903c
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 30 deletions.
2 changes: 1 addition & 1 deletion aggregators/bebop/index.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 2 additions & 4 deletions dexs/lynex/index.ts
Original file line number Diff line number Diff line change
@@ -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",
});

Expand Down
6 changes: 2 additions & 4 deletions dexs/nile-exchange/index.ts
Original file line number Diff line number Diff line change
@@ -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",
});

Expand Down
6 changes: 2 additions & 4 deletions dexs/pharaoh-exchange/index.ts
Original file line number Diff line number Diff line change
@@ -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",
});

Expand Down
6 changes: 2 additions & 4 deletions dexs/ramses-exchange-v2/index.ts
Original file line number Diff line number Diff line change
@@ -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",
});

Expand Down
6 changes: 2 additions & 4 deletions dexs/solidly-v3/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
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'),
[CHAIN.ARBITRUM]: sdk.graph.modifyEndpoint('ALCsbp7jWC6EQjwgicvZkG6dDEFGMV32QUZJvJGqL9Kx'),
[CHAIN.FANTOM]: sdk.graph.modifyEndpoint('HDNu25S2uqr13BHrQdPv2PfTpwxJgPB7QEnC8fsgKcM9')
}, {
factoriesName: "factories",
dayData: "solidlyDayData",
dailyVolume: "volumeUSD",
totalVolume: "totalVolumeUSD",
});

Expand Down
2 changes: 1 addition & 1 deletion dexs/sushiswap/classic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion dexs/sushiswap/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion dexs/swaap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions dexs/traderjoe/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -24,7 +24,7 @@ interface IVolume {
timestamp: number;
volumeUsd: number;
}
const fetchV2 = async (options: FetchOptions): Promise<FetchResultVolume> => {
const fetchV2 = async (options: FetchOptions): Promise<FetchResultV2> => {
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: {
Expand All @@ -39,7 +39,6 @@ const fetchV2 = async (options: FetchOptions): Promise<FetchResultVolume> => {
return {
totalVolume: `${totalVolume}`,
dailyVolume: dailyVolume !== undefined ? `${dailyVolume}` : undefined,
timestamp: dayTimestamp,
}
}
const mapChain = (chain: Chain): string => {
Expand Down
2 changes: 1 addition & 1 deletion helpers/getUniSubgraphVolume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ function univ2Adapter(endpoints: {
}
}
}, {} as BaseAdapter),
version: 2
version: 1
};

return adapter;
Expand Down
4 changes: 2 additions & 2 deletions protocols/pancakeswap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit fc2903c

Please sign in to comment.