Production-ready FastAPI backend for Valthera infrastructure, AI routing, portfolio data, and quote provider orchestration.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reloadWindows PowerShell:
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn app.main:app --reloadDocker:
docker compose upCopy .env.example to .env.
Key settings:
APP_ENVAPP_NAMEAPP_VERSIONHOSTPORTAI_ENGINE_BASE_URLREDIS_URLDATABASE_URLLOG_LEVELQUOTE_CACHE_TTLCORS_ORIGINS
Primary API prefix:
/api/v1
Endpoints:
GET /api/v1/healthGET /api/v1/portfolio/{address}GET /api/v1/quotePOST /api/v1/ai/analyze-portfolioPOST /api/v1/ai/analyze-token
Temporary MVP compatibility paths remain available under /v1.
curl "http://localhost:8000/api/v1/quote?chain_id=1&token_in=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&token_out=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&amount_in=1.5&slippage_bps=50"The quote layer uses a provider abstraction with priority:
- Uniswap V3 Quoter
- 0x API
- 1inch
Provider fallback and TTL quote caching are implemented. The current provider adapters are quote-only and do not build or submit transactions.
make test
make lint
make typecheck
make checkPre-commit:
pre-commit install
pre-commit run --all-filesNo private keys, paid provider keys, transaction signing, transaction building, or transaction submission are included. Rate limiting and input validation are enabled.
docs/Architecture.mddocs/Providers.mddocs/API.md