Local-first + edge proxy

Data stays on the device — only prices flow through the edge.

FolioSpan stores your portfolio lots on the phone while market quotes, read-only chain queries, and Folio AI traffic pass through a stateless Cloudflare Workers gateway.

1. Local vault

Lots, transactions, wallet addresses, and price alerts live in the on-device SQLite database; credentials are protected by iOS Keychain / Android Keystore.

SQLite + SecureStore • Offline-first

2. Stateless edge proxy

CoinGecko, Yahoo Finance, FMP, Finnhub, chain RPC endpoints, and the AI gateway secret never reach the client. Folio AI requests carry your Firebase sign-in; market and chain routes are rate-limited per IP.

/v1/market • /v1/chain • /v1/folio-ai

3. On-device computation

Net worth, 24h change, unrealized P/L, and 20+ currency conversions are computed on-device — offline capable by design.

Zero-PII • Offline capable

Local data schema overview

holdings Cost-basis FIFO / average lots
synced_wallets Read-only public addresses only
transactions Koinly & yearly CSV export records
price_alerts Price and portfolio drawdown rules