Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Mar 15, 2024
1 parent e92dacd commit fb5e115
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dexs/synfutures-v3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import request from "graphql-request";
import { Chain } from "@defillama/sdk/build/general";
import { CHAIN } from "../../helpers/chains";
import { ChainBlocks, FetchOptions, SimpleAdapter } from "../../adapters/types";
import { getTimestampAtStartOfDayUTC, getTimestampAtStartOfNextDayUTC } from "../../utils/date";

const info: { [key: string]: any } = {
[CHAIN.BLAST]: {
Expand All @@ -13,18 +14,19 @@ const fetch = (chain: Chain) => {
return async (
timestamp: number,
_: ChainBlocks,
{ createBalances, startTimestamp, endTimestamp, startOfDay }: FetchOptions
{ createBalances, startOfDay }: FetchOptions
) => {
const dailyVolume = createBalances();

const to = getTimestampAtStartOfNextDayUTC(timestamp)
const from = getTimestampAtStartOfDayUTC(timestamp)
const graphQL = `{
amms(where: {status_in: [TRADING, SETTLING]}) {
instrument {
quote {
id
}
}
hourlyDataList(where: {timestamp_gte: ${startTimestamp}, timestamp_lt: ${endTimestamp}}, orderBy: timestamp, orderDirection: desc) {
hourlyDataList(where: {timestamp_gte: ${from}, timestamp_lte: ${to - 1}}, orderBy: timestamp, orderDirection: desc) {
volume
}
}
Expand Down

0 comments on commit fb5e115

Please sign in to comment.