@1delta/margin-fetcher 0.0.319 → 0.0.320
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/README.md +34 -1
- package/dist/index.js +84 -4
- package/dist/index.js.map +1 -1
- package/dist/lending/public-data/midnight/convertPublic.d.ts.map +1 -1
- package/dist/lending/public-data/midnight/convertPublic.test.d.ts +2 -0
- package/dist/lending/public-data/midnight/convertPublic.test.d.ts.map +1 -0
- package/dist/lending/public-data/midnight/math.d.ts +31 -0
- package/dist/lending/public-data/midnight/math.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAcnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAchD,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAkBD;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,iBAAiB,EAAE,EACxB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CAkO9C;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertPublic.test.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/convertPublic.test.ts"],"names":[],"mappings":""}
|
|
@@ -19,4 +19,35 @@ export declare function tickToRate(tick: bigint): bigint;
|
|
|
19
19
|
export declare function tickToApr(tick: bigint, timeToMaturity: bigint): bigint;
|
|
20
20
|
/** APR as a plain fraction (e.g. `0.0512` for 5.12%). Convenience for display. */
|
|
21
21
|
export declare function tickToAprNumber(tick: bigint, timeToMaturity: bigint): number;
|
|
22
|
+
/**
|
|
23
|
+
* Midnight max liquidation-incentive factor (LIF), WAD-scaled, mirroring the
|
|
24
|
+
* on-chain `ConstantsLib.maxLif`:
|
|
25
|
+
* `LIF = WAD² / (WAD − liquidationCursor·(WAD − lltv)/WAD)`
|
|
26
|
+
* i.e. `1 / (1 − cursor·(1 − lltv))`. Unlike Morpho Blue, Midnight makes the
|
|
27
|
+
* `liquidationCursor` a per-collateral market parameter and applies NO fixed
|
|
28
|
+
* cap (Morpho hardcodes cursor = 0.3 and caps LIF at 1.15). Inputs are WAD.
|
|
29
|
+
*/
|
|
30
|
+
export declare function midnightMaxLif(lltv: bigint, liquidationCursor: bigint): bigint;
|
|
31
|
+
/**
|
|
32
|
+
* Midnight liquidation penalty as a plain fraction (`LIF − 1`, e.g. `0.0438`
|
|
33
|
+
* for a 4.38% liquidator bonus) — the value surfaced as `liquidationPenalty` in
|
|
34
|
+
* the public store. Derived from the market's own `liquidationCursor`, so it
|
|
35
|
+
* stays correct if a market deviates from the 0.3 cursor the Morpho
|
|
36
|
+
* approximation assumes. Returns 0 when either input is non-positive.
|
|
37
|
+
*/
|
|
38
|
+
export declare function midnightLiquidationPenaltyNumber(lltv: bigint, liquidationCursor: bigint): number;
|
|
39
|
+
/**
|
|
40
|
+
* Effective Midnight settlement fee as a plain fraction (e.g. `0.005` = 50 bps)
|
|
41
|
+
* for a given time-to-maturity, mirroring the on-chain piecewise-linear curve
|
|
42
|
+
* over the 7 cbp breakpoints. Post-maturity (ttm ≤ 0) uses the 0d breakpoint;
|
|
43
|
+
* ttm ≥ 360d uses the 360d breakpoint; in between it linearly interpolates.
|
|
44
|
+
* Returns 0 when the fee array is missing/short.
|
|
45
|
+
*/
|
|
46
|
+
export declare function midnightSettlementFeeForTtm(settlementFeeCbp: number[] | undefined, ttmSecs: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* Annualized Midnight continuous fee as a PERCENT (e.g. `1` = 1%/yr). The raw
|
|
49
|
+
* value is a per-second WAD rate (uint32); annual fraction =
|
|
50
|
+
* raw·SECONDS_PER_YEAR/1e18. Returns 0 for missing/zero input.
|
|
51
|
+
*/
|
|
52
|
+
export declare function midnightContinuousFeeAprPercent(continuousFeeRaw: string | bigint | undefined): number;
|
|
22
53
|
//# sourceMappingURL=math.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/math.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,GAAG,uBAA6B,CAAA;AAI7C,eAAO,MAAM,iBAAiB,oBAAyB,CAAA;AACvD,eAAO,MAAM,IAAI,sBAA2B,CAAA;AAC5C,eAAO,MAAM,UAAU,sBAA2B,CAAA;AAClD,eAAO,MAAM,QAAQ,QAAQ,CAAA;AAC7B,eAAO,MAAM,mBAAmB,gBAAmB,CAAA;AAGnD,eAAO,MAAM,gBAAgB,YAAc,CAAA;AAM3C,4EAA4E;AAC5E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAUtC;AAED,kFAAkF;AAClF,w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,GAAG,MAAM,CAI9E;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,MAAM,GACxB,MAAM,CAKR;AASD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,GACd,MAAM,CAaR;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAC5C,MAAM,CAUR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1delta/margin-fetcher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.320",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"async-retry": "^1.3.3",
|
|
24
24
|
"lodash": "^4.17.23",
|
|
25
25
|
"@1delta/abis": "0.0.22",
|
|
26
|
-
"@1delta/calldata-sdk": "0.0.156",
|
|
27
|
-
"@1delta/lender-registry": "0.0.34",
|
|
28
26
|
"@1delta/data-sdk": "0.0.30",
|
|
27
|
+
"@1delta/calldata-sdk": "0.0.157",
|
|
29
28
|
"@1delta/dex-registry": "0.0.103",
|
|
30
|
-
"@1delta/
|
|
31
|
-
"@1delta/providers": "0.0.62"
|
|
29
|
+
"@1delta/lender-registry": "0.0.34",
|
|
30
|
+
"@1delta/providers": "0.0.62",
|
|
31
|
+
"@1delta/proxy-fetch": "0.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/async-retry": "^1.4.9",
|