Skip to content

Commit b3e2e34

Browse files
authored
Merge pull request #2389 from BeralisDex/master
add beralis-v3
2 parents 83ddd4e + a8d63d9 commit b3e2e34

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

protocols/beralis-v3/index.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { FetchOptions, SimpleAdapter } from "../../adapters/types";
2+
import { CHAIN } from "../../helpers/chains";
3+
import { DEFAULT_TOTAL_VOLUME_FIELD, getGraphDimensions2 } from "../../helpers/getUniSubgraph";
4+
5+
const v3Endpoints: { [key: string]: string } = {
6+
[CHAIN.BERACHAIN]: "https://api.studio.thegraph.com/query/92670/berav3/version/latest"
7+
}
8+
const v3Graphs = getGraphDimensions2({
9+
graphUrls: v3Endpoints,
10+
totalVolume: {
11+
factory: "factories",
12+
field: DEFAULT_TOTAL_VOLUME_FIELD,
13+
},
14+
feesPercent: {
15+
type: "fees",
16+
ProtocolRevenue: 0,
17+
HoldersRevenue: 0,
18+
UserFees: 100, // User fees are 100% of collected fees
19+
SupplySideRevenue: 100, // 100% of fees are going to LPs
20+
Revenue: 0 // Revenue is 100% of collected fees
21+
}
22+
});
23+
24+
25+
const adapters: SimpleAdapter = {
26+
version: 2,
27+
adapter: {
28+
[CHAIN.BERACHAIN]: {
29+
fetch: (options: FetchOptions) => {
30+
return v3Graphs(options.chain)(options)
31+
}
32+
},
33+
}
34+
}
35+
36+
37+
export default adapters;

0 commit comments

Comments
 (0)