diff --git a/dexs/surfone/index.ts b/dexs/surfone/index.ts index 56228b97d9..3417ba1c11 100644 --- a/dexs/surfone/index.ts +++ b/dexs/surfone/index.ts @@ -3,26 +3,28 @@ import { CHAIN } from "../../helpers/chains"; import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume"; import { httpGet } from "../../utils/fetchURL"; -const volumeEndpoint = "https://apigateway.surf.one/pool/24h/data" +// const volumeEndpoint = "https://apigateway.surf.one/pool/24h/data" +const volumeEndpointV2 = "https://apigateway.surf.one/v2/market/total/stat" const headers = { - "Block-Chain-Id": '8453', + "Block-Chain-Id":"4200", + "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" }; interface IVolume { - totalVolume: number, - totalTradeSize: number, + 'total_vol': number, + '24h_vol': number, } const fetch = () => { return async (timestamp: number) => { const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(timestamp * 1000)) - const response = (await httpGet(volumeEndpoint, { headers })); + const response = (await httpGet(volumeEndpointV2, { headers })); const volume: IVolume = response.data; return { - totalVolume: `${volume?.totalVolume || undefined}`, - dailyVolume: `${volume?.totalTradeSize || undefined}`, + totalVolume: `${volume?.total_vol || undefined}`, + dailyVolume: `${volume['24h_vol'] || undefined}`, timestamp: dayTimestamp, }; }; @@ -31,10 +33,10 @@ const fetch = () => { const adapter: SimpleAdapter = { adapter: { - [CHAIN.BASE]: { + ['merlin']: { fetch: fetch(), runAtCurrTime: true, - start: 7963804, + start: 9142115, } }, }; diff --git a/fees/surfone/index.ts b/fees/surfone/index.ts index 7daeade8d5..f77f41ead3 100644 --- a/fees/surfone/index.ts +++ b/fees/surfone/index.ts @@ -3,24 +3,26 @@ import { CHAIN } from "../../helpers/chains"; import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume"; import { httpGet } from "../../utils/fetchURL"; -const volumeEndpoint = "https://apigateway.surf.one/pool/24h/data" +// const volumeEndpoint = "https://apigateway.surf.one/pool/24h/data" +const volumeEndpointV2 = "https://apigateway.surf.one/v2/market/total/stat" const headers = { - "Block-Chain-Id": '8453', + "Block-Chain-Id":"4200", + "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" }; interface IVolume { - totalTradeFee: number, + total_fee: number, } const fetch = () => { return async (timestamp: number) => { const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(timestamp * 1000)) - const response = (await httpGet(volumeEndpoint, { headers })); + const response = (await httpGet(volumeEndpointV2, { headers })); const volume: IVolume = response.data; return { - dailyFees: `${volume?.totalTradeFee || undefined}`, + dailyFees: `${volume?.total_fee || undefined}`, timestamp: dayTimestamp, }; }; @@ -29,10 +31,10 @@ const fetch = () => { const adapter: SimpleAdapter = { adapter: { - [CHAIN.BASE]: { + ['merlin']: { fetch: fetch(), runAtCurrTime: true, - start: 7963804, + start: 9142115, } }, };