Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Sep 12, 2024
1 parent e7c1601 commit b2ee4c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions options/arrow-markets/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SimpleAdapter } from "../../adapters/types";
import { FetchOptions, SimpleAdapter } from "../../adapters/types";
import fetchURL from "../../utils/fetchURL";
import { CHAIN } from "../../helpers/chains";

Expand All @@ -22,9 +22,11 @@ export const v2_adapter: SimpleAdapter = {

export async function fetchArrowMarketsVolumeData(
/** Timestamp representing the end of the 24 hour period */
timestamp: number
timestamp: number,
_t: any,
options: FetchOptions
) {
const ArrowMarketsVolumeData = await getArrowMarketsVolumeData(arrowMarketsVolumeEndpoint, timestamp);
const ArrowMarketsVolumeData = await getArrowMarketsVolumeData(arrowMarketsVolumeEndpoint, options.startOfDay);

const dailyPremiumVolume = Number(ArrowMarketsVolumeData.daily_premium_volume).toFixed(2);
const dailyNotionalVolume = Number(ArrowMarketsVolumeData.daily_notional_volume).toFixed(2);
Expand All @@ -39,10 +41,8 @@ export async function fetchArrowMarketsVolumeData(
}

async function getArrowMarketsVolumeData(endpoint: string, timestamp: number): Promise<ArrowMarketsVolumeResponse> {
const url = new URL(endpoint);
url.searchParams.append('timestamp', timestamp.toString());

return fetchURL(endpoint)
const url = `${endpoint}?timestamp=${timestamp}`;
return fetchURL(url)
}

export default v2_adapter;

0 comments on commit b2ee4c7

Please sign in to comment.