@kamino-finance/klend-sdk 3.2.18 → 3.2.19
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 +42 -0
- package/dist/classes/manager.js +0 -17
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +15 -0
- package/dist/classes/market.js +153 -0
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.js +0 -45
- package/dist/classes/reserve.js.map +1 -1
- package/dist/client_kamino_manager.d.ts +2 -1
- package/dist/client_kamino_manager.js +22 -21
- package/dist/client_kamino_manager.js.map +1 -1
- package/dist/idl.json +41 -19
- package/dist/idl_codegen/accounts/LendingMarket.d.ts +6 -6
- package/dist/idl_codegen/accounts/LendingMarket.js +5 -5
- package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -1
- package/dist/idl_codegen/errors/custom.d.ts +25 -1
- package/dist/idl_codegen/errors/custom.js +40 -1
- package/dist/idl_codegen/errors/custom.js.map +1 -1
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts +0 -1
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js +1 -1
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts +0 -1
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js +1 -1
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen/instructions/index.d.ts +2 -0
- package/dist/idl_codegen/instructions/index.js +3 -1
- package/dist/idl_codegen/instructions/index.js.map +1 -1
- package/dist/idl_codegen/instructions/refreshReservesBatch.d.ts +6 -0
- package/dist/idl_codegen/instructions/refreshReservesBatch.js +43 -0
- package/dist/idl_codegen/instructions/refreshReservesBatch.js.map +1 -0
- package/dist/idl_codegen/programId.js.map +1 -1
- package/dist/idl_codegen/types/ReserveConfig.d.ts +16 -16
- package/dist/idl_codegen/types/ReserveConfig.js +12 -12
- package/dist/idl_codegen/types/ReserveConfig.js.map +1 -1
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts +14 -14
- package/dist/idl_codegen/types/UpdateConfigMode.js +25 -25
- package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -1
- package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +20 -7
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js +39 -13
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/idl_codegen/types/index.d.ts +4 -4
- package/dist/idl_codegen/types/index.js.map +1 -1
- package/dist/utils/instruction.js +0 -1
- package/dist/utils/instruction.js.map +1 -1
- package/dist/utils/managerTypes.js +2 -2
- package/dist/utils/managerTypes.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.layout = void 0;
|
|
27
|
+
exports.refreshReservesBatch = refreshReservesBatch;
|
|
28
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
30
|
+
const programId_1 = require("../programId");
|
|
31
|
+
exports.layout = borsh.struct([borsh.bool("skipPriceUpdates")]);
|
|
32
|
+
function refreshReservesBatch(args, programId = programId_1.PROGRAM_ID) {
|
|
33
|
+
const keys = [];
|
|
34
|
+
const identifier = Buffer.from([144, 110, 26, 103, 162, 204, 252, 147]);
|
|
35
|
+
const buffer = Buffer.alloc(1000);
|
|
36
|
+
const len = exports.layout.encode({
|
|
37
|
+
skipPriceUpdates: args.skipPriceUpdates,
|
|
38
|
+
}, buffer);
|
|
39
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
40
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
41
|
+
return ix;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=refreshReservesBatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshReservesBatch.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/refreshReservesBatch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,oDAgBC;AA5BD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAM5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAA;AAEpE,SAAgB,oBAAoB,CAClC,IAA8B,EAC9B,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB,EAAE,CAAA;IACnC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;IACvE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;KACxC,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface RefreshReservesBatchArgs {\n skipPriceUpdates: boolean\n}\n\nexport const layout = borsh.struct([borsh.bool(\"skipPriceUpdates\")])\n\nexport function refreshReservesBatch(\n args: RefreshReservesBatchArgs,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = []\n const identifier = Buffer.from([144, 110, 26, 103, 162, 204, 252, 147])\n const buffer = Buffer.alloc(1000)\n const len = layout.encode(\n {\n skipPriceUpdates: args.skipPriceUpdates,\n },\n buffer\n )\n const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"programId.js","sourceRoot":"","sources":["../../src/idl_codegen/programId.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,0HAA0H;AAC7G,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAA;AAED,4GAA4G;AACjG,QAAA,UAAU,GAAc,sBAAc,CAAA;AAE1C,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAE,EAAE;IACxD,kBAAU,GAAG,SAAS,CAAC;AACzB,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B","sourcesContent":["import { PublicKey } from \"@solana/web3.js\"\n\n// Program ID passed with the cli --program-id flag when running the code generator. Do not edit, it will get overwritten.\nexport const PROGRAM_ID_CLI = new PublicKey(\n \"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD\"\n)\n\n// This constant will not get overwritten on subsequent code generations and it's safe to modify it's value.\nexport let PROGRAM_ID: PublicKey = PROGRAM_ID_CLI\n\nexport const setKLendProgramId = (programId: PublicKey) => {\n PROGRAM_ID = programId;\n}
|
|
1
|
+
{"version":3,"file":"programId.js","sourceRoot":"","sources":["../../src/idl_codegen/programId.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,0HAA0H;AAC7G,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAA;AAED,4GAA4G;AACjG,QAAA,UAAU,GAAc,sBAAc,CAAA;AAE1C,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAE,EAAE;IACxD,kBAAU,GAAG,SAAS,CAAC;AACzB,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B","sourcesContent":["import { PublicKey } from \"@solana/web3.js\"\n\n// Program ID passed with the cli --program-id flag when running the code generator. Do not edit, it will get overwritten.\nexport const PROGRAM_ID_CLI = new PublicKey(\n \"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD\"\n)\n\n// This constant will not get overwritten on subsequent code generations and it's safe to modify it's value.\nexport let PROGRAM_ID: PublicKey = PROGRAM_ID_CLI\n\nexport const setKLendProgramId = (programId: PublicKey) => {\n PROGRAM_ID = programId;\n};"]}
|
|
@@ -8,10 +8,10 @@ export interface ReserveConfigFields {
|
|
|
8
8
|
assetTier: number;
|
|
9
9
|
/** Flat rate that goes to the host */
|
|
10
10
|
hostFixedInterestRateBps: number;
|
|
11
|
-
/** Boost for side (debt or collateral) */
|
|
12
|
-
|
|
13
|
-
/** Reward points multiplier per obligation type */
|
|
14
|
-
|
|
11
|
+
/** [DEPRECATED] Boost for side (debt or collateral) */
|
|
12
|
+
reserved2: Array<number>;
|
|
13
|
+
/** [DEPRECATED] Reward points multiplier per obligation type */
|
|
14
|
+
reserved3: Array<number>;
|
|
15
15
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
16
16
|
protocolTakeRatePct: number;
|
|
17
17
|
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
@@ -77,10 +77,10 @@ export interface ReserveConfigJSON {
|
|
|
77
77
|
assetTier: number;
|
|
78
78
|
/** Flat rate that goes to the host */
|
|
79
79
|
hostFixedInterestRateBps: number;
|
|
80
|
-
/** Boost for side (debt or collateral) */
|
|
81
|
-
|
|
82
|
-
/** Reward points multiplier per obligation type */
|
|
83
|
-
|
|
80
|
+
/** [DEPRECATED] Boost for side (debt or collateral) */
|
|
81
|
+
reserved2: Array<number>;
|
|
82
|
+
/** [DEPRECATED] Reward points multiplier per obligation type */
|
|
83
|
+
reserved3: Array<number>;
|
|
84
84
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
85
85
|
protocolTakeRatePct: number;
|
|
86
86
|
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
@@ -147,10 +147,10 @@ export declare class ReserveConfig {
|
|
|
147
147
|
readonly assetTier: number;
|
|
148
148
|
/** Flat rate that goes to the host */
|
|
149
149
|
readonly hostFixedInterestRateBps: number;
|
|
150
|
-
/** Boost for side (debt or collateral) */
|
|
151
|
-
readonly
|
|
152
|
-
/** Reward points multiplier per obligation type */
|
|
153
|
-
readonly
|
|
150
|
+
/** [DEPRECATED] Boost for side (debt or collateral) */
|
|
151
|
+
readonly reserved2: Array<number>;
|
|
152
|
+
/** [DEPRECATED] Reward points multiplier per obligation type */
|
|
153
|
+
readonly reserved3: Array<number>;
|
|
154
154
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
155
155
|
readonly protocolTakeRatePct: number;
|
|
156
156
|
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
@@ -215,8 +215,8 @@ export declare class ReserveConfig {
|
|
|
215
215
|
status: number;
|
|
216
216
|
assetTier: number;
|
|
217
217
|
hostFixedInterestRateBps: number;
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
reserved2: number[];
|
|
219
|
+
reserved3: number[];
|
|
220
220
|
protocolTakeRatePct: number;
|
|
221
221
|
protocolLiquidationFeePct: number;
|
|
222
222
|
loanToValuePct: number;
|
|
@@ -291,8 +291,8 @@ export declare class ReserveConfig {
|
|
|
291
291
|
status: number;
|
|
292
292
|
assetTier: number;
|
|
293
293
|
hostFixedInterestRateBps: number;
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
reserved2: number[];
|
|
295
|
+
reserved3: number[];
|
|
296
296
|
protocolTakeRatePct: number;
|
|
297
297
|
protocolLiquidationFeePct: number;
|
|
298
298
|
loanToValuePct: number;
|
|
@@ -36,8 +36,8 @@ class ReserveConfig {
|
|
|
36
36
|
this.status = fields.status;
|
|
37
37
|
this.assetTier = fields.assetTier;
|
|
38
38
|
this.hostFixedInterestRateBps = fields.hostFixedInterestRateBps;
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
39
|
+
this.reserved2 = fields.reserved2;
|
|
40
|
+
this.reserved3 = fields.reserved3;
|
|
41
41
|
this.protocolTakeRatePct = fields.protocolTakeRatePct;
|
|
42
42
|
this.protocolLiquidationFeePct = fields.protocolLiquidationFeePct;
|
|
43
43
|
this.loanToValuePct = fields.loanToValuePct;
|
|
@@ -72,8 +72,8 @@ class ReserveConfig {
|
|
|
72
72
|
borsh.u8("status"),
|
|
73
73
|
borsh.u8("assetTier"),
|
|
74
74
|
borsh.u16("hostFixedInterestRateBps"),
|
|
75
|
-
borsh.array(borsh.u8(), 2, "
|
|
76
|
-
borsh.array(borsh.u8(), 8, "
|
|
75
|
+
borsh.array(borsh.u8(), 2, "reserved2"),
|
|
76
|
+
borsh.array(borsh.u8(), 8, "reserved3"),
|
|
77
77
|
borsh.u8("protocolTakeRatePct"),
|
|
78
78
|
borsh.u8("protocolLiquidationFeePct"),
|
|
79
79
|
borsh.u8("loanToValuePct"),
|
|
@@ -105,8 +105,8 @@ class ReserveConfig {
|
|
|
105
105
|
status: obj.status,
|
|
106
106
|
assetTier: obj.assetTier,
|
|
107
107
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
reserved2: obj.reserved2,
|
|
109
|
+
reserved3: obj.reserved3,
|
|
110
110
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
111
111
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
112
112
|
loanToValuePct: obj.loanToValuePct,
|
|
@@ -137,8 +137,8 @@ class ReserveConfig {
|
|
|
137
137
|
status: fields.status,
|
|
138
138
|
assetTier: fields.assetTier,
|
|
139
139
|
hostFixedInterestRateBps: fields.hostFixedInterestRateBps,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
reserved2: fields.reserved2,
|
|
141
|
+
reserved3: fields.reserved3,
|
|
142
142
|
protocolTakeRatePct: fields.protocolTakeRatePct,
|
|
143
143
|
protocolLiquidationFeePct: fields.protocolLiquidationFeePct,
|
|
144
144
|
loanToValuePct: fields.loanToValuePct,
|
|
@@ -169,8 +169,8 @@ class ReserveConfig {
|
|
|
169
169
|
status: this.status,
|
|
170
170
|
assetTier: this.assetTier,
|
|
171
171
|
hostFixedInterestRateBps: this.hostFixedInterestRateBps,
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
reserved2: this.reserved2,
|
|
173
|
+
reserved3: this.reserved3,
|
|
174
174
|
protocolTakeRatePct: this.protocolTakeRatePct,
|
|
175
175
|
protocolLiquidationFeePct: this.protocolLiquidationFeePct,
|
|
176
176
|
loanToValuePct: this.loanToValuePct,
|
|
@@ -201,8 +201,8 @@ class ReserveConfig {
|
|
|
201
201
|
status: obj.status,
|
|
202
202
|
assetTier: obj.assetTier,
|
|
203
203
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
reserved2: obj.reserved2,
|
|
205
|
+
reserved3: obj.reserved3,
|
|
206
206
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
207
207
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
208
208
|
loanToValuePct: obj.loanToValuePct,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReserveConfig.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ReserveConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAsB,CAAC,wDAAwD;AAC/E,gDAAiC,CAAC,wDAAwD;AAC1F,wDAAyC;AA8IzC,mCAAmC;AACnC,MAAa,aAAa;IAqExB,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;QAC3B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAA;QAC/D,IAAI,CAAC,mBAA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,QAAQ,CACjD,GAAG,CAAC,oBAAoB,CACzB;YACD,iBAAiB,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC;YACvE,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,8BAA8B,EAAE,GAAG,CAAC,8BAA8B;YAClE,mCAAmC,EACjC,GAAG,CAAC,mCAAmC;YACzC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,gCAAgC,EAAE,IAAI,eAAE,CACtC,GAAG,CAAC,gCAAgC,CACrC;YACD,gDAAgD,EAC9C,GAAG,CAAC,gDAAgD,CAAC,GAAG,CACtD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CACvB;SACJ,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF;AAhUD,sCAgUC","sourcesContent":["import { PublicKey } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\"\n\nexport interface ReserveConfigFields {\n /** Status of the reserve Active/Obsolete/Hidden */\n status: number\n /** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */\n assetTier: number\n /** Flat rate that goes to the host */\n hostFixedInterestRateBps: number\n /** Boost for side (debt or collateral) */\n multiplierSideBoost: Array<number>\n /** Reward points multiplier per obligation type */\n multiplierTagBoost: Array<number>\n /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */\n protocolTakeRatePct: number\n /** Cut of the liquidation bonus that the protocol receives, as a percentage */\n protocolLiquidationFeePct: number\n /**\n * Target ratio of the value of borrows to deposits, as a percentage\n * 0 if use as collateral is disabled\n */\n loanToValuePct: number\n /** Loan to value ratio at which an obligation can be liquidated, as percentage */\n liquidationThresholdPct: number\n /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n minLiquidationBonusBps: number\n /** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n maxLiquidationBonusBps: number\n /** Bad debt liquidation bonus for an undercollateralized obligation, as bps */\n badDebtLiquidationBonusBps: number\n /** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */\n deleveragingMarginCallPeriodSecs: BN\n /**\n * The rate at which the deleveraging threshold decreases in slots per bps\n * e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)\n */\n deleveragingThresholdSlotsPerBps: BN\n /** Program owner fees assessed, separate from gains due to interest accrual */\n fees: types.ReserveFeesFields\n /** Borrow rate curve based on utilization */\n borrowRateCurve: types.BorrowRateCurveFields\n /** Borrow factor in percentage - used for risk adjustment */\n borrowFactorPct: BN\n /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */\n depositLimit: BN\n /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */\n borrowLimit: BN\n /** Token id from TokenInfos struct */\n tokenInfo: types.TokenInfoFields\n /** Deposit withdrawl caps - deposit & redeem */\n depositWithdrawalCap: types.WithdrawalCapsFields\n /** Debt withdrawl caps - borrow & repay */\n debtWithdrawalCap: types.WithdrawalCapsFields\n elevationGroups: Array<number>\n disableUsageAsCollOutsideEmode: number\n utilizationLimitBlockBorrowingAbove: number\n reserved1: Array<number>\n /**\n * Maximum amount liquidity of this reserve borrowed outside all elevation groups\n * - u64::MAX for inf\n * - 0 to disable borrows outside elevation groups\n */\n borrowLimitOutsideElevationGroup: BN\n /**\n * Defines the maximum amount (in lamports of elevation group debt asset)\n * that can be borrowed when this reserve is used as collateral.\n * - u64::MAX for inf\n * - 0 to disable borrows in this elevation group (expected value for the debt asset)\n */\n borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>\n}\n\nexport interface ReserveConfigJSON {\n /** Status of the reserve Active/Obsolete/Hidden */\n status: number\n /** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */\n assetTier: number\n /** Flat rate that goes to the host */\n hostFixedInterestRateBps: number\n /** Boost for side (debt or collateral) */\n multiplierSideBoost: Array<number>\n /** Reward points multiplier per obligation type */\n multiplierTagBoost: Array<number>\n /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */\n protocolTakeRatePct: number\n /** Cut of the liquidation bonus that the protocol receives, as a percentage */\n protocolLiquidationFeePct: number\n /**\n * Target ratio of the value of borrows to deposits, as a percentage\n * 0 if use as collateral is disabled\n */\n loanToValuePct: number\n /** Loan to value ratio at which an obligation can be liquidated, as percentage */\n liquidationThresholdPct: number\n /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n minLiquidationBonusBps: number\n /** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n maxLiquidationBonusBps: number\n /** Bad debt liquidation bonus for an undercollateralized obligation, as bps */\n badDebtLiquidationBonusBps: number\n /** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */\n deleveragingMarginCallPeriodSecs: string\n /**\n * The rate at which the deleveraging threshold decreases in slots per bps\n * e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)\n */\n deleveragingThresholdSlotsPerBps: string\n /** Program owner fees assessed, separate from gains due to interest accrual */\n fees: types.ReserveFeesJSON\n /** Borrow rate curve based on utilization */\n borrowRateCurve: types.BorrowRateCurveJSON\n /** Borrow factor in percentage - used for risk adjustment */\n borrowFactorPct: string\n /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */\n depositLimit: string\n /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */\n borrowLimit: string\n /** Token id from TokenInfos struct */\n tokenInfo: types.TokenInfoJSON\n /** Deposit withdrawl caps - deposit & redeem */\n depositWithdrawalCap: types.WithdrawalCapsJSON\n /** Debt withdrawl caps - borrow & repay */\n debtWithdrawalCap: types.WithdrawalCapsJSON\n elevationGroups: Array<number>\n disableUsageAsCollOutsideEmode: number\n utilizationLimitBlockBorrowingAbove: number\n reserved1: Array<number>\n /**\n * Maximum amount liquidity of this reserve borrowed outside all elevation groups\n * - u64::MAX for inf\n * - 0 to disable borrows outside elevation groups\n */\n borrowLimitOutsideElevationGroup: string\n /**\n * Defines the maximum amount (in lamports of elevation group debt asset)\n * that can be borrowed when this reserve is used as collateral.\n * - u64::MAX for inf\n * - 0 to disable borrows in this elevation group (expected value for the debt asset)\n */\n borrowLimitAgainstThisCollateralInElevationGroup: Array<string>\n}\n\n/** Reserve configuration values */\nexport class ReserveConfig {\n /** Status of the reserve Active/Obsolete/Hidden */\n readonly status: number\n /** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */\n readonly assetTier: number\n /** Flat rate that goes to the host */\n readonly hostFixedInterestRateBps: number\n /** Boost for side (debt or collateral) */\n readonly multiplierSideBoost: Array<number>\n /** Reward points multiplier per obligation type */\n readonly multiplierTagBoost: Array<number>\n /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */\n readonly protocolTakeRatePct: number\n /** Cut of the liquidation bonus that the protocol receives, as a percentage */\n readonly protocolLiquidationFeePct: number\n /**\n * Target ratio of the value of borrows to deposits, as a percentage\n * 0 if use as collateral is disabled\n */\n readonly loanToValuePct: number\n /** Loan to value ratio at which an obligation can be liquidated, as percentage */\n readonly liquidationThresholdPct: number\n /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n readonly minLiquidationBonusBps: number\n /** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n readonly maxLiquidationBonusBps: number\n /** Bad debt liquidation bonus for an undercollateralized obligation, as bps */\n readonly badDebtLiquidationBonusBps: number\n /** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */\n readonly deleveragingMarginCallPeriodSecs: BN\n /**\n * The rate at which the deleveraging threshold decreases in slots per bps\n * e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)\n */\n readonly deleveragingThresholdSlotsPerBps: BN\n /** Program owner fees assessed, separate from gains due to interest accrual */\n readonly fees: types.ReserveFees\n /** Borrow rate curve based on utilization */\n readonly borrowRateCurve: types.BorrowRateCurve\n /** Borrow factor in percentage - used for risk adjustment */\n readonly borrowFactorPct: BN\n /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */\n readonly depositLimit: BN\n /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */\n readonly borrowLimit: BN\n /** Token id from TokenInfos struct */\n readonly tokenInfo: types.TokenInfo\n /** Deposit withdrawl caps - deposit & redeem */\n readonly depositWithdrawalCap: types.WithdrawalCaps\n /** Debt withdrawl caps - borrow & repay */\n readonly debtWithdrawalCap: types.WithdrawalCaps\n readonly elevationGroups: Array<number>\n readonly disableUsageAsCollOutsideEmode: number\n readonly utilizationLimitBlockBorrowingAbove: number\n readonly reserved1: Array<number>\n /**\n * Maximum amount liquidity of this reserve borrowed outside all elevation groups\n * - u64::MAX for inf\n * - 0 to disable borrows outside elevation groups\n */\n readonly borrowLimitOutsideElevationGroup: BN\n /**\n * Defines the maximum amount (in lamports of elevation group debt asset)\n * that can be borrowed when this reserve is used as collateral.\n * - u64::MAX for inf\n * - 0 to disable borrows in this elevation group (expected value for the debt asset)\n */\n readonly borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>\n\n constructor(fields: ReserveConfigFields) {\n this.status = fields.status\n this.assetTier = fields.assetTier\n this.hostFixedInterestRateBps = fields.hostFixedInterestRateBps\n this.multiplierSideBoost = fields.multiplierSideBoost\n this.multiplierTagBoost = fields.multiplierTagBoost\n this.protocolTakeRatePct = fields.protocolTakeRatePct\n this.protocolLiquidationFeePct = fields.protocolLiquidationFeePct\n this.loanToValuePct = fields.loanToValuePct\n this.liquidationThresholdPct = fields.liquidationThresholdPct\n this.minLiquidationBonusBps = fields.minLiquidationBonusBps\n this.maxLiquidationBonusBps = fields.maxLiquidationBonusBps\n this.badDebtLiquidationBonusBps = fields.badDebtLiquidationBonusBps\n this.deleveragingMarginCallPeriodSecs =\n fields.deleveragingMarginCallPeriodSecs\n this.deleveragingThresholdSlotsPerBps =\n fields.deleveragingThresholdSlotsPerBps\n this.fees = new types.ReserveFees({ ...fields.fees })\n this.borrowRateCurve = new types.BorrowRateCurve({\n ...fields.borrowRateCurve,\n })\n this.borrowFactorPct = fields.borrowFactorPct\n this.depositLimit = fields.depositLimit\n this.borrowLimit = fields.borrowLimit\n this.tokenInfo = new types.TokenInfo({ ...fields.tokenInfo })\n this.depositWithdrawalCap = new types.WithdrawalCaps({\n ...fields.depositWithdrawalCap,\n })\n this.debtWithdrawalCap = new types.WithdrawalCaps({\n ...fields.debtWithdrawalCap,\n })\n this.elevationGroups = fields.elevationGroups\n this.disableUsageAsCollOutsideEmode = fields.disableUsageAsCollOutsideEmode\n this.utilizationLimitBlockBorrowingAbove =\n fields.utilizationLimitBlockBorrowingAbove\n this.reserved1 = fields.reserved1\n this.borrowLimitOutsideElevationGroup =\n fields.borrowLimitOutsideElevationGroup\n this.borrowLimitAgainstThisCollateralInElevationGroup =\n fields.borrowLimitAgainstThisCollateralInElevationGroup\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.u8(\"status\"),\n borsh.u8(\"assetTier\"),\n borsh.u16(\"hostFixedInterestRateBps\"),\n borsh.array(borsh.u8(), 2, \"multiplierSideBoost\"),\n borsh.array(borsh.u8(), 8, \"multiplierTagBoost\"),\n borsh.u8(\"protocolTakeRatePct\"),\n borsh.u8(\"protocolLiquidationFeePct\"),\n borsh.u8(\"loanToValuePct\"),\n borsh.u8(\"liquidationThresholdPct\"),\n borsh.u16(\"minLiquidationBonusBps\"),\n borsh.u16(\"maxLiquidationBonusBps\"),\n borsh.u16(\"badDebtLiquidationBonusBps\"),\n borsh.u64(\"deleveragingMarginCallPeriodSecs\"),\n borsh.u64(\"deleveragingThresholdSlotsPerBps\"),\n types.ReserveFees.layout(\"fees\"),\n types.BorrowRateCurve.layout(\"borrowRateCurve\"),\n borsh.u64(\"borrowFactorPct\"),\n borsh.u64(\"depositLimit\"),\n borsh.u64(\"borrowLimit\"),\n types.TokenInfo.layout(\"tokenInfo\"),\n types.WithdrawalCaps.layout(\"depositWithdrawalCap\"),\n types.WithdrawalCaps.layout(\"debtWithdrawalCap\"),\n borsh.array(borsh.u8(), 20, \"elevationGroups\"),\n borsh.u8(\"disableUsageAsCollOutsideEmode\"),\n borsh.u8(\"utilizationLimitBlockBorrowingAbove\"),\n borsh.array(borsh.u8(), 2, \"reserved1\"),\n borsh.u64(\"borrowLimitOutsideElevationGroup\"),\n borsh.array(\n borsh.u64(),\n 32,\n \"borrowLimitAgainstThisCollateralInElevationGroup\"\n ),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new ReserveConfig({\n status: obj.status,\n assetTier: obj.assetTier,\n hostFixedInterestRateBps: obj.hostFixedInterestRateBps,\n multiplierSideBoost: obj.multiplierSideBoost,\n multiplierTagBoost: obj.multiplierTagBoost,\n protocolTakeRatePct: obj.protocolTakeRatePct,\n protocolLiquidationFeePct: obj.protocolLiquidationFeePct,\n loanToValuePct: obj.loanToValuePct,\n liquidationThresholdPct: obj.liquidationThresholdPct,\n minLiquidationBonusBps: obj.minLiquidationBonusBps,\n maxLiquidationBonusBps: obj.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: obj.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs: obj.deleveragingMarginCallPeriodSecs,\n deleveragingThresholdSlotsPerBps: obj.deleveragingThresholdSlotsPerBps,\n fees: types.ReserveFees.fromDecoded(obj.fees),\n borrowRateCurve: types.BorrowRateCurve.fromDecoded(obj.borrowRateCurve),\n borrowFactorPct: obj.borrowFactorPct,\n depositLimit: obj.depositLimit,\n borrowLimit: obj.borrowLimit,\n tokenInfo: types.TokenInfo.fromDecoded(obj.tokenInfo),\n depositWithdrawalCap: types.WithdrawalCaps.fromDecoded(\n obj.depositWithdrawalCap\n ),\n debtWithdrawalCap: types.WithdrawalCaps.fromDecoded(\n obj.debtWithdrawalCap\n ),\n elevationGroups: obj.elevationGroups,\n disableUsageAsCollOutsideEmode: obj.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n obj.utilizationLimitBlockBorrowingAbove,\n reserved1: obj.reserved1,\n borrowLimitOutsideElevationGroup: obj.borrowLimitOutsideElevationGroup,\n borrowLimitAgainstThisCollateralInElevationGroup:\n obj.borrowLimitAgainstThisCollateralInElevationGroup,\n })\n }\n\n static toEncodable(fields: ReserveConfigFields) {\n return {\n status: fields.status,\n assetTier: fields.assetTier,\n hostFixedInterestRateBps: fields.hostFixedInterestRateBps,\n multiplierSideBoost: fields.multiplierSideBoost,\n multiplierTagBoost: fields.multiplierTagBoost,\n protocolTakeRatePct: fields.protocolTakeRatePct,\n protocolLiquidationFeePct: fields.protocolLiquidationFeePct,\n loanToValuePct: fields.loanToValuePct,\n liquidationThresholdPct: fields.liquidationThresholdPct,\n minLiquidationBonusBps: fields.minLiquidationBonusBps,\n maxLiquidationBonusBps: fields.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: fields.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs: fields.deleveragingMarginCallPeriodSecs,\n deleveragingThresholdSlotsPerBps: fields.deleveragingThresholdSlotsPerBps,\n fees: types.ReserveFees.toEncodable(fields.fees),\n borrowRateCurve: types.BorrowRateCurve.toEncodable(\n fields.borrowRateCurve\n ),\n borrowFactorPct: fields.borrowFactorPct,\n depositLimit: fields.depositLimit,\n borrowLimit: fields.borrowLimit,\n tokenInfo: types.TokenInfo.toEncodable(fields.tokenInfo),\n depositWithdrawalCap: types.WithdrawalCaps.toEncodable(\n fields.depositWithdrawalCap\n ),\n debtWithdrawalCap: types.WithdrawalCaps.toEncodable(\n fields.debtWithdrawalCap\n ),\n elevationGroups: fields.elevationGroups,\n disableUsageAsCollOutsideEmode: fields.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n fields.utilizationLimitBlockBorrowingAbove,\n reserved1: fields.reserved1,\n borrowLimitOutsideElevationGroup: fields.borrowLimitOutsideElevationGroup,\n borrowLimitAgainstThisCollateralInElevationGroup:\n fields.borrowLimitAgainstThisCollateralInElevationGroup,\n }\n }\n\n toJSON(): ReserveConfigJSON {\n return {\n status: this.status,\n assetTier: this.assetTier,\n hostFixedInterestRateBps: this.hostFixedInterestRateBps,\n multiplierSideBoost: this.multiplierSideBoost,\n multiplierTagBoost: this.multiplierTagBoost,\n protocolTakeRatePct: this.protocolTakeRatePct,\n protocolLiquidationFeePct: this.protocolLiquidationFeePct,\n loanToValuePct: this.loanToValuePct,\n liquidationThresholdPct: this.liquidationThresholdPct,\n minLiquidationBonusBps: this.minLiquidationBonusBps,\n maxLiquidationBonusBps: this.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: this.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs:\n this.deleveragingMarginCallPeriodSecs.toString(),\n deleveragingThresholdSlotsPerBps:\n this.deleveragingThresholdSlotsPerBps.toString(),\n fees: this.fees.toJSON(),\n borrowRateCurve: this.borrowRateCurve.toJSON(),\n borrowFactorPct: this.borrowFactorPct.toString(),\n depositLimit: this.depositLimit.toString(),\n borrowLimit: this.borrowLimit.toString(),\n tokenInfo: this.tokenInfo.toJSON(),\n depositWithdrawalCap: this.depositWithdrawalCap.toJSON(),\n debtWithdrawalCap: this.debtWithdrawalCap.toJSON(),\n elevationGroups: this.elevationGroups,\n disableUsageAsCollOutsideEmode: this.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n this.utilizationLimitBlockBorrowingAbove,\n reserved1: this.reserved1,\n borrowLimitOutsideElevationGroup:\n this.borrowLimitOutsideElevationGroup.toString(),\n borrowLimitAgainstThisCollateralInElevationGroup:\n this.borrowLimitAgainstThisCollateralInElevationGroup.map((item) =>\n item.toString()\n ),\n }\n }\n\n static fromJSON(obj: ReserveConfigJSON): ReserveConfig {\n return new ReserveConfig({\n status: obj.status,\n assetTier: obj.assetTier,\n hostFixedInterestRateBps: obj.hostFixedInterestRateBps,\n multiplierSideBoost: obj.multiplierSideBoost,\n multiplierTagBoost: obj.multiplierTagBoost,\n protocolTakeRatePct: obj.protocolTakeRatePct,\n protocolLiquidationFeePct: obj.protocolLiquidationFeePct,\n loanToValuePct: obj.loanToValuePct,\n liquidationThresholdPct: obj.liquidationThresholdPct,\n minLiquidationBonusBps: obj.minLiquidationBonusBps,\n maxLiquidationBonusBps: obj.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: obj.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs: new BN(\n obj.deleveragingMarginCallPeriodSecs\n ),\n deleveragingThresholdSlotsPerBps: new BN(\n obj.deleveragingThresholdSlotsPerBps\n ),\n fees: types.ReserveFees.fromJSON(obj.fees),\n borrowRateCurve: types.BorrowRateCurve.fromJSON(obj.borrowRateCurve),\n borrowFactorPct: new BN(obj.borrowFactorPct),\n depositLimit: new BN(obj.depositLimit),\n borrowLimit: new BN(obj.borrowLimit),\n tokenInfo: types.TokenInfo.fromJSON(obj.tokenInfo),\n depositWithdrawalCap: types.WithdrawalCaps.fromJSON(\n obj.depositWithdrawalCap\n ),\n debtWithdrawalCap: types.WithdrawalCaps.fromJSON(obj.debtWithdrawalCap),\n elevationGroups: obj.elevationGroups,\n disableUsageAsCollOutsideEmode: obj.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n obj.utilizationLimitBlockBorrowingAbove,\n reserved1: obj.reserved1,\n borrowLimitOutsideElevationGroup: new BN(\n obj.borrowLimitOutsideElevationGroup\n ),\n borrowLimitAgainstThisCollateralInElevationGroup:\n obj.borrowLimitAgainstThisCollateralInElevationGroup.map(\n (item) => new BN(item)\n ),\n })\n }\n\n toEncodable() {\n return ReserveConfig.toEncodable(this)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ReserveConfig.js","sourceRoot":"","sources":["../../../src/idl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C,GAAG,CAAC,eAAe,CAAC;YACpE,eAAe,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,eAAe,CAAC;YAC5C,YAAY,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,YAAY,CAAC;YACtC,WAAW,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,WAAW,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC;YAClD,oBAAoB,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CACjD,GAAG,CAAC,oBAAoB,CACzB;YACD,iBAAiB,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC;YACvE,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,8BAA8B,EAAE,GAAG,CAAC,8BAA8B;YAClE,mCAAmC,EACjC,GAAG,CAAC,mCAAmC;YACzC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,gCAAgC,EAAE,IAAI,eAAE,CACtC,GAAG,CAAC,gCAAgC,CACrC;YACD,gDAAgD,EAC9C,GAAG,CAAC,gDAAgD,CAAC,GAAG,CACtD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CACvB;SACJ,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF;AAhUD,sCAgUC","sourcesContent":["import { PublicKey } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\"\n\nexport interface ReserveConfigFields {\n /** Status of the reserve Active/Obsolete/Hidden */\n status: number\n /** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */\n assetTier: number\n /** Flat rate that goes to the host */\n hostFixedInterestRateBps: number\n /** [DEPRECATED] Boost for side (debt or collateral) */\n reserved2: Array<number>\n /** [DEPRECATED] Reward points multiplier per obligation type */\n reserved3: Array<number>\n /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */\n protocolTakeRatePct: number\n /** Cut of the liquidation bonus that the protocol receives, as a percentage */\n protocolLiquidationFeePct: number\n /**\n * Target ratio of the value of borrows to deposits, as a percentage\n * 0 if use as collateral is disabled\n */\n loanToValuePct: number\n /** Loan to value ratio at which an obligation can be liquidated, as percentage */\n liquidationThresholdPct: number\n /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n minLiquidationBonusBps: number\n /** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n maxLiquidationBonusBps: number\n /** Bad debt liquidation bonus for an undercollateralized obligation, as bps */\n badDebtLiquidationBonusBps: number\n /** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */\n deleveragingMarginCallPeriodSecs: BN\n /**\n * The rate at which the deleveraging threshold decreases in slots per bps\n * e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)\n */\n deleveragingThresholdSlotsPerBps: BN\n /** Program owner fees assessed, separate from gains due to interest accrual */\n fees: types.ReserveFeesFields\n /** Borrow rate curve based on utilization */\n borrowRateCurve: types.BorrowRateCurveFields\n /** Borrow factor in percentage - used for risk adjustment */\n borrowFactorPct: BN\n /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */\n depositLimit: BN\n /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */\n borrowLimit: BN\n /** Token id from TokenInfos struct */\n tokenInfo: types.TokenInfoFields\n /** Deposit withdrawl caps - deposit & redeem */\n depositWithdrawalCap: types.WithdrawalCapsFields\n /** Debt withdrawl caps - borrow & repay */\n debtWithdrawalCap: types.WithdrawalCapsFields\n elevationGroups: Array<number>\n disableUsageAsCollOutsideEmode: number\n utilizationLimitBlockBorrowingAbove: number\n reserved1: Array<number>\n /**\n * Maximum amount liquidity of this reserve borrowed outside all elevation groups\n * - u64::MAX for inf\n * - 0 to disable borrows outside elevation groups\n */\n borrowLimitOutsideElevationGroup: BN\n /**\n * Defines the maximum amount (in lamports of elevation group debt asset)\n * that can be borrowed when this reserve is used as collateral.\n * - u64::MAX for inf\n * - 0 to disable borrows in this elevation group (expected value for the debt asset)\n */\n borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>\n}\n\nexport interface ReserveConfigJSON {\n /** Status of the reserve Active/Obsolete/Hidden */\n status: number\n /** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */\n assetTier: number\n /** Flat rate that goes to the host */\n hostFixedInterestRateBps: number\n /** [DEPRECATED] Boost for side (debt or collateral) */\n reserved2: Array<number>\n /** [DEPRECATED] Reward points multiplier per obligation type */\n reserved3: Array<number>\n /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */\n protocolTakeRatePct: number\n /** Cut of the liquidation bonus that the protocol receives, as a percentage */\n protocolLiquidationFeePct: number\n /**\n * Target ratio of the value of borrows to deposits, as a percentage\n * 0 if use as collateral is disabled\n */\n loanToValuePct: number\n /** Loan to value ratio at which an obligation can be liquidated, as percentage */\n liquidationThresholdPct: number\n /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n minLiquidationBonusBps: number\n /** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n maxLiquidationBonusBps: number\n /** Bad debt liquidation bonus for an undercollateralized obligation, as bps */\n badDebtLiquidationBonusBps: number\n /** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */\n deleveragingMarginCallPeriodSecs: string\n /**\n * The rate at which the deleveraging threshold decreases in slots per bps\n * e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)\n */\n deleveragingThresholdSlotsPerBps: string\n /** Program owner fees assessed, separate from gains due to interest accrual */\n fees: types.ReserveFeesJSON\n /** Borrow rate curve based on utilization */\n borrowRateCurve: types.BorrowRateCurveJSON\n /** Borrow factor in percentage - used for risk adjustment */\n borrowFactorPct: string\n /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */\n depositLimit: string\n /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */\n borrowLimit: string\n /** Token id from TokenInfos struct */\n tokenInfo: types.TokenInfoJSON\n /** Deposit withdrawl caps - deposit & redeem */\n depositWithdrawalCap: types.WithdrawalCapsJSON\n /** Debt withdrawl caps - borrow & repay */\n debtWithdrawalCap: types.WithdrawalCapsJSON\n elevationGroups: Array<number>\n disableUsageAsCollOutsideEmode: number\n utilizationLimitBlockBorrowingAbove: number\n reserved1: Array<number>\n /**\n * Maximum amount liquidity of this reserve borrowed outside all elevation groups\n * - u64::MAX for inf\n * - 0 to disable borrows outside elevation groups\n */\n borrowLimitOutsideElevationGroup: string\n /**\n * Defines the maximum amount (in lamports of elevation group debt asset)\n * that can be borrowed when this reserve is used as collateral.\n * - u64::MAX for inf\n * - 0 to disable borrows in this elevation group (expected value for the debt asset)\n */\n borrowLimitAgainstThisCollateralInElevationGroup: Array<string>\n}\n\n/** Reserve configuration values */\nexport class ReserveConfig {\n /** Status of the reserve Active/Obsolete/Hidden */\n readonly status: number\n /** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */\n readonly assetTier: number\n /** Flat rate that goes to the host */\n readonly hostFixedInterestRateBps: number\n /** [DEPRECATED] Boost for side (debt or collateral) */\n readonly reserved2: Array<number>\n /** [DEPRECATED] Reward points multiplier per obligation type */\n readonly reserved3: Array<number>\n /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */\n readonly protocolTakeRatePct: number\n /** Cut of the liquidation bonus that the protocol receives, as a percentage */\n readonly protocolLiquidationFeePct: number\n /**\n * Target ratio of the value of borrows to deposits, as a percentage\n * 0 if use as collateral is disabled\n */\n readonly loanToValuePct: number\n /** Loan to value ratio at which an obligation can be liquidated, as percentage */\n readonly liquidationThresholdPct: number\n /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n readonly minLiquidationBonusBps: number\n /** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */\n readonly maxLiquidationBonusBps: number\n /** Bad debt liquidation bonus for an undercollateralized obligation, as bps */\n readonly badDebtLiquidationBonusBps: number\n /** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */\n readonly deleveragingMarginCallPeriodSecs: BN\n /**\n * The rate at which the deleveraging threshold decreases in slots per bps\n * e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)\n */\n readonly deleveragingThresholdSlotsPerBps: BN\n /** Program owner fees assessed, separate from gains due to interest accrual */\n readonly fees: types.ReserveFees\n /** Borrow rate curve based on utilization */\n readonly borrowRateCurve: types.BorrowRateCurve\n /** Borrow factor in percentage - used for risk adjustment */\n readonly borrowFactorPct: BN\n /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */\n readonly depositLimit: BN\n /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */\n readonly borrowLimit: BN\n /** Token id from TokenInfos struct */\n readonly tokenInfo: types.TokenInfo\n /** Deposit withdrawl caps - deposit & redeem */\n readonly depositWithdrawalCap: types.WithdrawalCaps\n /** Debt withdrawl caps - borrow & repay */\n readonly debtWithdrawalCap: types.WithdrawalCaps\n readonly elevationGroups: Array<number>\n readonly disableUsageAsCollOutsideEmode: number\n readonly utilizationLimitBlockBorrowingAbove: number\n readonly reserved1: Array<number>\n /**\n * Maximum amount liquidity of this reserve borrowed outside all elevation groups\n * - u64::MAX for inf\n * - 0 to disable borrows outside elevation groups\n */\n readonly borrowLimitOutsideElevationGroup: BN\n /**\n * Defines the maximum amount (in lamports of elevation group debt asset)\n * that can be borrowed when this reserve is used as collateral.\n * - u64::MAX for inf\n * - 0 to disable borrows in this elevation group (expected value for the debt asset)\n */\n readonly borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>\n\n constructor(fields: ReserveConfigFields) {\n this.status = fields.status\n this.assetTier = fields.assetTier\n this.hostFixedInterestRateBps = fields.hostFixedInterestRateBps\n this.reserved2 = fields.reserved2\n this.reserved3 = fields.reserved3\n this.protocolTakeRatePct = fields.protocolTakeRatePct\n this.protocolLiquidationFeePct = fields.protocolLiquidationFeePct\n this.loanToValuePct = fields.loanToValuePct\n this.liquidationThresholdPct = fields.liquidationThresholdPct\n this.minLiquidationBonusBps = fields.minLiquidationBonusBps\n this.maxLiquidationBonusBps = fields.maxLiquidationBonusBps\n this.badDebtLiquidationBonusBps = fields.badDebtLiquidationBonusBps\n this.deleveragingMarginCallPeriodSecs =\n fields.deleveragingMarginCallPeriodSecs\n this.deleveragingThresholdSlotsPerBps =\n fields.deleveragingThresholdSlotsPerBps\n this.fees = new types.ReserveFees({ ...fields.fees })\n this.borrowRateCurve = new types.BorrowRateCurve({\n ...fields.borrowRateCurve,\n })\n this.borrowFactorPct = fields.borrowFactorPct\n this.depositLimit = fields.depositLimit\n this.borrowLimit = fields.borrowLimit\n this.tokenInfo = new types.TokenInfo({ ...fields.tokenInfo })\n this.depositWithdrawalCap = new types.WithdrawalCaps({\n ...fields.depositWithdrawalCap,\n })\n this.debtWithdrawalCap = new types.WithdrawalCaps({\n ...fields.debtWithdrawalCap,\n })\n this.elevationGroups = fields.elevationGroups\n this.disableUsageAsCollOutsideEmode = fields.disableUsageAsCollOutsideEmode\n this.utilizationLimitBlockBorrowingAbove =\n fields.utilizationLimitBlockBorrowingAbove\n this.reserved1 = fields.reserved1\n this.borrowLimitOutsideElevationGroup =\n fields.borrowLimitOutsideElevationGroup\n this.borrowLimitAgainstThisCollateralInElevationGroup =\n fields.borrowLimitAgainstThisCollateralInElevationGroup\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.u8(\"status\"),\n borsh.u8(\"assetTier\"),\n borsh.u16(\"hostFixedInterestRateBps\"),\n borsh.array(borsh.u8(), 2, \"reserved2\"),\n borsh.array(borsh.u8(), 8, \"reserved3\"),\n borsh.u8(\"protocolTakeRatePct\"),\n borsh.u8(\"protocolLiquidationFeePct\"),\n borsh.u8(\"loanToValuePct\"),\n borsh.u8(\"liquidationThresholdPct\"),\n borsh.u16(\"minLiquidationBonusBps\"),\n borsh.u16(\"maxLiquidationBonusBps\"),\n borsh.u16(\"badDebtLiquidationBonusBps\"),\n borsh.u64(\"deleveragingMarginCallPeriodSecs\"),\n borsh.u64(\"deleveragingThresholdSlotsPerBps\"),\n types.ReserveFees.layout(\"fees\"),\n types.BorrowRateCurve.layout(\"borrowRateCurve\"),\n borsh.u64(\"borrowFactorPct\"),\n borsh.u64(\"depositLimit\"),\n borsh.u64(\"borrowLimit\"),\n types.TokenInfo.layout(\"tokenInfo\"),\n types.WithdrawalCaps.layout(\"depositWithdrawalCap\"),\n types.WithdrawalCaps.layout(\"debtWithdrawalCap\"),\n borsh.array(borsh.u8(), 20, \"elevationGroups\"),\n borsh.u8(\"disableUsageAsCollOutsideEmode\"),\n borsh.u8(\"utilizationLimitBlockBorrowingAbove\"),\n borsh.array(borsh.u8(), 2, \"reserved1\"),\n borsh.u64(\"borrowLimitOutsideElevationGroup\"),\n borsh.array(\n borsh.u64(),\n 32,\n \"borrowLimitAgainstThisCollateralInElevationGroup\"\n ),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new ReserveConfig({\n status: obj.status,\n assetTier: obj.assetTier,\n hostFixedInterestRateBps: obj.hostFixedInterestRateBps,\n reserved2: obj.reserved2,\n reserved3: obj.reserved3,\n protocolTakeRatePct: obj.protocolTakeRatePct,\n protocolLiquidationFeePct: obj.protocolLiquidationFeePct,\n loanToValuePct: obj.loanToValuePct,\n liquidationThresholdPct: obj.liquidationThresholdPct,\n minLiquidationBonusBps: obj.minLiquidationBonusBps,\n maxLiquidationBonusBps: obj.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: obj.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs: obj.deleveragingMarginCallPeriodSecs,\n deleveragingThresholdSlotsPerBps: obj.deleveragingThresholdSlotsPerBps,\n fees: types.ReserveFees.fromDecoded(obj.fees),\n borrowRateCurve: types.BorrowRateCurve.fromDecoded(obj.borrowRateCurve),\n borrowFactorPct: obj.borrowFactorPct,\n depositLimit: obj.depositLimit,\n borrowLimit: obj.borrowLimit,\n tokenInfo: types.TokenInfo.fromDecoded(obj.tokenInfo),\n depositWithdrawalCap: types.WithdrawalCaps.fromDecoded(\n obj.depositWithdrawalCap\n ),\n debtWithdrawalCap: types.WithdrawalCaps.fromDecoded(\n obj.debtWithdrawalCap\n ),\n elevationGroups: obj.elevationGroups,\n disableUsageAsCollOutsideEmode: obj.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n obj.utilizationLimitBlockBorrowingAbove,\n reserved1: obj.reserved1,\n borrowLimitOutsideElevationGroup: obj.borrowLimitOutsideElevationGroup,\n borrowLimitAgainstThisCollateralInElevationGroup:\n obj.borrowLimitAgainstThisCollateralInElevationGroup,\n })\n }\n\n static toEncodable(fields: ReserveConfigFields) {\n return {\n status: fields.status,\n assetTier: fields.assetTier,\n hostFixedInterestRateBps: fields.hostFixedInterestRateBps,\n reserved2: fields.reserved2,\n reserved3: fields.reserved3,\n protocolTakeRatePct: fields.protocolTakeRatePct,\n protocolLiquidationFeePct: fields.protocolLiquidationFeePct,\n loanToValuePct: fields.loanToValuePct,\n liquidationThresholdPct: fields.liquidationThresholdPct,\n minLiquidationBonusBps: fields.minLiquidationBonusBps,\n maxLiquidationBonusBps: fields.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: fields.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs: fields.deleveragingMarginCallPeriodSecs,\n deleveragingThresholdSlotsPerBps: fields.deleveragingThresholdSlotsPerBps,\n fees: types.ReserveFees.toEncodable(fields.fees),\n borrowRateCurve: types.BorrowRateCurve.toEncodable(\n fields.borrowRateCurve\n ),\n borrowFactorPct: fields.borrowFactorPct,\n depositLimit: fields.depositLimit,\n borrowLimit: fields.borrowLimit,\n tokenInfo: types.TokenInfo.toEncodable(fields.tokenInfo),\n depositWithdrawalCap: types.WithdrawalCaps.toEncodable(\n fields.depositWithdrawalCap\n ),\n debtWithdrawalCap: types.WithdrawalCaps.toEncodable(\n fields.debtWithdrawalCap\n ),\n elevationGroups: fields.elevationGroups,\n disableUsageAsCollOutsideEmode: fields.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n fields.utilizationLimitBlockBorrowingAbove,\n reserved1: fields.reserved1,\n borrowLimitOutsideElevationGroup: fields.borrowLimitOutsideElevationGroup,\n borrowLimitAgainstThisCollateralInElevationGroup:\n fields.borrowLimitAgainstThisCollateralInElevationGroup,\n }\n }\n\n toJSON(): ReserveConfigJSON {\n return {\n status: this.status,\n assetTier: this.assetTier,\n hostFixedInterestRateBps: this.hostFixedInterestRateBps,\n reserved2: this.reserved2,\n reserved3: this.reserved3,\n protocolTakeRatePct: this.protocolTakeRatePct,\n protocolLiquidationFeePct: this.protocolLiquidationFeePct,\n loanToValuePct: this.loanToValuePct,\n liquidationThresholdPct: this.liquidationThresholdPct,\n minLiquidationBonusBps: this.minLiquidationBonusBps,\n maxLiquidationBonusBps: this.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: this.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs:\n this.deleveragingMarginCallPeriodSecs.toString(),\n deleveragingThresholdSlotsPerBps:\n this.deleveragingThresholdSlotsPerBps.toString(),\n fees: this.fees.toJSON(),\n borrowRateCurve: this.borrowRateCurve.toJSON(),\n borrowFactorPct: this.borrowFactorPct.toString(),\n depositLimit: this.depositLimit.toString(),\n borrowLimit: this.borrowLimit.toString(),\n tokenInfo: this.tokenInfo.toJSON(),\n depositWithdrawalCap: this.depositWithdrawalCap.toJSON(),\n debtWithdrawalCap: this.debtWithdrawalCap.toJSON(),\n elevationGroups: this.elevationGroups,\n disableUsageAsCollOutsideEmode: this.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n this.utilizationLimitBlockBorrowingAbove,\n reserved1: this.reserved1,\n borrowLimitOutsideElevationGroup:\n this.borrowLimitOutsideElevationGroup.toString(),\n borrowLimitAgainstThisCollateralInElevationGroup:\n this.borrowLimitAgainstThisCollateralInElevationGroup.map((item) =>\n item.toString()\n ),\n }\n }\n\n static fromJSON(obj: ReserveConfigJSON): ReserveConfig {\n return new ReserveConfig({\n status: obj.status,\n assetTier: obj.assetTier,\n hostFixedInterestRateBps: obj.hostFixedInterestRateBps,\n reserved2: obj.reserved2,\n reserved3: obj.reserved3,\n protocolTakeRatePct: obj.protocolTakeRatePct,\n protocolLiquidationFeePct: obj.protocolLiquidationFeePct,\n loanToValuePct: obj.loanToValuePct,\n liquidationThresholdPct: obj.liquidationThresholdPct,\n minLiquidationBonusBps: obj.minLiquidationBonusBps,\n maxLiquidationBonusBps: obj.maxLiquidationBonusBps,\n badDebtLiquidationBonusBps: obj.badDebtLiquidationBonusBps,\n deleveragingMarginCallPeriodSecs: new BN(\n obj.deleveragingMarginCallPeriodSecs\n ),\n deleveragingThresholdSlotsPerBps: new BN(\n obj.deleveragingThresholdSlotsPerBps\n ),\n fees: types.ReserveFees.fromJSON(obj.fees),\n borrowRateCurve: types.BorrowRateCurve.fromJSON(obj.borrowRateCurve),\n borrowFactorPct: new BN(obj.borrowFactorPct),\n depositLimit: new BN(obj.depositLimit),\n borrowLimit: new BN(obj.borrowLimit),\n tokenInfo: types.TokenInfo.fromJSON(obj.tokenInfo),\n depositWithdrawalCap: types.WithdrawalCaps.fromJSON(\n obj.depositWithdrawalCap\n ),\n debtWithdrawalCap: types.WithdrawalCaps.fromJSON(obj.debtWithdrawalCap),\n elevationGroups: obj.elevationGroups,\n disableUsageAsCollOutsideEmode: obj.disableUsageAsCollOutsideEmode,\n utilizationLimitBlockBorrowingAbove:\n obj.utilizationLimitBlockBorrowingAbove,\n reserved1: obj.reserved1,\n borrowLimitOutsideElevationGroup: new BN(\n obj.borrowLimitOutsideElevationGroup\n ),\n borrowLimitAgainstThisCollateralInElevationGroup:\n obj.borrowLimitAgainstThisCollateralInElevationGroup.map(\n (item) => new BN(item)\n ),\n })\n }\n\n toEncodable() {\n return ReserveConfig.toEncodable(this)\n }\n}\n"]}
|
|
@@ -468,30 +468,30 @@ export declare class DeleveragingThresholdSlotsPerBps {
|
|
|
468
468
|
DeleveragingThresholdSlotsPerBps: {};
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
export interface
|
|
472
|
-
kind: "
|
|
471
|
+
export interface DeprecatedUpdateMultiplierSideBoostJSON {
|
|
472
|
+
kind: "DeprecatedUpdateMultiplierSideBoost";
|
|
473
473
|
}
|
|
474
|
-
export declare class
|
|
474
|
+
export declare class DeprecatedUpdateMultiplierSideBoost {
|
|
475
475
|
static readonly discriminator = 36;
|
|
476
|
-
static readonly kind = "
|
|
476
|
+
static readonly kind = "DeprecatedUpdateMultiplierSideBoost";
|
|
477
477
|
readonly discriminator = 36;
|
|
478
|
-
readonly kind = "
|
|
479
|
-
toJSON():
|
|
478
|
+
readonly kind = "DeprecatedUpdateMultiplierSideBoost";
|
|
479
|
+
toJSON(): DeprecatedUpdateMultiplierSideBoostJSON;
|
|
480
480
|
toEncodable(): {
|
|
481
|
-
|
|
481
|
+
DeprecatedUpdateMultiplierSideBoost: {};
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
|
-
export interface
|
|
485
|
-
kind: "
|
|
484
|
+
export interface DeprecatedUpdateMultiplierTagBoostJSON {
|
|
485
|
+
kind: "DeprecatedUpdateMultiplierTagBoost";
|
|
486
486
|
}
|
|
487
|
-
export declare class
|
|
487
|
+
export declare class DeprecatedUpdateMultiplierTagBoost {
|
|
488
488
|
static readonly discriminator = 37;
|
|
489
|
-
static readonly kind = "
|
|
489
|
+
static readonly kind = "DeprecatedUpdateMultiplierTagBoost";
|
|
490
490
|
readonly discriminator = 37;
|
|
491
|
-
readonly kind = "
|
|
492
|
-
toJSON():
|
|
491
|
+
readonly kind = "DeprecatedUpdateMultiplierTagBoost";
|
|
492
|
+
toJSON(): DeprecatedUpdateMultiplierTagBoostJSON;
|
|
493
493
|
toEncodable(): {
|
|
494
|
-
|
|
494
|
+
DeprecatedUpdateMultiplierTagBoost: {};
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
497
|
export interface UpdateReserveStatusJSON {
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.UpdateHostFixedInterestRateBps = exports.UpdateBorrowLimitsInElevationGroupAgainstThisReserve = exports.UpdateBorrowLimitOutsideElevationGroup = exports.UpdateBlockPriceUsage = exports.UpdateBlockBorrowingAboveUtilization = exports.UpdateDisableUsageAsCollateralOutsideEmode = exports.UpdateFarmDebt = exports.UpdateFarmCollateral = exports.UpdateReserveStatus = exports.
|
|
26
|
+
exports.UpdateHostFixedInterestRateBps = exports.UpdateBorrowLimitsInElevationGroupAgainstThisReserve = exports.UpdateBorrowLimitOutsideElevationGroup = exports.UpdateBlockPriceUsage = exports.UpdateBlockBorrowingAboveUtilization = exports.UpdateDisableUsageAsCollateralOutsideEmode = exports.UpdateFarmDebt = exports.UpdateFarmCollateral = exports.UpdateReserveStatus = exports.DeprecatedUpdateMultiplierTagBoost = exports.DeprecatedUpdateMultiplierSideBoost = exports.DeleveragingThresholdSlotsPerBps = exports.UpdateElevationGroup = exports.UpdateAssetTier = exports.UpdateBorrowFactor = exports.DeleveragingMarginCallPeriod = exports.UpdateMinLiquidationBonusBps = exports.UpdateBadDebtLiquidationBonusBps = exports.UpdateDepositWithdrawalCapCurrentTotal = exports.UpdateDebtWithdrawalCapCurrentTotal = exports.UpdateDepositWithdrawalCap = exports.UpdateDebtWithdrawalCap = exports.UpdateEntireReserveConfig = exports.UpdateBorrowRateCurve = exports.UpdateSwitchboardTwapFeed = exports.UpdateSwitchboardFeed = exports.UpdatePythPrice = exports.UpdateScopePriceFeed = exports.UpdateTokenInfoTwapMaxAge = exports.UpdateTokenInfoPriceMaxAge = exports.UpdateTokenInfoName = exports.UpdateTokenInfoScopeChain = exports.UpdateTokenInfoScopeTwap = exports.UpdateTokenInfoTwapDivergence = exports.UpdateTokenInfoExpHeuristic = exports.UpdateTokenInfoUpperHeuristic = exports.UpdateTokenInfoLowerHeuristic = exports.UpdateBorrowLimit = exports.UpdateDepositLimit = exports.UpdateFeesReferralFeeBps = exports.UpdateFeesFlashLoanFee = exports.UpdateFeesBorrowFee = exports.UpdateProtocolTakeRate = exports.UpdateProtocolLiquidationFee = exports.UpdateLiquidationThresholdPct = exports.UpdateMaxLiquidationBonusBps = exports.UpdateLoanToValuePct = void 0;
|
|
27
27
|
exports.fromDecoded = fromDecoded;
|
|
28
28
|
exports.fromJSON = fromJSON;
|
|
29
29
|
exports.layout = layout;
|
|
@@ -712,44 +712,44 @@ class DeleveragingThresholdSlotsPerBps {
|
|
|
712
712
|
exports.DeleveragingThresholdSlotsPerBps = DeleveragingThresholdSlotsPerBps;
|
|
713
713
|
DeleveragingThresholdSlotsPerBps.discriminator = 35;
|
|
714
714
|
DeleveragingThresholdSlotsPerBps.kind = "DeleveragingThresholdSlotsPerBps";
|
|
715
|
-
class
|
|
715
|
+
class DeprecatedUpdateMultiplierSideBoost {
|
|
716
716
|
constructor() {
|
|
717
717
|
this.discriminator = 36;
|
|
718
|
-
this.kind = "
|
|
718
|
+
this.kind = "DeprecatedUpdateMultiplierSideBoost";
|
|
719
719
|
}
|
|
720
720
|
toJSON() {
|
|
721
721
|
return {
|
|
722
|
-
kind: "
|
|
722
|
+
kind: "DeprecatedUpdateMultiplierSideBoost",
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
725
|
toEncodable() {
|
|
726
726
|
return {
|
|
727
|
-
|
|
727
|
+
DeprecatedUpdateMultiplierSideBoost: {},
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
exports.
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
class
|
|
731
|
+
exports.DeprecatedUpdateMultiplierSideBoost = DeprecatedUpdateMultiplierSideBoost;
|
|
732
|
+
DeprecatedUpdateMultiplierSideBoost.discriminator = 36;
|
|
733
|
+
DeprecatedUpdateMultiplierSideBoost.kind = "DeprecatedUpdateMultiplierSideBoost";
|
|
734
|
+
class DeprecatedUpdateMultiplierTagBoost {
|
|
735
735
|
constructor() {
|
|
736
736
|
this.discriminator = 37;
|
|
737
|
-
this.kind = "
|
|
737
|
+
this.kind = "DeprecatedUpdateMultiplierTagBoost";
|
|
738
738
|
}
|
|
739
739
|
toJSON() {
|
|
740
740
|
return {
|
|
741
|
-
kind: "
|
|
741
|
+
kind: "DeprecatedUpdateMultiplierTagBoost",
|
|
742
742
|
};
|
|
743
743
|
}
|
|
744
744
|
toEncodable() {
|
|
745
745
|
return {
|
|
746
|
-
|
|
746
|
+
DeprecatedUpdateMultiplierTagBoost: {},
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
exports.
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
exports.DeprecatedUpdateMultiplierTagBoost = DeprecatedUpdateMultiplierTagBoost;
|
|
751
|
+
DeprecatedUpdateMultiplierTagBoost.discriminator = 37;
|
|
752
|
+
DeprecatedUpdateMultiplierTagBoost.kind = "DeprecatedUpdateMultiplierTagBoost";
|
|
753
753
|
class UpdateReserveStatus {
|
|
754
754
|
constructor() {
|
|
755
755
|
this.discriminator = 38;
|
|
@@ -1034,11 +1034,11 @@ function fromDecoded(obj) {
|
|
|
1034
1034
|
if ("DeleveragingThresholdSlotsPerBps" in obj) {
|
|
1035
1035
|
return new DeleveragingThresholdSlotsPerBps();
|
|
1036
1036
|
}
|
|
1037
|
-
if ("
|
|
1038
|
-
return new
|
|
1037
|
+
if ("DeprecatedUpdateMultiplierSideBoost" in obj) {
|
|
1038
|
+
return new DeprecatedUpdateMultiplierSideBoost();
|
|
1039
1039
|
}
|
|
1040
|
-
if ("
|
|
1041
|
-
return new
|
|
1040
|
+
if ("DeprecatedUpdateMultiplierTagBoost" in obj) {
|
|
1041
|
+
return new DeprecatedUpdateMultiplierTagBoost();
|
|
1042
1042
|
}
|
|
1043
1043
|
if ("UpdateReserveStatus" in obj) {
|
|
1044
1044
|
return new UpdateReserveStatus();
|
|
@@ -1179,11 +1179,11 @@ function fromJSON(obj) {
|
|
|
1179
1179
|
case "DeleveragingThresholdSlotsPerBps": {
|
|
1180
1180
|
return new DeleveragingThresholdSlotsPerBps();
|
|
1181
1181
|
}
|
|
1182
|
-
case "
|
|
1183
|
-
return new
|
|
1182
|
+
case "DeprecatedUpdateMultiplierSideBoost": {
|
|
1183
|
+
return new DeprecatedUpdateMultiplierSideBoost();
|
|
1184
1184
|
}
|
|
1185
|
-
case "
|
|
1186
|
-
return new
|
|
1185
|
+
case "DeprecatedUpdateMultiplierTagBoost": {
|
|
1186
|
+
return new DeprecatedUpdateMultiplierTagBoost();
|
|
1187
1187
|
}
|
|
1188
1188
|
case "UpdateReserveStatus": {
|
|
1189
1189
|
return new UpdateReserveStatus();
|
|
@@ -1252,8 +1252,8 @@ function layout(property) {
|
|
|
1252
1252
|
borsh.struct([], "UpdateAssetTier"),
|
|
1253
1253
|
borsh.struct([], "UpdateElevationGroup"),
|
|
1254
1254
|
borsh.struct([], "DeleveragingThresholdSlotsPerBps"),
|
|
1255
|
-
borsh.struct([], "
|
|
1256
|
-
borsh.struct([], "
|
|
1255
|
+
borsh.struct([], "DeprecatedUpdateMultiplierSideBoost"),
|
|
1256
|
+
borsh.struct([], "DeprecatedUpdateMultiplierTagBoost"),
|
|
1257
1257
|
borsh.struct([], "UpdateReserveStatus"),
|
|
1258
1258
|
borsh.struct([], "UpdateFarmCollateral"),
|
|
1259
1259
|
borsh.struct([], "UpdateFarmDebt"),
|