Skip to content

Commit

Permalink
add kodiak-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Feb 7, 2025
1 parent b8df098 commit f0f8798
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions helpers/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export enum CHAIN {
REDSTONE = "redstone",
PLUME = "plume",
PENUMBRA = "penumbra",
BERACHAIN = "berachain"
}

// Don´t use
Expand Down
37 changes: 37 additions & 0 deletions protocols/kodiak-v3/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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.BERACHAIN]: "https://api.goldsky.com/api/public/project_clpx84oel0al201r78jsl0r3i/subgraphs/kodiak-v3-berachain-mainnet/latest/gn"
}
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.BERACHAIN]: {
fetch: (options: FetchOptions) => {
return v3Graphs(options.chain)(options)
}
},
}
}


export default adapters;

0 comments on commit f0f8798

Please sign in to comment.