-
Notifications
You must be signed in to change notification settings - Fork 620
Add gas metrics chart to account abstraction analytics #8442
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
Conversation
Introduces a new GasMetricsChartCard component to visualize gas usage, average gas price, and cost efficiency across chains. Updates the analytics API and UserOpStats type to include gasUnits and avgGasPrice fields, and aggregates these metrics for display. Integrates the new chart into the account abstraction analytics page. Closes BLD-460
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
WalkthroughAdds gasUnits and avgGasPrice to analytics types and aggregation, introduces a new GasMetricsChartCard React component for gas-related charts, and replaces SponsoredTransactionsChartCard with GasMetricsChartCard in the Account Abstraction analytics layout. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Browser as Browser (GasMetricsChartCard)
participant Server as Server (getAggregateUserOpUsage)
participant Reducer as Aggregation Reducer
participant Chart as Chart Renderer
Browser->>Server: request aggregated userOpStats
Server->>Reducer: filter production chains, reduce per-day
note right of Reducer `#F9F5E7`: accumulate:\n- successful / failed / sponsoredUsd\n- gasUnits\n- gasPriceSum, gasPriceCount
Reducer-->>Server: return UserOpStats[] (avgGasPrice computed)
Server-->>Browser: respond with aggregated UserOpStats[]
Browser->>Browser: transform per-day, select top chains, group "Others", build CSV
Browser->>Chart: render stacked bars, tooltips, metric toggles
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8442 +/- ##
=======================================
Coverage 54.83% 54.83%
=======================================
Files 919 919
Lines 60868 60868
Branches 4141 4141
=======================================
Hits 33375 33375
Misses 27391 27391
Partials 102 102
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx (1)
145-148: Consider more intuitive formatting for cost per gas unit.The micro-USD formatting (
$0.0001µ) may be confusing for users. Consider alternative representations:
- Scientific notation:
$1.00e-7- Milli-USD with more decimals:
$0.0001 (mUSD)- Simply higher precision USD:
$0.00000010
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
apps/dashboard/src/@/api/analytics.ts(2 hunks)apps/dashboard/src/@/types/analytics.ts(1 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx(1 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/aa-analytics.tsx(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-05-29T00:46:09.063Z
Learnt from: jnsdls
Repo: thirdweb-dev/js PR: 7188
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx:15-15
Timestamp: 2025-05-29T00:46:09.063Z
Learning: In the accounts component at apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx, the 3-column grid layout (md:grid-cols-3) is intentionally maintained even when rendering only one StatCard, as part of the design structure for this component.
Applied to files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsxapps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/aa-analytics.tsx
📚 Learning: 2025-07-10T10:18:33.238Z
Learnt from: arcoraven
Repo: thirdweb-dev/js PR: 7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Applied to files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsxapps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/aa-analytics.tsx
📚 Learning: 2025-06-10T00:50:20.795Z
Learnt from: MananTank
Repo: thirdweb-dev/js PR: 7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
Applied to files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx
🧬 Code graph analysis (3)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx (3)
apps/dashboard/src/@/types/analytics.ts (1)
UserOpStats(21-29)apps/dashboard/src/@/components/blocks/charts/bar-chart.tsx (1)
ThirdwebBarChart(49-125)apps/dashboard/src/@/components/blocks/ExportToCSVButton.tsx (1)
ExportToCSVButton(9-57)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/aa-analytics.tsx (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx (1)
GasMetricsChartCard(25-237)
apps/dashboard/src/@/api/analytics.ts (1)
apps/dashboard/src/@/types/analytics.ts (1)
UserOpStats(21-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Unit Tests
- GitHub Check: Size
- GitHub Check: Build Packages
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (13)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/aa-analytics.tsx (2)
14-14: LGTM!The import follows the existing pattern and is correctly placed with other chart card imports.
109-112: LGTM!The GasMetricsChartCard is correctly integrated with the appropriate props and follows the established pattern for chart cards in this layout.
apps/dashboard/src/@/types/analytics.ts (1)
26-27: LGTM!The new fields are properly typed and consistently integrated into the UserOpStats interface.
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx (7)
1-23: LGTM!Imports and type definitions are well-structured and appropriate for the component's functionality.
25-32: LGTM!Component props and state initialization are well-defined and sensible.
34-111: LGTM!The chart data processing logic is well-structured with proper safeguards:
- Division by zero is handled in the costPerGasUnit calculation (Line 53)
- Top chains aggregation with "Others" category is implemented correctly
- useMemo dependencies are appropriate
113-121: LGTM!The disableActions logic correctly handles all edge cases including pending state, empty data, and zero values.
201-212: LGTM!The CSV export logic correctly formats the data with proper headers and row values.
239-277: LGTM!The empty state component provides helpful guidance with documentation links across multiple platforms.
134-138: Verify with backend API documentation that avgGasPrice returns wei units.The code contains an explicit comment stating the conversion assumption ("Convert from wei to Gwei" at line 136), and the division by 1e9 is mathematically correct for wei→Gwei conversion. However, the backend API endpoint (v2/bundler/usage) is external and not present in this repository, so the unit assumption cannot be verified from the codebase. Confirm with your backend service documentation or team that avgGasPrice is indeed returned in wei units.
apps/dashboard/src/@/api/analytics.ts (3)
330-334: LGTM!The average gas price calculation is correct with proper division-by-zero protection.
337-344: LGTM!The return statement correctly excludes internal accumulator fields and returns only the public UserOpStats interface fields.
312-315: Verify if avgGasPrice from backend includes failed transactions.The backend provides a pre-calculated
avgGasPricewith eachUserOpStatsrecord (line 268, fetched from API). The frontend then re-weights these values at line 314:acc.gasPriceSum += curr.avgGasPrice * curr.successful; acc.gasPriceCount += curr.successful;This assumes each backend
avgGasPricerepresents only successful transactions. If the backend includes both successful and failed transactions in its calculation, the weight should be(curr.successful + curr.failed)instead ofcurr.successfulalone.Check the backend API response format or documentation to confirm the scope of
avgGasPrice—does it aggregate gas prices for all sponsored transactions or only successful ones?
...ject_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx
Show resolved
Hide resolved
size-limit report 📦
|
Added 'sponsoredTransactions' as a metric type to GasMetricsChartCard and removed the separate SponsoredTransactionsChartCard from aa-analytics.tsx. This simplifies the analytics UI by consolidating related metrics into a single chart component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx (1)
246-252: Fix type inconsistency in tooltip formatter.As previously noted,
ChartDatadefinestime: string(line 20), but line 248 casts it asnumber. This type mismatch should be corrected.Apply the fix from the previous review:
toolTipLabelFormatter={(_v, item) => { if (Array.isArray(item)) { - const time = item[0].payload.time as number; + const time = item[0].payload.time as string; return format(new Date(time), "MMM d, yyyy"); } return undefined; }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx(1 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/aa-analytics.tsx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/aa-analytics.tsx
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-05-29T00:46:09.063Z
Learnt from: jnsdls
Repo: thirdweb-dev/js PR: 7188
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx:15-15
Timestamp: 2025-05-29T00:46:09.063Z
Learning: In the accounts component at apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx, the 3-column grid layout (md:grid-cols-3) is intentionally maintained even when rendering only one StatCard, as part of the design structure for this component.
Applied to files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx
📚 Learning: 2025-07-10T10:18:33.238Z
Learnt from: arcoraven
Repo: thirdweb-dev/js PR: 7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Applied to files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx
🧬 Code graph analysis (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx (3)
apps/dashboard/src/@/types/analytics.ts (1)
UserOpStats(21-29)apps/dashboard/src/@/components/blocks/charts/bar-chart.tsx (1)
ThirdwebBarChart(49-125)apps/dashboard/src/@/components/blocks/ExportToCSVButton.tsx (1)
ExportToCSVButton(9-57)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx (2)
144-152: Verify thatavgGasPriceis provided in wei.The formatter divides
avgGasPriceby 1,000,000,000 to convert from wei to Gwei. This assumes the backend provides gas prices in wei (the standard smallest unit). If the backend uses a different unit (e.g., Gwei or wei expressed differently), the displayed values will be incorrect.Confirm the units used in the analytics API response. You can check the backend aggregation logic or add a comment documenting the expected unit:
avgGasPrice: { title: "Average Gas Price", description: "Average gas price in Gwei for sponsored transactions", fileName: "Average Gas Price", formatter: (value: number) => { // Backend provides avgGasPrice in wei; convert to Gwei for display const gwei = value / 1_000_000_000; return `${formatTickerNumber(gwei)} Gwei`; }, },
154-162: Verify micro-USD formatting convention.The formatter displays cost per gas unit in micro-USD (µUSD) by multiplying by 1,000,000. The notation
$${value}µis unconventional—typically micro-USD is written asµ$ormicroUSD.Consider using a more standard format for clarity:
formatter: (value: number) => { // Show in micro-USD for readability - return `$${(value * 1_000_000).toFixed(4)}µ`; + return `${(value * 1_000_000).toFixed(4)} µUSD`; },Or add a comment explaining the choice if
$...µis your preferred notation for design consistency.
| if (metricType === "sponsoredTransactions") { | ||
| value = stat.successful; | ||
| } else if (metricType === "gasUnits") { | ||
| value = stat.gasUnits; | ||
| } else if (metricType === "avgGasPrice") { | ||
| value = stat.avgGasPrice; | ||
| } else { | ||
| // costPerGasUnit: USD spent per gas unit (helps identify price spike impact) | ||
| value = stat.gasUnits > 0 ? stat.sponsoredUsd / stat.gasUnits : 0; | ||
| } | ||
|
|
||
| // if no data for current day - create new entry | ||
| if (!chartData) { | ||
| _chartDataMap.set(stat.date, { | ||
| time: stat.date, | ||
| [chainName]: value, | ||
| } as ChartData); | ||
| } else { | ||
| chartData[chainName] = (chartData[chainName] || 0) + value; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix aggregation logic for average-based metrics.
The accumulation logic at line 71 uses simple addition for all metric types. This is mathematically correct for cumulative metrics (sponsoredTransactions, gasUnits) but incorrect for average-based metrics (avgGasPrice, costPerGasUnit).
When multiple UserOpStats entries share the same date and chain, summing avgGasPrice values produces a meaningless result (e.g., 50 Gwei + 60 Gwei = 110 Gwei is not a valid average). Similarly, summing cost-per-unit ratios distorts the true cost efficiency.
For average metrics, you need weighted aggregation:
avgGasPrice: Track total gas price sum and transaction count, then dividecostPerGasUnit: Track totalsponsoredUsdand totalgasUnits, then divide
Consider this approach:
- let value: number;
- if (metricType === "sponsoredTransactions") {
- value = stat.successful;
- } else if (metricType === "gasUnits") {
- value = stat.gasUnits;
- } else if (metricType === "avgGasPrice") {
- value = stat.avgGasPrice;
- } else {
- // costPerGasUnit: USD spent per gas unit (helps identify price spike impact)
- value = stat.gasUnits > 0 ? stat.sponsoredUsd / stat.gasUnits : 0;
- }
+ // Store raw components for proper aggregation
+ const isSummableMetric = metricType === "sponsoredTransactions" || metricType === "gasUnits";Then handle accumulation differently:
if (!chartData) {
_chartDataMap.set(stat.date, {
time: stat.date,
- [chainName]: value,
+ [chainName]: isSummableMetric ? value : { sum: stat.sponsoredUsd, units: stat.gasUnits, count: stat.successful, gasPriceSum: stat.avgGasPrice * stat.successful },
} as ChartData);
} else {
- chartData[chainName] = (chartData[chainName] || 0) + value;
+ if (isSummableMetric) {
+ chartData[chainName] = (chartData[chainName] || 0) + value;
+ } else {
+ // Accumulate components for weighted average
+ const existing = chartData[chainName] || { sum: 0, units: 0, count: 0, gasPriceSum: 0 };
+ chartData[chainName] = {
+ sum: existing.sum + stat.sponsoredUsd,
+ units: existing.units + stat.gasUnits,
+ count: existing.count + stat.successful,
+ gasPriceSum: existing.gasPriceSum + (stat.avgGasPrice * stat.successful)
+ };
+ }
}Then compute final values after aggregation based on metricType.
Alternatively, if the backend guarantees unique date+chain combinations (one UserOpStats per date per chain), document this assumption clearly and add an assertion to catch violations early.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/GasMetricsChartCard.tsx
around lines 53 to 72, the code currently adds metric values naively which is
correct for cumulative metrics but wrong for average-based metrics; change the
aggregation to maintain weighted accumulators: for avgGasPrice store and sum
{totalGasPriceSum, txCount} (e.g., totalGasPriceSum += avgGasPrice * successful;
txCount += successful) and for costPerGasUnit store and sum {totalSponsoredUsd,
totalGasUnits} (totalSponsoredUsd += sponsoredUsd; totalGasUnits += gasUnits);
when creating a new chart entry initialize these accumulator fields, when
merging add to them instead of adding a single computed ratio, and after all
data is aggregated compute the final display value per date+chain by dividing
the appropriate totals based on metricType (avgGasPrice =
totalGasPriceSum/txCount, costPerGasUnit = totalSponsoredUsd/totalGasUnits),
with guards for zero counts; if the backend guarantees unique date+chain entries
either document that assumption or add an assertion to catch violations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/storyUtils.ts (1)
8-8: Fix double negative in comment.The comment contains "doesn't not have" which is a confusing double negative. It should read "does not have" or "doesn't have" instead.
Apply this diff:
- // don't use Math.floor because real data doesn't not have integer values + // don't use Math.floor because real data does not have integer values
🧹 Nitpick comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/storyUtils.ts (1)
12-13: Consider using integer values forgasUnits.In EVM chains, gas units are always integers. The current implementation generates fractional values, which may not accurately reflect real-world data. Consider applying
Math.floor()togasUnitsfor more realistic stub data.Apply this diff to generate integer gas units:
- const gasUnits = Math.random() * 1000000; // Random gas units between 0-1M + const gasUnits = Math.floor(Math.random() * 1000000); // Random gas units between 0-1MAdditionally, verify that the consuming code (GasMetricsChartCard and analytics API) correctly handles or formats gasUnits values, especially if it expects integers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/storyUtils.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/AccountAbstractionAnalytics/storyUtils.ts (1)
21-22: LGTM!The new
gasUnitsandavgGasPricefields are correctly added to the stubbed data object, matching the updatedUserOpStatstype definition.
Introduces a new GasMetricsChartCard component to visualize gas usage, average gas price, and cost efficiency across chains. Updates the analytics API and UserOpStats type to include gasUnits and avgGasPrice fields, and aggregates these metrics for display. Integrates the new chart into the account abstraction analytics page.
Closes BLD-460
PR-Codex overview
This PR enhances the analytics functionality by introducing gas metrics to track gas units and average gas prices for user operations. It modifies existing types, functions, and components to accommodate these new metrics.
Detailed summary
gasUnitsandavgGasPricetoUserOpStatsinanalytics.ts.gasUnitsandavgGasPriceinstoryUtils.ts.SponsoredTransactionsChartCardwithGasMetricsChartCardinaa-analytics.tsx.gasUnitsand averageavgGasPriceinanalytics.ts.GasMetricsChartCardcomponent to visualize gas metrics.Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.