web
web copied to clipboard
implement chart for historical pool data
AC
- see thoryield for reference
- data from midgard is available already
- finish implementing chart (volume and liquidity line charts for time frames displayed 1W, 1M, All)
swapsData: (poolAssetId: string, interval: Interval, count: number) => ({
queryKey: ['midgardSwapsData', poolAssetId, interval, count],
staleTime: 60_000,
queryFn: async () => {
const { data } = await axios.get<MidgardSwapHistoryResponse>(
`${midgardUrl}/history/swaps?pool=${poolAssetId}&interval=${interval}&count=${count}`,
)
return data
},
}),
tvl: (interval: Interval, count: number) => ({
queryKey: ['tvl', interval, count],
staleTime: 60_000,
queryFn: async () => {
const { data } = await axios.get<MidgardTvlHistoryResponse>(
`${midgardUrl}/history/tvl?interval=${interval}&count=${count}`,
)
return data
},
}),
.../shapeshift/web/src/react-queries/queries/midgard.ts