@perena/vault-sdk 1.0.27 → 1.0.29

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/dist/index.d.ts CHANGED
@@ -4765,66 +4765,6 @@ type Bankineco = {
4765
4765
  };
4766
4766
  };
4767
4767
  },
4768
- {
4769
- "name": "feeCollector";
4770
- },
4771
- {
4772
- "name": "feeCollectorOutputAta";
4773
- "writable": true;
4774
- "pda": {
4775
- "seeds": [
4776
- {
4777
- "kind": "account";
4778
- "path": "feeCollector";
4779
- },
4780
- {
4781
- "kind": "account";
4782
- "path": "assetTokenProgram";
4783
- },
4784
- {
4785
- "kind": "account";
4786
- "path": "outputMint";
4787
- }
4788
- ];
4789
- "program": {
4790
- "kind": "const";
4791
- "value": [
4792
- 140,
4793
- 151,
4794
- 37,
4795
- 143,
4796
- 78,
4797
- 36,
4798
- 137,
4799
- 241,
4800
- 187,
4801
- 61,
4802
- 16,
4803
- 41,
4804
- 20,
4805
- 142,
4806
- 13,
4807
- 131,
4808
- 11,
4809
- 90,
4810
- 19,
4811
- 153,
4812
- 218,
4813
- 255,
4814
- 16,
4815
- 132,
4816
- 4,
4817
- 142,
4818
- 123,
4819
- 216,
4820
- 219,
4821
- 233,
4822
- 248,
4823
- 89
4824
- ];
4825
- };
4826
- };
4827
- },
4828
4768
  {
4829
4769
  "name": "queueInputAta";
4830
4770
  "writable": true;
@@ -4897,7 +4837,24 @@ type Bankineco = {
4897
4837
  "address": "11111111111111111111111111111111";
4898
4838
  }
4899
4839
  ];
4900
- "args": [];
4840
+ "args": [
4841
+ {
4842
+ "name": "externalWithdrawIxRefs";
4843
+ "type": {
4844
+ "option": {
4845
+ "defined": {
4846
+ "name": "instructionRefs";
4847
+ };
4848
+ };
4849
+ };
4850
+ },
4851
+ {
4852
+ "name": "externalLiquiditySource";
4853
+ "type": {
4854
+ "option": "u8";
4855
+ };
4856
+ }
4857
+ ];
4901
4858
  },
4902
4859
  {
4903
4860
  "name": "fulfillJuniorTrancheWithdrawFeeExempt";
@@ -5064,66 +5021,6 @@ type Bankineco = {
5064
5021
  };
5065
5022
  };
5066
5023
  },
5067
- {
5068
- "name": "feeCollector";
5069
- },
5070
- {
5071
- "name": "feeCollectorOutputAta";
5072
- "writable": true;
5073
- "pda": {
5074
- "seeds": [
5075
- {
5076
- "kind": "account";
5077
- "path": "feeCollector";
5078
- },
5079
- {
5080
- "kind": "account";
5081
- "path": "assetTokenProgram";
5082
- },
5083
- {
5084
- "kind": "account";
5085
- "path": "outputMint";
5086
- }
5087
- ];
5088
- "program": {
5089
- "kind": "const";
5090
- "value": [
5091
- 140,
5092
- 151,
5093
- 37,
5094
- 143,
5095
- 78,
5096
- 36,
5097
- 137,
5098
- 241,
5099
- 187,
5100
- 61,
5101
- 16,
5102
- 41,
5103
- 20,
5104
- 142,
5105
- 13,
5106
- 131,
5107
- 11,
5108
- 90,
5109
- 19,
5110
- 153,
5111
- 218,
5112
- 255,
5113
- 16,
5114
- 132,
5115
- 4,
5116
- 142,
5117
- 123,
5118
- 216,
5119
- 219,
5120
- 233,
5121
- 248,
5122
- 89
5123
- ];
5124
- };
5125
- };
5126
- },
5127
5024
  {
5128
5025
  "name": "queueInputAta";
5129
5026
  "writable": true;
@@ -5197,6 +5094,22 @@ type Bankineco = {
5197
5094
  }
5198
5095
  ];
