forked from DefiLlama/dimension-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreservoir-tools-clmm.ts
61 lines (55 loc) · 2.03 KB
/
reservoir-tools-clmm.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
import { FetchOptions, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import { DEFAULT_TOTAL_VOLUME_FIELD, getGraphDimensions2 } from "../helpers/getUniSubgraph";
const v3Endpoints: { [key: string]: string } = {
[CHAIN.ABSTRACT]: "https://graph-node.internal.reservoir.tools/subgraphs/name/abstract/v3-subgraph",
[CHAIN.ZERO]: "https://graph-node.internal.reservoir.tools/subgraphs/name/zero/v3-subgraph",
[CHAIN.SHAPE]: "https://graph-node.internal.reservoir.tools/subgraphs/name/shape/v3-subgraph",
[CHAIN.REDSTONE]: "https://graph-node.internal.reservoir.tools/subgraphs/name/redstone/v3-subgraph",
}
// https://graph-node.internal.reservoir.tools/subgraphs/name/abstract/v3-subgraph
// https://graph-node.internal.reservoir.tools/subgraphs/name/zero/v3-subgraph
// https://graph-node.internal.reservoir.tools/subgraphs/name/shape/v3-subgraph
// https://graph-node.internal.reservoir.tools/subgraphs/name/redstone/v3-subgraph
// https://graph-node.internal.reservoir.tools/subgraphs/name/ink/v3-subgraph
const v3Graphs = getGraphDimensions2({
graphUrls: v3Endpoints,
totalVolume: {
factory: "factories",
field: DEFAULT_TOTAL_VOLUME_FIELD,
},
feesPercent: {
type: "fees",
ProtocolRevenue: 0,
HoldersRevenue: 0,
UserFees: 100, // User fees are 100% of collected fees
SupplySideRevenue: 100, // 100% of fees are going to LPs
Revenue: 0 // Revenue is 100% of collected fees
}
});
const adapters: SimpleAdapter = {
version: 2,
adapter: {
[CHAIN.ABSTRACT]: {
fetch: (options: FetchOptions) => {
return v3Graphs(options.chain)(options)
}
},
[CHAIN.ZERO]: {
fetch: (options: FetchOptions) => {
return v3Graphs(options.chain)(options)
}
},
[CHAIN.SHAPE]: {
fetch: (options: FetchOptions) => {
return v3Graphs(options.chain)(options)
}
},
[CHAIN.REDSTONE]: {
fetch: (options: FetchOptions) => {
return v3Graphs(options.chain)(options)
}
},
}
}
export default adapters