forked from DefiLlama/dimension-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreservoir-tools-amm.ts
58 lines (51 loc) · 1.52 KB
/
reservoir-tools-amm.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
import { FetchOptions, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import { getGraphDimensions2 } from "../helpers/getUniSubgraph";
const v2Endpoints: { [s: string]: string } = {
[CHAIN.INK]: "https://graph-node.internal.reservoir.tools/subgraphs/name/ink/v2-subgraph",
[CHAIN.ZERO]: "https://graph-node.internal.reservoir.tools/subgraphs/name/zero/v2-subgraph",
[CHAIN.SHAPE]: "https://graph-node.internal.reservoir.tools/subgraphs/name/shape/v2-subgraph",
[CHAIN.ABSTRACT]: "https://graph-node.internal.reservoir.tools/subgraphs/name/abstract/v2-subgraph",
}
const v2Graph = getGraphDimensions2({
graphUrls: v2Endpoints,
feesPercent: {
type: "volume",
UserFees: 0.3,
ProtocolRevenue: 0,
SupplySideRevenue: 0.3,
HoldersRevenue: 0,
Revenue: 0,
Fees: 0.3
}
});
const adapter: SimpleAdapter = {
version: 2,
adapter: {
[CHAIN.INK]: {
fetch: (options: FetchOptions) => {
return v2Graph(options.chain)(options)
},
start: '2025-01-07',
},
[CHAIN.ZERO]: {
fetch: (options: FetchOptions) => {
return v2Graph(options.chain)(options)
},
start: '2025-01-07',
},
[CHAIN.SHAPE]: {
fetch: (options: FetchOptions) => {
return v2Graph(options.chain)(options)
},
start: '2025-01-07',
},
[CHAIN.ABSTRACT]: {
fetch: (options: FetchOptions) => {
return v2Graph(options.chain)(options)
},
start: '2025-01-07',
},
}
}
export default adapter;