Skip to content

Commit

Permalink
enable reservoir-tools-amm
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Jan 28, 2025
1 parent ca6b56b commit a2581e1
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
3 changes: 3 additions & 0 deletions helpers/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ export enum CHAIN {
SONEIUM = "soneium",
INK = "ink",
RIPPLE = "ripple",
ZERO = "zero_network",
SHAPE = "shape",
ABSTRACT = "abstract",
}

// Don´t use
Expand Down
58 changes: 58 additions & 0 deletions protocols/reservoir-tools-amm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,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;

0 comments on commit a2581e1

Please sign in to comment.