@wireio/stake 0.4.2 → 0.4.3

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/lib/stake.d.ts CHANGED
@@ -38,6 +38,8 @@ interface IStakingClient {
38
38
  windowBefore?: number;
39
39
  windowAfter?: number;
40
40
  }): Promise<TrancheSnapshot | null>;
41
+ getSystemAPY(): Promise<number>;
42
+ getDepositFee(amount: bigint): Promise<bigint>;
41
43
  }
42
44
  /**
43
45
  * Cross-chain portfolio view for a single account/wallet.
@@ -100,9 +102,9 @@ interface BalanceView {
100
102
  ata?: PublicKey$1;
101
103
  }
102
104
  /**
103
- * SOL / Outpost yield view.
105
+ * Outpost yield view.
104
106
  *
105
- * All amounts are integers in base units (lamports for liqSOL).
107
+ * All amounts are integers in base units (lamports for liqSOL, wei for liqETH).
106
108
  *
107
109
  * Math matches capital-staking:
108
110
  * INDEX_SCALE = 1e12
@@ -125,19 +127,19 @@ interface YieldView {
125
127
  /** User’s staked shares in the Outpost pool. */
126
128
  userShares: bigint;
127
129
  /**
128
- * Total liqSOL (lamports) the user could claim right now if they fully
130
+ * Total liq (wei/lamports) the user could claim right now if they fully
129
131
  * unwound their stake:
130
- * estimatedClaimLiqsol = userShares * currentIndex / indexScale
132
+ * estimatedClaim = userShares * currentIndex / indexScale
131
133
  */
132
- estimatedClaimLiqsol: bigint;
134
+ estimatedClaim?: bigint;
133
135
  /**
134
- * Portion of estimatedClaimLiqsol that is “yield” above principal:
135
- * estimatedYieldLiqsol = max(0, estimatedClaimLiqsol - stakedLiqsol)
136
+ * Portion of estimatedClaim that is “yield” above principal:
137
+ * estimatedYield = max(0, estimatedClaim - staked)
136
138
  *
137
- * NOTE: stakedLiqsol principal itself is surfaced separately as
139
+ * NOTE: staked principal itself is surfaced separately as
138
140
  * Portfolio.staked.amount.
139
141
  */
140
- estimatedYieldLiqsol: bigint;
142
+ estimatedYield?: bigint;
141
143
  }
