尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Stop-loss stress test of one day of hourly ETH data against illustrative Aave V3 and Morpho parameters.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Live: summer-fi-risk-analysis.vercel.app
This is an independent portfolio case study. A small Python model replays 24 hourly ETH price and gas observations for 5 August 2024 against static stop-loss buffers. It uses illustrative Aave V3 and Morpho parameters. A Next.js page lets a reader change the market, entry LTV and buffer and see the outcome. The repository is not affiliated with Summer.fi, Aave or Morpho.
All numbers come from data/aug_5_crash_data.csv and reports/sweep_results.csv.
scripts/risk_model.py holds a DeFiRiskModel. At each hourly row it computes LTV as debt / (collateral x price). It checks the liquidation threshold first, then the stop-loss trigger (threshold minus buffer). Gas does not change LTV. It adds slippage (0.1% + gas/100 x 0.5%, capped at 5%) and a fixed 300,000-gas cost to the modeled exit value. Only a static strategy exists. web-showcase/src/app/riskModel.ts mirrors the model for the interactive page, and tests/test_ts_parity.py checks that both give the same status, trigger hour and exit values. notebooks/aug5_analysis.ipynb plots the data and the sweep, with its executed output committed.
Needs Python 3.14 (the version tested; pandas==3.1.0 needs 3.11 or newer) and Node 22.18 or newer (the parity test runs the TypeScript model with Node's built-in type stripping). No network or keys are needed after install.
python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python -m pytest tests # 13 tests passed on 2026-10-24
python scripts/risk_model.py --combined-sweep # rewrites reports/sweep_results.csv (identical to the committed file)
python scripts/risk_model.py --protocol AaveV3 --ltv 0.70 --buffer 0.05
jupyter nbconvert --to notebook --execute notebooks/aug5_analysis.ipynb --stdout > /dev/null
cd web-showcase
npm ci
npm run lint && npm run build
npm run dev
data/: the 24-row hourly price and gas CSV.scripts/: the Python risk model and command-line entry point, plus the Node helper the parity test calls.tests/: 13 pytest tests: the Python model, and its agreement with the TypeScript model.notebooks/: plots of the data and the sweep.reports/: the sweep CSV and a written backtest report.web-showcase/: the Next.js case-study page and docs viewer.reports/backtest_report_aug5.md: assumptions, sweep counts and limits.CONSULTING_REPORT.md: the case-study write-up and recommendation.PROJECT_OVERSIGHT.md: scope notes for the workstream.The CSV is described as a "supplied scenario". Its source is not recorded in this repository, and I have not checked it against on-chain or exchange data. Treat the prices and gas values as illustrative inputs, not as a market record.
tests/test_ts_parity.py compares it with the Python model on the 50-run sweep grid and four off-grid inputs. It does not prove the two agree on every input./docs.MIT, see LICENSE. It covers this project's code, not the supplied scenario data, whose source is uncited.
Part of Rahil Bhavan's projects.