From 67292563ad029888e68061ad6f212f19aa7a1e2c Mon Sep 17 00:00:00 2001 From: 0xShad0w <44497716+0xShad0w@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:34:15 +0000 Subject: [PATCH 1/5] add shadow-exchange --- fees/shadow-exchange.ts | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 fees/shadow-exchange.ts diff --git a/fees/shadow-exchange.ts b/fees/shadow-exchange.ts new file mode 100644 index 0000000000..31b51803e6 --- /dev/null +++ b/fees/shadow-exchange.ts @@ -0,0 +1,62 @@ +import * as sdk from "@defillama/sdk"; +import { SimpleAdapter } from "../adapters/types"; +import { SONIC, CHAIN } from "../helpers/chains"; +import { + DEFAULT_DAILY_VOLUME_FACTORY, + DEFAULT_TOTAL_VOLUME_FIELD, + getGraphDimensions2, +} from "../helpers/getUniSubgraph"; + +type TStartTime = { + [key: string]: number; +}; +const startTimeV2: TStartTime = { + [CHAIN.SONIC]: 1735129946, +}; + +const v2Endpoints = { + [CHAIN.SONIC]: + sdk.graph.modifyEndpoint('QmQUpw87hb34A97MJZJcFNDfG9sP3ekSMojNKxVfPH8Ukw'), +}; + +const VOLUME_USD = "volumeUSD"; + +const v2Graphs = getGraphDimensions2({ + graphUrls: v2Endpoints, + totalVolume: { + factory: "factories", + field: DEFAULT_TOTAL_VOLUME_FIELD, + }, + feesPercent: { + type: "fees", + HoldersRevenue: 92, + UserFees: 100, + Revenue: 92, + SupplySideRevenue: 0, + ProtocolRevenue: 8, + }, +}); + +const methodology = { + UserFees: "User pays 0.3% fees on each swap.", + ProtocolRevenue: "Revenue going to the protocol.", + HoldersRevenue: "User fees are distributed among holders.", +}; + +const adapter: SimpleAdapter = { + version: 2, + adapter: { + [CHAIN.AVAX]: { + fetch: v2Graphs(SONIC), + start: startTimeV2[CHAIN.SONIC], + meta: { + methodology: { + ...methodology, + UserFees: "User pays 0.05%, 0.30%, or 1% on each swap.", + }, + }, + }, + }, +}; + +export default adapter; From 310b6a6b43879bbb2e187b6be3ecbc1ff5c516f5 Mon Sep 17 00:00:00 2001 From: 0xShad0w <44497716+0xShad0w@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:38:48 +0000 Subject: [PATCH 2/5] update --- fees/shadow-exchange.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fees/shadow-exchange.ts b/fees/shadow-exchange.ts index 31b51803e6..3a64c9d44c 100644 --- a/fees/shadow-exchange.ts +++ b/fees/shadow-exchange.ts @@ -29,11 +29,11 @@ const v2Graphs = getGraphDimensions2({ }, feesPercent: { type: "fees", - HoldersRevenue: 92, + HoldersRevenue: 100, UserFees: 100, - Revenue: 92, + Revenue: 100, SupplySideRevenue: 0, - ProtocolRevenue: 8, + ProtocolRevenue: 0, }, }); From ded41f55f3b197e1de3250774cac22b05416fd3d Mon Sep 17 00:00:00 2001 From: 0xShad0w <44497716+0xShad0w@users.noreply.github.com> Date: Tue, 31 Dec 2024 13:21:23 +0000 Subject: [PATCH 3/5] a --- fees/shadow-exchange.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fees/shadow-exchange.ts b/fees/shadow-exchange.ts index 3a64c9d44c..e538eb01fb 100644 --- a/fees/shadow-exchange.ts +++ b/fees/shadow-exchange.ts @@ -46,7 +46,7 @@ const methodology = { const adapter: SimpleAdapter = { version: 2, adapter: { - [CHAIN.AVAX]: { + [CHAIN.SONIC]: { fetch: v2Graphs(SONIC), start: startTimeV2[CHAIN.SONIC], meta: { From 07c97452207dc432d642dcb7bfbd2a250c8d8a21 Mon Sep 17 00:00:00 2001 From: 0xShad0w <44497716+0xShad0w@users.noreply.github.com> Date: Wed, 1 Jan 2025 08:18:27 +0000 Subject: [PATCH 4/5] a --- fees/shadow-exchange.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fees/shadow-exchange.ts b/fees/shadow-exchange.ts index e538eb01fb..702d594136 100644 --- a/fees/shadow-exchange.ts +++ b/fees/shadow-exchange.ts @@ -1,6 +1,6 @@ import * as sdk from "@defillama/sdk"; import { SimpleAdapter } from "../adapters/types"; -import { SONIC, CHAIN } from "../helpers/chains"; +import { CHAIN } from "../helpers/chains"; import { DEFAULT_DAILY_VOLUME_FACTORY, DEFAULT_TOTAL_VOLUME_FIELD, From 879f5c2113f77b136d1055cb3d3284faa725175d Mon Sep 17 00:00:00 2001 From: 0xShad0w <44497716+0xShad0w@users.noreply.github.com> Date: Wed, 1 Jan 2025 08:21:20 +0000 Subject: [PATCH 5/5] a --- fees/shadow-exchange.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fees/shadow-exchange.ts b/fees/shadow-exchange.ts index 702d594136..11e81b6f3f 100644 --- a/fees/shadow-exchange.ts +++ b/fees/shadow-exchange.ts @@ -47,7 +47,7 @@ const adapter: SimpleAdapter = { version: 2, adapter: { [CHAIN.SONIC]: { - fetch: v2Graphs(SONIC), + fetch: v2Graphs(CHAIN.SONIC), start: startTimeV2[CHAIN.SONIC], meta: { methodology: {