Skip to content

Commit 76ef615

Browse files
authored
remove vest exchange wash trading pair (DefiLlama#3667)
1 parent 7c0b019 commit 76ef615

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

dexs/vest/index.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@ import {getUniqStartOfTodayTimestamp} from "../../helpers/getUniSubgraphVolume";
44
import fetchURL from "../../utils/fetchURL"
55
import { FetchOptions } from "../../adapters/types";
66

7+
const tickers_endpoint = 'https://serverprod.vest.exchange/v2/ticker/24hr'
8+
9+
const blacklisted_tickers = ['VC-PERP'] // wash trading
10+
711
const fetch = async (timestamp: number, _: any, options: FetchOptions): Promise<FetchResultVolume> => {
8-
const from_date = getUniqStartOfTodayTimestamp(new Date(options.startOfDay * 1000));
9-
const to_date = from_date + 86400;
10-
const data = (await fetchURL(`https://serverprod.vest.exchange/v2/exchangeInfo/volume?from_date=${from_date * 1000}&to_date=${to_date * 1000}`));
12+
// const from_date = getUniqStartOfTodayTimestamp(new Date(options.startOfDay * 1000));
13+
// const to_date = from_date + 86400;
14+
// const data = (await fetchURL(`https://serverprod.vest.exchange/v2/exchangeInfo/volume?from_date=${from_date * 1000}&to_date=${to_date * 1000}`));
15+
16+
const data = (await fetchURL(tickers_endpoint)).tickers;
17+
const dailyVolume = data.filter((ticker: any) => !blacklisted_tickers.includes(ticker.symbol)).reduce((acc: number, ticker: any) => acc + Number(ticker.quoteVolume || 0), 0);
18+
1119
return {
12-
dailyVolume: data.total,
13-
timestamp: timestamp,
20+
dailyVolume: dailyVolume,
1421
};
1522
};
1623

1724
const adapter: SimpleAdapter = {
25+
version: 2,
1826
adapter: {
1927
[CHAIN.BASE]: {
2028
fetch,

0 commit comments

Comments
 (0)