forked from DefiLlama/dimension-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DefiLlama#1202 from SupSwap/master
added supswapv2-v3
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |