@1delta/margin-fetcher 5.0.6 → 5.0.7
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.
- package/dist/index.d.ts +10 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -8416,7 +8416,16 @@ interface TermAssetRef {
|
|
|
8416
8416
|
* `tags.ts` — never hand-written per lender, so they cannot drift from the
|
|
8417
8417
|
* numbers they summarize.
|
|
8418
8418
|
*/
|
|
8419
|
-
type TermTag = Open<'fixed-rate' | 'variable-rate' | 'user-set-rate' | 'zero-interest' | 'prepaid-interest' | 'nav-accrual' | 'has-maturity' | 'perpetual' | 'rolling-duration' | 'static-debt' | 'accruing-debt' | 'time-liquidation' | 'price-liquidation' | 'redeemable' | 'no-liquidation' | 'full-collateral-seizure' | 'early-exit-free' | 'early-exit-penalty' | 'early-exit-discount' | 'exit-instant' | 'exit-capped' | 'exit-cooldown'
|
|
8419
|
+
type TermTag = Open<'fixed-rate' | 'variable-rate' | 'user-set-rate' | 'zero-interest' | 'prepaid-interest' | 'nav-accrual' | 'has-maturity' | 'perpetual' | 'rolling-duration' | 'static-debt' | 'accruing-debt' | 'time-liquidation' | 'price-liquidation' | 'redeemable' | 'no-liquidation' | 'full-collateral-seizure' | 'early-exit-free' | 'early-exit-penalty' | 'early-exit-discount' | 'exit-instant' | 'exit-capped' | 'exit-cooldown'
|
|
8420
|
+
/**
|
|
8421
|
+
* The DEBT cannot be repaid for a period after opening or topping up.
|
|
8422
|
+
*
|
|
8423
|
+
* Deliberately distinct from `exit-cooldown` (a supply-side withdrawal
|
|
8424
|
+
* delay): this one means the position cannot be closed, deleveraged or
|
|
8425
|
+
* migrated out — and, on the lender that has it, that an incoming
|
|
8426
|
+
* liquidation cannot be averted by repaying.
|
|
8427
|
+
*/
|
|
8428
|
+
| 'repay-locked' | 'exit-queued' | 'exit-market-sale' | 'exit-may-be-impossible' | 'permissioned' | 'capped' | 'cap-full' | 'first-loss' | 'socialized-loss' | 'physical-delivery' | 'undercollateralized' | 'nav-attested' | 'immutable' | 'no-timelock' | 'eoa-controlled' | 'points-rewards'
|
|
8420
8429
|
/**
|
|
8421
8430
|
* The headline yield is MOSTLY the asset's own (staking / RWA / savings)
|
|
8422
8431
|
* yield, not interest this market pays. Set at >= 50 % of `aprTotal`.
|
package/dist/index.js
CHANGED
|
@@ -62293,9 +62293,11 @@ function deriveBorrowTags(borrow, market = {}) {
|
|
|
62293
62293
|
if (borrow.liquidation.redeemable) push(out, "redeemable");
|
|
62294
62294
|
if (borrow.liquidation.seizure === "full-collateral")
|
|
62295
62295
|
push(out, "full-collateral-seizure");
|
|
62296
|
+
const repayLocked = (borrow.exit.cooldownSecs ?? 0) > 0;
|
|
62297
|
+
if (repayLocked) push(out, "repay-locked");
|
|
62296
62298
|
switch (borrow.exit.earlyRepay) {
|
|
62297
62299
|
case "free":
|
|
62298
|
-
push(out, "early-exit-free");
|
|
62300
|
+
if (!repayLocked) push(out, "early-exit-free");
|
|
62299
62301
|
break;
|
|
62300
62302
|
case "penalty":
|
|
62301
62303
|
push(out, "early-exit-penalty");
|
|
@@ -62451,6 +62453,9 @@ function borrowHeadline(b) {
|
|
|
62451
62453
|
) : `${rateLabel(b)} ${pct(b.rate.apr)}`;
|
|
62452
62454
|
const mat = b.maturity.kind === "perpetual" ? "" : ` ${maturityPhrase(b.maturity)}`;
|
|
62453
62455
|
const exit = earlyRepayPhrase[String(b.exit.earlyRepay)] ?? "see repay terms";
|
|
62456
|
+
if (b.exit.cooldownSecs) {
|
|
62457
|
+
return `${rate}${mat} \xB7 no repayment for ${duration(b.exit.cooldownSecs)}, then ${exit}`;
|
|
62458
|
+
}
|
|
62454
62459
|
return `${rate}${mat} \xB7 ${exit}`;
|
|
62455
62460
|
}
|
|
62456
62461
|
function supplyDescription(s, sheet = {}) {
|
|
@@ -63633,6 +63638,16 @@ function supplyFindings(supply) {
|
|
|
63633
63638
|
function borrowFindings(borrow) {
|
|
63634
63639
|
const out = [];
|
|
63635
63640
|
const liq = borrow.liquidation;
|
|
63641
|
+
if (borrow.exit.cooldownSecs) {
|
|
63642
|
+
out.push({
|
|
63643
|
+
severity: "critical",
|
|
63644
|
+
id: "repay-locked",
|
|
63645
|
+
side: "borrow",
|
|
63646
|
+
message: `The debt CANNOT be repaid for ${fmtSecs(
|
|
63647
|
+
borrow.exit.cooldownSecs
|
|
63648
|
+
)} after opening or topping up: the position cannot be closed, deleveraged or migrated out in that window, and an incoming liquidation cannot be averted by repaying (adding collateral still works).`
|
|
63649
|
+
});
|
|
63650
|
+
}
|
|
63636
63651
|
if (liq.seizure === "full-collateral") {
|
|
63637
63652
|
out.push({
|
|
63638
63653
|
severity: "critical",
|