@exponent-labs/exponent-sdk 0.9.1 → 0.9.2
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/build/client/vaults/types/kaminoObligationEntry.d.ts +21 -21
- package/build/client/vaults/types/obligationType.d.ts +1 -1
- package/build/client/vaults/types/proposalAction.d.ts +54 -54
- package/build/client/vaults/types/reserveFarmMapping.d.ts +3 -3
- package/build/client/vaults/types/strategyPosition.d.ts +1 -1
- package/build/exponentVaults/index.d.ts +1 -1
- package/build/exponentVaults/index.js +3 -2
- package/build/exponentVaults/index.js.map +1 -1
- package/build/exponentVaults/vault-instruction-types.d.ts +1 -1
- package/build/exponentVaults/vault-interaction.d.ts +58 -41
- package/build/exponentVaults/vault-interaction.js +294 -54
- package/build/exponentVaults/vault-interaction.js.map +1 -1
- package/build/exponentVaults/vault-interaction.kamino-vault.test.d.ts +1 -0
- package/build/exponentVaults/vault-interaction.kamino-vault.test.js +143 -0
- package/build/exponentVaults/vault-interaction.kamino-vault.test.js.map +1 -0
- package/build/exponentVaults/vaultTransactionBuilder.js +35 -30
- package/build/exponentVaults/vaultTransactionBuilder.js.map +1 -1
- package/build/exponentVaults/vaultTransactionBuilder.test.js +84 -1
- package/build/exponentVaults/vaultTransactionBuilder.test.js.map +1 -1
- package/package.json +34 -32
- package/src/exponentVaults/index.ts +1 -0
- package/src/exponentVaults/vault-instruction-types.ts +1 -1
- package/src/exponentVaults/vault-interaction.kamino-vault.test.ts +149 -0
- package/src/exponentVaults/vault-interaction.ts +514 -86
- package/src/exponentVaults/vaultTransactionBuilder.test.ts +93 -0
- package/src/exponentVaults/vaultTransactionBuilder.ts +47 -41
|
@@ -12,12 +12,6 @@ export interface KaminoObligationEntry {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const kaminoObligationEntryCodec: import("@solana/codecs").VariableSizeCodec<{
|
|
14
14
|
obligation: PublicKey;
|
|
15
|
-
reserveFarmMappings: {
|
|
16
|
-
reserve: PublicKey;
|
|
17
|
-
farmKind: number | bigint;
|
|
18
|
-
farmState: PublicKey;
|
|
19
|
-
}[];
|
|
20
|
-
lendingProgramId: PublicKey;
|
|
21
15
|
quotePriceId: ({
|
|
22
16
|
priceId: number | bigint;
|
|
23
17
|
} & {
|
|
@@ -28,6 +22,7 @@ export declare const kaminoObligationEntryCodec: import("@solana/codecs").Variab
|
|
|
28
22
|
__kind: "Multiply";
|
|
29
23
|
});
|
|
30
24
|
minPriceStatusFlags: number | bigint;
|
|
25
|
+
lendingProgramId: PublicKey;
|
|
31
26
|
reservePriceMappings: {
|
|
32
27
|
reserve: PublicKey;
|
|
33
28
|
reservePriceId: ({
|
|
@@ -40,18 +35,13 @@ export declare const kaminoObligationEntryCodec: import("@solana/codecs").Variab
|
|
|
40
35
|
__kind: "Multiply";
|
|
41
36
|
});
|
|
42
37
|
}[];
|
|
43
|
-
|
|
44
|
-
obligation: PublicKey;
|
|
45
|
-
reserveFarmMappings: ({
|
|
38
|
+
reserveFarmMappings: {
|
|
46
39
|
reserve: PublicKey;
|
|
47
|
-
farmKind: number;
|
|
48
40
|
farmState: PublicKey;
|
|
49
|
-
} & {
|
|
50
|
-
reserve: PublicKey;
|
|
51
41
|
farmKind: number | bigint;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
}[];
|
|
43
|
+
}, {
|
|
44
|
+
obligation: PublicKey;
|
|
55
45
|
quotePriceId: ({
|
|
56
46
|
priceId: bigint;
|
|
57
47
|
} & {
|
|
@@ -70,6 +60,7 @@ export declare const kaminoObligationEntryCodec: import("@solana/codecs").Variab
|
|
|
70
60
|
__kind: "Multiply";
|
|
71
61
|
});
|
|
72
62
|
minPriceStatusFlags: number;
|
|
63
|
+
lendingProgramId: PublicKey;
|
|
73
64
|
reservePriceMappings: ({
|
|
74
65
|
reserve: PublicKey;
|
|
75
66
|
reservePriceId: ({
|
|
@@ -101,14 +92,17 @@ export declare const kaminoObligationEntryCodec: import("@solana/codecs").Variab
|
|
|
101
92
|
__kind: "Multiply";
|
|
102
93
|
});
|
|
103
94
|
})[];
|
|
104
|
-
|
|
105
|
-
obligation: PublicKey;
|
|
106
|
-
reserveFarmMappings: {
|
|
95
|
+
reserveFarmMappings: ({
|
|
107
96
|
reserve: PublicKey;
|
|
108
|
-
farmKind: number | bigint;
|
|
109
97
|
farmState: PublicKey;
|
|
110
|
-
|
|
111
|
-
|
|
98
|
+
farmKind: number;
|
|
99
|
+
} & {
|
|
100
|
+
reserve: PublicKey;
|
|
101
|
+
farmState: PublicKey;
|
|
102
|
+
farmKind: number | bigint;
|
|
103
|
+
})[];
|
|
104
|
+
} & {
|
|
105
|
+
obligation: PublicKey;
|
|
112
106
|
quotePriceId: ({
|
|
113
107
|
priceId: number | bigint;
|
|
114
108
|
} & {
|
|
@@ -119,6 +113,7 @@ export declare const kaminoObligationEntryCodec: import("@solana/codecs").Variab
|
|
|
119
113
|
__kind: "Multiply";
|
|
120
114
|
});
|
|
121
115
|
minPriceStatusFlags: number | bigint;
|
|
116
|
+
lendingProgramId: PublicKey;
|
|
122
117
|
reservePriceMappings: {
|
|
123
118
|
reserve: PublicKey;
|
|
124
119
|
reservePriceId: ({
|
|
@@ -131,4 +126,9 @@ export declare const kaminoObligationEntryCodec: import("@solana/codecs").Variab
|
|
|
131
126
|
__kind: "Multiply";
|
|
132
127
|
});
|
|
133
128
|
}[];
|
|
129
|
+
reserveFarmMappings: {
|
|
130
|
+
reserve: PublicKey;
|
|
131
|
+
farmState: PublicKey;
|
|
132
|
+
farmKind: number | bigint;
|
|
133
|
+
}[];
|
|
134
134
|
}>;
|
|
@@ -3,7 +3,7 @@ export type ObligationType = {
|
|
|
3
3
|
__kind: "KaminoObligation";
|
|
4
4
|
fields: [KaminoObligationEntry];
|
|
5
5
|
};
|
|
6
|
-
export declare const obligationTypeCodec:
|
|
6
|
+
export declare const obligationTypeCodec: import("@solana/codecs").Codec<never, never>;
|
|
7
7
|
type GetDiscriminatedUnionVariant<TUnion, TDiscriminator extends keyof TUnion, TKind extends TUnion[TDiscriminator]> = Extract<TUnion, Record<TDiscriminator, TKind>>;
|
|
8
8
|
type GetDiscriminatedUnionVariantContent<TUnion, TDiscriminator extends keyof TUnion, TKind extends TUnion[TDiscriminator]> = Omit<GetDiscriminatedUnionVariant<TUnion, TDiscriminator, TKind>, TDiscriminator>;
|
|
9
9
|
export declare function obligationType(kind: "KaminoObligation", data: GetDiscriminatedUnionVariantContent<ObligationType, "__kind", "KaminoObligation">["fields"]): GetDiscriminatedUnionVariant<ObligationType, "__kind", "KaminoObligation">;
|
|
@@ -15,10 +15,6 @@ export declare const proposalActionCodec: import("@solana/codecs").Codec<({
|
|
|
15
15
|
fields: readonly [unknown[]];
|
|
16
16
|
} & {
|
|
17
17
|
__kind: "VaultSettingsAction";
|
|
18
|
-
}) | ({
|
|
19
|
-
fields: any;
|
|
20
|
-
} & {
|
|
21
|
-
__kind: "PositionUpdate";
|
|
22
18
|
}) | ({
|
|
23
19
|
fields: readonly [({
|
|
24
20
|
fields: readonly [unknown];
|
|
@@ -26,16 +22,20 @@ export declare const proposalActionCodec: import("@solana/codecs").Codec<({
|
|
|
26
22
|
__kind: "Add";
|
|
27
23
|
}) | ({
|
|
28
24
|
policySeed: number | bigint;
|
|
29
|
-
policyConfig: unknown;
|
|
30
25
|
} & {
|
|
31
|
-
__kind: "
|
|
26
|
+
__kind: "Remove";
|
|
32
27
|
}) | ({
|
|
33
28
|
policySeed: number | bigint;
|
|
29
|
+
policyConfig: unknown;
|
|
34
30
|
} & {
|
|
35
|
-
__kind: "
|
|
31
|
+
__kind: "Update";
|
|
36
32
|
})];
|
|
37
33
|
} & {
|
|
38
34
|
__kind: "PolicyAction";
|
|
35
|
+
}) | ({
|
|
36
|
+
fields: readonly [unknown];
|
|
37
|
+
} & {
|
|
38
|
+
__kind: "PositionUpdate";
|
|
39
39
|
}), ({
|
|
40
40
|
fields: readonly [unknown[]];
|
|
41
41
|
} & {
|
|
@@ -44,14 +44,6 @@ export declare const proposalActionCodec: import("@solana/codecs").Codec<({
|
|
|
44
44
|
__kind: "VaultSettingsAction";
|
|
45
45
|
} & {
|
|
46
46
|
__kind: "VaultSettingsAction";
|
|
47
|
-
}) | ({
|
|
48
|
-
fields: any;
|
|
49
|
-
} & {
|
|
50
|
-
fields: any;
|
|
51
|
-
} & {
|
|
52
|
-
__kind: "PositionUpdate";
|
|
53
|
-
} & {
|
|
54
|
-
__kind: "PositionUpdate";
|
|
55
47
|
}) | ({
|
|
56
48
|
fields: readonly [({
|
|
57
49
|
fields: readonly [unknown];
|
|
@@ -63,35 +55,35 @@ export declare const proposalActionCodec: import("@solana/codecs").Codec<({
|
|
|
63
55
|
__kind: "Add";
|
|
64
56
|
}) | ({
|
|
65
57
|
policySeed: bigint;
|
|
66
|
-
policyConfig: unknown;
|
|
67
58
|
} & {
|
|
68
59
|
policySeed: number | bigint;
|
|
69
|
-
policyConfig: unknown;
|
|
70
60
|
} & {
|
|
71
|
-
__kind: "
|
|
61
|
+
__kind: "Remove";
|
|
72
62
|
} & {
|
|
73
|
-
__kind: "
|
|
63
|
+
__kind: "Remove";
|
|
74
64
|
}) | ({
|
|
75
65
|
policySeed: bigint;
|
|
66
|
+
policyConfig: unknown;
|
|
76
67
|
} & {
|
|
77
68
|
policySeed: number | bigint;
|
|
69
|
+
policyConfig: unknown;
|
|
78
70
|
} & {
|
|
79
|
-
__kind: "
|
|
71
|
+
__kind: "Update";
|
|
80
72
|
} & {
|
|
81
|
-
__kind: "
|
|
73
|
+
__kind: "Update";
|
|
82
74
|
})] & readonly [({
|
|
83
75
|
fields: readonly [unknown];
|
|
84
76
|
} & {
|
|
85
77
|
__kind: "Add";
|
|
86
78
|
}) | ({
|
|
87
79
|
policySeed: number | bigint;
|
|
88
|
-
policyConfig: unknown;
|
|
89
80
|
} & {
|
|
90
|
-
__kind: "
|
|
81
|
+
__kind: "Remove";
|
|
91
82
|
}) | ({
|
|
92
83
|
policySeed: number | bigint;
|
|
84
|
+
policyConfig: unknown;
|
|
93
85
|
} & {
|
|
94
|
-
__kind: "
|
|
86
|
+
__kind: "Update";
|
|
95
87
|
})];
|
|
96
88
|
} & {
|
|
97
89
|
fields: readonly [({
|
|
@@ -100,27 +92,31 @@ export declare const proposalActionCodec: import("@solana/codecs").Codec<({
|
|
|
100
92
|
__kind: "Add";
|
|
101
93
|
}) | ({
|
|
102
94
|
policySeed: number | bigint;
|
|
103
|
-
policyConfig: unknown;
|
|
104
95
|
} & {
|
|
105
|
-
__kind: "
|
|
96
|
+
__kind: "Remove";
|
|
106
97
|
}) | ({
|
|
107
98
|
policySeed: number | bigint;
|
|
99
|
+
policyConfig: unknown;
|
|
108
100
|
} & {
|
|
109
|
-
__kind: "
|
|
101
|
+
__kind: "Update";
|
|
110
102
|
})];
|
|
111
103
|
} & {
|
|
112
104
|
__kind: "PolicyAction";
|
|
113
105
|
} & {
|
|
114
106
|
__kind: "PolicyAction";
|
|
107
|
+
}) | ({
|
|
108
|
+
fields: readonly [unknown];
|
|
109
|
+
} & {
|
|
110
|
+
fields: readonly [unknown];
|
|
111
|
+
} & {
|
|
112
|
+
__kind: "PositionUpdate";
|
|
113
|
+
} & {
|
|
114
|
+
__kind: "PositionUpdate";
|
|
115
115
|
})>;
|
|
116
116
|
export declare const proposalActionsCodec: import("@solana/codecs").VariableSizeCodec<(({
|
|
117
117
|
fields: readonly [unknown[]];
|
|
118
118
|
} & {
|
|
119
119
|
__kind: "VaultSettingsAction";
|
|
120
|
-
}) | ({
|
|
121
|
-
fields: any;
|
|
122
|
-
} & {
|
|
123
|
-
__kind: "PositionUpdate";
|
|
124
120
|
}) | ({
|
|
125
121
|
fields: readonly [({
|
|
126
122
|
fields: readonly [unknown];
|
|
@@ -128,16 +124,20 @@ export declare const proposalActionsCodec: import("@solana/codecs").VariableSize
|
|
|
128
124
|
__kind: "Add";
|
|
129
125
|
}) | ({
|
|
130
126
|
policySeed: number | bigint;
|
|
131
|
-
policyConfig: unknown;
|
|
132
127
|
} & {
|
|
133
|
-
__kind: "
|
|
128
|
+
__kind: "Remove";
|
|
134
129
|
}) | ({
|
|
135
130
|
policySeed: number | bigint;
|
|
131
|
+
policyConfig: unknown;
|
|
136
132
|
} & {
|
|
137
|
-
__kind: "
|
|
133
|
+
__kind: "Update";
|
|
138
134
|
})];
|
|
139
135
|
} & {
|
|
140
136
|
__kind: "PolicyAction";
|
|
137
|
+
}) | ({
|
|
138
|
+
fields: readonly [unknown];
|
|
139
|
+
} & {
|
|
140
|
+
__kind: "PositionUpdate";
|
|
141
141
|
}))[], (({
|
|
142
142
|
fields: readonly [unknown[]];
|
|
143
143
|
} & {
|
|
@@ -146,14 +146,6 @@ export declare const proposalActionsCodec: import("@solana/codecs").VariableSize
|
|
|
146
146
|
__kind: "VaultSettingsAction";
|
|
147
147
|
} & {
|
|
148
148
|
__kind: "VaultSettingsAction";
|
|
149
|
-
}) | ({
|
|
150
|
-
fields: any;
|
|
151
|
-
} & {
|
|
152
|
-
fields: any;
|
|
153
|
-
} & {
|
|
154
|
-
__kind: "PositionUpdate";
|
|
155
|
-
} & {
|
|
156
|
-
__kind: "PositionUpdate";
|
|
157
149
|
}) | ({
|
|
158
150
|
fields: readonly [({
|
|
159
151
|
fields: readonly [unknown];
|
|
@@ -165,35 +157,35 @@ export declare const proposalActionsCodec: import("@solana/codecs").VariableSize
|
|
|
165
157
|
__kind: "Add";
|
|
166
158
|
}) | ({
|
|
167
159
|
policySeed: bigint;
|
|
168
|
-
policyConfig: unknown;
|
|
169
160
|
} & {
|
|
170
161
|
policySeed: number | bigint;
|
|
171
|
-
policyConfig: unknown;
|
|
172
162
|
} & {
|
|
173
|
-
__kind: "
|
|
163
|
+
__kind: "Remove";
|
|
174
164
|
} & {
|
|
175
|
-
__kind: "
|
|
165
|
+
__kind: "Remove";
|
|
176
166
|
}) | ({
|
|
177
167
|
policySeed: bigint;
|
|
168
|
+
policyConfig: unknown;
|
|
178
169
|
} & {
|
|
179
170
|
policySeed: number | bigint;
|
|
171
|
+
policyConfig: unknown;
|
|
180
172
|
} & {
|
|
181
|
-
__kind: "
|
|
173
|
+
__kind: "Update";
|
|
182
174
|
} & {
|
|
183
|
-
__kind: "
|
|
175
|
+
__kind: "Update";
|
|
184
176
|
})] & readonly [({
|
|
185
177
|
fields: readonly [unknown];
|
|
186
178
|
} & {
|
|
187
179
|
__kind: "Add";
|
|
188
180
|
}) | ({
|
|
189
181
|
policySeed: number | bigint;
|
|
190
|
-
policyConfig: unknown;
|
|
191
182
|
} & {
|
|
192
|
-
__kind: "
|
|
183
|
+
__kind: "Remove";
|
|
193
184
|
}) | ({
|
|
194
185
|
policySeed: number | bigint;
|
|
186
|
+
policyConfig: unknown;
|
|
195
187
|
} & {
|
|
196
|
-
__kind: "
|
|
188
|
+
__kind: "Update";
|
|
197
189
|
})];
|
|
198
190
|
} & {
|
|
199
191
|
fields: readonly [({
|
|
@@ -202,18 +194,26 @@ export declare const proposalActionsCodec: import("@solana/codecs").VariableSize
|
|
|
202
194
|
__kind: "Add";
|
|
203
195
|
}) | ({
|
|
204
196
|
policySeed: number | bigint;
|
|
205
|
-
policyConfig: unknown;
|
|
206
197
|
} & {
|
|
207
|
-
__kind: "
|
|
198
|
+
__kind: "Remove";
|
|
208
199
|
}) | ({
|
|
209
200
|
policySeed: number | bigint;
|
|
201
|
+
policyConfig: unknown;
|
|
210
202
|
} & {
|
|
211
|
-
__kind: "
|
|
203
|
+
__kind: "Update";
|
|
212
204
|
})];
|
|
213
205
|
} & {
|
|
214
206
|
__kind: "PolicyAction";
|
|
215
207
|
} & {
|
|
216
208
|
__kind: "PolicyAction";
|
|
209
|
+
}) | ({
|
|
210
|
+
fields: readonly [unknown];
|
|
211
|
+
} & {
|
|
212
|
+
fields: readonly [unknown];
|
|
213
|
+
} & {
|
|
214
|
+
__kind: "PositionUpdate";
|
|
215
|
+
} & {
|
|
216
|
+
__kind: "PositionUpdate";
|
|
217
217
|
}))[]>;
|
|
218
218
|
type GetDiscriminatedUnionVariant<TUnion, TDiscriminator extends keyof TUnion, TKind extends TUnion[TDiscriminator]> = Extract<TUnion, Record<TDiscriminator, TKind>>;
|
|
219
219
|
type GetDiscriminatedUnionVariantContent<TUnion, TDiscriminator extends keyof TUnion, TKind extends TUnion[TDiscriminator]> = Omit<GetDiscriminatedUnionVariant<TUnion, TDiscriminator, TKind>, TDiscriminator>;
|
|
@@ -6,14 +6,14 @@ export interface ReserveFarmMapping {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const reserveFarmMappingCodec: import("@solana/codecs").FixedSizeCodec<{
|
|
8
8
|
reserve: PublicKey;
|
|
9
|
-
farmKind: number | bigint;
|
|
10
9
|
farmState: PublicKey;
|
|
10
|
+
farmKind: number | bigint;
|
|
11
11
|
}, {
|
|
12
12
|
reserve: PublicKey;
|
|
13
|
-
farmKind: number;
|
|
14
13
|
farmState: PublicKey;
|
|
14
|
+
farmKind: number;
|
|
15
15
|
} & {
|
|
16
16
|
reserve: PublicKey;
|
|
17
|
-
farmKind: number | bigint;
|
|
18
17
|
farmState: PublicKey;
|
|
18
|
+
farmKind: number | bigint;
|
|
19
19
|
}>;
|
|
@@ -31,7 +31,7 @@ export type StrategyPosition = {
|
|
|
31
31
|
__kind: "KaminoFarm";
|
|
32
32
|
fields: [KaminoFarmEntry];
|
|
33
33
|
};
|
|
34
|
-
export declare const strategyPositionCodec:
|
|
34
|
+
export declare const strategyPositionCodec: import("@solana/codecs").Codec<never, never>;
|
|
35
35
|
type GetDiscriminatedUnionVariant<TUnion, TDiscriminator extends keyof TUnion, TKind extends TUnion[TDiscriminator]> = Extract<TUnion, Record<TDiscriminator, TKind>>;
|
|
36
36
|
type GetDiscriminatedUnionVariantContent<TUnion, TDiscriminator extends keyof TUnion, TKind extends TUnion[TDiscriminator]> = Omit<GetDiscriminatedUnionVariant<TUnion, TDiscriminator, TKind>, TDiscriminator>;
|
|
37
37
|
export declare function strategyPosition(kind: "Orderbook", data: GetDiscriminatedUnionVariantContent<StrategyPosition, "__kind", "Orderbook">["fields"]): GetDiscriminatedUnionVariant<StrategyPosition, "__kind", "Orderbook">;
|
|
@@ -14,7 +14,7 @@ export type { DepositLiquidityParams, QueueWithdrawalParams, ExecuteWithdrawalPa
|
|
|
14
14
|
export * as vaultsEvents from "./events";
|
|
15
15
|
export { KAMINO_LENDING_PROGRAM_ID, KAMINO_VAULT_PROGRAM_ID, KAMINO_FARMS_PROGRAM_ID, KAMINO_DISCRIMINATORS, KAMINO_VAULT_DISCRIMINATORS, KAMINO_FARM_DISCRIMINATORS, KAMINO_ACCOUNT_INDICES, KAMINO_VAULT_ACCOUNT_INDICES, KAMINO_FARM_ACCOUNT_INDICES, createProgramInteractionPolicy, createInstructionConstraint, createAccountConstraint, createAccountDataConstraint, createDiscriminatorConstraint, createKaminoDepositPolicy, createKaminoWithdrawPolicy, createKaminoBorrowPolicy, createKaminoRepayPolicy, createKaminoFullAccessPolicy, createKaminoPolicy, createKaminoVaultPolicy, createKaminoFarmPolicy, EXPONENT_ORDERBOOK_PROGRAM_ID, MARGINFI_STANDARD_PROGRAM_ID, KAMINO_STANDARD_PROGRAM_ID, JITO_RESTAKING_STANDARD_PROGRAM_ID, PERENA_STANDARD_PROGRAM_ID, GENERIC_STANDARD_PROGRAM_ID, ORDERBOOK_DISCRIMINATORS, ORDERBOOK_ACCOUNT_INDICES, createOrderbookInstructionConstraints, createOrderbookPolicy, STANDARD_PROGRAM_DISCRIMINATORS, STANDARD_PROGRAM_ACCOUNT_INDICES, createStandardProgramInstructionConstraints, createStandardProgramPolicy, EXPONENT_CORE_PROGRAM_ID, EXPONENT_CORE_DISCRIMINATORS, EXPONENT_VAULT_ACCOUNT_DATA_OFFSETS, EXPONENT_CORE_INITIALIZE_YIELD_POSITION_ACCOUNT_INDICES, EXPONENT_CORE_STRIP_ACCOUNT_INDICES, EXPONENT_CORE_MERGE_ACCOUNT_INDICES, EXPONENT_CORE_COLLECT_INTEREST_ACCOUNT_INDICES, EXPONENT_CORE_DEPOSIT_YT_ACCOUNT_INDICES, EXPONENT_CORE_WITHDRAW_YT_ACCOUNT_INDICES, EXPONENT_CORE_WRAPPER_COLLECT_INTEREST_ACCOUNT_INDICES, createCoreInstructionConstraints, createCorePolicy, TITAN_PROGRAM_ID, TITAN_DISCRIMINATORS, TITAN_ACCOUNT_INDICES, createTitanSwapPolicy, LOOPSCALE_PROGRAM_ID, LOOPSCALE_DISCRIMINATORS, LOOPSCALE_ACCOUNT_INDICES, createLoopscalePolicy, deriveLoopscaleStrategyAddress, deriveLoopscaleLoanAddress, EXPONENT_CLMM_PROGRAM_ID, CLMM_DISCRIMINATORS, CLMM_ACCOUNT_INDICES, createClmmPolicy, } from "./policyBuilders";
|
|
16
16
|
export type { OrderbookPolicyAction, CorePolicyAction, KaminoPolicyAction, KaminoVaultPolicyAction, KaminoFarmPolicyAction, StandardProgramPolicyAction, AllowedSyMintProgram, LoopscalePolicyAction, } from "./policyBuilders";
|
|
17
|
-
export { createVaultSyncTransaction, createOrderbookSyncTransaction, kaminoAction, kaminoVaultAction, kaminoFarmAction, orderbookAction, coreAction, syAction, titanAction, clmmAction, loopscaleAction, VaultAction, KaminoVaultAction, KaminoFarmAction, OrderbookAction, OrderbookTradeDirection, CoreAction, SyAction, TitanAction, ClmmAction, LoopscaleAction, } from "./vault-interaction";
|
|
17
|
+
export { createVaultSyncTransaction, createVaultSyncTransactions, createOrderbookSyncTransaction, kaminoAction, kaminoVaultAction, kaminoFarmAction, orderbookAction, coreAction, syAction, titanAction, clmmAction, loopscaleAction, VaultAction, KaminoVaultAction, KaminoFarmAction, OrderbookAction, OrderbookTradeDirection, CoreAction, SyAction, TitanAction, ClmmAction, LoopscaleAction, } from "./vault-interaction";
|
|
18
18
|
export type { VaultInstruction, MarketInstruction, ReserveInstruction, KaminoVaultInstruction, KaminoVaultDepositInstruction, KaminoVaultWithdrawInstruction, KaminoFarmInstruction, KaminoFarmInitializeUserInstruction, KaminoFarmStakeInstruction, KaminoFarmUnstakeInstruction, KaminoFarmWithdrawUnstakedDepositsInstruction, KaminoFarmHarvestRewardInstruction, OrderbookInstruction, OrderbookPostOfferInstruction, OrderbookMarketOfferInstruction, OrderbookRemoveOfferInstruction, OrderbookWithdrawFundsInstruction, OrderbookOfferOption, CoreInstruction, CoreStripInstruction, CoreMergeInstruction, SyInstruction, SyMintInstruction, SyRedeemInstruction, TitanSwapInstruction, LoopscaleInstruction, ClmmInstruction, ClmmDepositLiquidityInstruction, ClmmAddLiquidityInstruction, ClmmWithdrawLiquidityInstruction, ClmmTradePtInstruction, ClmmBuyPtInstruction, ClmmSellPtInstruction, ClmmBuyYtInstruction, ClmmSellYtInstruction, ClmmClaimFarmEmissionInstruction, VaultSyncTransactionResult, } from "./vault-interaction";
|
|
19
19
|
export { getTitanQuote } from "./titan-quote";
|
|
20
20
|
export type { TitanQuoteResult } from "./titan-quote";
|
|
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.createOrderbookPolicy = exports.createOrderbookInstructionConstraints = exports.ORDERBOOK_ACCOUNT_INDICES = exports.ORDERBOOK_DISCRIMINATORS = exports.GENERIC_STANDARD_PROGRAM_ID = exports.PERENA_STANDARD_PROGRAM_ID = exports.JITO_RESTAKING_STANDARD_PROGRAM_ID = exports.KAMINO_STANDARD_PROGRAM_ID = exports.MARGINFI_STANDARD_PROGRAM_ID = exports.EXPONENT_ORDERBOOK_PROGRAM_ID = exports.createKaminoFarmPolicy = exports.createKaminoVaultPolicy = exports.createKaminoPolicy = exports.createKaminoFullAccessPolicy = exports.createKaminoRepayPolicy = exports.createKaminoBorrowPolicy = exports.createKaminoWithdrawPolicy = exports.createKaminoDepositPolicy = exports.createDiscriminatorConstraint = exports.createAccountDataConstraint = exports.createAccountConstraint = exports.createInstructionConstraint = exports.createProgramInteractionPolicy = exports.KAMINO_FARM_ACCOUNT_INDICES = exports.KAMINO_VAULT_ACCOUNT_INDICES = exports.KAMINO_ACCOUNT_INDICES = exports.KAMINO_FARM_DISCRIMINATORS = exports.KAMINO_VAULT_DISCRIMINATORS = exports.KAMINO_DISCRIMINATORS = exports.KAMINO_FARMS_PROGRAM_ID = exports.KAMINO_VAULT_PROGRAM_ID = exports.KAMINO_LENDING_PROGRAM_ID = exports.vaultsEvents = exports.proposalActionsCodec = exports.proposalActionCodec = exports.proposalAction = exports.createCancelProposalInstruction = exports.createInitProposalInstruction = exports.createAppendProposalActionsInstruction = exports.createActivateProposalInstruction = exports.EXPONENT_VAULTS_PROGRAM_ID = exports.PositionType = exports.AumCalculator = exports.getSyntheticMintDecimals = exports.SYNTHETIC_USD9_MINT = exports.SYNTHETIC_USD9_DECIMALS = exports.SYNTHETIC_USD_MINT = exports.SYNTHETIC_USD_DECIMALS = exports.ExponentVaultsFetcher = exports.ExponentVault = void 0;
|
|
27
|
-
exports.
|
|
28
|
-
exports.VaultTransactionBuilder = exports.getTxnTokensBalancesChanges = exports.getMessageAccountKeysFromVersionedTxn = exports.decompileInstructions = exports.ACTION_DISPLAY_NAMES = exports.INTERACTION_TYPES = exports.SquadsVaultTxnResolver = exports.SQUADS_PROGRAM_ID = exports.compileToSyncTransactionPayload = exports.buildSyncTransactionInstruction = exports.wrapInstructionsInSyncTransaction = exports.resolvePolicyMatchForVault = exports.resolvePolicyMatch = exports.resolveHookAccounts = exports.resolveConstraintIndices = exports.getPolicyPostHookNumExtraAccounts = exports.fetchProgramInteractionPolicies = exports.getKaminoReserves = exports.KAMINO_RESERVES = exports.KAMINO_MARKETS = exports.KaminoMarket = exports.identifyLoopscaleInstruction = exports.getLoopscaleTransactionResponses = exports.extractCreatedStrategyNonce = exports.extractCreatedStrategyAddress = exports.deserializeLoopscaleTransactionBatchResponse = exports.deserializeLoopscaleTransactionResponse = exports.LoopscaleClient = exports.getTitanQuote = exports.LoopscaleAction = void 0;
|
|
27
|
+
exports.TitanAction = exports.SyAction = exports.CoreAction = exports.OrderbookTradeDirection = exports.OrderbookAction = exports.KaminoFarmAction = exports.KaminoVaultAction = exports.VaultAction = exports.loopscaleAction = exports.clmmAction = exports.titanAction = exports.syAction = exports.coreAction = exports.orderbookAction = exports.kaminoFarmAction = exports.kaminoVaultAction = exports.kaminoAction = exports.createOrderbookSyncTransaction = exports.createVaultSyncTransactions = exports.createVaultSyncTransaction = exports.createClmmPolicy = exports.CLMM_ACCOUNT_INDICES = exports.CLMM_DISCRIMINATORS = exports.EXPONENT_CLMM_PROGRAM_ID = exports.deriveLoopscaleLoanAddress = exports.deriveLoopscaleStrategyAddress = exports.createLoopscalePolicy = exports.LOOPSCALE_ACCOUNT_INDICES = exports.LOOPSCALE_DISCRIMINATORS = exports.LOOPSCALE_PROGRAM_ID = exports.createTitanSwapPolicy = exports.TITAN_ACCOUNT_INDICES = exports.TITAN_DISCRIMINATORS = exports.TITAN_PROGRAM_ID = exports.createCorePolicy = exports.createCoreInstructionConstraints = exports.EXPONENT_CORE_WRAPPER_COLLECT_INTEREST_ACCOUNT_INDICES = exports.EXPONENT_CORE_WITHDRAW_YT_ACCOUNT_INDICES = exports.EXPONENT_CORE_DEPOSIT_YT_ACCOUNT_INDICES = exports.EXPONENT_CORE_COLLECT_INTEREST_ACCOUNT_INDICES = exports.EXPONENT_CORE_MERGE_ACCOUNT_INDICES = exports.EXPONENT_CORE_STRIP_ACCOUNT_INDICES = exports.EXPONENT_CORE_INITIALIZE_YIELD_POSITION_ACCOUNT_INDICES = exports.EXPONENT_VAULT_ACCOUNT_DATA_OFFSETS = exports.EXPONENT_CORE_DISCRIMINATORS = exports.EXPONENT_CORE_PROGRAM_ID = exports.createStandardProgramPolicy = exports.createStandardProgramInstructionConstraints = exports.STANDARD_PROGRAM_ACCOUNT_INDICES = exports.STANDARD_PROGRAM_DISCRIMINATORS = void 0;
|
|
28
|
+
exports.VaultTransactionBuilder = exports.getTxnTokensBalancesChanges = exports.getMessageAccountKeysFromVersionedTxn = exports.decompileInstructions = exports.ACTION_DISPLAY_NAMES = exports.INTERACTION_TYPES = exports.SquadsVaultTxnResolver = exports.SQUADS_PROGRAM_ID = exports.compileToSyncTransactionPayload = exports.buildSyncTransactionInstruction = exports.wrapInstructionsInSyncTransaction = exports.resolvePolicyMatchForVault = exports.resolvePolicyMatch = exports.resolveHookAccounts = exports.resolveConstraintIndices = exports.getPolicyPostHookNumExtraAccounts = exports.fetchProgramInteractionPolicies = exports.getKaminoReserves = exports.KAMINO_RESERVES = exports.KAMINO_MARKETS = exports.KaminoMarket = exports.identifyLoopscaleInstruction = exports.getLoopscaleTransactionResponses = exports.extractCreatedStrategyNonce = exports.extractCreatedStrategyAddress = exports.deserializeLoopscaleTransactionBatchResponse = exports.deserializeLoopscaleTransactionResponse = exports.LoopscaleClient = exports.getTitanQuote = exports.LoopscaleAction = exports.ClmmAction = void 0;
|
|
29
29
|
var vault_1 = require("./vault");
|
|
30
30
|
Object.defineProperty(exports, "ExponentVault", { enumerable: true, get: function () { return vault_1.ExponentVault; } });
|
|
31
31
|
var fetcher_1 = require("./fetcher");
|
|
@@ -129,6 +129,7 @@ Object.defineProperty(exports, "createClmmPolicy", { enumerable: true, get: func
|
|
|
129
129
|
// Vault interaction builders (Kamino + Orderbook + Core)
|
|
130
130
|
var vault_interaction_1 = require("./vault-interaction");
|
|
131
131
|
Object.defineProperty(exports, "createVaultSyncTransaction", { enumerable: true, get: function () { return vault_interaction_1.createVaultSyncTransaction; } });
|
|
132
|
+
Object.defineProperty(exports, "createVaultSyncTransactions", { enumerable: true, get: function () { return vault_interaction_1.createVaultSyncTransactions; } });
|
|
132
133
|
Object.defineProperty(exports, "createOrderbookSyncTransaction", { enumerable: true, get: function () { return vault_interaction_1.createOrderbookSyncTransaction; } });
|
|
133
134
|
Object.defineProperty(exports, "kaminoAction", { enumerable: true, get: function () { return vault_interaction_1.kaminoAction; } });
|
|
134
135
|
Object.defineProperty(exports, "kaminoVaultAction", { enumerable: true, get: function () { return vault_interaction_1.kaminoVaultAction; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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D9B,mDAAmG;AAA1F,8GAAA,YAAY,OAAA;AAAE,gHAAA,cAAc,OAAA;AAAE,iHAAA,eAAe,OAAA;AAAE,mHAAA,iBAAiB,OAAA;AAGzE,oCAAoC;AACpC,iDAOwB;AANtB,gIAAA,+BAA+B,OAAA;AAC/B,kIAAA,iCAAiC,OAAA;AACjC,yHAAA,wBAAwB,OAAA;AACxB,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAClB,2HAAA,0BAA0B,OAAA;AAG5B,6BAA6B;AAC7B,qDAK0B;AAJxB,oIAAA,iCAAiC,OAAA;AACjC,kIAAA,+BAA+B,OAAA;AAC/B,kIAAA,+BAA+B,OAAA;AAC/B,oHAAA,iBAAiB,OAAA;AAInB,mEAWiC;AAV/B,gIAAA,sBAAsB,OAAA;AACtB,2HAAA,iBAAiB,OAAA;AACjB,8HAAA,oBAAoB,OAAA;AAEpB,+HAAA,qBAAqB,OAAA;AACrB,+IAAA,qCAAqC,OAAA;AACrC,qIAAA,2BAA2B,OAAA;AAM7B,4BAA4B;AAC5B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA"}
|
|
@@ -42,7 +42,7 @@ export type KaminoVaultDepositInstruction = KaminoVaultInstructionBase & {
|
|
|
42
42
|
export type KaminoVaultWithdrawInstruction = KaminoVaultInstructionBase & {
|
|
43
43
|
action: KaminoVaultAction.WITHDRAW;
|
|
44
44
|
sharesAmount: BN;
|
|
45
|
-
/**
|
|
45
|
+
/** Optional reserve override. Omit it to let the SDK plan the withdraw across the vault's active reserves. */
|
|
46
46
|
reserve?: PublicKey;
|
|
47
47
|
};
|
|
48
48
|
export type KaminoVaultInstruction = KaminoVaultDepositInstruction | KaminoVaultWithdrawInstruction;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KaminoMarket } from "./kamino-markets";
|
|
2
|
+
import Decimal from "decimal.js";
|
|
2
3
|
import { SwapDirection } from "../client/clmm";
|
|
3
4
|
import { Environment } from "../environment";
|
|
4
5
|
import { ExponentVault as StrategyVault } from "./vault";
|
|
@@ -374,7 +375,7 @@ export declare const kaminoAction: {
|
|
|
374
375
|
readonly TNSR: {
|
|
375
376
|
pubkey: web3.PublicKey;
|
|
376
377
|
mint: web3.PublicKey;
|
|
377
|
-
};
|
|
378
|
+
}; /** Harvest a specific reward index into a managed vault reward ATA. */
|
|
378
379
|
readonly GOAT: {
|
|
379
380
|
pubkey: web3.PublicKey;
|
|
380
381
|
mint: web3.PublicKey;
|
|
@@ -633,7 +634,6 @@ export declare const kaminoAction: {
|
|
|
633
634
|
pubkey: web3.PublicKey;
|
|
634
635
|
mint: web3.PublicKey;
|
|
635
636
|
};
|
|
636
|
-
/** KLend farm modes — collateral for deposit/withdraw, debt for borrow/repay. */
|
|
637
637
|
readonly USD1: {
|
|
638
638
|
pubkey: web3.PublicKey;
|
|
639
639
|
mint: web3.PublicKey;
|
|
@@ -1227,7 +1227,7 @@ export declare const kaminoAction: {
|
|
|
1227
1227
|
readonly TNSR: {
|
|
1228
1228
|
pubkey: web3.PublicKey;
|
|
1229
1229
|
mint: web3.PublicKey;
|
|
1230
|
-
};
|
|
1230
|
+
}; /** Harvest a specific reward index into a managed vault reward ATA. */
|
|
1231
1231
|
readonly GOAT: {
|
|
1232
1232
|
pubkey: web3.PublicKey;
|
|
1233
1233
|
mint: web3.PublicKey;
|
|
@@ -1486,7 +1486,6 @@ export declare const kaminoAction: {
|
|
|
1486
1486
|
pubkey: web3.PublicKey;
|
|
1487
1487
|
mint: web3.PublicKey;
|
|
1488
1488
|
};
|
|
1489
|
-
/** KLend farm modes — collateral for deposit/withdraw, debt for borrow/repay. */
|
|
1490
1489
|
readonly USD1: {
|
|
1491
1490
|
pubkey: web3.PublicKey;
|
|
1492
1491
|
mint: web3.PublicKey;
|
|
@@ -2080,7 +2079,7 @@ export declare const kaminoAction: {
|
|
|
2080
2079
|
readonly TNSR: {
|
|
2081
2080
|
pubkey: web3.PublicKey;
|
|
2082
2081
|
mint: web3.PublicKey;
|
|
2083
|
-
};
|
|
2082
|
+
}; /** Harvest a specific reward index into a managed vault reward ATA. */
|
|
2084
2083
|
readonly GOAT: {
|
|
2085
2084
|
pubkey: web3.PublicKey;
|
|
2086
2085
|
mint: web3.PublicKey;
|
|
@@ -2339,7 +2338,6 @@ export declare const kaminoAction: {
|
|
|
2339
2338
|
pubkey: web3.PublicKey;
|
|
2340
2339
|
mint: web3.PublicKey;
|
|
2341
2340
|
};
|
|
2342
|
-
/** KLend farm modes — collateral for deposit/withdraw, debt for borrow/repay. */
|
|
2343
2341
|
readonly USD1: {
|
|
2344
2342
|
pubkey: web3.PublicKey;
|
|
2345
2343
|
mint: web3.PublicKey;
|
|
@@ -2638,8 +2636,8 @@ export declare const kaminoVaultAction: {
|
|
|
2638
2636
|
}): KaminoVaultDepositInstruction;
|
|
2639
2637
|
/**
|
|
2640
2638
|
* Withdraw Kamino Vault shares back into the vault-owned token account.
|
|
2641
|
-
*
|
|
2642
|
-
*
|
|
2639
|
+
* `reserve` is an optional override. When omitted, the SDK plans the
|
|
2640
|
+
* withdraw across the vault's active reserves automatically.
|
|
2643
2641
|
*/
|
|
2644
2642
|
withdraw(params: {
|
|
2645
2643
|
vault: PublicKey;
|
|
@@ -2712,38 +2710,7 @@ export interface VaultSyncTransactionResult {
|
|
|
2712
2710
|
/** ALT addresses that should be loaded and included in the versioned transaction's lookup tables. */
|
|
2713
2711
|
addressLookupTableAddresses: PublicKey[];
|
|
2714
2712
|
}
|
|
2715
|
-
|
|
2716
|
-
* Build vault instructions and wrap them in a Squads sync transaction.
|
|
2717
|
-
*
|
|
2718
|
-
* Takes high-level `VaultInstruction` descriptors (built with `kamino.*`),
|
|
2719
|
-
* resolves them to raw Solana instructions, then separates them:
|
|
2720
|
-
* - Permissionless refresh instructions → `preInstructions` (top-level)
|
|
2721
|
-
* - Vault-signed instructions → `instruction` (Squads sync transaction)
|
|
2722
|
-
*
|
|
2723
|
-
* KLend's `check_refresh` requires refreshReserve to be a top-level instruction
|
|
2724
|
-
* so it can be found via the instruction sysvar.
|
|
2725
|
-
*
|
|
2726
|
-
* @returns `{ setupInstructions, preInstructions, instruction, postInstructions, signers, addressLookupTableAddresses }`
|
|
2727
|
-
*
|
|
2728
|
-
* @example
|
|
2729
|
-
* ```ts
|
|
2730
|
-
* const { setupInstructions, preInstructions, instruction, postInstructions, signers, addressLookupTableAddresses } = await createVaultSyncTransaction({
|
|
2731
|
-
* instructions: [
|
|
2732
|
-
* kamino.initUserMetadata(KaminoMarket.MAIN),
|
|
2733
|
-
* kamino.initObligation(KaminoMarket.MAIN),
|
|
2734
|
-
* kamino.deposit(KaminoMarket.MAIN, "USDC", new BN(1_000_000)),
|
|
2735
|
-
* ],
|
|
2736
|
-
* owner: vaultPda,
|
|
2737
|
-
* connection,
|
|
2738
|
-
* policyPda,
|
|
2739
|
-
* vaultPda,
|
|
2740
|
-
* signer: wallet.publicKey,
|
|
2741
|
-
* vaultAddress: VAULT_ADDRESS,
|
|
2742
|
-
* })
|
|
2743
|
-
* // Send: [...setupInstructions, ...preInstructions, instruction, ...postInstructions]
|
|
2744
|
-
* ```
|
|
2745
|
-
*/
|
|
2746
|
-
export declare function createVaultSyncTransaction({ instructions, owner, connection, policyPda, vaultPda, signer, accountIndex, constraintIndices, vaultAddress, leadingAccounts, preHookAccounts, postHookAccounts, squadsProgram, autoManagePositions, setupContext, }: {
|
|
2713
|
+
type CreateVaultSyncTransactionParams = {
|
|
2747
2714
|
instructions: VaultInstruction[];
|
|
2748
2715
|
owner: PublicKey;
|
|
2749
2716
|
connection: Connection;
|
|
@@ -2762,7 +2729,32 @@ export declare function createVaultSyncTransaction({ instructions, owner, connec
|
|
|
2762
2729
|
autoManagePositions?: boolean;
|
|
2763
2730
|
/** Optional shared setup context — when provided, setup state (tracked accounts, positions) is shared across calls, preventing duplicate setup instructions. */
|
|
2764
2731
|
setupContext?: StrategySetupContext;
|
|
2765
|
-
}
|
|
2732
|
+
};
|
|
2733
|
+
/**
|
|
2734
|
+
* Build one or more vault sync transactions from high-level instruction descriptors.
|
|
2735
|
+
*
|
|
2736
|
+
* This is the plural companion to {@link createVaultSyncTransaction}. Most
|
|
2737
|
+
* calls return a single result. Smart Kamino Vault withdraws can expand into
|
|
2738
|
+
* multiple reserve-specific sync transactions when the wrapper needs to split
|
|
2739
|
+
* an oversized withdraw across sequential chunks.
|
|
2740
|
+
*/
|
|
2741
|
+
export declare function createVaultSyncTransactions(params: CreateVaultSyncTransactionParams): Promise<VaultSyncTransactionResult[]>;
|
|
2742
|
+
/**
|
|
2743
|
+
* Build exactly one vault sync transaction and return its wrapped instruction set.
|
|
2744
|
+
*
|
|
2745
|
+
* Takes high-level `VaultInstruction` descriptors (built with `kamino.*`),
|
|
2746
|
+
* resolves them to raw Solana instructions, then separates them:
|
|
2747
|
+
* - Permissionless refresh instructions → `preInstructions` (top-level)
|
|
2748
|
+
* - Vault-signed instructions → `instruction` (Squads sync transaction)
|
|
2749
|
+
*
|
|
2750
|
+
* KLend's `check_refresh` requires refreshReserve to be a top-level instruction
|
|
2751
|
+
* so it can be found via the instruction sysvar.
|
|
2752
|
+
*
|
|
2753
|
+
* When a smart Kamino Vault withdraw expands beyond one sync transaction, this
|
|
2754
|
+
* singular helper throws and asks the caller to use
|
|
2755
|
+
* {@link createVaultSyncTransactions} or {@link VaultTransactionBuilder}.
|
|
2756
|
+
*/
|
|
2757
|
+
export declare function createVaultSyncTransaction(params: CreateVaultSyncTransactionParams): Promise<VaultSyncTransactionResult>;
|
|
2766
2758
|
type TrackedKaminoObligationState = {
|
|
2767
2759
|
quotePriceId: ClientPriceId;
|
|
2768
2760
|
quoteInputMint: PublicKey;
|
|
@@ -2826,6 +2818,31 @@ export declare function createStrategySetupContext({ connection, env, owner, sig
|
|
|
2826
2818
|
pricesAccount?: ExponentPrices;
|
|
2827
2819
|
}): StrategySetupContext;
|
|
2828
2820
|
export declare function buildSetupStatePriceRefreshInstructions(setupContext: StrategySetupContext): Promise<TransactionInstruction[]>;
|
|
2821
|
+
type KaminoVaultWithdrawPlanningSnapshot = {
|
|
2822
|
+
sharesBalance: BN;
|
|
2823
|
+
tokenAvailable: BN;
|
|
2824
|
+
sharesIssued: BN;
|
|
2825
|
+
pendingFeesSf: BN;
|
|
2826
|
+
reserves: Array<{
|
|
2827
|
+
reserveAddress: PublicKey;
|
|
2828
|
+
investedLiquidityAmount: Decimal;
|
|
2829
|
+
availableLiquidityToWithdraw: Decimal;
|
|
2830
|
+
}>;
|
|
2831
|
+
};
|
|
2832
|
+
type KaminoVaultWithdrawPlanningLeg = {
|
|
2833
|
+
reserveAddress: PublicKey;
|
|
2834
|
+
sharesAmount: BN;
|
|
2835
|
+
};
|
|
2836
|
+
declare function calculateKaminoVaultTokensPerShareFromSnapshot(snapshot: KaminoVaultWithdrawPlanningSnapshot): Decimal;
|
|
2837
|
+
declare function planKaminoVaultWithdrawLegsFromSnapshot(params: {
|
|
2838
|
+
sharesAmount: BN;
|
|
2839
|
+
reserve?: PublicKey;
|
|
2840
|
+
snapshot: KaminoVaultWithdrawPlanningSnapshot;
|
|
2841
|
+
}): KaminoVaultWithdrawPlanningLeg[];
|
|
2842
|
+
export declare const __kaminoVaultTesting: {
|
|
2843
|
+
calculateKaminoVaultTokensPerShareFromSnapshot: typeof calculateKaminoVaultTokensPerShareFromSnapshot;
|
|
2844
|
+
planKaminoVaultWithdrawLegsFromSnapshot: typeof planKaminoVaultWithdrawLegsFromSnapshot;
|
|
2845
|
+
};
|
|
2829
2846
|
/**
|
|
2830
2847
|
* Builder for Exponent Orderbook vault action descriptors.
|
|
2831
2848
|
*
|