StealThis .dev

Web3 — Liquidity Pool / Provide LP

A DeFi provide-liquidity component for an ETH/USDC pair with ratio-linked deposit inputs that auto-fill from the mock pool price, wallet balances with MAX buttons, a fee-tier selector (0.05/0.3/1%) that re-animates TVL, volume, and fee-APR stats, plus live pool-share and LP-token estimates. Includes Add and Remove tabs with a percent slider, a position summary card, and a sign-pending-success confirmation modal with an impermanent-loss warning and toast feedback.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Liquidity Pool / Provide LP

A glassy, dark-first “provide liquidity” widget for a fictional ETH/USDC pool on Lumen Chain. The two deposit inputs are ratio-linked: type into either one and the other auto-fills from the mock pool price (1 ETH = 2,584.30 USDC). Each input shows the wallet balance with a MAX shortcut and a live fiat estimate, while the summary below recomputes your pool share, estimated LUM-LP tokens minted, and the fee-APR projection on every keystroke. A three-card fee-tier selector (0.05% / 0.3% / 1%) swaps in per-tier TVL, 24h volume, and fee stats with animated count-ups.

The card is split into Add and Remove tabs with a sliding glider. The Remove tab drives everything from a percent slider with 25/50/75/MAX presets, previewing the exact ETH, USDC, and burned LP amounts plus auto-collected fees. A sidebar position card tracks your pooled tokens, LP balance, pool share, lifetime fees, and a fee-APR bar compared to the pool average.

Pressing Add or Remove opens a three-step confirmation modal — review with an impermanent-loss warning, a simulated wallet-signing pending state with a fake transaction hash, then a success step that updates balances and the position and fires a toast. Everything is keyboard-accessible: Escape closes the modal, focus rings are visible, and the panel collapses cleanly down to 360px.

UI-only simulation — no real wallet, RPC, or on-chain calls. Mock data, fictional tokens.