Skip to content

Commit

Permalink
Merge pull request DefiLlama#1202 from SupSwap/master
Browse files Browse the repository at this point in the history
added supswapv2-v3
  • Loading branch information
dtmkeng authored Feb 14, 2024
2 parents 6f0e97f + b1e1b04 commit 040452f
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
39 changes: 39 additions & 0 deletions dexs/supswap-v2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { DEFAULT_TOTAL_VOLUME_FIELD, getGraphDimensions } from "../../helpers/getUniSubgraph";

const v2Endpoints = {
[CHAIN.MODE]: "https://api.goldsky.com/api/public/project_clrhmyxsvvuao01tu4aqj653e/subgraphs/supswap-exchange-v2/1.0.0/gn"
}

const v2Graphs = getGraphDimensions({
graphUrls: v2Endpoints,
totalVolume: {
factory: "supFactories",
field: DEFAULT_TOTAL_VOLUME_FIELD,
},
dailyVolume: {
factory: "supDayData",
field: "dailyVolumeUSD",
},
feesPercent: {
type: "volume",
ProtocolRevenue: 0.08,
HoldersRevenue: 0.00,
Fees: 0.2, // 0.2% fees
UserFees: 0.2, // User fees are 100% of collected fees
SupplySideRevenue: 0.15, // 75% of fees are going to LPs
Revenue: 0.05 // Revenue is 33% of collected fees
}
});

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.MODE]: {
fetch: v2Graphs(CHAIN.MODE),
start: 3093279,
},
},
};

export default adapter;
45 changes: 45 additions & 0 deletions dexs/supswap-v3/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { DEFAULT_TOTAL_VOLUME_FIELD, getGraphDimensions } from "../../helpers/getUniSubgraph";

const v3Endpoints = {
[CHAIN.MODE]: "https://api.goldsky.com/api/public/project_clrhmyxsvvuao01tu4aqj653e/subgraphs/supswap-exchange-v3/1.0.0/gn"
}

const VOLUME_USD = "volumeUSD";

const v3Graphs = getGraphDimensions({
graphUrls: v3Endpoints,
totalVolume: {
factory: "factories",
field: DEFAULT_TOTAL_VOLUME_FIELD,
},
dailyVolume: {
factory: "supDayData",
field: VOLUME_USD,
},
dailyFees: {
factory: "supDayData",
field: "feesUSD",
},
feesPercent: {
type: "fees",
ProtocolRevenue: 33.33,
HoldersRevenue: 0,
Fees: 100,
UserFees: 100, // User fees are 100% of collected fees
SupplySideRevenue: 66.67, // 66% of fees are going to LPs
Revenue: 33.33 // Revenue is 33% of collected fees
}
});

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.MODE]: {
fetch: v3Graphs(CHAIN.MODE),
start: 3093279,
},
},
};

export default adapter;

0 comments on commit 040452f

Please sign in to comment.