()
- const userHistoricalLocks = lockSnapshots
+ const userHistoricalLocks = [...lockSnapshots].sort((a, b) => a.timestamp - b.timestamp)
- const { mainnetLockedInfo } = useVebalLockInfo()
const lockedUntil = mainnetLockedInfo.lockedEndDate
? differenceInDays(new Date(mainnetLockedInfo.lockedEndDate), new Date())
: 0
@@ -96,9 +101,12 @@ export function useVebalLocksChart() {
const isExpired = mainnetLockedInfo.isExpired
const chartValues = useMemo(() => {
- if (!userHistoricalLocks) return []
-
- const processedValues = processLockSnapshots(lockSnapshots)
+ const processedValues = processLockSnapshots(
+ userHistoricalLocks.map(userHistoricalLock => ({
+ ...userHistoricalLock,
+ slope: userHistoricalLock.slope,
+ }))
+ )
const valuesByDates = groupValuesByDates(processedValues)
return filterAndFlattenValues(valuesByDates)
}, [userHistoricalLocks])
@@ -234,7 +242,7 @@ export function useVebalLocksChart() {
if (!mouseoverRef.current) {
if (firstPoint.seriesId === MAIN_SERIES_ID) {
- if (firstPoint.dataIndex === chartValues.length - 1) {
+ if ([firstPoint.dataIndex, secondPoint?.dataIndex].includes(chartValues.length - 1)) {
return `
@@ -356,5 +364,6 @@ export function useVebalLocksChart() {
options,
onChartReady,
onEvents,
+ insufficientData: chartValues.length < MIN_CHART_VALUES,
}
}
diff --git a/packages/lib/shared/services/api/vebal.graphql b/packages/lib/shared/services/api/vebal.graphql
index ba034518d..cec6770dc 100644
--- a/packages/lib/shared/services/api/vebal.graphql
+++ b/packages/lib/shared/services/api/vebal.graphql
@@ -8,5 +8,11 @@ query GetVeBalUser(
) {
balance
rank
+ lockSnapshots {
+ balance
+ timestamp
+ bias
+ slope
+ }
}
}
\ No newline at end of file
diff --git a/turbo.json b/turbo.json
index 8e9d8ac46..0c5a778b8 100644
--- a/turbo.json
+++ b/turbo.json
@@ -21,6 +21,9 @@
"dependsOn": ["^start"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
},
+ "transit": {
+ "dependsOn": ["^transit"]
+ },
"lint": {
"dependsOn": ["^transit"],
"outputs": ["node_modules/.cache/.eslintcache", ".next/cache/eslint"]
@@ -31,24 +34,21 @@
"cache": false
},
"typecheck": {
- "dependsOn": ["graphql:gen", "transit"],
+ "dependsOn": ["^graphql:gen", "^transit"],
"outputs": ["node_modules/.cache/tsbuildinfo.json"]
},
"test:unit": {
- "dependsOn": ["graphql:gen", "^test:unit"]
+ "dependsOn": ["^graphql:gen", "^test:unit"]
},
"test:integration": {
- "dependsOn": ["graphql:gen", "^test:integration"],
+ "dependsOn": ["^graphql:gen", "^test:integration"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
},
"graphql:gen": {
"dependsOn": ["^graphql:gen"],
- "inputs": [".env*"],
+ "inputs": ["**/*.graphql"],
"outputs": ["shared/services/api/generated/**"]
},
- "transit": {
- "dependsOn": ["^transit"]
- },
"//#format": {
"outputs": ["node_modules/.cache/.prettiercache"]
},