@epicentral/sos-sdk 0.9.1-beta → 0.10.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/accounts/fetchers.ts +79 -9
- package/accounts/list.ts +12 -6
- package/accounts/resolve-option.ts +60 -19
- package/generated/accounts/collateralPool.ts +29 -1
- package/generated/accounts/makerCollateralShare.ts +9 -1
- package/generated/errors/optionProgram.ts +48 -36
- package/generated/instructions/autoExerciseAllExpired.ts +32 -86
- package/generated/instructions/autoExerciseExpired.ts +38 -95
- package/generated/instructions/claimMakerRemaining.ts +452 -0
- package/generated/instructions/depositCollateral.ts +6 -6
- package/generated/instructions/index.ts +1 -0
- package/generated/instructions/initCollateralPool.ts +3 -3
- package/generated/instructions/settleMakerCollateral.ts +50 -74
- package/generated/programs/optionProgram.ts +24 -0
- package/package.json +1 -1
- package/short/builders.ts +8 -8
|
@@ -55,6 +55,7 @@ export type AutoExerciseExpiredInstruction<
|
|
|
55
55
|
TAccountOptionPool extends string | AccountMeta<string> = string,
|
|
56
56
|
TAccountOptionAccount extends string | AccountMeta<string> = string,
|
|
57
57
|
TAccountUnderlyingMint extends string | AccountMeta<string> = string,
|
|
58
|
+
TAccountCollateralMint extends string | AccountMeta<string> = string,
|
|
58
59
|
TAccountPositionAccount extends string | AccountMeta<string> = string,
|
|
59
60
|
TAccountCollateralVault extends string | AccountMeta<string> = string,
|
|
60
61
|
TAccountBuyerPaymentAccount extends string | AccountMeta<string> = string,
|
|
@@ -66,8 +67,6 @@ export type AutoExerciseExpiredInstruction<
|
|
|
66
67
|
TAccountInstructionsSysvar extends string | AccountMeta<string> =
|
|
67
68
|
"Sysvar1nstructions1111111111111111111111111",
|
|
68
69
|
TAccountMarketData extends string | AccountMeta<string> = string,
|
|
69
|
-
TAccountOmlpVault extends string | AccountMeta<string> = string,
|
|
70
|
-
TAccountOmlpVaultState extends string | AccountMeta<string> = string,
|
|
71
70
|
TAccountKeeper extends string | AccountMeta<string> = string,
|
|
72
71
|
TAccountTokenProgram extends string | AccountMeta<string> =
|
|
73
72
|
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
|
|
@@ -90,6 +89,9 @@ export type AutoExerciseExpiredInstruction<
|
|
|
90
89
|
TAccountUnderlyingMint extends string
|
|
91
90
|
? ReadonlyAccount<TAccountUnderlyingMint>
|
|
92
91
|
: TAccountUnderlyingMint,
|
|
92
|
+
TAccountCollateralMint extends string
|
|
93
|
+
? ReadonlyAccount<TAccountCollateralMint>
|
|
94
|
+
: TAccountCollateralMint,
|
|
93
95
|
TAccountPositionAccount extends string
|
|
94
96
|
? WritableAccount<TAccountPositionAccount>
|
|
95
97
|
: TAccountPositionAccount,
|
|
@@ -117,12 +119,6 @@ export type AutoExerciseExpiredInstruction<
|
|
|
117
119
|
TAccountMarketData extends string
|
|
118
120
|
? ReadonlyAccount<TAccountMarketData>
|
|
119
121
|
: TAccountMarketData,
|
|
120
|
-
TAccountOmlpVault extends string
|
|
121
|
-
? WritableAccount<TAccountOmlpVault>
|
|
122
|
-
: TAccountOmlpVault,
|
|
123
|
-
TAccountOmlpVaultState extends string
|
|
124
|
-
? WritableAccount<TAccountOmlpVaultState>
|
|
125
|
-
: TAccountOmlpVaultState,
|
|
126
122
|
TAccountKeeper extends string
|
|
127
123
|
? WritableSignerAccount<TAccountKeeper> &
|
|
128
124
|
AccountSignerMeta<TAccountKeeper>
|
|
@@ -174,6 +170,7 @@ export type AutoExerciseExpiredAsyncInput<
|
|
|
174
170
|
TAccountOptionPool extends string = string,
|
|
175
171
|
TAccountOptionAccount extends string = string,
|
|
176
172
|
TAccountUnderlyingMint extends string = string,
|
|
173
|
+
TAccountCollateralMint extends string = string,
|
|
177
174
|
TAccountPositionAccount extends string = string,
|
|
178
175
|
TAccountCollateralVault extends string = string,
|
|
179
176
|
TAccountBuyerPaymentAccount extends string = string,
|
|
@@ -183,8 +180,6 @@ export type AutoExerciseExpiredAsyncInput<
|
|
|
183
180
|
TAccountSlotHashesSysvar extends string = string,
|
|
184
181
|
TAccountInstructionsSysvar extends string = string,
|
|
185
182
|
TAccountMarketData extends string = string,
|
|
186
|
-
TAccountOmlpVault extends string = string,
|
|
187
|
-
TAccountOmlpVaultState extends string = string,
|
|
188
183
|
TAccountKeeper extends string = string,
|
|
189
184
|
TAccountTokenProgram extends string = string,
|
|
190
185
|
TAccountSystemProgram extends string = string,
|
|
@@ -194,6 +189,7 @@ export type AutoExerciseExpiredAsyncInput<
|
|
|
194
189
|
optionAccount: Address<TAccountOptionAccount>;
|
|
195
190
|
/** Underlying token mint (for dynamic decimal handling - supports any SPL token) */
|
|
196
191
|
underlyingMint: Address<TAccountUnderlyingMint>;
|
|
192
|
+
collateralMint: Address<TAccountCollateralMint>;
|
|
197
193
|
/**
|
|
198
194
|
* Buyer's position (tracks quantity owned)
|
|
199
195
|
* Note: NO signer constraint - keeper exercises on behalf of buyer
|
|
@@ -201,7 +197,7 @@ export type AutoExerciseExpiredAsyncInput<
|
|
|
201
197
|
positionAccount: Address<TAccountPositionAccount>;
|
|
202
198
|
/** Pool's collateral vault (source of payout) */
|
|
203
199
|
collateralVault: Address<TAccountCollateralVault>;
|
|
204
|
-
/** Buyer's
|
|
200
|
+
/** Buyer's settlement token account (receives intrinsic value) */
|
|
205
201
|
buyerPaymentAccount: Address<TAccountBuyerPaymentAccount>;
|
|
206
202
|
/** Buyer's option token account (burns tokens) */
|
|
207
203
|
buyerOptionAccount: Address<TAccountBuyerOptionAccount>;
|
|
@@ -212,16 +208,6 @@ export type AutoExerciseExpiredAsyncInput<
|
|
|
212
208
|
instructionsSysvar?: Address<TAccountInstructionsSysvar>;
|
|
213
209
|
/** Market data for this underlying asset (contains switchboard_feed_id) */
|
|
214
210
|
marketData: Address<TAccountMarketData>;
|
|
215
|
-
/** OMLP Vault token account to receive repayments */
|
|
216
|
-
omlpVault: Address<TAccountOmlpVault>;
|
|
217
|
-
/**
|
|
218
|
-
* OMLP Vault state PDA (mut: keeps `total_loans`, `total_liquidity`,
|
|
219
|
-
* and `acc_interest_per_share_fp` consistent via `add_interest_to_index`
|
|
220
|
-
* so auto-exercised lender repayments actually realize interest to LPs).
|
|
221
|
-
* Constrained to the vault matching `underlying_mint` — same mint the
|
|
222
|
-
* collateral vault settles in.
|
|
223
|
-
*/
|
|
224
|
-
omlpVaultState?: Address<TAccountOmlpVaultState>;
|
|
225
211
|
/** Keeper who pays for gas - anyone can call this after expiration */
|
|
226
212
|
keeper: TransactionSigner<TAccountKeeper>;
|
|
227
213
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
@@ -233,6 +219,7 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
233
219
|
TAccountOptionPool extends string,
|
|
234
220
|
TAccountOptionAccount extends string,
|
|
235
221
|
TAccountUnderlyingMint extends string,
|
|
222
|
+
TAccountCollateralMint extends string,
|
|
236
223
|
TAccountPositionAccount extends string,
|
|
237
224
|
TAccountCollateralVault extends string,
|
|
238
225
|
TAccountBuyerPaymentAccount extends string,
|
|
@@ -242,8 +229,6 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
242
229
|
TAccountSlotHashesSysvar extends string,
|
|
243
230
|
TAccountInstructionsSysvar extends string,
|
|
244
231
|
TAccountMarketData extends string,
|
|
245
|
-
TAccountOmlpVault extends string,
|
|
246
|
-
TAccountOmlpVaultState extends string,
|
|
247
232
|
TAccountKeeper extends string,
|
|
248
233
|
TAccountTokenProgram extends string,
|
|
249
234
|
TAccountSystemProgram extends string,
|
|
@@ -254,6 +239,7 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
254
239
|
TAccountOptionPool,
|
|
255
240
|
TAccountOptionAccount,
|
|
256
241
|
TAccountUnderlyingMint,
|
|
242
|
+
TAccountCollateralMint,
|
|
257
243
|
TAccountPositionAccount,
|
|
258
244
|
TAccountCollateralVault,
|
|
259
245
|
TAccountBuyerPaymentAccount,
|
|
@@ -263,8 +249,6 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
263
249
|
TAccountSlotHashesSysvar,
|
|
264
250
|
TAccountInstructionsSysvar,
|
|
265
251
|
TAccountMarketData,
|
|
266
|
-
TAccountOmlpVault,
|
|
267
|
-
TAccountOmlpVaultState,
|
|
268
252
|
TAccountKeeper,
|
|
269
253
|
TAccountTokenProgram,
|
|
270
254
|
TAccountSystemProgram
|
|
@@ -277,6 +261,7 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
277
261
|
TAccountOptionPool,
|
|
278
262
|
TAccountOptionAccount,
|
|
279
263
|
TAccountUnderlyingMint,
|
|
264
|
+
TAccountCollateralMint,
|
|
280
265
|
TAccountPositionAccount,
|
|
281
266
|
TAccountCollateralVault,
|
|
282
267
|
TAccountBuyerPaymentAccount,
|
|
@@ -286,8 +271,6 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
286
271
|
TAccountSlotHashesSysvar,
|
|
287
272
|
TAccountInstructionsSysvar,
|
|
288
273
|
TAccountMarketData,
|
|
289
|
-
TAccountOmlpVault,
|
|
290
|
-
TAccountOmlpVaultState,
|
|
291
274
|
TAccountKeeper,
|
|
292
275
|
TAccountTokenProgram,
|
|
293
276
|
TAccountSystemProgram
|
|
@@ -303,6 +286,7 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
303
286
|
optionPool: { value: input.optionPool ?? null, isWritable: true },
|
|
304
287
|
optionAccount: { value: input.optionAccount ?? null, isWritable: true },
|
|
305
288
|
underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
|
|
289
|
+
collateralMint: { value: input.collateralMint ?? null, isWritable: false },
|
|
306
290
|
positionAccount: { value: input.positionAccount ?? null, isWritable: true },
|
|
307
291
|
collateralVault: { value: input.collateralVault ?? null, isWritable: true },
|
|
308
292
|
buyerPaymentAccount: {
|
|
@@ -327,8 +311,6 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
327
311
|
isWritable: false,
|
|
328
312
|
},
|
|
329
313
|
marketData: { value: input.marketData ?? null, isWritable: false },
|
|
330
|
-
omlpVault: { value: input.omlpVault ?? null, isWritable: true },
|
|
331
|
-
omlpVaultState: { value: input.omlpVaultState ?? null, isWritable: true },
|
|
332
314
|
keeper: { value: input.keeper ?? null, isWritable: true },
|
|
333
315
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
334
316
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
@@ -361,17 +343,6 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
361
343
|
accounts.instructionsSysvar.value =
|
|
362
344
|
"Sysvar1nstructions1111111111111111111111111" as Address<"Sysvar1nstructions1111111111111111111111111">;
|
|
363
345
|
}
|
|
364
|
-
if (!accounts.omlpVaultState.value) {
|
|
365
|
-
accounts.omlpVaultState.value = await getProgramDerivedAddress({
|
|
366
|
-
programAddress,
|
|
367
|
-
seeds: [
|
|
368
|
-
getBytesEncoder().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
369
|
-
getAddressEncoder().encode(
|
|
370
|
-
expectAddress(accounts.underlyingMint.value),
|
|
371
|
-
),
|
|
372
|
-
],
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
346
|
if (!accounts.tokenProgram.value) {
|
|
376
347
|
accounts.tokenProgram.value =
|
|
377
348
|
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" as Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">;
|
|
@@ -388,6 +359,7 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
388
359
|
getAccountMeta(accounts.optionPool),
|
|
389
360
|
getAccountMeta(accounts.optionAccount),
|
|
390
361
|
getAccountMeta(accounts.underlyingMint),
|
|
362
|
+
getAccountMeta(accounts.collateralMint),
|
|
391
363
|
getAccountMeta(accounts.positionAccount),
|
|
392
364
|
getAccountMeta(accounts.collateralVault),
|
|
393
365
|
getAccountMeta(accounts.buyerPaymentAccount),
|
|
@@ -397,8 +369,6 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
397
369
|
getAccountMeta(accounts.slotHashesSysvar),
|
|
398
370
|
getAccountMeta(accounts.instructionsSysvar),
|
|
399
371
|
getAccountMeta(accounts.marketData),
|
|
400
|
-
getAccountMeta(accounts.omlpVault),
|
|
401
|
-
getAccountMeta(accounts.omlpVaultState),
|
|
402
372
|
getAccountMeta(accounts.keeper),
|
|
403
373
|
getAccountMeta(accounts.tokenProgram),
|
|
404
374
|
getAccountMeta(accounts.systemProgram),
|
|
@@ -411,6 +381,7 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
411
381
|
TAccountOptionPool,
|
|
412
382
|
TAccountOptionAccount,
|
|
413
383
|
TAccountUnderlyingMint,
|
|
384
|
+
TAccountCollateralMint,
|
|
414
385
|
TAccountPositionAccount,
|
|
415
386
|
TAccountCollateralVault,
|
|
416
387
|
TAccountBuyerPaymentAccount,
|
|
@@ -420,8 +391,6 @@ export async function getAutoExerciseExpiredInstructionAsync<
|
|
|
420
391
|
TAccountSlotHashesSysvar,
|
|
421
392
|
TAccountInstructionsSysvar,
|
|
422
393
|
TAccountMarketData,
|
|
423
|
-
TAccountOmlpVault,
|
|
424
|
-
TAccountOmlpVaultState,
|
|
425
394
|
TAccountKeeper,
|
|
426
395
|
TAccountTokenProgram,
|
|
427
396
|
TAccountSystemProgram
|
|
@@ -433,6 +402,7 @@ export type AutoExerciseExpiredInput<
|
|
|
433
402
|
TAccountOptionPool extends string = string,
|
|
434
403
|
TAccountOptionAccount extends string = string,
|
|
435
404
|
TAccountUnderlyingMint extends string = string,
|
|
405
|
+
TAccountCollateralMint extends string = string,
|
|
436
406
|
TAccountPositionAccount extends string = string,
|
|
437
407
|
TAccountCollateralVault extends string = string,
|
|
438
408
|
TAccountBuyerPaymentAccount extends string = string,
|
|
@@ -442,8 +412,6 @@ export type AutoExerciseExpiredInput<
|
|
|
442
412
|
TAccountSlotHashesSysvar extends string = string,
|
|
443
413
|
TAccountInstructionsSysvar extends string = string,
|
|
444
414
|
TAccountMarketData extends string = string,
|
|
445
|
-
TAccountOmlpVault extends string = string,
|
|
446
|
-
TAccountOmlpVaultState extends string = string,
|
|
447
415
|
TAccountKeeper extends string = string,
|
|
448
416
|
TAccountTokenProgram extends string = string,
|
|
449
417
|
TAccountSystemProgram extends string = string,
|
|
@@ -453,6 +421,7 @@ export type AutoExerciseExpiredInput<
|
|
|
453
421
|
optionAccount: Address<TAccountOptionAccount>;
|
|
454
422
|
/** Underlying token mint (for dynamic decimal handling - supports any SPL token) */
|
|
455
423
|
underlyingMint: Address<TAccountUnderlyingMint>;
|
|
424
|
+
collateralMint: Address<TAccountCollateralMint>;
|
|
456
425
|
/**
|
|
457
426
|
* Buyer's position (tracks quantity owned)
|
|
458
427
|
* Note: NO signer constraint - keeper exercises on behalf of buyer
|
|
@@ -460,7 +429,7 @@ export type AutoExerciseExpiredInput<
|
|
|
460
429
|
positionAccount: Address<TAccountPositionAccount>;
|
|
461
430
|
/** Pool's collateral vault (source of payout) */
|
|
462
431
|
collateralVault: Address<TAccountCollateralVault>;
|
|
463
|
-
/** Buyer's
|
|
432
|
+
/** Buyer's settlement token account (receives intrinsic value) */
|
|
464
433
|
buyerPaymentAccount: Address<TAccountBuyerPaymentAccount>;
|
|
465
434
|
/** Buyer's option token account (burns tokens) */
|
|
466
435
|
buyerOptionAccount: Address<TAccountBuyerOptionAccount>;
|
|
@@ -471,16 +440,6 @@ export type AutoExerciseExpiredInput<
|
|
|
471
440
|
instructionsSysvar?: Address<TAccountInstructionsSysvar>;
|
|
472
441
|
/** Market data for this underlying asset (contains switchboard_feed_id) */
|
|
473
442
|
marketData: Address<TAccountMarketData>;
|
|
474
|
-
/** OMLP Vault token account to receive repayments */
|
|
475
|
-
omlpVault: Address<TAccountOmlpVault>;
|
|
476
|
-
/**
|
|
477
|
-
* OMLP Vault state PDA (mut: keeps `total_loans`, `total_liquidity`,
|
|
478
|
-
* and `acc_interest_per_share_fp` consistent via `add_interest_to_index`
|
|
479
|
-
* so auto-exercised lender repayments actually realize interest to LPs).
|
|
480
|
-
* Constrained to the vault matching `underlying_mint` — same mint the
|
|
481
|
-
* collateral vault settles in.
|
|
482
|
-
*/
|
|
483
|
-
omlpVaultState: Address<TAccountOmlpVaultState>;
|
|
484
443
|
/** Keeper who pays for gas - anyone can call this after expiration */
|
|
485
444
|
keeper: TransactionSigner<TAccountKeeper>;
|
|
486
445
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
@@ -492,6 +451,7 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
492
451
|
TAccountOptionPool extends string,
|
|
493
452
|
TAccountOptionAccount extends string,
|
|
494
453
|
TAccountUnderlyingMint extends string,
|
|
454
|
+
TAccountCollateralMint extends string,
|
|
495
455
|
TAccountPositionAccount extends string,
|
|
496
456
|
TAccountCollateralVault extends string,
|
|
497
457
|
TAccountBuyerPaymentAccount extends string,
|
|
@@ -501,8 +461,6 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
501
461
|
TAccountSlotHashesSysvar extends string,
|
|
502
462
|
TAccountInstructionsSysvar extends string,
|
|
503
463
|
TAccountMarketData extends string,
|
|
504
|
-
TAccountOmlpVault extends string,
|
|
505
|
-
TAccountOmlpVaultState extends string,
|
|
506
464
|
TAccountKeeper extends string,
|
|
507
465
|
TAccountTokenProgram extends string,
|
|
508
466
|
TAccountSystemProgram extends string,
|
|
@@ -513,6 +471,7 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
513
471
|
TAccountOptionPool,
|
|
514
472
|
TAccountOptionAccount,
|
|
515
473
|
TAccountUnderlyingMint,
|
|
474
|
+
TAccountCollateralMint,
|
|
516
475
|
TAccountPositionAccount,
|
|
517
476
|
TAccountCollateralVault,
|
|
518
477
|
TAccountBuyerPaymentAccount,
|
|
@@ -522,8 +481,6 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
522
481
|
TAccountSlotHashesSysvar,
|
|
523
482
|
TAccountInstructionsSysvar,
|
|
524
483
|
TAccountMarketData,
|
|
525
|
-
TAccountOmlpVault,
|
|
526
|
-
TAccountOmlpVaultState,
|
|
527
484
|
TAccountKeeper,
|
|
528
485
|
TAccountTokenProgram,
|
|
529
486
|
TAccountSystemProgram
|
|
@@ -535,6 +492,7 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
535
492
|
TAccountOptionPool,
|
|
536
493
|
TAccountOptionAccount,
|
|
537
494
|
TAccountUnderlyingMint,
|
|
495
|
+
TAccountCollateralMint,
|
|
538
496
|
TAccountPositionAccount,
|
|
539
497
|
TAccountCollateralVault,
|
|
540
498
|
TAccountBuyerPaymentAccount,
|
|
@@ -544,8 +502,6 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
544
502
|
TAccountSlotHashesSysvar,
|
|
545
503
|
TAccountInstructionsSysvar,
|
|
546
504
|
TAccountMarketData,
|
|
547
|
-
TAccountOmlpVault,
|
|
548
|
-
TAccountOmlpVaultState,
|
|
549
505
|
TAccountKeeper,
|
|
550
506
|
TAccountTokenProgram,
|
|
551
507
|
TAccountSystemProgram
|
|
@@ -560,6 +516,7 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
560
516
|
optionPool: { value: input.optionPool ?? null, isWritable: true },
|
|
561
517
|
optionAccount: { value: input.optionAccount ?? null, isWritable: true },
|
|
562
518
|
underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
|
|
519
|
+
collateralMint: { value: input.collateralMint ?? null, isWritable: false },
|
|
563
520
|
positionAccount: { value: input.positionAccount ?? null, isWritable: true },
|
|
564
521
|
collateralVault: { value: input.collateralVault ?? null, isWritable: true },
|
|
565
522
|
buyerPaymentAccount: {
|
|
@@ -584,8 +541,6 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
584
541
|
isWritable: false,
|
|
585
542
|
},
|
|
586
543
|
marketData: { value: input.marketData ?? null, isWritable: false },
|
|
587
|
-
omlpVault: { value: input.omlpVault ?? null, isWritable: true },
|
|
588
|
-
omlpVaultState: { value: input.omlpVaultState ?? null, isWritable: true },
|
|
589
544
|
keeper: { value: input.keeper ?? null, isWritable: true },
|
|
590
545
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
591
546
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
@@ -620,6 +575,7 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
620
575
|
getAccountMeta(accounts.optionPool),
|
|
621
576
|
getAccountMeta(accounts.optionAccount),
|
|
622
577
|
getAccountMeta(accounts.underlyingMint),
|
|
578
|
+
getAccountMeta(accounts.collateralMint),
|
|
623
579
|
getAccountMeta(accounts.positionAccount),
|
|
624
580
|
getAccountMeta(accounts.collateralVault),
|
|
625
581
|
getAccountMeta(accounts.buyerPaymentAccount),
|
|
@@ -629,8 +585,6 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
629
585
|
getAccountMeta(accounts.slotHashesSysvar),
|
|
630
586
|
getAccountMeta(accounts.instructionsSysvar),
|
|
631
587
|
getAccountMeta(accounts.marketData),
|
|
632
|
-
getAccountMeta(accounts.omlpVault),
|
|
633
|
-
getAccountMeta(accounts.omlpVaultState),
|
|
634
588
|
getAccountMeta(accounts.keeper),
|
|
635
589
|
getAccountMeta(accounts.tokenProgram),
|
|
636
590
|
getAccountMeta(accounts.systemProgram),
|
|
@@ -643,6 +597,7 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
643
597
|
TAccountOptionPool,
|
|
644
598
|
TAccountOptionAccount,
|
|
645
599
|
TAccountUnderlyingMint,
|
|
600
|
+
TAccountCollateralMint,
|
|
646
601
|
TAccountPositionAccount,
|
|
647
602
|
TAccountCollateralVault,
|
|
648
603
|
TAccountBuyerPaymentAccount,
|
|
@@ -652,8 +607,6 @@ export function getAutoExerciseExpiredInstruction<
|
|
|
652
607
|
TAccountSlotHashesSysvar,
|
|
653
608
|
TAccountInstructionsSysvar,
|
|
654
609
|
TAccountMarketData,
|
|
655
|
-
TAccountOmlpVault,
|
|
656
|
-
TAccountOmlpVaultState,
|
|
657
610
|
TAccountKeeper,
|
|
658
611
|
TAccountTokenProgram,
|
|
659
612
|
TAccountSystemProgram
|
|
@@ -671,38 +624,29 @@ export type ParsedAutoExerciseExpiredInstruction<
|
|
|
671
624
|
optionAccount: TAccountMetas[2];
|
|
672
625
|
/** Underlying token mint (for dynamic decimal handling - supports any SPL token) */
|
|
673
626
|
underlyingMint: TAccountMetas[3];
|
|
627
|
+
collateralMint: TAccountMetas[4];
|
|
674
628
|
/**
|
|
675
629
|
* Buyer's position (tracks quantity owned)
|
|
676
630
|
* Note: NO signer constraint - keeper exercises on behalf of buyer
|
|
677
631
|
*/
|
|
678
|
-
positionAccount: TAccountMetas[
|
|
632
|
+
positionAccount: TAccountMetas[5];
|
|
679
633
|
/** Pool's collateral vault (source of payout) */
|
|
680
|
-
collateralVault: TAccountMetas[
|
|
681
|
-
/** Buyer's
|
|
682
|
-
buyerPaymentAccount: TAccountMetas[
|
|
634
|
+
collateralVault: TAccountMetas[6];
|
|
635
|
+
/** Buyer's settlement token account (receives intrinsic value) */
|
|
636
|
+
buyerPaymentAccount: TAccountMetas[7];
|
|
683
637
|
/** Buyer's option token account (burns tokens) */
|
|
684
|
-
buyerOptionAccount: TAccountMetas[
|
|
638
|
+
buyerOptionAccount: TAccountMetas[8];
|
|
685
639
|
/** Option mint (for burning) */
|
|
686
|
-
optionMint: TAccountMetas[
|
|
687
|
-
switchboardQueue: TAccountMetas[
|
|
688
|
-
slotHashesSysvar: TAccountMetas[
|
|
689
|
-
instructionsSysvar: TAccountMetas[
|
|
640
|
+
optionMint: TAccountMetas[9];
|
|
641
|
+
switchboardQueue: TAccountMetas[10];
|
|
642
|
+
slotHashesSysvar: TAccountMetas[11];
|
|
643
|
+
instructionsSysvar: TAccountMetas[12];
|
|
690
644
|
/** Market data for this underlying asset (contains switchboard_feed_id) */
|
|
691
|
-
marketData: TAccountMetas[
|
|
692
|
-
/** OMLP Vault token account to receive repayments */
|
|
693
|
-
omlpVault: TAccountMetas[13];
|
|
694
|
-
/**
|
|
695
|
-
* OMLP Vault state PDA (mut: keeps `total_loans`, `total_liquidity`,
|
|
696
|
-
* and `acc_interest_per_share_fp` consistent via `add_interest_to_index`
|
|
697
|
-
* so auto-exercised lender repayments actually realize interest to LPs).
|
|
698
|
-
* Constrained to the vault matching `underlying_mint` — same mint the
|
|
699
|
-
* collateral vault settles in.
|
|
700
|
-
*/
|
|
701
|
-
omlpVaultState: TAccountMetas[14];
|
|
645
|
+
marketData: TAccountMetas[13];
|
|
702
646
|
/** Keeper who pays for gas - anyone can call this after expiration */
|
|
703
|
-
keeper: TAccountMetas[
|
|
704
|
-
tokenProgram: TAccountMetas[
|
|
705
|
-
systemProgram: TAccountMetas[
|
|
647
|
+
keeper: TAccountMetas[14];
|
|
648
|
+
tokenProgram: TAccountMetas[15];
|
|
649
|
+
systemProgram: TAccountMetas[16];
|
|
706
650
|
};
|
|
707
651
|
data: AutoExerciseExpiredInstructionData;
|
|
708
652
|
};
|
|
@@ -715,7 +659,7 @@ export function parseAutoExerciseExpiredInstruction<
|
|
|
715
659
|
InstructionWithAccounts<TAccountMetas> &
|
|
716
660
|
InstructionWithData<ReadonlyUint8Array>,
|
|
717
661
|
): ParsedAutoExerciseExpiredInstruction<TProgram, TAccountMetas> {
|
|
718
|
-
if (instruction.accounts.length <
|
|
662
|
+
if (instruction.accounts.length < 17) {
|
|
719
663
|
// TODO: Coded error.
|
|
720
664
|
throw new Error("Not enough accounts");
|
|
721
665
|
}
|
|
@@ -732,6 +676,7 @@ export function parseAutoExerciseExpiredInstruction<
|
|
|
732
676
|
optionPool: getNextAccount(),
|
|
733
677
|
optionAccount: getNextAccount(),
|
|
734
678
|
underlyingMint: getNextAccount(),
|
|
679
|
+
collateralMint: getNextAccount(),
|
|
735
680
|
positionAccount: getNextAccount(),
|
|
736
681
|
collateralVault: getNextAccount(),
|
|
737
682
|
buyerPaymentAccount: getNextAccount(),
|
|
@@ -741,8 +686,6 @@ export function parseAutoExerciseExpiredInstruction<
|
|
|
741
686
|
slotHashesSysvar: getNextAccount(),
|
|
742
687
|
instructionsSysvar: getNextAccount(),
|
|
743
688
|
marketData: getNextAccount(),
|
|
744
|
-
omlpVault: getNextAccount(),
|
|
745
|
-
omlpVaultState: getNextAccount(),
|
|
746
689
|
keeper: getNextAccount(),
|
|
747
690
|
tokenProgram: getNextAccount(),
|
|
748
691
|
systemProgram: getNextAccount(),
|