Skip to content

feat: complete Liquidity Hub form component#5689

Open
therealemjy wants to merge 1 commit into
feat/liquidity-hub-formsfrom
feat/liquidity-hub-form-validation
Open

feat: complete Liquidity Hub form component#5689
therealemjy wants to merge 1 commit into
feat/liquidity-hub-formsfrom
feat/liquidity-hub-form-validation

Conversation

@therealemjy

@therealemjy therealemjy commented Jul 16, 2026

Copy link
Copy Markdown
Member

Jira ticket(s)

VPD-1560

Changes

  • add Liquidity Hub form scaffolding, including the row-action modal and Supply/Withdraw tabs
  • implement the initial “Supply with collateral” flow with Safe Max, spending-limit display, and token approval support
  • introduce shared wallet-balance and collateral-withdrawal limit utilities reused across existing flows
  • add supporting contract configuration, token handling, translations, and targeted tests

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 03cd6c5

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 Jul 16, 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 Jul 16, 2026 12:29pm
dapp-testnet Ready Ready Preview Jul 16, 2026 12:29pm
venus.io Ready Ready Preview Jul 16, 2026 12:29pm

Request Review

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 83.2% 51977 / 62467
🔵 Statements 83.2% 51977 / 62467
🔵 Functions 63.45% 684 / 1078
🔵 Branches 72.94% 5981 / 8199
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/components/BalanceUpdates/index.tsx 100% 90% 100% 100%
apps/evm/src/components/BalanceUpdates/getAssetBalanceUpdate/index.ts 97.29% 84.61% 100% 97.29% 4
apps/evm/src/components/BalanceUpdates/getLiquidityHubBalanceUpdate/index.ts 96% 66.66% 100% 96% 4
apps/evm/src/components/LabeledInlineContent/index.tsx 97.61% 81.81% 100% 97.61% 52
apps/evm/src/containers/AccountLiquidityHubDailyEarnings/index.tsx 100% 50% 100% 100%
apps/evm/src/containers/AccountLiquidityHubDailyEarnings/formatToReadableDailyEarnings/index.ts 91.66% 33.33% 100% 91.66% 1
apps/evm/src/containers/AccountPoolDailyEarnings/index.tsx 100% 50% 100% 100%
apps/evm/src/containers/AccountPoolDailyEarnings/formatToReadableDailyEarnings/index.ts 85.71% 0% 100% 85.71% 2
apps/evm/src/containers/AccountPoolHealth/index.tsx 97.56% 77.77% 100% 97.56% 50
apps/evm/src/containers/LiquidityHubForm/Form/index.tsx 97.87% 85.71% 66.66% 97.87% 107-109
apps/evm/src/containers/LiquidityHubForm/Form/useForm/index.tsx 89.13% 40% 100% 89.13% 3, 92-96
apps/evm/src/containers/LiquidityHubForm/Form/useForm/useFormValidation/index.ts 97.91% 91.66% 100% 97.91% 1
apps/evm/src/containers/LiquidityHubForm/Form/useForm/useFormValidation/validateCommonCases/index.ts 0% 100% 100% 0% 7-28
apps/evm/src/containers/LiquidityHubForm/SupplyTabs/index.tsx 100% 88.88% 100% 100%
apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithCollateralForm/index.tsx 100% 92.85% 100% 100%
apps/evm/src/containers/MarketForm/ApyBreakdown/index.tsx 100% 96.66% 100% 100%
apps/evm/src/containers/MarketForm/BoostForm/index.tsx 94.4% 91.56% 84.61% 94.4% 150-153, 274-284, 315-324
apps/evm/src/containers/MarketForm/BorrowForm/index.tsx 92.92% 82.35% 85.71% 92.92% 101-104, 240-256
apps/evm/src/containers/MarketForm/BorrowForm/useForm/useFormValidation.ts 98.11% 92.3% 100% 98.11% 1
apps/evm/src/containers/MarketForm/Footer/index.tsx 100% 83.33% 100% 100%
apps/evm/src/containers/MarketForm/OperationDetails/index.tsx 89.18% 33.33% 100% 89.18% 31-35
apps/evm/src/containers/MarketForm/Repay/RepayWithCollateralForm/index.tsx 96.56% 93.54% 90% 96.56% 167-170, 303-313, 382
apps/evm/src/containers/MarketForm/Repay/RepayWithWalletBalanceForm/index.tsx 97.44% 91.08% 87.5% 97.44% 99, 185, 475-485, 498
apps/evm/src/containers/MarketForm/Repay/RepayWithWalletBalanceForm/useForm/useFormValidation/index.ts 91.3% 88.23% 100% 91.3% 1, 91-96
apps/evm/src/containers/MarketForm/SupplyForm/index.tsx 90.86% 85.71% 77.77% 90.86% 102, 196, 334-349, 360-361, 386-387, 444-454, 469, 508-511
apps/evm/src/containers/MarketForm/SupplyForm/useForm/useFormValidation.ts 98.63% 93.75% 100% 98.63% 1
apps/evm/src/containers/MarketForm/WithdrawForm/index.tsx 92.35% 89.09% 88.88% 92.35% 83-86, 186-202, 226, 410-415
apps/evm/src/hooks/useSimulateLiquidityHubMutations/index.ts 98.5% 85.71% 100% 98.5% 1
apps/evm/src/pages/Trade/PositionForm/Form/useFormValidation/index.tsx 99.33% 98.43% 100% 99.33% 1
apps/evm/src/pages/Vai/Borrow/index.tsx 95.16% 83.72% 100% 95.16% 64, 86-87, 102, 112, 201-205, 222-223
apps/evm/src/pages/Vai/Repay/index.tsx 94.68% 52.94% 100% 94.68% 62-63, 130-134, 157-158, 166-168
apps/evm/src/types/index.ts 100% 100% 100% 100%
apps/evm/src/utilities/index.ts 98.73% 0% 100% 98.73% 1
apps/evm/src/utilities/shouldShowAccountHealth/index.ts 100% 0% 100% 100%
apps/evm/src/utilities/validateLiquidityHubBalanceMutations/index.ts 98.71% 94.73% 100% 98.71% 5
Generated in workflow #13837 for commit 03cd6c5 by the Vitest Coverage Report Action