142
144
  interface TrancheLadderItem {
143
145
  /** On-chain tranche id, 0-based (0,1,2,...) */
@@ -407,7 +409,7 @@ declare class EthereumStakingClient implements IStakingClient {
407
409
  getOPPMessages(address?: string): Promise<OPPAssertion[]>;
408
410
  private ensureUser;
409
411
  getSystemAPY(): Promise<number>;
410
- getDepositFee(amount: bigint): Promise<bigint>;
412
+ getDepositFee(amountWei: bigint): Promise<bigint>;
411
413
  getOPPStatus(): Promise<any>;
412
414
  getEthStats(): Promise<any>;
413
415
  /**
@@ -1230,7 +1232,7 @@ declare class LeaderboardClient {
1230
1232
  * IDL can be found at `target/idl/liqsol_core.json`.
1231
1233
  */
1232
1234
  type LiqsolCore = {
1233
- "address": "2qSsCXBYUSwF7zrzTT9jFpRpCmWoDpEyHr9exfCMq56P";
1235
+ "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH";
1234
1236
  "metadata": {
1235
1237
  "name": "liqsolCore";
1236
1238
  "version": "0.1.0";
@@ -1244,7 +1246,8 @@ type LiqsolCore = {
1244
1246
  "Accumulate unstake requests to be processed in next allocation cycle",
1245
1247
  "Multiple requests can be accumulated before calculating allocations",
1246
1248
  "Returns the target epoch when this unstake request will be processed",
1247
- "We should not be able to"
1249
+ "We should not be able to call this without development feature enabled",
1250
+ ""
1248
1251
  ];
1249
1252
  "discriminator": [
1250
1253
  24,
@@ -1281,6 +1284,12 @@ type LiqsolCore = {
1281
1284
  "Maintenance ledger - to determine target processing epoch"
1282
1285
  ];
1283
1286
  },
1287
+ {
1288
+ "name": "globalConfig";
1289
+ "docs": [
1290
+ "Global config for min_unstake_request setting"
1291
+ ];
1292
+ },
1284
1293
  {
1285
1294
  "name": "clock";
1286
1295
  }
@@ -1332,6 +1341,12 @@ type LiqsolCore = {
1332
1341
  "name": "processingState";
1333
1342
  "writable": true;
1334
1343
  },
1344
+ {
1345
+ "name": "globalConfig";
1346
+ "docs": [
1347
+ "Global config for threshold parameters"
1348
+ ];
1349
+ },
1335
1350
  {
1336
1351
  "name": "authority";
1337
1352
  "signer": true;
@@ -1407,44 +1422,6 @@ type LiqsolCore = {
1407
1422
  }
1408
1423
  ];
1409
1424
  },
1410
- {
1411
- "name": "advanceServiceability";
1412
- "docs": [
1413
- "Advance the max servicable receipt ID"
1414
- ];
1415
- "discriminator": [
1416
- 139,
1417
- 89,
1418
- 79,
1419
- 2,
1420
- 90,
1421
- 211,
1422
- 173,
1423
- 240
1424
- ];
1425
- "accounts": [
1426
- {
1427
- "name": "authority";
1428
- "docs": [
1429
- "Authority that can update serviceable epoch"
1430
- ];
1431
- "signer": true;
1432
- },
1433
- {
1434
- "name": "global";
1435
- "writable": true;
1436
- },
1437
- {
1438
- "name": "runtimeProgram";
1439
- }
1440
- ];
1441
- "args": [
1442
- {
1443
- "name": "resolvedEpoch";
1444
- "type": "u64";
1445
- }
1446
- ];
1447
- },
1448
1425
  {
1449
1426
  "name": "aggregateStakeMetrics";
1450
1427
  "docs": [
@@ -1605,6 +1582,12 @@ type LiqsolCore = {
1605
1582
  "Maintenance ledger - to track last unstake allocation epoch"
1606
1583
  ];
1607
1584
  "writable": true;
1585
+ },
1586
+ {
1587
+ "name": "globalConfig";
1588
+ "docs": [
1589
+ "Global config for late epoch slot gate"
1590
+ ];
1608
1591
  }
1609
1592
  ];
1610
1593
  "args": [];
@@ -1668,6 +1651,12 @@ type LiqsolCore = {
1668
1651
  "docs": [
1669
1652
  "Global withdraw operator state - to read total_encumbered_funds"
1670
1653
  ];
1654
+ },
1655
+ {
1656
+ "name": "globalConfig";
1657
+ "docs": [
1658
+ "Global config for rebalancing thresholds"
1659
+ ];
1671
1660
  }
1672
1661
  ];
1673
1662
  "args": [];
@@ -1790,6 +1779,12 @@ type LiqsolCore = {
1790
1779
  {
1791
1780
  "name": "stakeHistory";
1792
1781
  },
1782
+ {
1783
+ "name": "globalConfig";
1784
+ "docs": [
1785
+ "Global config for claim_withdrawals_enabled check"
1786
+ ];
1787
+ },
1793
1788
  {
1794
1789
  "name": "tokenProgram";
1795
1790
  },
@@ -1841,6 +1836,12 @@ type LiqsolCore = {
1841
1836
  "Stake controller state - used to verify authority"
1842
1837
  ];
1843
1838
  },
1839
+ {
1840
+ "name": "globalConfig";
1841
+ "docs": [
1842
+ "Global config for cooldown_epochs"
1843
+ ];
1844
+ },
1844
1845
  {
1845
1846
  "name": "clock";
1846
1847
  },
@@ -2176,6 +2177,12 @@ type LiqsolCore = {
2176
2177
  "name": "controllerState";
2177
2178
  "writable": true;
2178
2179
  },
2180
+ {
2181
+ "name": "globalConfig";
2182
+ "docs": [
2183
+ "Global config for deposit settings"
2184
+ ];
2185
+ },
2179
2186
  {
2180
2187
  "name": "payoutState";
2181
2188
  "writable": true;
@@ -2312,47 +2319,6 @@ type LiqsolCore = {
2312
2319
  }
2313
2320
  ];
2314
2321
  },
2315
- {
2316
- "name": "forceValidatorUnstake";
2317
- "docs": [
2318
- "A function you can call to directly influence the amount to unstake from a particular validator",
2319
- "Tbh this is a bypass of the system and should not be called unless you know what you are doing"
2320
- ];
2321
- "discriminator": [
2322
- 7,
2323
- 208,
2324
- 146,
2325
- 241,
2326
- 10,
2327
- 219,
2328
- 109,
2329
- 30
2330
- ];
2331
- "accounts": [
2332
- {
2333
- "name": "admin";
2334
- "writable": true;
2335
- "signer": true;
2336
- },
2337
- {
2338
- "name": "validatorInfo";
2339
- "docs": [
2340
- "Validator info account to update"
2341
- ];
2342
- "writable": true;
2343
- }
2344
- ];
2345
- "args": [
2346
- {
2347
- "name": "voteAccount";
2348
- "type": "pubkey";
2349
- },
2350
- {
2351
- "name": "amount";
2352
- "type": "u64";
2353
- }
2354
- ];
2355
- },
2356
2322
  {
2357
2323
  "name": "getMinMaxResolvedEpochDeactivations";
2358
2324
  "docs": [
@@ -2591,6 +2557,37 @@ type LiqsolCore = {
2591
2557
  ];
2592
2558
  "args": [];
2593
2559
  },
2560
+ {
2561
+ "name": "initializeGlobalConfig";
2562
+ "discriminator": [
2563
+ 113,
2564
+ 216,
2565
+ 122,
2566
+ 131,
2567
+ 225,
2568
+ 209,
2569
+ 22,
2570
+ 55
2571
+ ];
2572
+ "accounts": [
2573
+ {
2574
+ "name": "globalConfig";
2575
+ "writable": true;
2576
+ },
2577
+ {
2578
+ "name": "controllerState";
2579
+ },
2580
+ {
2581
+ "name": "payer";
2582
+ "writable": true;
2583
+ "signer": true;
2584
+ },
2585
+ {
2586
+ "name": "systemProgram";
2587
+ }
2588
+ ];
2589
+ "args": [];
2590
+ },
2594
2591
  {
2595
2592
  "name": "initializeGraveyardList";
2596
2593
  "docs": [
@@ -3111,6 +3108,10 @@ type LiqsolCore = {
3111
3108
  ];
3112
3109
  "writable": true;
3113
3110
  },
3111
+ {
3112
+ "name": "withdrawGlobal";
3113
+ "writable": true;
3114
+ },
3114
3115
  {
3115
3116
  "name": "stakeProgram";
3116
3117
  },
@@ -3175,6 +3176,12 @@ type LiqsolCore = {
3175
3176
  "name": "processingState";
3176
3177
  "writable": true;
3177
3178
  },
3179
+ {
3180
+ "name": "globalConfig";
3181
+ "docs": [
3182
+ "Global config for late epoch slot gate"
3183
+ ];
3184
+ },
3178
3185
  {
3179
3186
  "name": "clock";
3180
3187
  },
@@ -3248,6 +3255,12 @@ type LiqsolCore = {
3248
3255
  },
3249
3256
  {
3250
3257
  "name": "instructions";
3258
+ },
3259
+ {
3260
+ "name": "globalConfig";
3261
+ "docs": [
3262
+ "Global config for process_pay_cycle_enabled check"
3263
+ ];
3251
3264
  }
3252
3265
  ];
3253
3266
  "args": [];
@@ -3319,6 +3332,12 @@ type LiqsolCore = {
3319
3332
  },
3320
3333
  {
3321
3334
  "name": "rent";
3335
+ },
3336
+ {
3337
+ "name": "globalConfig";
3338
+ "docs": [
3339
+ "Global config for process_stake_orders_enabled check"
3340
+ ];
3322
3341
  }
3323
3342
  ];
3324
3343
  "args": [];
@@ -3427,6 +3446,12 @@ type LiqsolCore = {
3427
3446
  },
3428
3447
  {
3429
3448
  "name": "stakeProgram";
3449
+ },
3450
+ {
3451
+ "name": "globalConfig";
3452
+ "docs": [
3453
+ "Global config for process_unstake_orders_enabled check"
3454
+ ];
3430
3455
  }
3431
3456
  ];
