Skip to content

feat: add analytics to Liquidity Hub feature - #5765

Open
therealemjy wants to merge 2 commits into
feat/liquidity-hub-apifrom
feat/liquidity-hub-analytics
Open

feat: add analytics to Liquidity Hub feature#5765
therealemjy wants to merge 2 commits into
feat/liquidity-hub-apifrom
feat/liquidity-hub-analytics

Conversation

@therealemjy

Copy link
Copy Markdown
Member

Changes

  • add analytics to Liquidity Hub feature

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 21e7af1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Aug 4, 2026 1:47pm
dapp-testnet Ready Ready Preview Aug 4, 2026 1:47pm
venus.io Ready Ready Preview Aug 4, 2026 1:47pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

Adds analytics across Liquidity Hub navigation, amount entry, and transaction lifecycle events, with tests covering the new instrumentation.

  • Tracks hub selection from navigation, dashboard cards, placeholders, and the hub table.
  • Records supply and withdrawal amount, initiation, signature, rejection, and confirmation events.
  • Adds pathname metadata to page views and displays borrow availability using the lesser of the configured cap and market liquidity.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified.

The added instrumentation preserves existing navigation and transaction behavior, and the borrow-cap display now consistently reflects both the protocol cap and available market liquidity.

Important Files Changed

Filename Overview
apps/evm/src/libs/analytics/useAnalytics/types.ts Extends the typed analytics event map for Liquidity Hub navigation, selection, funding sources, and amount events.
apps/evm/src/containers/LiquidityHubForm/Form/index.tsx Exposes amount-entry and maximum-selection callbacks without changing form validation or submission behavior.
apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithWalletForm/index.tsx Adds wallet-funded supply analytics around amount changes and transaction signing while preserving the existing mutation flow.
apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithCollateralForm/index.tsx Adds collateral-migration supply analytics with funding-source attribution and rejection tracking.
apps/evm/src/containers/LiquidityHubForm/WithdrawForm/index.tsx Adds withdrawal amount and transaction-lifecycle analytics without changing withdrawal inputs.
apps/evm/src/clients/api/mutations/useSupplyToLiquidityHub/index.ts Records confirmed wallet supplies before performing the existing Liquidity Hub cache invalidations.
apps/evm/src/clients/api/mutations/useMigrateCoreSupplyToLiquidityHub/index.ts Records confirmed collateral migrations with normalized token amounts and funding-source attribution.
apps/evm/src/clients/api/mutations/useWithdrawFromLiquidityHub/index.ts Records confirmed withdrawals, including whether the full supply was redeemed.
apps/evm/src/containers/Layout/NavBar/MenuItem/index.tsx Invokes item-specific analytics callbacks before retaining the existing menu-closing behavior.
apps/evm/src/pages/LiquidityHubs/LiquidityHubTable/index.tsx Tracks both hub-row navigation and row-control modal selection.
apps/evm/src/pages/Market/MarketHistory/index.tsx Caps the displayed total-borrow threshold at the amount reachable from current borrows plus available market cash.

Reviews (1): Last reviewed commit: 2c4b91b | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c4b91ba65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/evm/src/pages/Dashboard/Hubs/LiquidityHubCard/index.tsx
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 81.32% 53075 / 65261
🔵 Statements 81.32% 53075 / 65261
🔵 Functions 74.66% 1612 / 2159
🔵 Branches 86.07% 7771 / 9028
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/clients/api/mutations/useMigrateCoreSupplyToLiquidityHub/index.ts 90.4% 80% 100% 90.4% 52-69
apps/evm/src/clients/api/mutations/useSupplyToLiquidityHub/index.ts 100% 100% 100% 100%
apps/evm/src/clients/api/mutations/useWithdrawFromLiquidityHub/index.ts 94.62% 87.5% 100% 94.62% 41-45
apps/evm/src/containers/Layout/NavBar/MenuItem/index.tsx 88.77% 76.19% 42.85% 88.77% 70-72, 87-93, 124-126, 132
apps/evm/src/containers/Layout/NavBar/useMenuItems/index.tsx 96.62% 90% 100% 96.62% 83-87
apps/evm/src/containers/LiquidityHubForm/Form/index.tsx 97.72% 96.29% 75% 97.72% 138-141
apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithCollateralForm/index.tsx 100% 100% 100% 100%
apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithWalletForm/index.tsx 98.59% 89.47% 100% 98.59% 88-89
apps/evm/src/containers/LiquidityHubForm/WithdrawForm/index.tsx 96.74% 68.75% 100% 96.74% 48-49, 77, 125
apps/evm/src/libs/analytics/AnalyticProvider/RouteChangeTracker/index.tsx 28.57% 100% 0% 28.57% 6-17
apps/evm/src/pages/Dashboard/Hubs/index.tsx 100% 80% 100% 100%
apps/evm/src/pages/Dashboard/Hubs/LiquidityHubCard/index.tsx 100% 76.92% 75% 100%
apps/evm/src/pages/Dashboard/Placeholder/index.tsx 100% 50% 100% 100%
apps/evm/src/pages/Dashboard/PositionCardsTab/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Dashboard/PreviewCard/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/LiquidityHubs/LiquidityHubTable/index.tsx 84.49% 72.22% 68.75% 84.49% 55-60, 69-70, 72-73, 78, 95, 140-152, 174, 228-231
Generated in workflow #14038 for commit 21e7af1 by the Vitest Coverage Report Action

@cuzz-venus cuzz-venus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants