Skip to content

Commit

Permalink
update adapter to v2 to fix fee in wombat
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy-wombat committed Apr 7, 2024
1 parent be63b1a commit 2e13b3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions dexs/wombat-exchange/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FetchResultVolume, SimpleAdapter } from "../../adapters/types";
import {FetchOptions, FetchResultV2, SimpleAdapter} from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { gql, request } from "graphql-request";
import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume";
Expand Down Expand Up @@ -41,9 +41,10 @@ const endpoints: TEndpoint = {
};

const fetchVolume = (chain: Chain) => {
return async (timestamp: number): Promise<FetchResultVolume> => {
return async (options: FetchOptions): Promise<FetchResultV2> => {
const { startTimestamp} = options;
const dayTimestamp = getUniqStartOfTodayTimestamp(
new Date(timestamp * 1000)
new Date(startTimestamp * 1000)
);
const todaysBlock = await getBlock(dayTimestamp, chain, {});
const dayID = dayTimestamp / 86400;
Expand Down Expand Up @@ -71,6 +72,7 @@ const fetchVolume = (chain: Chain) => {
};

const adapter: SimpleAdapter = {
version: 2,
adapter: {
[CHAIN.BSC]: {
fetch: fetchVolume(CHAIN.BSC),
Expand Down
2 changes: 1 addition & 1 deletion fees/wombat-exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Adapter } from "../adapters/types";
import volumeAdapter from "../dexs/wombat-exchange";
import { getDexChainFees } from "../helpers/getUniSubgraphFees";

const TOTAL_FEES = 0.0001;
const TOTAL_FEES = 0.0004;

const feeAdapter = getDexChainFees({
totalFees: TOTAL_FEES,
Expand Down

0 comments on commit 2e13b3c

Please sign in to comment.