From 787edda8daccf8ddc1d6694cbdce168cb4561f6f Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:30:03 +0100 Subject: [PATCH] track titan #2113 --- aggregators/titan/index.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 aggregators/titan/index.ts diff --git a/aggregators/titan/index.ts b/aggregators/titan/index.ts new file mode 100644 index 0000000000..aa4bd5e1ae --- /dev/null +++ b/aggregators/titan/index.ts @@ -0,0 +1,30 @@ +import { Adapter, FetchV2 } from "../../adapters/types"; +import { httpGet } from "../../utils/fetchURL"; +import { CHAIN } from "../../helpers/chains"; + +const statisticsEndpoint = "https://api.titan.tg/v1/statistics" + +const fetch: FetchV2 = async ({ fromTimestamp, toTimestamp }) => { + const statistics = await httpGet(statisticsEndpoint, { + params: { + start: fromTimestamp, + end: toTimestamp, + } + }) + + return { + dailyVolume: statistics?.volumeUsd, + }; +} + +const adapter: Adapter = { + version: 2, + adapter: { + [CHAIN.TON]: { + fetch, + start: 1730250000, + }, + } +} + +export default adapter;