5199
5096
  "args": [
5097
+ {
5098
+ "name": "externalWithdrawIxRefs";
5099
+ "type": {
5100
+ "option": {
5101
+ "defined": {
5102
+ "name": "instructionRefs";
5103
+ };
5104
+ };
5105
+ };
5106
+ },
5107
+ {
5108
+ "name": "externalLiquiditySource";
5109
+ "type": {
5110
+ "option": "u8";
5111
+ };
5112
+ },
5200
5113
  {
5201
5114
  "name": "signerSeeds";
5202
5115
  "type": {
@@ -9536,239 +9449,229 @@ type Bankineco = {
9536
9449
  ];
9537
9450
  "errors": [
9538
9451
  {
9539
- "code": 14001;
9540
- "name": "unauthorized";
9541
- "msg": "You are not authorized to perform this action.";
9542
- },
9543
- {
9544
- "code": 14002;
9545
- "name": "invalidBankMint";
9546
- "msg": "Invalid mint";
9452
+ "code": 6000;
9453
+ "name": "mintSupplyNonZero";
9454
+ "msg": "Supplied share mint already has non-zero supply";
9547
9455
  },
9548
9456
  {
9549
- "code": 14003;
9550
- "name": "accountingIssue";
9551
- "msg": "Accounting issue";
9457
+ "code": 6001;
9458
+ "name": "invalidAssetMint";
9459
+ "msg": "Supplied mint is not accepted by this vault";
9552
9460
  },
9553
9461
  {
9554
- "code": 14004;
9555
- "name": "vaultAccountingIssue";
9556
- "msg": "Vault accounting issue";
9462
+ "code": 6002;
9463
+ "name": "zeroDepositAmount";
9464
+ "msg": "Deposit amount must be greater than zero";
9557
9465
  },
9558
9466
  {
9559
- "code": 14005;
9560
- "name": "bankAccountingIssue";
9561
- "msg": "Bank accounting issue";
9467
+ "code": 6003;
9468
+ "name": "exceedsTvlLimit";
9469
+ "msg": "Deposit would exceed the vault's TVL limit";
9562
9470
  },
9563
9471
  {
9564
- "code": 14006;
9565
- "name": "onchainAccountingIssue";
9566
- "msg": "Onchain accounting issue";
9472
+ "code": 6004;
9473
+ "name": "zeroBurnAmount";
9474
+ "msg": "Burn amount must be greater than zero";
9567
9475
  },
9568
9476
  {
9569
- "code": 14007;
9570
- "name": "externalAccountingIssue";
9571
- "msg": "External accounting issue";
9477
+ "code": 6005;
9478
+ "name": "zeroAssetAmount";
9479
+ "msg": "Asset amount must be greater than zero";
9572
9480
  },
9573
9481
  {
9574
- "code": 14008;
9575
- "name": "mintSlippage";
9576
- "msg": "Minting failed due to slippage.";
9482
+ "code": 6006;
9483
+ "name": "insufficientVaultLiquidity";
9484
+ "msg": "Insufficient vault liquidity to satisfy withdrawal";
9577
9485
  },
9578
9486
  {
9579
- "code": 14009;
9580
- "name": "burningSlippage";
9581
- "msg": "Burning failed due to slippage.";
9487
+ "code": 6007;
9488
+ "name": "mintAuthorityNotCurator";
9489
+ "msg": "Mint authority is not the curator";
9582
9490
  },
9583
9491
  {
9584
- "code": 14010;
9585
- "name": "teamAccountAlreadyExists";
9586
- "msg": "Team account already exists";
9492
+ "code": 6008;
9493
+ "name": "zeroTotalSupply";
9494
+ "msg": "Vault total supply is zero";
9587
9495
  },
9588
9496
  {
9589
- "code": 14011;
9590
- "name": "oracleAccountAlreadyExists";
9591
- "msg": "Oracle account already exists";
9592
- },
9593
- {
9594
- "code": 14012;
9497
+ "code": 6009;
9595
9498
  "name": "staleOracle";
9596
- "msg": "Stale oracle";
9499
+ "msg": "Vault oracle is stale";
9597
9500
  },
9598
9501
  {
9599
- "code": 14013;
9600
- "name": "localSignificantPriceChange";
9601
- "msg": "Price change is too large locally";
9502
+ "code": 6010;
9503
+ "name": "invalidOracleUpdate";
9504
+ "msg": "Invalid oracle update";
9602
9505
  },
9603
9506
  {
9604
- "code": 14014;
9605
- "name": "significantPriceChange";
9606
- "msg": "Price change is too large";
9507
+ "code": 6011;
9508
+ "name": "invalidInitialMintSharePrice";
9509
+ "msg": "Initial mint share price must be greater than zero";
9607
9510
  },
9608
9511
  {
9609
- "code": 14015;
9610
- "name": "roundingImpact";
9611
- "msg": "Rounding impacts the protocol";
9512
+ "code": 6012;
9513
+ "name": "maxApyExceeded";
9514
+ "msg": "Oracle NAV update exceeds the vault's maximum acceptable APY";
9612
9515
  },
9613
9516
  {
9614
- "code": 14016;
9615
- "name": "bankIsHalted";
9616
- "msg": "Bank is halted";
9517
+ "code": 6013;
9518
+ "name": "invalidApyConfig";
9519
+ "msg": "Invalid APY configuration";
9617
9520
  },
9618
9521
  {
9619
- "code": 14017;
9620
- "name": "vaultIsHalted";
9621
- "msg": "Vault is halted";
9522
+ "code": 6014;
9523
+ "name": "invalidFeeConfig";
9524
+ "msg": "Invalid fee configuration";
9622
9525
  },
9623
9526
  {
9624
- "code": 14018;
9625
- "name": "conversionOverflow";
9626
- "msg": "Conversion Overflow";
9527
+ "code": 6015;
9528
+ "name": "vaultHasLiveAssets";
9529
+ "msg": "Vault has live supply, TVL, or holdings";
9627
9530
  },
9628
9531
  {
9629
- "code": 14019;
9630
- "name": "reserved8019";
9631
- "msg": "reserved";
9532
+ "code": 6016;
9533
+ "name": "depositMintsZeroShares";
9534
+ "msg": "Deposit would mint zero shares";
9632
9535
  },
9633
9536
  {
9634
- "code": 14020;
9635
- "name": "invalidArgument";
9636
- "msg": "Invalid argument";
9537
+ "code": 6017;
9538
+ "name": "insufficientAccruedApyBalance";
9539
+ "msg": "Insufficient accrued APY balance";
9637
9540
  },
9638
9541
  {
9639
- "code": 14021;
9640
- "name": "userSanityCheck";
9641
- "msg": "User Sanity Check";
9542
+ "code": 6018;
9543
+ "name": "invalidRole";
9544
+ "msg": "Invalid role configuration";
9642
9545
  },
9643
9546
  {
9644
- "code": 14022;
9645
- "name": "mathOverflow";
9646
- "msg": "Math overflow";
9547
+ "code": 6019;
9548
+ "name": "invalidProtocolInteraction";
9549
+ "msg": "Invalid protocol interaction CPI";
9647
9550
  },
9648
9551
  {
9649
- "code": 14023;
9650
- "name": "invalidMarginFiAccount";
9651
- "msg": "Invalid MarginFi account - must be correct PDA for this vault";
9552
+ "code": 6020;
9553
+ "name": "reserved7020";
9554
+ "msg": "reserved";
9652
9555
  },
9653
9556
  {
9654
- "code": 14024;
9655
- "name": "invalidStartMarker";
9656
- "msg": "Invalid start marker";
9557
+ "code": 6021;
9558
+ "name": "invalidExternalLiquidity";
9559
+ "msg": "Invalid external liquidity configuration";
9657
9560
  },
9658
9561
  {
9659
- "code": 14025;
9660
- "name": "oracleUpdateOnEmptyReserve";
9661
- "msg": "Unable to push oracle update on an empty vault reserve";
9562
+ "code": 6022;
9563
+ "name": "swapBalanceUnchanged";
9564
+ "msg": "Swap did not change both source and destination balances";
9662
9565
  },
9663
9566
  {
9664
- "code": 14026;
9665
- "name": "invalidRemainingAccountsLength";
9666
- "msg": "Invalid remaining accounts length";
9567
+ "code": 6023;
9568
+ "name": "protocolBalanceUnchanged";
9569
+ "msg": "Protocol interaction did not change the affected token balance";
9667
9570
  },
9668
9571
  {
9669
- "code": 14027;
9670
- "name": "withdrawalExceedsBalance";
9671
- "msg": "Specified withdrawal exceeds available balance";
9572
+ "code": 6024;
9573
+ "name": "excessiveSwapSlippage";
9574
+ "msg": "Swap TVL loss exceeds the allowed slippage";
9672
9575
  },
9673
9576
  {
9674
- "code": 14028;
9675
- "name": "insufficientPendingYield";
9676
- "msg": "Insufficient pending yield";
9577
+ "code": 6025;
9578
+ "name": "tranchingNotEnabled";
9579
+ "msg": "Vault tranching is not enabled";
9677
9580
  },
9678
9581
  {
9679
- "code": 14029;
9680
- "name": "notSupported";
9681
- "msg": "Not supported";
9582
+ "code": 6026;
9583
+ "name": "tranchingAlreadyEnabled";
9584
+ "msg": "Vault tranching is already enabled";
9682
9585
  },
9683
9586
  {
9684
- "code": 14030;
9685
- "name": "exceedsMaxYieldingTvl";
9686
- "msg": "Exceeds maximum yielding TVL";
9587
+ "code": 6027;
9588
+ "name": "trancheStateRequired";
9589
+ "msg": "Tranche state account is required";
9687
9590
  },
9688
9591
  {
9689
- "code": 14031;
9690
- "name": "tranchingNotEnabled";
9691
- "msg": "Tranching is not enabled for this bank";
9592
+ "code": 6028;
9593
+ "name": "invalidTrancheConfig";
9594
+ "msg": "Invalid tranche configuration";
9692
9595
  },
9693
9596
  {
9694
- "code": 14032;
9695
- "name": "invalidLeverageFactor";
9696
- "msg": "Invalid leverage factor - must be at least 10000 (1x)";
9597
+ "code": 6029;
9598
+ "name": "invalidTrancheMint";
9599
+ "msg": "Invalid tranche mint";
9697
9600
  },
9698
9601
  {
9699
- "code": 14033;
9700
- "name": "insufficientStakedAmount";
9701
- "msg": "Insufficient staked amount";
9602
+ "code": 6030;
9603
+ "name": "lossesDisabled";
9604
+ "msg": "Vault losses are not enabled";
9702
9605
  },
9703
9606
  {
9704
- "code": 14034;
9705
- "name": "juniorTrancheEmpty";
9706
- "msg": "Junior tranche has no value";
9607
+ "code": 6031;
9608
+ "name": "withdrawalQueueNotExpired";
9609
+ "msg": "Withdrawal queue is not yet expired";
9707
9610
  },
9708
9611
  {
9709
- "code": 14035;
9710
- "name": "invalidTrancheConfig";
9711
- "msg": "Invalid tranche config parameter";
9612
+ "code": 6032;
9613
+ "name": "invalidWithdrawalQueue";
9614
+ "msg": "Invalid withdrawal queue";
9712
9615
  },
9713
9616
  {
9714
- "code": 14036;
9715
- "name": "withdrawalQueueNotExpired";
9716
- "msg": "Withdrawal queue lockup period has not expired";
9617
+ "code": 6033;
9618
+ "name": "assetPriceNotSet";
9619
+ "msg": "Destination asset has no price set; a consensus oracle price is required before swapping";
9717
9620
  },
9718
9621
  {
9719
- "code": 14037;
9720
- "name": "invalidWithdrawalQueue";
9721
- "msg": "Withdrawal queue entry is not in a valid state";
9622
+ "code": 6034;
9623
+ "name": "assetHoldingNotEmpty";
9624
+ "msg": "Asset holding still has a balance and cannot be removed";
9722
9625
  },
9723
9626
  {
9724
- "code": 14038;
9725
- "name": "invalidAccount";
9726
- "msg": "Account does not belong to the expected parent";
9627
+ "code": 6035;
9628
+ "name": "cannotRemoveBaseHolding";
9629
+ "msg": "The base asset holding cannot be removed";
9727
9630
  },
9728
9631
  {
9729
- "code": 14039;
9730
- "name": "missingAccount";
9731
- "msg": "Required optional account is missing";
9632
+ "code": 6036;
9633
+ "name": "unauthorizedPriceUpdater";
9634
+ "msg": "Caller is not authorized to trigger an asset price update";
9732
9635
  },
9733
9636
  {
9734
- "code": 14040;
9735
- "name": "trancheWipedOut";
9736
- "msg": "Junior tranche is wiped out and cannot accept new stakes";
9637
+ "code": 6037;
9638
+ "name": "invalidStalenessConfig";
9639
+ "msg": "Invalid asset-price staleness threshold";
9737
9640
  },
9738
9641
  {
9739
- "code": 14041;
9740
- "name": "vaultLossNotAccepted";
9741
- "msg": "Vault does not accept losses — enable losses_accepted before retrying";
9642
+ "code": 6038;
9643
+ "name": "assetRebalanceRateLimitExceeded";
9644
+ "msg": "Asset was rebalanced too recently";
9742
9645
  },
9743
9646
  {
9744
- "code": 14042;
9745
- "name": "capitalLossExceedsReserve";
9746
- "msg": "Capital loss exceeds available yielding reserve";
9647
+ "code": 6039;
9648
+ "name": "invalidShareTokenProgram";
9649
+ "msg": "Share token program does not match the vault/tranche mint configuration";
9747
9650
  },
9748
9651
  {
9749
- "code": 14043;
9750
- "name": "rollingWithdrawalLimitExceeded";
9751
- "msg": "Rolling withdrawal limit exceeded";
9652
+ "code": 6040;
9653
+ "name": "unauthorizedVaultCreator";
9654
+ "msg": "Caller is not on the vault-creator whitelist";
9752
9655
  },
9753
9656
  {
9754
- "code": 14044;
9755
- "name": "vaultAlreadyMigrated";
9756
- "msg": "Legacy vault has already been migrated";
9657
+ "code": 6041;
9658
+ "name": "invalidShareMintDecimals";
9659
+ "msg": "Share mint decimals must match the vault accounting decimals";
9757
9660
  },
9758
9661
  {
9759
- "code": 14045;
9760
- "name": "invalidMigrationState";
9761
- "msg": "Legacy vault migration is incomplete or invalid";
9662
+ "code": 6042;
9663
+ "name": "invalidFeeExemption";
9664
+ "msg": "Invalid fee-exemption PDA signer or seeds";
9762
9665
  },
9763
9666
  {
9764
- "code": 14046;
9765
- "name": "invalidMigrationMintAuthority";
9766
- "msg": "Mint authority does not match the expected migration source";
9667
+ "code": 6043;
9668
+ "name": "exceedsJuniorDepositCap";
9669
+ "msg": "Deposit would exceed the junior tranche deposit cap";
9767
9670
  },
9768
9671
  {
9769
- "code": 14047;
9770
- "name": "bankMigrationIncomplete";
9771
- "msg": "Legacy bank or tranche migration is incomplete source accounting and escrow must be fully drained before mint authority transfer";
9672
+ "code": 6044;
9673
+ "name": "invalidShareSupply";
9674
+ "msg": "Physical share-mint supply does not match effective supply accounting";
9772
9675
  }
9773
9676
  ];
9774
9677
  "types": [
@@ -10149,9 +10052,7 @@ type Bankineco = {
10149
10052
  "Holdings are addressed by their slot index (1 byte) to keep instruction data",
10150
10053
  "small. To register a brand-new consensus holding, set `mint` to its mint",
10151
10054
  "(and pass the matching `asset_mint` account); the created slot's index is used",
10152
- "and `holding_index` is ignored. For existing holdings leave `mint` as `None`.",
10153
- "The price is authoritative only for ConsensusOracle holdings. Pyth and nested-vault",
10154
- "holdings use the report only for external_amount and retain their live-oracle price."
10055
+ "and `holding_index` is ignored. For existing holdings leave `mint` as `None`."
10155
10056
  ];
10156
10057
  "type": {
10157
10058
  "kind": "struct";
@@ -11028,6 +10929,106 @@ type Bankineco = {
11028
10929
  ];
11029
10930
  };
11030
10931
  },
10932
+ {
10933
+ "name": "rollingRebalanceLimit";
10934
+ "docs": [
10935
+ "Rolling-window cap on rebalance (Jupiter swap) throughput, expressed as a",
10936
+ "share of current TVL rather than a fixed amount.",
10937
+ "",
10938
+ "Sibling of [`super::withdrawal_limits::RollingWithdrawalLimit`]: same",
10939
+ "window-slide-then-charge mechanics, but the ceiling is recomputed from live",
10940
+ "TVL on every call, so the cap tracks the vault as it grows or shrinks",
10941
+ "instead of going stale at whatever amount the curator last set.",
10942
+ "",
10943
+ "Both swap directions charge the same window — the cap bounds total value",
10944
+ "routed through Jupiter per window, regardless of which asset is sold."
10945
+ ];
10946
+ "serialization": "bytemuck";
10947
+ "repr": {
10948
+ "kind": "c";
10949
+ };
10950
+ "type": {
10951
+ "kind": "struct";
10952
+ "fields": [
10953
+ {
10954
+ "name": "windowStartTs";
10955
+ "docs": [
10956
+ "Unix timestamp the current window opened."
10957
+ ];
10958
+ "type": "i64";
10959
+ },
10960
+ {
10961
+ "name": "windowDurationSeconds";
10962
+ "docs": [
10963
+ "Window length, in seconds (e.g. 3_600 for an hourly limit)."
10964
+ ];
10965
+ "type": "u64";
10966
+ },
10967
+ {
10968
+ "name": "valueInWindow";
10969
+ "docs": [
10970
+ "Value rebalanced inside the current window, in the vault's accounting",
10971
+ "unit."
10972
+ ];
10973
+ "type": "u64";
10974
+ },
10975
+ {
10976
+ "name": "windowLimitBps";
10977
+ "docs": [
10978
+ "Cap as a share of TVL, in bps. `0` disables the limit."
10979
+ ];
10980
+ "type": "u16";
10981
+ },
10982
+ {
10983
+ "name": "padding1";
10984
+ "type": {
10985
+ "array": [
10986
+ "u8",
10987
+ 6
10988
+ ];
10989
+ };
10990
+ },
10991
+ {
10992
+ "name": "padding2";
10993
+ "type": {
10994
+ "array": [
10995
+ "u64",
10996
+ 4
10997
+ ];
10998
+ };
10999
+ }
11000
+ ];
11001
+ };
11002
+ },
11003
+ {
11004
+ "name": "rollingRebalanceLimitConfig";
11005
+ "docs": [
11006
+ "Rolling rebalance-limit config applied via [`SetVaultConfigArgs`].",
11007
+ "",
11008
+ "The cap is a share of TVL rather than a fixed amount, so it stays",
11009
+ "meaningful as the vault grows. Both fields must be zero (disable the cap)",
11010
+ "or both non-zero (enable it)."
11011
+ ];
11012
+ "type": {
11013
+ "kind": "struct";
11014
+ "fields": [
11015
+ {
11016
+ "name": "windowLimitBps";
11017
+ "docs": [
11018
+ "Max share of TVL rebalanced inside one window, in bps (`0` disables)."
11019
+ ];
11020
+ "type": "u16";
11021
+ },
11022
+ {
11023
+ "name": "windowDurationSeconds";
11024
+ "docs": [
11025
+ "Window length in seconds (`0` only valid when `window_limit_bps` is `0`)."
11026
+ ];
11027
+ "type": "u64";
11028
+ }
11029
+ ];
11030
+ };
11031
+ },
11031
11032
  {
11032
11033
  "name": "setAssetPriceOracleArgs";
11033
11034
  "type": {
@@ -11213,6 +11214,20 @@ type Bankineco = {
11213
11214
  };
11214
11215
  };
11215
11216
  };
11217
+ },
11218
+ {
11219
+ "name": "rebalanceLimit";
11220
+ "docs": [
11221
+ "Rolling cap on rebalance (Jupiter swap) throughput. `None` leaves",
11222
+ "unchanged."
11223
+ ];
11224
+ "type": {
11225
+ "option": {
11226
+ "defined": {
11227
+ "name": "rollingRebalanceLimitConfig";
11228
+ };
11229
+ };
11230
+ };
11216
11231
  }
11217
11232
  ];
11218
11233
  };
