Skip to content

Commit 7ce8f1d

Browse files
committed
eon is dead; skip sei log pulls;
1 parent 1840083 commit 7ce8f1d

File tree

6 files changed

+11
-61
lines changed

6 files changed

+11
-61
lines changed

adapters/utils/runAdapter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,13 @@ async function _runAdapter({
313313
const fromTimestamp = toTimestamp - ONE_DAY_IN_SECONDS
314314
const getFromBlock = async () => await getBlock(fromTimestamp, chain)
315315
const getToBlock = async () => await getBlock(toTimestamp, chain, chainBlocks)
316+
const problematicChains = new Set(['sei'])
317+
316318
const getLogs = async ({ target, targets, onlyArgs = true, fromBlock, toBlock, flatten = true, eventAbi, topics, topic, cacheInCloud = false, skipCacheRead = false, entireLog = false, skipIndexer, noTarget, ...rest }: FetchGetLogsOptions) => {
319+
320+
321+
if (problematicChains.has(chain)) throw new Error(`getLogs is disabled for ${chain} chain due to frequent timeouts`)
322+
317323
fromBlock = fromBlock ?? await getFromBlock()
318324
toBlock = toBlock ?? await getToBlock()
319325

aggregators/rubic/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const chains: Record<string, string> = {
5252
[CHAIN.KROMA]: 'kroma',
5353
[CHAIN.XLAYER]: 'xlayer',
5454
[CHAIN.SEI]: 'sei',
55-
[CHAIN.EON]: 'horizen-eon',
55+
// [CHAIN.EON]: 'horizen-eon', // chain is dead
5656
[CHAIN.BAHAMUT]: 'bahamut',
5757
[CHAIN.KLAYTN]: 'klaytn',
5858
// [CHAIN.ASTAR_ZKEVM]: 'astar-evm',

bridge-aggregators/rubic/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const chains: Record<string, string> = {
6565
[CHAIN.KROMA]: 'kroma',
6666
[CHAIN.XLAYER]: 'xlayer',
6767
[CHAIN.SEI]: 'sei',
68-
[CHAIN.EON]: 'horizen-eon',
68+
// [CHAIN.EON]: 'horizen-eon', // chain is dead
6969
[CHAIN.BAHAMUT]: 'bahamut',
7070
[CHAIN.KLAYTN]: 'klaytn',
7171
[CHAIN.VELAS]: 'velas',

dexs/apex/index.ts

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,11 @@
1-
import fetchURL from "../../utils/fetchURL"
21
import { SimpleAdapter } from "../../adapters/types";
32
import { CHAIN } from "../../helpers/chains";
4-
import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume";
5-
6-
const historicalVolumeEndpoint = (symbol: string, endTime: number) => `https://pro.apex.exchange/api/v1/klines?end=${endTime}&interval=D&start=1708732800&symbol=${symbol}&limit=10`
7-
const allTiker = (symbol: string) => `https://pro.apex.exchange/api/v1/ticker?symbol=${symbol}`
8-
interface IVolumeall {
9-
id: string;
10-
volume: string;
11-
timestamp: number;
12-
price: string;
13-
volumeUSD: number;
14-
}
15-
const symbol: string[] = [...new Set([
16-
'1000PEPEUSDC', 'APTUSDC', 'ARBUSDC',
17-
'ATOMUSDC', 'AVAXUSDC', 'BCHUSDC',
18-
'BLURUSDC', 'BNBUSDC', 'BTCUSDC',
19-
'BTCUSDT', 'DOGEUSDC', 'DYDXUSDC',
20-
'ETCUSDC', 'ETHUSDC', 'ETHUSDT',
21-
'LBRUSDC', 'LDOUSDC', 'LINKUSDC',
22-
'LTCUSDC', 'MATICUSDC', 'OPUSDC',
23-
'ORDIUSDT', 'SOLUSDC', 'TIAUSDC',
24-
'TONUSDC', 'WLDUSDC', 'XRPUSDC',
25-
'STXUSDT', 'BIGTIMEUSDT', 'MEMEUSDT',
26-
'PYTHUSDT', 'FETUSDT', 'RNDRUSDT',
27-
'ICPUSDT', '1000BONKUSDT', 'DOTUSDT',
28-
'SEIUSDT', 'INJUSDT', 'ENSUSDT',
29-
'1000SATSUSDT', 'PENDLEUSDT', 'GMTUSDT',
30-
'MANTAUSDT', 'LINKUSDT', 'SOLUSDT',
31-
'MATICUSDT', 'STRKUSDT', 'SUIUSDT'
32-
])]
33-
interface IOpenInterest {
34-
id: string;
35-
openInterest: string;
36-
lastPrice: string;
37-
}
38-
39-
const fetch = async (timestamp: number) => {
40-
const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(timestamp * 1000))
41-
const historical: any[] = (await Promise.all(symbol.map((coins: string) => fetchURL(historicalVolumeEndpoint(coins, dayTimestamp + 60 * 60 * 24)))))
42-
.map((e: any) => Object.values(e.data)).flat().flat()
43-
.map((e: any) => { return { timestamp: e.t / 1000, volume: e.v, price: e.c } });
44-
const openInterestHistorical: IOpenInterest[] = (await Promise.all(symbol.map((coins: string) => fetchURL(allTiker(coins)))))
45-
.map((e: any) => e.data).flat().map((e: any) => { return { id: e.symbol, openInterest: e.openInterest, lastPrice: e.lastPrice } });
46-
const openInterestAtEnd = openInterestHistorical.reduce((a: number, { openInterest, lastPrice }) => a + Number(openInterest) * Number(lastPrice), 0);
47-
const historicalUSD = historical.map((e: IVolumeall) => {
48-
return {
49-
...e,
50-
volumeUSD: Number(e.volume) * Number(e.price)
51-
}
52-
});
53-
const dailyVolume = historicalUSD.filter((e: IVolumeall) => e.timestamp === dayTimestamp)
54-
.reduce((a: number, { volumeUSD }) => a + volumeUSD, 0);
55-
return {
56-
dailyVolume: dailyVolume,
57-
openInterestAtEnd,
58-
};
59-
};
60-
613

624
const adapter: SimpleAdapter = {
635
deadFrom: '2025-04-26', // https://apex-pro.gitbook.io/apex-pro/apex-pro-discontinued/about-apex-pro
646
adapter: {
657
[CHAIN.ETHEREUM]: {
66-
fetch,
8+
fetch: () => { throw new Error("Apex Pro has been discontinued") },
679
start: '2022-10-05',
6810
}
6911
},

dexs/ascent/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const graphsV3 = getChainVolume2({
2828

2929

3030
const adapter: BreakdownAdapter = {
31+
deadFrom: '2025-05-05', // EON chain is deprecated
3132
version: 2,
3233
breakdown: {
3334
v2: {

fees/ascent-v2.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const getFees = () => {
6464

6565

6666
const adapter: SimpleAdapter = {
67+
deadFrom: '2025-05-05', // EON chain is deprecated
6768
version: 2,
6869
adapter: {
6970
[CHAIN.EON]: {

0 commit comments

Comments
 (0)