forked from DefiLlama/DefiLlama-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.
- Loading branch information
1 parent
d4ea020
commit 7db6e14
Showing
1 changed file
with
44 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,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/sotblad/yieldfieldsexchange", | ||
}; | ||
|
||
const DAILY_VOLUME_FACTORY = "YieldFieldsDayData"; | ||
|
||
const graphs = getChainVolume({ | ||
graphUrls: { | ||
[BSC]: endpoints[BSC], | ||
}, | ||
totalVolume: { | ||
factory: "YieldFieldsFactory", | ||
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; |