@kamino-finance/klend-sdk 5.12.5-beta.1 → 5.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/manager.d.ts +1 -1
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +9 -17
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/vault.d.ts +1 -0
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +16 -0
- package/dist/classes/vault.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts +2 -0
- package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.js +2 -0
- package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts +4 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.js +12 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.d.ts +2 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.js +2 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts +26 -11
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js +15 -10
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/manager.ts +11 -23
- package/src/classes/vault.ts +16 -1
- package/src/idl_codegen_kamino_vault/instructions/deposit.ts +4 -0
- package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +16 -0
- package/src/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.ts +4 -0
- package/src/idl_codegen_kamino_vault/types/ReserveConfig.ts +31 -16
- package/src/idl_kamino_vault.json +120 -10
|
@@ -48,10 +48,15 @@ class ReserveConfig {
|
|
|
48
48
|
assetTier;
|
|
49
49
|
/** Flat rate that goes to the host */
|
|
50
50
|
hostFixedInterestRateBps;
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
53
|
+
* - Boost for side (debt or collateral)
|
|
54
|
+
* - Reward points multiplier per obligation type
|
|
55
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
56
|
+
*/
|
|
52
57
|
reserved2;
|
|
53
|
-
/**
|
|
54
|
-
|
|
58
|
+
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
59
|
+
protocolOrderExecutionFeePct;
|
|
55
60
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
56
61
|
protocolTakeRatePct;
|
|
57
62
|
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
@@ -132,7 +137,7 @@ class ReserveConfig {
|
|
|
132
137
|
this.assetTier = fields.assetTier;
|
|
133
138
|
this.hostFixedInterestRateBps = fields.hostFixedInterestRateBps;
|
|
134
139
|
this.reserved2 = fields.reserved2;
|
|
135
|
-
this.
|
|
140
|
+
this.protocolOrderExecutionFeePct = fields.protocolOrderExecutionFeePct;
|
|
136
141
|
this.protocolTakeRatePct = fields.protocolTakeRatePct;
|
|
137
142
|
this.protocolLiquidationFeePct = fields.protocolLiquidationFeePct;
|
|
138
143
|
this.loanToValuePct = fields.loanToValuePct;
|
|
@@ -176,8 +181,8 @@ class ReserveConfig {
|
|
|
176
181
|
borsh.u8("status"),
|
|
177
182
|
borsh.u8("assetTier"),
|
|
178
183
|
borsh.u16("hostFixedInterestRateBps"),
|
|
179
|
-
borsh.array(borsh.u8(),
|
|
180
|
-
borsh.
|
|
184
|
+
borsh.array(borsh.u8(), 9, "reserved2"),
|
|
185
|
+
borsh.u8("protocolOrderExecutionFeePct"),
|
|
181
186
|
borsh.u8("protocolTakeRatePct"),
|
|
182
187
|
borsh.u8("protocolLiquidationFeePct"),
|
|
183
188
|
borsh.u8("loanToValuePct"),
|
|
@@ -212,7 +217,7 @@ class ReserveConfig {
|
|
|
212
217
|
assetTier: obj.assetTier,
|
|
213
218
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
214
219
|
reserved2: obj.reserved2,
|
|
215
|
-
|
|
220
|
+
protocolOrderExecutionFeePct: obj.protocolOrderExecutionFeePct,
|
|
216
221
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
217
222
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
218
223
|
loanToValuePct: obj.loanToValuePct,
|
|
@@ -246,7 +251,7 @@ class ReserveConfig {
|
|
|
246
251
|
assetTier: fields.assetTier,
|
|
247
252
|
hostFixedInterestRateBps: fields.hostFixedInterestRateBps,
|
|
248
253
|
reserved2: fields.reserved2,
|
|
249
|
-
|
|
254
|
+
protocolOrderExecutionFeePct: fields.protocolOrderExecutionFeePct,
|
|
250
255
|
protocolTakeRatePct: fields.protocolTakeRatePct,
|
|
251
256
|
protocolLiquidationFeePct: fields.protocolLiquidationFeePct,
|
|
252
257
|
loanToValuePct: fields.loanToValuePct,
|
|
@@ -280,7 +285,7 @@ class ReserveConfig {
|
|
|
280
285
|
assetTier: this.assetTier,
|
|
281
286
|
hostFixedInterestRateBps: this.hostFixedInterestRateBps,
|
|
282
287
|
reserved2: this.reserved2,
|
|
283
|
-
|
|
288
|
+
protocolOrderExecutionFeePct: this.protocolOrderExecutionFeePct,
|
|
284
289
|
protocolTakeRatePct: this.protocolTakeRatePct,
|
|
285
290
|
protocolLiquidationFeePct: this.protocolLiquidationFeePct,
|
|
286
291
|
loanToValuePct: this.loanToValuePct,
|
|
@@ -314,7 +319,7 @@ class ReserveConfig {
|
|
|
314
319
|
assetTier: obj.assetTier,
|
|
315
320
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
316
321
|
reserved2: obj.reserved2,
|
|
317
|
-
|
|
322
|
+
protocolOrderExecutionFeePct: obj.protocolOrderExecutionFeePct,
|
|
318
323
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
319
324
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
320
325
|
loanToValuePct: obj.loanToValuePct,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReserveConfig.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/types/ReserveConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAsB,CAAC,wDAAwD;AAC/E,gDAAiC,CAAC,wDAAwD;AAC1F,wDAAyC;
|
|
1
|
+
{"version":3,"file":"ReserveConfig.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/types/ReserveConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAsB,CAAC,wDAAwD;AAC/E,gDAAiC,CAAC,wDAAwD;AAC1F,wDAAyC;AA4LzC,mCAAmC;AACnC,MAAa,aAAa;IACxB,mDAAmD;IAC1C,MAAM,CAAQ;IACvB,gGAAgG;IACvF,SAAS,CAAQ;IAC1B,sCAAsC;IAC7B,wBAAwB,CAAQ;IACzC;;;;;OAKG;IACM,SAAS,CAAe;IACjC,mFAAmF;IAC1E,4BAA4B,CAAQ;IAC7C,4FAA4F;IACnF,mBAAmB,CAAQ;IACpC,+EAA+E;IACtE,yBAAyB,CAAQ;IAC1C;;;OAGG;IACM,cAAc,CAAQ;IAC/B,kFAAkF;IACzE,uBAAuB,CAAQ;IACxC,gGAAgG;IACvF,sBAAsB,CAAQ;IACvC,gGAAgG;IACvF,sBAAsB,CAAQ;IACvC,+EAA+E;IACtE,0BAA0B,CAAQ;IA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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,sCAAsC,EACpC,GAAG,CAAC,sCAAsC;YAC5C,qBAAqB,EAAE,GAAG,CAAC,qBAAqB;YAChD,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;YACH,kCAAkC,EAAE,IAAI,eAAE,CACxC,GAAG,CAAC,kCAAkC,CACvC;SACF,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF;AA3WD,sCA2WC"}
|
package/package.json
CHANGED
package/src/classes/manager.ts
CHANGED
|
@@ -599,7 +599,7 @@ export class KaminoManager {
|
|
|
599
599
|
* Get all lending markets
|
|
600
600
|
* @returns an array of all lending markets
|
|
601
601
|
*/
|
|
602
|
-
async getAllMarkets(
|
|
602
|
+
async getAllMarkets(): Promise<KaminoMarket[]> {
|
|
603
603
|
const lendingMarketsAccounts = await getProgramAccounts(
|
|
604
604
|
this.getConnection(),
|
|
605
605
|
this._kaminoLendProgramId,
|
|
@@ -613,28 +613,16 @@ export class KaminoManager {
|
|
|
613
613
|
}
|
|
614
614
|
);
|
|
615
615
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
batch.map((account) =>
|
|
624
|
-
KaminoMarket.load(this._connection, account.pubkey, this.recentSlotDurationMs, this._kaminoLendProgramId).catch(error => {
|
|
625
|
-
console.error(`Error loading market ${account.pubkey}:`, error.message);
|
|
626
|
-
return null;
|
|
627
|
-
})
|
|
628
|
-
)
|
|
629
|
-
);
|
|
630
|
-
loadedMarkets.push(...batchResults);
|
|
631
|
-
// sleep only if there's more batches to process
|
|
632
|
-
if (i + batchSizeToUse < lendingMarketsAccounts.length) {
|
|
633
|
-
await new Promise((resolve) => setTimeout(resolve, sleepMs));
|
|
634
|
-
}
|
|
635
|
-
}
|
|
616
|
+
const marketPromises = lendingMarketsAccounts.map(account =>
|
|
617
|
+
KaminoMarket.load(this._connection, account.pubkey, this.recentSlotDurationMs, this._kaminoLendProgramId)
|
|
618
|
+
.catch(error => {
|
|
619
|
+
console.error(`Error loading market ${account.pubkey}:`, error.message);
|
|
620
|
+
return null;
|
|
621
|
+
})
|
|
622
|
+
);
|
|
636
623
|
|
|
637
|
-
|
|
624
|
+
const markets = await Promise.all(marketPromises);
|
|
625
|
+
return markets.filter((market): market is KaminoMarket => market !== null);
|
|
638
626
|
}
|
|
639
627
|
|
|
640
628
|
/**
|
|
@@ -1348,7 +1336,7 @@ const updateLendingMarketConfig = (
|
|
|
1348
1336
|
mode: UpdateLendingMarketMode.UpdateObligationOrdersEnabled.discriminator,
|
|
1349
1337
|
value: updateMarketConfigEncodedValue(
|
|
1350
1338
|
UpdateLendingMarketMode.UpdateObligationOrdersEnabled.discriminator,
|
|
1351
|
-
newMarket.
|
|
1339
|
+
newMarket.obligationOrdersEnabled
|
|
1352
1340
|
),
|
|
1353
1341
|
});
|
|
1354
1342
|
}
|
package/src/classes/vault.ts
CHANGED
|
@@ -109,7 +109,7 @@ const TOKEN_VAULT_SEED = 'token_vault';
|
|
|
109
109
|
const CTOKEN_VAULT_SEED = 'ctoken_vault';
|
|
110
110
|
const BASE_VAULT_AUTHORITY_SEED = 'authority';
|
|
111
111
|
const SHARES_SEED = 'shares';
|
|
112
|
-
|
|
112
|
+
const EVENT_AUTHORITY_SEED = '__event_authority';
|
|
113
113
|
export const INITIAL_DEPOSIT_LAMPORTS = 1000;
|
|
114
114
|
|
|
115
115
|
/**
|
|
@@ -794,6 +794,7 @@ export class KaminoVaultClient {
|
|
|
794
794
|
]);
|
|
795
795
|
createAtasIxns.push(createSharesAtaIxns);
|
|
796
796
|
|
|
797
|
+
const eventAuthority = getEventAuthorityPda(this._kaminoVaultProgramId);
|
|
797
798
|
const depoistAccounts: DepositAccounts = {
|
|
798
799
|
user: user,
|
|
799
800
|
vaultState: vault.address,
|
|
@@ -806,6 +807,8 @@ export class KaminoVaultClient {
|
|
|
806
807
|
tokenProgram: tokenProgramID,
|
|
807
808
|
klendProgram: this._kaminoLendProgramId,
|
|
808
809
|
sharesTokenProgram: TOKEN_PROGRAM_ID,
|
|
810
|
+
eventAuthority: eventAuthority,
|
|
811
|
+
program: this._kaminoVaultProgramId,
|
|
809
812
|
};
|
|
810
813
|
|
|
811
814
|
const depositArgs: DepositArgs = {
|
|
@@ -1276,6 +1279,7 @@ export class KaminoVaultClient {
|
|
|
1276
1279
|
): TransactionInstruction {
|
|
1277
1280
|
const lendingMarketAuth = lendingMarketAuthPda(marketAddress, this._kaminoLendProgramId)[0];
|
|
1278
1281
|
|
|
1282
|
+
const eventAuthority = getEventAuthorityPda(this._kaminoVaultProgramId);
|
|
1279
1283
|
const withdrawAccounts: WithdrawAccounts = {
|
|
1280
1284
|
withdrawFromAvailable: {
|
|
1281
1285
|
user,
|
|
@@ -1289,6 +1293,8 @@ export class KaminoVaultClient {
|
|
|
1289
1293
|
tokenProgram: vaultState.tokenProgram,
|
|
1290
1294
|
sharesTokenProgram: TOKEN_PROGRAM_ID,
|
|
1291
1295
|
klendProgram: this._kaminoLendProgramId,
|
|
1296
|
+
eventAuthority: eventAuthority,
|
|
1297
|
+
program: this._kaminoVaultProgramId,
|
|
1292
1298
|
},
|
|
1293
1299
|
withdrawFromReserveAccounts: {
|
|
1294
1300
|
vaultState: vault.address,
|
|
@@ -1301,6 +1307,8 @@ export class KaminoVaultClient {
|
|
|
1301
1307
|
reserveCollateralTokenProgram: TOKEN_PROGRAM_ID,
|
|
1302
1308
|
instructionSysvarAccount: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
1303
1309
|
},
|
|
1310
|
+
eventAuthority: eventAuthority,
|
|
1311
|
+
program: this._kaminoVaultProgramId,
|
|
1304
1312
|
};
|
|
1305
1313
|
|
|
1306
1314
|
const withdrawArgs: WithdrawArgs = {
|
|
@@ -1341,6 +1349,7 @@ export class KaminoVaultClient {
|
|
|
1341
1349
|
userTokenAta: PublicKey,
|
|
1342
1350
|
shareAmountLamports: Decimal
|
|
1343
1351
|
): Promise<TransactionInstruction> {
|
|
1352
|
+
const eventAuthority = getEventAuthorityPda(this._kaminoVaultProgramId);
|
|
1344
1353
|
const withdrawFromAvailableAccounts: WithdrawFromAvailableAccounts = {
|
|
1345
1354
|
user,
|
|
1346
1355
|
vaultState: vault.address,
|
|
@@ -1353,6 +1362,8 @@ export class KaminoVaultClient {
|
|
|
1353
1362
|
tokenProgram: vaultState.tokenProgram,
|
|
1354
1363
|
sharesTokenProgram: TOKEN_PROGRAM_ID,
|
|
1355
1364
|
klendProgram: this._kaminoLendProgramId,
|
|
1365
|
+
eventAuthority: eventAuthority,
|
|
1366
|
+
program: this._kaminoVaultProgramId,
|
|
1356
1367
|
};
|
|
1357
1368
|
|
|
1358
1369
|
const withdrawFromAvailableArgs: WithdrawFromAvailableArgs = {
|
|
@@ -2688,6 +2699,10 @@ export function getCTokenVaultPda(vaultAddress: PublicKey, reserveAddress: Publi
|
|
|
2688
2699
|
)[0];
|
|
2689
2700
|
}
|
|
2690
2701
|
|
|
2702
|
+
export function getEventAuthorityPda(kaminoVaultProgramId: PublicKey) {
|
|
2703
|
+
return PublicKey.findProgramAddressSync([Buffer.from(EVENT_AUTHORITY_SEED)], kaminoVaultProgramId)[0];
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2691
2706
|
export type VaultHolder = {
|
|
2692
2707
|
holderPubkey: PublicKey;
|
|
2693
2708
|
amount: Decimal;
|
|
@@ -20,6 +20,8 @@ export interface DepositAccounts {
|
|
|
20
20
|
klendProgram: PublicKey
|
|
21
21
|
tokenProgram: PublicKey
|
|
22
22
|
sharesTokenProgram: PublicKey
|
|
23
|
+
eventAuthority: PublicKey
|
|
24
|
+
program: PublicKey
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export const layout = borsh.struct([borsh.u64("maxAmount")])
|
|
@@ -41,6 +43,8 @@ export function deposit(
|
|
|
41
43
|
{ pubkey: accounts.klendProgram, isSigner: false, isWritable: false },
|
|
42
44
|
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
43
45
|
{ pubkey: accounts.sharesTokenProgram, isSigner: false, isWritable: false },
|
|
46
|
+
{ pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
|
|
47
|
+
{ pubkey: accounts.program, isSigner: false, isWritable: false },
|
|
44
48
|
]
|
|
45
49
|
const identifier = Buffer.from([242, 35, 198, 137, 82, 225, 242, 182])
|
|
46
50
|
const buffer = Buffer.alloc(1000)
|
|
@@ -21,6 +21,8 @@ export interface WithdrawAccounts {
|
|
|
21
21
|
tokenProgram: PublicKey
|
|
22
22
|
sharesTokenProgram: PublicKey
|
|
23
23
|
klendProgram: PublicKey
|
|
24
|
+
eventAuthority: PublicKey
|
|
25
|
+
program: PublicKey
|
|
24
26
|
}
|
|
25
27
|
withdrawFromReserveAccounts: {
|
|
26
28
|
vaultState: PublicKey
|
|
@@ -33,6 +35,8 @@ export interface WithdrawAccounts {
|
|
|
33
35
|
reserveCollateralTokenProgram: PublicKey
|
|
34
36
|
instructionSysvarAccount: PublicKey
|
|
35
37
|
}
|
|
38
|
+
eventAuthority: PublicKey
|
|
39
|
+
program: PublicKey
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
export const layout = borsh.struct([borsh.u64("sharesAmount")])
|
|
@@ -98,6 +102,16 @@ export function withdraw(
|
|
|
98
102
|
isSigner: false,
|
|
99
103
|
isWritable: false,
|
|
100
104
|
},
|
|
105
|
+
{
|
|
106
|
+
pubkey: accounts.withdrawFromAvailable.eventAuthority,
|
|
107
|
+
isSigner: false,
|
|
108
|
+
isWritable: false,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
pubkey: accounts.withdrawFromAvailable.program,
|
|
112
|
+
isSigner: false,
|
|
113
|
+
isWritable: false,
|
|
114
|
+
},
|
|
101
115
|
{
|
|
102
116
|
pubkey: accounts.withdrawFromReserveAccounts.vaultState,
|
|
103
117
|
isSigner: false,
|
|
@@ -144,6 +158,8 @@ export function withdraw(
|
|
|
144
158
|
isSigner: false,
|
|
145
159
|
isWritable: false,
|
|
146
160
|
},
|
|
161
|
+
{ pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
|
|
162
|
+
{ pubkey: accounts.program, isSigner: false, isWritable: false },
|
|
147
163
|
]
|
|
148
164
|
const identifier = Buffer.from([183, 18, 70, 156, 148, 109, 161, 34])
|
|
149
165
|
const buffer = Buffer.alloc(1000)
|
|
@@ -20,6 +20,8 @@ export interface WithdrawFromAvailableAccounts {
|
|
|
20
20
|
tokenProgram: PublicKey
|
|
21
21
|
sharesTokenProgram: PublicKey
|
|
22
22
|
klendProgram: PublicKey
|
|
23
|
+
eventAuthority: PublicKey
|
|
24
|
+
program: PublicKey
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export const layout = borsh.struct([borsh.u64("sharesAmount")])
|
|
@@ -41,6 +43,8 @@ export function withdrawFromAvailable(
|
|
|
41
43
|
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
42
44
|
{ pubkey: accounts.sharesTokenProgram, isSigner: false, isWritable: false },
|
|
43
45
|
{ pubkey: accounts.klendProgram, isSigner: false, isWritable: false },
|
|
46
|
+
{ pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
|
|
47
|
+
{ pubkey: accounts.program, isSigner: false, isWritable: false },
|
|
44
48
|
]
|
|
45
49
|
const identifier = Buffer.from([19, 131, 112, 155, 170, 220, 34, 57])
|
|
46
50
|
const buffer = Buffer.alloc(1000)
|
|
@@ -10,10 +10,15 @@ export interface ReserveConfigFields {
|
|
|
10
10
|
assetTier: number
|
|
11
11
|
/** Flat rate that goes to the host */
|
|
12
12
|
hostFixedInterestRateBps: number
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
15
|
+
* - Boost for side (debt or collateral)
|
|
16
|
+
* - Reward points multiplier per obligation type
|
|
17
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
18
|
+
*/
|
|
14
19
|
reserved2: Array<number>
|
|
15
|
-
/**
|
|
16
|
-
|
|
20
|
+
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
21
|
+
protocolOrderExecutionFeePct: number
|
|
17
22
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
18
23
|
protocolTakeRatePct: number
|
|
19
24
|
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
@@ -98,10 +103,15 @@ export interface ReserveConfigJSON {
|
|
|
98
103
|
assetTier: number
|
|
99
104
|
/** Flat rate that goes to the host */
|
|
100
105
|
hostFixedInterestRateBps: number
|
|
101
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
108
|
+
* - Boost for side (debt or collateral)
|
|
109
|
+
* - Reward points multiplier per obligation type
|
|
110
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
111
|
+
*/
|
|
102
112
|
reserved2: Array<number>
|
|
103
|
-
/**
|
|
104
|
-
|
|
113
|
+
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
114
|
+
protocolOrderExecutionFeePct: number
|
|
105
115
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
106
116
|
protocolTakeRatePct: number
|
|
107
117
|
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
@@ -187,10 +197,15 @@ export class ReserveConfig {
|
|
|
187
197
|
readonly assetTier: number
|
|
188
198
|
/** Flat rate that goes to the host */
|
|
189
199
|
readonly hostFixedInterestRateBps: number
|
|
190
|
-
/**
|
|
200
|
+
/**
|
|
201
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
202
|
+
* - Boost for side (debt or collateral)
|
|
203
|
+
* - Reward points multiplier per obligation type
|
|
204
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
205
|
+
*/
|
|
191
206
|
readonly reserved2: Array<number>
|
|
192
|
-
/**
|
|
193
|
-
readonly
|
|
207
|
+
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
208
|
+
readonly protocolOrderExecutionFeePct: number
|
|
194
209
|
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
195
210
|
readonly protocolTakeRatePct: number
|
|
196
211
|
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
@@ -272,7 +287,7 @@ export class ReserveConfig {
|
|
|
272
287
|
this.assetTier = fields.assetTier
|
|
273
288
|
this.hostFixedInterestRateBps = fields.hostFixedInterestRateBps
|
|
274
289
|
this.reserved2 = fields.reserved2
|
|
275
|
-
this.
|
|
290
|
+
this.protocolOrderExecutionFeePct = fields.protocolOrderExecutionFeePct
|
|
276
291
|
this.protocolTakeRatePct = fields.protocolTakeRatePct
|
|
277
292
|
this.protocolLiquidationFeePct = fields.protocolLiquidationFeePct
|
|
278
293
|
this.loanToValuePct = fields.loanToValuePct
|
|
@@ -318,8 +333,8 @@ export class ReserveConfig {
|
|
|
318
333
|
borsh.u8("status"),
|
|
319
334
|
borsh.u8("assetTier"),
|
|
320
335
|
borsh.u16("hostFixedInterestRateBps"),
|
|
321
|
-
borsh.array(borsh.u8(),
|
|
322
|
-
borsh.
|
|
336
|
+
borsh.array(borsh.u8(), 9, "reserved2"),
|
|
337
|
+
borsh.u8("protocolOrderExecutionFeePct"),
|
|
323
338
|
borsh.u8("protocolTakeRatePct"),
|
|
324
339
|
borsh.u8("protocolLiquidationFeePct"),
|
|
325
340
|
borsh.u8("loanToValuePct"),
|
|
@@ -361,7 +376,7 @@ export class ReserveConfig {
|
|
|
361
376
|
assetTier: obj.assetTier,
|
|
362
377
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
363
378
|
reserved2: obj.reserved2,
|
|
364
|
-
|
|
379
|
+
protocolOrderExecutionFeePct: obj.protocolOrderExecutionFeePct,
|
|
365
380
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
366
381
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
367
382
|
loanToValuePct: obj.loanToValuePct,
|
|
@@ -404,7 +419,7 @@ export class ReserveConfig {
|
|
|
404
419
|
assetTier: fields.assetTier,
|
|
405
420
|
hostFixedInterestRateBps: fields.hostFixedInterestRateBps,
|
|
406
421
|
reserved2: fields.reserved2,
|
|
407
|
-
|
|
422
|
+
protocolOrderExecutionFeePct: fields.protocolOrderExecutionFeePct,
|
|
408
423
|
protocolTakeRatePct: fields.protocolTakeRatePct,
|
|
409
424
|
protocolLiquidationFeePct: fields.protocolLiquidationFeePct,
|
|
410
425
|
loanToValuePct: fields.loanToValuePct,
|
|
@@ -449,7 +464,7 @@ export class ReserveConfig {
|
|
|
449
464
|
assetTier: this.assetTier,
|
|
450
465
|
hostFixedInterestRateBps: this.hostFixedInterestRateBps,
|
|
451
466
|
reserved2: this.reserved2,
|
|
452
|
-
|
|
467
|
+
protocolOrderExecutionFeePct: this.protocolOrderExecutionFeePct,
|
|
453
468
|
protocolTakeRatePct: this.protocolTakeRatePct,
|
|
454
469
|
protocolLiquidationFeePct: this.protocolLiquidationFeePct,
|
|
455
470
|
loanToValuePct: this.loanToValuePct,
|
|
@@ -492,7 +507,7 @@ export class ReserveConfig {
|
|
|
492
507
|
assetTier: obj.assetTier,
|
|
493
508
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
494
509
|
reserved2: obj.reserved2,
|
|
495
|
-
|
|
510
|
+
protocolOrderExecutionFeePct: obj.protocolOrderExecutionFeePct,
|
|
496
511
|
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
497
512
|
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
498
513
|
loanToValuePct: obj.loanToValuePct,
|
|
@@ -180,6 +180,16 @@
|
|
|
180
180
|
"name": "sharesTokenProgram",
|
|
181
181
|
"isMut": false,
|
|
182
182
|
"isSigner": false
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "eventAuthority",
|
|
186
|
+
"isMut": false,
|
|
187
|
+
"isSigner": false
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "program",
|
|
191
|
+
"isMut": false,
|
|
192
|
+
"isSigner": false
|
|
183
193
|
}
|
|
184
194
|
],
|
|
185
195
|
"args": [
|
|
@@ -249,6 +259,16 @@
|
|
|
249
259
|
"name": "klendProgram",
|
|
250
260
|
"isMut": false,
|
|
251
261
|
"isSigner": false
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "eventAuthority",
|
|
265
|
+
"isMut": false,
|
|
266
|
+
"isSigner": false
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "program",
|
|
270
|
+
"isMut": false,
|
|
271
|
+
"isSigner": false
|
|
252
272
|
}
|
|
253
273
|
]
|
|
254
274
|
},
|
|
@@ -301,6 +321,16 @@
|
|
|
301
321
|
"isSigner": false
|
|
302
322
|
}
|
|
303
323
|
]
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"name": "eventAuthority",
|
|
327
|
+
"isMut": false,
|
|
328
|
+
"isSigner": false
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "program",
|
|
332
|
+
"isMut": false,
|
|
333
|
+
"isSigner": false
|
|
304
334
|
}
|
|
305
335
|
],
|
|
306
336
|
"args": [
|
|
@@ -722,6 +752,16 @@
|
|
|
722
752
|
"name": "klendProgram",
|
|
723
753
|
"isMut": false,
|
|
724
754
|
"isSigner": false
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"name": "eventAuthority",
|
|
758
|
+
"isMut": false,
|
|
759
|
+
"isSigner": false
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "program",
|
|
763
|
+
"isMut": false,
|
|
764
|
+
"isSigner": false
|
|
725
765
|
}
|
|
726
766
|
],
|
|
727
767
|
"args": [
|
|
@@ -1198,26 +1238,24 @@
|
|
|
1198
1238
|
{
|
|
1199
1239
|
"name": "reserved2",
|
|
1200
1240
|
"docs": [
|
|
1201
|
-
"[DEPRECATED]
|
|
1241
|
+
"[DEPRECATED] Space that used to hold 2 fields:",
|
|
1242
|
+
"- Boost for side (debt or collateral)",
|
|
1243
|
+
"- Reward points multiplier per obligation type",
|
|
1244
|
+
"Can be re-used after making sure all underlying production account data is zeroed."
|
|
1202
1245
|
],
|
|
1203
1246
|
"type": {
|
|
1204
1247
|
"array": [
|
|
1205
1248
|
"u8",
|
|
1206
|
-
|
|
1249
|
+
9
|
|
1207
1250
|
]
|
|
1208
1251
|
}
|
|
1209
1252
|
},
|
|
1210
1253
|
{
|
|
1211
|
-
"name": "
|
|
1254
|
+
"name": "protocolOrderExecutionFeePct",
|
|
1212
1255
|
"docs": [
|
|
1213
|
-
"
|
|
1256
|
+
"Cut of the order execution bonus that the protocol receives, as a percentage"
|
|
1214
1257
|
],
|
|
1215
|
-
"type":
|
|
1216
|
-
"array": [
|
|
1217
|
-
"u8",
|
|
1218
|
-
8
|
|
1219
|
-
]
|
|
1220
|
-
}
|
|
1258
|
+
"type": "u8"
|
|
1221
1259
|
},
|
|
1222
1260
|
{
|
|
1223
1261
|
"name": "protocolTakeRatePct",
|
|
@@ -1982,6 +2020,78 @@
|
|
|
1982
2020
|
}
|
|
1983
2021
|
}
|
|
1984
2022
|
],
|
|
2023
|
+
"events": [
|
|
2024
|
+
{
|
|
2025
|
+
"name": "DepositResultEvent",
|
|
2026
|
+
"fields": [
|
|
2027
|
+
{
|
|
2028
|
+
"name": "sharesToMint",
|
|
2029
|
+
"type": "u64",
|
|
2030
|
+
"index": false
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
"name": "tokenToDeposit",
|
|
2034
|
+
"type": "u64",
|
|
2035
|
+
"index": false
|
|
2036
|
+
},
|
|
2037
|
+
{
|
|
2038
|
+
"name": "crankFundsToDeposit",
|
|
2039
|
+
"type": "u64",
|
|
2040
|
+
"index": false
|
|
2041
|
+
}
|
|
2042
|
+
]
|
|
2043
|
+
},
|
|
2044
|
+
{
|
|
2045
|
+
"name": "DepositUserAtaBalanceEvent",
|
|
2046
|
+
"fields": [
|
|
2047
|
+
{
|
|
2048
|
+
"name": "userAtaBalance",
|
|
2049
|
+
"type": "u64",
|
|
2050
|
+
"index": false
|
|
2051
|
+
}
|
|
2052
|
+
]
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"name": "SharesToWithdrawEvent",
|
|
2056
|
+
"fields": [
|
|
2057
|
+
{
|
|
2058
|
+
"name": "sharesAmount",
|
|
2059
|
+
"type": "u64",
|
|
2060
|
+
"index": false
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
"name": "userSharesBefore",
|
|
2064
|
+
"type": "u64",
|
|
2065
|
+
"index": false
|
|
2066
|
+
}
|
|
2067
|
+
]
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
"name": "WithdrawResultEvent",
|
|
2071
|
+
"fields": [
|
|
2072
|
+
{
|
|
2073
|
+
"name": "sharesToBurn",
|
|
2074
|
+
"type": "u64",
|
|
2075
|
+
"index": false
|
|
2076
|
+
},
|
|
2077
|
+
{
|
|
2078
|
+
"name": "availableToSendToUser",
|
|
2079
|
+
"type": "u64",
|
|
2080
|
+
"index": false
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"name": "investedToDisinvestCtokens",
|
|
2084
|
+
"type": "u64",
|
|
2085
|
+
"index": false
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
"name": "investedLiquidityToSendToUser",
|
|
2089
|
+
"type": "u64",
|
|
2090
|
+
"index": false
|
|
2091
|
+
}
|
|
2092
|
+
]
|
|
2093
|
+
}
|
|
2094
|
+
],
|
|
1985
2095
|
"errors": [
|
|
1986
2096
|
{
|
|
1987
2097
|
"code": 7000,
|