Strategos | Architect of Capital
Important: Strategos is currently focused exclusively on Algorand wallets, Algorand assets (ALGO and ASAs), and Algorand DeFi protocols.
Portfolio intelligence platform for disciplined investors with Google login, multi-wallet linking, FIFO cost basis, transaction analytics, and DeFi estimates.
- Google OAuth sign-in (NextAuth + Prisma adapter)
- Link and verify multiple Algorand wallets (Pera Wallet flow + on-chain nonce note verification)
- Consolidated balances across wallets (ALGO + ASAs)
- FIFO cost basis and unrealized PnL
- Transaction table with filtering/search and explorer links
- Historical portfolio charts:
- Overview: aggregate transaction-based history
- Wallet Analytics tab: aggregate/per-wallet lines
- Metric toggle:
Total value (USD)orToken balance - Range toggle:
7D / 30D / 90D / Max
- DeFi positions (Tinyman/Folks/Reti adapter layer, best-effort detection)
- EN/ES language switch via structured JSON locales, dark-first UI, privacy hide-amounts mode
- User self-service account deletion from Settings
- Cost basis method: FIFO only.
- Fee policy:
- Buy: fee capitalized into lot cost.
- Sell: fee deducted from proceeds.
- Lot accounting uses historical tx-date prices only.
- Transaction display values can fall back to spot price if historical is missing, but FIFO lot cost basis does not use this fallback.
- Assets without pricing are shown as balances with
no priceand excluded from priced totals.
- Next.js 14 (App Router, TypeScript)
- Tailwind CSS
- NextAuth v4
- Prisma + PostgreSQL (Neon/Supabase compatible)
- TanStack Query
- Zod
- algosdk + Algorand Indexer/Algod
- Vitest
Client (Next.js app)
├── / Landing + Google sign-in
├── /dashboard Overview / Transactions / DeFi / Wallet Analytics / Settings
└── /wallets Pera connect + wallet verification + wallet removal
API (route handlers, auth-guarded)
├── /api/auth/[...nextauth]
├── /api/wallets/link
├── /api/wallets/verify
├── /api/wallets/list
├── /api/wallets/[walletId] DELETE
├── /api/portfolio/refresh
├── /api/portfolio/snapshot
├── /api/portfolio/history
└── /api/account DELETE
Core services
├── Indexer fetch + tx parsing
├── FIFO lot engine
├── Snapshot compute + persistence
├── Wallet analytics series builder
├── DeFi adapter aggregator
└── Security: same-origin checks + rate limiting + audit logs
src/
app/
api/
account/route.ts
auth/[...nextauth]/route.ts
portfolio/{refresh,snapshot,history}/route.ts
wallets/{link,list,verify}/route.ts
wallets/[walletId]/route.ts
dashboard/page.tsx
wallets/page.tsx
components/
auth-buttons.tsx
dashboard/dashboard-client.tsx
lib/
algorand/
defi/
portfolio/
lots.ts
parser.ts
snapshot.ts
history.ts
wallet-analytics.ts
price/provider.ts
auth.ts
env.ts
rate-limit.ts
tests/
locales/
en.json
es.json
- Node.js 18+
- PostgreSQL database
- Google OAuth credentials
- Algorand indexer/algod endpoints
npm install
cp .env.example .env.local
npx prisma db push
npm run devDATABASE_URLNEXTAUTH_URLNEXTAUTH_SECRETGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETALGORAND_INDEXER_URLALGORAND_VERIFICATION_RECEIVER
ALGORAND_INDEXER_TOKENALGORAND_ALGOD_URLALGORAND_ALGOD_TOKENPRICE_API_URLDEFI_LLAMA_PRICE_API_URLDEXSCREENER_PRICE_API_URLASA_PRICE_MAP_JSONTINYMAN_APP_IDSFOLKS_APP_IDSRETI_APP_IDSPUBLIC_RATE_LIMIT_WINDOW_MSPUBLIC_RATE_LIMIT_MAXINDEXER_TX_LIMITMANUAL_REFRESH_DAILY_MAXREFRESH_EXEMPT_EMAILCRON_SECRETNEXTAUTH_DEBUGNEXT_PUBLIC_BASE_URLNEXT_PUBLIC_SUPPORT_EMAIL
- No private keys or seed phrases are stored.
- Wallet ownership is verified on-chain.
- Mutating routes enforce same-origin checks.
- Public APIs are rate-limited.
- Account deletion removes user-linked data via relational cascade.
npm test
npm run buildStrategos uses semantic versioning with a practical release cadence:
patch: bug fixes and small UI/UX improvementsminor: additive features and non-breaking product incrementsmajor: strategic milestones or breaking changes (for example, major DeFi scope expansions)
Rules:
- Keep work under
## [Unreleased]while developing - Cut at most one release per UTC day
- Only cut a version when the deployment is stable and ready
Release helper commands:
npm run release:patch
npm run release:minor
npm run release:majorThe release script:
- blocks if a release already exists for today (UTC)
- moves
Unreleasedentries into a dated version section inCHANGELOG.md - bumps
package.jsonversion
- Set all required env vars in Vercel project.
- Ensure Google OAuth redirect URI:
https://<your-domain>/api/auth/callback/google
- Add custom domain in Vercel:
- Project -> Settings -> Domains -> add
<your-domain>
- Project -> Settings -> Domains -> add
- Set canonical base URL:
NEXT_PUBLIC_BASE_URL=https://<your-domain>
- Deploy:
vercel --prod- Configure daily automatic refresh:
vercel.jsonschedules/api/cron/daily-refreshat00:00 UTC- set
CRON_SECRETin Vercel so cron calls are authorized
- Manual refresh policy:
- users can manually refresh up to
MANUAL_REFRESH_DAILY_MAXtimes per UTC day (default: 2) REFRESH_EXEMPT_EMAILbypasses that daily manual limit
- Initialize database schema (first deploy):
npx prisma db pushDetailed runbook: docs/DEPLOYMENT.md.
Brand system reference: docs/BRANDING.md.
- DeFi adapters are intentionally best-effort and extensible.
- Historical pricing coverage depends on mappings/data availability.
- FIFO only (average-cost mode not implemented).
- Realized PnL summary card is intentionally hidden in top dashboard cards for now.