mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
add CryptoSwap intergration
This commit is contained in:
44
dexVolumes/cryptoswap/index.ts
Normal file
44
dexVolumes/cryptoswap/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
const {
|
||||
getChainVolume,
|
||||
DEFAULT_TOTAL_VOLUME_FIELD,
|
||||
DEFAULT_DAILY_VOLUME_FIELD,
|
||||
} = require("../helper/getUniSubgraphVolume");
|
||||
const { BSC } = require("../helper/chains");
|
||||
const { getStartTimestamp } = require("../helper/getStartTimestamp");
|
||||
|
||||
import { DexVolumeAdapter } from "../dexVolume.type";
|
||||
|
||||
const endpoints = {
|
||||
[BSC]: "https://api.thegraph.com/subgraphs/name/cr3k/cdsexchange",
|
||||
};
|
||||
|
||||
const DAILY_VOLUME_FACTORY = "CSTDayData";
|
||||
|
||||
const graphs = getChainVolume({
|
||||
graphUrls: {
|
||||
[BSC]: endpoints[BSC],
|
||||
},
|
||||
totalVolume: {
|
||||
factory: "CSTFactory",
|
||||
field: DEFAULT_TOTAL_VOLUME_FIELD,
|
||||
},
|
||||
dailyVolume: {
|
||||
factory: DAILY_VOLUME_FACTORY,
|
||||
field: DEFAULT_DAILY_VOLUME_FIELD,
|
||||
},
|
||||
});
|
||||
|
||||
const adapter: DexVolumeAdapter = {
|
||||
volume: {
|
||||
[BSC]: {
|
||||
fetch: graphs(BSC),
|
||||
start: getStartTimestamp({
|
||||
endpoints,
|
||||
chain: BSC,
|
||||
dailyDataField: `${DAILY_VOLUME_FACTORY}s`,
|
||||
}),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default adapter;
|
||||
19
projects/cryptoswap/index.js
Normal file
19
projects/cryptoswap/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { calculateUsdUniTvl } = require("../helper/getUsdUniTvl");
|
||||
|
||||
module.exports = {
|
||||
misrepresentedTokens: true,
|
||||
methodology: 'The CryptoSwap subgraph and the CryptoSwap factory contract address are used to obtain the balance held in every LP pair.',
|
||||
bsc: {
|
||||
tvl: calculateUsdUniTvl(
|
||||
"0x4136A450861f5CFE7E860Ce93e678Ad12158695C",
|
||||
'bsc',
|
||||
"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
|
||||
[
|
||||
"0xe9e7cea3dedca5984780bafc599bd69add087d56",
|
||||
"0xcC4b3EA1F25c8772D390dA1DB507832aBE4a9740"
|
||||
],
|
||||
'wbnb'
|
||||
)
|
||||
},
|
||||
start: 1651494114, // Mon May 02 2022 12:21:54
|
||||
};
|
||||
Reference in New Issue
Block a user