@sovryn-zero/lib-base 0.1.0 → 0.2.0
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 +13 -13
- package/dist/index.js +25 -25
- package/dist/src/Decimal.d.ts +88 -88
- package/dist/src/Decimal.js +360 -360
- package/dist/src/Fees.d.ts +81 -81
- package/dist/src/Fees.js +122 -122
- package/dist/src/LiquityStore.d.ts +208 -208
- package/dist/src/LiquityStore.js +208 -208
- package/dist/src/ObservableLiquity.d.ts +14 -14
- package/dist/src/ObservableLiquity.js +2 -2
- package/dist/src/PopulatableLiquity.d.ts +124 -124
- package/dist/src/PopulatableLiquity.js +2 -2
- package/dist/src/ReadableLiquity.d.ts +155 -155
- package/dist/src/ReadableLiquity.js +2 -2
- package/dist/src/SendableLiquity.d.ts +155 -155
- package/dist/src/SendableLiquity.js +19 -19
- package/dist/src/StabilityDeposit.d.ts +58 -58
- package/dist/src/StabilityDeposit.js +79 -79
- package/dist/src/TransactableLiquity.d.ts +413 -413
- package/dist/src/TransactableLiquity.js +17 -17
- package/dist/src/Trove.d.ts +366 -366
- package/dist/src/Trove.js +422 -422
- package/dist/src/ZEROStake.d.ts +51 -51
- package/dist/src/ZEROStake.js +73 -73
- package/dist/src/_CachedReadableLiquity.d.ts +54 -54
- package/dist/src/_CachedReadableLiquity.js +92 -92
- package/dist/src/constants.d.ts +60 -60
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +63 -63
- package/dist/src/constants.js.map +1 -1
- package/package.json +2 -2
- package/src/constants.ts +3 -3
package/dist/src/constants.d.ts
CHANGED
@@ -1,61 +1,61 @@
|
|
1
|
-
import { Decimal } from "./Decimal";
|
2
|
-
/**
|
3
|
-
* Total collateral ratio below which recovery mode is triggered.
|
4
|
-
*
|
5
|
-
* @public
|
6
|
-
*/
|
7
|
-
export declare const CRITICAL_COLLATERAL_RATIO: Decimal;
|
8
|
-
/**
|
9
|
-
* Collateral ratio below which a Trove can be liquidated in normal mode.
|
10
|
-
*
|
11
|
-
* @public
|
12
|
-
*/
|
13
|
-
export declare const MINIMUM_COLLATERAL_RATIO: Decimal;
|
14
|
-
/**
|
15
|
-
* Amount of ZUSD that's reserved for compensating the liquidator of a Trove.
|
16
|
-
*
|
17
|
-
* @public
|
18
|
-
*/
|
19
|
-
export declare const ZUSD_LIQUIDATION_RESERVE: Decimal;
|
20
|
-
/**
|
21
|
-
* A Trove must always have at least this much debt on top of the
|
22
|
-
* {@link ZUSD_LIQUIDATION_RESERVE | liquidation reserve}.
|
23
|
-
*
|
24
|
-
* @remarks
|
25
|
-
* Any transaction that would result in a Trove with less net debt than this will be reverted.
|
26
|
-
*
|
27
|
-
* @public
|
28
|
-
*/
|
29
|
-
export declare const ZUSD_MINIMUM_NET_DEBT: Decimal;
|
30
|
-
/**
|
31
|
-
* A Trove must always have at least this much debt.
|
32
|
-
*
|
33
|
-
* @remarks
|
34
|
-
* Any transaction that would result in a Trove with less debt than this will be reverted.
|
35
|
-
*
|
36
|
-
* @public
|
37
|
-
*/
|
38
|
-
export declare const ZUSD_MINIMUM_DEBT: Decimal;
|
39
|
-
/**
|
40
|
-
* Value that the {@link Fees.borrowingRate | borrowing rate} will never decay below.
|
41
|
-
*
|
42
|
-
* @remarks
|
43
|
-
* Note that the borrowing rate can still be lower than this during recovery mode, when it's
|
44
|
-
* overridden by zero.
|
45
|
-
*
|
46
|
-
* @public
|
47
|
-
*/
|
48
|
-
export declare const MINIMUM_BORROWING_RATE: Decimal;
|
49
|
-
/**
|
50
|
-
* Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.
|
51
|
-
*
|
52
|
-
* @public
|
53
|
-
*/
|
54
|
-
export declare const MAXIMUM_BORROWING_RATE: Decimal;
|
55
|
-
/**
|
56
|
-
* Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.
|
57
|
-
*
|
58
|
-
* @public
|
59
|
-
*/
|
60
|
-
export declare const MINIMUM_REDEMPTION_RATE: Decimal;
|
1
|
+
import { Decimal } from "./Decimal";
|
2
|
+
/**
|
3
|
+
* Total collateral ratio below which recovery mode is triggered.
|
4
|
+
*
|
5
|
+
* @public
|
6
|
+
*/
|
7
|
+
export declare const CRITICAL_COLLATERAL_RATIO: Decimal;
|
8
|
+
/**
|
9
|
+
* Collateral ratio below which a Trove can be liquidated in normal mode.
|
10
|
+
*
|
11
|
+
* @public
|
12
|
+
*/
|
13
|
+
export declare const MINIMUM_COLLATERAL_RATIO: Decimal;
|
14
|
+
/**
|
15
|
+
* Amount of ZUSD that's reserved for compensating the liquidator of a Trove.
|
16
|
+
*
|
17
|
+
* @public
|
18
|
+
*/
|
19
|
+
export declare const ZUSD_LIQUIDATION_RESERVE: Decimal;
|
20
|
+
/**
|
21
|
+
* A Trove must always have at least this much debt on top of the
|
22
|
+
* {@link ZUSD_LIQUIDATION_RESERVE | liquidation reserve}.
|
23
|
+
*
|
24
|
+
* @remarks
|
25
|
+
* Any transaction that would result in a Trove with less net debt than this will be reverted.
|
26
|
+
*
|
27
|
+
* @public
|
28
|
+
*/
|
29
|
+
export declare const ZUSD_MINIMUM_NET_DEBT: Decimal;
|
30
|
+
/**
|
31
|
+
* A Trove must always have at least this much debt.
|
32
|
+
*
|
33
|
+
* @remarks
|
34
|
+
* Any transaction that would result in a Trove with less debt than this will be reverted.
|
35
|
+
*
|
36
|
+
* @public
|
37
|
+
*/
|
38
|
+
export declare const ZUSD_MINIMUM_DEBT: Decimal;
|
39
|
+
/**
|
40
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never decay below.
|
41
|
+
*
|
42
|
+
* @remarks
|
43
|
+
* Note that the borrowing rate can still be lower than this during recovery mode, when it's
|
44
|
+
* overridden by zero.
|
45
|
+
*
|
46
|
+
* @public
|
47
|
+
*/
|
48
|
+
export declare const MINIMUM_BORROWING_RATE: Decimal;
|
49
|
+
/**
|
50
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.
|
51
|
+
*
|
52
|
+
* @public
|
53
|
+
*/
|
54
|
+
export declare const MAXIMUM_BORROWING_RATE: Decimal;
|
55
|
+
/**
|
56
|
+
* Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.
|
57
|
+
*
|
58
|
+
* @public
|
59
|
+
*/
|
60
|
+
export declare const MINIMUM_REDEMPTION_RATE: Decimal;
|
61
61
|
//# sourceMappingURL=constants.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAAoB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,SAAoB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,SAAmB,CAAC;AAEzD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAAoB,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,SAAsD,CAAC;AAErF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAAoB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,SAAoB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,SAAmB,CAAC;AAEzD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAAoB,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,SAAsD,CAAC;AAErF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,SAAqB,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,SAAsB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,SAAsB,CAAC"}
|
package/dist/src/constants.js
CHANGED
@@ -1,64 +1,64 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.MINIMUM_REDEMPTION_RATE = exports.MAXIMUM_BORROWING_RATE = exports.MINIMUM_BORROWING_RATE = exports.ZUSD_MINIMUM_DEBT = exports.ZUSD_MINIMUM_NET_DEBT = exports.ZUSD_LIQUIDATION_RESERVE = exports.MINIMUM_COLLATERAL_RATIO = exports.CRITICAL_COLLATERAL_RATIO = void 0;
|
4
|
-
const Decimal_1 = require("./Decimal");
|
5
|
-
/**
|
6
|
-
* Total collateral ratio below which recovery mode is triggered.
|
7
|
-
*
|
8
|
-
* @public
|
9
|
-
*/
|
10
|
-
exports.CRITICAL_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.5);
|
11
|
-
/**
|
12
|
-
* Collateral ratio below which a Trove can be liquidated in normal mode.
|
13
|
-
*
|
14
|
-
* @public
|
15
|
-
*/
|
16
|
-
exports.MINIMUM_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.1);
|
17
|
-
/**
|
18
|
-
* Amount of ZUSD that's reserved for compensating the liquidator of a Trove.
|
19
|
-
*
|
20
|
-
* @public
|
21
|
-
*/
|
22
|
-
exports.ZUSD_LIQUIDATION_RESERVE = Decimal_1.Decimal.from(20);
|
23
|
-
/**
|
24
|
-
* A Trove must always have at least this much debt on top of the
|
25
|
-
* {@link ZUSD_LIQUIDATION_RESERVE | liquidation reserve}.
|
26
|
-
*
|
27
|
-
* @remarks
|
28
|
-
* Any transaction that would result in a Trove with less net debt than this will be reverted.
|
29
|
-
*
|
30
|
-
* @public
|
31
|
-
*/
|
32
|
-
exports.ZUSD_MINIMUM_NET_DEBT = Decimal_1.Decimal.from(180);
|
33
|
-
/**
|
34
|
-
* A Trove must always have at least this much debt.
|
35
|
-
*
|
36
|
-
* @remarks
|
37
|
-
* Any transaction that would result in a Trove with less debt than this will be reverted.
|
38
|
-
*
|
39
|
-
* @public
|
40
|
-
*/
|
41
|
-
exports.ZUSD_MINIMUM_DEBT = exports.ZUSD_LIQUIDATION_RESERVE.add(exports.ZUSD_MINIMUM_NET_DEBT);
|
42
|
-
/**
|
43
|
-
* Value that the {@link Fees.borrowingRate | borrowing rate} will never decay below.
|
44
|
-
*
|
45
|
-
* @remarks
|
46
|
-
* Note that the borrowing rate can still be lower than this during recovery mode, when it's
|
47
|
-
* overridden by zero.
|
48
|
-
*
|
49
|
-
* @public
|
50
|
-
*/
|
51
|
-
exports.MINIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.
|
52
|
-
/**
|
53
|
-
* Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.
|
54
|
-
*
|
55
|
-
* @public
|
56
|
-
*/
|
57
|
-
exports.MAXIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.
|
58
|
-
/**
|
59
|
-
* Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.
|
60
|
-
*
|
61
|
-
* @public
|
62
|
-
*/
|
63
|
-
exports.MINIMUM_REDEMPTION_RATE = Decimal_1.Decimal.from(0.
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.MINIMUM_REDEMPTION_RATE = exports.MAXIMUM_BORROWING_RATE = exports.MINIMUM_BORROWING_RATE = exports.ZUSD_MINIMUM_DEBT = exports.ZUSD_MINIMUM_NET_DEBT = exports.ZUSD_LIQUIDATION_RESERVE = exports.MINIMUM_COLLATERAL_RATIO = exports.CRITICAL_COLLATERAL_RATIO = void 0;
|
4
|
+
const Decimal_1 = require("./Decimal");
|
5
|
+
/**
|
6
|
+
* Total collateral ratio below which recovery mode is triggered.
|
7
|
+
*
|
8
|
+
* @public
|
9
|
+
*/
|
10
|
+
exports.CRITICAL_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.5);
|
11
|
+
/**
|
12
|
+
* Collateral ratio below which a Trove can be liquidated in normal mode.
|
13
|
+
*
|
14
|
+
* @public
|
15
|
+
*/
|
16
|
+
exports.MINIMUM_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.1);
|
17
|
+
/**
|
18
|
+
* Amount of ZUSD that's reserved for compensating the liquidator of a Trove.
|
19
|
+
*
|
20
|
+
* @public
|
21
|
+
*/
|
22
|
+
exports.ZUSD_LIQUIDATION_RESERVE = Decimal_1.Decimal.from(20);
|
23
|
+
/**
|
24
|
+
* A Trove must always have at least this much debt on top of the
|
25
|
+
* {@link ZUSD_LIQUIDATION_RESERVE | liquidation reserve}.
|
26
|
+
*
|
27
|
+
* @remarks
|
28
|
+
* Any transaction that would result in a Trove with less net debt than this will be reverted.
|
29
|
+
*
|
30
|
+
* @public
|
31
|
+
*/
|
32
|
+
exports.ZUSD_MINIMUM_NET_DEBT = Decimal_1.Decimal.from(180);
|
33
|
+
/**
|
34
|
+
* A Trove must always have at least this much debt.
|
35
|
+
*
|
36
|
+
* @remarks
|
37
|
+
* Any transaction that would result in a Trove with less debt than this will be reverted.
|
38
|
+
*
|
39
|
+
* @public
|
40
|
+
*/
|
41
|
+
exports.ZUSD_MINIMUM_DEBT = exports.ZUSD_LIQUIDATION_RESERVE.add(exports.ZUSD_MINIMUM_NET_DEBT);
|
42
|
+
/**
|
43
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never decay below.
|
44
|
+
*
|
45
|
+
* @remarks
|
46
|
+
* Note that the borrowing rate can still be lower than this during recovery mode, when it's
|
47
|
+
* overridden by zero.
|
48
|
+
*
|
49
|
+
* @public
|
50
|
+
*/
|
51
|
+
exports.MINIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.05);
|
52
|
+
/**
|
53
|
+
* Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.
|
54
|
+
*
|
55
|
+
* @public
|
56
|
+
*/
|
57
|
+
exports.MAXIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.075);
|
58
|
+
/**
|
59
|
+
* Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.
|
60
|
+
*
|
61
|
+
* @public
|
62
|
+
*/
|
63
|
+
exports.MINIMUM_REDEMPTION_RATE = Decimal_1.Decimal.from(0.019);
|
64
64
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE3D;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE1D;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,iBAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvD;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,gCAAwB,CAAC,GAAG,CAAC,6BAAqB,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAG,iBAAO,CAAC,IAAI,CAAC,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE3D;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE1D;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,iBAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvD;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,gCAAwB,CAAC,GAAG,CAAC,6BAAqB,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEzD;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,iBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE1D;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,iBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
@@ -51,18 +51,18 @@ export const ZUSD_MINIMUM_DEBT = ZUSD_LIQUIDATION_RESERVE.add(ZUSD_MINIMUM_NET_D
|
|
51
51
|
*
|
52
52
|
* @public
|
53
53
|
*/
|
54
|
-
export const MINIMUM_BORROWING_RATE = Decimal.from(0.
|
54
|
+
export const MINIMUM_BORROWING_RATE = Decimal.from(0.05);
|
55
55
|
|
56
56
|
/**
|
57
57
|
* Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.
|
58
58
|
*
|
59
59
|
* @public
|
60
60
|
*/
|
61
|
-
export const MAXIMUM_BORROWING_RATE = Decimal.from(0.
|
61
|
+
export const MAXIMUM_BORROWING_RATE = Decimal.from(0.075);
|
62
62
|
|
63
63
|
/**
|
64
64
|
* Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.
|
65
65
|
*
|
66
66
|
* @public
|
67
67
|
*/
|
68
|
-
export const MINIMUM_REDEMPTION_RATE = Decimal.from(0.
|
68
|
+
export const MINIMUM_REDEMPTION_RATE = Decimal.from(0.019);
|