@kamino-finance/klend-sdk 7.2.6-beta.0 → 7.2.6-beta.1
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 +0 -1
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts +0 -33
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.js +2 -24
- package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
- package/dist/@codegen/klend/errors/custom.d.ts +2 -26
- package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/klend/errors/custom.js +3 -45
- package/dist/@codegen/klend/errors/custom.js.map +1 -1
- package/dist/@codegen/klend/instructions/index.d.ts +0 -2
- package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/index.js +1 -3
- package/dist/@codegen/klend/instructions/index.js.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.d.ts +1 -1
- package/dist/@codegen/klend/instructions/initReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.js +5 -1
- package/dist/@codegen/klend/instructions/initReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.js +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js +1 -1
- package/dist/@codegen/klend/types/ReserveConfig.d.ts +24 -58
- package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveConfig.js +18 -40
- package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/types/ReserveFees.d.ts +8 -8
- package/dist/@codegen/klend/types/ReserveFees.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveFees.js +8 -8
- package/dist/@codegen/klend/types/ReserveFees.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +7 -46
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.js +12 -85
- package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +0 -26
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +1 -49
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/@codegen/klend/types/index.d.ts +4 -4
- package/dist/@codegen/klend/types/index.d.ts.map +1 -1
- package/dist/@codegen/klend/types/index.js.map +1 -1
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +0 -2
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +4 -0
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +4 -7
- package/dist/classes/reserve.js.map +1 -1
- package/dist/idl/klend.json +59 -129
- package/dist/manager/client_kamino_manager.js +3 -5
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/managerTypes.d.ts +1 -1
- package/dist/utils/managerTypes.d.ts.map +1 -1
- package/dist/utils/managerTypes.js +3 -5
- package/dist/utils/managerTypes.js.map +1 -1
- package/dist/utils/seeds.d.ts +5 -5
- package/dist/utils/seeds.d.ts.map +1 -1
- package/dist/utils/seeds.js +13 -13
- package/dist/utils/seeds.js.map +1 -1
- package/package.json +1 -1
- package/src/@codegen/klend/accounts/LendingMarket.ts +2 -46
- package/src/@codegen/klend/errors/custom.ts +2 -47
- package/src/@codegen/klend/instructions/index.ts +0 -2
- package/src/@codegen/klend/instructions/initReserve.ts +6 -2
- package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.ts +1 -1
- package/src/@codegen/klend/instructions/withdrawObligationCollateral.ts +1 -1
- package/src/@codegen/klend/instructions/withdrawObligationCollateralV2.ts +1 -1
- package/src/@codegen/klend/types/ReserveConfig.ts +30 -72
- package/src/@codegen/klend/types/ReserveFees.ts +12 -12
- package/src/@codegen/klend/types/UpdateConfigMode.ts +13 -103
- package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +0 -60
- package/src/@codegen/klend/types/index.ts +2 -12
- package/src/classes/manager.ts +0 -2
- package/src/classes/market.ts +4 -0
- package/src/classes/reserve.ts +5 -7
- package/src/idl/klend.json +60 -130
- package/src/manager/client_kamino_manager.ts +3 -5
- package/src/utils/index.ts +1 -0
- package/src/utils/managerTypes.ts +4 -6
- package/src/utils/seeds.ts +17 -13
- package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.d.ts +0 -13
- package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.js +0 -24
- package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.js.map +0 -1
- package/src/@codegen/klend/instructions/seedDepositOnInitReserve.ts +0 -50
package/dist/utils/seeds.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seeds.js","sourceRoot":"","sources":["../../src/utils/seeds.ts"],"names":[],"mappings":";;;AA2EA,kCAaC;AAQD,oDAQC;AASD,
|
|
1
|
+
{"version":3,"file":"seeds.js","sourceRoot":"","sources":["../../src/utils/seeds.ts"],"names":[],"mappings":";;;AA2EA,kCAaC;AAQD,oDAQC;AASD,kDASC;AASD,gDASC;AASD,4DASC;AASD,gEASC;AAQD,0CAKC;AASD,sDAcC;AAQD,4CAKC;AAQD,kCAMC;AAOD,0CAMC;AAOD,wCAMC;AAQD,wDAMC;AAOD,gEAKC;AAnSD,qCAAmH;AACnH,2DAAyD;AACzD,uFA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,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC1G,cAAc,EAAE,sBAAgB;KACjC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,0BAA0B,CAAC,IAAa;IAC5D,OAAO,IAAA,8BAAwB,EAAC;QAC9B,KAAK,EAAE,CAAC,eAAM,CAAC,IAAI,CAAC,qBAAa,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,2BAAmB,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5G,cAAc,EAAE,2BAAmB;KACpC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -92,18 +92,7 @@ export interface LendingMarketFields {
|
|
|
92
92
|
* Note: updating or cancelling existing orders is *not* affected by this flag.
|
|
93
93
|
*/
|
|
94
94
|
obligationOrderCreationEnabled: number
|
|
95
|
-
/**
|
|
96
|
-
* Whether the liquidation operations that are triggered by price changes should be disabled.
|
|
97
|
-
* This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some
|
|
98
|
-
* obligation orders' execution.
|
|
99
|
-
*
|
|
100
|
-
* *Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other
|
|
101
|
-
* liquidation-driving flags (see e.g. [Self::autodeleverage_enabled]).
|
|
102
|
-
*/
|
|
103
|
-
priceTriggeredLiquidationDisabled: number
|
|
104
95
|
padding2: Array<number>
|
|
105
|
-
/** Authority that can propose creating of new reserves but cannot enable them. */
|
|
106
|
-
proposerAuthority: Address
|
|
107
96
|
padding1: Array<BN>
|
|
108
97
|
}
|
|
109
98
|
|
|
@@ -184,18 +173,7 @@ export interface LendingMarketJSON {
|
|
|
184
173
|
* Note: updating or cancelling existing orders is *not* affected by this flag.
|
|
185
174
|
*/
|
|
186
175
|
obligationOrderCreationEnabled: number
|
|
187
|
-
/**
|
|
188
|
-
* Whether the liquidation operations that are triggered by price changes should be disabled.
|
|
189
|
-
* This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some
|
|
190
|
-
* obligation orders' execution.
|
|
191
|
-
*
|
|
192
|
-
* *Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other
|
|
193
|
-
* liquidation-driving flags (see e.g. [Self::autodeleverage_enabled]).
|
|
194
|
-
*/
|
|
195
|
-
priceTriggeredLiquidationDisabled: number
|
|
196
176
|
padding2: Array<number>
|
|
197
|
-
/** Authority that can propose creating of new reserves but cannot enable them. */
|
|
198
|
-
proposerAuthority: string
|
|
199
177
|
padding1: Array<string>
|
|
200
178
|
}
|
|
201
179
|
|
|
@@ -276,18 +254,7 @@ export class LendingMarket {
|
|
|
276
254
|
* Note: updating or cancelling existing orders is *not* affected by this flag.
|
|
277
255
|
*/
|
|
278
256
|
readonly obligationOrderCreationEnabled: number
|
|
279
|
-
/**
|
|
280
|
-
* Whether the liquidation operations that are triggered by price changes should be disabled.
|
|
281
|
-
* This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some
|
|
282
|
-
* obligation orders' execution.
|
|
283
|
-
*
|
|
284
|
-
* *Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other
|
|
285
|
-
* liquidation-driving flags (see e.g. [Self::autodeleverage_enabled]).
|
|
286
|
-
*/
|
|
287
|
-
readonly priceTriggeredLiquidationDisabled: number
|
|
288
257
|
readonly padding2: Array<number>
|
|
289
|
-
/** Authority that can propose creating of new reserves but cannot enable them. */
|
|
290
|
-
readonly proposerAuthority: Address
|
|
291
258
|
readonly padding1: Array<BN>
|
|
292
259
|
|
|
293
260
|
static readonly discriminator = Buffer.from([
|
|
@@ -324,10 +291,8 @@ export class LendingMarket {
|
|
|
324
291
|
borsh.u8("obligationOrderExecutionEnabled"),
|
|
325
292
|
borsh.u8("immutable"),
|
|
326
293
|
borsh.u8("obligationOrderCreationEnabled"),
|
|
327
|
-
borsh.u8("
|
|
328
|
-
borsh.array(borsh.
|
|
329
|
-
borshAddress("proposerAuthority"),
|
|
330
|
-
borsh.array(borsh.u64(), 165, "padding1"),
|
|
294
|
+
borsh.array(borsh.u8(), 5, "padding2"),
|
|
295
|
+
borsh.array(borsh.u64(), 169, "padding1"),
|
|
331
296
|
])
|
|
332
297
|
|
|
333
298
|
constructor(fields: LendingMarketFields) {
|
|
@@ -369,10 +334,7 @@ export class LendingMarket {
|
|
|
369
334
|
fields.obligationOrderExecutionEnabled
|
|
370
335
|
this.immutable = fields.immutable
|
|
371
336
|
this.obligationOrderCreationEnabled = fields.obligationOrderCreationEnabled
|
|
372
|
-
this.priceTriggeredLiquidationDisabled =
|
|
373
|
-
fields.priceTriggeredLiquidationDisabled
|
|
374
337
|
this.padding2 = fields.padding2
|
|
375
|
-
this.proposerAuthority = fields.proposerAuthority
|
|
376
338
|
this.padding1 = fields.padding1
|
|
377
339
|
}
|
|
378
340
|
|
|
@@ -459,9 +421,7 @@ export class LendingMarket {
|
|
|
459
421
|
obligationOrderExecutionEnabled: dec.obligationOrderExecutionEnabled,
|
|
460
422
|
immutable: dec.immutable,
|
|
461
423
|
obligationOrderCreationEnabled: dec.obligationOrderCreationEnabled,
|
|
462
|
-
priceTriggeredLiquidationDisabled: dec.priceTriggeredLiquidationDisabled,
|
|
463
424
|
padding2: dec.padding2,
|
|
464
|
-
proposerAuthority: dec.proposerAuthority,
|
|
465
425
|
padding1: dec.padding1,
|
|
466
426
|
})
|
|
467
427
|
}
|
|
@@ -504,9 +464,7 @@ export class LendingMarket {
|
|
|
504
464
|
obligationOrderExecutionEnabled: this.obligationOrderExecutionEnabled,
|
|
505
465
|
immutable: this.immutable,
|
|
506
466
|
obligationOrderCreationEnabled: this.obligationOrderCreationEnabled,
|
|
507
|
-
priceTriggeredLiquidationDisabled: this.priceTriggeredLiquidationDisabled,
|
|
508
467
|
padding2: this.padding2,
|
|
509
|
-
proposerAuthority: this.proposerAuthority,
|
|
510
468
|
padding1: this.padding1.map((item) => item.toString()),
|
|
511
469
|
}
|
|
512
470
|
}
|
|
@@ -556,9 +514,7 @@ export class LendingMarket {
|
|
|
556
514
|
obligationOrderExecutionEnabled: obj.obligationOrderExecutionEnabled,
|
|
557
515
|
immutable: obj.immutable,
|
|
558
516
|
obligationOrderCreationEnabled: obj.obligationOrderCreationEnabled,
|
|
559
|
-
priceTriggeredLiquidationDisabled: obj.priceTriggeredLiquidationDisabled,
|
|
560
517
|
padding2: obj.padding2,
|
|
561
|
-
proposerAuthority: address(obj.proposerAuthority),
|
|
562
518
|
padding1: obj.padding1.map((item) => new BN(item)),
|
|
563
519
|
})
|
|
564
520
|
}
|
|
@@ -129,9 +129,6 @@ export type CustomError =
|
|
|
129
129
|
| OperationNotPermittedMarketImmutable
|
|
130
130
|
| OrderCreationDisabled
|
|
131
131
|
| NoUpgradeAuthority
|
|
132
|
-
| InitialAdminDepositExecuted
|
|
133
|
-
| ReserveHasNotReceivedInitialDeposit
|
|
134
|
-
| CTokenUsageBlocked
|
|
135
132
|
|
|
136
133
|
export class InvalidMarketAuthority extends Error {
|
|
137
134
|
static readonly code = 6000
|
|
@@ -192,10 +189,10 @@ export class InvalidSigner extends Error {
|
|
|
192
189
|
static readonly code = 6005
|
|
193
190
|
readonly code = 6005
|
|
194
191
|
readonly name = "InvalidSigner"
|
|
195
|
-
readonly msg = "
|
|
192
|
+
readonly msg = "Input account must be a signer"
|
|
196
193
|
|
|
197
194
|
constructor(readonly logs?: string[]) {
|
|
198
|
-
super("6005:
|
|
195
|
+
super("6005: Input account must be a signer")
|
|
199
196
|
}
|
|
200
197
|
}
|
|
201
198
|
|
|
@@ -1644,42 +1641,6 @@ export class NoUpgradeAuthority extends Error {
|
|
|
1644
1641
|
}
|
|
1645
1642
|
}
|
|
1646
1643
|
|
|
1647
|
-
export class InitialAdminDepositExecuted extends Error {
|
|
1648
|
-
static readonly code = 6130
|
|
1649
|
-
readonly code = 6130
|
|
1650
|
-
readonly name = "InitialAdminDepositExecuted"
|
|
1651
|
-
readonly msg = "Initial admin deposit in reserve already executed"
|
|
1652
|
-
|
|
1653
|
-
constructor(readonly logs?: string[]) {
|
|
1654
|
-
super("6130: Initial admin deposit in reserve already executed")
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
export class ReserveHasNotReceivedInitialDeposit extends Error {
|
|
1659
|
-
static readonly code = 6131
|
|
1660
|
-
readonly code = 6131
|
|
1661
|
-
readonly name = "ReserveHasNotReceivedInitialDeposit"
|
|
1662
|
-
readonly msg =
|
|
1663
|
-
"Reserve has not received the initial deposit, cannot update config"
|
|
1664
|
-
|
|
1665
|
-
constructor(readonly logs?: string[]) {
|
|
1666
|
-
super(
|
|
1667
|
-
"6131: Reserve has not received the initial deposit, cannot update config"
|
|
1668
|
-
)
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
export class CTokenUsageBlocked extends Error {
|
|
1673
|
-
static readonly code = 6132
|
|
1674
|
-
readonly code = 6132
|
|
1675
|
-
readonly name = "CTokenUsageBlocked"
|
|
1676
|
-
readonly msg = "CToken minting/redeeming is blocked for this reserve"
|
|
1677
|
-
|
|
1678
|
-
constructor(readonly logs?: string[]) {
|
|
1679
|
-
super("6132: CToken minting/redeeming is blocked for this reserve")
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
1644
|
export function fromCode(code: number, logs?: string[]): CustomError | null {
|
|
1684
1645
|
switch (code) {
|
|
1685
1646
|
case 6000:
|
|
@@ -1942,12 +1903,6 @@ export function fromCode(code: number, logs?: string[]): CustomError | null {
|
|
|
1942
1903
|
return new OrderCreationDisabled(logs)
|
|
1943
1904
|
case 6129:
|
|
1944
1905
|
return new NoUpgradeAuthority(logs)
|
|
1945
|
-
case 6130:
|
|
1946
|
-
return new InitialAdminDepositExecuted(logs)
|
|
1947
|
-
case 6131:
|
|
1948
|
-
return new ReserveHasNotReceivedInitialDeposit(logs)
|
|
1949
|
-
case 6132:
|
|
1950
|
-
return new CTokenUsageBlocked(logs)
|
|
1951
1906
|
}
|
|
1952
1907
|
|
|
1953
1908
|
return null
|
|
@@ -29,8 +29,6 @@ export type {
|
|
|
29
29
|
WithdrawProtocolFeeArgs,
|
|
30
30
|
WithdrawProtocolFeeAccounts,
|
|
31
31
|
} from "./withdrawProtocolFee"
|
|
32
|
-
export { seedDepositOnInitReserve } from "./seedDepositOnInitReserve"
|
|
33
|
-
export type { SeedDepositOnInitReserveAccounts } from "./seedDepositOnInitReserve"
|
|
34
32
|
export { socializeLoss } from "./socializeLoss"
|
|
35
33
|
export type { SocializeLossArgs, SocializeLossAccounts } from "./socializeLoss"
|
|
36
34
|
export { socializeLossV2 } from "./socializeLossV2"
|
|
@@ -18,7 +18,7 @@ import { PROGRAM_ID } from "../programId"
|
|
|
18
18
|
export const DISCRIMINATOR = Buffer.from([138, 245, 71, 225, 153, 4, 3, 43])
|
|
19
19
|
|
|
20
20
|
export interface InitReserveAccounts {
|
|
21
|
-
|
|
21
|
+
lendingMarketOwner: TransactionSigner
|
|
22
22
|
lendingMarket: Address
|
|
23
23
|
lendingMarketAuthority: Address
|
|
24
24
|
reserve: Address
|
|
@@ -40,7 +40,11 @@ export function initReserve(
|
|
|
40
40
|
programAddress: Address = PROGRAM_ID
|
|
41
41
|
) {
|
|
42
42
|
const keys: Array<AccountMeta | AccountSignerMeta> = [
|
|
43
|
-
{
|
|
43
|
+
{
|
|
44
|
+
address: accounts.lendingMarketOwner.address,
|
|
45
|
+
role: 3,
|
|
46
|
+
signer: accounts.lendingMarketOwner,
|
|
47
|
+
},
|
|
44
48
|
{ address: accounts.lendingMarket, role: 0 },
|
|
45
49
|
{ address: accounts.lendingMarketAuthority, role: 0 },
|
|
46
50
|
{ address: accounts.reserve, role: 1 },
|
|
@@ -78,7 +78,7 @@ export function liquidateObligationAndRedeemReserveCollateralV2(
|
|
|
78
78
|
},
|
|
79
79
|
{ address: accounts.liquidationAccounts.obligation, role: 1 },
|
|
80
80
|
{ address: accounts.liquidationAccounts.lendingMarket, role: 0 },
|
|
81
|
-
{ address: accounts.liquidationAccounts.lendingMarketAuthority, role:
|
|
81
|
+
{ address: accounts.liquidationAccounts.lendingMarketAuthority, role: 1 },
|
|
82
82
|
{ address: accounts.liquidationAccounts.repayReserve, role: 1 },
|
|
83
83
|
{
|
|
84
84
|
address: accounts.liquidationAccounts.repayReserveLiquidityMint,
|
|
@@ -44,7 +44,7 @@ export function withdrawObligationCollateral(
|
|
|
44
44
|
programAddress: Address = PROGRAM_ID
|
|
45
45
|
) {
|
|
46
46
|
const keys: Array<AccountMeta | AccountSignerMeta> = [
|
|
47
|
-
{ address: accounts.owner.address, role:
|
|
47
|
+
{ address: accounts.owner.address, role: 2, signer: accounts.owner },
|
|
48
48
|
{ address: accounts.obligation, role: 1 },
|
|
49
49
|
{ address: accounts.lendingMarket, role: 0 },
|
|
50
50
|
{ address: accounts.lendingMarketAuthority, role: 0 },
|
|
@@ -55,7 +55,7 @@ export function withdrawObligationCollateralV2(
|
|
|
55
55
|
const keys: Array<AccountMeta | AccountSignerMeta> = [
|
|
56
56
|
{
|
|
57
57
|
address: accounts.withdrawAccounts.owner.address,
|
|
58
|
-
role:
|
|
58
|
+
role: 2,
|
|
59
59
|
signer: accounts.withdrawAccounts.owner,
|
|
60
60
|
},
|
|
61
61
|
{ address: accounts.withdrawAccounts.obligation, role: 1 },
|
|
@@ -11,16 +11,13 @@ export interface ReserveConfigFields {
|
|
|
11
11
|
assetTier: number
|
|
12
12
|
/** Flat rate that goes to the host */
|
|
13
13
|
hostFixedInterestRateBps: number
|
|
14
|
-
/** Starting bonus for deleveraging-related liquidations, in bps. */
|
|
15
|
-
minDeleveragingBonusBps: number
|
|
16
14
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
16
|
+
* - Boost for side (debt or collateral)
|
|
17
|
+
* - Reward points multiplier per obligation type
|
|
18
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
20
19
|
*/
|
|
21
|
-
|
|
22
|
-
/** Past reserved space - feel free to reuse. */
|
|
23
|
-
reserved1: Array<number>
|
|
20
|
+
reserved2: Array<number>
|
|
24
21
|
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
25
22
|
protocolOrderExecutionFeePct: number
|
|
26
23
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
@@ -79,14 +76,7 @@ export interface ReserveConfigFields {
|
|
|
79
76
|
* obligations) is NOT affected by this flag.
|
|
80
77
|
*/
|
|
81
78
|
autodeleverageEnabled: number
|
|
82
|
-
|
|
83
|
-
* Boolean flag indicating whether the reserve is locked for the proposer authority.
|
|
84
|
-
*
|
|
85
|
-
* Once the proposer have finished preparing the reserve, it must be locked to prevent
|
|
86
|
-
* further changes to the reserve configuration allowing review and voting on the proposal
|
|
87
|
-
* without alteration during the voting period.
|
|
88
|
-
*/
|
|
89
|
-
proposerAuthorityLocked: number
|
|
79
|
+
reserved1: Array<number>
|
|
90
80
|
/**
|
|
91
81
|
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
92
82
|
* - u64::MAX for inf
|
|
@@ -114,16 +104,13 @@ export interface ReserveConfigJSON {
|
|
|
114
104
|
assetTier: number
|
|
115
105
|
/** Flat rate that goes to the host */
|
|
116
106
|
hostFixedInterestRateBps: number
|
|
117
|
-
/** Starting bonus for deleveraging-related liquidations, in bps. */
|
|
118
|
-
minDeleveragingBonusBps: number
|
|
119
107
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
108
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
109
|
+
* - Boost for side (debt or collateral)
|
|
110
|
+
* - Reward points multiplier per obligation type
|
|
111
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
123
112
|
*/
|
|
124
|
-
|
|
125
|
-
/** Past reserved space - feel free to reuse. */
|
|
126
|
-
reserved1: Array<number>
|
|
113
|
+
reserved2: Array<number>
|
|
127
114
|
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
128
115
|
protocolOrderExecutionFeePct: number
|
|
129
116
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
@@ -182,14 +169,7 @@ export interface ReserveConfigJSON {
|
|
|
182
169
|
* obligations) is NOT affected by this flag.
|
|
183
170
|
*/
|
|
184
171
|
autodeleverageEnabled: number
|
|
185
|
-
|
|
186
|
-
* Boolean flag indicating whether the reserve is locked for the proposer authority.
|
|
187
|
-
*
|
|
188
|
-
* Once the proposer have finished preparing the reserve, it must be locked to prevent
|
|
189
|
-
* further changes to the reserve configuration allowing review and voting on the proposal
|
|
190
|
-
* without alteration during the voting period.
|
|
191
|
-
*/
|
|
192
|
-
proposerAuthorityLocked: number
|
|
172
|
+
reserved1: Array<number>
|
|
193
173
|
/**
|
|
194
174
|
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
195
175
|
* - u64::MAX for inf
|
|
@@ -218,16 +198,13 @@ export class ReserveConfig {
|
|
|
218
198
|
readonly assetTier: number
|
|
219
199
|
/** Flat rate that goes to the host */
|
|
220
200
|
readonly hostFixedInterestRateBps: number
|
|
221
|
-
/** Starting bonus for deleveraging-related liquidations, in bps. */
|
|
222
|
-
readonly minDeleveragingBonusBps: number
|
|
223
201
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
202
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
203
|
+
* - Boost for side (debt or collateral)
|
|
204
|
+
* - Reward points multiplier per obligation type
|
|
205
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
227
206
|
*/
|
|
228
|
-
readonly
|
|
229
|
-
/** Past reserved space - feel free to reuse. */
|
|
230
|
-
readonly reserved1: Array<number>
|
|
207
|
+
readonly reserved2: Array<number>
|
|
231
208
|
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
232
209
|
readonly protocolOrderExecutionFeePct: number
|
|
233
210
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
@@ -286,14 +263,7 @@ export class ReserveConfig {
|
|
|
286
263
|
* obligations) is NOT affected by this flag.
|
|
287
264
|
*/
|
|
288
265
|
readonly autodeleverageEnabled: number
|
|
289
|
-
|
|
290
|
-
* Boolean flag indicating whether the reserve is locked for the proposer authority.
|
|
291
|
-
*
|
|
292
|
-
* Once the proposer have finished preparing the reserve, it must be locked to prevent
|
|
293
|
-
* further changes to the reserve configuration allowing review and voting on the proposal
|
|
294
|
-
* without alteration during the voting period.
|
|
295
|
-
*/
|
|
296
|
-
readonly proposerAuthorityLocked: number
|
|
266
|
+
readonly reserved1: Array<number>
|
|
297
267
|
/**
|
|
298
268
|
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
299
269
|
* - u64::MAX for inf
|
|
@@ -317,9 +287,7 @@ export class ReserveConfig {
|
|
|
317
287
|
this.status = fields.status
|
|
318
288
|
this.assetTier = fields.assetTier
|
|
319
289
|
this.hostFixedInterestRateBps = fields.hostFixedInterestRateBps
|
|
320
|
-
this.
|
|
321
|
-
this.blockCtokenUsage = fields.blockCtokenUsage
|
|
322
|
-
this.reserved1 = fields.reserved1
|
|
290
|
+
this.reserved2 = fields.reserved2
|
|
323
291
|
this.protocolOrderExecutionFeePct = fields.protocolOrderExecutionFeePct
|
|
324
292
|
this.protocolTakeRatePct = fields.protocolTakeRatePct
|
|
325
293
|
this.protocolLiquidationFeePct = fields.protocolLiquidationFeePct
|
|
@@ -351,7 +319,7 @@ export class ReserveConfig {
|
|
|
351
319
|
this.utilizationLimitBlockBorrowingAbovePct =
|
|
352
320
|
fields.utilizationLimitBlockBorrowingAbovePct
|
|
353
321
|
this.autodeleverageEnabled = fields.autodeleverageEnabled
|
|
354
|
-
this.
|
|
322
|
+
this.reserved1 = fields.reserved1
|
|
355
323
|
this.borrowLimitOutsideElevationGroup =
|
|
356
324
|
fields.borrowLimitOutsideElevationGroup
|
|
357
325
|
this.borrowLimitAgainstThisCollateralInElevationGroup =
|
|
@@ -366,9 +334,7 @@ export class ReserveConfig {
|
|
|
366
334
|
borsh.u8("status"),
|
|
367
335
|
borsh.u8("assetTier"),
|
|
368
336
|
borsh.u16("hostFixedInterestRateBps"),
|
|
369
|
-
borsh.
|
|
370
|
-
borsh.u8("blockCtokenUsage"),
|
|
371
|
-
borsh.array(borsh.u8(), 6, "reserved1"),
|
|
337
|
+
borsh.array(borsh.u8(), 9, "reserved2"),
|
|
372
338
|
borsh.u8("protocolOrderExecutionFeePct"),
|
|
373
339
|
borsh.u8("protocolTakeRatePct"),
|
|
374
340
|
borsh.u8("protocolLiquidationFeePct"),
|
|
@@ -391,7 +357,7 @@ export class ReserveConfig {
|
|
|
391
357
|
borsh.u8("disableUsageAsCollOutsideEmode"),
|
|
392
358
|
borsh.u8("utilizationLimitBlockBorrowingAbovePct"),
|
|
393
359
|
borsh.u8("autodeleverageEnabled"),
|
|
394
|
-
borsh.u8("
|
|
360
|
+
borsh.array(borsh.u8(), 1, "reserved1"),
|
|
395
361
|
borsh.u64("borrowLimitOutsideElevationGroup"),
|
|
396
362
|
borsh.array(
|
|
397
363
|
borsh.u64(),
|
|
@@ -410,9 +376,7 @@ export class ReserveConfig {
|
|
|
410
376
|
status: obj.status,
|
|
411
377
|
assetTier: obj.assetTier,
|
|
412
378
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
413
|
-
|
|
414
|
-
blockCtokenUsage: obj.blockCtokenUsage,
|
|
415
|
-
reserved1: obj.reserved1,
|
|
379
|
+
reserved2: obj.reserved2,
|
|
416
380
|
protocolOrderExecutionFeePct: obj.protocolOrderExecutionFeePct,
|
|
417
381
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
418
382
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
@@ -441,7 +405,7 @@ export class ReserveConfig {
|
|
|
441
405
|
utilizationLimitBlockBorrowingAbovePct:
|
|
442
406
|
obj.utilizationLimitBlockBorrowingAbovePct,
|
|
443
407
|
autodeleverageEnabled: obj.autodeleverageEnabled,
|
|
444
|
-
|
|
408
|
+
reserved1: obj.reserved1,
|
|
445
409
|
borrowLimitOutsideElevationGroup: obj.borrowLimitOutsideElevationGroup,
|
|
446
410
|
borrowLimitAgainstThisCollateralInElevationGroup:
|
|
447
411
|
obj.borrowLimitAgainstThisCollateralInElevationGroup,
|
|
@@ -455,9 +419,7 @@ export class ReserveConfig {
|
|
|
455
419
|
status: fields.status,
|
|
456
420
|
assetTier: fields.assetTier,
|
|
457
421
|
hostFixedInterestRateBps: fields.hostFixedInterestRateBps,
|
|
458
|
-
|
|
459
|
-
blockCtokenUsage: fields.blockCtokenUsage,
|
|
460
|
-
reserved1: fields.reserved1,
|
|
422
|
+
reserved2: fields.reserved2,
|
|
461
423
|
protocolOrderExecutionFeePct: fields.protocolOrderExecutionFeePct,
|
|
462
424
|
protocolTakeRatePct: fields.protocolTakeRatePct,
|
|
463
425
|
protocolLiquidationFeePct: fields.protocolLiquidationFeePct,
|
|
@@ -488,7 +450,7 @@ export class ReserveConfig {
|
|
|
488
450
|
utilizationLimitBlockBorrowingAbovePct:
|
|
489
451
|
fields.utilizationLimitBlockBorrowingAbovePct,
|
|
490
452
|
autodeleverageEnabled: fields.autodeleverageEnabled,
|
|
491
|
-
|
|
453
|
+
reserved1: fields.reserved1,
|
|
492
454
|
borrowLimitOutsideElevationGroup: fields.borrowLimitOutsideElevationGroup,
|
|
493
455
|
borrowLimitAgainstThisCollateralInElevationGroup:
|
|
494
456
|
fields.borrowLimitAgainstThisCollateralInElevationGroup,
|
|
@@ -502,9 +464,7 @@ export class ReserveConfig {
|
|
|
502
464
|
status: this.status,
|
|
503
465
|
assetTier: this.assetTier,
|
|
504
466
|
hostFixedInterestRateBps: this.hostFixedInterestRateBps,
|
|
505
|
-
|
|
506
|
-
blockCtokenUsage: this.blockCtokenUsage,
|
|
507
|
-
reserved1: this.reserved1,
|
|
467
|
+
reserved2: this.reserved2,
|
|
508
468
|
protocolOrderExecutionFeePct: this.protocolOrderExecutionFeePct,
|
|
509
469
|
protocolTakeRatePct: this.protocolTakeRatePct,
|
|
510
470
|
protocolLiquidationFeePct: this.protocolLiquidationFeePct,
|
|
@@ -530,7 +490,7 @@ export class ReserveConfig {
|
|
|
530
490
|
utilizationLimitBlockBorrowingAbovePct:
|
|
531
491
|
this.utilizationLimitBlockBorrowingAbovePct,
|
|
532
492
|
autodeleverageEnabled: this.autodeleverageEnabled,
|
|
533
|
-
|
|
493
|
+
reserved1: this.reserved1,
|
|
534
494
|
borrowLimitOutsideElevationGroup:
|
|
535
495
|
this.borrowLimitOutsideElevationGroup.toString(),
|
|
536
496
|
borrowLimitAgainstThisCollateralInElevationGroup:
|
|
@@ -547,9 +507,7 @@ export class ReserveConfig {
|
|
|
547
507
|
status: obj.status,
|
|
548
508
|
assetTier: obj.assetTier,
|
|
549
509
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
550
|
-
|
|
551
|
-
blockCtokenUsage: obj.blockCtokenUsage,
|
|
552
|
-
reserved1: obj.reserved1,
|
|
510
|
+
reserved2: obj.reserved2,
|
|
553
511
|
protocolOrderExecutionFeePct: obj.protocolOrderExecutionFeePct,
|
|
554
512
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
555
513
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
@@ -579,7 +537,7 @@ export class ReserveConfig {
|
|
|
579
537
|
utilizationLimitBlockBorrowingAbovePct:
|
|
580
538
|
obj.utilizationLimitBlockBorrowingAbovePct,
|
|
581
539
|
autodeleverageEnabled: obj.autodeleverageEnabled,
|
|
582
|
-
|
|
540
|
+
reserved1: obj.reserved1,
|
|
583
541
|
borrowLimitOutsideElevationGroup: new BN(
|
|
584
542
|
obj.borrowLimitOutsideElevationGroup
|
|
585
543
|
),
|
|
@@ -11,9 +11,9 @@ export interface ReserveFeesFields {
|
|
|
11
11
|
* clarity:
|
|
12
12
|
* 1% = (1 << 60) / 100 = 11529215046068470
|
|
13
13
|
* 0.01% (1 basis point) = 115292150460685
|
|
14
|
-
* 0.00001% (Aave
|
|
14
|
+
* 0.00001% (Aave borrow fee) = 115292150461
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
borrowFeeSf: BN
|
|
17
17
|
/**
|
|
18
18
|
* Fee for flash loan, expressed as scaled fraction.
|
|
19
19
|
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
@@ -30,9 +30,9 @@ export interface ReserveFeesJSON {
|
|
|
30
30
|
* clarity:
|
|
31
31
|
* 1% = (1 << 60) / 100 = 11529215046068470
|
|
32
32
|
* 0.01% (1 basis point) = 115292150460685
|
|
33
|
-
* 0.00001% (Aave
|
|
33
|
+
* 0.00001% (Aave borrow fee) = 115292150461
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
borrowFeeSf: string
|
|
36
36
|
/**
|
|
37
37
|
* Fee for flash loan, expressed as scaled fraction.
|
|
38
38
|
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
@@ -56,9 +56,9 @@ export class ReserveFees {
|
|
|
56
56
|
* clarity:
|
|
57
57
|
* 1% = (1 << 60) / 100 = 11529215046068470
|
|
58
58
|
* 0.01% (1 basis point) = 115292150460685
|
|
59
|
-
* 0.00001% (Aave
|
|
59
|
+
* 0.00001% (Aave borrow fee) = 115292150461
|
|
60
60
|
*/
|
|
61
|
-
readonly
|
|
61
|
+
readonly borrowFeeSf: BN
|
|
62
62
|
/**
|
|
63
63
|
* Fee for flash loan, expressed as scaled fraction.
|
|
64
64
|
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
@@ -68,7 +68,7 @@ export class ReserveFees {
|
|
|
68
68
|
readonly padding: Array<number>
|
|
69
69
|
|
|
70
70
|
constructor(fields: ReserveFeesFields) {
|
|
71
|
-
this.
|
|
71
|
+
this.borrowFeeSf = fields.borrowFeeSf
|
|
72
72
|
this.flashLoanFeeSf = fields.flashLoanFeeSf
|
|
73
73
|
this.padding = fields.padding
|
|
74
74
|
}
|
|
@@ -76,7 +76,7 @@ export class ReserveFees {
|
|
|
76
76
|
static layout(property?: string) {
|
|
77
77
|
return borsh.struct(
|
|
78
78
|
[
|
|
79
|
-
borsh.u64("
|
|
79
|
+
borsh.u64("borrowFeeSf"),
|
|
80
80
|
borsh.u64("flashLoanFeeSf"),
|
|
81
81
|
borsh.array(borsh.u8(), 8, "padding"),
|
|
82
82
|
],
|
|
@@ -87,7 +87,7 @@ export class ReserveFees {
|
|
|
87
87
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
88
|
static fromDecoded(obj: any) {
|
|
89
89
|
return new ReserveFees({
|
|
90
|
-
|
|
90
|
+
borrowFeeSf: obj.borrowFeeSf,
|
|
91
91
|
flashLoanFeeSf: obj.flashLoanFeeSf,
|
|
92
92
|
padding: obj.padding,
|
|
93
93
|
})
|
|
@@ -95,7 +95,7 @@ export class ReserveFees {
|
|
|
95
95
|
|
|
96
96
|
static toEncodable(fields: ReserveFeesFields) {
|
|
97
97
|
return {
|
|
98
|
-
|
|
98
|
+
borrowFeeSf: fields.borrowFeeSf,
|
|
99
99
|
flashLoanFeeSf: fields.flashLoanFeeSf,
|
|
100
100
|
padding: fields.padding,
|
|
101
101
|
}
|
|
@@ -103,7 +103,7 @@ export class ReserveFees {
|
|
|
103
103
|
|
|
104
104
|
toJSON(): ReserveFeesJSON {
|
|
105
105
|
return {
|
|
106
|
-
|
|
106
|
+
borrowFeeSf: this.borrowFeeSf.toString(),
|
|
107
107
|
flashLoanFeeSf: this.flashLoanFeeSf.toString(),
|
|
108
108
|
padding: this.padding,
|
|
109
109
|
}
|
|
@@ -111,7 +111,7 @@ export class ReserveFees {
|
|
|
111
111
|
|
|
112
112
|
static fromJSON(obj: ReserveFeesJSON): ReserveFees {
|
|
113
113
|
return new ReserveFees({
|
|
114
|
-
|
|
114
|
+
borrowFeeSf: new BN(obj.borrowFeeSf),
|
|
115
115
|
flashLoanFeeSf: new BN(obj.flashLoanFeeSf),
|
|
116
116
|
padding: obj.padding,
|
|
117
117
|
})
|