Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts + analytics #1161

Merged
merged 39 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a83ca70
feat: update price + podRate
Space-Bean Oct 12, 2024
03654b5
feat: remove logs from useSeasonsQuery
Space-Bean Oct 12, 2024
e05ca77
feat: update price + podRate
Space-Bean Oct 12, 2024
e2722f5
feat: remove logs from useSeasonsQuery
Space-Bean Oct 12, 2024
6993c25
feat: update useSeasonsQuery implementations
Space-Bean Oct 15, 2024
8a696a0
feat: update gql client
Space-Bean Oct 17, 2024
eee0225
feat: update useSeasonsQuery
Space-Bean Oct 17, 2024
ba61839
feat: update forecast charts
Space-Bean Oct 17, 2024
dad565b
merge
Space-Bean Oct 17, 2024
e274bd6
feat: update useSeasonsQuery
Space-Bean Oct 17, 2024
c5287a1
feat: update client + useSeasonsQuery
Space-Bean Oct 17, 2024
0b356c3
feat: update useSeasonsQuery
Space-Bean Oct 17, 2024
43581ab
feat: improve update stacked area chart
Space-Bean Oct 17, 2024
959534b
feat: fix farmer deposits chart
Space-Bean Oct 18, 2024
9ca8ab4
feat: update queries
Space-Bean Oct 18, 2024
46fe6c1
feat: start updating analytics
Space-Bean Oct 18, 2024
1268318
feat: implement sg query configs
Space-Bean Oct 18, 2024
03525a7
feat: update imports
Space-Bean Oct 18, 2024
0707adc
feat: update imports
Space-Bean Oct 18, 2024
54d19f1
feat: update charts implementation
Space-Bean Oct 21, 2024
8bade6a
feat: update gql fns
Space-Bean Oct 21, 2024
89ae7c9
feat: update graph
Space-Bean Oct 21, 2024
4988239
feat: remove old field + bean charts
Space-Bean Oct 21, 2024
6f85c6f
feat: update silo charts
Space-Bean Oct 21, 2024
1187f00
Merge branch 'master' into spacebean/ui/charts
Space-Bean Oct 21, 2024
262fce3
feat: fix build errors --no-verify
Space-Bean Oct 21, 2024
711ab05
feat: fix stalk chart--no-verify
Space-Bean Oct 21, 2024
7992186
feat: add logs
Space-Bean Oct 21, 2024
292d928
feat: update logs to sdk
Space-Bean Oct 21, 2024
160564a
feat: add logs
Space-Bean Oct 21, 2024
d985bc9
feat: update test utils provider
Space-Bean Oct 21, 2024
11bfd96
feat: update chainId for package.json
Space-Bean Oct 21, 2024
d23c2eb
feat: remove multicall for supply + bean
Space-Bean Oct 21, 2024
c388eeb
feat: ethers adapters
Space-Bean Oct 21, 2024
4f85ac6
feat: remove multicalls from silo/updater
Space-Bean Oct 21, 2024
0df932d
feat: update liq by state
Space-Bean Oct 21, 2024
5a5155b
feat: remove multicall for pools updater
Space-Bean Oct 21, 2024
0183994
feat: remove multicall from prices updater
Space-Bean Oct 21, 2024
418b69d
feat: clean up
Space-Bean Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: update gql fns
  • Loading branch information
Space-Bean committed Oct 21, 2024
commit 8bade6a761e752197e83fdc4e8d061f4d57a853d
2 changes: 1 addition & 1 deletion projects/ui/src/components/Analytics/ChartV2.tsx
Original file line number Diff line number Diff line change
@@ -346,7 +346,7 @@ const ChartV2: FC<ChartV2DataProps> = ({
const dataIndex = mode === 'last' ? selectedData.length - 1 : 0;
_time = Math.max(_time, selectedData[dataIndex]?.time.valueOf() as number);
_season = Math.max(_season, selectedData[dataIndex]?.customValues?.season);
_value.push(selectedData[dataIndex].value);
_value.push(selectedData[dataIndex]?.value);
});