@therealemjy
therealemjy force-pushed the feat/liquidity-hub-form-validation branch from 595d7b5 to 1dd1fd0 Compare July 16, 2026 09:48
@therealemjy therealemjy changed the title feat: add validation to liquidity hub form component feat: complete Liquidity Hub form component Jul 16, 2026
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR completes the Liquidity Hub form structure and adds its first collateral-supply flow. The main changes are:

  • Supply and withdraw tab scaffolding with approval and spending-limit UI.
  • Pool and Liquidity Hub balance simulation and validation.
  • Shared account-health, earnings, balance, and withdrawal-limit utilities.
  • Supporting token configuration, translations, and tests.

Confidence Score: 4/5

The collateral-supply path is not safe to merge while submission is a no-op and live validation uses mock hub state.

  • A successful form submission clears the input without sending a transaction.
  • Fixed fixture data can disagree with production balances and caps.
  • Multiple supplies to one hub can pass cap checks independently while exceeding the cap together.

SupplyWithCollateralForm/index.tsx, LiquidityHubForm/Form/index.tsx, and validateLiquidityHubBalanceMutations/index.ts

Important Files Changed

Filename Overview
apps/evm/src/containers/LiquidityHubForm/SupplyTabs/SupplyWithCollateralForm/index.tsx Builds the collateral-supply model and approval flow, but submission currently performs no transaction.
apps/evm/src/containers/LiquidityHubForm/Form/index.tsx Composes the new form simulations and account data, but uses mock Liquidity Hub state in the live flow.
apps/evm/src/utilities/validateLiquidityHubBalanceMutations/index.ts Adds cap, liquidity, and user-balance checks without accumulating multiple mutations for the same hub.
apps/evm/src/hooks/useSimulateLiquidityHubMutations/index.ts Sequentially simulates matching Liquidity Hub supplies and withdrawals.
apps/evm/src/utilities/validatePoolBalanceMutations/index.ts Centralizes existing pool cap, liquidity, balance, price-impact, and health validation.
apps/evm/src/components/BalanceUpdates/index.tsx Extends balance updates to support both pool assets and Liquidity Hub positions.

Reviews (1): Last reviewed commit: "feat: complete Liquidity Hub form compon..." | Re-trigger Greptile

Comment thread apps/evm/src/containers/LiquidityHubForm/Form/index.tsx

@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: 03cd6c5f01

ℹ️ 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/containers/LiquidityHubForm/Form/index.tsx
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.

1 participant