A factor-based portfolio management toolkit for DeFi trading. Think in terms of exposures (beta, momentum, carry) rather than individual positions.
See SPEC.md for the vision and ROADMAP.md for the path there.
Portfolio Rebalancer (/): Set positions by weight, adjust cross-account
leverage while maintaining proportions. Currently shows net notional exposure;
beta-aware hedging coming soon.
Design Reference (/prototype): Interactive mockup of the target UI/UX.
| Layer | Technology | Status |
|---|---|---|
| Frontend | TypeScript + SolidJS | Active |
| Backend | Rust | Building |
| Legacy Backend | Python | Being replaced |
The frontend holds credentials and executes trades directly to venues. The backend provides analytics and execution plans but never touches credentials.
- Nix with flakes enabled
- Direnv (recommended)
git clone https://github.com/data-cartel/moneymentum.git
cd moneymentum
direnv allow # or: nix developcd frontend
bun run dev # http://localhost:5173python server.py # FastAPI on port 8000# Frontend (from frontend/)
bun run typecheck
bun run lint
bun run test
# Legacy Python
ruff check .
ruff format .
pytest
# Pre-commit (must pass)
pre-commit run -aLaunch agents directly via nix develop rather than relying on direnv:
# Example with Claude Code
nix develop --impure -c claudeThis avoids occasional shell initialization quirks that can occur when agents are spawned in a direnv-managed shell.
All dependencies managed through Nix. Do not use pip install or bun install directly.
Terraform provisions the server, then NixOS is bootstrapped onto it.
# Create and encrypt terraform variables
nix run .#tfCreateVars
# Initialize terraform
nix run .#tfInit
# Plan and apply infrastructure
nix run .#tfPlan
nix run .#tfApply
# Bootstrap NixOS on the provisioned server
nix run .#bootstrap# SSH into the server
nix run .#remote
# Edit terraform variables
nix run .#tfEditVars
# Destroy infrastructure
nix run .#tfDestroyAll infrastructure commands use age-encrypted state files. The -i flag can be
passed to specify a custom SSH identity file (defaults to ~/.ssh/id_ed25519).
