diff --git a/aggregators/tondiamonds/index.ts b/aggregators/tondiamonds/index.ts new file mode 100644 index 0000000000..3ff9b91116 --- /dev/null +++ b/aggregators/tondiamonds/index.ts @@ -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;