return {
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
query SeasonalHarvestedPods($season_lte: Int, $first: Int) {
query SeasonalHarvestedPods($season_lte: Int, $first: Int, $field: String) {
seasons: fieldHourlySnapshots(
where: {
field: "0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5",
field: $field,
season_lte: $season_lte
}
first: $first
4 changes: 2 additions & 2 deletions projects/ui/src/components/Analytics/Field/Pods.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
query SeasonalPods($season_lte: Int, $first: Int) {
query SeasonalPods($season_lte: Int, $first: Int, $field: String) {
seasons: fieldHourlySnapshots(
where: {
field: "0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5",
field: $field,
season_lte: $season_lte
}
first: $first
4 changes: 2 additions & 2 deletions projects/ui/src/components/Analytics/Field/RRoR.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
query SeasonalRRoR($season_lte: Int, $first: Int) {
query SeasonalRRoR($season_lte: Int, $first: Int, $field: String) {
seasons: fieldHourlySnapshots(
where: {
field: "0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5",
field: $field,
season_lte: $season_lte
}
first: $first
4 changes: 2 additions & 2 deletions projects/ui/src/components/Analytics/Field/Sown.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
query SeasonalSown($season_lte: Int, $first: Int) {
query SeasonalSown($season_lte: Int, $first: Int, $field: String) {
seasons: fieldHourlySnapshots(
where: {
field: "0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5",
field: $field,
season_lte: $season_lte
}
first: $first
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
query SeasonalTemperature($season_lte: Int, $first: Int) {
query SeasonalTemperature($season_lte: Int, $first: Int, $field: String) {
seasons: fieldHourlySnapshots(
where: {
season_lte: $season_lte,
field: "0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5",
field: $field,
}
first: $first
orderBy: season
2 changes: 2 additions & 0 deletions projects/ui/src/components/Analytics/Field/Temperature.tsx
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import { SnapshotData } from '~/hooks/beanstalk/useSeasonsQuery';
import { AppState } from '~/state';

import { FC } from '~/types';
import { subgraphQueryKeys } from '~/util/Graph';

const getValue = (snapshot: SnapshotData<SeasonalTemperatureQuery>) =>
snapshot.temperature;
@@ -47,6 +48,7 @@ const Temperature: FC<{
StatProps={statProps}
LineChartProps={lineChartProps}
statsRowFullWidth={statsRowFullWidth}
name={subgraphQueryKeys.beanstalkMaxTemperature}
/>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
query SeasonalTotalSowers($season_lte: Int, $first: Int) {
query SeasonalTotalSowers($season_lte: Int, $first: Int, $field: String) {
seasons: fieldHourlySnapshots(
where: {
field: "0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5",
field: $field,
season_lte: $season_lte
}
first: $first
46 changes: 0 additions & 46 deletions projects/ui/src/components/Analytics/Field/TotalSowers.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions projects/ui/src/components/Analytics/Field/index.tsx
Original file line number Diff line number Diff line change
@@ -2,14 +2,13 @@ import React from 'react';

import { Card, Tabs, Tab } from '@mui/material';
import useTabs from '~/hooks/display/useTabs';
import { FC } from '~/types';
import HarvestedPods from './HarvestedPods';
import PodRate from './PodRate';
import Pods from './Pods';
import Temperature from './Temperature';
import Sown from './Sown';
import TotalSowers from './TotalSowers';
import RRoR from './RRoR';
import { FC } from '~/types';

const SLUGS = [
'rror',
@@ -44,7 +43,7 @@ const FieldAnalytics: FC<{}> = () => {
{tab === 3 && <PodRate height={300} />}
{tab === 4 && <Sown height={300} />}
{tab === 5 && <HarvestedPods height={300} />}
{tab === 6 && <TotalSowers height={300} />}

</Card>
);
};
16 changes: 16 additions & 0 deletions projects/ui/src/graph/graphql.schema.json
Original file line number Diff line number Diff line change
@@ -88762,6 +88762,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "labels_in",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "network",
"description": null,
1 change: 1 addition & 0 deletions projects/ui/src/graph/schema-snapshot1.graphql
Original file line number Diff line number Diff line change
@@ -223,6 +223,7 @@ input ProposalWhere {
id_in: [String]
ipfs: String
ipfs_in: [String]
labels_in: [String]
network: String
network_in: [String]
plugins_contains: String
44 changes: 36 additions & 8 deletions projects/ui/src/util/Graph.ts
Original file line number Diff line number Diff line change
@@ -365,49 +365,77 @@ export const subgraphQueryConfigs = {
document: SeasonalRRoRDocument,
queryKey: subgraphQueryKeys.beanstalkRRoR,
queryOptions: (
(chain) => makeOptions(chain)
(chain) => makeOptions(chain, {
vars: {
field: (chain === "l2" ? beanstalkARB : beanstalkETH).toLowerCase()
}
})
) satisfies DynamicSGQueryOption,
},
beanstalkMaxTemperature: {
document: SeasonalTemperatureDocument,
queryKey: subgraphQueryKeys.beanstalkMaxTemperature,
queryOptions: (
(chain) => makeOptions(chain)
(chain) => makeOptions(chain, {
vars: {
field: (chain === "l2" ? beanstalkARB : beanstalkETH).toLowerCase()
}
})
) satisfies DynamicSGQueryOption,
},
beanstalkUnharvestablePods: {
document: SeasonalPodsDocument,
queryKey: subgraphQueryKeys.beanstalkUnharvestablePods,
queryOptions: (
(chain) => makeOptions(chain)
(chain) => makeOptions(chain, {
vars: {
field: (chain === "l2" ? beanstalkARB : beanstalkETH).toLowerCase()
}
})
) satisfies DynamicSGQueryOption,
},
beanstalkPodRate: {
document: SeasonalPodRateDocument,
queryKey: subgraphQueryKeys.beanstalkPodRate,
queryOptions: (
(chain) => makeOptions(chain)
(chain) => makeOptions(chain, {
vars: {
field: (chain === "l2" ? beanstalkARB : beanstalkETH).toLowerCase()
}
})
) satisfies DynamicSGQueryOption,
},
beanstalkSownBeans: {
document: SeasonalSownDocument,
queryKey: subgraphQueryKeys.beanstalkSownBeans,
queryOptions: (
(chain) => makeOptions(chain)
(chain) => makeOptions(chain, {
vars: {
field: (chain === "l2" ? beanstalkARB : beanstalkETH).toLowerCase()
}
})
) satisfies DynamicSGQueryOption,
},
beanstalkHarvestedPods: {
document: SeasonalHarvestedPodsDocument,
queryKey: subgraphQueryKeys.beanstalkHarvestedPods,
queryOptions: (
(chain) => makeOptions(chain)
(chain) => makeOptions(chain, {
vars: {
field: (chain === "l2" ? beanstalkARB : beanstalkETH).toLowerCase()
}
})
) satisfies DynamicSGQueryOption,
},
beanstalkTotalSowers: {
document: SeasonalTotalSowersDocument,
queryKey: subgraphQueryKeys.beanstalkTotalSowers,
queryOptions: (
(chain) => makeOptions(chain)
(chain) => makeOptions(chain, {
vars: {
field: (chain === "l2" ? beanstalkARB : beanstalkETH).toLowerCase()
}
})
) satisfies DynamicSGQueryOption,
}
};
@@ -526,7 +554,7 @@ export async function fetchAllSeasonData(
const apolloRequests = options
.map((opts) => ({
id: getRequstIdWithParams(opts, params, fetchAll),
request: () => apolloClient.query({ ...opts, fetchPolicy: 'no-cache' }),
request: () => apolloClient.query({ ...opts, fetchPolicy: 'network-only' }),
}))

if (apolloRequests.length > 0) {