From e6fe05927dcfb76f562a16f3b0918c5294a982eb Mon Sep 17 00:00:00 2001 From: elsvv Date: Mon, 9 Sep 2024 00:29:48 +0300 Subject: [PATCH] feat: add prophet adapters (wip) --- fees/prophet-protocol/index.ts | 29 +++++++++++++++++++++++++++++ options/prophet-protocol/index.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 fees/prophet-protocol/index.ts create mode 100644 options/prophet-protocol/index.ts diff --git a/fees/prophet-protocol/index.ts b/fees/prophet-protocol/index.ts new file mode 100644 index 0000000000..dab195c45d --- /dev/null +++ b/fees/prophet-protocol/index.ts @@ -0,0 +1,29 @@ +import { FetchOptions, SimpleAdapter } from "../../adapters/types"; +import { CHAIN } from "../../helpers/chains"; +import fetchURL from "../../utils/fetchURL"; + +const adapter: SimpleAdapter = { + adapter: { + [CHAIN.TON]: { + fetch: async (timestamp: number, _t: any, options: FetchOptions) => { + const result = await fetchURL( + `https://api.prophet.click/history?timestamp=${options.startOfDay * 1000}` + ); + + return { + dailyUserFees: result.fees.toString(), + dailyFees: result.fees.toString(), + timestamp: result.timestamp, + }; + }, + start: 1719847914, + meta: { + methodology: { + Fees: "Traders pay opening fees", + }, + }, + }, + }, +}; + +export default adapter; diff --git a/options/prophet-protocol/index.ts b/options/prophet-protocol/index.ts new file mode 100644 index 0000000000..30fd37d0fb --- /dev/null +++ b/options/prophet-protocol/index.ts @@ -0,0 +1,28 @@ +import { FetchOptions, SimpleAdapter } from "../../adapters/types"; +import { CHAIN } from "../../helpers/chains"; +import fetchURL from "../../utils/fetchURL"; + +const adapter: SimpleAdapter = { + adapter: { + [CHAIN.TON]: { + fetch: async (timestamp: number, _t: any, options: FetchOptions) => { + const result = await fetchURL( + `https://api.prophet.click/history?timestamp=${options.startOfDay * 1000}` + ); + + return { + ...result, + timestamp, + }; + }, + start: 1719847914, + meta: { + methodology: { + Volume: "Parimutual bets volume", + }, + }, + }, + }, +}; + +export default adapter;