
Stavlos
Simulation-only DeFi yield analytics for cross-chain stablecoin lending, with risk-adjusted yields.
Demo
About
Stavlos is an institutional-grade, simulation-only DeFi yield analytics platform designed to analyze and optimize cross-chain stablecoin lending opportunities. It tracks stablecoins such as USDC, USDT, DAI, USDS, and USDe across major DeFi protocols including Aave, Compound, Morpho, and Spark. The platform ingests yield and protocol data from DeFiLlama, validates and normalizes the data, filters pools based on liquidity and stability criteria, and stores historical yield observations in an idempotent SQLite time-series database. The core of Stavlos is a quantitative risk-scoring engine that risk-adjusts nominal APYs using multiple factors, including TVL/liquidity depth, protocol age, APY volatility, blockchain security tiers, and bridge friction. It provides deterministic risk grades and plain-English explanations so users can understand why a particular lending pool receives its score. A historical backtesting engine then simulates capital rotation between opportunities while accounting for gas costs, bridge fees, minimum holding periods, slippage, and churn penalties, allowing strategies to be compared against a static benchmark. The project also includes a FastAPI analytical backend and a Next.js dashboard with sortable pool rankings, historical APY charts, quantitative audit information, and interactive 180-day backtest visualizations. An advisory alerting system monitors sudden TVL contractions, abnormal APY increases, and risk-grade changes and can dispatch alerts through console, database, or webhook channels. Stavlos is deliberately non-custodial and simulation-only: it does not contain private keys, request transaction signatures, or broadcast transactions. Its Web3 integration is read-only, using standard JSON-RPC calls to inspect stablecoin balances across multiple chains and compare idle wallet assets with risk-adjusted lending opportunities. Overall, the project combines data engineering, quantitative finance, DeFi analytics, backtesting, Web3 infrastructure, and full-stack development into a single production-oriented research platform.
How it's made
Stavlos was built as a modular Python + Next.js system, with a strong focus on quantitative analysis, data reliability, and non-custodial Web3 architecture. The backend is written in Python using FastAPI, Pydantic, Pandas, NumPy, and SQLite. The frontend uses Next.js 14 with the App Router and Recharts to provide an interactive analytics dashboard. The data pipeline starts with DeFiLlama’s yields API, accessed through an HTTPX-based ingestion client with Tenacity-powered retries and jittered exponential backoff. Incoming pool data is validated and normalized with Pydantic, filtered for supported stablecoins and sufficient TVL, deduplicated, and persisted into a WAL-enabled SQLite time-series database through an idempotent repository layer. On top of this data layer, I built a deterministic risk-scoring engine that applies penalties for TVL, protocol age, APY volatility, chain security, and bridge friction. A historical backtesting engine then replays multi-month yield data and simulates portfolio rotation while accounting for gas costs, bridge fees, slippage, minimum holding periods, and churn penalties. The results are exposed through FastAPI and visualized in the Next.js dashboard. The Web3 layer uses Viem and standard EIP-1193/JSON-RPC `eth_call` requests to inspect stablecoin balances across Ethereum, Arbitrum, Optimism, Base, and Sepolia. The integration deliberately has no private keys, signing, or transaction broadcasting, making the system fully read-only and non-custodial. A particularly notable engineering choice was keeping the entire strategy simulation deterministic and auditable rather than simply ranking APYs. The platform can explain why a yield is considered attractive, replay historical decisions, calculate net performance after realistic friction, and generate advisory alerts for TVL contractions, APY spikes, and risk-grade changes. This turns raw DeFi yield data into an end-to-end research, risk, simulation, and monitoring pipeline.