@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.js CHANGED
@@ -6,7 +6,7 @@ var anchor = require('@coral-xyz/anchor');
6
6
  var splToken = require('@solana/spl-token');
7
7
  var ethers = require('ethers');
8
8
 
9
- var address$3 = "2qSsCXBYUSwF7zrzTT9jFpRpCmWoDpEyHr9exfCMq56P";
9
+ var address$3 = "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH";
10
10
  var metadata$3 = {
11
11
  name: "liqsol_core",
12
12
  version: "0.1.0",
@@ -20,7 +20,8 @@ var instructions$3 = [
20
20
  "Accumulate unstake requests to be processed in next allocation cycle",
21
21
  "Multiple requests can be accumulated before calculating allocations",
22
22
  "Returns the target epoch when this unstake request will be processed",
23
- "We should not be able to"
23
+ "We should not be able to call this without development feature enabled",
24
+ ""
24
25
  ],
25
26
  discriminator: [
26
27
  24,
@@ -57,6 +58,12 @@ var instructions$3 = [
57
58
  "Maintenance ledger - to determine target processing epoch"
58
59
  ]
59
60
  },
61
+ {
62
+ name: "global_config",
63
+ docs: [
64
+ "Global config for min_unstake_request setting"
65
+ ]
66
+ },
60
67
  {
61
68
  name: "clock"
62
69
  }
@@ -108,6 +115,12 @@ var instructions$3 = [
108
115
  name: "processing_state",
109
116
  writable: true
110
117
  },
118
+ {
119
+ name: "global_config",
120
+ docs: [
121
+ "Global config for threshold parameters"
122
+ ]
123
+ },
111
124
  {
112
125
  name: "authority",
113
126
  signer: true
@@ -184,44 +197,6 @@ var instructions$3 = [
184
197
  }
185
198
  ]
186
199
  },
187
- {
188
- name: "advance_serviceability",
189
- docs: [
190
- "Advance the max servicable receipt ID"
191
- ],
192
- discriminator: [
193
- 139,
194
- 89,
195
- 79,
196
- 2,
197
- 90,
198
- 211,
199
- 173,
200
- 240
201
- ],
202
- accounts: [
203
- {
204
- name: "authority",
205
- docs: [
206
- "Authority that can update serviceable epoch"
207
- ],
208
- signer: true
209
- },
210
- {
211
- name: "global",
212
- writable: true
213
- },
214
- {
215
- name: "runtime_program"
216
- }
217
- ],
218
- args: [
219
- {
220
- name: "resolved_epoch",
221
- type: "u64"
222
- }
223
- ]
224
- },
225
200
  {
226
201
  name: "aggregate_stake_metrics",
227
202
  docs: [
@@ -383,6 +358,12 @@ var instructions$3 = [
383
358
  "Maintenance ledger - to track last unstake allocation epoch"
384
359
  ],
385
360
  writable: true
361
+ },
362
+ {
363
+ name: "global_config",
364
+ docs: [
365
+ "Global config for late epoch slot gate"
366
+ ]
386
367
  }
387
368
  ],
388
369
  args: [
@@ -447,6 +428,12 @@ var instructions$3 = [
447
428
  docs: [
448
429
  "Global withdraw operator state - to read total_encumbered_funds"
449
430
  ]
431
+ },
432
+ {
433
+ name: "global_config",
434
+ docs: [
435
+ "Global config for rebalancing thresholds"
436
+ ]
450
437
  }
451
438
  ],
452
439
  args: [
@@ -571,6 +558,12 @@ var instructions$3 = [
571
558
  {
572
559
  name: "stake_history"
573
560
  },
561
+ {
562
+ name: "global_config",
563
+ docs: [
564
+ "Global config for claim_withdrawals_enabled check"
565
+ ]
566
+ },
574
567
  {
575
568
  name: "token_program"
576
569
  },
@@ -623,6 +616,12 @@ var instructions$3 = [
623
616
  "Stake controller state - used to verify authority"
624
617
  ]
625
618
  },
619
+ {
620
+ name: "global_config",
621
+ docs: [
622
+ "Global config for cooldown_epochs"
623
+ ]
624
+ },
626
625
  {
627
626
  name: "clock"
628
627
  },
@@ -962,6 +961,12 @@ var instructions$3 = [
962
961
  name: "controller_state",
963
962
  writable: true
964
963
  },
964
+ {
965
+ name: "global_config",
966
+ docs: [
967
+ "Global config for deposit settings"
968
+ ]
969
+ },
965
970
  {
966
971
  name: "payout_state",
967
972
  writable: true
@@ -1098,47 +1103,6 @@ var instructions$3 = [
1098
1103
  }
1099
1104
  ]
1100
1105
  },