@@ -11896,7 +11911,8 @@ type Bankineco = {
11896
11911
  {
11897
11912
  "name": "lossesEnabled";
11898
11913
  "docs": [
11899
- "Allows consensus-oracle NAV losses beyond the protocol's small-loss tolerance. Losses inside that tolerance settle without this flag."
11914
+ "Allows consensus-oracle NAV losses beyond the protocol's small-loss",
11915
+ "tolerance. Losses inside that tolerance settle without this flag."
11900
11916
  ];
11901
11917
  "type": {
11902
11918
  "defined": {
@@ -12133,6 +12149,14 @@ type Bankineco = {
12133
12149
  "name": "seniorFixedApyBps";
12134
12150
  "type": "u16";
12135
12151
  },
12152
+ {
12153
+ "name": "juniorFloorApyBps";
12154
+ "docs": [
12155
+ "Floor APY for the junior tranche, in basis points. Zero disables the",
12156
+ "floor. Shortfalls are funded from the untranched sleeve, never senior."
12157
+ ];
12158
+ "type": "u16";
12159
+ },
12136
12160
  {
12137
12161
  "name": "earlyUnstakeFeeBps";
12138
12162
  "type": "u16";
@@ -12958,12 +12982,38 @@ type Bankineco = {
12958
12982
  ];
12959
12983
  "type": "u64";
12960
12984
  },
12985
+ {
12986
+ "name": "juniorFloorApyBps";
12987
+ "docs": [
12988
+ "Curator-set floor APY for the junior tranche, in basis points. Zero",
12989
+ "disables the floor.",
12990
+ "",
12991
+ "When junior's realized growth falls short of this floor, the shortfall is",
12992
+ "topped up from the *untranched* (regular) sleeve's value, never from the",
12993
+ "senior tranche -- senior's fixed-APY entitlement is settled first and is",
12994
+ "untouched by the floor. The top-up is best-effort: it is capped by the",
12995
+ "untranched sleeve's available value, and any unpaid remainder stays",
12996
+ "outstanding against the durable junior anchor",
12997
+ "(`VaultTrancheState::junior_apy_anchor_share_price`) so it can be paid on",
12998
+ "a later settlement."
12999
+ ];
13000
+ "type": "u16";
13001
+ },
13002
+ {
13003
+ "name": "padding1";
13004
+ "type": {
13005
+ "array": [
13006
+ "u8",
13007
+ 6
13008
+ ];
13009
+ };
13010
+ },
12961
13011
  {
12962
13012
  "name": "padding2";
12963
13013
  "type": {
12964
13014
  "array": [
12965
13015
  "u64",
12966
- 13
13016
+ 12
12967
13017
  ];
12968
13018
  };
12969
13019
  }
@@ -13041,12 +13091,28 @@ type Bankineco = {
13041
13091
  ];
13042
13092
  "type": "i64";
13043
13093
  },
13094
+ {
13095
+ "name": "juniorApyAnchorSharePrice";
13096
+ "docs": [
13097
+ "Junior share price at the start of the current floor-APY regime. The",
13098
+ "anchor is durable across settlements so an unpaid floor shortfall stays",
13099
+ "outstanding and can be caught up later."
13100
+ ];
13101
+ "type": "u64";
13102
+ },
13103
+ {
13104
+ "name": "juniorApyAnchorTs";
13105
+ "docs": [
13106
+ "Unix timestamp when the junior floor-APY anchor was set."
13107
+ ];
13108
+ "type": "i64";
13109
+ },
13044
13110
  {
13045
13111
  "name": "padding2";
13046
13112
  "type": {
13047
13113
  "array": [
13048
13114
  "u64",
13049
- 29
13115
+ 27
13050
13116
  ];
13051
13117
  };
13052
13118
  }
@@ -13064,6 +13130,17 @@ type Bankineco = {
13064
13130
  "option": "u16";
13065
13131
  };
13066
13132
  },
13133
+ {
13134
+ "name": "juniorFloorApyBps";
13135
+ "docs": [
13136
+ "Floor APY for the junior tranche, in basis points. Zero disables the",
13137
+ "floor. Setting this starts a fresh regime: any shortfall accrued under",
13138
+ "the previous value is forfeited."
13139
+ ];
13140
+ "type": {
13141
+ "option": "u16";
13142
+ };
13143
+ },
13067
13144
  {
13068
13145
  "name": "earlyUnstakeFeeBps";
13069
13146
  "type": {
@@ -13346,12 +13423,25 @@ type Bankineco = {
13346
13423
  ];
13347
13424
  "type": "u64";
13348
13425
  },
13426
+ {
13427
+ "name": "rebalanceLimit";
13428
+ "docs": [
13429
+ "Rolling cap on rebalance (Jupiter swap) throughput per window, as a",
13430
+ "share of TVL. Carved out of `_padding1`, so the account layout and size",
13431
+ "are unchanged and existing vaults decode it as disabled."
13432
+ ];
13433
+ "type": {
13434
+ "defined": {
13435
+ "name": "rollingRebalanceLimit";
13436
+ };
13437
+ };
13438
+ },
13349
13439
  {
13350
13440
  "name": "padding1";
13351
13441
  "type": {
13352
13442
  "array": [
13353
13443
  "u64",
13354
- 30
13444
+ 22
13355
13445
  ];
13356
13446
  };
13357
13447
  },
@@ -14172,6 +14262,11 @@ interface CreateTrancheStateIxArgs {
14172
14262
  */
14173
14263
  vaultOracle?: Address;
14174
14264
  seniorFixedApyBps: number;
14265
+ /**
14266
+ * Junior floor APY in basis points. Zero disables the floor. Shortfalls are
14267
+ * funded from the untranched sleeve, never from the senior tranche.
14268
+ */
14269
+ juniorFloorApyBps: number;
14175
14270
  earlyUnstakeFeeBps: number;
14176
14271
  standardUnstakeFeeBps: number;
14177
14272
  targetLockupDurationSecs: BN;
@@ -14186,6 +14281,8 @@ interface CreateTrancheStateTxArgs {
14186
14281
  seniorShareMint: Address;
14187
14282
  vaultOracle?: Address;
14188
14283
  seniorFixedApyBps?: number;
14284
+ /** Junior floor APY in basis points. Zero disables the floor. */
14285
+ juniorFloorApyBps?: number;
14189
14286
  earlyUnstakeFeeBps?: number;
14190
14287
  standardUnstakeFeeBps?: number;
14191
14288
  targetLockupDurationSecs?: number;
@@ -14200,6 +14297,12 @@ interface UpdateTrancheConfigIxArgs {
14200
14297
  vaultTrancheState: Address;
14201
14298
  vaultOracle: Address;
14202
14299
  seniorFixedApyBps: number | null;
14300
+ /**
14301
+ * Junior floor APY in basis points, or null to leave it unchanged. Setting it
14302
+ * starts a fresh regime: any shortfall accrued under the previous value is
14303
+ * forfeited.
14304
+ */
14305
+ juniorFloorApyBps: number | null;
14203
14306
  earlyUnstakeFeeBps: number | null;
14204
14307
  standardUnstakeFeeBps: number | null;
14205
14308
  targetLockupDurationSecs: BN | null;
@@ -14211,6 +14314,8 @@ interface UpdateTrancheConfigTxArgs {
14211
14314
  vaultTrancheState?: Address;
14212
14315
  vaultOracle?: Address;
14213
14316
  seniorFixedApyBps?: number;
14317
+ /** Junior floor APY in basis points. Zero disables the floor. */
14318
+ juniorFloorApyBps?: number;
14214
14319
  earlyUnstakeFeeBps?: number;
14215
14320
  standardUnstakeFeeBps?: number;
14216
14321
  targetLockupDurationSecs?: number;
@@ -14236,6 +14341,15 @@ interface RollingLimitConfig {
14236
14341
  windowLimit: bigint;
14237
14342
  windowDurationSeconds: bigint;
14238
14343
  }
14344
+ /**
14345
+ * Rolling rebalance cap. Unlike {@link RollingLimitConfig} the ceiling is a
14346
+ * share of TVL, recomputed on every swap, so it does not go stale as the vault
14347
+ * grows.
14348
+ */
14349
+ interface RollingRebalanceLimitConfig {
14350
+ windowLimitBps: number;
14351
+ windowDurationSeconds: bigint;
14352
+ }
14239
14353
  interface SetVaultConfigIxArgs {
14240
14354
  curator: Address;
14241
14355
  vault: Address;
@@ -14263,6 +14377,10 @@ interface SetVaultConfigIxArgs {
14263
14377
  windowLimit: BN;
14264
14378
  windowDurationSeconds: BN;
14265
14379
  } | null;
14380
+ rebalanceLimit: {
14381
+ windowLimitBps: number;
14382
+ windowDurationSeconds: BN;
14383
+ } | null;
14266
14384
  };
14267
14385
  }
14268
14386
  interface SetVaultConfigTxArgs {
@@ -14288,6 +14406,11 @@ interface SetVaultConfigTxArgs {
14288
14406
  userBurnLimit?: RollingLimitConfig;
14289
14407
  /** Rolling cap on manager liquidity pulls. Omit to leave unchanged. */
14290
14408
  managerPullLimit?: RollingLimitConfig;
14409
+ /**
14410
+ * Rolling cap on rebalance (Jupiter swap) throughput, as a share of TVL.
14411
+ * Omit to leave unchanged.
14412
+ */
14413
+ rebalanceLimit?: RollingRebalanceLimitConfig;
14291
14414
  }
14292
14415
  interface SetProtocolFeeIxArgs {
14293
14416
  /** The hardcoded protocol wallet, the only authority allowed to set this. */
@@ -14561,11 +14684,12 @@ interface FulfillJuniorTrancheWithdrawIxArgs {
14561
14684
  ownerInputAta: Address;
14562
14685
  ownerOutputAta: Address;
14563
14686
  vaultOutputAta: Address;
14564
- feeCollector: Address;
14565
- feeCollectorOutputAta: Address;
14566
14687
  queueInputAta: Address;
14567
14688
  assetTokenProgram: Address;
14568
14689
  shareTokenProgram: Address;
14690
+ externalWithdrawIxRefs: InstructionRefs | null;
14691
+ externalLiquiditySource: number | null;
14692
+ externalWithdrawAccounts: CustomAccountMeta[];
14569
14693
  /** PDA derivation seeds, including the bump, for the fee-exempt route. */
14570
14694
  addressSeeds?: readonly Uint8Array[];
14571
14695
  }
@@ -14581,9 +14705,17 @@ interface FulfillJuniorTrancheWithdrawTxArgs {
14581
14705
  juniorShareMint: Address;
14582
14706
  ownerInputAta?: Address;
14583
14707
  queueId: number;
14584
- feeCollector?: Address;
14585
14708
  assetTokenProgram?: Address;
14586
14709
  shareTokenProgram?: Address;
14710
+ externalWithdrawIxRefs?: InstructionRefs;
14711
+ externalLiquiditySource?: number;
14712
+ externalWithdrawAccounts?: CustomAccountMeta[];
14713
+ /**
14714
+ * When true, skips the automatic detection of on-chain Marginfi external
14715
+ * liquidity and always fulfills from local vault liquidity only.
14716
+ */
14717
+ skipExternalLiquidity?: boolean;
14718
+ lookupTables?: Address[];
14587
14719
  /** PDA derivation seeds, including the bump, for the fee-exempt route. */
14588
14720
  addressSeeds?: readonly Uint8Array[];
14589
14721
  }
@@ -15134,19 +15266,19 @@ declare class ExecuteTrancheWithdrawBuilder extends VaultBuilderBase<ExecuteTran
15134
15266
 
15135
15267
  declare class ExecuteWithdrawBuilder extends VaultBuilderBase<ExecuteWithdrawIxArgs, ExecuteWithdrawTxArgs> {
15136
15268
  getIxAccounts(args: ExecuteWithdrawIxArgs): {
15137
- user: PublicKey;
15138
- vault: PublicKey;
15139
- vaultOracle: PublicKey;
15140
- vaultTrancheState: PublicKey | null;
15141
- assetMint: PublicKey;
15142
- shareMint: PublicKey;
15143
- userAssetAta: PublicKey;
15144
- vaultAssetAta: PublicKey;
15145
- feeVault: PublicKey;
15146
- feeVaultAta: PublicKey;
15147
- userShareAta: PublicKey;
15148
- assetTokenProgram: PublicKey;
15149
- shareTokenProgram: PublicKey;
15269
+ user: _solana_web3_js.PublicKey;
15270
+ vault: _solana_web3_js.PublicKey;
15271
+ vaultOracle: _solana_web3_js.PublicKey;
15272
+ vaultTrancheState: _solana_web3_js.PublicKey | null;
15273
+ assetMint: _solana_web3_js.PublicKey;
15274
+ shareMint: _solana_web3_js.PublicKey;
15275
+ userAssetAta: _solana_web3_js.PublicKey;
15276
+ vaultAssetAta: _solana_web3_js.PublicKey;
15277
+ feeVault: _solana_web3_js.PublicKey;
15278
+ feeVaultAta: _solana_web3_js.PublicKey;
15279
+ userShareAta: _solana_web3_js.PublicKey;
15280
+ assetTokenProgram: _solana_web3_js.PublicKey;
15281
+ shareTokenProgram: _solana_web3_js.PublicKey;
15150
15282
  };
15151
15283
  getIxData(args: ExecuteWithdrawIxArgs): {
15152
15284
  shareAmount: BN;
@@ -15168,12 +15300,13 @@ declare class ExecuteWithdrawBuilder extends VaultBuilderBase<ExecuteWithdrawIxA
15168
15300
  declare class FulfillJuniorTrancheWithdrawBuilder extends VaultBuilderBase<FulfillJuniorTrancheWithdrawIxArgs, FulfillJuniorTrancheWithdrawTxArgs> {
15169
15301
  getIx(args: FulfillJuniorTrancheWithdrawIxArgs): Promise<_solana_kit.Instruction<string, readonly (_solana_kit.AccountLookupMeta<string, string> | _solana_kit.AccountMeta<string>)[]>>;
15170
15302
  protected deriveIxArgs(txArgs: FulfillJuniorTrancheWithdrawTxArgs): Promise<FulfillJuniorTrancheWithdrawIxArgs>;
15303
+ protected buildLookupTables(_args: FulfillJuniorTrancheWithdrawIxArgs, txArgs: FulfillJuniorTrancheWithdrawTxArgs): Promise<readonly Address[] | undefined>;
15171
15304
  protected buildPreambleInstructions(args: FulfillJuniorTrancheWithdrawIxArgs): Promise<_solana_kit.Instruction<string, readonly (_solana_kit.AccountLookupMeta<string, string> | _solana_kit.AccountMeta<string>)[]>[]>;
15172
15305
  protected buildPlanExtras(args: FulfillJuniorTrancheWithdrawIxArgs): Promise<{
15173
15306
  postSuccessCacheInvalidations: {
15174
- vaultPda: _solana_kit.Address;
15175
- vaultTrancheStatePda: _solana_kit.Address;
15176
- withdrawalQueuePda: _solana_kit.Address;
15307
+ vaultPda: Address;
15308
+ vaultTrancheStatePda: Address;
15309
+ withdrawalQueuePda: Address;
15177
15310
  }[];
15178
15311
  }>;
15179
15312
  }
@@ -15364,7 +15497,9 @@ declare function resolveKeypairPath(keypairPath: string): string;
15364
15497
  declare function loadKeypair(keypairPath: string): Keypair;
15365
15498
  /**
15366
15499
  * Default keypair location for a given role/env, e.g.
15367
- * `~/.config/solana/vault-fulfiller-prod.json`. Override per-invocation with
15500
+ * `~/.config/solana/vault-fulfiller-prod.json`. Roles in
15501
+ * {@link ENV_AGNOSTIC_ROLES} share one key across envs, e.g.
15502
+ * `~/.config/solana/fulfiller.json`. Override per-invocation with
15368
15503
  * the `--keypair` CLI flag or the `keypairPath` option.
15369
15504
  */
15370
15505
  declare function defaultKeypairPath(env: VaultEnv, role?: string): string;
@@ -15662,7 +15797,7 @@ interface FulfillSummary {
15662
15797
  failed: number;
15663
15798
  signatures: string[];
15664
15799
  }
15665
- type LogFn$2 = (msg: string) => void;
15800
+ type LogFn$3 = (msg: string) => void;
15666
15801
  declare class WithdrawalQueueService {
15667
15802
  private readonly client;
15668
15803
  constructor(client: VaultClient);
@@ -15690,7 +15825,7 @@ declare class WithdrawalQueueService {
15690
15825
  */
15691
15826
  fulfillAllDue(signer: Keypair, opts?: {
15692
15827
  vault?: Address;
15693
- log?: LogFn$2;
15828
+ log?: LogFn$3;
15694
15829
  }): Promise<FulfillSummary>;
15695
15830
  private toSnapshot;
15696
15831
  }
@@ -15712,7 +15847,7 @@ declare class WithdrawalQueueService {
15712
15847
  * this service only submits the resulting values on-chain.
15713
15848
  */
15714
15849
 
15715
- type LogFn$1 = (msg: string) => void;
15850
+ type LogFn$2 = (msg: string) => void;
15716
15851
  type NavCrankBlockerReason = "unpriced" | "stale";
15717
15852
  interface NavCrankBlocker {
15718
15853
  holdingIndex: number;
@@ -15765,12 +15900,12 @@ declare class OracleService {
15765
15900
  }[];
15766
15901
  assetMint?: Address;
15767
15902
  assetTokenProgram?: Address;
15768
- }, log?: LogFn$1): Promise<string>;
15903
+ }, log?: LogFn$2): Promise<string>;
15769
15904
  /** Settle the vault NAV from its current holdings (permissionless). */
15770
15905
  crankNav(cranker: Keypair, args: {
15771
15906
  vault: Address;
15772
15907
  vaultTrancheState?: Address;
15773
- }, log?: LogFn$1): Promise<string>;
15908
+ }, log?: LogFn$2): Promise<string>;
15774
15909
  /**
15775
15910
  * Check the same active-holding price preconditions that `crank_nav` enforces
15776
15911
  * before spending a transaction on the permissionless settlement.
@@ -15780,19 +15915,19 @@ declare class OracleService {
15780
15915
  crankNavIfReady(cranker: Keypair, args: {
15781
15916
  vault: Address;
15782
15917
  vaultTrancheState?: Address;
15783
- }, log?: LogFn$1): Promise<NavCrankResult>;
15918
+ }, log?: LogFn$2): Promise<NavCrankResult>;
15784
15919
  /** Re-price one live-oracle holding from its bound Pyth/nested-vault account. */
15785
15920
  refreshAssetPrice(updater: Keypair, args: {
15786
15921
  vault: Address;
15787
15922
  mint: Address;
15788
15923
  oracleAccount: Address;
15789
15924
  maxAgeSecs?: bigint;
15790
- }, log?: LogFn$1): Promise<string>;
15925
+ }, log?: LogFn$2): Promise<string>;
15791
15926
  /**
15792
15927
  * Refresh several holdings in sequence. Non-fatal: one failure is recorded
15793
15928
  * and the rest still run. Returns a per-mint result list.
15794
15929
  */
15795
- refreshAssetPrices(updater: Keypair, vault: Address, targets: AssetPriceRefreshTarget[], log?: LogFn$1): Promise<AssetRefreshResult[]>;
15930
+ refreshAssetPrices(updater: Keypair, vault: Address, targets: AssetPriceRefreshTarget[], log?: LogFn$2): Promise<AssetRefreshResult[]>;
15796
15931
  }
15797
15932
 
15798
15933
  /**
@@ -16015,12 +16150,15 @@ interface DecodedVaultTrancheState {
16015
16150
  juniorMint: unknown;
16016
16151
  seniorMint: unknown;
16017
16152
  seniorFixedApyBps?: unknown;
16153
+ juniorFloorApyBps?: unknown;
16018
16154
  };
16019
16155
  junior?: Record<string, unknown>;
16020
16156
  senior?: Record<string, unknown>;
16021
16157
  lastSettledTs?: unknown;
16022
16158
  seniorApyAnchorSharePrice?: unknown;
16023
16159
  seniorApyAnchorTs?: unknown;
16160
+ juniorApyAnchorSharePrice?: unknown;
16161
+ juniorApyAnchorTs?: unknown;
16024
16162
  }
16025
16163
  interface ConsensusHoldingSimulation {
16026
16164
  holdingIndex: number;
@@ -16612,61 +16750,235 @@ declare class ConsensusOracleService {
16612
16750
  /**
16613
16751
  * External Liquidity Integrity Service
16614
16752
  *
16615
- * Scans all vaults for active external liquidity positions. For each vault
16616
- * holding with a non-zero local_amount and an active (non-None) external
16617
- * liquidity slot, deposits the local funds into the external position via
16618
- * `protocol_interaction` (e.g. a Marginfi deposit CPI).
16753
+ * Keeps each vault holding's split between local (vault-owned token account)
16754
+ * and external (Marginfi) balances at its target ratio. A small share of every
16755
+ * holding is deliberately left local see {@link DEFAULT_TARGET_LOCAL_BPS}
16756
+ * so routine payouts can be served without a Marginfi round trip; everything
16757
+ * above that target is deposited into the configured external position via
16758
+ * `protocol_interaction` (a Marginfi deposit CPI).
16759
+ *
16760
+ * The rebalance is two-sided: when the local balance has drifted *below* the
16761
+ * target (deposits swept too aggressively, payouts drained the buffer) the
16762
+ * service withdraws the shortfall back out of Marginfi. Either leg only fires
16763
+ * once the drift leaves the hysteresis band around the target — see
16764
+ * {@link DEFAULT_REBALANCE_BAND_BPS} — so ordinary flow does not generate a
16765
+ * transaction per run.
16619
16766
  *
16620
- * Intended to run on a recurring schedule (every ~10 minutes) so that idle
16621
- * local balances are always deployed into the configured yield source.
16767
+ * Intended to run on a recurring schedule (every ~10 minutes) so that the idle
16768
+ * buffer stays close to target and the rest keeps earning yield.
16622
16769
  */
16623
16770
 
16624
16771
  interface ExternalLiquidityIntegrityResult {
16625
16772
  vault: Address;
16626
16773
  deposited: number;
16774
+ withdrawn: number;
16627
16775
  skipped: number;
16628
16776
  failed: number;
16629
- /** Signatures of sent deposits (empty in dry-run mode). */
16777
+ /** Signatures of sent rebalances (empty in dry-run mode). */
16630
16778
  signatures: string[];
16631
16779
  }
16632
16780
  interface ExternalLiquidityIntegritySummary {
16633
16781
  vaultsProcessed: number;
16634
16782
  totalDeposited: number;
16783
+ totalWithdrawn: number;
16635
16784
  totalSkipped: number;
16636
16785
  totalFailed: number;
16637
- /** True when deposits were simulated rather than sent. */
16786
+ /** True when rebalances were simulated rather than sent. */
16638
16787
  dryRun: boolean;
16639
16788
  }
16640
- type LogFn = (msg: string) => void;
16789
+ type LogFn$1 = (msg: string) => void;
16641
16790
  interface ExternalLiquidityIntegrityOptions {
16642
- log?: LogFn;
16643
- /** Simulate each deposit instead of sending it. Nothing is submitted. */
16791
+ log?: LogFn$1;
16792
+ /** Simulate each rebalance instead of sending it. Nothing is submitted. */
16644
16793
  dryRun?: boolean;
16645
16794
  /**
16646
- * Skip holdings worth less than this many UI tokens. Every mint with a
16795
+ * Skip rebalances smaller than this many UI tokens. Every mint with a
16647
16796
  * Marginfi bank is a USD stablecoin, so the default of 1 means "ignore
16648
- * dust below ~$1" and keeps the tx fee from exceeding the deposit.
16797
+ * dust below ~$1" and keeps the tx fee from exceeding the movement.
16649
16798
  */
16650
16799
  minAmountUi?: number;
16800
+ /**
16801
+ * Share of each holding (local + external) to keep in the vault's own token
16802
+ * account, in basis points. Defaults to {@link DEFAULT_TARGET_LOCAL_BPS}.
16803
+ */
16804
+ targetLocalBps?: number;
16805
+ /**
16806
+ * Hysteresis band, in basis points *of the target local amount*: the local
16807
+ * balance must drift at least this far from target before a rebalance is
16808
+ * worth a transaction. Defaults to {@link DEFAULT_REBALANCE_BAND_BPS}.
16809
+ */
16810
+ rebalanceBandBps?: number;
16651
16811
  }
16652
16812
  declare const DEFAULT_MIN_AMOUNT_UI = 1;
16813
+ /** Keep 1% of each holding local; the remaining 99% earns yield in Marginfi. */
16814
+ declare const DEFAULT_TARGET_LOCAL_BPS = 100;
16815
+ /**
16816
+ * Rebalance only once the local balance has drifted more than 20% away from its
16817
+ * target — i.e. outside 0.8%–1.2% of the holding at the default 1% target.
16818
+ * Without this band every arriving deposit or payout would trigger its own
16819
+ * transaction; with it, each rebalance restores the exact target, so the next
16820
+ * one is a full band away rather than one dust movement later.
16821
+ */
16822
+ declare const DEFAULT_REBALANCE_BAND_BPS = 2000;
16823
+ type RebalanceDirection = "deposit" | "withdraw";
16824
+ /**
16825
+ * Decide how to move a holding back toward its target local share.
16826
+ *
16827
+ * A rebalance fires only once the drift from target exceeds both the hysteresis
16828
+ * band (`rebalanceBandBps` of the target) and the `minRaw` dust floor — the band
16829
+ * keeps the vault from paying a transaction fee for every small deposit or
16830
+ * payout, the floor keeps small vaults, where the band itself is dust, quiet.
16831
+ * When it does fire the move restores the exact target rather than the band
16832
+ * edge. Withdrawals are additionally capped at the external balance.
16833
+ */
16834
+ declare function planRebalance(params: {
16835
+ localAmount: bigint;
16836
+ externalAmount: bigint;
16837
+ targetLocalBps: number;
16838
+ rebalanceBandBps: number;
16839
+ minRaw: bigint;
16840
+ }): {
16841
+ direction: RebalanceDirection;
16842
+ amount: bigint;
16843
+ targetLocal: bigint;
16844
+ } | null;
16653
16845
  declare class ExternalLiquidityIntegrityService {
16654
16846
  private readonly client;
16655
16847
  constructor(client: VaultClient);
16656
16848
  /**
16657
- * Scan all vaults and deposit any idle local balance into configured external
16658
- * liquidity positions. Non-fatal per vault — errors are logged and counted.
16849
+ * Scan all vaults and rebalance each holding toward its target local share.
16850
+ * Non-fatal per vault — errors are logged and counted.
16659
16851
  */
16660
16852
  runAll(hwManager: Keypair, opts?: ExternalLiquidityIntegrityOptions): Promise<ExternalLiquidityIntegritySummary>;
16661
16853
  /**
16662
- * Process a single vault: for each active external liquidity slot, deposit
16663
- * any holdings that have a non-zero local_amount.
16854
+ * Process a single vault: for each active external liquidity slot, move each
16855
+ * holding's balance toward the target local/external split.
16664
16856
  */
16665
- processVault(vault: Address, vaultState: VaultAccountData, hwManager: Keypair, log: LogFn, opts?: {
16857
+ processVault(vault: Address, vaultState: VaultAccountData, hwManager: Keypair, log: LogFn$1, opts?: {
16666
16858
  dryRun?: boolean;
16667
16859
  minAmountUi?: number;
16860
+ targetLocalBps?: number;
16861
+ rebalanceBandBps?: number;
16668
16862
  }): Promise<ExternalLiquidityIntegrityResult>;
16669
- private depositIntoMarginfi;
16863
+ /**
16864
+ * Move `amount` of `mintAddress` between the vault's own token account and
16865
+ * its Marginfi position, in `direction`, through `protocol_interaction`.
16866
+ */
16867
+ private rebalanceMarginfi;
16868
+ }
16869
+
16870
+ /**
16871
+ * Idle Liquidity Service
16872
+ *
16873
+ * Keeps a floor of idle USDC in the vault so junior withdrawals and other
16874
+ * payouts can be served without unwinding yield positions on demand.
16875
+ *
16876
+ * Idle USDC is measured as the USDC holding's `local_amount + external_amount`
16877
+ * valued at the holding price — external (Marginfi-deployed) USDC counts,
16878
+ * because the external-liquidity service sweeps local balances into Marginfi on
16879
+ * its own schedule and that liquidity is withdrawable.
16880
+ *
16881
+ * When idle USDC drops below {@link IDLE_RESERVE_FLOOR_BPS} of vault TVL, the
16882
+ * service swaps PST into USDC through the permissioned `jupiter_swap`
16883
+ * instruction, sizing the swap to land at {@link IDLE_RESERVE_TARGET_BPS} of
16884
+ * TVL. PST is never deployed externally, so the vault's local PST balance is
16885
+ * the whole swappable inventory; if it cannot cover the full top-up the run is
16886
+ * skipped rather than partially filled.
16887
+ *
16888
+ * Every swap is simulated before the signed transaction is submitted — the same
16889
+ * mandatory-simulation discipline as the `swap-pst-to-usdc` script this service
16890
+ * generalizes.
16891
+ */
16892
+
16893
+ /** Idle USDC below this share of TVL triggers a top-up. */
16894
+ declare const IDLE_RESERVE_FLOOR_BPS = 400;
16895
+ /** Top-ups are sized to land idle USDC at this share of TVL. */
16896
+ declare const IDLE_RESERVE_TARGET_BPS = 500;
16897
+ declare const DEFAULT_SLIPPAGE_BPS = 30;
16898
+ declare const DEFAULT_CU_PRICE_MICRO_LAMPORTS = 10000;
16899
+ declare const DEFAULT_MAX_ACCOUNTS = 20;
16900
+ /**
16901
+ * Mirrors `ASSET_REBALANCE_COOLDOWN_SECS` on-chain. Swapping inside the cooldown
16902
+ * reverts with `AssetRebalanceRateLimitExceeded`, so the run is skipped instead.
16903
+ */
16904
+ declare const ASSET_REBALANCE_COOLDOWN_SECS = 60;
16905
+ type LogFn = (msg: string) => void;
16906
+ /** Why a run did not swap, or that it did. */
16907
+ type IdleLiquidityStatus = "swapped" | "simulated" | "above-floor" | "insufficient-pst" | "rebalance-cooldown" | "rebalance-limit" | "missing-holding" | "stale-price" | "no-tvl" | "failed";
16908
+ interface IdleLiquidityResult {
16909
+ vault: Address;
16910
+ status: IdleLiquidityStatus;
16911
+ /** Human-readable detail for the status, always populated. */
16912
+ reason: string;
16913
+ /** Vault TVL in accounting units. */
16914
+ tvl: bigint;
16915
+ /** Idle USDC (local + external) valued in accounting units. */
16916
+ idleValue: bigint;
16917
+ /** Idle USDC as a share of TVL, in bps. */
16918
+ idleBps: number;
16919
+ /** USDC the swap needs to produce to reach the target, in raw USDC units. */
16920
+ shortfallUsdc: bigint;
16921
+ /** PST spent (0 unless a swap was executed or simulated). */
16922
+ pstSpent: bigint;
16923
+ /** USDC received (0 unless a swap was executed or simulated). */
16924
+ usdcReceived: bigint;
16925
+ signature?: string;
16926
+ }
16927
+ interface IdleLiquidityOptions {
16928
+ log?: LogFn;
16929
+ /** Simulate the swap and stop; nothing is submitted. */
16930
+ dryRun?: boolean;
16931
+ /** Jupiter slippage tolerance for the top-up quote. */
16932
+ slippageBps?: number;
16933
+ /** Priority fee. Set to 0 to omit the compute-unit-price instruction. */
16934
+ cuPriceMicroLamports?: number;
16935
+ /**
16936
+ * Cap on a single swap's PST input, in raw units. Useful to bound price
16937
+ * impact when the shortfall is large; the deficit closes over several runs.
16938
+ */
16939
+ maxPstInput?: bigint;
16940
+ }
16941
+ declare class IdleLiquidityService {
16942
+ private readonly client;
16943
+ constructor(client: VaultClient);
16944
+ /** Current unix time in seconds (override in tests). */
16945
+ protected now(): number;
16946
+ /**
16947
+ * Top up the vault's idle USDC reserve if it has fallen below the floor.
16948
+ * Never throws for an expected no-op — inspect `status` on the result.
16949
+ */
16950
+ run(vault: Address, hwManager: Keypair, opts?: IdleLiquidityOptions): Promise<IdleLiquidityResult>;
16951
+ /**
16952
+ * Decide whether a top-up is warranted. Returns either a terminal `result`
16953
+ * (nothing to do) or the holdings and sizing needed to build the swap.
16954
+ */
16955
+ private assess;
16956
+ /**
16957
+ * Value still chargeable against the vault's rolling rebalance window, in
16958
+ * accounting units. `undefined` when the cap is disabled (unlimited).
16959
+ */
16960
+ private remainingRebalanceAllowance;
16961
+ /**
16962
+ * PST input that buys `shortfallUsdc` at the holdings' recorded prices.
16963
+ * Both prices share the vault's accounting unit, so this is a straight
16964
+ * value conversion; slippage is absorbed by landing slightly under target.
16965
+ */
16966
+ private sizePstInput;
16967
+ private stalenessThresholdSecs;
16968
+ /**
16969
+ * Token program owning a mint. Read from the chain rather than from the
16970
+ * holding's enum so a Token-2022 mint can never be passed to the classic
16971
+ * program (and vice versa).
16972
+ */
16973
+ private mintTokenProgram;
16974
+ /**
16975
+ * Build, simulate, and (unless `dryRun`) submit the `jupiter_swap`.
16976
+ *
16977
+ * Built as a versioned transaction here rather than through
16978
+ * `client.sendTransaction`, because a Jupiter route needs address lookup
16979
+ * tables and a raised compute-unit limit to fit.
16980
+ */
16981
+ private executeSwap;
16670
16982
  }
16671
16983
 
16672
- export { ASSET_DECIMALS, type AccountBalanceResponse, AccountClient, type AccountYieldResponse, ActivateCircuitBreakerBuilder, type ActivateCircuitBreakerIxArgs, type ActivateCircuitBreakerTxArgs, type AssetPriceOracleConfigIxArgs, type AssetPriceOracleConfigTxArgs, type AssetPriceRefreshTarget, type AssetRefreshResult, type Bankineco, type BasicAuthCredentials, type Bigintish, CONSENSUS_ORACLE_VARIANT, CancelJuniorTrancheWithdrawBuilder, type CancelJuniorTrancheWithdrawIxArgs, type CancelJuniorTrancheWithdrawTxArgs, type Clock, type CollectSamplesOptions, type ConsensusAssetUpdate, type ConsensusHoldingEntry, type ConsensusHoldingSimulation, type ConsensusOracleDeps, type ConsensusOracleHoldingConfig, ConsensusOracleService, type ConsensusOracleTarget, CrankNavBuilder, type CrankNavIxArgs, type CrankNavTxArgs, CrankPerformanceFeesBuilder, type CrankPerformanceFeesIxArgs, type CrankPerformanceFeesTxArgs, type CreateAccountParams, CreateAssetHoldingBuilder, type CreateAssetHoldingIxArgs, type CreateAssetHoldingTxArgs, type CreateTokenMintIxs, CreateTrancheStateBuilder, type CreateTrancheStateIxArgs, type CreateTrancheStateTxArgs, CreateVaultBuilder, type CreateVaultClientOptions, type CreateVaultIxArgs, type CreateVaultParams, type CreateVaultTxArgs, type CreateYieldPaymentParams, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, DEFAULT_MIN_AMOUNT_UI, DEFAULT_ORACLE_STALENESS_THRESHOLD_SECS, DEFAULT_PRICE_ORACLE_ACCOUNT, DEFAULT_PRICE_STALENESS_SECS, DEFAULT_PRICE_STALENESS_THRESHOLD_SECS, DEFAULT_VAULT_ID, type DecodedHolding, type DecodedVault, type DecodedVaultTrancheState, type DeleteAccountParams, DisableCircuitBreakerBuilder, type DisableCircuitBreakerIxArgs, type DisableCircuitBreakerTxArgs, EXTERNAL_POSITION_SAMPLES, ExecuteDepositBuilder, type ExecuteDepositIxArgs, type ExecuteDepositTxArgs, ExecuteShareSwapBuilder, type ExecuteShareSwapIxArgs, type ExecuteShareSwapTxArgs, ExecuteTrancheDepositBuilder, type ExecuteTrancheDepositIxArgs, type ExecuteTrancheDepositTxArgs, ExecuteTrancheWithdrawBuilder, type ExecuteTrancheWithdrawIxArgs, type ExecuteTrancheWithdrawTxArgs, ExecuteWithdrawBuilder, type ExecuteWithdrawIxArgs, type ExecuteWithdrawTxArgs, type ExternalLiquidityIntegrityOptions, type ExternalLiquidityIntegrityResult, ExternalLiquidityIntegrityService, type ExternalLiquidityIntegritySummary, type ExternalLiquiditySlot, type ExternalLiquiditySourceArgs, type ExternalPosition, type ExternalPositionContext, type ExternalPositionProvider, type ExternalPositionRef, ExternalPositionRegistry, FEE_VAULT_CACHE_CATEGORY, type FeeVaultAccountData, type FetchNestTokenPriceOptions, FulfillJuniorTrancheWithdrawBuilder, type FulfillJuniorTrancheWithdrawIxArgs, type FulfillJuniorTrancheWithdrawTxArgs, type FulfillSummary, type HoldingNavContribution, type HoldingUpdatePreview, IDL, InitializeVaultRolesBuilder, type InitializeVaultRolesIxArgs, type InitializeVaultRolesTxArgs, type JuniorWithdrawalMode, JupiterBalanceSource, type JupiterBalanceSourceOptions, JupiterPriceSource, type JupiterPriceSourceOptions, JupiterSwapBuilder, type JupiterSwapIxArgs, type JupiterSwapTxArgs, KaminoPositionProvider, LIVE_ORACLE_VARIANTS, LIVE_PRICE_REFRESH_INTERVAL_SECS, LOCAL_PROTOCOL_ADMIN, type LiveConsensusOracleDepsOptions, LivePriceSource, type LivePriceSourceOptions, MAX_CONSENSUS_SIGNERS, MAX_PRICE_STALENESS_THRESHOLD_SECS, MIN_EXTERNAL_POSITION_SAMPLES, ManagerRedepositAssetBuilder, type ManagerRedepositAssetIxArgs, type ManagerRedepositAssetTxArgs, ManagerWithdrawAssetBuilder, type ManagerWithdrawAssetIxArgs, type ManagerWithdrawAssetTxArgs, MarginfiPositionProvider, type MockYieldAccountConfig, MockYieldTracker, type MockYieldTrackerOptions, NEST_RWA_SHARE_MINT, NEST_VAULT_SLUG, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, NestPriceSource, type NestPriceSourceOptions, ORACLE_ENTRIES_OFFSET, ORACLE_ENTRY_SIZE, ORACLE_SETTLED_NAV_TS_OFFSET, OracleService, PRICE_ORACLE_TYPES_BY_INDEX, PROGRAM_FEE_EXEMPT_OWNER_WHITELIST, PROTOCOL_ADMIN, PROTOCOL_FEE_RECIPIENT, PdaClient, type PreparedDirectTransaction, type PreparedSquadsTransaction, type PreparedVaultTransaction, type PriceOracleTypeArgs, type PriceSource, ProtocolInteractionBuilder, type ProtocolInteractionIxArgs, type ProtocolInteractionTxArgs, type QuoteFeeUnit, REPORTABLE_ORACLE_VARIANTS, type RefreshLiveOraclePricesParams, RemoveAssetHoldingBuilder, type RemoveAssetHoldingIxArgs, type RemoveAssetHoldingTxArgs, RequestJuniorTrancheWithdrawBuilder, type RequestJuniorTrancheWithdrawIxArgs, type RequestJuniorTrancheWithdrawTxArgs, type ResolvedSquadsWalletRoute, type RollingLimitConfig, type RunLiveConsensusOracleOptions, type RunOptions, type RunSummary, SHARE_DECIMALS, SYSTEM_PROGRAM, SetAssetPriceOracleBuilder, type SetAssetPriceOracleIxArgs, type SetAssetPriceOracleTxArgs, SetExternalLiquidityBuilder, type SetExternalLiquidityIxArgs, type SetExternalLiquidityTxArgs, SetProtocolFeeBuilder, type SetProtocolFeeIxArgs, type SetProtocolFeeTxArgs, SetVaultConfigBuilder, type SetVaultConfigIxArgs, type SetVaultConfigTxArgs, type SettleVaultParams, type SettleVaultResult, type SettlementSimulation, type SettlementSimulationSnapshot, type SimulateDryRunSettlementParams, type SimulateSettlementArgs, type SimulatedShareClass, type SquadsWalletRouteConfig, StaticPositionProvider, TOKEN_PROGRAM, TOKEN_PROGRAM_ID, type TrancheKindArgs, type TransactionBuilder, TransactionClient, USDC_MINT, USD_STAR_JUNIOR_MINT, USD_STAR_MINT, USD_STAR_PRINCIPAL_MINT, type UpdateAccountParams, UpdateAssetPriceBuilder, type UpdateAssetPriceIxArgs, type UpdateAssetPriceTxArgs, UpdateConsensusOracleBuilder, type UpdateConsensusOracleIxArgs, type UpdateConsensusOracleTxArgs, UpdateConsensusSignersBuilder, type UpdateConsensusSignersIxArgs, type UpdateConsensusSignersTxArgs, type UpdateDynamicAprParams, UpdateTrancheConfigBuilder, type UpdateTrancheConfigIxArgs, type UpdateTrancheConfigTxArgs, VAULT_CACHE_CATEGORY, VAULT_CREATOR_WHITELIST, VAULT_ENVIRONMENTS, VAULT_ORACLE_CACHE_CATEGORY, VAULT_PROGRAM_ID, VAULT_PROGRAM_IDS, VAULT_PROGRAM_PUBLIC_KEY, VAULT_ROLE_UPDATE_TIMELOCK_SECS, VAULT_TRANCHE_STATE_CACHE_CATEGORY, VAULT_TRANCHE_WITHDRAWAL_QUEUE_CACHE_CATEGORY, type Vault, type VaultAccountData, VaultBuilderBase, type VaultBuilderContext, type VaultCacheInvalidation, VaultClient, type VaultClientBundle, type VaultEnv, type VaultOracleAccountData, type VaultOracleResult, type VaultPricingInputs, type VaultQuote, type VaultQuoteArgs, VaultQuoteClient, type VaultQuoteDirection, type VaultQuoteShareClass, VaultReallocationBuilder, type VaultReallocationIxArgs, type VaultReallocationTxArgs, type VaultTrancheStateAccountData, type VaultTrancheWithdrawalQueueAccountData, type VaultTransactionPlan, type WalletBalanceSource, type WithdrawProtocolFeesIxArgs, type WithdrawProtocolFeesTxArgs, type WithdrawTrancheFeesIxArgs, type WithdrawTrancheFeesTxArgs, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldPaymentResponse, type YieldPaymentSnapshot, type YieldTracker, accountingUnitPriceToUsd, addCashflowUpdate, applyEffectiveApy, assertNoUnconfirmedYieldPayments, buildHoldingUpdate, buildUpdates, coerceBool, collectSamples, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, defaultKeypairPath, deleteAccount, discoverVaultsForSigner, fetchExternalPositions, fetchNestTokenPrice, fetchReceiptMints, filterTargetHoldings, findSquadsWalletRoute, formatSettlementSimulation, fromUiAmount, gatherPricingInputs, getAccounts, getBalance, getCashflows, getRpcUrl, getTotalOutstandingYield, getTotalYield, getVaultProgramId, getYield, getYieldPayments, indexConfigByMint, isVaultEnv, keypairAddress, loadKeypair, logProspectiveApy, makeProvider, mintTokensTo, mostFrequent, parseExternalLiquidityRefs, prepareVaultTransaction, priceInAccountingUnit, readI64LE, readSplMintSupply, refreshLiveOraclePrices, resolveKeypairPath, resolveSquadsWalletRoute, resolveTrackedAmounts, roundToNextUtcMidnight, runLiveConsensusOracle, selectReportableHoldings, settleVault, signerInOracleData, simulateConsensusOracleSettlement, simulateDryRunSettlement, sumPositionsByMint, systemClock, toBigInt, toUiAmount, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, variantName, vaultAuthorityForWallet, withDiscoveredYieldAccounts };
16984
+ export { ASSET_DECIMALS, ASSET_REBALANCE_COOLDOWN_SECS, type AccountBalanceResponse, AccountClient, type AccountYieldResponse, ActivateCircuitBreakerBuilder, type ActivateCircuitBreakerIxArgs, type ActivateCircuitBreakerTxArgs, type AssetPriceOracleConfigIxArgs, type AssetPriceOracleConfigTxArgs, type AssetPriceRefreshTarget, type AssetRefreshResult, type Bankineco, type BasicAuthCredentials, type Bigintish, CONSENSUS_ORACLE_VARIANT, CancelJuniorTrancheWithdrawBuilder, type CancelJuniorTrancheWithdrawIxArgs, type CancelJuniorTrancheWithdrawTxArgs, type Clock, type CollectSamplesOptions, type ConsensusAssetUpdate, type ConsensusHoldingEntry, type ConsensusHoldingSimulation, type ConsensusOracleDeps, type ConsensusOracleHoldingConfig, ConsensusOracleService, type ConsensusOracleTarget, CrankNavBuilder, type CrankNavIxArgs, type CrankNavTxArgs, CrankPerformanceFeesBuilder, type CrankPerformanceFeesIxArgs, type CrankPerformanceFeesTxArgs, type CreateAccountParams, CreateAssetHoldingBuilder, type CreateAssetHoldingIxArgs, type CreateAssetHoldingTxArgs, type CreateTokenMintIxs, CreateTrancheStateBuilder, type CreateTrancheStateIxArgs, type CreateTrancheStateTxArgs, CreateVaultBuilder, type CreateVaultClientOptions, type CreateVaultIxArgs, type CreateVaultParams, type CreateVaultTxArgs, type CreateYieldPaymentParams, DEFAULT_CU_PRICE_MICRO_LAMPORTS, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, DEFAULT_MAX_ACCOUNTS, DEFAULT_MIN_AMOUNT_UI, DEFAULT_ORACLE_STALENESS_THRESHOLD_SECS, DEFAULT_PRICE_ORACLE_ACCOUNT, DEFAULT_PRICE_STALENESS_SECS, DEFAULT_PRICE_STALENESS_THRESHOLD_SECS, DEFAULT_REBALANCE_BAND_BPS, DEFAULT_SLIPPAGE_BPS, DEFAULT_TARGET_LOCAL_BPS, DEFAULT_VAULT_ID, type DecodedHolding, type DecodedVault, type DecodedVaultTrancheState, type DeleteAccountParams, DisableCircuitBreakerBuilder, type DisableCircuitBreakerIxArgs, type DisableCircuitBreakerTxArgs, EXTERNAL_POSITION_SAMPLES, ExecuteDepositBuilder, type ExecuteDepositIxArgs, type ExecuteDepositTxArgs, ExecuteShareSwapBuilder, type ExecuteShareSwapIxArgs, type ExecuteShareSwapTxArgs, ExecuteTrancheDepositBuilder, type ExecuteTrancheDepositIxArgs, type ExecuteTrancheDepositTxArgs, ExecuteTrancheWithdrawBuilder, type ExecuteTrancheWithdrawIxArgs, type ExecuteTrancheWithdrawTxArgs, ExecuteWithdrawBuilder, type ExecuteWithdrawIxArgs, type ExecuteWithdrawTxArgs, type ExternalLiquidityIntegrityOptions, type ExternalLiquidityIntegrityResult, ExternalLiquidityIntegrityService, type ExternalLiquidityIntegritySummary, type ExternalLiquiditySlot, type ExternalLiquiditySourceArgs, type ExternalPosition, type ExternalPositionContext, type ExternalPositionProvider, type ExternalPositionRef, ExternalPositionRegistry, FEE_VAULT_CACHE_CATEGORY, type FeeVaultAccountData, type FetchNestTokenPriceOptions, FulfillJuniorTrancheWithdrawBuilder, type FulfillJuniorTrancheWithdrawIxArgs, type FulfillJuniorTrancheWithdrawTxArgs, type FulfillSummary, type HoldingNavContribution, type HoldingUpdatePreview, IDL, IDLE_RESERVE_FLOOR_BPS, IDLE_RESERVE_TARGET_BPS, type IdleLiquidityOptions, type IdleLiquidityResult, IdleLiquidityService, type IdleLiquidityStatus, InitializeVaultRolesBuilder, type InitializeVaultRolesIxArgs, type InitializeVaultRolesTxArgs, type JuniorWithdrawalMode, JupiterBalanceSource, type JupiterBalanceSourceOptions, JupiterPriceSource, type JupiterPriceSourceOptions, JupiterSwapBuilder, type JupiterSwapIxArgs, type JupiterSwapTxArgs, KaminoPositionProvider, LIVE_ORACLE_VARIANTS, LIVE_PRICE_REFRESH_INTERVAL_SECS, LOCAL_PROTOCOL_ADMIN, type LiveConsensusOracleDepsOptions, LivePriceSource, type LivePriceSourceOptions, MAX_CONSENSUS_SIGNERS, MAX_PRICE_STALENESS_THRESHOLD_SECS, MIN_EXTERNAL_POSITION_SAMPLES, ManagerRedepositAssetBuilder, type ManagerRedepositAssetIxArgs, type ManagerRedepositAssetTxArgs, ManagerWithdrawAssetBuilder, type ManagerWithdrawAssetIxArgs, type ManagerWithdrawAssetTxArgs, MarginfiPositionProvider, type MockYieldAccountConfig, MockYieldTracker, type MockYieldTrackerOptions, NEST_RWA_SHARE_MINT, NEST_VAULT_SLUG, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, NestPriceSource, type NestPriceSourceOptions, ORACLE_ENTRIES_OFFSET, ORACLE_ENTRY_SIZE, ORACLE_SETTLED_NAV_TS_OFFSET, OracleService, PRICE_ORACLE_TYPES_BY_INDEX, PROGRAM_FEE_EXEMPT_OWNER_WHITELIST, PROTOCOL_ADMIN, PROTOCOL_FEE_RECIPIENT, PdaClient, type PreparedDirectTransaction, type PreparedSquadsTransaction, type PreparedVaultTransaction, type PriceOracleTypeArgs, type PriceSource, ProtocolInteractionBuilder, type ProtocolInteractionIxArgs, type ProtocolInteractionTxArgs, type QuoteFeeUnit, REPORTABLE_ORACLE_VARIANTS, type RefreshLiveOraclePricesParams, RemoveAssetHoldingBuilder, type RemoveAssetHoldingIxArgs, type RemoveAssetHoldingTxArgs, RequestJuniorTrancheWithdrawBuilder, type RequestJuniorTrancheWithdrawIxArgs, type RequestJuniorTrancheWithdrawTxArgs, type ResolvedSquadsWalletRoute, type RollingLimitConfig, type RollingRebalanceLimitConfig, type RunLiveConsensusOracleOptions, type RunOptions, type RunSummary, SHARE_DECIMALS, SYSTEM_PROGRAM, SetAssetPriceOracleBuilder, type SetAssetPriceOracleIxArgs, type SetAssetPriceOracleTxArgs, SetExternalLiquidityBuilder, type SetExternalLiquidityIxArgs, type SetExternalLiquidityTxArgs, SetProtocolFeeBuilder, type SetProtocolFeeIxArgs, type SetProtocolFeeTxArgs, SetVaultConfigBuilder, type SetVaultConfigIxArgs, type SetVaultConfigTxArgs, type SettleVaultParams, type SettleVaultResult, type SettlementSimulation, type SettlementSimulationSnapshot, type SimulateDryRunSettlementParams, type SimulateSettlementArgs, type SimulatedShareClass, type SquadsWalletRouteConfig, StaticPositionProvider, TOKEN_PROGRAM, TOKEN_PROGRAM_ID, type TrancheKindArgs, type TransactionBuilder, TransactionClient, USDC_MINT, USD_STAR_JUNIOR_MINT, USD_STAR_MINT, USD_STAR_PRINCIPAL_MINT, type UpdateAccountParams, UpdateAssetPriceBuilder, type UpdateAssetPriceIxArgs, type UpdateAssetPriceTxArgs, UpdateConsensusOracleBuilder, type UpdateConsensusOracleIxArgs, type UpdateConsensusOracleTxArgs, UpdateConsensusSignersBuilder, type UpdateConsensusSignersIxArgs, type UpdateConsensusSignersTxArgs, type UpdateDynamicAprParams, UpdateTrancheConfigBuilder, type UpdateTrancheConfigIxArgs, type UpdateTrancheConfigTxArgs, VAULT_CACHE_CATEGORY, VAULT_CREATOR_WHITELIST, VAULT_ENVIRONMENTS, VAULT_ORACLE_CACHE_CATEGORY, VAULT_PROGRAM_ID, VAULT_PROGRAM_IDS, VAULT_PROGRAM_PUBLIC_KEY, VAULT_ROLE_UPDATE_TIMELOCK_SECS, VAULT_TRANCHE_STATE_CACHE_CATEGORY, VAULT_TRANCHE_WITHDRAWAL_QUEUE_CACHE_CATEGORY, type Vault, type VaultAccountData, VaultBuilderBase, type VaultBuilderContext, type VaultCacheInvalidation, VaultClient, type VaultClientBundle, type VaultEnv, type VaultOracleAccountData, type VaultOracleResult, type VaultPricingInputs, type VaultQuote, type VaultQuoteArgs, VaultQuoteClient, type VaultQuoteDirection, type VaultQuoteShareClass, VaultReallocationBuilder, type VaultReallocationIxArgs, type VaultReallocationTxArgs, type VaultTrancheStateAccountData, type VaultTrancheWithdrawalQueueAccountData, type VaultTransactionPlan, type WalletBalanceSource, type WithdrawProtocolFeesIxArgs, type WithdrawProtocolFeesTxArgs, type WithdrawTrancheFeesIxArgs, type WithdrawTrancheFeesTxArgs, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldPaymentResponse, type YieldPaymentSnapshot, type YieldTracker, accountingUnitPriceToUsd, addCashflowUpdate, applyEffectiveApy, assertNoUnconfirmedYieldPayments, buildHoldingUpdate, buildUpdates, coerceBool, collectSamples, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, defaultKeypairPath, deleteAccount, discoverVaultsForSigner, fetchExternalPositions, fetchNestTokenPrice, fetchReceiptMints, filterTargetHoldings, findSquadsWalletRoute, formatSettlementSimulation, fromUiAmount, gatherPricingInputs, getAccounts, getBalance, getCashflows, getRpcUrl, getTotalOutstandingYield, getTotalYield, getVaultProgramId, getYield, getYieldPayments, indexConfigByMint, isVaultEnv, keypairAddress, loadKeypair, logProspectiveApy, makeProvider, mintTokensTo, mostFrequent, parseExternalLiquidityRefs, planRebalance, prepareVaultTransaction, priceInAccountingUnit, readI64LE, readSplMintSupply, refreshLiveOraclePrices, resolveKeypairPath, resolveSquadsWalletRoute, resolveTrackedAmounts, roundToNextUtcMidnight, runLiveConsensusOracle, selectReportableHoldings, settleVault, signerInOracleData, simulateConsensusOracleSettlement, simulateDryRunSettlement, sumPositionsByMint, systemClock, toBigInt, toUiAmount, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, variantName, vaultAuthorityForWallet, withDiscoveredYieldAccounts };