Skip to content

Commit

Permalink
Merge pull request #1926 from re-doubt/feature/tondiamonds
Browse files Browse the repository at this point in the history
Add tondiamonds DEX aggregator volume adapter
  • Loading branch information
dtmkeng authored Sep 19, 2024
2 parents 0c3dd80 + 26ccd40 commit 1d513d7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions aggregators/tondiamonds/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Adapter, FetchV2 } from "../../adapters/types";
import { httpGet } from "../../utils/fetchURL";
import { CHAIN } from "../../helpers/chains";

const statisticsEndpoint = "https://ton.diamonds/api/v2/dex/stats"

const fetch: FetchV2 = async ({startTimestamp}) => {
const statistics = await httpGet(statisticsEndpoint)

return {
timestamp: Math.floor(new Date(statistics?.data?.yesterday).getTime() / 1000),
dailyVolume: statistics?.data?.yesterdayVolume,
};
}

const adapter: Adapter = {
version: 2,
adapter: {
[CHAIN.TON]: {
fetch,
start: 1725148800,
},
}
}

export default adapter;

0 comments on commit 1d513d7

Please sign in to comment.