Architecture
How the app is put together. Modules, who calls whom, and where each kind of state lives.
Five rules
- The API is the source of truthopenapi.yamlschema.d.ts·GET /configchain · contracts · limits
- Amounts are bigint"1.5"1500000n"1500000" 1.5 (float)
- Private data stays in the workerkeys · notesworkernever →ReactstorageURL
- Every async step is a stateIdlePreparingConfirm in walletPendingSuccess
- We own the look--pl-*Base UI
Modules
Routes
Features
Shared libraries
Outside the app
swapsrc/features/swap
Quote, slippage, impact tiers, the swap button and the send flow.
Calls: 8← 4
Where state lives
- Config, tokens, prices, balances, quotes, orders, historyTanStack Query cache
- Latest block and stream healthZustand (memory)
- Pair and amount being typedURLZustand (memory)
- Slippage, deadline, expert mode, sourceslocalStorage
- Last pair and recent pairslocalStorage
- Transaction progressComponent reducer
- Connected account and chainwagmi
- Private keys, notes, nullifiersSDK worker + encrypted IndexedDB