@kamino-finance/klend-sdk 5.11.7 → 5.11.8
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/action.d.ts +12 -2
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +225 -30
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/manager.js +1 -1
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/obligation.d.ts +1 -1
- package/dist/classes/obligation.d.ts.map +1 -1
- package/dist/classes/obligation.js +1 -1
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/vault.js +6 -6
- package/dist/classes/vault.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.js +9 -5
- package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.d.ts +5 -0
- package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.js +26 -1
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/utils/lookupTable.d.ts +27 -0
- package/dist/utils/lookupTable.d.ts.map +1 -1
- package/dist/utils/lookupTable.js +58 -0
- package/dist/utils/lookupTable.js.map +1 -1
- package/dist/utils/seeds.d.ts +11 -1
- package/dist/utils/seeds.d.ts.map +1 -1
- package/dist/utils/seeds.js +13 -3
- package/dist/utils/seeds.js.map +1 -1
- package/dist/utils/userMetadata.js +6 -6
- package/dist/utils/userMetadata.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/action.ts +358 -50
- package/src/classes/manager.ts +1 -1
- package/src/classes/obligation.ts +1 -1
- package/src/classes/vault.ts +1 -1
- package/src/lending_operations/repay_with_collateral_calcs.ts +14 -5
- package/src/lending_operations/repay_with_collateral_operations.ts +63 -20
- package/src/utils/lookupTable.ts +62 -0
- package/src/utils/seeds.ts +14 -4
- package/src/utils/userMetadata.ts +14 -14
- package/dist/classes/lut_utils.d.ts +0 -29
- package/dist/classes/lut_utils.d.ts.map +0 -1
- package/dist/classes/lut_utils.js +0 -62
- package/dist/classes/lut_utils.js.map +0 -1
- package/src/classes/lut_utils.ts +0 -63
package/dist/classes/action.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { KaminoMarket } from './market';
|
|
|
5
5
|
import { KaminoObligation } from './obligation';
|
|
6
6
|
import { KaminoReserve } from './reserve';
|
|
7
7
|
import { Scope } from '@kamino-finance/scope-sdk';
|
|
8
|
-
export type ActionType = 'deposit' | 'borrow' | 'withdraw' | 'repay' | 'mint' | 'redeem' | 'depositCollateral' | 'liquidate' | 'depositAndBorrow' | 'repayAndWithdraw' | 'refreshObligation' | 'requestElevationGroup' | 'withdrawReferrerFees';
|
|
8
|
+
export type ActionType = 'deposit' | 'borrow' | 'withdraw' | 'repay' | 'mint' | 'redeem' | 'depositCollateral' | 'liquidate' | 'depositAndBorrow' | 'repayAndWithdraw' | 'refreshObligation' | 'requestElevationGroup' | 'withdrawReferrerFees' | 'repayAndWithdrawV2' | 'depositAndWithdraw';
|
|
9
9
|
export type AuxiliaryIx = 'setup' | 'inBetween' | 'cleanup';
|
|
10
10
|
export declare class KaminoAction {
|
|
11
11
|
kaminoMarket: KaminoMarket;
|
|
@@ -72,6 +72,14 @@ export declare class KaminoAction {
|
|
|
72
72
|
includeAtaIxns?: boolean, // if true it includes create and close wsol and token atas,
|
|
73
73
|
requestElevationGroup?: boolean, includeUserMetadata?: boolean, // if true it includes user metadata,
|
|
74
74
|
createLookupTable?: boolean, referrer?: PublicKey, currentSlot?: number): Promise<KaminoAction>;
|
|
75
|
+
static buildDepositAndWithdrawV2Txns(kaminoMarket: KaminoMarket, depositAmount: string | BN, depositMint: PublicKey, withdrawAmount: string | BN, withdrawMint: PublicKey, payer: PublicKey, currentSlot: number, obligation: KaminoObligation | ObligationType, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ixn
|
|
76
|
+
includeAtaIxns?: boolean, // if true it includes create and close wsol and token atas,
|
|
77
|
+
requestElevationGroup?: boolean, includeUserMetadata?: boolean, // if true it includes user metadata,
|
|
78
|
+
createLookupTable?: boolean, referrer?: PublicKey): Promise<KaminoAction>;
|
|
79
|
+
static buildRepayAndWithdrawV2Txns(kaminoMarket: KaminoMarket, repayAmount: string | BN, repayMint: PublicKey, withdrawAmount: string | BN, withdrawMint: PublicKey, payer: PublicKey, currentSlot: number, obligation: KaminoObligation | ObligationType, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ixn
|
|
80
|
+
includeAtaIxns?: boolean, // if true it includes create and close wsol and token atas,
|
|
81
|
+
requestElevationGroup?: boolean, includeUserMetadata?: boolean, // if true it includes user metadata,
|
|
82
|
+
createLookupTable?: boolean, referrer?: PublicKey): Promise<KaminoAction>;
|
|
75
83
|
static buildRepayAndWithdrawTxns(kaminoMarket: KaminoMarket, repayAmount: string | BN, repayMint: PublicKey, withdrawAmount: string | BN, withdrawMint: PublicKey, payer: PublicKey, currentSlot: number, obligation: KaminoObligation | ObligationType, useV2Ixs: boolean, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ixn
|
|
76
84
|
includeAtaIxns?: boolean, // if true it includes create and close wsol and token atas,
|
|
77
85
|
requestElevationGroup?: boolean, includeUserMetadata?: boolean, // if true it includes user metadata,
|
|
@@ -121,11 +129,13 @@ export declare class KaminoAction {
|
|
|
121
129
|
addWithdrawIxV2(collateralAmount: BN): Promise<void>;
|
|
122
130
|
addRepayIx(): Promise<void>;
|
|
123
131
|
addRepayIxV2(): Promise<void>;
|
|
132
|
+
addRepayAndWithdrawV2Ixs(withdrawCollateralAmount: BN): void;
|
|
133
|
+
addDepositAndWithdrawV2Ixs(withdrawCollateralAmount: BN): void;
|
|
124
134
|
addDepositAndBorrowIx(): Promise<void>;
|
|
125
135
|
addDepositAndBorrowIxV2(): Promise<void>;
|
|
126
136
|
addRepayAndWithdrawIxs(withdrawCollateralAmount: BN): Promise<void>;
|
|
127
137
|
addRepayAndWithdrawIxsV2(withdrawCollateralAmount: BN): Promise<void>;
|
|
128
|
-
addLiquidateIx(maxAllowedLtvOverridePercent?: number):
|
|
138
|
+
addLiquidateIx(maxAllowedLtvOverridePercent?: number): void;
|
|
129
139
|
addLiquidateIxV2(maxAllowedLtvOverridePercent?: number): Promise<void>;
|
|
130
140
|
addInBetweenIxs(action: ActionType, includeAtaIxns: boolean, requestElevationGroup: boolean, addInitObligationForFarm: boolean, useV2Ixs: boolean): Promise<void>;
|
|
131
141
|
addRefreshObligation(crank: PublicKey): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/classes/action.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,4BAA4B,EAI5B,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAE,MAAM,OAAO,CAAC;AAiCvB,OAAO,EAGL,cAAc,EAQd,uBAAuB,EAIxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAA8B,YAAY,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAM1C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,QAAQ,GACR,UAAU,GACV,OAAO,GACP,MAAM,GACN,QAAQ,GACR,mBAAmB,GACnB,WAAW,GACX,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAE5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,GAAG,EAAE,EACzB,eAAe,EAAE,SAAS,EAC1B,gBAAgB,EAAE,SAAS,EAC3B,KAAK,EAAE,SAAS,EAChB,eAAe,EAAE,SAAS,EAC1B,UAAU,EAAE,gBAAgB,GAAG,cAAc,EAC7C,aAAa,CAAC,EAAE,MAAM,GAAG,EAAE,EAC3B,QAAQ,GAAE,SAA6B,EACvC,WAAW,GAAE,MAAU;WAqDZ,8BAA8B,CACzC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,YAAY,EAC1B,WAAW,GAAE,MAAU;;;;IAoCzB,2BAA2B,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE;IAWnE,gBAAgB,IAAI,SAAS;IAM7B,gCAAgC,IAAI,SAAS,EAAE;mBAsB1B,cAAc;IAoBnC,0BAA0B,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS;IAI7D,4BAA4B,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS;IAIhF,+BAA+B,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS;WAIpD,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,sBAAsB,CAAC;WAOhE,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,sBAAsB,CAAC;WAWvE,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;WAOrD,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;CAU3E"}
|
package/dist/classes/action.js
CHANGED
|
@@ -304,6 +304,36 @@ class KaminoAction {
|
|
|
304
304
|
}
|
|
305
305
|
return axn;
|
|
306
306
|
}
|
|
307
|
+
static async buildDepositAndWithdrawV2Txns(kaminoMarket, depositAmount, depositMint, withdrawAmount, withdrawMint, payer, currentSlot, obligation, scopeRefreshConfig, extraComputeBudget = 1_000_000, // if > 0 then adds the ixn
|
|
308
|
+
includeAtaIxns = true, // if true it includes create and close wsol and token atas,
|
|
309
|
+
requestElevationGroup = false, includeUserMetadata = true, // if true it includes user metadata,
|
|
310
|
+
createLookupTable = true, referrer = web3_js_1.PublicKey.default) {
|
|
311
|
+
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'depositAndWithdraw', depositAmount, depositMint, withdrawMint, payer, payer, obligation, withdrawAmount, referrer, currentSlot);
|
|
312
|
+
const addInitObligationForFarm = true;
|
|
313
|
+
const twoTokenAction = true;
|
|
314
|
+
if (extraComputeBudget > 0) {
|
|
315
|
+
axn.addComputeBudgetIxn(extraComputeBudget);
|
|
316
|
+
}
|
|
317
|
+
await axn.addSupportIxs('depositAndWithdraw', includeAtaIxns, requestElevationGroup, includeUserMetadata, addInitObligationForFarm, true, scopeRefreshConfig, createLookupTable, twoTokenAction);
|
|
318
|
+
const withdrawCollateralAmount = axn.getWithdrawCollateralAmount(axn.outflowReserve, axn.outflowAmount);
|
|
319
|
+
axn.addDepositAndWithdrawV2Ixs(withdrawCollateralAmount);
|
|
320
|
+
return axn;
|
|
321
|
+
}
|
|
322
|
+
static async buildRepayAndWithdrawV2Txns(kaminoMarket, repayAmount, repayMint, withdrawAmount, withdrawMint, payer, currentSlot, obligation, scopeRefreshConfig, extraComputeBudget = 1_000_000, // if > 0 then adds the ixn
|
|
323
|
+
includeAtaIxns = true, // if true it includes create and close wsol and token atas,
|
|
324
|
+
requestElevationGroup = false, includeUserMetadata = true, // if true it includes user metadata,
|
|
325
|
+
createLookupTable = true, referrer = web3_js_1.PublicKey.default) {
|
|
326
|
+
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'repayAndWithdrawV2', repayAmount, repayMint, withdrawMint, payer, payer, obligation, withdrawAmount, referrer, currentSlot);
|
|
327
|
+
const addInitObligationForFarm = true;
|
|
328
|
+
const twoTokenAction = true;
|
|
329
|
+
if (extraComputeBudget > 0) {
|
|
330
|
+
axn.addComputeBudgetIxn(extraComputeBudget);
|
|
331
|
+
}
|
|
332
|
+
await axn.addSupportIxs('repayAndWithdrawV2', includeAtaIxns, requestElevationGroup, includeUserMetadata, addInitObligationForFarm, true, scopeRefreshConfig, createLookupTable, twoTokenAction);
|
|
333
|
+
const withdrawCollateralAmount = axn.getWithdrawCollateralAmount(axn.outflowReserve, axn.outflowAmount);
|
|
334
|
+
axn.addRepayAndWithdrawV2Ixs(withdrawCollateralAmount);
|
|
335
|
+
return axn;
|
|
336
|
+
}
|
|
307
337
|
static async buildRepayAndWithdrawTxns(kaminoMarket, repayAmount, repayMint, withdrawAmount, withdrawMint, payer, currentSlot, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, // if > 0 then adds the ixn
|
|
308
338
|
includeAtaIxns = true, // if true it includes create and close wsol and token atas,
|
|
309
339
|
requestElevationGroup = false, includeUserMetadata = true, // if true it includes user metadata,
|
|
@@ -533,7 +563,7 @@ class KaminoAction {
|
|
|
533
563
|
reserveFarmState: this.kaminoMarket.programId,
|
|
534
564
|
}
|
|
535
565
|
: {
|
|
536
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
566
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmCollateral, this.getObligationPda()),
|
|
537
567
|
reserveFarmState: this.reserve.state.farmCollateral,
|
|
538
568
|
};
|
|
539
569
|
this.lendingIxsLabels.push(`depositReserveLiquidityAndObligationCollateralV2`);
|
|
@@ -583,7 +613,7 @@ class KaminoAction {
|
|
|
583
613
|
reserveFarmState: this.kaminoMarket.programId,
|
|
584
614
|
}
|
|
585
615
|
: {
|
|
586
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
616
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmCollateral, this.getObligationPda()),
|
|
587
617
|
reserveFarmState: this.reserve.state.farmCollateral,
|
|
588
618
|
};
|
|
589
619
|
this.lendingIxsLabels.push(`depositObligationCollateralV2`);
|
|
@@ -646,7 +676,7 @@ class KaminoAction {
|
|
|
646
676
|
reserveFarmState: this.kaminoMarket.programId,
|
|
647
677
|
}
|
|
648
678
|
: {
|
|
649
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
679
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmDebt, this.getObligationPda()),
|
|
650
680
|
reserveFarmState: this.reserve.state.farmDebt,
|
|
651
681
|
};
|
|
652
682
|
const borrowIx = (0, instructions_1.borrowObligationLiquidityV2)({
|
|
@@ -704,7 +734,7 @@ class KaminoAction {
|
|
|
704
734
|
reserveFarmState: this.kaminoMarket.programId,
|
|
705
735
|
}
|
|
706
736
|
: {
|
|
707
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
737
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmCollateral, this.getObligationPda()),
|
|
708
738
|
reserveFarmState: this.reserve.state.farmCollateral,
|
|
709
739
|
};
|
|
710
740
|
this.lendingIxsLabels.push(`withdrawObligationCollateralAndRedeemReserveCollateralV2`);
|
|
@@ -764,7 +794,7 @@ class KaminoAction {
|
|
|
764
794
|
reserveFarmState: this.kaminoMarket.programId,
|
|
765
795
|
}
|
|
766
796
|
: {
|
|
767
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
797
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmDebt, this.getObligationPda()),
|
|
768
798
|
reserveFarmState: this.reserve.state.farmDebt,
|
|
769
799
|
};
|
|
770
800
|
const depositReserveAccountMetas = depositReservesList.map((reserve) => {
|
|
@@ -792,6 +822,159 @@ class KaminoAction {
|
|
|
792
822
|
this.obligation.state.elevationGroup > 0 ? repayIx.keys.concat([...depositReserveAccountMetas]) : repayIx.keys;
|
|
793
823
|
this.lendingIxs.push(repayIx);
|
|
794
824
|
}
|
|
825
|
+
addRepayAndWithdrawV2Ixs(withdrawCollateralAmount) {
|
|
826
|
+
this.lendingIxsLabels.push(`repayAndWithdrawAndRedeem(repayReserve=${this.reserve.address})(withdrawReserve=${this.outflowReserve.address})(obligation=${this.getObligationPda()})`);
|
|
827
|
+
const depositReservesList = this.getAdditionalDepositReservesList();
|
|
828
|
+
const depositReserveAccountMetas = depositReservesList.map((reserve) => {
|
|
829
|
+
return { pubkey: reserve, isSigner: false, isWritable: true };
|
|
830
|
+
});
|
|
831
|
+
const borrowReserveAccountMetas = this.borrowReserves.map((reserve) => {
|
|
832
|
+
return { pubkey: reserve, isSigner: false, isWritable: true };
|
|
833
|
+
});
|
|
834
|
+
if (!this.outflowAmount) {
|
|
835
|
+
throw new Error(`outflowAmount not set`);
|
|
836
|
+
}
|
|
837
|
+
if (!this.outflowReserve) {
|
|
838
|
+
throw new Error(`outflowReserve not set`);
|
|
839
|
+
}
|
|
840
|
+
const collateralFarmsAccounts = this.outflowReserve.state.farmCollateral.equals(web3_js_1.PublicKey.default)
|
|
841
|
+
? {
|
|
842
|
+
obligationFarmUserState: this.kaminoMarket.programId,
|
|
843
|
+
reserveFarmState: this.kaminoMarket.programId,
|
|
844
|
+
}
|
|
845
|
+
: {
|
|
846
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.outflowReserve.state.farmCollateral, this.getObligationPda()),
|
|
847
|
+
reserveFarmState: this.outflowReserve.state.farmCollateral,
|
|
848
|
+
};
|
|
849
|
+
const debtFarmsAccounts = this.reserve.state.farmDebt.equals(web3_js_1.PublicKey.default)
|
|
850
|
+
? {
|
|
851
|
+
obligationFarmUserState: this.kaminoMarket.programId,
|
|
852
|
+
reserveFarmState: this.kaminoMarket.programId,
|
|
853
|
+
}
|
|
854
|
+
: {
|
|
855
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmDebt, this.getObligationPda()),
|
|
856
|
+
reserveFarmState: this.reserve.state.farmDebt,
|
|
857
|
+
};
|
|
858
|
+
const repayAndWithdrawIx = (0, instructions_1.repayAndWithdrawAndRedeem)({
|
|
859
|
+
repayAmount: this.amount,
|
|
860
|
+
withdrawCollateralAmount,
|
|
861
|
+
}, {
|
|
862
|
+
repayAccounts: {
|
|
863
|
+
owner: this.owner,
|
|
864
|
+
obligation: this.getObligationPda(),
|
|
865
|
+
lendingMarket: this.kaminoMarket.getAddress(),
|
|
866
|
+
repayReserve: this.reserve.address,
|
|
867
|
+
reserveLiquidityMint: this.reserve.getLiquidityMint(),
|
|
868
|
+
userSourceLiquidity: this.getUserTokenAccountAddress(this.reserve),
|
|
869
|
+
reserveDestinationLiquidity: this.reserve.state.liquidity.supplyVault,
|
|
870
|
+
tokenProgram: this.reserve.getLiquidityTokenProgram(),
|
|
871
|
+
instructionSysvarAccount: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
872
|
+
},
|
|
873
|
+
withdrawAccounts: {
|
|
874
|
+
owner: this.owner,
|
|
875
|
+
obligation: this.getObligationPda(),
|
|
876
|
+
lendingMarket: this.kaminoMarket.getAddress(),
|
|
877
|
+
lendingMarketAuthority: this.kaminoMarket.getLendingMarketAuthority(),
|
|
878
|
+
withdrawReserve: this.outflowReserve.address,
|
|
879
|
+
reserveLiquidityMint: this.outflowReserve.getLiquidityMint(),
|
|
880
|
+
reserveCollateralMint: this.outflowReserve.getCTokenMint(),
|
|
881
|
+
reserveLiquiditySupply: this.outflowReserve.state.liquidity.supplyVault,
|
|
882
|
+
reserveSourceCollateral: this.outflowReserve.state.collateral.supplyVault,
|
|
883
|
+
userDestinationLiquidity: this.getUserTokenAccountAddress(this.outflowReserve),
|
|
884
|
+
placeholderUserDestinationCollateral: this.kaminoMarket.programId,
|
|
885
|
+
collateralTokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
886
|
+
liquidityTokenProgram: this.outflowReserve.getLiquidityTokenProgram(),
|
|
887
|
+
instructionSysvarAccount: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
888
|
+
},
|
|
889
|
+
collateralFarmsAccounts,
|
|
890
|
+
debtFarmsAccounts,
|
|
891
|
+
farmsProgram: farms_sdk_1.farmsId,
|
|
892
|
+
}, this.kaminoMarket.programId);
|
|
893
|
+
repayAndWithdrawIx.keys = repayAndWithdrawIx.keys.concat([
|
|
894
|
+
...depositReserveAccountMetas,
|
|
895
|
+
...borrowReserveAccountMetas,
|
|
896
|
+
]);
|
|
897
|
+
this.lendingIxs.push(repayAndWithdrawIx);
|
|
898
|
+
}
|
|
899
|
+
addDepositAndWithdrawV2Ixs(withdrawCollateralAmount) {
|
|
900
|
+
this.lendingIxsLabels.push(`depositAndWithdrawV2(depositReserve=${this.reserve.address})(withdrawReserve=${this.outflowReserve.address})(obligation=${this.getObligationPda()})`);
|
|
901
|
+
const depositReservesList = this.getAdditionalDepositReservesList();
|
|
902
|
+
const depositReserveAccountMetas = depositReservesList.map((reserve) => {
|
|
903
|
+
return { pubkey: reserve, isSigner: false, isWritable: true };
|
|
904
|
+
});
|
|
905
|
+
const borrowReserveAccountMetas = this.borrowReserves.map((reserve) => {
|
|
906
|
+
return { pubkey: reserve, isSigner: false, isWritable: true };
|
|
907
|
+
});
|
|
908
|
+
if (!this.outflowAmount) {
|
|
909
|
+
throw new Error(`outflowAmount not set`);
|
|
910
|
+
}
|
|
911
|
+
if (!this.outflowReserve) {
|
|
912
|
+
throw new Error(`outflowReserve not set`);
|
|
913
|
+
}
|
|
914
|
+
const depositFarmsAccounts = this.reserve.state.farmCollateral.equals(web3_js_1.PublicKey.default)
|
|
915
|
+
? {
|
|
916
|
+
obligationFarmUserState: this.kaminoMarket.programId,
|
|
917
|
+
reserveFarmState: this.kaminoMarket.programId,
|
|
918
|
+
}
|
|
919
|
+
: {
|
|
920
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmCollateral, this.getObligationPda()),
|
|
921
|
+
reserveFarmState: this.reserve.state.farmCollateral,
|
|
922
|
+
};
|
|
923
|
+
const withdrawFarmsAccounts = this.outflowReserve.state.farmCollateral.equals(web3_js_1.PublicKey.default)
|
|
924
|
+
? {
|
|
925
|
+
obligationFarmUserState: this.kaminoMarket.programId,
|
|
926
|
+
reserveFarmState: this.kaminoMarket.programId,
|
|
927
|
+
}
|
|
928
|
+
: {
|
|
929
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.outflowReserve.state.farmCollateral, this.getObligationPda()),
|
|
930
|
+
reserveFarmState: this.outflowReserve.state.farmCollateral,
|
|
931
|
+
};
|
|
932
|
+
const depositAndWithdrawIx = (0, instructions_1.depositAndWithdraw)({
|
|
933
|
+
liquidityAmount: this.amount,
|
|
934
|
+
withdrawCollateralAmount,
|
|
935
|
+
}, {
|
|
936
|
+
depositAccounts: {
|
|
937
|
+
owner: this.owner,
|
|
938
|
+
obligation: this.getObligationPda(),
|
|
939
|
+
lendingMarket: this.kaminoMarket.getAddress(),
|
|
940
|
+
lendingMarketAuthority: this.kaminoMarket.getLendingMarketAuthority(),
|
|
941
|
+
reserve: this.reserve.address,
|
|
942
|
+
reserveLiquidityMint: this.reserve.getLiquidityMint(),
|
|
943
|
+
reserveLiquiditySupply: this.reserve.state.liquidity.supplyVault,
|
|
944
|
+
reserveCollateralMint: this.reserve.getCTokenMint(),
|
|
945
|
+
reserveDestinationDepositCollateral: this.reserve.state.collateral.supplyVault, // destinationCollateral
|
|
946
|
+
userSourceLiquidity: this.getUserTokenAccountAddress(this.reserve),
|
|
947
|
+
placeholderUserDestinationCollateral: this.kaminoMarket.programId,
|
|
948
|
+
collateralTokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
949
|
+
liquidityTokenProgram: this.reserve.getLiquidityTokenProgram(),
|
|
950
|
+
instructionSysvarAccount: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
951
|
+
},
|
|
952
|
+
withdrawAccounts: {
|
|
953
|
+
owner: this.owner,
|
|
954
|
+
obligation: this.getObligationPda(),
|
|
955
|
+
lendingMarket: this.kaminoMarket.getAddress(),
|
|
956
|
+
lendingMarketAuthority: this.kaminoMarket.getLendingMarketAuthority(),
|
|
957
|
+
withdrawReserve: this.outflowReserve.address,
|
|
958
|
+
reserveLiquidityMint: this.outflowReserve.getLiquidityMint(),
|
|
959
|
+
reserveCollateralMint: this.outflowReserve.getCTokenMint(),
|
|
960
|
+
reserveLiquiditySupply: this.outflowReserve.state.liquidity.supplyVault,
|
|
961
|
+
reserveSourceCollateral: this.outflowReserve.state.collateral.supplyVault,
|
|
962
|
+
userDestinationLiquidity: this.getUserTokenAccountAddress(this.outflowReserve),
|
|
963
|
+
placeholderUserDestinationCollateral: this.kaminoMarket.programId,
|
|
964
|
+
collateralTokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
965
|
+
liquidityTokenProgram: this.outflowReserve.getLiquidityTokenProgram(),
|
|
966
|
+
instructionSysvarAccount: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
967
|
+
},
|
|
968
|
+
depositFarmsAccounts,
|
|
969
|
+
withdrawFarmsAccounts,
|
|
970
|
+
farmsProgram: farms_sdk_1.farmsId,
|
|
971
|
+
}, this.kaminoMarket.programId);
|
|
972
|
+
depositAndWithdrawIx.keys = depositAndWithdrawIx.keys.concat([
|
|
973
|
+
...depositReserveAccountMetas,
|
|
974
|
+
...borrowReserveAccountMetas,
|
|
975
|
+
]);
|
|
976
|
+
this.lendingIxs.push(depositAndWithdrawIx);
|
|
977
|
+
}
|
|
795
978
|
async addDepositAndBorrowIx() {
|
|
796
979
|
this.lendingIxsLabels.push(`depositReserveLiquidityAndObligationCollateral`);
|
|
797
980
|
this.lendingIxsLabels.push(`borrowObligationLiquidity`);
|
|
@@ -852,7 +1035,7 @@ class KaminoAction {
|
|
|
852
1035
|
reserveFarmState: this.kaminoMarket.programId,
|
|
853
1036
|
}
|
|
854
1037
|
: {
|
|
855
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
1038
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmCollateral, this.getObligationPda()),
|
|
856
1039
|
reserveFarmState: this.reserve.state.farmCollateral,
|
|
857
1040
|
};
|
|
858
1041
|
this.lendingIxsLabels.push(`depositReserveLiquidityAndObligationCollateralV2`);
|
|
@@ -898,7 +1081,7 @@ class KaminoAction {
|
|
|
898
1081
|
reserveFarmState: this.kaminoMarket.programId,
|
|
899
1082
|
}
|
|
900
1083
|
: {
|
|
901
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
1084
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.outflowReserve.state.farmDebt, this.getObligationPda()),
|
|
902
1085
|
reserveFarmState: this.outflowReserve.state.farmDebt,
|
|
903
1086
|
};
|
|
904
1087
|
const borrowIx = (0, instructions_1.borrowObligationLiquidityV2)({
|
|
@@ -984,7 +1167,7 @@ class KaminoAction {
|
|
|
984
1167
|
reserveFarmState: this.kaminoMarket.programId,
|
|
985
1168
|
}
|
|
986
1169
|
: {
|
|
987
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
1170
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmDebt, this.getObligationPda()),
|
|
988
1171
|
reserveFarmState: this.reserve.state.farmDebt,
|
|
989
1172
|
};
|
|
990
1173
|
const repayIx = (0, instructions_1.repayObligationLiquidityV2)({
|
|
@@ -1019,7 +1202,7 @@ class KaminoAction {
|
|
|
1019
1202
|
reserveFarmState: this.kaminoMarket.programId,
|
|
1020
1203
|
}
|
|
1021
1204
|
: {
|
|
1022
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
1205
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.outflowReserve.state.farmCollateral, this.getObligationPda()),
|
|
1023
1206
|
reserveFarmState: this.outflowReserve.state.farmCollateral,
|
|
1024
1207
|
};
|
|
1025
1208
|
this.lendingIxs.push((0, instructions_1.withdrawObligationCollateralAndRedeemReserveCollateralV2)({
|
|
@@ -1045,7 +1228,7 @@ class KaminoAction {
|
|
|
1045
1228
|
farmsProgram: farms_sdk_1.farmsId,
|
|
1046
1229
|
}, this.kaminoMarket.programId));
|
|
1047
1230
|
}
|
|
1048
|
-
|
|
1231
|
+
addLiquidateIx(maxAllowedLtvOverridePercent = 0) {
|
|
1049
1232
|
this.lendingIxsLabels.push(`liquidateObligationAndRedeemReserveCollateral`);
|
|
1050
1233
|
if (!this.outflowReserve) {
|
|
1051
1234
|
throw Error(`Withdraw reserve during liquidation is not defined`);
|
|
@@ -1102,7 +1285,7 @@ class KaminoAction {
|
|
|
1102
1285
|
reserveFarmState: this.kaminoMarket.programId,
|
|
1103
1286
|
}
|
|
1104
1287
|
: {
|
|
1105
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
1288
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.outflowReserve.state.farmCollateral, this.getObligationPda()),
|
|
1106
1289
|
reserveFarmState: this.outflowReserve.state.farmCollateral,
|
|
1107
1290
|
};
|
|
1108
1291
|
const debtFarmsAccounts = this.reserve.state.farmDebt.equals(web3_js_1.PublicKey.default)
|
|
@@ -1111,7 +1294,7 @@ class KaminoAction {
|
|
|
1111
1294
|
reserveFarmState: this.kaminoMarket.programId,
|
|
1112
1295
|
}
|
|
1113
1296
|
: {
|
|
1114
|
-
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.
|
|
1297
|
+
obligationFarmUserState: (0, utils_1.obligationFarmStatePda)(this.reserve.state.farmDebt, this.getObligationPda()),
|
|
1115
1298
|
reserveFarmState: this.reserve.state.farmDebt,
|
|
1116
1299
|
};
|
|
1117
1300
|
const liquidateIx = (0, instructions_1.liquidateObligationAndRedeemReserveCollateralV2)({
|
|
@@ -1179,7 +1362,9 @@ class KaminoAction {
|
|
|
1179
1362
|
'repay',
|
|
1180
1363
|
'depositAndBorrow',
|
|
1181
1364
|
'repayAndWithdraw',
|
|
1365
|
+
'repayAndWithdrawV2',
|
|
1182
1366
|
'refreshObligation',
|
|
1367
|
+
'depositAndWithdraw',
|
|
1183
1368
|
].includes(action)) {
|
|
1184
1369
|
// The support ixns in order are:
|
|
1185
1370
|
// 0. Init obligation ixn
|
|
@@ -1194,11 +1379,14 @@ class KaminoAction {
|
|
|
1194
1379
|
// 7. Ixn to refresh the `debt` farm of the obligation
|
|
1195
1380
|
// 8. Ixn to refresh the `collateral` farm of the obligation
|
|
1196
1381
|
let currentReserves = [];
|
|
1197
|
-
if (action === 'liquidate' ||
|
|
1382
|
+
if (action === 'liquidate' ||
|
|
1383
|
+
action === 'depositAndBorrow' ||
|
|
1384
|
+
action === 'repayAndWithdraw' ||
|
|
1385
|
+
action === 'repayAndWithdrawV2') {
|
|
1198
1386
|
if (!this.outflowReserve) {
|
|
1199
1387
|
throw new Error('outflowReserve is undefined');
|
|
1200
1388
|
}
|
|
1201
|
-
if (action === 'depositAndBorrow' || action === 'repayAndWithdraw') {
|
|
1389
|
+
if (action === 'depositAndBorrow' || action === 'repayAndWithdraw' || action === 'repayAndWithdrawV2') {
|
|
1202
1390
|
currentReserves = [this.reserve, this.outflowReserve];
|
|
1203
1391
|
if (action === 'depositAndBorrow') {
|
|
1204
1392
|
if (this.obligation) {
|
|
@@ -1236,13 +1424,17 @@ class KaminoAction {
|
|
|
1236
1424
|
else if (action === 'depositAndBorrow' ||
|
|
1237
1425
|
action === 'depositCollateral' ||
|
|
1238
1426
|
action === 'withdraw' ||
|
|
1239
|
-
action === 'deposit'
|
|
1427
|
+
action === 'deposit' ||
|
|
1428
|
+
action === 'depositAndWithdraw') {
|
|
1240
1429
|
await this.addInitObligationForFarm(this.reserve, types_1.ReserveFarmKind.Collateral, addAsSupportIx);
|
|
1241
|
-
if (this.outflowReserve) {
|
|
1430
|
+
if (this.outflowReserve && action !== 'depositAndWithdraw') {
|
|
1242
1431
|
await this.addInitObligationForFarm(this.outflowReserve, types_1.ReserveFarmKind.Debt, addAsSupportIx);
|
|
1243
1432
|
}
|
|
1244
1433
|
}
|
|
1245
|
-
else if (action === 'repayAndWithdraw' ||
|
|
1434
|
+
else if (action === 'repayAndWithdraw' ||
|
|
1435
|
+
action === 'borrow' ||
|
|
1436
|
+
action === 'repay' ||
|
|
1437
|
+
action === 'repayAndWithdrawV2') {
|
|
1246
1438
|
// todo - probably don't need to add both debt and collateral for everything here
|
|
1247
1439
|
await this.addInitObligationForFarm(this.reserve, types_1.ReserveFarmKind.Debt, addAsSupportIx);
|
|
1248
1440
|
if (this.outflowReserve) {
|
|
@@ -1273,7 +1465,7 @@ class KaminoAction {
|
|
|
1273
1465
|
this.addRefreshObligationIx(addAsSupportIx);
|
|
1274
1466
|
}
|
|
1275
1467
|
if (requestElevationGroup) {
|
|
1276
|
-
if (action === 'repay') {
|
|
1468
|
+
if (action === 'repay' || action === 'repayAndWithdrawV2') {
|
|
1277
1469
|
const repayObligationLiquidity = this.obligation.borrows.get(this.reserve.address);
|
|
1278
1470
|
if (!repayObligationLiquidity) {
|
|
1279
1471
|
throw new Error(`Could not find debt reserve ${this.reserve.address} in obligation`);
|
|
@@ -1577,7 +1769,7 @@ class KaminoAction {
|
|
|
1577
1769
|
farms.push([
|
|
1578
1770
|
types_1.ReserveFarmKind.Collateral,
|
|
1579
1771
|
kaminoReserve.state.farmCollateral,
|
|
1580
|
-
(0, utils_1.obligationFarmStatePda)(
|
|
1772
|
+
(0, utils_1.obligationFarmStatePda)(kaminoReserve.state.farmCollateral, this.getObligationPda()),
|
|
1581
1773
|
kaminoReserve,
|
|
1582
1774
|
]);
|
|
1583
1775
|
}
|
|
@@ -1585,7 +1777,7 @@ class KaminoAction {
|
|
|
1585
1777
|
farms.push([
|
|
1586
1778
|
types_1.ReserveFarmKind.Debt,
|
|
1587
1779
|
kaminoReserve.state.farmDebt,
|
|
1588
|
-
(0, utils_1.obligationFarmStatePda)(
|
|
1780
|
+
(0, utils_1.obligationFarmStatePda)(kaminoReserve.state.farmDebt, this.getObligationPda()),
|
|
1589
1781
|
kaminoReserve,
|
|
1590
1782
|
]);
|
|
1591
1783
|
}
|
|
@@ -1635,17 +1827,17 @@ class KaminoAction {
|
|
|
1635
1827
|
async addInitObligationForFarm(reserve, mode, addAsSupportIx = 'setup') {
|
|
1636
1828
|
const farms = [];
|
|
1637
1829
|
if (mode === types_1.ReserveFarmKind.Collateral && (0, utils_1.isNotNullPubkey)(reserve.state.farmCollateral)) {
|
|
1638
|
-
const
|
|
1639
|
-
const account = await this.kaminoMarket.getConnection().getAccountInfo(
|
|
1830
|
+
const pda = (0, utils_1.obligationFarmStatePda)(reserve.state.farmCollateral, this.getObligationPda());
|
|
1831
|
+
const account = await this.kaminoMarket.getConnection().getAccountInfo(pda);
|
|
1640
1832
|
if (!account) {
|
|
1641
|
-
farms.push([types_1.ReserveFarmKind.Collateral.discriminator, reserve.state.farmCollateral,
|
|
1833
|
+
farms.push([types_1.ReserveFarmKind.Collateral.discriminator, reserve.state.farmCollateral, pda]);
|
|
1642
1834
|
}
|
|
1643
1835
|
}
|
|
1644
1836
|
if (mode === types_1.ReserveFarmKind.Debt && (0, utils_1.isNotNullPubkey)(reserve.state.farmDebt)) {
|
|
1645
|
-
const
|
|
1646
|
-
const account = await this.kaminoMarket.getConnection().getAccountInfo(
|
|
1837
|
+
const pda = (0, utils_1.obligationFarmStatePda)(reserve.state.farmDebt, this.getObligationPda());
|
|
1838
|
+
const account = await this.kaminoMarket.getConnection().getAccountInfo(pda);
|
|
1647
1839
|
if (!account) {
|
|
1648
|
-
farms.push([types_1.ReserveFarmKind.Debt.discriminator, reserve.state.farmDebt,
|
|
1840
|
+
farms.push([types_1.ReserveFarmKind.Debt.discriminator, reserve.state.farmDebt, pda]);
|
|
1649
1841
|
}
|
|
1650
1842
|
}
|
|
1651
1843
|
farms.forEach((arg) => {
|
|
@@ -1674,7 +1866,7 @@ class KaminoAction {
|
|
|
1674
1866
|
}
|
|
1675
1867
|
});
|
|
1676
1868
|
}
|
|
1677
|
-
|
|
1869
|
+
addInitObligationIxs() {
|
|
1678
1870
|
if (!this.obligation) {
|
|
1679
1871
|
const obligationPda = this.getObligationPda();
|
|
1680
1872
|
const [userMetadataAddress, _bump] = (0, utils_1.userMetadataPda)(this.owner, this.kaminoMarket.programId);
|
|
@@ -1803,14 +1995,13 @@ class KaminoAction {
|
|
|
1803
1995
|
return;
|
|
1804
1996
|
}
|
|
1805
1997
|
let safeRepay = new bn_js_1.default(this.amount);
|
|
1806
|
-
if (this.obligation && action === 'repay' && this.amount.eq(new bn_js_1.default(utils_1.U64_MAX))) {
|
|
1998
|
+
if (this.obligation && (action === 'repay' || action === 'repayAndWithdrawV2') && this.amount.eq(new bn_js_1.default(utils_1.U64_MAX))) {
|
|
1807
1999
|
const borrow = this.obligation.state.borrows.find((borrow) => borrow.borrowReserve.toString() === this.reserve.address.toString());
|
|
1808
2000
|
if (!borrow) {
|
|
1809
2001
|
throw Error(`Unable to find obligation borrow to repay for ${this.obligation.state.owner.toBase58()}`);
|
|
1810
2002
|
}
|
|
1811
2003
|
const cumulativeBorrowRateObligation = obligation_1.KaminoObligation.getCumulativeBorrowRate(borrow);
|
|
1812
2004
|
const cumulativeBorrowRateReserve = this.reserve.getEstimatedCumulativeBorrowRate(this.currentSlot, this.kaminoMarket.state.referralFeeBps);
|
|
1813
|
-
// TODO: shouldn't this calc be added to all other stuff as well?
|
|
1814
2005
|
safeRepay = new bn_js_1.default(Math.floor(obligation_1.KaminoObligation.getBorrowAmount(borrow)
|
|
1815
2006
|
.mul(cumulativeBorrowRateReserve)
|
|
1816
2007
|
.div(cumulativeBorrowRateObligation)
|
|
@@ -1830,6 +2021,7 @@ class KaminoAction {
|
|
|
1830
2021
|
// Add rent exemption lamports for WSOL accounts that need to be pre-funded for inflow/send transactions
|
|
1831
2022
|
const sendAction = action === 'deposit' ||
|
|
1832
2023
|
action === 'repay' ||
|
|
2024
|
+
action === 'repayAndWithdrawV2' ||
|
|
1833
2025
|
action === 'mint' ||
|
|
1834
2026
|
(action === 'liquidate' && this.mint?.equals(spl_token_1.NATIVE_MINT)); // only sync WSOL amount if liquidator repays SOL which is secondaryMint
|
|
1835
2027
|
const transferLamportsIx = web3_js_1.SystemProgram.transfer({
|
|
@@ -1875,7 +2067,10 @@ class KaminoAction {
|
|
|
1875
2067
|
const referrerKey = await this.getReferrerKey(kaminoMarket, payer, kaminoObligation, referrer);
|
|
1876
2068
|
let secondaryMint;
|
|
1877
2069
|
let primaryMint;
|
|
1878
|
-
if (action === 'liquidate' ||
|
|
2070
|
+
if (action === 'liquidate' ||
|
|
2071
|
+
action === 'depositAndBorrow' ||
|
|
2072
|
+
action === 'repayAndWithdraw' ||
|
|
2073
|
+
action === 'repayAndWithdrawV2') {
|
|
1879
2074
|
primaryMint = inflowTokenMint;
|
|
1880
2075
|
secondaryMint = outflowTokenMint;
|
|
1881
2076
|
}
|