@wireio/stake 2.3.0 → 2.4.0

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.
Files changed (30) hide show
  1. package/lib/stake.browser.js +1224 -71
  2. package/lib/stake.browser.js.map +1 -1
  3. package/lib/stake.d.ts +1150 -163
  4. package/lib/stake.js +1234 -71
  5. package/lib/stake.js.map +1 -1
  6. package/lib/stake.m.js +1224 -71
  7. package/lib/stake.m.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/assets/solana/devnet/idl/liqsol_core.json +472 -27
  10. package/src/assets/solana/devnet/idl/liqsol_token.json +34 -0
  11. package/src/assets/solana/devnet/idl/transfer_hook.json +34 -0
  12. package/src/assets/solana/devnet/types/liqsol_core.ts +472 -27
  13. package/src/assets/solana/devnet/types/liqsol_token.ts +34 -0
  14. package/src/assets/solana/devnet/types/transfer_hook.ts +34 -0
  15. package/src/assets/solana/mainnet/idl/liqsol_core.json +472 -27
  16. package/src/assets/solana/mainnet/idl/liqsol_token.json +34 -0
  17. package/src/assets/solana/mainnet/idl/transfer_hook.json +34 -0
  18. package/src/assets/solana/mainnet/types/liqsol_core.ts +472 -27
  19. package/src/assets/solana/mainnet/types/liqsol_token.ts +34 -0
  20. package/src/assets/solana/mainnet/types/transfer_hook.ts +34 -0
  21. package/src/networks/ethereum/ethereum.ts +9 -9
  22. package/src/networks/solana/clients/distribution.client.ts +114 -2
  23. package/src/networks/solana/clients/outpost.client.ts +2 -0
  24. package/src/networks/solana/clients/token.client.ts +2 -0
  25. package/src/networks/solana/constants.ts +3 -0
  26. package/src/networks/solana/program.ts +7 -0
  27. package/src/networks/solana/solana.ts +26 -1
  28. package/src/networks/solana/types.ts +3 -3
  29. package/src/networks/solana/utils.ts +7 -1
  30. package/src/types.ts +10 -1
