mercury-stellar-backend contains the complete Next.js frontend and its API routes.
Screens
Pro is the default persisted application mode. Lite guards hide or redirect advanced screens such as Earn. A visible pool card is not proof of an enabled controller route: Aquarius configuration also contains an XLM/USDT pool for display, whereas configured lending markets remain the four documented assets.
Wallets and state
Freighter is supported directly. Privy email/Google embedded-wallet login is conditional onNEXT_PUBLIC_PRIVY_APP_ID and provider readiness. LOBSTR and xBull do not have implemented adapters in this build.
Zustand stores hold wallet, UI mode, selections, and transaction progress. TanStack Query and ledger-driven hooks refresh data. Lite positions are reconstructed from chain through lib/lite-positions.ts; original leverage, opening time, and cost basis cannot always be recovered and should not be represented as exact history.
APIs
Data limitations
Do not label every Analytics chart live. Single-asset, multi-asset crash, and leverage-concentration scenario pages import fixture datasets; oracle and alert pages have fallback/mock paths. The Margin summary currently initializes realized P&L to zero until cost-basis accounting is wired. Derived equity is not realized profit.Copilot integration
lib/copilot includes intent routing, planning, asset readiness, plan sanitization, approval checks, wallet binding, conditional guards, write deduplication, and execution receipts. Configured MCP and signing services live outside this repository. Browser user consent is required to add a Vanna signer to a Privy wallet; the user’s ownership is retained. Presence of these code paths does not prove the external services are configured or available.
Source reference
mercury-stellar-backend/appmercury-stellar-backend/lib/constants.tsmercury-stellar-backend/lib/lite-positions.tsmercury-stellar-backend/lib/wallet-adapter.tsmercury-stellar-backend/lib/copilot/config.ts

