Skip to content

Commit

Permalink
fix(polynomial-trade): new volume API
Browse files Browse the repository at this point in the history
  • Loading branch information
gaulois committed Jul 27, 2023
1 parent 210261b commit 2f28dde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dexs/polynomial-trade/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getTimestampAtStartOfDayUTC } from "../../utils/date";
import fetchURL from "../../utils/fetchURL"
import { CHAIN } from "../../helpers/chains";

const volumeEndpoint = "https://perps-api-staging.polynomial.fi/snx-perps/volume"
const volumeEndpoint = "https://perps-api-experimental.polynomial.fi/snx-perps/volume"
const oneDay = 86400
const startTimeStamp = 1679875200

Expand All @@ -23,7 +23,7 @@ const fetch = async (timestamp: number) => {
async function getDailyVolume(startDayTimestamp: number) : Promise<string> {
const endDayTimeStamp = startDayTimestamp + oneDay
const dailyVolumeQuery = '?from='+startDayTimestamp.toString()+'&to='+endDayTimeStamp.toString()
return (await fetchURL(volumeEndpoint+dailyVolumeQuery))?.data.volume;
return (await fetchURL(volumeEndpoint+dailyVolumeQuery))?.data;
}

async function getTotalVolume(endtimestamp: number) : Promise<string> {
Expand Down

0 comments on commit 2f28dde

Please sign in to comment.