How kk666679/defi-amm works
PayFlow is a hybrid-wallet and DeFi AMM demo: users enter the app, connect an injected wallet, and use swap or liquidity screens against a local chain. The visible PayFlow dashboard also presents balances and navigation; sampled swap and pool screens contain demonstration data, so their displayed quotes and pool listings are not evidence of live AMM calls. The README documents the intended wallet-to-chain path and AMM capabilities, but the contract sources are absent from the supplied tree. Several wallet-route and shared-component implementations were indexed as read but not excerpted, so their internal wiring is omitted.
Main entry points: layout.tsx Wallet Shell · PayFlowApp.tsx PayFlow Shell · app/page.tsx AMM Landing · wallet/page.tsx Wallet Dashboard
Components 22
App and Wallet
- AMM Landing
frontend/app/page.tsx - Wallet Shell
frontend/app/wallet/layout.tsx - Wallet Dashboard
frontend/app/wallet/page.tsx - Wallet Pools
frontend/app/wallet/pools/page.tsx - Wallet Swap
frontend/app/wallet/swap/page.tsx - Wallet Bar
frontend/components/WalletBar.tsx - Swap Card
frontend/components/SwapCard.tsx - Reserve Display
frontend/components/ReservesDisplay.tsx
PayFlow Screens
- PayFlow Route
frontend/app/payflow/page.tsx - PayFlow Shell
frontend/app/payflow/PayFlowApp.tsx - Balance Home
frontend/app/payflow/components/HomePage.tsx - Swap Screen
frontend/app/payflow/components/SwapPage.tsx - Pool Screen
frontend/app/payflow/components/PoolsPage.tsx - Screen Data
frontend/app/payflow/data.ts
Web3 Runtime
- Web3 Providers
frontend/app/providers.tsx - Wallet Config
frontend/app/wagmi.ts - Contract ABI
frontend/lib/abi.ts - Injected Wallet
AMM Chain
- Local Hardhat Chain
- Constant-Product AMM
- Pool Tokens
Other components
- User
Connections 22
- User → AMM Landing: opens
- User → PayFlow Route: opens
- PayFlow Route → PayFlow Shell: renders
- PayFlow Shell → Balance Home: renders
frontend/app/payflow/PayFlowApp.tsx - PayFlow Shell → Swap Screen: renders
frontend/app/payflow/PayFlowApp.tsx - PayFlow Shell → Pool Screen: renders
frontend/app/payflow/PayFlowApp.tsx - Swap Screen → Screen Data: reads quote data
frontend/app/payflow/components/SwapPage.tsx - Pool Screen → Screen Data: reads pool data
frontend/app/payflow/components/PoolsPage.tsx - AMM Landing → Web3 Providers: uses
- Wallet Shell → Wallet Dashboard: frames
- Wallet Shell → Wallet Pools: frames
- Wallet Shell → Wallet Swap: frames
- Wallet Shell → Wallet Bar: uses
- Wallet Swap → Swap Card: uses
- Wallet Dashboard → Reserve Display: uses
- Web3 Providers → Wallet Config: configures
frontend/app/layout.tsx - Wallet Config → Injected Wallet: connects injected
- Injected Wallet → Local Hardhat Chain: sends JSON-RPC
- Local Hardhat Chain → Constant-Product AMM: hosts
- Constant-Product AMM → Pool Tokens: uses reserves
- Swap Card → Contract ABI: uses contract interface
- Reserve Display → Contract ABI: uses contract interface