feat: liquidity hub analytics - #5813
cuzz-venus wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 40b72d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds Liquidity Hub analytics across navigation, hub selection, amount entry, transaction submission, confirmation, and dashboard entry points. It also enriches page-view events with pathname data and extends typed analytics payloads.
Confidence Score: 4/5The PR appears safe to merge from a runtime perspective, but the two non-blocking analytics correctness issues should be addressed to avoid misleading Liquidity Hub reporting. Transaction behavior remains intact, but fallback withdrawals can be classified incorrectly and debounced amount events can arrive after later funnel stages. Files Needing Attention: apps/evm/src/clients/api/mutations/useWithdrawFromLiquidityHub/index.ts; apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithWalletForm/index.tsx
|
| Filename | Overview |
|---|---|
| apps/evm/src/clients/api/mutations/useWithdrawFromLiquidityHub/index.ts | Adds confirmed-withdrawal analytics, but classifies fallback partial withdrawals as full exits. |
| apps/evm/src/clients/api/mutations/useMigrateCoreSupplyToLiquidityHub/index.ts | Adds confirmed migration analytics and a required underlying-amount input. |
| apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithWalletForm/index.tsx | Adds amount-entry and transaction-lifecycle analytics, with delayed amount events that can arrive out of order. |
| apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithCollateralForm/index.tsx | Adds funding-source-aware analytics to Core Pool migration and amount selection. |
| apps/evm/src/containers/LiquidityHubForm/WithdrawForm/index.tsx | Adds withdrawal funnel analytics and amount-selection tracking. |
| apps/evm/src/pages/LiquidityHubs/LiquidityHubTable/index.tsx | Tracks hub selection through both row navigation and modal controls while preserving propagation behavior. |
| apps/evm/src/libs/analytics/useAnalytics/types.ts | Extends typed event contracts for Liquidity Hub navigation, selection, and funding sources. |
Reviews (1): Last reviewed commit: "feat: support liquidity hub analytics" | Re-trigger Greptile
| token: input.liquidityHub.vhToken.underlyingToken, | ||
| value: input.amountMantissa, | ||
| }).toNumber(), | ||
| withdrewFullSupply: input.withdrawFullSupply === true, |
There was a problem hiding this comment.
When a full withdrawal is requested but the hub cannot redeem the complete vhToken balance, the transaction falls back to a partial withdraw call. This event still sets withdrewFullSupply to true from the original request, so analytics incorrectly records the partial withdrawal as a full exit.
Knowledge Base Used: Liquidity hub operations
| captureAnalyticEvent( | ||
| 'supply_amount_set', | ||
| { | ||
| ...getAnalyticData(amountTokens), | ||
| maxSelected, | ||
| }, | ||
| { | ||
| debounced: true, | ||
| }, | ||
| ); |
There was a problem hiding this comment.
The amount event is delayed by 900 ms, while submission immediately records the initiated and signed events and may then close the modal without flushing or cancelling the pending callback. If a user enters an amount and submits within that window, supply_amount_set can be recorded after the later funnel stages, making analytics ordering depend on transaction latency. The collateral-supply and withdrawal forms use the same pattern.
Knowledge Base Used:
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
945ed11 to
e40365c
Compare
Instrument the Liquidity Hub funnel defined in the New Event Taxonomy: hub_navigation, hub_selected, the supply funnel (amount_set, initiated, rejected, signed, Tokens supplied) and the withdrawal funnel, all tagged with poolName liquidity_hub. Supplies also carry fundingSource to separate new capital from Core pool collateral being reallocated. Also send $pathname alongside $pageview so Hub list views can be isolated in PostHog.
e40365c to
40b72d1
Compare
Jira ticket(s)
VPD-1740
Changes