-
Notifications
You must be signed in to change notification settings - Fork 1k
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 #747 from DackieSwap/master
dackieswap integrate volume chart
- Loading branch information
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 @@ | ||
import { IJSON, SimpleAdapter } from "../../adapters/types"; | ||
import { CHAIN } from "../../helpers/chains"; | ||
|
||
import { getGraphDimensions } from "../../helpers/getUniSubgraph"; | ||
|
||
const v3Endpoint = { | ||
[CHAIN.BASE]: | ||
"https://api.studio.thegraph.com/query/50473/exchange-clmm/version/latest", | ||
}; | ||
|
||
const VOLUME_USD = "volumeUSD"; | ||
|
||
const v3Graph = getGraphDimensions({ | ||
graphUrls: v3Endpoint, | ||
totalVolume: { | ||
factory: "factories", | ||
}, | ||
dailyVolume: { | ||
factory: "pancakeDayData", | ||
field: VOLUME_USD, | ||
}, | ||
totalFees:{ | ||
factory: "factories", | ||
}, | ||
dailyFees: { | ||
factory: "pancakeDayData", | ||
field: "feesUSD" | ||
}, | ||
}); | ||
|
||
const v3StartTimes = { | ||
[CHAIN.BASE]: 1691712000, | ||
} as IJSON<number>; | ||
|
||
const adapter: SimpleAdapter = { | ||
adapter: { | ||
[CHAIN.BASE]: { | ||
fetch: v3Graph(CHAIN.BASE), | ||
start: async () => v3StartTimes[CHAIN.BASE] | ||
}, | ||
}, | ||
}; | ||
|
||
export default adapter; |