primecli 0.2.4__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {primecli-0.2.4 → primecli-0.2.6}/PKG-INFO +31 -1
- {primecli-0.2.4 → primecli-0.2.6}/README.md +30 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli/deltaprime.py +653 -360
- {primecli-0.2.4 → primecli-0.2.6}/primecli.egg-info/PKG-INFO +31 -1
- {primecli-0.2.4 → primecli-0.2.6}/pyproject.toml +1 -1
- {primecli-0.2.4 → primecli-0.2.6}/LICENSE +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli/__init__.py +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli/degenprime.py +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli.egg-info/SOURCES.txt +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli.egg-info/dependency_links.txt +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli.egg-info/entry_points.txt +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli.egg-info/requires.txt +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/primecli.egg-info/top_level.txt +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/setup.cfg +0 -0
- {primecli-0.2.4 → primecli-0.2.6}/tests/test_redstone_encoding.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: primecli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Agent-friendly CLI tools for the DeltaPrime (Avalanche) and DegenPrime (Base) lending and leverage protocols. Preview-by-default; no Etherscan key required.
|
|
5
5
|
Author: Mnemosyne-quest contributors
|
|
6
6
|
License: MIT
|
|
@@ -254,6 +254,36 @@ If your failure is not on this list and the on-chain revert reason is opaque, ca
|
|
|
254
254
|
- Per-version release notes: <https://github.com/Mnemosyne-quest/primecli/releases>.
|
|
255
255
|
- The `main` branch may be ahead of the latest tagged release; install from git if you need the bleeding edge.
|
|
256
256
|
|
|
257
|
+
## Health Math (0-100% Scale)
|
|
258
|
+
|
|
259
|
+
The protocol's health meter runs from 0% (liquidation) to 100% (no debt).
|
|
260
|
+
The tool reports `health_ratio` from the SolvencyFacet (1.0 = liquidation line),
|
|
261
|
+
but the frontend-friendly 0-100% scale is computed as:
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
equity = total_supplied_usd - total_debt_usd
|
|
265
|
+
max_debt = equity * (tier - 1) # PREMIUM=10, BASIC=5
|
|
266
|
+
health_pct = (max_debt - debt) / max_debt * 100
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Key insight: **LP tokens (GMX, LB, Aerodrome CL) don't count as full-rate
|
|
270
|
+
collateral.** Using gross `supplied_usd` as the borrowing base inflates `max_debt`
|
|
271
|
+
and overstates health. The formula above uses `equity` only, which matches the
|
|
272
|
+
protocol's cross-margin calculation within ~3pp.
|
|
273
|
+
|
|
274
|
+
### Rebalancing
|
|
275
|
+
|
|
276
|
+
Auto-rebalance within a configurable range (e.g. 30-70%) by borrowing more
|
|
277
|
+
(deploy into existing position) or repaying debt. A 1h cooldown prevents
|
|
278
|
+
frequent toggling. Below 20% the cooldown is bypassed and the agent is escalated.
|
|
279
|
+
|
|
280
|
+
### Stop Loss (Equity Drawdown)
|
|
281
|
+
|
|
282
|
+
Track a baseline equity (recorded at position open) and trigger a full close
|
|
283
|
+
if equity drops X% below that baseline. Withdraw from the position, swap to
|
|
284
|
+
USDC, repay all debt. See `examples/health-monitoring/` for a reference
|
|
285
|
+
implementation.
|
|
286
|
+
|
|
257
287
|
## Contributing
|
|
258
288
|
|
|
259
289
|
PRs welcome. Open an issue first if you are planning anything non-trivial (new facet support, new chain, write paths for Aerodrome). Pinning ABIs and verifying on-chain shapes takes a real probe pass, and it is worth aligning before doing the work.
|
|
@@ -222,6 +222,36 @@ If your failure is not on this list and the on-chain revert reason is opaque, ca
|
|
|
222
222
|
- Per-version release notes: <https://github.com/Mnemosyne-quest/primecli/releases>.
|
|
223
223
|
- The `main` branch may be ahead of the latest tagged release; install from git if you need the bleeding edge.
|
|
224
224
|
|
|
225
|
+
## Health Math (0-100% Scale)
|
|
226
|
+
|
|
227
|
+
The protocol's health meter runs from 0% (liquidation) to 100% (no debt).
|
|
228
|
+
The tool reports `health_ratio` from the SolvencyFacet (1.0 = liquidation line),
|
|
229
|
+
but the frontend-friendly 0-100% scale is computed as:
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
equity = total_supplied_usd - total_debt_usd
|
|
233
|
+
max_debt = equity * (tier - 1) # PREMIUM=10, BASIC=5
|
|
234
|
+
health_pct = (max_debt - debt) / max_debt * 100
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Key insight: **LP tokens (GMX, LB, Aerodrome CL) don't count as full-rate
|
|
238
|
+
collateral.** Using gross `supplied_usd` as the borrowing base inflates `max_debt`
|
|
239
|
+
and overstates health. The formula above uses `equity` only, which matches the
|
|
240
|
+
protocol's cross-margin calculation within ~3pp.
|
|
241
|
+
|
|
242
|
+
### Rebalancing
|
|
243
|
+
|
|
244
|
+
Auto-rebalance within a configurable range (e.g. 30-70%) by borrowing more
|
|
245
|
+
(deploy into existing position) or repaying debt. A 1h cooldown prevents
|
|
246
|
+
frequent toggling. Below 20% the cooldown is bypassed and the agent is escalated.
|
|
247
|
+
|
|
248
|
+
### Stop Loss (Equity Drawdown)
|
|
249
|
+
|
|
250
|
+
Track a baseline equity (recorded at position open) and trigger a full close
|
|
251
|
+
if equity drops X% below that baseline. Withdraw from the position, swap to
|
|
252
|
+
USDC, repay all debt. See `examples/health-monitoring/` for a reference
|
|
253
|
+
implementation.
|
|
254
|
+
|
|
225
255
|
## Contributing
|
|
226
256
|
|
|
227
257
|
PRs welcome. Open an issue first if you are planning anything non-trivial (new facet support, new chain, write paths for Aerodrome). Pinning ABIs and verifying on-chain shapes takes a real probe pass, and it is worth aligning before doing the work.
|