@haven-fi/solauto-sdk 1.0.133 → 1.0.135
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/solautoClient.d.ts.map +1 -1
- package/dist/clients/solautoClient.js +49 -39
- package/dist/generated/accounts/solautoPosition.d.ts +1 -7
- package/dist/generated/accounts/solautoPosition.d.ts.map +1 -1
- package/dist/generated/accounts/solautoPosition.js +2 -6
- package/dist/generated/instructions/cancelDCA.d.ts +3 -3
- package/dist/generated/instructions/cancelDCA.d.ts.map +1 -1
- package/dist/generated/instructions/cancelDCA.js +6 -6
- package/dist/generated/instructions/closePosition.d.ts +1 -2
- package/dist/generated/instructions/closePosition.d.ts.map +1 -1
- package/dist/generated/instructions/closePosition.js +6 -11
- package/dist/generated/instructions/updatePosition.d.ts +3 -3
- package/dist/generated/instructions/updatePosition.d.ts.map +1 -1
- package/dist/generated/instructions/updatePosition.js +6 -6
- package/dist/generated/types/dCASettings.d.ts +7 -5
- package/dist/generated/types/dCASettings.d.ts.map +1 -1
- package/dist/generated/types/dCASettings.js +3 -2
- package/dist/generated/types/dCASettingsInp.d.ts +5 -3
- package/dist/generated/types/dCASettingsInp.d.ts.map +1 -1
- package/dist/generated/types/dCASettingsInp.js +2 -1
- package/dist/generated/types/index.d.ts +1 -1
- package/dist/generated/types/index.d.ts.map +1 -1
- package/dist/generated/types/index.js +1 -1
- package/dist/generated/types/{feeType.d.ts → tokenType.d.ts} +6 -6
- package/dist/generated/types/tokenType.d.ts.map +1 -0
- package/dist/generated/types/tokenType.js +22 -0
- package/dist/transactions/transactionUtils.d.ts.map +1 -1
- package/dist/transactions/transactionUtils.js +15 -15
- package/dist/utils/marginfiUtils.d.ts.map +1 -1
- package/dist/utils/solauto/generalUtils.d.ts +15 -5
- package/dist/utils/solauto/generalUtils.d.ts.map +1 -1
- package/dist/utils/solauto/generalUtils.js +54 -37
- package/dist/utils/solauto/rebalanceUtils.d.ts +2 -1
- package/dist/utils/solauto/rebalanceUtils.d.ts.map +1 -1
- package/dist/utils/solauto/rebalanceUtils.js +7 -5
- package/package.json +1 -1
- package/src/clients/solautoClient.ts +50 -45
- package/src/generated/accounts/solautoPosition.ts +2 -15
- package/src/generated/instructions/cancelDCA.ts +9 -9
- package/src/generated/instructions/closePosition.ts +7 -13
- package/src/generated/instructions/updatePosition.ts +9 -9
- package/src/generated/types/dCASettings.ts +14 -7
- package/src/generated/types/dCASettingsInp.ts +9 -3
- package/src/generated/types/index.ts +1 -1
- package/src/generated/types/{feeType.ts → tokenType.ts} +8 -9
- package/src/transactions/transactionUtils.ts +35 -25
- package/src/utils/marginfiUtils.ts +2 -2
- package/src/utils/solauto/generalUtils.ts +75 -59
- package/src/utils/solauto/rebalanceUtils.ts +9 -8
- package/tests/unit/rebalanceCalculations.ts +14 -14
- package/dist/generated/types/feeType.d.ts.map +0 -1
- package/dist/generated/types/feeType.js +0 -20
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,MAAM,EACN,kBAAkB,EAOnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,aAAa,EAEd,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,
|
1
|
+
{"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,MAAM,EACN,kBAAkB,EAOnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,aAAa,EAEd,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL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kB;IAErB,QAAQ,CAAC,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,kBAAkB;IAE3E,QAAQ,CAAC,SAAS,CAChB,aAAa,EAAE,GAAG,GAAG,GAAG,EACxB,WAAW,EAAE,cAAc,EAC3B,aAAa,EAAE,wBAAwB,EACvC,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,gBAAgB,EAC5B,2BAA2B,CAAC,EAAE,MAAM,EACpC,WAAW,CAAC,EAAE,MAAM,GACnB,kBAAkB;IAEf,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAalE"}
|
@@ -190,10 +190,13 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
190
190
|
this.solautoPositionData?.position.dca);
|
191
191
|
}
|
192
192
|
openPosition(settingParams, dca) {
|
193
|
-
if (dca && dca.
|
193
|
+
if (dca && dca.dcaInBaseUnit > 0) {
|
194
194
|
this.livePositionUpdates.new({
|
195
|
-
type: "
|
196
|
-
value:
|
195
|
+
type: "dcaInBalance",
|
196
|
+
value: {
|
197
|
+
amount: BigInt(dca.dcaInBaseUnit),
|
198
|
+
tokenType: dca.tokenType
|
199
|
+
},
|
197
200
|
});
|
198
201
|
}
|
199
202
|
if (settingParams) {
|
@@ -211,31 +214,33 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
211
214
|
return (0, umi_1.transactionBuilder)();
|
212
215
|
}
|
213
216
|
updatePositionIx(args) {
|
214
|
-
let
|
215
|
-
let
|
216
|
-
let
|
217
|
+
let dcaMint = undefined;
|
218
|
+
let positionDcaTa = undefined;
|
219
|
+
let signerDcaTa = undefined;
|
217
220
|
if ((0, umi_1.isOption)(args.dca) && (0, umi_1.isSome)(args.dca)) {
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
+
if (args.dca.value.tokenType === generated_1.TokenType.Supply) {
|
222
|
+
dcaMint = (0, umi_1.publicKey)(this.supplyMint);
|
223
|
+
positionDcaTa = (0, umi_1.publicKey)(this.positionSupplyTa);
|
224
|
+
signerDcaTa = (0, umi_1.publicKey)(this.signerSupplyTa);
|
225
|
+
}
|
226
|
+
else {
|
227
|
+
dcaMint = (0, umi_1.publicKey)(this.debtMint);
|
228
|
+
positionDcaTa = (0, umi_1.publicKey)(this.positionDebtTa);
|
229
|
+
signerDcaTa = (0, umi_1.publicKey)(this.signerDebtTa);
|
230
|
+
}
|
221
231
|
let addingToPos = false;
|
222
232
|
if ((0, umi_1.isOption)(args.dca) &&
|
223
233
|
(0, umi_1.isSome)(args.dca) &&
|
224
|
-
args.dca.value.
|
234
|
+
args.dca.value.dcaInBaseUnit > 0) {
|
225
235
|
this.livePositionUpdates.new({
|
226
|
-
type: "
|
227
|
-
value:
|
236
|
+
type: "dcaInBalance",
|
237
|
+
value: {
|
238
|
+
amount: BigInt(args.dca.value.dcaInBaseUnit),
|
239
|
+
tokenType: args.dca.value.tokenType
|
240
|
+
},
|
228
241
|
});
|
229
242
|
addingToPos = true;
|
230
243
|
}
|
231
|
-
if (this.solautoPositionData?.position.dca.debtToAddBaseUnit &&
|
232
|
-
!addingToPos) {
|
233
|
-
this.livePositionUpdates.new({
|
234
|
-
type: "debtDcaIn",
|
235
|
-
value: this.solautoPositionData.position.dca.debtToAddBaseUnit *
|
236
|
-
BigInt(-1),
|
237
|
-
});
|
238
|
-
}
|
239
244
|
}
|
240
245
|
if ((0, umi_1.isOption)(args.settingParams) && (0, umi_1.isSome)(args.settingParams)) {
|
241
246
|
this.livePositionUpdates.new({
|
@@ -252,9 +257,9 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
252
257
|
return (0, generated_1.updatePosition)(this.umi, {
|
253
258
|
signer: this.signer,
|
254
259
|
solautoPosition: (0, umi_1.publicKey)(this.solautoPosition),
|
255
|
-
|
256
|
-
|
257
|
-
|
260
|
+
dcaMint,
|
261
|
+
positionDcaTa,
|
262
|
+
signerDcaTa,
|
258
263
|
updatePositionData: args,
|
259
264
|
});
|
260
265
|
}
|
@@ -270,27 +275,32 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
270
275
|
});
|
271
276
|
}
|
272
277
|
cancelDCAIx() {
|
273
|
-
let
|
274
|
-
let
|
275
|
-
let
|
276
|
-
|
277
|
-
|
278
|
-
if (
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
278
|
+
let dcaMint = undefined;
|
279
|
+
let positionDcaTa = undefined;
|
280
|
+
let signerDcaTa = undefined;
|
281
|
+
const currDca = this.solautoPositionActiveDca();
|
282
|
+
if (currDca.dcaInBaseUnit > 0) {
|
283
|
+
if (currDca.tokenType === generated_1.TokenType.Supply) {
|
284
|
+
dcaMint = (0, umi_1.publicKey)(this.supplyMint);
|
285
|
+
positionDcaTa = (0, umi_1.publicKey)(this.positionSupplyTa);
|
286
|
+
signerDcaTa = (0, umi_1.publicKey)(this.signerSupplyTa);
|
287
|
+
}
|
288
|
+
else {
|
289
|
+
dcaMint = (0, umi_1.publicKey)(this.debtMint);
|
290
|
+
positionDcaTa = (0, umi_1.publicKey)(this.positionDebtTa);
|
291
|
+
signerDcaTa = (0, umi_1.publicKey)(this.signerDebtTa);
|
286
292
|
}
|
293
|
+
this.livePositionUpdates.new({
|
294
|
+
type: "cancellingDca",
|
295
|
+
value: this.solautoPositionData.position.dca.tokenType,
|
296
|
+
});
|
287
297
|
}
|
288
298
|
return (0, generated_1.cancelDCA)(this.umi, {
|
289
299
|
signer: this.signer,
|
290
300
|
solautoPosition: (0, umi_1.publicKey)(this.solautoPosition),
|
291
|
-
|
292
|
-
|
293
|
-
|
301
|
+
dcaMint,
|
302
|
+
positionDcaTa,
|
303
|
+
signerDcaTa,
|
294
304
|
});
|
295
305
|
}
|
296
306
|
protocolInteraction(args) {
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*/
|
8
8
|
import { Account, Context, Pda, PublicKey, RpcAccount, RpcGetAccountOptions, RpcGetAccountsOptions } from '@metaplex-foundation/umi';
|
9
9
|
import { Serializer } from '@metaplex-foundation/umi/serializers';
|
10
|
-
import {
|
10
|
+
import { PodBool, PodBoolArgs, PositionData, PositionDataArgs, PositionState, PositionStateArgs, RebalanceData, RebalanceDataArgs } from '../types';
|
11
11
|
export type SolautoPosition = Account<SolautoPositionAccountData>;
|
12
12
|
export type SolautoPositionAccountData = {
|
13
13
|
bump: Array<number>;
|
@@ -18,8 +18,6 @@ export type SolautoPositionAccountData = {
|
|
18
18
|
position: PositionData;
|
19
19
|
state: PositionState;
|
20
20
|
rebalance: RebalanceData;
|
21
|
-
feeType: FeeType;
|
22
|
-
padding2: Array<number>;
|
23
21
|
padding: Array<number>;
|
24
22
|
};
|
25
23
|
export type SolautoPositionAccountDataArgs = {
|
@@ -31,8 +29,6 @@ export type SolautoPositionAccountDataArgs = {
|
|
31
29
|
position: PositionDataArgs;
|
32
30
|
state: PositionStateArgs;
|
33
31
|
rebalance: RebalanceDataArgs;
|
34
|
-
feeType: FeeTypeArgs;
|
35
|
-
padding2: Array<number>;
|
36
32
|
padding: Array<number>;
|
37
33
|
};
|
38
34
|
export declare function getSolautoPositionAccountDataSerializer(): Serializer<SolautoPositionAccountDataArgs, SolautoPositionAccountData>;
|
@@ -50,8 +46,6 @@ export declare function getSolautoPositionGpaBuilder(context: Pick<Context, 'rpc
|
|
50
46
|
position: PositionDataArgs;
|
51
47
|
state: PositionStateArgs;
|
52
48
|
rebalance: RebalanceDataArgs;
|
53
|
-
feeType: FeeTypeArgs;
|
54
|
-
padding2: Array<number>;
|
55
49
|
padding: Array<number>;
|
56
50
|
}>;
|
57
51
|
export declare function getSolautoPositionSize(): number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoPosition.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/solautoPosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,OAAO,EACP,GAAG,EACH,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EAKtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAMX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,WAAW,EACX,
|
1
|
+
{"version":3,"file":"solautoPosition.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/solautoPosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,OAAO,EACP,GAAG,EACH,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EAKtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAMX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EAKlB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAElE,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACpB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACpB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,gB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AC;iBACZ,WAAW;cACd,KAAK,CAAC,MAAM,CAAC;eACZ,SAAS;cACV,gBAAgB;WACnB,iBAAiB;eACb,iBAAiB;aACnB,KAAK,CAAC,MAAM,CAAC;GAe3B;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C"}
|
@@ -28,9 +28,7 @@ function getSolautoPositionAccountDataSerializer() {
|
|
28
28
|
['position', (0, types_1.getPositionDataSerializer)()],
|
29
29
|
['state', (0, types_1.getPositionStateSerializer)()],
|
30
30
|
['rebalance', (0, types_1.getRebalanceDataSerializer)()],
|
31
|
-
['
|
32
|
-
['padding2', (0, serializers_1.array)((0, serializers_1.u8)(), { size: 7 })],
|
33
|
-
['padding', (0, serializers_1.array)((0, serializers_1.u32)(), { size: 30 })],
|
31
|
+
['padding', (0, serializers_1.array)((0, serializers_1.u32)(), { size: 32 })],
|
34
32
|
], { description: 'SolautoPositionAccountData' });
|
35
33
|
}
|
36
34
|
function deserializeSolautoPosition(rawAccount) {
|
@@ -70,9 +68,7 @@ function getSolautoPositionGpaBuilder(context) {
|
|
70
68
|
position: [40, (0, types_1.getPositionDataSerializer)()],
|
71
69
|
state: [360, (0, types_1.getPositionStateSerializer)()],
|
72
70
|
rebalance: [648, (0, types_1.getRebalanceDataSerializer)()],
|
73
|
-
|
74
|
-
padding2: [705, (0, serializers_1.array)((0, serializers_1.u8)(), { size: 7 })],
|
75
|
-
padding: [712, (0, serializers_1.array)((0, serializers_1.u32)(), { size: 30 })],
|
71
|
+
padding: [704, (0, serializers_1.array)((0, serializers_1.u32)(), { size: 32 })],
|
76
72
|
})
|
77
73
|
.deserializeUsing((account) => deserializeSolautoPosition(account));
|
78
74
|
}
|
@@ -13,9 +13,9 @@ export type CancelDCAInstructionAccounts = {
|
|
13
13
|
tokenProgram?: PublicKey | Pda;
|
14
14
|
ataProgram?: PublicKey | Pda;
|
15
15
|
solautoPosition: PublicKey | Pda;
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
dcaMint?: PublicKey | Pda;
|
17
|
+
positionDcaTa?: PublicKey | Pda;
|
18
|
+
signerDcaTa?: PublicKey | Pda;
|
19
19
|
};
|
20
20
|
export type CancelDCAInstructionData = {
|
21
21
|
discriminator: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cancelDCA.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/cancelDCA.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,
|
1
|
+
{"version":3,"file":"cancelDCA.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/cancelDCA.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,OAAO,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,WAAW,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;CAC/B,CAAC;AAGF,MAAM,MAAM,wBAAwB,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,MAAM,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAE9C,wBAAgB,qCAAqC,IAAI,UAAU,CACjE,4BAA4B,EAC5B,wBAAwB,CACzB,CAWA;AAGD,wBAAgB,SAAS,CACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAClC,KAAK,EAAE,4BAA4B,GAClC,kBAAkB,CA+FpB"}
|
@@ -48,20 +48,20 @@ function cancelDCA(context, input) {
|
|
48
48
|
isWritable: true,
|
49
49
|
value: input.solautoPosition ?? null,
|
50
50
|
},
|
51
|
-
|
51
|
+
dcaMint: {
|
52
52
|
index: 5,
|
53
53
|
isWritable: false,
|
54
|
-
value: input.
|
54
|
+
value: input.dcaMint ?? null,
|
55
55
|
},
|
56
|
-
|
56
|
+
positionDcaTa: {
|
57
57
|
index: 6,
|
58
58
|
isWritable: true,
|
59
|
-
value: input.
|
59
|
+
value: input.positionDcaTa ?? null,
|
60
60
|
},
|
61
|
-
|
61
|
+
signerDcaTa: {
|
62
62
|
index: 7,
|
63
63
|
isWritable: true,
|
64
|
-
value: input.
|
64
|
+
value: input.signerDcaTa ?? null,
|
65
65
|
},
|
66
66
|
};
|
67
67
|
// Default values.
|
@@ -14,9 +14,8 @@ export type ClosePositionInstructionAccounts = {
|
|
14
14
|
ataProgram?: PublicKey | Pda;
|
15
15
|
solautoPosition: PublicKey | Pda;
|
16
16
|
protocolAccount: PublicKey | Pda;
|
17
|
-
signerSupplyTa: PublicKey | Pda;
|
18
17
|
positionSupplyTa: PublicKey | Pda;
|
19
|
-
|
18
|
+
signerSupplyTa: PublicKey | Pda;
|
20
19
|
positionDebtTa: PublicKey | Pda;
|
21
20
|
signerDebtTa: PublicKey | Pda;
|
22
21
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"closePosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/closePosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,
|
1
|
+
{"version":3,"file":"closePosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/closePosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,gBAAgB,EAAE,SAAS,GAAG,GAAG,CAAC;IAClC,cAAc,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,cAAc,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,EAAE,SAAS,GAAG,GAAG,CAAC;CAC/B,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAElD,wBAAgB,yCAAyC,IAAI,UAAU,CACrE,gCAAgC,EAChC,4BAA4B,CAC7B,CAcA;AAGD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAClC,KAAK,EAAE,gCAAgC,GACtC,kBAAkB,CAyGpB"}
|
@@ -53,28 +53,23 @@ function closePosition(context, input) {
|
|
53
53
|
isWritable: true,
|
54
54
|
value: input.protocolAccount ?? null,
|
55
55
|
},
|
56
|
-
signerSupplyTa: {
|
57
|
-
index: 6,
|
58
|
-
isWritable: true,
|
59
|
-
value: input.signerSupplyTa ?? null,
|
60
|
-
},
|
61
56
|
positionSupplyTa: {
|
62
|
-
index:
|
57
|
+
index: 6,
|
63
58
|
isWritable: true,
|
64
59
|
value: input.positionSupplyTa ?? null,
|
65
60
|
},
|
66
|
-
|
67
|
-
index:
|
61
|
+
signerSupplyTa: {
|
62
|
+
index: 7,
|
68
63
|
isWritable: true,
|
69
|
-
value: input.
|
64
|
+
value: input.signerSupplyTa ?? null,
|
70
65
|
},
|
71
66
|
positionDebtTa: {
|
72
|
-
index:
|
67
|
+
index: 8,
|
73
68
|
isWritable: true,
|
74
69
|
value: input.positionDebtTa ?? null,
|
75
70
|
},
|
76
71
|
signerDebtTa: {
|
77
|
-
index:
|
72
|
+
index: 9,
|
78
73
|
isWritable: true,
|
79
74
|
value: input.signerDebtTa ?? null,
|
80
75
|
},
|
@@ -13,9 +13,9 @@ export type UpdatePositionInstructionAccounts = {
|
|
13
13
|
systemProgram?: PublicKey | Pda;
|
14
14
|
tokenProgram?: PublicKey | Pda;
|
15
15
|
solautoPosition: PublicKey | Pda;
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
dcaMint?: PublicKey | Pda;
|
17
|
+
positionDcaTa?: PublicKey | Pda;
|
18
|
+
signerDcaTa?: PublicKey | Pda;
|
19
19
|
};
|
20
20
|
export type UpdatePositionInstructionData = {
|
21
21
|
discriminator: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"updatePosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/updatePosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EAEvB,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,iCAAiC,GAAG;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,
|
1
|
+
{"version":3,"file":"updatePosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/updatePosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EAEvB,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,iCAAiC,GAAG;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,OAAO,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,WAAW,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;CAC/B,CAAC;AAGF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,kBAAkB,EAAE,sBAAsB,CAAC;CAC5C,CAAC;AAEF,wBAAgB,0CAA0C,IAAI,UAAU,CACtE,iCAAiC,EACjC,6BAA6B,CAC9B,CAkBA;AAGD,MAAM,MAAM,6BAA6B,GAAG,iCAAiC,CAAC;AAG9E,wBAAgB,cAAc,CAC5B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAClC,KAAK,EAAE,iCAAiC,GAAG,6BAA6B,GACvE,kBAAkB,CAwFpB"}
|
@@ -45,20 +45,20 @@ function updatePosition(context, input) {
|
|
45
45
|
isWritable: true,
|
46
46
|
value: input.solautoPosition ?? null,
|
47
47
|
},
|
48
|
-
|
48
|
+
dcaMint: {
|
49
49
|
index: 4,
|
50
50
|
isWritable: false,
|
51
|
-
value: input.
|
51
|
+
value: input.dcaMint ?? null,
|
52
52
|
},
|
53
|
-
|
53
|
+
positionDcaTa: {
|
54
54
|
index: 5,
|
55
55
|
isWritable: true,
|
56
|
-
value: input.
|
56
|
+
value: input.positionDcaTa ?? null,
|
57
57
|
},
|
58
|
-
|
58
|
+
signerDcaTa: {
|
59
59
|
index: 6,
|
60
60
|
isWritable: true,
|
61
|
-
value: input.
|
61
|
+
value: input.signerDcaTa ?? null,
|
62
62
|
},
|
63
63
|
};
|
64
64
|
// Arguments.
|
@@ -6,16 +6,18 @@
|
|
6
6
|
* @see https://github.com/metaplex-foundation/kinobi
|
7
7
|
*/
|
8
8
|
import { Serializer } from '@metaplex-foundation/umi/serializers';
|
9
|
-
import { AutomationSettings, AutomationSettingsArgs } from '.';
|
9
|
+
import { AutomationSettings, AutomationSettingsArgs, TokenType, TokenTypeArgs } from '.';
|
10
10
|
export type DCASettings = {
|
11
11
|
automation: AutomationSettings;
|
12
|
-
|
13
|
-
|
12
|
+
dcaInBaseUnit: bigint;
|
13
|
+
tokenType: TokenType;
|
14
|
+
padding: Array<number>;
|
14
15
|
};
|
15
16
|
export type DCASettingsArgs = {
|
16
17
|
automation: AutomationSettingsArgs;
|
17
|
-
|
18
|
-
|
18
|
+
dcaInBaseUnit: number | bigint;
|
19
|
+
tokenType: TokenTypeArgs;
|
20
|
+
padding: Array<number>;
|
19
21
|
};
|
20
22
|
export declare function getDCASettingsSerializer(): Serializer<DCASettingsArgs, DCASettings>;
|
21
23
|
//# sourceMappingURL=dCASettings.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dCASettings.d.ts","sourceRoot":"","sources":["../../../src/generated/types/dCASettings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,
|
1
|
+
{"version":3,"file":"dCASettings.d.ts","sourceRoot":"","sources":["../../../src/generated/types/dCASettings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EAKX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,aAAa,EAGd,MAAM,GAAG,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,sBAAsB,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,UAAU,CACpD,eAAe,EACf,WAAW,CACZ,CAUA"}
|
@@ -13,7 +13,8 @@ const _1 = require(".");
|
|
13
13
|
function getDCASettingsSerializer() {
|
14
14
|
return (0, serializers_1.struct)([
|
15
15
|
['automation', (0, _1.getAutomationSettingsSerializer)()],
|
16
|
-
['
|
17
|
-
['
|
16
|
+
['dcaInBaseUnit', (0, serializers_1.u64)()],
|
17
|
+
['tokenType', (0, _1.getTokenTypeSerializer)()],
|
18
|
+
['padding', (0, serializers_1.array)((0, serializers_1.u8)(), { size: 31 })],
|
18
19
|
], { description: 'DCASettings' });
|
19
20
|
}
|
@@ -6,14 +6,16 @@
|
|
6
6
|
* @see https://github.com/metaplex-foundation/kinobi
|
7
7
|
*/
|
8
8
|
import { Serializer } from '@metaplex-foundation/umi/serializers';
|
9
|
-
import { AutomationSettingsInp, AutomationSettingsInpArgs } from '.';
|
9
|
+
import { AutomationSettingsInp, AutomationSettingsInpArgs, TokenType, TokenTypeArgs } from '.';
|
10
10
|
export type DCASettingsInp = {
|
11
11
|
automation: AutomationSettingsInp;
|
12
|
-
|
12
|
+
dcaInBaseUnit: bigint;
|
13
|
+
tokenType: TokenType;
|
13
14
|
};
|
14
15
|
export type DCASettingsInpArgs = {
|
15
16
|
automation: AutomationSettingsInpArgs;
|
16
|
-
|
17
|
+
dcaInBaseUnit: number | bigint;
|
18
|
+
tokenType: TokenTypeArgs;
|
17
19
|
};
|
18
20
|
export declare function getDCASettingsInpSerializer(): Serializer<DCASettingsInpArgs, DCASettingsInp>;
|
19
21
|
//# sourceMappingURL=dCASettingsInp.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dCASettingsInp.d.ts","sourceRoot":"","sources":["../../../src/generated/types/dCASettingsInp.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAe,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EACL,qBAAqB,EACrB,yBAAyB,
|
1
|
+
{"version":3,"file":"dCASettingsInp.d.ts","sourceRoot":"","sources":["../../../src/generated/types/dCASettingsInp.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAe,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACT,aAAa,EAGd,MAAM,GAAG,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,qBAAqB,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,yBAAyB,CAAC;IACtC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,UAAU,CACvD,kBAAkB,EAClB,cAAc,CACf,CASA"}
|
@@ -13,6 +13,7 @@ const _1 = require(".");
|
|
13
13
|
function getDCASettingsInpSerializer() {
|
14
14
|
return (0, serializers_1.struct)([
|
15
15
|
['automation', (0, _1.getAutomationSettingsInpSerializer)()],
|
16
|
-
['
|
16
|
+
['dcaInBaseUnit', (0, serializers_1.u64)()],
|
17
|
+
['tokenType', (0, _1.getTokenTypeSerializer)()],
|
17
18
|
], { description: 'DCASettingsInp' });
|
18
19
|
}
|
@@ -9,7 +9,6 @@ export * from './automationSettings';
|
|
9
9
|
export * from './automationSettingsInp';
|
10
10
|
export * from './dCASettings';
|
11
11
|
export * from './dCASettingsInp';
|
12
|
-
export * from './feeType';
|
13
12
|
export * from './lendingPlatform';
|
14
13
|
export * from './podBool';
|
15
14
|
export * from './positionData';
|
@@ -22,5 +21,6 @@ export * from './solautoSettingsParameters';
|
|
22
21
|
export * from './solautoSettingsParametersInp';
|
23
22
|
export * from './tokenAmount';
|
24
23
|
export * from './tokenBalanceAmount';
|
24
|
+
export * from './tokenType';
|
25
25
|
export * from './updatePositionData';
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC"}
|
@@ -25,7 +25,6 @@ __exportStar(require("./automationSettings"), exports);
|
|
25
25
|
__exportStar(require("./automationSettingsInp"), exports);
|
26
26
|
__exportStar(require("./dCASettings"), exports);
|
27
27
|
__exportStar(require("./dCASettingsInp"), exports);
|
28
|
-
__exportStar(require("./feeType"), exports);
|
29
28
|
__exportStar(require("./lendingPlatform"), exports);
|
30
29
|
__exportStar(require("./podBool"), exports);
|
31
30
|
__exportStar(require("./positionData"), exports);
|
@@ -38,4 +37,5 @@ __exportStar(require("./solautoSettingsParameters"), exports);
|
|
38
37
|
__exportStar(require("./solautoSettingsParametersInp"), exports);
|
39
38
|
__exportStar(require("./tokenAmount"), exports);
|
40
39
|
__exportStar(require("./tokenBalanceAmount"), exports);
|
40
|
+
__exportStar(require("./tokenType"), exports);
|
41
41
|
__exportStar(require("./updatePositionData"), exports);
|
@@ -6,10 +6,10 @@
|
|
6
6
|
* @see https://github.com/metaplex-foundation/kinobi
|
7
7
|
*/
|
8
8
|
import { Serializer } from '@metaplex-foundation/umi/serializers';
|
9
|
-
export declare enum
|
10
|
-
|
11
|
-
|
9
|
+
export declare enum TokenType {
|
10
|
+
Supply = 0,
|
11
|
+
Debt = 1
|
12
12
|
}
|
13
|
-
export type
|
14
|
-
export declare function
|
15
|
-
//# sourceMappingURL=
|
13
|
+
export type TokenTypeArgs = TokenType;
|
14
|
+
export declare function getTokenTypeSerializer(): Serializer<TokenTypeArgs, TokenType>;
|
15
|
+
//# sourceMappingURL=tokenType.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tokenType.d.ts","sourceRoot":"","sources":["../../../src/generated/types/tokenType.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAc,MAAM,sCAAsC,CAAC;AAE9E,oBAAY,SAAS;IACnB,MAAM,IAAA;IACN,IAAI,IAAA;CACL;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEtC,wBAAgB,sBAAsB,IAAI,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC,CAI7E"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* This code was AUTOGENERATED using the kinobi library.
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
5
|
+
* to add features, then rerun kinobi to update it.
|
6
|
+
*
|
7
|
+
* @see https://github.com/metaplex-foundation/kinobi
|
8
|
+
*/
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
+
exports.TokenType = void 0;
|
11
|
+
exports.getTokenTypeSerializer = getTokenTypeSerializer;
|
12
|
+
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
13
|
+
var TokenType;
|
14
|
+
(function (TokenType) {
|
15
|
+
TokenType[TokenType["Supply"] = 0] = "Supply";
|
16
|
+
TokenType[TokenType["Debt"] = 1] = "Debt";
|
17
|
+
})(TokenType || (exports.TokenType = TokenType = {}));
|
18
|
+
function getTokenTypeSerializer() {
|
19
|
+
return (0, serializers_1.scalarEnum)(TokenType, {
|
20
|
+
description: 'TokenType',
|
21
|
+
});
|
22
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAKxE,OAAO,EAEL,aAAa,
|
1
|
+
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAKxE,OAAO,EAEL,aAAa,EAUd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAyNzD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CA+G7B;AAmLD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CACN;IACE,EAAE,EAAE,kBAAkB,CAAC;IACvB,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC,GACD,SAAS,CACZ,CA4HA;AAED,wBAAsB,gCAAgC,CACpD,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,SAAS,GACtB,OAAO,CAAC,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC,CAmCrD"}
|
@@ -24,17 +24,18 @@ function getWSolUsage(client, solautoActions, initiatingDcaIn, cancellingDcaIn)
|
|
24
24
|
return undefined;
|
25
25
|
}
|
26
26
|
const usingSupplyTaAction = solautoActions?.find((args) => (0, generated_1.isSolautoAction)("Deposit", args) || (0, generated_1.isSolautoAction)("Withdraw", args));
|
27
|
-
const usingDebtTaAction = solautoActions?.find((args) => (0, generated_1.isSolautoAction)("Borrow", args) ||
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
const usingDebtTaAction = solautoActions?.find((args) => (0, generated_1.isSolautoAction)("Borrow", args) || (0, generated_1.isSolautoAction)("Repay", args));
|
28
|
+
const dcaSupply = (initiatingDcaIn && initiatingDcaIn.tokenType === generated_1.TokenType.Supply) ||
|
29
|
+
(cancellingDcaIn !== undefined && cancellingDcaIn === generated_1.TokenType.Supply);
|
30
|
+
const dcaDebt = (initiatingDcaIn && initiatingDcaIn.tokenType === generated_1.TokenType.Debt) ||
|
31
|
+
(cancellingDcaIn !== undefined && cancellingDcaIn === generated_1.TokenType.Debt);
|
32
|
+
if (supplyIsWsol && (usingSupplyTaAction || dcaSupply)) {
|
32
33
|
return {
|
33
34
|
wSolTokenAccount: client.signerSupplyTa,
|
34
35
|
solautoAction: usingSupplyTaAction,
|
35
36
|
};
|
36
37
|
}
|
37
|
-
else if (debtIsWsol && usingDebtTaAction) {
|
38
|
+
else if (debtIsWsol && (usingDebtTaAction || dcaDebt)) {
|
38
39
|
return {
|
39
40
|
wSolTokenAccount: client.signerDebtTa,
|
40
41
|
solautoAction: usingDebtTaAction,
|
@@ -72,16 +73,17 @@ async function transactionChoresBefore(client, accountsGettingCreated, solautoAc
|
|
72
73
|
chores = chores.add((0, solanaUtils_1.closeTokenAccountUmiIx)(client.signer, wSolUsage.wSolTokenAccount, (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(client.signer.publicKey)));
|
73
74
|
}
|
74
75
|
let amountToTransfer = BigInt(0);
|
75
|
-
if (
|
76
|
+
if (wSolUsage.solautoAction &&
|
77
|
+
(0, generated_1.isSolautoAction)("Deposit", wSolUsage.solautoAction)) {
|
76
78
|
amountToTransfer = BigInt(wSolUsage.solautoAction.fields[0]);
|
77
79
|
}
|
78
|
-
else if (
|
80
|
+
else if (wSolUsage.solautoAction &&
|
81
|
+
(0, generated_1.isSolautoAction)("Repay", wSolUsage.solautoAction) &&
|
79
82
|
wSolUsage.solautoAction.fields[0].__kind === "Some") {
|
80
83
|
amountToTransfer = BigInt(wSolUsage.solautoAction.fields[0].fields[0]);
|
81
84
|
}
|
82
|
-
else if (initiatingDcaIn
|
83
|
-
|
84
|
-
amountToTransfer = initiatingDcaIn;
|
85
|
+
else if (initiatingDcaIn) {
|
86
|
+
amountToTransfer = initiatingDcaIn.amount;
|
85
87
|
}
|
86
88
|
if (amountToTransfer > 0) {
|
87
89
|
const amount = amountToTransfer +
|
@@ -314,12 +316,10 @@ async function getTransactionChores(client, tx) {
|
|
314
316
|
const accountsGettingCreated = [];
|
315
317
|
const solautoActions = getSolautoActions(tx);
|
316
318
|
choresBefore = choresBefore.add([
|
317
|
-
await transactionChoresBefore(client, accountsGettingCreated, solautoActions, client.livePositionUpdates.
|
318
|
-
? client.livePositionUpdates.debtTaBalanceAdjustment
|
319
|
-
: undefined),
|
319
|
+
await transactionChoresBefore(client, accountsGettingCreated, solautoActions, client.livePositionUpdates.dcaInBalance),
|
320
320
|
await rebalanceChoresBefore(client, tx, accountsGettingCreated),
|
321
321
|
]);
|
322
|
-
choresAfter = choresAfter.add(transactionChoresAfter(client, solautoActions, client.livePositionUpdates.
|
322
|
+
choresAfter = choresAfter.add(transactionChoresAfter(client, solautoActions, client.livePositionUpdates.cancellingDca));
|
323
323
|
return [choresBefore, choresAfter];
|
324
324
|
}
|
325
325
|
async function buildSolautoRebalanceTransaction(client, targetLiqUtilizationRateBps, attemptNum) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marginfiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/marginfiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,
|
1
|
+
{"version":3,"file":"marginfiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/marginfiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAa,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EACL,IAAI,EAKL,MAAM,iBAAiB,CAAC;AAUzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,GAAG,qBAAqB,CAU3E;AAED,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,GAAG,EACR,MAAM,EAAE;IACN,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB,EACD,IAAI,EAAE;IACJ,IAAI,EAAE,SA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