3432
3457
  "args": [];
@@ -3701,6 +3726,12 @@ type LiqsolCore = {
3701
3726
  },
3702
3727
  {
3703
3728
  "name": "activeList";
3729
+ },
3730
+ {
3731
+ "name": "globalConfig";
3732
+ "docs": [
3733
+ "Global config for late epoch slot gate"
3734
+ ];
3704
3735
  }
3705
3736
  ];
3706
3737
  "args": [];
@@ -3741,6 +3772,12 @@ type LiqsolCore = {
3741
3772
  },
3742
3773
  {
3743
3774
  "name": "activeList";
3775
+ },
3776
+ {
3777
+ "name": "globalConfig";
3778
+ "docs": [
3779
+ "Global config for late epoch slot gate"
3780
+ ];
3744
3781
  }
3745
3782
  ];
3746
3783
  "args": [];
@@ -3833,6 +3870,12 @@ type LiqsolCore = {
3833
3870
  {
3834
3871
  "name": "allocationState";
3835
3872
  },
3873
+ {
3874
+ "name": "globalConfig";
3875
+ "docs": [
3876
+ "Global config for late epoch slot gate"
3877
+ ];
3878
+ },
3836
3879
  {
3837
3880
  "name": "authority";
3838
3881
  "signer": true;
@@ -3963,6 +4006,12 @@ type LiqsolCore = {
3963
4006
  "Maintenance ledger - for accumulate_unstake_request"
3964
4007
  ];
3965
4008
  },
4009
+ {
4010
+ "name": "globalConfig";
4011
+ "docs": [
4012
+ "Global config for min_unstake_request setting"
4013
+ ];
4014
+ },
3966
4015
  {
3967
4016
  "name": "clock";
3968
4017
  },
@@ -4340,6 +4389,12 @@ type LiqsolCore = {
4340
4389
  "name": "allocationState";
4341
4390
  "writable": true;
4342
4391
  },
4392
+ {
4393
+ "name": "globalConfig";
4394
+ "docs": [
4395
+ "Global config for late epoch slot gate"
4396
+ ];
4397
+ },
4343
4398
  {
4344
4399
  "name": "systemProgram";
4345
4400
  "docs": [
@@ -4406,6 +4461,12 @@ type LiqsolCore = {
4406
4461
  "name": "maintenanceLedger";
4407
4462
  "writable": true;
4408
4463
  },
4464
+ {
4465
+ "name": "globalConfig";
4466
+ "docs": [
4467
+ "Global config for late epoch slot gate"
4468
+ ];
4469
+ },
4409
4470
  {
4410
4471
  "name": "authority";
4411
4472
  "signer": true;
@@ -4414,37 +4475,32 @@ type LiqsolCore = {
4414
4475
  "args": [];
4415
4476
  },
4416
4477
  {
4417
- "name": "syncDistributionIndex";
4478
+ "name": "syncLeaderboardScoresBatch";
4418
4479
  "discriminator": [
4419
- 82,
4420
- 159,
4421
- 232,
4422
- 125,
4423
- 12,
4424
- 29,
4425
- 9,
4426
- 226
4480
+ 52,
4481
+ 11,
4482
+ 210,
4483
+ 173,
4484
+ 90,
4485
+ 5,
4486
+ 48,
4487
+ 50
4427
4488
  ];
4428
4489
  "accounts": [
4429
4490
  {
4430
- "name": "authority";
4431
- "docs": [
4432
- "Admin or crank that triggers the index sync"
4433
- ];
4434
- "signer": true;
4491
+ "name": "leaderboardState";
4435
4492
  },
4436
4493
  {
4437
- "name": "distributionState";
4494
+ "name": "processingState";
4438
4495
  "writable": true;
4439
4496
  },
4440
4497
  {
4441
- "name": "bucketAuthority";
4442
- "docs": [
4443
- "The bucket's associated token account holding liqSOL"
4444
- ];
4498
+ "name": "maintenanceLedger";
4499
+ "writable": true;
4445
4500
  },
4446
4501
  {
4447
- "name": "bucketTokenAccount";
4502
+ "name": "authority";
4503
+ "signer": true;
4448
4504
  }
4449
4505
  ];
4450
4506
  "args": [];
@@ -4530,6 +4586,12 @@ type LiqsolCore = {
4530
4586
  "name": "maintenanceLedger";
4531
4587
  "writable": true;
4532
4588
  },
4589
+ {
4590
+ "name": "globalConfig";
4591
+ "docs": [
4592
+ "Global config for min_vpp_entry and min_vpp_exit"
4593
+ ];
4594
+ },
4533
4595
  {
4534
4596
  "name": "authority";
4535
4597
  "signer": true;
@@ -4659,63 +4721,235 @@ type LiqsolCore = {
4659
4721
  "args": [];
4660
4722
  },
4661
4723
  {
4662
- "name": "updateGrowthParameters";
4724
+ "name": "updateConfigBool";
4663
4725
  "discriminator": [
4664
- 172,
4665
- 187,
4666
- 237,
4667
- 233,
4668
- 250,
4669
- 160,
4670
- 115,
4671
- 239
4726
+ 79,
4727
+ 36,
4728
+ 65,
4729
+ 239,
4730
+ 188,
4731
+ 35,
4732
+ 13,
4733
+ 160
4672
4734
  ];
4673
4735
  "accounts": [
4674
4736
  {
4675
- "name": "admin";
4676
- "writable": true;
4677
- "signer": true;
4678
- },
4679
- {
4680
- "name": "trancheState";
4737
+ "name": "globalConfig";
4681
4738
  "writable": true;
4682
4739
  },
4683
4740
  {
4684
- "name": "priceHistory";
4685
- "writable": true;
4741
+ "name": "controllerState";
4686
4742
  },
4687
4743
  {
4688
- "name": "systemProgram";
4744
+ "name": "authority";
4745
+ "docs": [
4746
+ "Authority must match StakeControllerState.authority"
4747
+ ];
4748
+ "signer": true;
4689
4749
  }
4690
4750
  ];
4691
4751
  "args": [
4692
4752
  {
4693
- "name": "supplyGrowthBps";
4694
- "type": "u16";
4753
+ "name": "key";
4754
+ "type": {
4755
+ "defined": {
4756
+ "name": "configKeyBool";
4757
+ };
4758
+ };
4695
4759
  },
4696
4760
  {
4697
- "name": "priceGrowthBps";
4698
- "type": "u16";
4761
+ "name": "value";
4762
+ "type": "bool";
4699
4763
  }
4700
4764
  ];
4701
4765
  },
4702
4766
  {
4703
- "name": "updatePriceBounds";
4767
+ "name": "updateConfigU16";
4704
4768
  "discriminator": [
4705
- 241,
4706
- 116,
4707
- 141,
4708
- 65,
4709
- 61,
4710
- 95,
4711
- 232,
4712
- 28
4713
- ];
4714
- "accounts": [
4715
- {
4716
- "name": "admin";
4717
- "writable": true;
4718
- "signer": true;
4769
+ 149,
4770
+ 9,
4771
+ 244,
4772
+ 25,
4773
+ 46,
4774
+ 136,
4775
+ 59,
4776
+ 173
4777
+ ];
4778
+ "accounts": [
4779
+ {
4780
+ "name": "globalConfig";
4781
+ "writable": true;
4782
+ },
4783
+ {
4784
+ "name": "controllerState";
4785
+ },
4786
+ {
4787
+ "name": "authority";
4788
+ "docs": [
4789
+ "Authority must match StakeControllerState.authority"
4790
+ ];
4791
+ "signer": true;
4792
+ }
4793
+ ];
4794
+ "args": [
4795
+ {
4796
+ "name": "key";
4797
+ "type": {
4798
+ "defined": {
4799
+ "name": "configKeyU16";
4800
+ };
4801
+ };
4802
+ },
4803
+ {
4804
+ "name": "value";
4805
+ "type": "u16";
4806
+ }
4807
+ ];
4808
+ },
4809
+ {
4810
+ "name": "updateConfigU64";
4811
+ "discriminator": [
4812
+ 120,
4813
+ 43,
4814
+ 124,
4815
+ 106,
4816
+ 97,
4817
+ 80,
4818
+ 208,
4819
+ 123
4820
+ ];
4821
+ "accounts": [
4822
+ {
4823
+ "name": "globalConfig";
4824
+ "writable": true;
4825
+ },
4826
+ {
4827
+ "name": "controllerState";
4828
+ },
4829
+ {
4830
+ "name": "authority";
4831
+ "docs": [
4832
+ "Authority must match StakeControllerState.authority"
4833
+ ];
4834
+ "signer": true;
4835
+ }
4836
+ ];
4837
+ "args": [
4838
+ {
4839
+ "name": "key";
4840
+ "type": {
4841
+ "defined": {
4842
+ "name": "configKeyU64";
4843
+ };
4844
+ };
4845
+ },
4846
+ {
4847
+ "name": "value";
4848
+ "type": "u64";
4849
+ }
4850
+ ];
4851
+ },
4852
+ {
4853
+ "name": "updateConfigU8";
4854
+ "discriminator": [
4855
+ 17,
4856
+ 160,
4857
+ 31,
4858
+ 134,
4859
+ 222,
4860
+ 250,
4861
+ 229,
4862
+ 253
4863
+ ];
4864
+ "accounts": [
4865
+ {
4866
+ "name": "globalConfig";
4867
+ "writable": true;
4868
+ },
4869
+ {
4870
+ "name": "controllerState";
4871
+ },
4872
+ {
4873
+ "name": "authority";
4874
+ "docs": [
4875
+ "Authority must match StakeControllerState.authority"
4876
+ ];
4877
+ "signer": true;
4878
+ }
4879
+ ];
4880
+ "args": [
4881
+ {
4882
+ "name": "key";
4883
+ "type": {
4884
+ "defined": {
4885
+ "name": "configKeyU8";
4886
+ };
4887
+ };
4888
+ },
4889
+ {
4890
+ "name": "value";
4891
+ "type": "u8";
4892
+ }
4893
+ ];
4894
+ },
4895
+ {
4896
+ "name": "updateGrowthParameters";
4897
+ "discriminator": [
4898
+ 172,
4899
+ 187,
4900
+ 237,
4901
+ 233,
4902
+ 250,
4903
+ 160,
4904
+ 115,
4905
+ 239
4906
+ ];
4907
+ "accounts": [
4908
+ {
4909
+ "name": "admin";
4910
+ "writable": true;
4911
+ "signer": true;
4912
+ },
4913
+ {
4914
+ "name": "trancheState";
4915
+ "writable": true;
4916
+ },
4917
+ {
4918
+ "name": "priceHistory";
4919
+ "writable": true;
4920
+ },
4921
+ {
4922
+ "name": "systemProgram";
4923
+ }
4924
+ ];
4925
+ "args": [
4926
+ {
4927
+ "name": "supplyGrowthBps";
4928
+ "type": "u16";
4929
+ },
4930
+ {
4931
+ "name": "priceGrowthBps";
4932
+ "type": "u16";
4933
+ }
4934
+ ];
4935
+ },
4936
+ {
4937
+ "name": "updatePriceBounds";
4938
+ "discriminator": [
4939
+ 241,
4940
+ 116,
4941
+ 141,
4942
+ 65,
4943
+ 61,
4944
+ 95,
4945
+ 232,
4946
+ 28
4947
+ ];
4948
+ "accounts": [
4949
+ {
4950
+ "name": "admin";
4951
+ "writable": true;
4952
+ "signer": true;
4719
4953
  },
4720
4954
  {
4721
4955
  "name": "trancheState";
@@ -4732,11 +4966,11 @@ type LiqsolCore = {
4732
4966
  "args": [
4733
4967
  {
4734
4968
  "name": "minPriceUsd";
4735
- "type": "i128";
4969
+ "type": "u64";
4736
4970
  },
4737
4971
  {
4738
4972
  "name": "maxPriceUsd";
4739
- "type": "i128";
4973
+ "type": "u64";
4740
4974
  },
4741
4975
  {
4742
4976
  "name": "maxStalenessSeconds";
@@ -4785,6 +5019,19 @@ type LiqsolCore = {
4785
5019
  127
4786
5020
  ];
4787
5021
  },
5022
+ {
5023
+ "name": "globalConfig";
5024
+ "discriminator": [
5025
+ 149,
5026
+ 8,
5027
+ 156,
5028
+ 202,
5029
+ 160,
5030
+ 252,
5031
+ 176,
5032
+ 217
5033
+ ];
5034
+ },
4788
5035
  {
4789
5036
  "name": "globalState";
4790
5037
  "discriminator": [
@@ -5346,6 +5593,13 @@ type LiqsolCore = {
5346
5593
  ];
5347
5594
  "type": "u16";
5348
5595
  },
5596
+ {
5597
+ "name": "leaderboardScoresNextIndex";
5598
+ "docs": [
5599
+ "Next leaderboard registry index to process for score sync"
5600
+ ];
5601
+ "type": "u16";
5602
+ },
5349
5603
  {
5350
5604
  "name": "removalNextIndex";
5351
5605
  "docs": [
@@ -5393,6 +5647,130 @@ type LiqsolCore = {
5393
5647
  ];
5394
5648
  };
5395
5649
  },
5650
+ {
5651
+ "name": "configKeyBool";
5652
+ "docs": [
5653
+ "Keys for bool config values (feature flags) - stored as bits in a u16",
5654
+ "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,",
5655
+ "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved"
5656
+ ];
5657
+ "type": {
5658
+ "kind": "enum";
5659
+ "variants": [
5660
+ {
5661
+ "name": "depositsEnabled";
5662
+ },
5663
+ {
5664
+ "name": "withdrawalsEnabled";
5665
+ },
5666
+ {
5667
+ "name": "claimWithdrawalsEnabled";
5668
+ },
5669
+ {
5670
+ "name": "processStakeOrdersEnabled";
5671
+ },
5672
+ {
5673
+ "name": "processUnstakeOrdersEnabled";
5674
+ },
5675
+ {
5676
+ "name": "processPayCycleEnabled";
5677
+ },
5678
+ {
5679
+ "name": "rebalancingEnabled";
5680
+ }
5681
+ ];
5682
+ };
5683
+ },
5684
+ {
5685
+ "name": "configKeyU16";
5686
+ "docs": [
5687
+ "Keys for u16 config values (small counts, thresholds, ranks)"
5688
+ ];
5689
+ "type": {
5690
+ "kind": "enum";
5691
+ "variants": [
5692
+ {
5693
+ "name": "cooldownEpochs";
5694
+ },
5695
+ {
5696
+ "name": "depositFeeEpochsMultiplier";
5697
+ },
5698
+ {
5699
+ "name": "minVppEntry";
5700
+ },
5701
+ {
5702
+ "name": "minVppExit";
5703
+ },
5704
+ {
5705
+ "name": "tinyNetworkThreshold";
5706
+ },
5707
+ {
5708
+ "name": "smallNetworkThreshold";
5709
+ },
5710
+ {
5711
+ "name": "mediumNetworkThreshold";
5712
+ },
5713
+ {
5714
+ "name": "largeNetworkEntryRank";
5715
+ },
5716
+ {
5717
+ "name": "largeNetworkExitRank";
5718
+ }
5719
+ ];
5720
+ };
5721
+ },
5722
+ {
5723
+ "name": "configKeyU64";
5724
+ "docs": [
5725
+ "Keys for u64 config values (large amounts, rates)"
5726
+ ];
5727
+ "type": {
5728
+ "kind": "enum";
5729
+ "variants": [
5730
+ {
5731
+ "name": "minUserDeposit";
5732
+ },
5733
+ {
5734
+ "name": "minUnstakeRequest";
5735
+ },
5736
+ {
5737
+ "name": "minRebalanceStakeDelta";
5738
+ },
5739
+ {
5740
+ "name": "minRebalanceUnstakeDelta";
5741
+ },
5742
+ {
5743
+ "name": "transientThreshold";
5744
+ },
5745
+ {
5746
+ "name": "minLateEpochSlotGate";
5747
+ }
5748
+ ];
5749
+ };
5750
+ },
5751
+ {
5752
+ "name": "configKeyU8";
5753
+ "docs": [
5754
+ "Keys for u8 config values (percentages 0-100)"
5755
+ ];
5756
+ "type": {
5757
+ "kind": "enum";
5758
+ "variants": [
5759
+ {
5760
+ "name": "smallNetworkEntryPercent";
5761
+ },
5762
+ {
5763
+ "name": "smallNetworkExitPercent";
5764
+ },
5765
+ {
5766
+ "name": "mediumNetworkEntryPercent";
5767
+ },
5768
+ {
5769
+ "name": "mediumNetworkExitPercent";
5770
+ }
5771
+ ];
5772
+ };
5773
+ },
5396
5774
  {
5397
5775
  "name": "distributionState";
5398
5776
  "type": {
@@ -5531,6 +5909,213 @@ type LiqsolCore = {
5531
5909
  ];
5532
5910
  };
5533
5911
  },
5912
+ {
5913
+ "name": "globalConfig";
5914
+ "docs": [
5915
+ "Zero-copy global config PDA",
5916
+ "Authority is taken from StakeControllerState, not stored here"
5917
+ ];
5918
+ "serialization": "bytemuckunsafe";
5919
+ "repr": {
5920
+ "kind": "c";
5921
+ };
5922
+ "type": {
5923
+ "kind": "struct";
5924
+ "fields": [
5925
+ {
5926
+ "name": "bump";
5927
+ "type": "u8";
5928
+ },
5929
+ {
5930
+ "name": "padding";
5931
+ "type": {
5932
+ "array": [
5933
+ "u8",
5934
+ 7
5935
+ ];
5936
+ };
5937
+ },
5938
+ {
5939
+ "name": "minUserDeposit";
5940
+ "docs": [
5941
+ "Minimum SOL amount a user can deposit"
5942
+ ];
5943
+ "type": "u64";
5944
+ },
5945
+ {
5946
+ "name": "minUnstakeRequest";
5947
+ "docs": [
5948
+ "Minimum SOL amount for an unstake/withdrawal request"
5949
+ ];
5950
+ "type": "u64";
5951
+ },
5952
+ {
5953
+ "name": "minRebalanceStakeDelta";
5954
+ "docs": [
5955
+ "Minimum stake delta to trigger a stake rebalance order"
5956
+ ];
5957
+ "type": "u64";
5958
+ },
5959
+ {
5960
+ "name": "minRebalanceUnstakeDelta";
5961
+ "docs": [
5962
+ "Minimum unstake delta to trigger an unstake rebalance order"
5963
+ ];
5964
+ "type": "u64";
5965
+ },
5966
+ {
5967
+ "name": "transientThreshold";
5968
+ "docs": [
5969
+ "Minimum transient stake to include in effective stake calculations"
5970
+ ];
5971
+ "type": "u64";
5972
+ },
5973
+ {
5974
+ "name": "minLateEpochSlotGate";
5975
+ "docs": [
5976
+ "Minimum slots that must have elapsed in the epoch before late epoch operations can execute"
5977
+ ];
5978
+ "type": "u64";
5979
+ },
5980
+ {
5981
+ "name": "reservedU64";
5982
+ "type": {
5983
+ "array": [
5984
+ "u64",
5985
+ 2
5986
+ ];
5987
+ };
5988
+ },
5989
+ {
5990
+ "name": "cooldownEpochs";
5991
+ "docs": [
5992
+ "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change"
5993
+ ];
5994
+ "type": "u16";
5995
+ },
5996
+ {
5997
+ "name": "depositFeeMultiplier";
5998
+ "docs": [
5999
+ "Multiplier for deposit fee calculation, this would be average \"pay rate x number of epochs we expect the stake to warm up\""
6000
+ ];
6001
+ "type": "u16";
6002
+ },
6003
+ {
6004
+ "name": "minVppEntry";
6005
+ "docs": [
6006
+ "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small"
6007
+ ];
6008
+ "type": "u16";
6009
+ },
6010
+ {
6011
+ "name": "minVppExit";
6012
+ "docs": [
6013
+ "VPP score threshold below which a validator is removed from active set, again a fall back"
6014
+ ];
6015
+ "type": "u16";
6016
+ },
6017
+ {
6018
+ "name": "tinyNetworkThreshold";
6019
+ "docs": [
6020
+ "Max validators for \"tiny\" network band (uses fixed VPP thresholds) as above"
6021
+ ];
6022
+ "type": "u16";
6023
+ },
6024
+ {
6025
+ "name": "smallNetworkThreshold";
6026
+ "docs": [
6027
+ "Max validators for \"small\" network band (uses percentile-based selection)"
6028
+ ];
6029
+ "type": "u16";
6030
+ },
6031
+ {
6032
+ "name": "mediumNetworkThreshold";
6033
+ "docs": [
6034
+ "Max validators for \"medium\" network band (uses percentile-based selection)"
6035
+ ];
6036
+ "type": "u16";
6037
+ },
6038
+ {
6039
+ "name": "largeNetworkEntryRank";
6040
+ "docs": [
6041
+ "Fixed rank threshold to enter active set in large networks (0-indexed)"
6042
+ ];
6043
+ "type": "u16";
6044
+ },
6045
+ {
6046
+ "name": "largeNetworkExitRank";
6047
+ "docs": [
6048
+ "Fixed rank threshold to exit active set in large networks (0-indexed)"
6049
+ ];
6050
+ "type": "u16";
6051
+ },
6052
+ {
6053
+ "name": "reservedU16";
6054
+ "type": {
6055
+ "array": [
6056
+ "u16",
6057
+ 3
6058
+ ];
6059
+ };
6060
+ },
6061
+ {
6062
+ "name": "smallNetworkEntryPercent";
6063
+ "docs": [
6064
+ "Percentile rank required to enter active set in small networks"
6065
+ ];
6066
+ "type": "u8";
6067
+ },
6068
+ {
6069
+ "name": "smallNetworkExitPercent";
6070
+ "docs": [
6071
+ "Percentile rank below which validators exit in small networks"
6072
+ ];
6073
+ "type": "u8";
6074
+ },
6075
+ {
6076
+ "name": "mediumNetworkEntryPercent";
6077
+ "docs": [
6078
+ "Percentile rank required to enter active set in medium networks"
6079
+ ];
6080
+ "type": "u8";
6081
+ },
6082
+ {
6083
+ "name": "mediumNetworkExitPercent";
6084
+ "docs": [
6085
+ "Percentile rank below which validators exit in medium networks"
6086
+ ];
6087
+ "type": "u8";
6088
+ },
6089
+ {
6090
+ "name": "reservedU8";
6091
+ "type": {
6092
+ "array": [
6093
+ "u8",
6094
+ 2
6095
+ ];
6096
+ };
6097
+ },
6098
+ {
6099
+ "name": "featureFlags";
6100
+ "docs": [
6101
+ "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,",
6102
+ "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,",
6103
+ "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved"
6104
+ ];
6105
+ "type": "u16";
6106
+ },
6107
+ {
6108
+ "name": "reservedFlags";
6109
+ "type": {
6110
+ "array": [
6111
+ "u16",
6112
+ 1
6113
+ ];
6114
+ };
6115
+ }
6116
+ ];
6117
+ };
6118
+ },
5534
6119
  {
5535
6120
  "name": "globalState";
5536
6121
  "type": {
@@ -5797,6 +6382,10 @@ type LiqsolCore = {
5797
6382
  "name": "lastValidatorScoreSyncEpoch";
5798
6383
  "type": "u16";
5799
6384
  },
6385
+ {
6386
+ "name": "lastLeaderboardScoresSyncEpoch";
6387
+ "type": "u16";
6388
+ },
5800
6389
  {
5801
6390
  "name": "lastActiveInfosSyncedEpoch";
5802
6391
  "type": "u16";
@@ -6086,7 +6675,7 @@ type LiqsolCore = {
6086
6675
  },
6087
6676
  {
6088
6677
  "name": "pretokensPurchased";
6089
- "type": "i128";
6678
+ "type": "u64";
6090
6679
  }
6091
6680
  ];
6092
6681
  };
@@ -6114,7 +6703,7 @@ type LiqsolCore = {
6114
6703
  ];
6115
6704
  "type": {
6116
6705
  "array": [
6117
- "i128",
6706
+ "u64",
6118
6707
  10
6119
6708
  ];
6120
6709
  };
@@ -6290,6 +6879,30 @@ type LiqsolCore = {
6290
6879
  ];
6291
6880
  "type": "u64";
6292
6881
  },
6882
+ {
6883
+ "name": "isSmallDistributionMode";
6884
+ "docs": [
6885
+ "Whether we're in small distribution mode (not enough for VPP-based distribution)",
6886
+ "In this mode, we distribute evenly to first N validators instead of using VPP ratios"
6887
+ ];
6888
+ "type": "bool";
6889
+ },
6890
+ {
6891
+ "name": "validatorsToFundThisRebalance";
6892
+ "docs": [
6893
+ "Number of validators to fund in small distribution mode",
6894
+ "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)"
6895
+ ];
6896
+ "type": "u16";
6897
+ },
6898
+ {
6899
+ "name": "amountPerValidatorThisRebalance";
6900
+ "docs": [
6901
+ "Amount each validator gets in small distribution mode",
6902
+ "Calculated as total_to_distribute / validators_to_fund"
6903
+ ];
6904
+ "type": "u64";
6905
+ },
6293
6906
  {
6294
6907
  "name": "selectionEntryThresholdVpp";
6295
6908
  "docs": [
@@ -6466,8 +7079,7 @@ type LiqsolCore = {
6466
7079
  {
6467
7080
  "name": "trancheState";
6468
7081
  "docs": [
6469
- "All i128 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)",
6470
- "This matches Chainlink SOL/USD's native format, avoiding conversion overhead",
7082
+ "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)",
6471
7083
  "Example: $193.32 is stored as 19332000000"
6472
7084
  ];
6473
7085
  "type": {
@@ -6486,19 +7098,19 @@ type LiqsolCore = {
6486
7098
  },
6487
7099
  {
6488
7100
  "name": "currentTrancheSupply";
6489
- "type": "i128";
7101
+ "type": "u64";
6490
7102
  },
6491
7103
  {
6492
7104
  "name": "currentTranchePriceUsd";
6493
- "type": "i128";
7105
+ "type": "u64";
6494
7106
  },
6495
7107
  {
6496
7108
  "name": "totalPretokensSold";
6497
- "type": "i128";
7109
+ "type": "u64";
6498
7110
  },
6499
7111
  {
6500
7112
  "name": "initialTrancheSupply";
6501
- "type": "i128";
7113
+ "type": "u64";
6502
7114
  },
6503
7115
  {
6504
7116
  "name": "supplyGrowthBps";
@@ -6519,14 +7131,14 @@ type LiqsolCore = {
6519
7131
  "docs": [
6520
7132
  "Minimum valid SOL/USD price for validation (8-dec)"
6521
7133
  ];
6522
- "type": "i128";
7134
+ "type": "u64";
6523
7135
  },
6524
7136
  {
6525
7137
  "name": "maxPriceUsd";
6526
7138
  "docs": [
6527
7139
  "Maximum valid SOL/USD price for validation (8-dec)"
6528
7140
  ];
6529
- "type": "i128";
7141
+ "type": "u64";
6530
7142
  },
6531
7143
  {
6532
7144
  "name": "maxStalenessSeconds";
@@ -6571,7 +7183,7 @@ type LiqsolCore = {
6571
7183
  },
6572
7184
  {
6573
7185
  "name": "totalPretokensPurchased";
6574
- "type": "i128";
7186
+ "type": "u64";
6575
7187
  },
6576
7188
  {
6577
7189
  "name": "lastTrancheNumber";
@@ -6579,7 +7191,7 @@ type LiqsolCore = {
6579
7191
  },
6580
7192
  {
6581
7193
  "name": "lastTranchePriceUsd";
6582
- "type": "i128";
7194
+ "type": "u64";
6583
7195
  },
6584
7196
  {
6585
7197
  "name": "bump";
@@ -7516,6 +8128,7 @@ declare const TRANSFER_HOOK: PublicKey$1;
7516
8128
  * ---------------------------------------------------------------------------
7517
8129
  */
7518
8130
  declare const PDA_SEEDS: {
8131
+ readonly GLOBAL_CONFIG: "global_config";
7519
8132
  readonly DEPOSIT_AUTHORITY: "deposit_authority";
7520
8133
  readonly VAULT: "vault";
7521
8134
  readonly RESERVE_POOL: "reserve_pool";
@@ -7549,6 +8162,7 @@ declare const PDA_SEEDS: {
7549
8162
  readonly LIQ_RECEIPT_DATA: "liq_receipt_data";
7550
8163
  readonly WITHDRAW_MINT: "mint";
7551
8164
  };
8165
+ declare const deriveGlobalConfigPda: () => PublicKey$1;
7552
8166
  /**
7553
8167
  * ---------------------------------------------------------------------------
7554
8168
  * CORE / DISTRIBUTION / DEPOSIT PDAS
@@ -7640,5 +8254,5 @@ declare const INDEX_SCALE: bigint;
7640
8254
  declare const lamportsToSol: (lamports: number | bigint) => number;
7641
8255
  declare const solToLamports: (sol: number) => bigint;
7642
8256
 
7643
- export { ADDRESSES, CHAINLINK_FEED, CHAINLINK_PROGRAM, CONTRACTS, DEFAULT_AVERAGE_PAY_RATE, DEFAULT_PAY_RATE_LOOKBACK, DepositClient, DistributionClient, EPHEMERAL_RENT_EXEMPTION, ERC1155Abi, ERC20Abi, ERC721Abi, types$1 as ETH, EthereumContractService, EthereumStakingClient, INDEX_SCALE, LAMPORTS_PER_SOL, LIQSOL_CORE, LIQSOL_TOKEN, LeaderboardClient, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS, PurchaseAsset, ReceiptNFTKind, types as SOL, SolanaStakingClient, Staker, TRANSFER_HOOK, TokenClient, VALIDATOR_LEADERBOARD, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, calculateExpectedFee, deriveBarConfigPda, deriveBondLevelPda, deriveBondedActorPda, deriveBucketAuthorityPda, deriveDepositAuthorityPda, deriveDistributionStatePda, deriveEphemeralStakeAddress, deriveExtraAccountMetaListPda, deriveLeaderboardStatePda, deriveLiqReceiptDataPda, deriveLiqsolMintAuthorityPda, deriveLiqsolMintPda, deriveMaintenanceLedgerPda, deriveOutpostAccountPda, deriveOutpostGlobalStatePda, deriveOutpostPoolAuthorityPda, derivePayRateHistoryPda, derivePayoutStatePda, derivePriceHistoryPda, deriveReservePoolPda, deriveStakeAllocationStatePda, deriveStakeControllerStatePda, deriveStakeControllerVaultPda, deriveStakeMetricsPda, deriveTrancheStatePda, deriveUserPretokenRecordPda, deriveUserRecordPda, deriveValidatorRecordPda, deriveVaultPda, deriveWithdrawGlobalPda, deriveWithdrawMintAuthorityPda, deriveWithdrawMintMetadataPda, deriveWithdrawNftMintPda, generateRandomDepositAmount, generateTestKeypair, getAveragePayRate, getBucketLiqSolBalance, getEpochSnapshot, getErrorMessage, getLiqsolCoreProgram, getPayoutStateRaw, getReservePoolBalance, getStakeControllerStateRaw, getUserLiqSolBalance, getUserRecordRaw, lamportsToSol, msToEpochEnd, previewDepositEffects, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
8257
+ export { ADDRESSES, CHAINLINK_FEED, CHAINLINK_PROGRAM, CONTRACTS, DEFAULT_AVERAGE_PAY_RATE, DEFAULT_PAY_RATE_LOOKBACK, DepositClient, DistributionClient, EPHEMERAL_RENT_EXEMPTION, ERC1155Abi, ERC20Abi, ERC721Abi, types$1 as ETH, EthereumContractService, EthereumStakingClient, INDEX_SCALE, LAMPORTS_PER_SOL, LIQSOL_CORE, LIQSOL_TOKEN, LeaderboardClient, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS, PurchaseAsset, ReceiptNFTKind, types as SOL, SolanaStakingClient, Staker, TRANSFER_HOOK, TokenClient, VALIDATOR_LEADERBOARD, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, calculateExpectedFee, deriveBarConfigPda, deriveBondLevelPda, deriveBondedActorPda, deriveBucketAuthorityPda, deriveDepositAuthorityPda, deriveDistributionStatePda, deriveEphemeralStakeAddress, deriveExtraAccountMetaListPda, deriveGlobalConfigPda, deriveLeaderboardStatePda, deriveLiqReceiptDataPda, deriveLiqsolMintAuthorityPda, deriveLiqsolMintPda, deriveMaintenanceLedgerPda, deriveOutpostAccountPda, deriveOutpostGlobalStatePda, deriveOutpostPoolAuthorityPda, derivePayRateHistoryPda, derivePayoutStatePda, derivePriceHistoryPda, deriveReservePoolPda, deriveStakeAllocationStatePda, deriveStakeControllerStatePda, deriveStakeControllerVaultPda, deriveStakeMetricsPda, deriveTrancheStatePda, deriveUserPretokenRecordPda, deriveUserRecordPda, deriveValidatorRecordPda, deriveVaultPda, deriveWithdrawGlobalPda, deriveWithdrawMintAuthorityPda, deriveWithdrawMintMetadataPda, deriveWithdrawNftMintPda, generateRandomDepositAmount, generateTestKeypair, getAveragePayRate, getBucketLiqSolBalance, getEpochSnapshot, getErrorMessage, getLiqsolCoreProgram, getPayoutStateRaw, getReservePoolBalance, getStakeControllerStateRaw, getUserLiqSolBalance, getUserRecordRaw, lamportsToSol, msToEpochEnd, previewDepositEffects, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
7644
8258
  export type { BalanceView, ContractConfig, ContractOptions, Contracts, EpochSnapshot, IStakingClient, OPPAssertion, OutpostAccounts, Portfolio, PurchaseQuote, ScheduleConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot, YieldView };