1101
- {
1102
- name: "force_validator_unstake",
1103
- docs: [
1104
- "A function you can call to directly influence the amount to unstake from a particular validator",
1105
- "Tbh this is a bypass of the system and should not be called unless you know what you are doing"
1106
- ],
1107
- discriminator: [
1108
- 7,
1109
- 208,
1110
- 146,
1111
- 241,
1112
- 10,
1113
- 219,
1114
- 109,
1115
- 30
1116
- ],
1117
- accounts: [
1118
- {
1119
- name: "admin",
1120
- writable: true,
1121
- signer: true
1122
- },
1123
- {
1124
- name: "validator_info",
1125
- docs: [
1126
- "Validator info account to update"
1127
- ],
1128
- writable: true
1129
- }
1130
- ],
1131
- args: [
1132
- {
1133
- name: "vote_account",
1134
- type: "pubkey"
1135
- },
1136
- {
1137
- name: "amount",
1138
- type: "u64"
1139
- }
1140
- ]
1141
- },
1142
1106
  {
1143
1107
  name: "get_min_max_resolved_epoch_deactivations",
1144
1108
  docs: [
@@ -1384,6 +1348,38 @@ var instructions$3 = [
1384
1348
  args: [
1385
1349
  ]
1386
1350
  },
1351
+ {
1352
+ name: "initialize_global_config",
1353
+ discriminator: [
1354
+ 113,
1355
+ 216,
1356
+ 122,
1357
+ 131,
1358
+ 225,
1359
+ 209,
1360
+ 22,
1361
+ 55
1362
+ ],
1363
+ accounts: [
1364
+ {
1365
+ name: "global_config",
1366
+ writable: true
1367
+ },
1368
+ {
1369
+ name: "controller_state"
1370
+ },
1371
+ {
1372
+ name: "payer",
1373
+ writable: true,
1374
+ signer: true
1375
+ },
1376
+ {
1377
+ name: "system_program"
1378
+ }
1379
+ ],
1380
+ args: [
1381
+ ]
1382
+ },
1387
1383
  {
1388
1384
  name: "initialize_graveyard_list",
1389
1385
  docs: [
@@ -1914,6 +1910,10 @@ var instructions$3 = [
1914
1910
  ],
1915
1911
  writable: true
1916
1912
  },
1913
+ {
1914
+ name: "withdraw_global",
1915
+ writable: true
1916
+ },
1917
1917
  {
1918
1918
  name: "stake_program"
1919
1919
  },
@@ -1978,6 +1978,12 @@ var instructions$3 = [
1978
1978
  name: "processing_state",
1979
1979
  writable: true
1980
1980
  },
1981
+ {
1982
+ name: "global_config",
1983
+ docs: [
1984
+ "Global config for late epoch slot gate"
1985
+ ]
1986
+ },
1981
1987
  {
1982
1988
  name: "clock"
1983
1989
  },
@@ -2052,6 +2058,12 @@ var instructions$3 = [
2052
2058
  },
2053
2059
  {
2054
2060
  name: "instructions"
2061
+ },
2062
+ {
2063
+ name: "global_config",
2064
+ docs: [
2065
+ "Global config for process_pay_cycle_enabled check"
2066
+ ]
2055
2067
  }
2056
2068
  ],
2057
2069
  args: [
@@ -2124,6 +2136,12 @@ var instructions$3 = [
2124
2136
  },
2125
2137
  {
2126
2138
  name: "rent"
2139
+ },
2140
+ {
2141
+ name: "global_config",
2142
+ docs: [
2143
+ "Global config for process_stake_orders_enabled check"
2144
+ ]
2127
2145
  }
2128
2146
  ],
2129
2147
  args: [
@@ -2233,6 +2251,12 @@ var instructions$3 = [
2233
2251
  },
2234
2252
  {
2235
2253
  name: "stake_program"
2254
+ },
2255
+ {
2256
+ name: "global_config",
2257
+ docs: [
2258
+ "Global config for process_unstake_orders_enabled check"
2259
+ ]
2236
2260
  }
2237
2261
  ],
2238
2262
  args: [
@@ -2510,6 +2534,12 @@ var instructions$3 = [
2510
2534
  },
2511
2535
  {
2512
2536
  name: "active_list"
2537
+ },
2538
+ {
2539
+ name: "global_config",
2540
+ docs: [
2541
+ "Global config for late epoch slot gate"
2542
+ ]
2513
2543
  }
2514
2544
  ],
2515
2545
  args: [
@@ -2551,6 +2581,12 @@ var instructions$3 = [
2551
2581
  },
2552
2582
  {
2553
2583
  name: "active_list"
2584
+ },
2585
+ {
2586
+ name: "global_config",
2587
+ docs: [
2588
+ "Global config for late epoch slot gate"
2589
+ ]
2554
2590
  }
2555
2591
  ],
2556
2592
  args: [
@@ -2645,6 +2681,12 @@ var instructions$3 = [
2645
2681
  {
2646
2682
  name: "allocation_state"
2647
2683
  },
2684
+ {
2685
+ name: "global_config",
2686
+ docs: [
2687
+ "Global config for late epoch slot gate"
2688
+ ]
2689
+ },
2648
2690
  {
2649
2691
  name: "authority",
2650
2692
  signer: true
@@ -2776,6 +2818,12 @@ var instructions$3 = [
2776
2818
  "Maintenance ledger - for accumulate_unstake_request"
2777
2819
  ]
2778
2820
  },
2821
+ {
2822
+ name: "global_config",
2823
+ docs: [
2824
+ "Global config for min_unstake_request setting"
2825
+ ]
2826
+ },
2779
2827
  {
2780
2828
  name: "clock"
2781
2829
  },
@@ -3157,6 +3205,12 @@ var instructions$3 = [
3157
3205
  name: "allocation_state",
3158
3206
  writable: true
3159
3207
  },
3208
+ {
3209
+ name: "global_config",
3210
+ docs: [
3211
+ "Global config for late epoch slot gate"
3212
+ ]
3213
+ },
3160
3214
  {
3161
3215
  name: "system_program",
3162
3216
  docs: [
@@ -3225,6 +3279,12 @@ var instructions$3 = [
3225
3279
  name: "maintenance_ledger",
3226
3280
  writable: true
3227
3281
  },
3282
+ {
3283
+ name: "global_config",
3284
+ docs: [
3285
+ "Global config for late epoch slot gate"
3286
+ ]
3287
+ },
3228
3288
  {
3229
3289
  name: "authority",
3230
3290
  signer: true
@@ -3234,37 +3294,32 @@ var instructions$3 = [
3234
3294
  ]
3235
3295
  },
3236
3296
  {
3237
- name: "sync_distribution_index",
3297
+ name: "sync_leaderboard_scores_batch",
3238
3298
  discriminator: [
3239
- 82,
3240
- 159,
3241
- 232,
3242
- 125,
3243
- 12,
3244
- 29,
3245
- 9,
3246
- 226
3299
+ 52,
3300
+ 11,
3301
+ 210,
3302
+ 173,
3303
+ 90,
3304
+ 5,
3305
+ 48,
3306
+ 50
3247
3307
  ],
3248
3308
  accounts: [
3249
3309
  {
3250
- name: "authority",
3251
- docs: [
3252
- "Admin or crank that triggers the index sync"
3253
- ],
3254
- signer: true
3310
+ name: "leaderboard_state"
3255
3311
  },
3256
3312
  {
3257
- name: "distribution_state",
3313
+ name: "processing_state",
3258
3314
  writable: true
3259
3315
  },
3260
3316
  {
3261
- name: "bucket_authority",
3262
- docs: [
3263
- "The bucket's associated token account holding liqSOL"
3264
- ]
3317
+ name: "maintenance_ledger",
3318
+ writable: true
3265
3319
  },
3266
3320
  {
3267
- name: "bucket_token_account"
3321
+ name: "authority",
3322
+ signer: true
3268
3323
  }
3269
3324
  ],
3270
3325
  args: [
@@ -3352,6 +3407,12 @@ var instructions$3 = [
3352
3407
  name: "maintenance_ledger",
3353
3408
  writable: true
3354
3409
  },
3410
+ {
3411
+ name: "global_config",
3412
+ docs: [
3413
+ "Global config for min_vpp_entry and min_vpp_exit"
3414
+ ]
3415
+ },
3355
3416
  {
3356
3417
  name: "authority",
3357
3418
  signer: true
@@ -3482,6 +3543,178 @@ var instructions$3 = [
3482
3543
  args: [
3483
3544
  ]
3484
3545
  },
3546
+ {
3547
+ name: "update_config_bool",
3548
+ discriminator: [
3549
+ 79,
3550
+ 36,
3551
+ 65,
3552
+ 239,
3553
+ 188,
3554
+ 35,
3555
+ 13,
3556
+ 160
3557
+ ],
3558
+ accounts: [
3559
+ {
3560
+ name: "global_config",
3561
+ writable: true
3562
+ },
3563
+ {
3564
+ name: "controller_state"
3565
+ },
3566
+ {
3567
+ name: "authority",
3568
+ docs: [
3569
+ "Authority must match StakeControllerState.authority"
3570
+ ],
3571
+ signer: true
3572
+ }
3573
+ ],
3574
+ args: [
3575
+ {
3576
+ name: "key",
3577
+ type: {
3578
+ defined: {
3579
+ name: "ConfigKeyBool"
3580
+ }
3581
+ }
3582
+ },
3583
+ {
3584
+ name: "value",
3585
+ type: "bool"
3586
+ }
3587
+ ]
3588
+ },
3589
+ {
3590
+ name: "update_config_u16",
3591
+ discriminator: [
3592
+ 149,
3593
+ 9,
3594
+ 244,
3595
+ 25,
3596
+ 46,
3597
+ 136,
3598
+ 59,
3599
+ 173
3600
+ ],
3601
+ accounts: [
3602
+ {
3603
+ name: "global_config",
3604
+ writable: true
3605
+ },
3606
+ {
3607
+ name: "controller_state"
3608
+ },
3609
+ {
3610
+ name: "authority",
3611
+ docs: [
3612
+ "Authority must match StakeControllerState.authority"
3613
+ ],
3614
+ signer: true
3615
+ }
3616
+ ],
3617
+ args: [
3618
+ {
3619
+ name: "key",
3620
+ type: {
3621
+ defined: {
3622
+ name: "ConfigKeyU16"
3623
+ }
3624
+ }
3625
+ },
3626
+ {
3627
+ name: "value",
3628
+ type: "u16"
3629
+ }
3630
+ ]
3631
+ },
3632
+ {
3633
+ name: "update_config_u64",
3634
+ discriminator: [
3635
+ 120,
3636
+ 43,
3637
+ 124,
3638
+ 106,
3639
+ 97,
3640
+ 80,
3641
+ 208,
3642
+ 123
3643
+ ],
3644
+ accounts: [
3645
+ {
3646
+ name: "global_config",
3647
+ writable: true
3648
+ },
3649
+ {
3650
+ name: "controller_state"
3651
+ },
3652
+ {
3653
+ name: "authority",
3654
+ docs: [
3655
+ "Authority must match StakeControllerState.authority"
3656
+ ],
3657
+ signer: true
3658
+ }
3659
+ ],
3660
+ args: [
3661
+ {
3662
+ name: "key",
3663
+ type: {
3664
+ defined: {
3665
+ name: "ConfigKeyU64"
3666
+ }
3667
+ }
3668
+ },
3669
+ {
3670
+ name: "value",
3671
+ type: "u64"
3672
+ }
3673
+ ]
3674
+ },
3675
+ {
3676
+ name: "update_config_u8",
3677
+ discriminator: [
3678
+ 17,
3679
+ 160,
3680
+ 31,
3681
+ 134,
3682
+ 222,
3683
+ 250,
3684
+ 229,
3685
+ 253
3686
+ ],
3687
+ accounts: [
3688
+ {
3689
+ name: "global_config",
3690
+ writable: true
3691
+ },
3692
+ {
3693
+ name: "controller_state"
3694
+ },
3695
+ {
3696
+ name: "authority",
3697
+ docs: [
3698
+ "Authority must match StakeControllerState.authority"
3699
+ ],
3700
+ signer: true
3701
+ }
3702
+ ],
3703
+ args: [
3704
+ {
3705
+ name: "key",
3706
+ type: {
3707
+ defined: {
3708
+ name: "ConfigKeyU8"
3709
+ }
3710
+ }
3711
+ },
3712
+ {
3713
+ name: "value",
3714
+ type: "u8"
3715
+ }
3716
+ ]
3717
+ },
3485
3718
  {
3486
3719
  name: "update_growth_parameters",
3487
3720
  discriminator: [
@@ -3556,11 +3789,11 @@ var instructions$3 = [
3556
3789
  args: [
3557
3790
  {
3558
3791
  name: "min_price_usd",
3559
- type: "i128"
3792
+ type: "u64"
3560
3793
  },
3561
3794
  {
3562
3795
  name: "max_price_usd",
3563
- type: "i128"
3796
+ type: "u64"
3564
3797
  },
3565
3798
  {
3566
3799
  name: "max_staleness_seconds",
@@ -3609,6 +3842,19 @@ var accounts$2 = [
3609
3842
  127
3610
3843
  ]
3611
3844
  },
3845
+ {
3846
+ name: "GlobalConfig",
3847
+ discriminator: [
3848
+ 149,
3849
+ 8,
3850
+ 156,
3851
+ 202,
3852
+ 160,
3853
+ 252,
3854
+ 176,
3855
+ 217
3856
+ ]
3857
+ },
3612
3858
  {
3613
3859
  name: "GlobalState",
3614
3860
  discriminator: [
@@ -4171,48 +4417,179 @@ var types$5 = [
4171
4417
  type: "u16"
4172
4418
  },
4173
4419
  {
4174
- name: "removal_next_index",
4175
- docs: [
4176
- "Next index in active list to check for removal"
4177
- ],
4178
- type: "u16"
4420
+ name: "leaderboard_scores_next_index",
4421
+ docs: [
4422
+ "Next leaderboard registry index to process for score sync"
4423
+ ],
4424
+ type: "u16"
4425
+ },
4426
+ {
4427
+ name: "removal_next_index",
4428
+ docs: [
4429
+ "Next index in active list to check for removal"
4430
+ ],
4431
+ type: "u16"
4432
+ },
4433
+ {
4434
+ name: "addition_next_rank",
4435
+ docs: [
4436
+ "Next rank in leaderboard to check for addition"
4437
+ ],
4438
+ type: "u16"
4439
+ },
4440
+ {
4441
+ name: "addition_target_rank",
4442
+ docs: [
4443
+ "Target (inclusive) leaderboard rank to process up to"
4444
+ ],
4445
+ type: "u16"
4446
+ },
4447
+ {
4448
+ name: "graveyard_next_index",
4449
+ docs: [
4450
+ "Next index in graveyard list to process"
4451
+ ],
4452
+ type: "u16"
4453
+ },
4454
+ {
4455
+ name: "graveyard_cleanup_next_index",
4456
+ docs: [
4457
+ "Next index in graveyard list to check for cleanup"
4458
+ ],
4459
+ type: "u16"
4460
+ },
4461
+ {
4462
+ name: "_reserved",
4463
+ type: {
4464
+ array: [
4465
+ "u8",
4466
+ 32
4467
+ ]
4468
+ }
4469
+ }
4470
+ ]
4471
+ }
4472
+ },
4473
+ {
4474
+ name: "ConfigKeyBool",
4475
+ docs: [
4476
+ "Keys for bool config values (feature flags) - stored as bits in a u16",
4477
+ "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,",
4478
+ "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved"
4479
+ ],
4480
+ type: {
4481
+ kind: "enum",
4482
+ variants: [
4483
+ {
4484
+ name: "DepositsEnabled"
4485
+ },
4486
+ {
4487
+ name: "WithdrawalsEnabled"
4488
+ },
4489
+ {
4490
+ name: "ClaimWithdrawalsEnabled"
4491
+ },
4492
+ {
4493
+ name: "ProcessStakeOrdersEnabled"
4494
+ },
4495
+ {
4496
+ name: "ProcessUnstakeOrdersEnabled"
4497
+ },
4498
+ {
4499
+ name: "ProcessPayCycleEnabled"
4500
+ },
4501
+ {
4502
+ name: "RebalancingEnabled"
4503
+ }
4504
+ ]
4505
+ }
4506
+ },
4507
+ {
4508
+ name: "ConfigKeyU16",
4509
+ docs: [
4510
+ "Keys for u16 config values (small counts, thresholds, ranks)"
4511
+ ],
4512
+ type: {
4513
+ kind: "enum",
4514
+ variants: [
4515
+ {
4516
+ name: "CooldownEpochs"
4517
+ },
4518
+ {
4519
+ name: "DepositFeeEpochsMultiplier"
4520
+ },
4521
+ {
4522
+ name: "MinVppEntry"
4523
+ },
4524
+ {
4525
+ name: "MinVppExit"
4526
+ },
4527
+ {
4528
+ name: "TinyNetworkThreshold"
4529
+ },
4530
+ {
4531
+ name: "SmallNetworkThreshold"
4532
+ },
4533
+ {
4534
+ name: "MediumNetworkThreshold"
4535
+ },
4536
+ {
4537
+ name: "LargeNetworkEntryRank"
4538
+ },
4539
+ {
4540
+ name: "LargeNetworkExitRank"
4541
+ }
4542
+ ]
4543
+ }
4544
+ },
4545
+ {
4546
+ name: "ConfigKeyU64",
4547
+ docs: [
4548
+ "Keys for u64 config values (large amounts, rates)"
4549
+ ],
4550
+ type: {
4551
+ kind: "enum",
4552
+ variants: [
4553
+ {
4554
+ name: "MinUserDeposit"
4555
+ },
4556
+ {
4557
+ name: "MinUnstakeRequest"
4558
+ },
4559
+ {
4560
+ name: "MinRebalanceStakeDelta"
4179
4561
  },
4180
4562
  {
4181
- name: "addition_next_rank",
4182
- docs: [
4183
- "Next rank in leaderboard to check for addition"
4184
- ],
4185
- type: "u16"
4563
+ name: "MinRebalanceUnstakeDelta"
4186
4564
  },
4187
4565
  {
4188
- name: "addition_target_rank",
4189
- docs: [
4190
- "Target (inclusive) leaderboard rank to process up to"
4191
- ],
4192
- type: "u16"
4566
+ name: "TransientThreshold"
4193
4567
  },
4194
4568
  {
4195
- name: "graveyard_next_index",
4196
- docs: [
4197
- "Next index in graveyard list to process"
4198
- ],
4199
- type: "u16"
4569
+ name: "MinLateEpochSlotGate"
4570
+ }
4571
+ ]
4572
+ }
4573
+ },
4574
+ {
4575
+ name: "ConfigKeyU8",
4576
+ docs: [
4577
+ "Keys for u8 config values (percentages 0-100)"
4578
+ ],
4579
+ type: {
4580
+ kind: "enum",
4581
+ variants: [
4582
+ {
4583
+ name: "SmallNetworkEntryPercent"
4200
4584
  },
4201
4585
  {
4202
- name: "graveyard_cleanup_next_index",
4203
- docs: [
4204
- "Next index in graveyard list to check for cleanup"
4205
- ],
4206
- type: "u16"
4586
+ name: "SmallNetworkExitPercent"
4207
4587
  },
4208
4588
  {
4209
- name: "_reserved",
4210
- type: {
4211
- array: [
4212
- "u8",
4213
- 32
4214
- ]
4215
- }
4589
+ name: "MediumNetworkEntryPercent"
4590
+ },
4591
+ {
4592
+ name: "MediumNetworkExitPercent"
4216
4593
  }
4217
4594
  ]
4218
4595
  }
@@ -4355,6 +4732,213 @@ var types$5 = [
4355
4732
  ]
4356
4733
  }
4357
4734
  },
4735
+ {
4736
+ name: "GlobalConfig",
4737
+ docs: [
4738
+ "Zero-copy global config PDA",
4739
+ "Authority is taken from StakeControllerState, not stored here"
4740
+ ],
4741
+ serialization: "bytemuckunsafe",
4742
+ repr: {
4743
+ kind: "c"
4744
+ },
4745
+ type: {
4746
+ kind: "struct",
4747
+ fields: [
4748
+ {
4749
+ name: "bump",
4750
+ type: "u8"
4751
+ },
4752
+ {
4753
+ name: "_padding",
4754
+ type: {
4755
+ array: [
4756
+ "u8",
4757
+ 7
4758
+ ]
4759
+ }
4760
+ },
4761
+ {
4762
+ name: "min_user_deposit",
4763
+ docs: [
4764
+ "Minimum SOL amount a user can deposit"
4765
+ ],
4766
+ type: "u64"
4767
+ },
4768
+ {
4769
+ name: "min_unstake_request",
4770
+ docs: [
4771
+ "Minimum SOL amount for an unstake/withdrawal request"
4772
+ ],
4773
+ type: "u64"
4774
+ },
4775
+ {
4776
+ name: "min_rebalance_stake_delta",
4777
+ docs: [
4778
+ "Minimum stake delta to trigger a stake rebalance order"
4779
+ ],
4780
+ type: "u64"
4781
+ },
4782
+ {
4783
+ name: "min_rebalance_unstake_delta",
4784
+ docs: [
4785
+ "Minimum unstake delta to trigger an unstake rebalance order"
4786
+ ],
4787
+ type: "u64"
4788
+ },
4789
+ {
4790
+ name: "transient_threshold",
4791
+ docs: [
4792
+ "Minimum transient stake to include in effective stake calculations"
4793
+ ],
4794
+ type: "u64"
4795
+ },
4796
+ {
4797
+ name: "min_late_epoch_slot_gate",
4798
+ docs: [
4799
+ "Minimum slots that must have elapsed in the epoch before late epoch operations can execute"
4800
+ ],
4801
+ type: "u64"
4802
+ },
4803
+ {
4804
+ name: "_reserved_u64",
4805
+ type: {
4806
+ array: [
4807
+ "u64",
4808
+ 2
4809
+ ]
4810
+ }
4811
+ },
4812
+ {
4813
+ name: "cooldown_epochs",
4814
+ docs: [
4815
+ "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change"
4816
+ ],
4817
+ type: "u16"
4818
+ },
4819
+ {
4820
+ name: "deposit_fee_multiplier",
4821
+ docs: [
4822
+ "Multiplier for deposit fee calculation, this would be average \"pay rate x number of epochs we expect the stake to warm up\""
4823
+ ],
4824
+ type: "u16"
4825
+ },
4826
+ {
4827
+ name: "min_vpp_entry",
4828
+ docs: [
4829
+ "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small"
4830
+ ],
4831
+ type: "u16"
4832
+ },
4833
+ {
4834
+ name: "min_vpp_exit",
4835
+ docs: [
4836
+ "VPP score threshold below which a validator is removed from active set, again a fall back"
4837
+ ],
4838
+ type: "u16"
4839
+ },
4840
+ {
4841
+ name: "tiny_network_threshold",
4842
+ docs: [
4843
+ "Max validators for \"tiny\" network band (uses fixed VPP thresholds) as above"
4844
+ ],
4845
+ type: "u16"
4846
+ },
4847
+ {
4848
+ name: "small_network_threshold",
4849
+ docs: [
4850
+ "Max validators for \"small\" network band (uses percentile-based selection)"
4851
+ ],
4852
+ type: "u16"
4853
+ },
4854
+ {
4855
+ name: "medium_network_threshold",
4856
+ docs: [
4857
+ "Max validators for \"medium\" network band (uses percentile-based selection)"
4858
+ ],
4859
+ type: "u16"
4860
+ },
4861
+ {
4862
+ name: "large_network_entry_rank",
4863
+ docs: [
4864
+ "Fixed rank threshold to enter active set in large networks (0-indexed)"
4865
+ ],
4866
+ type: "u16"
4867
+ },
4868
+ {
4869
+ name: "large_network_exit_rank",
4870
+ docs: [
4871
+ "Fixed rank threshold to exit active set in large networks (0-indexed)"
4872
+ ],
4873
+ type: "u16"
4874
+ },
4875
+ {
4876
+ name: "_reserved_u16",
4877
+ type: {
4878
+ array: [
4879
+ "u16",
4880
+ 3
4881
+ ]
4882
+ }
4883
+ },
4884
+ {
4885
+ name: "small_network_entry_percent",
4886
+ docs: [
4887
+ "Percentile rank required to enter active set in small networks"
4888
+ ],
4889
+ type: "u8"
4890
+ },
4891
+ {
4892
+ name: "small_network_exit_percent",
4893
+ docs: [
4894
+ "Percentile rank below which validators exit in small networks"
4895
+ ],
4896
+ type: "u8"
4897
+ },
4898
+ {
4899
+ name: "medium_network_entry_percent",
4900
+ docs: [
4901
+ "Percentile rank required to enter active set in medium networks"
4902
+ ],
4903
+ type: "u8"
4904
+ },
4905
+ {
4906
+ name: "medium_network_exit_percent",
4907
+ docs: [
4908
+ "Percentile rank below which validators exit in medium networks"
4909
+ ],
4910
+ type: "u8"
4911
+ },
4912
+ {
4913
+ name: "_reserved_u8",
4914
+ type: {
4915
+ array: [
4916
+ "u8",
4917
+ 2
4918
+ ]
4919
+ }
4920
+ },
4921
+ {
4922
+ name: "feature_flags",
4923
+ docs: [
4924
+ "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,",
4925
+ "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,",
4926
+ "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved"
4927
+ ],
4928
+ type: "u16"
4929
+ },
4930
+ {
4931
+ name: "_reserved_flags",
4932
+ type: {
4933
+ array: [
4934
+ "u16",
4935
+ 1
4936
+ ]
4937
+ }
4938
+ }
4939
+ ]
4940
+ }
4941
+ },
4358
4942
  {
4359
4943
  name: "GlobalState",
4360
4944
  type: {
@@ -4621,6 +5205,10 @@ var types$5 = [
4621
5205
  name: "last_validator_score_sync_epoch",
4622
5206
  type: "u16"
4623
5207
  },
5208
+ {
5209
+ name: "last_leaderboard_scores_sync_epoch",
5210
+ type: "u16"
5211
+ },
4624
5212
  {
4625
5213
  name: "last_active_infos_synced_epoch",
4626
5214
  type: "u16"
@@ -4910,7 +5498,7 @@ var types$5 = [
4910
5498
  },
4911
5499
  {
4912
5500
  name: "pretokens_purchased",
4913
- type: "i128"
5501
+ type: "u64"
4914
5502
  }
4915
5503
  ]
4916
5504
  }
@@ -4938,7 +5526,7 @@ var types$5 = [
4938
5526
  ],
4939
5527
  type: {
4940
5528
  array: [
4941
- "i128",
5529
+ "u64",
4942
5530
  10
4943
5531
  ]
4944
5532
  }
@@ -5114,6 +5702,30 @@ var types$5 = [
5114
5702
  ],
5115
5703
  type: "u64"
5116
5704
  },
5705
+ {
5706
+ name: "is_small_distribution_mode",
5707
+ docs: [
5708
+ "Whether we're in small distribution mode (not enough for VPP-based distribution)",
5709
+ "In this mode, we distribute evenly to first N validators instead of using VPP ratios"
5710
+ ],
5711
+ type: "bool"
5712
+ },
5713
+ {
5714
+ name: "validators_to_fund_this_rebalance",
5715
+ docs: [
5716
+ "Number of validators to fund in small distribution mode",
5717
+ "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)"
5718
+ ],
5719
+ type: "u16"
5720
+ },
5721
+ {
5722
+ name: "amount_per_validator_this_rebalance",
5723
+ docs: [
5724
+ "Amount each validator gets in small distribution mode",
5725
+ "Calculated as total_to_distribute / validators_to_fund"
5726
+ ],
5727
+ type: "u64"
5728
+ },
5117
5729
  {
5118
5730
  name: "selection_entry_threshold_vpp",
5119
5731
  docs: [
@@ -5290,8 +5902,7 @@ var types$5 = [
5290
5902
  {
5291
5903
  name: "TrancheState",
5292
5904
  docs: [
5293
- "All i128 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)",
5294
- "This matches Chainlink SOL/USD's native format, avoiding conversion overhead",
5905
+ "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)",
5295
5906
  "Example: $193.32 is stored as 19332000000"
5296
5907
  ],
5297
5908
  type: {
@@ -5310,19 +5921,19 @@ var types$5 = [
5310
5921
  },
5311
5922
  {
5312
5923
  name: "current_tranche_supply",
5313
- type: "i128"
5924
+ type: "u64"
5314
5925
  },
5315
5926
  {
5316
5927
  name: "current_tranche_price_usd",
5317
- type: "i128"
5928
+ type: "u64"
5318
5929
  },
5319
5930
  {
5320
5931
  name: "total_pretokens_sold",
5321
- type: "i128"
5932
+ type: "u64"
5322
5933
  },
5323
5934
  {
5324
5935
  name: "initial_tranche_supply",
5325
- type: "i128"
5936
+ type: "u64"
5326
5937
  },
5327
5938
  {
5328
5939
  name: "supply_growth_bps",
@@ -5343,14 +5954,14 @@ var types$5 = [
5343
5954
  docs: [
5344
5955
  "Minimum valid SOL/USD price for validation (8-dec)"
5345
5956
  ],
5346
- type: "i128"
5957
+ type: "u64"
5347
5958
  },
5348
5959
  {
5349
5960
  name: "max_price_usd",
5350
5961
  docs: [
5351
5962
  "Maximum valid SOL/USD price for validation (8-dec)"
5352
5963
  ],
5353
- type: "i128"
5964
+ type: "u64"
5354
5965
  },
5355
5966
  {
5356
5967
  name: "max_staleness_seconds",
@@ -5395,7 +6006,7 @@ var types$5 = [
5395
6006
  },
5396
6007
  {
5397
6008
  name: "total_pretokens_purchased",
5398
- type: "i128"
6009
+ type: "u64"
5399
6010
  },
5400
6011
  {
5401
6012
  name: "last_tranche_number",
@@ -5403,7 +6014,7 @@ var types$5 = [
5403
6014
  },
5404
6015
  {
5405
6016
  name: "last_tranche_price_usd",
5406
- type: "i128"
6017
+ type: "u64"
5407
6018
  },
5408
6019
  {
5409
6020
  name: "bump",
@@ -5931,7 +6542,7 @@ var liqsolCoreIDL = {
5931
6542
  types: types$5
5932
6543
  };
5933
6544
 
5934
- var address$2 = "6hiJ8PrSyYLr7H9MA9VYh9fvGoHxZ2TXdDAMzjeUVSXZ";
6545
+ var address$2 = "5MRFSLCkXPEzfR6gkcZCVttq9g83mMUHyTZ85Z3TSpvU";
5935
6546
  var metadata$2 = {
5936
6547
  name: "liqsol_token",
5937
6548
  version: "0.1.0",
@@ -6120,7 +6731,7 @@ var liqsolTokenJson = {
6120
6731
  types: types$4
6121
6732
  };
6122
6733
 
6123
- var address$1 = "H6CWj2PgxCE9Z5dPi9nMrR2VxT1C4DQcqR1QjmLeon47";
6734
+ var address$1 = "5v7mWL1735qp2Th9B5WNf7spGynR5ZaxwyCYoQw13DP2";
6124
6735
  var metadata$1 = {
6125
6736
  name: "validator_leaderboard",
6126
6737
  version: "0.1.0",
@@ -6242,6 +6853,9 @@ var instructions$1 = [
6242
6853
  },
6243
6854
  {
6244
6855
  name: "system_program"
6856
+ },
6857
+ {
6858
+ name: "clock"
6245
6859
  }
6246
6860
  ],
6247
6861
  args: [
@@ -6849,7 +7463,7 @@ var validatorLeaderboardJson = {
6849
7463
  types: types$3
6850
7464
  };
6851
7465
 
6852
- var address = "EtqCLddkPNGjkgiH9rVUmK3M5X2FKFprQvgscBJ8g6hX";
7466
+ var address = "HbBpH9opFW9gcYVanHLweKuHhWQ8P3Kcc1mbpAx1vojz";
6853
7467
  var metadata = {
6854
7468
  name: "transfer_hook",
6855
7469
  version: "0.1.0",
@@ -6974,6 +7588,11 @@ var errors = [
6974
7588
  {
6975
7589
  code: 6002,
6976
7590
  name: "TlvAccountResolutionError"
7591
+ },
7592
+ {
7593
+ code: 6003,
7594
+ name: "CannotTransferToBucket",
7595
+ msg: "Cannot transfer liqSOL directly to bucket - only protocol minting is allowed"
6977
7596
  }
6978
7597
  ];
6979
7598
  var types$2 = [
@@ -7082,6 +7701,7 @@ const {
7082
7701
  TRANSFER_HOOK
7083
7702
  } = PROGRAM_IDS;
7084
7703
  const PDA_SEEDS = {
7704
+ GLOBAL_CONFIG: "global_config",
7085
7705
  DEPOSIT_AUTHORITY: "deposit_authority",
7086
7706
  VAULT: "vault",
7087
7707
  RESERVE_POOL: "reserve_pool",
@@ -7115,6 +7735,10 @@ const PDA_SEEDS = {
7115
7735
  LIQ_RECEIPT_DATA: "liq_receipt_data",
7116
7736
  WITHDRAW_MINT: "mint"
7117
7737
  };
7738
+ const deriveGlobalConfigPda = () => web3_js.PublicKey.findProgramAddressSync(
7739
+ [Buffer.from(PDA_SEEDS.GLOBAL_CONFIG)],
7740
+ LIQSOL_CORE
7741
+ )[0];
7118
7742
  const deriveLiqsolMintPda = () => web3_js.PublicKey.findProgramAddressSync(
7119
7743
  [Buffer.from(PDA_SEEDS.LIQSOL_MINT)],
7120
7744
  LIQSOL_TOKEN
@@ -7365,6 +7989,7 @@ class DepositClient {
7365
7989
  const payoutState = derivePayoutStatePda();
7366
7990
  const bucketAuthority = deriveBucketAuthorityPda();
7367
7991
  const payRateHistory = derivePayRateHistoryPda();
7992
+ const globalConfig = deriveGlobalConfigPda();
7368
7993
  const userAta = splToken.getAssociatedTokenAddressSync(
7369
7994
  liqsolMint,
7370
7995
  user,
@@ -7405,7 +8030,8 @@ class DepositClient {
7405
8030
  instructionsSysvar: web3_js.SYSVAR_INSTRUCTIONS_PUBKEY,
7406
8031
  clock: web3_js.SYSVAR_CLOCK_PUBKEY,
7407
8032
  stakeHistory: web3_js.SYSVAR_STAKE_HISTORY_PUBKEY,
7408
- rent: web3_js.SYSVAR_RENT_PUBKEY
8033
+ rent: web3_js.SYSVAR_RENT_PUBKEY,
8034
+ globalConfig
7409
8035
  }).instruction();
7410
8036
  return new web3_js.Transaction().add(ix);
7411
8037
  });
@@ -7436,6 +8062,7 @@ class DepositClient {
7436
8062
  const stakeAllocationState = deriveStakeAllocationStatePda();
7437
8063
  const stakeMetrics = deriveStakeMetricsPda();
7438
8064
  const maintenanceLedger = deriveMaintenanceLedgerPda();
8065
+ const globalConfig = deriveGlobalConfigPda();
7439
8066
  const globalState = yield this.program.account.global.fetch(global);
7440
8067
  const receiptId = globalState.nextReceiptId.toBigInt();
7441
8068
  const mintAuthority = deriveWithdrawMintAuthorityPda();
@@ -7479,7 +8106,8 @@ class DepositClient {
7479
8106
  tokenInterface: splToken.TOKEN_2022_PROGRAM_ID,
7480
8107
  associatedTokenProgram: splToken.ASSOCIATED_TOKEN_PROGRAM_ID,
7481
8108
  systemProgram: web3_js.SystemProgram.programId,
7482
- rent: web3_js.SYSVAR_RENT_PUBKEY
8109
+ rent: web3_js.SYSVAR_RENT_PUBKEY,
8110
+ globalConfig
7483
8111
  }).instruction();
7484
8112
  return new web3_js.Transaction().add(ix);
7485
8113
  });
@@ -8600,8 +9228,9 @@ class SolanaStakingClient {
8600
9228
  throw new Error("Stake amount must be greater than zero.");
8601
9229
  }
8602
9230
  const user = this.solPubKey;
9231
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8603
9232
  const ix = yield this.outpostClient.buildStakeIx(amountLamports, user);
8604
- const tx = new web3_js.Transaction().add(ix);
9233
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8605
9234
  const prepared = yield this.prepareTx(tx);
8606
9235
  const signed = yield this.signTransaction(prepared.tx);
8607
9236
  return this.sendAndConfirmHttp(signed, prepared);
@@ -8614,8 +9243,9 @@ class SolanaStakingClient {
8614
9243
  throw new Error("Unstake amount must be greater than zero.");
8615
9244
  }
8616
9245
  const user = this.solPubKey;
9246
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8617
9247
  const ix = yield this.outpostClient.buildUnstakeIx(amountLamports, user);
8618
- const tx = new web3_js.Transaction().add(ix);
9248
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8619
9249
  const prepared = yield this.prepareTx(tx);
8620
9250
  const signed = yield this.signTransaction(prepared.tx);
8621
9251
  return this.sendAndConfirmHttp(signed, prepared);
@@ -8674,12 +9304,12 @@ class SolanaStakingClient {
8674
9304
  const currentIndex = BigInt(currentIndexStr);
8675
9305
  const totalShares = BigInt(totalSharesStr);
8676
9306
  const userShares = BigInt(userSharesStr);
8677
- let estimatedClaimLiqsol = BigInt(0);
8678
- let estimatedYieldLiqsol = BigInt(0);
9307
+ let estimatedClaim = BigInt(0);
9308
+ let estimatedYield = BigInt(0);
8679
9309
  if (userShares > BigInt(0) && currentIndex > BigInt(0)) {
8680
- estimatedClaimLiqsol = userShares * currentIndex / INDEX_SCALE$1;
8681
- if (estimatedClaimLiqsol > stakedLiqsol) {
8682
- estimatedYieldLiqsol = estimatedClaimLiqsol - stakedLiqsol;
9310
+ estimatedClaim = userShares * currentIndex / INDEX_SCALE$1;
9311
+ if (estimatedClaim > stakedLiqsol) {
9312
+ estimatedYield = estimatedClaim - stakedLiqsol;
8683
9313
  }
8684
9314
  }
8685
9315
  return {
@@ -8709,8 +9339,8 @@ class SolanaStakingClient {
8709
9339
  indexScale: INDEX_SCALE$1,
8710
9340
  totalShares,
8711
9341
  userShares,
8712
- estimatedClaimLiqsol,
8713
- estimatedYieldLiqsol
9342
+ estimatedClaim,
9343
+ estimatedYield
8714
9344
  },
8715
9345
  extras: {
8716
9346
  userLiqsolAta: userLiqsolAta.toBase58(),
@@ -8735,7 +9365,7 @@ class SolanaStakingClient {
8735
9365
  return Promise.resolve(0);
8736
9366
  }
8737
9367
  getDepositFee(amount) {
8738
- return Promise.resolve(BigInt(0));
9368
+ return Promise.resolve(amount * BigInt(1) / BigInt(100));
8739
9369
  }
8740
9370
  getTrancheSnapshot(options) {
8741
9371
  return __async$8(this, null, function* () {
@@ -29735,7 +30365,28 @@ class EthereumStakingClient {
29735
30365
  for (let r of stakeReceipts) {
29736
30366
  stakeBalanceBN = stakeBalanceBN.add(ethers.BigNumber.from(r.receipt.principal.amount));
29737
30367
  }
30368
+ let stakeSharesBN = ethers.BigNumber.from(0);
30369
+ for (let r of stakeReceipts) {
30370
+ stakeSharesBN = stakeSharesBN.add(ethers.BigNumber.from(r.receipt.shares.amount));
30371
+ }
29738
30372
  const wireBalance = yield this.contract.Pretoken.balanceOf(walletAddress);
30373
+ let currentIndex = BigInt(0);
30374
+ let totalShares = BigInt(0);
30375
+ let userShares = BigInt(0);
30376
+ const indexScale = BigInt(1e27);
30377
+ try {
30378
+ const [indexBn, totalSharesBn] = yield Promise.all([
30379
+ this.contract.Depositor.index().catch(() => ethers.BigNumber.from(0)),
30380
+ this.contract.Depositor.totalShares().catch(() => ethers.BigNumber.from(0))
30381
+ ]);
30382
+ const userSharesBn = stakeSharesBN;
30383
+ currentIndex = BigInt(indexBn.toString());
30384
+ totalShares = BigInt(totalSharesBn.toString());
30385
+ userShares = BigInt(userSharesBn.toString());
30386
+ } catch (e) {
30387
+ }
30388
+ let estimatedClaim = BigInt(0);
30389
+ let estimatedYield = BigInt(0);
29739
30390
  const portfolio = {
29740
30391
  native: {
29741
30392
  amount: nativeBalance.toBigInt(),
@@ -29757,6 +30408,14 @@ class EthereumStakingClient {
29757
30408
  decimals: 18,
29758
30409
  symbol: "$WIRE"
29759
30410
  },
30411
+ yield: {
30412
+ currentIndex,
30413
+ indexScale,
30414
+ totalShares,
30415
+ userShares,
30416
+ estimatedClaim,
30417
+ estimatedYield
30418
+ },
29760
30419
  chainID: this.network.chainId
29761
30420
  };
29762
30421
  return portfolio;
@@ -29784,10 +30443,16 @@ class EthereumStakingClient {
29784
30443
  }
29785
30444
  }
29786
30445
  getSystemAPY() {
29787
- return Promise.resolve(0);
30446
+ return __async(this, null, function* () {
30447
+ const annualBpsBn = yield this.contract.DepositManager.dailyRateBPS();
30448
+ return annualBpsBn.toNumber() / 1e4;
30449
+ });
29788
30450
  }
29789
- getDepositFee(amount) {
29790
- return Promise.resolve(BigInt(0));
30451
+ getDepositFee(amountWei) {
30452
+ return __async(this, null, function* () {
30453
+ const feeBn = yield this.contract.DepositManager.procFee(amountWei);
30454
+ return BigInt(feeBn.toString());
30455
+ });
29791
30456
  }
29792
30457
  getOPPStatus() {
29793
30458
  return __async(this, null, function* () {
@@ -29994,6 +30659,7 @@ exports.deriveDepositAuthorityPda = deriveDepositAuthorityPda;
29994
30659
  exports.deriveDistributionStatePda = deriveDistributionStatePda;
29995
30660
  exports.deriveEphemeralStakeAddress = deriveEphemeralStakeAddress;
29996
30661
  exports.deriveExtraAccountMetaListPda = deriveExtraAccountMetaListPda;
30662
+ exports.deriveGlobalConfigPda = deriveGlobalConfigPda;
29997
30663
  exports.deriveLeaderboardStatePda = deriveLeaderboardStatePda;
29998
30664
  exports.deriveLiqReceiptDataPda = deriveLiqReceiptDataPda;
29999
30665
  exports.deriveLiqsolMintAuthorityPda = deriveLiqsolMintAuthorityPda;