package/lib/stake.d.ts CHANGED
@@ -41,6 +41,8 @@ interface IStakingClient {
41
41
  buy(amount: bigint): Promise<string>;
42
42
  /** Claim a withdrawal receipt (burn NFT + receive ETH/SOL) via claim_withdraw. */
43
43
  claimWithdraw(tokenId: bigint): Promise<string>;
44
+ /** Solana only: claim accrued liqSOL distribution rewards. */
45
+ claimLiqsolRewards?(): Promise<string>;
44
46
  /** Enumerate withdrawal receipt NFTs held by the user (queued/ready/claimed). */
45
47
  getPendingWithdraws(): Promise<WithdrawReceipt$1[]>;
46
48
  /** Fetch the complete user portfolio */
@@ -91,6 +93,11 @@ interface Portfolio {
91
93
  native: BalanceView;
92
94
  /** Liquid staking token balance (LiqETH, LiqSOL, etc.). */
93
95
  liq: BalanceView;
96
+ /**
97
+ * Solana-only liqSOL rewards currently claimable from the distribution bucket.
98
+ * Not populated on Ethereum.
99
+ */
100
+ claimable?: BalanceView;
94
101
  /**
95
102
  * Outpost-staked balance:
96
103
  * - On Solana: liqSOL staked via `synd` (stakedLiqsol, in lamports).
@@ -445,6 +452,7 @@ declare class EthereumStakingClient implements IStakingClient {
445
452
  MockAggregator: ethers.Contract;
446
453
  };
447
454
  get network(): _wireio_core.ExternalNetwork;
455
+ get address(): Promise<string> | undefined;
448
456
  constructor(config: StakerConfig);
449
457
  /**
450
458
  * Deposit native ETH into the liqETH protocol via DepositManager.
@@ -931,10 +939,10 @@ type GlobalState = {
931
939
  */
932
940
  currentIndex: BN;
933
941
  /**
934
- * Last observed liqSOL pool balance
935
- * used for computing incremental yield.
942
+ * Replaced legacy `lastPoolLiqsolBalance`
943
+ * with expected balance based on total shares and current index.
936
944
  */
937
- lastPoolLiqsolBalance: BN;
945
+ expectedPoolBalance: BN;
938
946
  /**
939
947
  * Accumulated liqSOL yield available to the protocol
940
948
  * (used for `purchaseFromYield`-style flows).
@@ -1425,6 +1433,7 @@ declare const PDA_SEEDS: {
1425
1433
  readonly MINT_METADATA: "mint_metadata";
1426
1434
  readonly LIQ_RECEIPT_DATA: "liq_receipt_data";
1427
1435
  readonly WITHDRAW_MINT: "mint";
1436
+ readonly PRETOKEN_PURCHASE_HISTORY: "pretoken_purchase_history";
1428
1437
  };
1429
1438
  /**
1430
1439
  * Ephemeral stake account address seed helper
@@ -1517,6 +1526,51 @@ type LiqsolCore$1 = {
1517
1526
  ];
1518
1527
  "args": [];
1519
1528
  },
1529
+ {
1530
+ "name": "adminForceUnbondRole";
1531
+ "discriminator": [
1532
+ 80,
1533
+ 107,
1534
+ 27,
1535
+ 49,
1536
+ 126,
1537
+ 25,
1538
+ 31,
1539
+ 238
1540
+ ];
1541
+ "accounts": [
1542
+ {
1543
+ "name": "admin";
1544
+ "signer": true;
1545
+ },
1546
+ {
1547
+ "name": "globalConfig";
1548
+ },
1549
+ {
1550
+ "name": "globalState";
1551
+ },
1552
+ {
1553
+ "name": "user";
1554
+ "docs": [
1555
+ "The user whose role bond is being force-unbonded"
1556
+ ];
1557
+ },
1558
+ {
1559
+ "name": "outpostAccount";
1560
+ "writable": true;
1561
+ }
1562
+ ];
1563
+ "args": [
1564
+ {
1565
+ "name": "role";
1566
+ "type": {
1567
+ "defined": {
1568
+ "name": "role";
1569
+ };
1570
+ };
1571
+ }
1572
+ ];
1573
+ },
1520
1574
  {
1521
1575
  "name": "aggregateStakeMetrics";
1522
1576
  "docs": [
@@ -2282,6 +2336,72 @@ type LiqsolCore$1 = {
2282
2336
  }
2283
2337
  ];
2284
2338
  },
2339
+ {
2340
+ "name": "depositToReserve";
2341
+ "discriminator": [
2342
+ 8,
2343
+ 79,
2344
+ 123,
2345
+ 129,
2346
+ 146,
2347
+ 140,
2348
+ 178,
2349
+ 128
2350
+ ];
2351
+ "accounts": [
2352
+ {
2353
+ "name": "admin";
2354
+ "signer": true;
2355
+ },
2356
+ {
2357
+ "name": "globalConfig";
2358
+ },
2359
+ {
2360
+ "name": "depositor";
2361
+ "writable": true;
2362
+ "signer": true;
2363
+ },
2364
+ {
2365
+ "name": "reservePool";
2366
+ "writable": true;
2367
+ },
2368
+ {
2369
+ "name": "vault";
2370
+ },
2371
+ {
2372
+ "name": "ephemeralStake";
2373
+ "writable": true;
2374
+ },
2375
+ {
2376
+ "name": "controllerState";
2377
+ },
2378
+ {
2379
+ "name": "stakeProgram";
2380
+ },
2381
+ {
2382
+ "name": "systemProgram";
2383
+ },
2384
+ {
2385
+ "name": "clock";
2386
+ },
2387
+ {
2388
+ "name": "stakeHistory";
2389
+ },
2390
+ {
2391
+ "name": "rent";
2392
+ }
2393
+ ];
2394
+ "args": [
2395
+ {
2396
+ "name": "amount";
2397
+ "type": "u64";
2398
+ },
2399
+ {
2400
+ "name": "seed";
2401
+ "type": "u32";
2402
+ }
2403
+ ];
2404
+ },
2285
2405
  {
2286
2406
  "name": "desynd";
2287
2407
  "discriminator": [
@@ -2358,6 +2478,10 @@ type LiqsolCore$1 = {
2358
2478
  ];
2359
2479
  "writable": true;
2360
2480
  },
2481
+ {
2482
+ "name": "pretokenPurchaseHistory";
2483
+ "writable": true;
2484
+ },
2361
2485
  {
2362
2486
  "name": "tokenProgram";
2363
2487
  },
@@ -2399,6 +2523,44 @@ type LiqsolCore$1 = {
2399
2523
  "args": [];
2400
2524
  "returns": "u16";
2401
2525
  },
2526
+ {
2527
+ "name": "hasRole";
2528
+ "discriminator": [
2529
+ 218,
2530
+ 136,
2531
+ 44,
2532
+ 87,
2533
+ 142,
2534
+ 247,
2535
+ 141,
2536
+ 195
2537
+ ];
2538
+ "accounts": [
2539
+ {
2540
+ "name": "user";
2541
+ "docs": [
2542
+ "User whose role status is being checked."
2543
+ ];
2544
+ },
2545
+ {
2546
+ "name": "outpostAccount";
2547
+ },
2548
+ {
2549
+ "name": "globalState";
2550
+ }
2551
+ ];
2552
+ "args": [
2553
+ {
2554
+ "name": "role";
2555
+ "type": {
2556
+ "defined": {
2557
+ "name": "role";
2558
+ };
2559
+ };
2560
+ }
2561
+ ];
2562
+ "returns": "bool";
2563
+ },
2402
2564
  {
2403
2565
  "name": "initBucket";
2404
2566
  "docs": [
@@ -2740,6 +2902,51 @@ type LiqsolCore$1 = {
2740
2902
  ];
2741
2903
  "args": [];
2742
2904
  },
2905
+ {
2906
+ "name": "initializePretokenPurchaseHistory";
2907
+ "docs": [
2908
+ "Admin-only: initialize PretokenPurchaseHistory PDA for a pool"
2909
+ ];
2910
+ "discriminator": [
2911
+ 140,
2912
+ 166,
2913
+ 196,
2914
+ 128,
2915
+ 189,
2916
+ 240,
2917
+ 159,
2918
+ 1
2919
+ ];
2920
+ "accounts": [
2921
+ {
2922
+ "name": "admin";
2923
+ "writable": true;
2924
+ "signer": true;
2925
+ },
2926
+ {
2927
+ "name": "globalConfig";
2928
+ },
2929
+ {
2930
+ "name": "pretokenPurchaseHistory";
2931
+ "writable": true;
2932
+ },
2933
+ {
2934
+ "name": "poolAuthority";
2935
+ },
2936
+ {
2937
+ "name": "globalState";
2938
+ "writable": true;
2939
+ },
2940
+ {
2941
+ "name": "poolPretokenRecord";
2942
+ "writable": true;
2943
+ },
2944
+ {
2945
+ "name": "systemProgram";
2946
+ }
2947
+ ];
2948
+ "args": [];
2949
+ },
2743
2950
  {
2744
2951
  "name": "initializeProcessingState";
2745
2952
  "docs": [
@@ -3610,6 +3817,10 @@ type LiqsolCore$1 = {
3610
3817
  },
3611
3818
  {
3612
3819
  "name": "systemProgram";
3820
+ },
3821
+ {
3822
+ "name": "pretokenPurchaseHistory";
3823
+ "writable": true;
3613
3824
  }
3614
3825
  ];
3615
3826
  "args": [
@@ -3704,6 +3915,10 @@ type LiqsolCore$1 = {
3704
3915
  },
3705
3916
  {
3706
3917
  "name": "chainlinkProgram";
3918
+ },
3919
+ {
3920
+ "name": "pretokenPurchaseHistory";
3921
+ "writable": true;
3707
3922
  }
3708
3923
  ];
3709
3924
  "args": [];
@@ -3796,7 +4011,7 @@ type LiqsolCore$1 = {
3796
4011
  "name": "refreshStakeMetricsPostSync";
3797
4012
  "docs": [
3798
4013
  "V2: Refresh stake metrics after removal selection + PDA setup",
3799
- "Requires ActiveInfosSynced + ValidatorPdaSetup as prerequisites",
4014
+ "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites",
3800
4015
  "Tracks completion in last_post_sync_stake_metrics_refresh_epoch"
3801
4016
  ];
3802
4017
  "discriminator": [
@@ -3839,92 +4054,222 @@ type LiqsolCore$1 = {
3839
4054
  "args": [];
3840
4055
  },
3841
4056
  {
3842
- "name": "registerUser";
4057
+ "name": "refund";
3843
4058
  "discriminator": [
3844
4059
  2,
3845
- 241,
3846
- 150,
3847
- 223,
3848
- 99,
3849
- 214,
3850
- 116,
3851
- 97
4060
+ 96,
4061
+ 183,
4062
+ 251,
4063
+ 63,
4064
+ 208,
4065
+ 46,
4066
+ 46
3852
4067
  ];
3853
4068
  "accounts": [
3854
4069
  {
3855
- "name": "user";
3856
- "writable": true;
4070
+ "name": "associatedTokenProgram";
3857
4071
  },
3858
4072
  {
3859
- "name": "userAta";
4073
+ "name": "user";
3860
4074
  "writable": true;
4075
+ "signer": true;
3861
4076
  },
3862
4077
  {
3863
- "name": "userRecord";
4078
+ "name": "globalState";
3864
4079
  "writable": true;
3865
4080
  },
3866
4081
  {
3867
- "name": "payer";
3868
- "docs": [
3869
- "Payer for the user record PDA creation (always the user)"
3870
- ];
4082
+ "name": "outpostAccount";
3871
4083
  "writable": true;
3872
- "signer": true;
3873
4084
  },
3874
4085
  {
3875
4086
  "name": "distributionState";
3876
4087
  "writable": true;
3877
4088
  },
3878
4089
  {
3879
- "name": "bucketAuthority";
4090
+ "name": "poolAuthority";
3880
4091
  },
3881
4092
  {
3882
- "name": "bucketTokenAccount";
3883
- "docs": [
3884
- "The bucket's associated token account holding liqSOL (for index sync)"
3885
- ];
4093
+ "name": "liqsolPoolAta";
3886
4094
  "writable": true;
3887
4095
  },
3888
4096
  {
3889
- "name": "systemProgram";
3890
- }
3891
- ];
3892
- "args": [];
3893
- },
3894
- {
3895
- "name": "removeLowPerformersBatch";
3896
- "docs": [
3897
- "Process batch of validators for removal (below exit threshold)"
3898
- ];
3899
- "discriminator": [
3900
- 91,
3901
- 142,
3902
- 166,
3903
- 98,
3904
- 245,
3905
- 245,
3906
- 159,
3907
- 44
3908
- ];
3909
- "accounts": [
3910
- {
3911
- "name": "activeList";
4097
+ "name": "refundLiqsolAta";
3912
4098
  "writable": true;
3913
4099
  },
3914
4100
  {
3915
- "name": "graveyardList";
4101
+ "name": "liqsolPoolUserRecord";
3916
4102
  "writable": true;
3917
4103
  },
3918
4104
  {
3919
- "name": "maintenanceLedger";
4105
+ "name": "userRecord";
3920
4106
  "writable": true;
3921
4107
  },
3922
4108
  {
3923
- "name": "processingState";
3924
- "writable": true;
4109
+ "name": "extraAccountMetaList";
3925
4110
  },
3926
4111
  {
3927
- "name": "allocationState";
4112
+ "name": "liqsolCoreProgram";
4113
+ },
4114
+ {
4115
+ "name": "transferHookProgram";
4116
+ },
4117
+ {
4118
+ "name": "liqsolMint";
4119
+ },
4120
+ {
4121
+ "name": "tokenProgram";
4122
+ },
4123
+ {
4124
+ "name": "bucketAuthority";
4125
+ },
4126
+ {
4127
+ "name": "bucketTokenAccount";
4128
+ "writable": true;
4129
+ },
4130
+ {
4131
+ "name": "bucketUserRecord";
4132
+ "writable": true;
4133
+ },
4134
+ {
4135
+ "name": "systemProgram";
4136
+ }
4137
+ ];
4138
+ "args": [];
4139
+ },
4140
+ {
4141
+ "name": "registerSystemPda";
4142
+ "discriminator": [
4143
+ 110,
4144
+ 93,
4145
+ 36,
4146
+ 156,
4147
+ 179,
4148
+ 69,
4149
+ 54,
4150
+ 210
4151
+ ];
4152
+ "accounts": [
4153
+ {
4154
+ "name": "admin";
4155
+ "writable": true;
4156
+ "signer": true;
4157
+ },
4158
+ {
4159
+ "name": "globalConfig";
4160
+ },
4161
+ {
4162
+ "name": "pdaOwner";
4163
+ "docs": [
4164
+ "The PDA whose user record we're creating — must be system-owned (no program data)."
4165
+ ];
4166
+ },
4167
+ {
4168
+ "name": "pdaAta";
4169
+ },
4170
+ {
4171
+ "name": "userRecord";
4172
+ "writable": true;
4173
+ },
4174
+ {
4175
+ "name": "distributionState";
4176
+ "writable": true;
4177
+ },
4178
+ {
4179
+ "name": "bucketAuthority";
4180
+ },
4181
+ {
4182
+ "name": "bucketTokenAccount";
4183
+ "docs": [
4184
+ "The bucket's associated token account holding liqSOL (for index sync)"
4185
+ ];
4186
+ "writable": true;
4187
+ },
4188
+ {
4189
+ "name": "systemProgram";
4190
+ }
4191
+ ];
4192
+ "args": [];
4193
+ },
4194
+ {
4195
+ "name": "registerUser";
4196
+ "discriminator": [
4197
+ 2,
4198
+ 241,
4199
+ 150,
4200
+ 223,
4201
+ 99,
4202
+ 214,
4203
+ 116,
4204
+ 97
4205
+ ];
4206
+ "accounts": [
4207
+ {
4208
+ "name": "payer";
4209
+ "writable": true;
4210
+ "signer": true;
4211
+ },
4212
+ {
4213
+ "name": "userAta";
4214
+ },
4215
+ {
4216
+ "name": "userRecord";
4217
+ "writable": true;
4218
+ },
4219
+ {
4220
+ "name": "distributionState";
4221
+ "writable": true;
4222
+ },
4223
+ {
4224
+ "name": "bucketAuthority";
4225
+ },
4226
+ {
4227
+ "name": "bucketTokenAccount";
4228
+ "docs": [
4229
+ "The bucket's associated token account holding liqSOL (for index sync)"
4230
+ ];
4231
+ "writable": true;
4232
+ },
4233
+ {
4234
+ "name": "systemProgram";
4235
+ }
4236
+ ];
4237
+ "args": [];
4238
+ },
4239
+ {
4240
+ "name": "removeLowPerformersBatch";
4241
+ "docs": [
4242
+ "Process batch of validators for removal (below exit threshold)"
4243
+ ];
4244
+ "discriminator": [
4245
+ 91,
4246
+ 142,
4247
+ 166,
4248
+ 98,
4249
+ 245,
4250
+ 245,
4251
+ 159,
4252
+ 44
4253
+ ];
4254
+ "accounts": [
4255
+ {
4256
+ "name": "activeList";
4257
+ "writable": true;
4258
+ },
4259
+ {
4260
+ "name": "graveyardList";
4261
+ "writable": true;
4262
+ },
4263
+ {
4264
+ "name": "maintenanceLedger";
4265
+ "writable": true;
4266
+ },
4267
+ {
4268
+ "name": "processingState";
4269
+ "writable": true;
4270
+ },
4271
+ {
4272
+ "name": "allocationState";
3928
4273
  },
3929
4274
  {
3930
4275
  "name": "globalConfig";
@@ -4035,6 +4380,7 @@ type LiqsolCore$1 = {
4035
4380
  "docs": [
4036
4381
  "The bucket's token account holding liqSOL (for sync_index balance)"
4037
4382
  ];
4383
+ "writable": true;
4038
4384
  },
4039
4385
  {
4040
4386
  "name": "reservePool";
@@ -4381,6 +4727,7 @@ type LiqsolCore$1 = {
4381
4727
  },
4382
4728
  {
4383
4729
  "name": "globalState";
4730
+ "writable": true;
4384
4731
  },
4385
4732
  {
4386
4733
  "name": "user";
@@ -4470,7 +4817,7 @@ type LiqsolCore$1 = {
4470
4817
  "name": "syncMainStakeAccounts";
4471
4818
  "docs": [
4472
4819
  "V2: Sync main stake accounts using PDA architecture (batched)",
4473
- "Processes up to 10 validators per transaction via remaining_accounts",
4820
+ "Processes validators in batches via remaining_accounts (batch size is enforced client-side)",
4474
4821
  "Note: Only syncs primary delegated stakes, not transient stakes"
4475
4822
  ];
4476
4823
  "discriminator": [
@@ -4636,6 +4983,10 @@ type LiqsolCore$1 = {
4636
4983
  ];
4637
4984
  "writable": true;
4638
4985
  },
4986
+ {
4987
+ "name": "pretokenPurchaseHistory";
4988
+ "writable": true;
4989
+ },
4639
4990
  {
4640
4991
  "name": "tokenProgram";
4641
4992
  },
@@ -5038,6 +5389,19 @@ type LiqsolCore$1 = {
5038
5389
  150
5039
5390
  ];
5040
5391
  },
5392
+ {
5393
+ "name": "pretokenPurchaseHistory";
5394
+ "discriminator": [
5395
+ 33,
5396
+ 71,
5397
+ 113,
5398
+ 206,
5399
+ 33,
5400
+ 180,
5401
+ 236,
5402
+ 131
5403
+ ];
5404
+ },
5041
5405
  {
5042
5406
  "name": "priceHistory";
5043
5407
  "discriminator": [
@@ -5550,12 +5914,24 @@ type LiqsolCore$1 = {
5550
5914
  ];
5551
5915
  "type": "u16";
5552
5916
  },
5917
+ {
5918
+ "name": "aggregateModeTag";
5919
+ "docs": [
5920
+ "Tracks which aggregation mode currently owns the shared temp fields.",
5921
+ "0 = idle,",
5922
+ "1 = Normal,",
5923
+ "2 = PostSync,",
5924
+ "3 = PostLateEpoch.",
5925
+ "Prevents cross-mode state contamination when modes share the same vars."
5926
+ ];
5927
+ "type": "u8";
5928
+ },
5553
5929
  {
5554
5930
  "name": "reserved";
5555
5931
  "type": {
5556
5932
  "array": [
5557
5933
  "u8",
5558
- 32
5934
+ 31
5559
5935
  ];
5560
5936
  };
5561
5937
  }
@@ -5788,7 +6164,9 @@ type LiqsolCore$1 = {
5788
6164
  {
5789
6165
  "name": "authority";
5790
6166
  "docs": [
5791
- "Authority that can update serviceable_epoch"
6167
+ "DEPRECATED: Originally intended as authority for serviceable_epoch updates,",
6168
+ "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.",
6169
+ "Retained to preserve account layout."
5792
6170
  ];
5793
6171
  "type": "pubkey";
5794
6172
  },
@@ -6104,9 +6482,10 @@ type LiqsolCore$1 = {
6104
6482
  "type": "u64";
6105
6483
  },
6106
6484
  {
6107
- "name": "lastPoolLiqsolBalance";
6485
+ "name": "expectedPoolBalance";
6108
6486
  "docs": [
6109
- "Last observed liqSOL pool balance (for yield calculation)"
6487
+ "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).",
6488
+ "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield."
6110
6489
  ];
6111
6490
  "type": "u64";
6112
6491
  },
@@ -6319,6 +6698,9 @@ type LiqsolCore$1 = {
6319
6698
  },
6320
6699
  {
6321
6700
  "name": "lastActiveInfosSyncedEpoch";
6701
+ "docs": [
6702
+ "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout."
6703
+ ];
6322
6704
  "type": "u16";
6323
6705
  },
6324
6706
  {
@@ -6333,6 +6715,9 @@ type LiqsolCore$1 = {
6333
6715
  },
6334
6716
  {
6335
6717
  "name": "lastDistributionSlot";
6718
+ "docs": [
6719
+ "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout."
6720
+ ];
6336
6721
  "type": {
6337
6722
  "option": "u64";
6338
6723
  };
@@ -6497,6 +6882,24 @@ type LiqsolCore$1 = {
6497
6882
  {
6498
6883
  "name": "bump";
6499
6884
  "type": "u8";
6885
+ },
6886
+ {
6887
+ "name": "accumulatedPretokenYield";
6888
+ "type": {
6889
+ "option": "u64";
6890
+ };
6891
+ },
6892
+ {
6893
+ "name": "lastEpochSyndLiqsol";
6894
+ "type": {
6895
+ "option": "u64";
6896
+ };
6897
+ },
6898
+ {
6899
+ "name": "lastSyndEpoch";
6900
+ "type": {
6901
+ "option": "u64";
6902
+ };
6500
6903
  }
6501
6904
  ];
6502
6905
  };
@@ -6591,6 +6994,57 @@ type LiqsolCore$1 = {
6591
6994
  ];
6592
6995
  };
6593
6996
  },
6997
+ {
6998
+ "name": "pretokenPurchaseHistory";
6999
+ "serialization": "bytemuck";
7000
+ "repr": {
7001
+ "kind": "c";
7002
+ };
7003
+ "type": {
7004
+ "kind": "struct";
7005
+ "fields": [
7006
+ {
7007
+ "name": "startingEpoch";
7008
+ "type": "u64";
7009
+ },
7010
+ {
7011
+ "name": "latestEpoch";
7012
+ "type": "u64";
7013
+ },
7014
+ {
7015
+ "name": "purchasedPerEpoch";
7016
+ "type": {
7017
+ "array": [
7018
+ "u64",
7019
+ 100
7020
+ ];
7021
+ };
7022
+ },
7023
+ {
7024
+ "name": "syndPerEpoch";
7025
+ "type": {
7026
+ "array": [
7027
+ "u64",
7028
+ 100
7029
+ ];
7030
+ };
7031
+ },
7032
+ {
7033
+ "name": "bump";
7034
+ "type": "u8";
7035
+ },
7036
+ {
7037
+ "name": "padding";
7038
+ "type": {
7039
+ "array": [
7040
+ "u8",
7041
+ 7
7042
+ ];
7043
+ };
7044
+ }
7045
+ ];
7046
+ };
7047
+ },
6594
7048
  {
6595
7049
  "name": "pretokenPurchased";
6596
7050
  "type": {
@@ -6851,56 +7305,56 @@ type LiqsolCore$1 = {
6851
7305
  {
6852
7306
  "name": "additionInProgress";
6853
7307
  "docs": [
6854
- "Whether validator addition selection is currently in progress (batched processing)"
7308
+ "DEPRECATED see BatchOrchestrator. Always false."
6855
7309
  ];
6856
7310
  "type": "bool";
6857
7311
  },
6858
7312
  {
6859
7313
  "name": "additionNextRank";
6860
7314
  "docs": [
6861
- "Next rank to process in leaderboard sorted_indices"
7315
+ "DEPRECATED see BatchOrchestrator.addition_next_rank. Always 0."
6862
7316
  ];
6863
7317
  "type": "u16";
6864
7318
  },
6865
7319
  {
6866
7320
  "name": "additionTargetRank";
6867
7321
  "docs": [
6868
- "Target rank to process up to (inclusive)"
7322
+ "DEPRECATED see BatchOrchestrator.addition_target_rank. Always 0."
6869
7323
  ];
6870
7324
  "type": "u16";
6871
7325
  },
6872
7326
  {
6873
7327
  "name": "validatorsAddedThisSelection";
6874
7328
  "docs": [
6875
- "Number of validators added in the current selection cycle"
7329
+ "DEPRECATED see BatchOrchestrator. Always 0."
6876
7330
  ];
6877
7331
  "type": "u16";
6878
7332
  },
6879
7333
  {
6880
7334
  "name": "removalInProgress";
6881
7335
  "docs": [
6882
- "Whether validator removal selection is currently in progress (batched processing)"
7336
+ "DEPRECATED see BatchOrchestrator. Always false."
6883
7337
  ];
6884
7338
  "type": "bool";
6885
7339
  },
6886
7340
  {
6887
7341
  "name": "removalNextIndex";
6888
7342
  "docs": [
6889
- "Next index in active list to check for removal"
7343
+ "DEPRECATED see BatchOrchestrator.removal_next_index. Always 0."
6890
7344
  ];
6891
7345
  "type": "u16";
6892
7346
  },
6893
7347
  {
6894
7348
  "name": "removalActiveListSnapshot";
6895
7349
  "docs": [
6896
- "Snapshot of active list count at start of removal (frozen)"
7350
+ "DEPRECATED see BatchOrchestrator. Always 0."
6897
7351
  ];
6898
7352
  "type": "u16";
6899
7353
  },
6900
7354
  {
6901
7355
  "name": "validatorsRemovedThisSelection";
6902
7356
  "docs": [
6903
- "Number of validators removed in the current selection cycle"
7357
+ "DEPRECATED see BatchOrchestrator. Always 0."
6904
7358
  ];
6905
7359
  "type": "u16";
6906
7360
  }
@@ -7755,22 +8209,56 @@ type LiqsolToken$1 = {
7755
8209
  };
7756
8210
  }
7757
8211
  ];
7758
- }
7759
- ];
7760
- "errors": [
7761
- {
7762
- "code": 6000;
7763
- "name": "invalidMintAuthority";
7764
- "msg": "Invalid mint authority";
7765
- },
7766
- {
7767
- "code": 6001;
7768
- "name": "unauthorizedProgram";
7769
- "msg": "Unauthorized program attempting to mint";
7770
8212
  },
7771
8213
  {
7772
- "code": 6002;
7773
- "name": "cannotDetermineCallingProgram";
8214
+ "name": "updateLiqsolMetadataPermissionless";
8215
+ "discriminator": [
8216
+ 21,
8217
+ 255,
8218
+ 26,
8219
+ 184,
8220
+ 136,
8221
+ 110,
8222
+ 214,
8223
+ 33
8224
+ ];
8225
+ "accounts": [
8226
+ {
8227
+ "name": "payer";
8228
+ "writable": true;
8229
+ "signer": true;
8230
+ },
8231
+ {
8232
+ "name": "mintAuthority";
8233
+ },
8234
+ {
8235
+ "name": "mint";
8236
+ "writable": true;
8237
+ },
8238
+ {
8239
+ "name": "tokenProgram";
8240
+ },
8241
+ {
8242
+ "name": "systemProgram";
8243
+ }
8244
+ ];
8245
+ "args": [];
8246
+ }
8247
+ ];
8248
+ "errors": [
8249
+ {
8250
+ "code": 6000;
8251
+ "name": "invalidMintAuthority";
8252
+ "msg": "Invalid mint authority";
8253
+ },
8254
+ {
8255
+ "code": 6001;
8256
+ "name": "unauthorizedProgram";
8257
+ "msg": "Unauthorized program attempting to mint";
8258
+ },
8259
+ {
8260
+ "code": 6002;
8261
+ "name": "cannotDetermineCallingProgram";
7774
8262
  "msg": "Cannot determine calling program";
7775
8263
  },
7776
8264
  {
@@ -8473,6 +8961,51 @@ type LiqsolCore = {
8473
8961
  ];
8474
8962
  "args": [];
8475
8963
  },
8964
+ {
8965
+ "name": "adminForceUnbondRole";
8966
+ "discriminator": [
8967
+ 80,
8968
+ 107,
8969
+ 27,
8970
+ 49,
8971
+ 126,
8972
+ 25,
8973
+ 31,
8974
+ 238
8975
+ ];
8976
+ "accounts": [
8977
+ {
8978
+ "name": "admin";
8979
+ "signer": true;
8980
+ },
8981
+ {
8982
+ "name": "globalConfig";
8983
+ },
8984
+ {
8985
+ "name": "globalState";
8986
+ },
8987
+ {
8988
+ "name": "user";
8989
+ "docs": [
8990
+ "The user whose role bond is being force-unbonded"
8991
+ ];
8992
+ },
8993
+ {
8994
+ "name": "outpostAccount";
8995
+ "writable": true;
8996
+ }
8997
+ ];
8998
+ "args": [
8999
+ {
9000
+ "name": "role";
9001
+ "type": {
9002
+ "defined": {
9003
+ "name": "role";
9004
+ };
9005
+ };
9006
+ }
9007
+ ];
9008
+ },
8476
9009
  {
8477
9010
  "name": "aggregateStakeMetrics";
8478
9011
  "docs": [
@@ -9238,6 +9771,72 @@ type LiqsolCore = {
9238
9771
  }
9239
9772
  ];
9240
9773
  },
9774
+ {
9775
+ "name": "depositToReserve";
9776
+ "discriminator": [
9777
+ 8,
9778
+ 79,
9779
+ 123,
9780
+ 129,
9781
+ 146,
9782
+ 140,
9783
+ 178,
9784
+ 128
9785
+ ];
9786
+ "accounts": [
9787
+ {
9788
+ "name": "admin";
9789
+ "signer": true;
9790
+ },
9791
+ {
9792
+ "name": "globalConfig";
9793
+ },
9794
+ {
9795
+ "name": "depositor";
9796
+ "writable": true;
9797
+ "signer": true;
9798
+ },
9799
+ {
9800
+ "name": "reservePool";
9801
+ "writable": true;
9802
+ },
9803
+ {
9804
+ "name": "vault";
9805
+ },
9806
+ {
9807
+ "name": "ephemeralStake";
9808
+ "writable": true;
9809
+ },
9810
+ {
9811
+ "name": "controllerState";
9812
+ },
9813
+ {
9814
+ "name": "stakeProgram";
9815
+ },
9816
+ {
9817
+ "name": "systemProgram";
9818
+ },
9819
+ {
9820
+ "name": "clock";
9821
+ },
9822
+ {
9823
+ "name": "stakeHistory";
9824
+ },
9825
+ {
9826
+ "name": "rent";
9827
+ }
9828
+ ];
9829
+ "args": [
9830
+ {
9831
+ "name": "amount";
9832
+ "type": "u64";
9833
+ },
9834
+ {
9835
+ "name": "seed";
9836
+ "type": "u32";
9837
+ }
9838
+ ];
9839
+ },
9241
9840
  {
9242
9841
  "name": "desynd";
9243
9842
  "discriminator": [
@@ -9314,6 +9913,10 @@ type LiqsolCore = {
9314
9913
  ];
9315
9914
  "writable": true;
9316
9915
  },
9916
+ {
9917
+ "name": "pretokenPurchaseHistory";
9918
+ "writable": true;
9919
+ },
9317
9920
  {
9318
9921
  "name": "tokenProgram";
9319
9922
  },
@@ -9355,6 +9958,44 @@ type LiqsolCore = {
9355
9958
  "args": [];
9356
9959
  "returns": "u16";
9357
9960
  },
9961
+ {
9962
+ "name": "hasRole";
9963
+ "discriminator": [
9964
+ 218,
9965
+ 136,
9966
+ 44,
9967
+ 87,
9968
+ 142,
9969
+ 247,
9970
+ 141,
9971
+ 195
9972
+ ];
9973
+ "accounts": [
9974
+ {
9975
+ "name": "user";
9976
+ "docs": [
9977
+ "User whose role status is being checked."
9978
+ ];
9979
+ },
9980
+ {
9981
+ "name": "outpostAccount";
9982
+ },
9983
+ {
9984
+ "name": "globalState";
9985
+ }
9986
+ ];
9987
+ "args": [
9988
+ {
9989
+ "name": "role";
9990
+ "type": {
9991
+ "defined": {
9992
+ "name": "role";
9993
+ };
9994
+ };
9995
+ }
9996
+ ];
9997
+ "returns": "bool";
9998
+ },
9358
9999
  {
9359
10000
  "name": "initBucket";
9360
10001
  "docs": [
@@ -9696,6 +10337,51 @@ type LiqsolCore = {
9696
10337
  ];
9697
10338
  "args": [];
9698
10339
  },
10340
+ {
10341
+ "name": "initializePretokenPurchaseHistory";
10342
+ "docs": [
10343
+ "Admin-only: initialize PretokenPurchaseHistory PDA for a pool"
10344
+ ];
10345
+ "discriminator": [
10346
+ 140,
10347
+ 166,
10348
+ 196,
10349
+ 128,
10350
+ 189,
10351
+ 240,
10352
+ 159,
10353
+ 1
10354
+ ];
10355
+ "accounts": [
10356
+ {
10357
+ "name": "admin";
10358
+ "writable": true;
10359
+ "signer": true;
10360
+ },
10361
+ {
10362
+ "name": "globalConfig";
10363
+ },
10364
+ {
10365
+ "name": "pretokenPurchaseHistory";
10366
+ "writable": true;
10367
+ },
10368
+ {
10369
+ "name": "poolAuthority";
10370
+ },
10371
+ {
10372
+ "name": "globalState";
10373
+ "writable": true;
10374
+ },
10375
+ {
10376
+ "name": "poolPretokenRecord";
10377
+ "writable": true;
10378
+ },
10379
+ {
10380
+ "name": "systemProgram";
10381
+ }
10382
+ ];
10383
+ "args": [];
10384
+ },
9699
10385
  {
9700
10386
  "name": "initializeProcessingState";
9701
10387
  "docs": [
@@ -10566,6 +11252,10 @@ type LiqsolCore = {
10566
11252
  },
10567
11253
  {
10568
11254
  "name": "systemProgram";
11255
+ },
11256
+ {
11257
+ "name": "pretokenPurchaseHistory";
11258
+ "writable": true;
10569
11259
  }
10570
11260
  ];
10571
11261
  "args": [
@@ -10660,6 +11350,10 @@ type LiqsolCore = {
10660
11350
  },
10661
11351
  {
10662
11352
  "name": "chainlinkProgram";
11353
+ },
11354
+ {
11355
+ "name": "pretokenPurchaseHistory";
11356
+ "writable": true;
10663
11357
  }
10664
11358
  ];
10665
11359
  "args": [];
@@ -10678,118 +11372,256 @@ type LiqsolCore = {
10678
11372
  ];
10679
11373
  "accounts": [
10680
11374
  {
10681
- "name": "payer";
11375
+ "name": "payer";
11376
+ "writable": true;
11377
+ "signer": true;
11378
+ },
11379
+ {
11380
+ "name": "trancheState";
11381
+ },
11382
+ {
11383
+ "name": "priceHistory";
11384
+ "writable": true;
11385
+ },
11386
+ {
11387
+ "name": "chainlinkProgram";
11388
+ },
11389
+ {
11390
+ "name": "chainlinkFeed";
11391
+ },
11392
+ {
11393
+ "name": "systemProgram";
11394
+ }
11395
+ ];
11396
+ "args": [];
11397
+ },
11398
+ {
11399
+ "name": "refreshStakeMetricsPostLateEpoch";
11400
+ "docs": [
11401
+ "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)",
11402
+ "Requires Distribution + UnstakeOrder as prerequisites",
11403
+ "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch"
11404
+ ];
11405
+ "discriminator": [
11406
+ 11,
11407
+ 226,
11408
+ 87,
11409
+ 114,
11410
+ 47,
11411
+ 159,
11412
+ 99,
11413
+ 157
11414
+ ];
11415
+ "accounts": [
11416
+ {
11417
+ "name": "admin";
11418
+ "writable": true;
11419
+ "signer": true;
11420
+ },
11421
+ {
11422
+ "name": "stakeMetrics";
11423
+ "writable": true;
11424
+ },
11425
+ {
11426
+ "name": "epochState";
11427
+ "writable": true;
11428
+ },
11429
+ {
11430
+ "name": "processingState";
11431
+ "writable": true;
11432
+ },
11433
+ {
11434
+ "name": "activeList";
11435
+ },
11436
+ {
11437
+ "name": "globalConfig";
11438
+ "docs": [
11439
+ "Global config for late epoch slot gate"
11440
+ ];
11441
+ }
11442
+ ];
11443
+ "args": [];
11444
+ },
11445
+ {
11446
+ "name": "refreshStakeMetricsPostSync";
11447
+ "docs": [
11448
+ "V2: Refresh stake metrics after removal selection + PDA setup",
11449
+ "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites",
11450
+ "Tracks completion in last_post_sync_stake_metrics_refresh_epoch"
11451
+ ];
11452
+ "discriminator": [
11453
+ 177,
11454
+ 250,
11455
+ 32,
11456
+ 155,
11457
+ 196,
11458
+ 199,
11459
+ 199,
11460
+ 249
11461
+ ];
11462
+ "accounts": [
11463
+ {
11464
+ "name": "admin";
11465
+ "signer": true;
11466
+ },
11467
+ {
11468
+ "name": "stakeMetrics";
11469
+ "writable": true;
11470
+ },
11471
+ {
11472
+ "name": "epochState";
11473
+ "writable": true;
11474
+ },
11475
+ {
11476
+ "name": "processingState";
11477
+ "writable": true;
11478
+ },
11479
+ {
11480
+ "name": "activeList";
11481
+ },
11482
+ {
11483
+ "name": "globalConfig";
11484
+ "docs": [
11485
+ "Global config for late epoch slot gate"
11486
+ ];
11487
+ }
11488
+ ];
11489
+ "args": [];
11490
+ },
11491
+ {
11492
+ "name": "refund";
11493
+ "discriminator": [
11494
+ 2,
11495
+ 96,
11496
+ 183,
11497
+ 251,
11498
+ 63,
11499
+ 208,
11500
+ 46,
11501
+ 46
11502
+ ];
11503
+ "accounts": [
11504
+ {
11505
+ "name": "associatedTokenProgram";
11506
+ },
11507
+ {
11508
+ "name": "user";
10682
11509
  "writable": true;
10683
11510
  "signer": true;
10684
11511
  },
10685
11512
  {
10686
- "name": "trancheState";
11513
+ "name": "globalState";
11514
+ "writable": true;
10687
11515
  },
10688
11516
  {
10689
- "name": "priceHistory";
11517
+ "name": "outpostAccount";
10690
11518
  "writable": true;
10691
11519
  },
10692
11520
  {
10693
- "name": "chainlinkProgram";
11521
+ "name": "distributionState";
11522
+ "writable": true;
10694
11523
  },
10695
11524
  {
10696
- "name": "chainlinkFeed";
11525
+ "name": "poolAuthority";
10697
11526
  },
10698
11527
  {
10699
- "name": "systemProgram";
10700
- }
10701
- ];
10702
- "args": [];
10703
- },
10704
- {
10705
- "name": "refreshStakeMetricsPostLateEpoch";
10706
- "docs": [
10707
- "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)",
10708
- "Requires Distribution + UnstakeOrder as prerequisites",
10709
- "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch"
10710
- ];
10711
- "discriminator": [
10712
- 11,
10713
- 226,
10714
- 87,
10715
- 114,
10716
- 47,
10717
- 159,
10718
- 99,
10719
- 157
10720
- ];
10721
- "accounts": [
11528
+ "name": "liqsolPoolAta";
11529
+ "writable": true;
11530
+ },
10722
11531
  {
10723
- "name": "admin";
11532
+ "name": "refundLiqsolAta";
10724
11533
  "writable": true;
10725
- "signer": true;
10726
11534
  },
10727
11535
  {
10728
- "name": "stakeMetrics";
11536
+ "name": "liqsolPoolUserRecord";
10729
11537
  "writable": true;
10730
11538
  },
10731
11539
  {
10732
- "name": "epochState";
11540
+ "name": "userRecord";
10733
11541
  "writable": true;
10734
11542
  },
10735
11543
  {
10736
- "name": "processingState";
11544
+ "name": "extraAccountMetaList";
11545
+ },
11546
+ {
11547
+ "name": "liqsolCoreProgram";
11548
+ },
11549
+ {
11550
+ "name": "transferHookProgram";
11551
+ },
11552
+ {
11553
+ "name": "liqsolMint";
11554
+ },
11555
+ {
11556
+ "name": "tokenProgram";
11557
+ },
11558
+ {
11559
+ "name": "bucketAuthority";
11560
+ },
11561
+ {
11562
+ "name": "bucketTokenAccount";
10737
11563
  "writable": true;
10738
11564
  },
10739
11565
  {
10740
- "name": "activeList";
11566
+ "name": "bucketUserRecord";
11567
+ "writable": true;
10741
11568
  },
10742
11569
  {
10743
- "name": "globalConfig";
10744
- "docs": [
10745
- "Global config for late epoch slot gate"
10746
- ];
11570
+ "name": "systemProgram";
10747
11571
  }
10748
11572
  ];
10749
11573
  "args": [];
10750
11574
  },
10751
11575
  {
10752
- "name": "refreshStakeMetricsPostSync";
10753
- "docs": [
10754
- "V2: Refresh stake metrics after removal selection + PDA setup",
10755
- "Requires ActiveInfosSynced + ValidatorPdaSetup as prerequisites",
10756
- "Tracks completion in last_post_sync_stake_metrics_refresh_epoch"
10757
- ];
11576
+ "name": "registerSystemPda";
10758
11577
  "discriminator": [
10759
- 177,
10760
- 250,
10761
- 32,
10762
- 155,
10763
- 196,
10764
- 199,
10765
- 199,
10766
- 249
11578
+ 110,
11579
+ 93,
11580
+ 36,
11581
+ 156,
11582
+ 179,
11583
+ 69,
11584
+ 54,
11585
+ 210
10767
11586
  ];
10768
11587
  "accounts": [
10769
11588
  {
10770
11589
  "name": "admin";
11590
+ "writable": true;
10771
11591
  "signer": true;
10772
11592
  },
10773
11593
  {
10774
- "name": "stakeMetrics";
10775
- "writable": true;
11594
+ "name": "globalConfig";
10776
11595
  },
10777
11596
  {
10778
- "name": "epochState";
11597
+ "name": "pdaOwner";
11598
+ "docs": [
11599
+ "The PDA whose user record we're creating — must be system-owned (no program data)."
11600
+ ];
11601
+ },
11602
+ {
11603
+ "name": "pdaAta";
11604
+ },
11605
+ {
11606
+ "name": "userRecord";
10779
11607
  "writable": true;
10780
11608
  },
10781
11609
  {
10782
- "name": "processingState";
11610
+ "name": "distributionState";
10783
11611
  "writable": true;
10784
11612
  },
10785
11613
  {
10786
- "name": "activeList";
11614
+ "name": "bucketAuthority";
10787
11615
  },
10788
11616
  {
10789
- "name": "globalConfig";
11617
+ "name": "bucketTokenAccount";
10790
11618
  "docs": [
10791
- "Global config for late epoch slot gate"
11619
+ "The bucket's associated token account holding liqSOL (for index sync)"
10792
11620
  ];
11621
+ "writable": true;
11622
+ },
11623
+ {
11624
+ "name": "systemProgram";
10793
11625
  }
10794
11626
  ];
10795
11627
  "args": [];
@@ -10808,25 +11640,17 @@ type LiqsolCore = {
10808
11640
  ];
10809
11641
  "accounts": [
10810
11642
  {
10811
- "name": "user";
11643
+ "name": "payer";
10812
11644
  "writable": true;
11645
+ "signer": true;
10813
11646
  },
10814
11647
  {
10815
11648
  "name": "userAta";
10816
- "writable": true;
10817
11649
  },
10818
11650
  {
10819
11651
  "name": "userRecord";
10820
11652
  "writable": true;
10821
11653
  },
10822
- {
10823
- "name": "payer";
10824
- "docs": [
10825
- "Payer for the user record PDA creation (always the user)"
10826
- ];
10827
- "writable": true;
10828
- "signer": true;
10829
- },
10830
11654
  {
10831
11655
  "name": "distributionState";
10832
11656
  "writable": true;
@@ -10991,6 +11815,7 @@ type LiqsolCore = {
10991
11815
  "docs": [
10992
11816
  "The bucket's token account holding liqSOL (for sync_index balance)"
10993
11817
  ];
11818
+ "writable": true;
10994
11819
  },
10995
11820
  {
10996
11821
  "name": "reservePool";
@@ -11337,6 +12162,7 @@ type LiqsolCore = {
11337
12162
  },
11338
12163
  {
11339
12164
  "name": "globalState";
12165
+ "writable": true;
11340
12166
  },
11341
12167
  {
11342
12168
  "name": "user";
@@ -11426,7 +12252,7 @@ type LiqsolCore = {
11426
12252
  "name": "syncMainStakeAccounts";
11427
12253
  "docs": [
11428
12254
  "V2: Sync main stake accounts using PDA architecture (batched)",
11429
- "Processes up to 10 validators per transaction via remaining_accounts",
12255
+ "Processes validators in batches via remaining_accounts (batch size is enforced client-side)",
11430
12256
  "Note: Only syncs primary delegated stakes, not transient stakes"
11431
12257
  ];
11432
12258
  "discriminator": [
@@ -11592,6 +12418,10 @@ type LiqsolCore = {
11592
12418
  ];
11593
12419
  "writable": true;
11594
12420
  },
12421
+ {
12422
+ "name": "pretokenPurchaseHistory";
12423
+ "writable": true;
12424
+ },
11595
12425
  {
11596
12426
  "name": "tokenProgram";
11597
12427
  },
@@ -11994,6 +12824,19 @@ type LiqsolCore = {
11994
12824
  150
11995
12825
  ];
11996
12826
  },
12827
+ {
12828
+ "name": "pretokenPurchaseHistory";
12829
+ "discriminator": [
12830
+ 33,
12831
+ 71,
12832
+ 113,
12833
+ 206,
12834
+ 33,
12835
+ 180,
12836
+ 236,
12837
+ 131
12838
+ ];
12839
+ },
11997
12840
  {
11998
12841
  "name": "priceHistory";
11999
12842
  "discriminator": [
@@ -12506,12 +13349,24 @@ type LiqsolCore = {
12506
13349
  ];
12507
13350
  "type": "u16";
12508
13351
  },
13352
+ {
13353
+ "name": "aggregateModeTag";
13354
+ "docs": [
13355
+ "Tracks which aggregation mode currently owns the shared temp fields.",
13356
+ "0 = idle,",
13357
+ "1 = Normal,",
13358
+ "2 = PostSync,",
13359
+ "3 = PostLateEpoch.",
13360
+ "Prevents cross-mode state contamination when modes share the same vars."
13361
+ ];
13362
+ "type": "u8";
13363
+ },
12509
13364
  {
12510
13365
  "name": "reserved";
12511
13366
  "type": {
12512
13367
  "array": [
12513
13368
  "u8",
12514
- 32
13369
+ 31
12515
13370
  ];
12516
13371
  };
12517
13372
  }
@@ -12744,7 +13599,9 @@ type LiqsolCore = {
12744
13599
  {
12745
13600
  "name": "authority";
12746
13601
  "docs": [
12747
- "Authority that can update serviceable_epoch"
13602
+ "DEPRECATED: Originally intended as authority for serviceable_epoch updates,",
13603
+ "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.",
13604
+ "Retained to preserve account layout."
12748
13605
  ];
12749
13606
  "type": "pubkey";
12750
13607
  },
@@ -13060,9 +13917,10 @@ type LiqsolCore = {
13060
13917
  "type": "u64";
13061
13918
  },
13062
13919
  {
13063
- "name": "lastPoolLiqsolBalance";
13920
+ "name": "expectedPoolBalance";
13064
13921
  "docs": [
13065
- "Last observed liqSOL pool balance (for yield calculation)"
13922
+ "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).",
13923
+ "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield."
13066
13924
  ];
13067
13925
  "type": "u64";
13068
13926
  },
@@ -13275,6 +14133,9 @@ type LiqsolCore = {
13275
14133
  },
13276
14134
  {
13277
14135
  "name": "lastActiveInfosSyncedEpoch";
14136
+ "docs": [
14137
+ "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout."
14138
+ ];
13278
14139
  "type": "u16";
13279
14140
  },
13280
14141
  {
@@ -13289,6 +14150,9 @@ type LiqsolCore = {
13289
14150
  },
13290
14151
  {
13291
14152
  "name": "lastDistributionSlot";
14153
+ "docs": [
14154
+ "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout."
14155
+ ];
13292
14156
  "type": {
13293
14157
  "option": "u64";
13294
14158
  };
@@ -13453,6 +14317,24 @@ type LiqsolCore = {
13453
14317
  {
13454
14318
  "name": "bump";
13455
14319
  "type": "u8";
14320
+ },
14321
+ {
14322
+ "name": "accumulatedPretokenYield";
14323
+ "type": {
14324
+ "option": "u64";
14325
+ };
14326
+ },
14327
+ {
14328
+ "name": "lastEpochSyndLiqsol";
14329
+ "type": {
14330
+ "option": "u64";
14331
+ };
14332
+ },
14333
+ {
14334
+ "name": "lastSyndEpoch";
14335
+ "type": {
14336
+ "option": "u64";
14337
+ };
13456
14338
  }
13457
14339
  ];
13458
14340
  };
@@ -13547,6 +14429,57 @@ type LiqsolCore = {
13547
14429
  ];
13548
14430
  };
13549
14431
  },
14432
+ {
14433
+ "name": "pretokenPurchaseHistory";
14434
+ "serialization": "bytemuck";
14435
+ "repr": {
14436
+ "kind": "c";
14437
+ };
14438
+ "type": {
14439
+ "kind": "struct";
14440
+ "fields": [
14441
+ {
14442
+ "name": "startingEpoch";
14443
+ "type": "u64";
14444
+ },
14445
+ {
14446
+ "name": "latestEpoch";
14447
+ "type": "u64";
14448
+ },
14449
+ {
14450
+ "name": "purchasedPerEpoch";
14451
+ "type": {
14452
+ "array": [
14453
+ "u64",
14454
+ 100
14455
+ ];
14456
+ };
14457
+ },
14458
+ {
14459
+ "name": "syndPerEpoch";
14460
+ "type": {
14461
+ "array": [
14462
+ "u64",
14463
+ 100
14464
+ ];
14465
+ };
14466
+ },
14467
+ {
14468
+ "name": "bump";
14469
+ "type": "u8";
14470
+ },
14471
+ {
14472
+ "name": "padding";
14473
+ "type": {
14474
+ "array": [
14475
+ "u8",
14476
+ 7
14477
+ ];
14478
+ };
14479
+ }
14480
+ ];
14481
+ };
14482
+ },
13550
14483
  {
13551
14484
  "name": "pretokenPurchased";
13552
14485
  "type": {
@@ -13807,56 +14740,56 @@ type LiqsolCore = {
13807
14740
  {
13808
14741
  "name": "additionInProgress";
13809
14742
  "docs": [
13810
- "Whether validator addition selection is currently in progress (batched processing)"
14743
+ "DEPRECATED see BatchOrchestrator. Always false."
13811
14744
  ];
13812
14745
  "type": "bool";
13813
14746
  },
13814
14747
  {
13815
14748
  "name": "additionNextRank";
13816
14749
  "docs": [
13817
- "Next rank to process in leaderboard sorted_indices"
14750
+ "DEPRECATED see BatchOrchestrator.addition_next_rank. Always 0."
13818
14751
  ];
13819
14752
  "type": "u16";
13820
14753
  },
13821
14754
  {
13822
14755
  "name": "additionTargetRank";
13823
14756
  "docs": [
13824
- "Target rank to process up to (inclusive)"
14757
+ "DEPRECATED see BatchOrchestrator.addition_target_rank. Always 0."
13825
14758
  ];
13826
14759
  "type": "u16";
13827
14760
  },
13828
14761
  {
13829
14762
  "name": "validatorsAddedThisSelection";
13830
14763
  "docs": [
13831
- "Number of validators added in the current selection cycle"
14764
+ "DEPRECATED see BatchOrchestrator. Always 0."
13832
14765
  ];
13833
14766
  "type": "u16";
13834
14767
  },
13835
14768
  {
13836
14769
  "name": "removalInProgress";
13837
14770
  "docs": [
13838
- "Whether validator removal selection is currently in progress (batched processing)"
14771
+ "DEPRECATED see BatchOrchestrator. Always false."
13839
14772
  ];
13840
14773
  "type": "bool";
13841
14774
  },
13842
14775
  {
13843
14776
  "name": "removalNextIndex";
13844
14777
  "docs": [
13845
- "Next index in active list to check for removal"
14778
+ "DEPRECATED see BatchOrchestrator.removal_next_index. Always 0."
13846
14779
  ];
13847
14780
  "type": "u16";
13848
14781
  },
13849
14782
  {
13850
14783
  "name": "removalActiveListSnapshot";
13851
14784
  "docs": [
13852
- "Snapshot of active list count at start of removal (frozen)"
14785
+ "DEPRECATED see BatchOrchestrator. Always 0."
13853
14786
  ];
13854
14787
  "type": "u16";
13855
14788
  },
13856
14789
  {
13857
14790
  "name": "validatorsRemovedThisSelection";
13858
14791
  "docs": [
13859
- "Number of validators removed in the current selection cycle"
14792
+ "DEPRECATED see BatchOrchestrator. Always 0."
13860
14793
  ];
13861
14794
  "type": "u16";
13862
14795
  }
@@ -14711,6 +15644,40 @@ type LiqsolToken = {
14711
15644
  };
14712
15645
  }
14713
15646
  ];
15647
+ },
15648
+ {
15649
+ "name": "updateLiqsolMetadataPermissionless";
15650
+ "discriminator": [
15651
+ 21,
15652
+ 255,
15653
+ 26,
15654
+ 184,
15655
+ 136,
15656
+ 110,
15657
+ 214,
15658
+ 33
15659
+ ];
15660
+ "accounts": [
15661
+ {
15662
+ "name": "payer";
15663
+ "writable": true;
15664
+ "signer": true;
15665
+ },
15666
+ {
15667
+ "name": "mintAuthority";
15668
+ },
15669
+ {
15670
+ "name": "mint";
15671
+ "writable": true;
15672
+ },
15673
+ {
15674
+ "name": "tokenProgram";
15675
+ },
15676
+ {
15677
+ "name": "systemProgram";
15678
+ }
15679
+ ];
15680
+ "args": [];
14714
15681
  }
14715
15682
  ];
14716
15683
  "errors": [
@@ -15409,6 +16376,7 @@ declare class SolanaProgramService {
15409
16376
  deriveMaintenanceLedgerPda(): PublicKey$1;
15410
16377
  deriveWithdrawMintAuthorityPda(): PublicKey$1;
15411
16378
  deriveWithdrawMintMetadataPda(): PublicKey$1;
16379
+ derivePretokenPurchaseHistoryPda(): PublicKey$1;
15412
16380
  /**
15413
16381
  * NFT mint for withdrawal receipt, derived from nextReceiptId.
15414
16382
  */
@@ -15494,6 +16462,7 @@ declare class DistributionClient {
15494
16462
  private program;
15495
16463
  constructor(provider: AnchorProvider, pgs: SolanaProgramService);
15496
16464
  get connection(): _solana_web3_js.Connection;
16465
+ private getTokenBalance;
15497
16466
  /**
15498
16467
  * Fetch the global distribution state account.
15499
16468
  *
@@ -15536,6 +16505,19 @@ declare class DistributionClient {
15536
16505
  totalShares: BN;
15537
16506
  ratio: number;
15538
16507
  }>;
16508
+ /**
16509
+ * Compute claimable liqSOL for a wallet:
16510
+ * claimable = max(0, entitled - actual)
16511
+ * entitled = floor(shares * syncedIndex / 1e12)
16512
+ *
16513
+ * `syncedIndex` mirrors on-chain `sync_index` behavior by incorporating any
16514
+ * unsynced bucket delta (bucket_balance - last_bucket_balance).
16515
+ */
16516
+ getClaimableLiqsol(user: PublicKey$1): Promise<BN>;
16517
+ /**
16518
+ * Build claim_rewards instruction for a wallet.
16519
+ */
16520
+ buildClaimRewardsIx(user: PublicKey$1): Promise<TransactionInstruction>;
15539
16521
  /**
15540
16522
  * Compute an average scaled pay rate over the most recent `windowSize`
15541
16523
  * valid entries in the pay-rate history circular buffer.
@@ -15639,6 +16621,7 @@ interface OutpostAccounts {
15639
16621
  chainLinkFeed: PublicKey$1;
15640
16622
  chainLinkProgram: PublicKey$1;
15641
16623
  extraAccountMetaList: PublicKey$1;
16624
+ pretokenPurchaseHistory: PublicKey$1;
15642
16625
  }
15643
16626
  declare function buildOutpostAccounts(connection: Connection, user: PublicKey$1, pgs: SolanaProgramService): Promise<OutpostAccounts>;
15644
16627
  type EpochSnapshot = {
@@ -15857,6 +16840,10 @@ declare class SolanaStakingClient implements IStakingClient {
15857
16840
  * Claim a withdrawal receipt (burn NFT + receive SOL) via claim_withdraw.
15858
16841
  */
15859
16842
  claimWithdraw(tokenId: bigint): Promise<string>;
16843
+ /**
16844
+ * Claim accrued liqSOL distribution rewards (liqsol_core::claim_rewards).
16845
+ */
16846
+ claimLiqsolRewards(): Promise<string>;
15860
16847
  /**
15861
16848
  * Stake liqSOL into Outpost (liqSOL → pool) via liqsol_core::synd.
15862
16849
  */