On-chain
One program. Instruction handlers ininstructions/*.rs. Pure math in math/. Validation in validation/.
scan_and_validate_positions rebuilds the set. A missing debt account fails closed.
Application
Backend-Solana is Next.js: React UI, TanStack-style hooks, Zustand stores, Anchor client, Privy optional.
Browser RPC is
NEXT_PUBLIC_SOLANA_RPC_URL (hosted: https://rpc-devnet.solana.vanna.finance). Server routes use FORK_RPC_URL on loopback when the app and Surfpool share a VM. Despite the devnet hostname, this is a Surfpool mainnet fork, not the public Solana Devnet cluster.
Boundaries
- Earn vTokens ≠ margin collateral
- Perps are recipes on top of borrow + swap, not a second program
- Fork cheatcodes are not mainnet
- Source support ≠ a verified public-mainnet deployment

