-
Notifications
You must be signed in to change notification settings - Fork 825
/
pharaoh-exchange.ts
65 lines (57 loc) · 1.47 KB
/
pharaoh-exchange.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { SimpleAdapter, FetchResultFees, BaseAdapter } from "../adapters/types";
import { AVAX, CHAIN } from "../helpers/chains";
import {
getGraphDimensions,
DEFAULT_DAILY_VOLUME_FACTORY,
DEFAULT_TOTAL_VOLUME_FIELD,
} from "../helpers/getUniSubgraph";
type TStartTime = {
[key: string]: number;
};
const startTimeV2: TStartTime = {
[CHAIN.AVAX]: 1702339200,
};
const v2Endpoints = {
[CHAIN.AVAX]:
"https://api.thegraph.com/subgraphs/name/ramsesexchange/pharaoh-cl-subgraph",
};
const VOLUME_USD = "volumeUSD";
const v2Graphs = getGraphDimensions({
graphUrls: v2Endpoints,
totalVolume: {
factory: "factories",
field: DEFAULT_TOTAL_VOLUME_FIELD,
},
dailyVolume: {
factory: DEFAULT_DAILY_VOLUME_FACTORY,
field: VOLUME_USD,
},
feesPercent: {
type: "fees",
HoldersRevenue: 50,
UserFees: 100, // User fees are 100% of collected fees
Revenue: 50, // Revenue is 50% of collected fees
SupplySideRevenue: 50,
},
});
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(AVAX),
start: startTimeV2[CHAIN.AVAX],
meta: {
methodology: {
...methodology,
UserFees: "User pays 0.05%, 0.30%, or 1% on each swap.",
},
},
},
},
};
export default adapter;