primecli 0.2.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primecli
3
- Version: 0.2.5
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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primecli
3
- Version: 0.2.5
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.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "primecli"
7
- version = "0.2.5"
7
+ version = "0.2.6"
8
8
  description = "Agent-friendly CLI tools for the DeltaPrime (Avalanche) and DegenPrime (Base) lending and leverage protocols. Preview-by-default; no Etherscan key required."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes