@perena/vault-sdk 1.0.26 → 1.0.28
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 +546 -410
- package/dist/index.js +3983 -1940
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,14 @@ import * as _solana_kit from '@solana/kit';
|
|
|
2
2
|
import { Address, ProgramDerivedAddressBump, Rpc, SolanaRpcApi, Instruction } from '@solana/kit';
|
|
3
3
|
export { address } from '@solana/kit';
|
|
4
4
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
5
|
-
import { PublicKey, Connection, Keypair, Transaction, TransactionInstruction } from '@solana/web3.js';
|
|
5
|
+
import { PublicKey, Connection, Keypair, SimulatedTransactionResponse, Transaction, TransactionInstruction } from '@solana/web3.js';
|
|
6
6
|
import * as _anchor_lang_core from '@anchor-lang/core';
|
|
7
7
|
import { Program, IdlAccounts, BN, AnchorProvider } from '@anchor-lang/core';
|
|
8
8
|
import * as common from 'common';
|
|
9
9
|
import { BaseAccountClient, InstructionRefs, CustomAccountMeta, TransactionPlan, SingleInstructionBuilderService } from 'common';
|
|
10
|
+
import { FetchJupiterUsdPricesOptions, FetchJupiterBalancesOptions } from 'jupiter';
|
|
11
|
+
import { FetchNestVaultSharePriceOptions } from 'nest';
|
|
12
|
+
export { NEST_API_BASE_URL } from 'nest';
|
|
10
13
|
|
|
11
14
|
/** Bankineco program id (local). Hosts new vault instructions. */
|
|
12
15
|
declare const VAULT_PROGRAM_ID: Address;
|
|
@@ -4762,66 +4765,6 @@ type Bankineco = {
|
|
|
4762
4765
|
};
|
|
4763
4766
|
};
|
|
4764
4767
|
},
|
|
4765
|
-
{
|
|
4766
|
-
"name": "feeCollector";
|
|
4767
|
-
},
|
|
4768
|
-
{
|
|
4769
|
-
"name": "feeCollectorOutputAta";
|
|
4770
|
-
"writable": true;
|
|
4771
|
-
"pda": {
|
|
4772
|
-
"seeds": [
|
|
4773
|
-
{
|
|
4774
|
-
"kind": "account";
|
|
4775
|
-
"path": "feeCollector";
|
|
4776
|
-
},
|
|
4777
|
-
{
|
|
4778
|
-
"kind": "account";
|
|
4779
|
-
"path": "assetTokenProgram";
|
|
4780
|
-
},
|
|
4781
|
-
{
|
|
4782
|
-
"kind": "account";
|
|
4783
|
-
"path": "outputMint";
|
|
4784
|
-
}
|
|
4785
|
-
];
|
|
4786
|
-
"program": {
|
|
4787
|
-
"kind": "const";
|
|
4788
|
-
"value": [
|
|
4789
|
-
140,
|
|
4790
|
-
151,
|
|
4791
|
-
37,
|
|
4792
|
-
143,
|
|
4793
|
-
78,
|
|
4794
|
-
36,
|
|
4795
|
-
137,
|
|
4796
|
-
241,
|
|
4797
|
-
187,
|
|
4798
|
-
61,
|
|
4799
|
-
16,
|
|
4800
|
-
41,
|
|
4801
|
-
20,
|
|
4802
|
-
142,
|
|
4803
|
-
13,
|
|
4804
|
-
131,
|
|
4805
|
-
11,
|
|
4806
|
-
90,
|
|
4807
|
-
19,
|
|
4808
|
-
153,
|
|
4809
|
-
218,
|
|
4810
|
-
255,
|
|
4811
|
-
16,
|
|
4812
|
-
132,
|
|
4813
|
-
4,
|
|
4814
|
-
142,
|
|
4815
|
-
123,
|
|
4816
|
-
216,
|
|
4817
|
-
219,
|
|
4818
|
-
233,
|
|
4819
|
-
248,
|
|
4820
|
-
89
|
|
4821
|
-
];
|
|
4822
|
-
};
|
|
4823
|
-
};
|
|
4824
|
-
},
|
|
4825
4768
|
{
|
|
4826
4769
|
"name": "queueInputAta";
|
|
4827
4770
|
"writable": true;
|
|
@@ -4894,7 +4837,24 @@ type Bankineco = {
|
|
|
4894
4837
|
"address": "11111111111111111111111111111111";
|
|
4895
4838
|
}
|
|
4896
4839
|
];
|
|
4897
|
-
"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
|
+
];
|
|
4898
4858
|
},
|
|
4899
4859
|
{
|
|
4900
4860
|
"name": "fulfillJuniorTrancheWithdrawFeeExempt";
|
|
@@ -5061,66 +5021,6 @@ type Bankineco = {
|
|
|
5061
5021
|
};
|
|
5062
5022
|
};
|
|
5063
5023
|
},
|
|
5064
|
-
{
|
|
5065
|
-
"name": "feeCollector";
|
|
5066
|
-
},
|
|
5067
|
-
{
|
|
5068
|
-
"name": "feeCollectorOutputAta";
|
|
5069
|
-
"writable": true;
|
|
5070
|
-
"pda": {
|
|
5071
|
-
"seeds": [
|
|
5072
|
-
{
|
|
5073
|
-
"kind": "account";
|
|
5074
|
-
"path": "feeCollector";
|
|
5075
|
-
},
|
|
5076
|
-
{
|
|
5077
|
-
"kind": "account";
|
|
5078
|
-
"path": "assetTokenProgram";
|
|
5079
|
-
},
|
|
5080
|
-
{
|
|
5081
|
-
"kind": "account";
|
|
5082
|
-
"path": "outputMint";
|
|
5083
|
-
}
|
|
5084
|
-
];
|
|
5085
|
-
"program": {
|
|
5086
|
-
"kind": "const";
|
|
5087
|
-
"value": [
|
|
5088
|
-
140,
|
|
5089
|
-
151,
|
|
5090
|
-
37,
|
|
5091
|
-
143,
|
|
5092
|
-
78,
|
|
5093
|
-
36,
|
|
5094
|
-
137,
|
|
5095
|
-
241,
|
|
5096
|
-
187,
|
|
5097
|
-
61,
|
|
5098
|
-
16,
|
|
5099
|
-
41,
|
|
5100
|
-
20,
|
|
5101
|
-
142,
|
|
5102
|
-
13,
|
|
5103
|
-
131,
|
|
5104
|
-
11,
|
|
5105
|
-
90,
|
|
5106
|
-
19,
|
|
5107
|
-
153,
|
|
5108
|
-
218,
|
|
5109
|
-
255,
|
|
5110
|
-
16,
|
|
5111
|
-
132,
|
|
5112
|
-
4,
|
|
5113
|
-
142,
|
|
5114
|
-
123,
|
|
5115
|
-
216,
|
|
5116
|
-
219,
|
|
5117
|
-
233,
|
|
5118
|
-
248,
|
|
5119
|
-
89
|
|
5120
|
-
];
|
|
5121
|
-
};
|
|
5122
|
-
};
|
|
5123
|
-
},
|
|
5124
5024
|
{
|
|
5125
5025
|
"name": "queueInputAta";
|
|
5126
5026
|
"writable": true;
|
|
@@ -5194,6 +5094,22 @@ type Bankineco = {
|
|
|
5194
5094
|
}
|
|
5195
5095
|
];
|
|
5196
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
|
+
},
|
|
5197
5113
|
{
|
|
5198
5114
|
"name": "signerSeeds";
|
|
5199
5115
|
"type": {
|
|
@@ -9533,239 +9449,229 @@ type Bankineco = {
|
|
|
9533
9449
|
];
|
|
9534
9450
|
"errors": [
|
|
9535
9451
|
{
|
|
9536
|
-
"code":
|
|
9537
|
-
"name": "
|
|
9538
|
-
"msg": "
|
|
9539
|
-
},
|
|
9540
|
-
{
|
|
9541
|
-
"code": 14002;
|
|
9542
|
-
"name": "invalidBankMint";
|
|
9543
|
-
"msg": "Invalid mint";
|
|
9452
|
+
"code": 6000;
|
|
9453
|
+
"name": "mintSupplyNonZero";
|
|
9454
|
+
"msg": "Supplied share mint already has non-zero supply";
|
|
9544
9455
|
},
|
|
9545
9456
|
{
|
|
9546
|
-
"code":
|
|
9547
|
-
"name": "
|
|
9548
|
-
"msg": "
|
|
9457
|
+
"code": 6001;
|
|
9458
|
+
"name": "invalidAssetMint";
|
|
9459
|
+
"msg": "Supplied mint is not accepted by this vault";
|
|
9549
9460
|
},
|
|
9550
9461
|
{
|
|
9551
|
-
"code":
|
|
9552
|
-
"name": "
|
|
9553
|
-
"msg": "
|
|
9462
|
+
"code": 6002;
|
|
9463
|
+
"name": "zeroDepositAmount";
|
|
9464
|
+
"msg": "Deposit amount must be greater than zero";
|
|
9554
9465
|
},
|
|
9555
9466
|
{
|
|
9556
|
-
"code":
|
|
9557
|
-
"name": "
|
|
9558
|
-
"msg": "
|
|
9467
|
+
"code": 6003;
|
|
9468
|
+
"name": "exceedsTvlLimit";
|
|
9469
|
+
"msg": "Deposit would exceed the vault's TVL limit";
|
|
9559
9470
|
},
|
|
9560
9471
|
{
|
|
9561
|
-
"code":
|
|
9562
|
-
"name": "
|
|
9563
|
-
"msg": "
|
|
9472
|
+
"code": 6004;
|
|
9473
|
+
"name": "zeroBurnAmount";
|
|
9474
|
+
"msg": "Burn amount must be greater than zero";
|
|
9564
9475
|
},
|
|
9565
9476
|
{
|
|
9566
|
-
"code":
|
|
9567
|
-
"name": "
|
|
9568
|
-
"msg": "
|
|
9477
|
+
"code": 6005;
|
|
9478
|
+
"name": "zeroAssetAmount";
|
|
9479
|
+
"msg": "Asset amount must be greater than zero";
|
|
9569
9480
|
},
|
|
9570
9481
|
{
|
|
9571
|
-
"code":
|
|
9572
|
-
"name": "
|
|
9573
|
-
"msg": "
|
|
9482
|
+
"code": 6006;
|
|
9483
|
+
"name": "insufficientVaultLiquidity";
|
|
9484
|
+
"msg": "Insufficient vault liquidity to satisfy withdrawal";
|
|
9574
9485
|
},
|
|
9575
9486
|
{
|
|
9576
|
-
"code":
|
|
9577
|
-
"name": "
|
|
9578
|
-
"msg": "
|
|
9487
|
+
"code": 6007;
|
|
9488
|
+
"name": "mintAuthorityNotCurator";
|
|
9489
|
+
"msg": "Mint authority is not the curator";
|
|
9579
9490
|
},
|
|
9580
9491
|
{
|
|
9581
|
-
"code":
|
|
9582
|
-
"name": "
|
|
9583
|
-
"msg": "
|
|
9492
|
+
"code": 6008;
|
|
9493
|
+
"name": "zeroTotalSupply";
|
|
9494
|
+
"msg": "Vault total supply is zero";
|
|
9584
9495
|
},
|
|
9585
9496
|
{
|
|
9586
|
-
"code":
|
|
9587
|
-
"name": "oracleAccountAlreadyExists";
|
|
9588
|
-
"msg": "Oracle account already exists";
|
|
9589
|
-
},
|
|
9590
|
-
{
|
|
9591
|
-
"code": 14012;
|
|
9497
|
+
"code": 6009;
|
|
9592
9498
|
"name": "staleOracle";
|
|
9593
|
-
"msg": "
|
|
9499
|
+
"msg": "Vault oracle is stale";
|
|
9594
9500
|
},
|
|
9595
9501
|
{
|
|
9596
|
-
"code":
|
|
9597
|
-
"name": "
|
|
9598
|
-
"msg": "
|
|
9502
|
+
"code": 6010;
|
|
9503
|
+
"name": "invalidOracleUpdate";
|
|
9504
|
+
"msg": "Invalid oracle update";
|
|
9599
9505
|
},
|
|
9600
9506
|
{
|
|
9601
|
-
"code":
|
|
9602
|
-
"name": "
|
|
9603
|
-
"msg": "
|
|
9507
|
+
"code": 6011;
|
|
9508
|
+
"name": "invalidInitialMintSharePrice";
|
|
9509
|
+
"msg": "Initial mint share price must be greater than zero";
|
|
9604
9510
|
},
|
|
9605
9511
|
{
|
|
9606
|
-
"code":
|
|
9607
|
-
"name": "
|
|
9608
|
-
"msg": "
|
|
9512
|
+
"code": 6012;
|
|
9513
|
+
"name": "maxApyExceeded";
|
|
9514
|
+
"msg": "Oracle NAV update exceeds the vault's maximum acceptable APY";
|
|
9609
9515
|
},
|
|
9610
9516
|
{
|
|
9611
|
-
"code":
|
|
9612
|
-
"name": "
|
|
9613
|
-
"msg": "
|
|
9517
|
+
"code": 6013;
|
|
9518
|
+
"name": "invalidApyConfig";
|
|
9519
|
+
"msg": "Invalid APY configuration";
|
|
9614
9520
|
},
|
|
9615
9521
|
{
|
|
9616
|
-
"code":
|
|
9617
|
-
"name": "
|
|
9618
|
-
"msg": "
|
|
9522
|
+
"code": 6014;
|
|
9523
|
+
"name": "invalidFeeConfig";
|
|
9524
|
+
"msg": "Invalid fee configuration";
|
|
9619
9525
|
},
|
|
9620
9526
|
{
|
|
9621
|
-
"code":
|
|
9622
|
-
"name": "
|
|
9623
|
-
"msg": "
|
|
9527
|
+
"code": 6015;
|
|
9528
|
+
"name": "vaultHasLiveAssets";
|
|
9529
|
+
"msg": "Vault has live supply, TVL, or holdings";
|
|
9624
9530
|
},
|
|
9625
9531
|
{
|
|
9626
|
-
"code":
|
|
9627
|
-
"name": "
|
|
9628
|
-
"msg": "
|
|
9532
|
+
"code": 6016;
|
|
9533
|
+
"name": "depositMintsZeroShares";
|
|
9534
|
+
"msg": "Deposit would mint zero shares";
|
|
9629
9535
|
},
|
|
9630
9536
|
{
|
|
9631
|
-
"code":
|
|
9632
|
-
"name": "
|
|
9633
|
-
"msg": "
|
|
9537
|
+
"code": 6017;
|
|
9538
|
+
"name": "insufficientAccruedApyBalance";
|
|
9539
|
+
"msg": "Insufficient accrued APY balance";
|
|
9634
9540
|
},
|
|
9635
9541
|
{
|
|
9636
|
-
"code":
|
|
9637
|
-
"name": "
|
|
9638
|
-
"msg": "
|
|
9542
|
+
"code": 6018;
|
|
9543
|
+
"name": "invalidRole";
|
|
9544
|
+
"msg": "Invalid role configuration";
|
|
9639
9545
|
},
|
|
9640
9546
|
{
|
|
9641
|
-
"code":
|
|
9642
|
-
"name": "
|
|
9643
|
-
"msg": "
|
|
9547
|
+
"code": 6019;
|
|
9548
|
+
"name": "invalidProtocolInteraction";
|
|
9549
|
+
"msg": "Invalid protocol interaction CPI";
|
|
9644
9550
|
},
|
|
9645
9551
|
{
|
|
9646
|
-
"code":
|
|
9647
|
-
"name": "
|
|
9648
|
-
"msg": "
|
|
9552
|
+
"code": 6020;
|
|
9553
|
+
"name": "reserved7020";
|
|
9554
|
+
"msg": "reserved";
|
|
9649
9555
|
},
|
|
9650
9556
|
{
|
|
9651
|
-
"code":
|
|
9652
|
-
"name": "
|
|
9653
|
-
"msg": "Invalid
|
|
9557
|
+
"code": 6021;
|
|
9558
|
+
"name": "invalidExternalLiquidity";
|
|
9559
|
+
"msg": "Invalid external liquidity configuration";
|
|
9654
9560
|
},
|
|
9655
9561
|
{
|
|
9656
|
-
"code":
|
|
9657
|
-
"name": "
|
|
9658
|
-
"msg": "
|
|
9562
|
+
"code": 6022;
|
|
9563
|
+
"name": "swapBalanceUnchanged";
|
|
9564
|
+
"msg": "Swap did not change both source and destination balances";
|
|
9659
9565
|
},
|
|
9660
9566
|
{
|
|
9661
|
-
"code":
|
|
9662
|
-
"name": "
|
|
9663
|
-
"msg": "
|
|
9567
|
+
"code": 6023;
|
|
9568
|
+
"name": "protocolBalanceUnchanged";
|
|
9569
|
+
"msg": "Protocol interaction did not change the affected token balance";
|
|
9664
9570
|
},
|
|
9665
9571
|
{
|
|
9666
|
-
"code":
|
|
9667
|
-
"name": "
|
|
9668
|
-
"msg": "
|
|
9572
|
+
"code": 6024;
|
|
9573
|
+
"name": "excessiveSwapSlippage";
|
|
9574
|
+
"msg": "Swap TVL loss exceeds the allowed slippage";
|
|
9669
9575
|
},
|
|
9670
9576
|
{
|
|
9671
|
-
"code":
|
|
9672
|
-
"name": "
|
|
9673
|
-
"msg": "
|
|
9577
|
+
"code": 6025;
|
|
9578
|
+
"name": "tranchingNotEnabled";
|
|
9579
|
+
"msg": "Vault tranching is not enabled";
|
|
9674
9580
|
},
|
|
9675
9581
|
{
|
|
9676
|
-
"code":
|
|
9677
|
-
"name": "
|
|
9678
|
-
"msg": "
|
|
9582
|
+
"code": 6026;
|
|
9583
|
+
"name": "tranchingAlreadyEnabled";
|
|
9584
|
+
"msg": "Vault tranching is already enabled";
|
|
9679
9585
|
},
|
|
9680
9586
|
{
|
|
9681
|
-
"code":
|
|
9682
|
-
"name": "
|
|
9683
|
-
"msg": "
|
|
9587
|
+
"code": 6027;
|
|
9588
|
+
"name": "trancheStateRequired";
|
|
9589
|
+
"msg": "Tranche state account is required";
|
|
9684
9590
|
},
|
|
9685
9591
|
{
|
|
9686
|
-
"code":
|
|
9687
|
-
"name": "
|
|
9688
|
-
"msg": "
|
|
9592
|
+
"code": 6028;
|
|
9593
|
+
"name": "invalidTrancheConfig";
|
|
9594
|
+
"msg": "Invalid tranche configuration";
|
|
9689
9595
|
},
|
|
9690
9596
|
{
|
|
9691
|
-
"code":
|
|
9692
|
-
"name": "
|
|
9693
|
-
"msg": "Invalid
|
|
9597
|
+
"code": 6029;
|
|
9598
|
+
"name": "invalidTrancheMint";
|
|
9599
|
+
"msg": "Invalid tranche mint";
|
|
9694
9600
|
},
|
|
9695
9601
|
{
|
|
9696
|
-
"code":
|
|
9697
|
-
"name": "
|
|
9698
|
-
"msg": "
|
|
9602
|
+
"code": 6030;
|
|
9603
|
+
"name": "lossesDisabled";
|
|
9604
|
+
"msg": "Vault losses are not enabled";
|
|
9699
9605
|
},
|
|
9700
9606
|
{
|
|
9701
|
-
"code":
|
|
9702
|
-
"name": "
|
|
9703
|
-
"msg": "
|
|
9607
|
+
"code": 6031;
|
|
9608
|
+
"name": "withdrawalQueueNotExpired";
|
|
9609
|
+
"msg": "Withdrawal queue is not yet expired";
|
|
9704
9610
|
},
|
|
9705
9611
|
{
|
|
9706
|
-
"code":
|
|
9707
|
-
"name": "
|
|
9708
|
-
"msg": "Invalid
|
|
9612
|
+
"code": 6032;
|
|
9613
|
+
"name": "invalidWithdrawalQueue";
|
|
9614
|
+
"msg": "Invalid withdrawal queue";
|
|
9709
9615
|
},
|
|
9710
9616
|
{
|
|
9711
|
-
"code":
|
|
9712
|
-
"name": "
|
|
9713
|
-
"msg": "
|
|
9617
|
+
"code": 6033;
|
|
9618
|
+
"name": "assetPriceNotSet";
|
|
9619
|
+
"msg": "Destination asset has no price set; a consensus oracle price is required before swapping";
|
|
9714
9620
|
},
|
|
9715
9621
|
{
|
|
9716
|
-
"code":
|
|
9717
|
-
"name": "
|
|
9718
|
-
"msg": "
|
|
9622
|
+
"code": 6034;
|
|
9623
|
+
"name": "assetHoldingNotEmpty";
|
|
9624
|
+
"msg": "Asset holding still has a balance and cannot be removed";
|
|
9719
9625
|
},
|
|
9720
9626
|
{
|
|
9721
|
-
"code":
|
|
9722
|
-
"name": "
|
|
9723
|
-
"msg": "
|
|
9627
|
+
"code": 6035;
|
|
9628
|
+
"name": "cannotRemoveBaseHolding";
|
|
9629
|
+
"msg": "The base asset holding cannot be removed";
|
|
9724
9630
|
},
|
|
9725
9631
|
{
|
|
9726
|
-
"code":
|
|
9727
|
-
"name": "
|
|
9728
|
-
"msg": "
|
|
9632
|
+
"code": 6036;
|
|
9633
|
+
"name": "unauthorizedPriceUpdater";
|
|
9634
|
+
"msg": "Caller is not authorized to trigger an asset price update";
|
|
9729
9635
|
},
|
|
9730
9636
|
{
|
|
9731
|
-
"code":
|
|
9732
|
-
"name": "
|
|
9733
|
-
"msg": "
|
|
9637
|
+
"code": 6037;
|
|
9638
|
+
"name": "invalidStalenessConfig";
|
|
9639
|
+
"msg": "Invalid asset-price staleness threshold";
|
|
9734
9640
|
},
|
|
9735
9641
|
{
|
|
9736
|
-
"code":
|
|
9737
|
-
"name": "
|
|
9738
|
-
"msg": "
|
|
9642
|
+
"code": 6038;
|
|
9643
|
+
"name": "assetRebalanceRateLimitExceeded";
|
|
9644
|
+
"msg": "Asset was rebalanced too recently";
|
|
9739
9645
|
},
|
|
9740
9646
|
{
|
|
9741
|
-
"code":
|
|
9742
|
-
"name": "
|
|
9743
|
-
"msg": "
|
|
9647
|
+
"code": 6039;
|
|
9648
|
+
"name": "invalidShareTokenProgram";
|
|
9649
|
+
"msg": "Share token program does not match the vault/tranche mint configuration";
|
|
9744
9650
|
},
|
|
9745
9651
|
{
|
|
9746
|
-
"code":
|
|
9747
|
-
"name": "
|
|
9748
|
-
"msg": "
|
|
9652
|
+
"code": 6040;
|
|
9653
|
+
"name": "unauthorizedVaultCreator";
|
|
9654
|
+
"msg": "Caller is not on the vault-creator whitelist";
|
|
9749
9655
|
},
|
|
9750
9656
|
{
|
|
9751
|
-
"code":
|
|
9752
|
-
"name": "
|
|
9753
|
-
"msg": "
|
|
9657
|
+
"code": 6041;
|
|
9658
|
+
"name": "invalidShareMintDecimals";
|
|
9659
|
+
"msg": "Share mint decimals must match the vault accounting decimals";
|
|
9754
9660
|
},
|
|
9755
9661
|
{
|
|
9756
|
-
"code":
|
|
9757
|
-
"name": "
|
|
9758
|
-
"msg": "
|
|
9662
|
+
"code": 6042;
|
|
9663
|
+
"name": "invalidFeeExemption";
|
|
9664
|
+
"msg": "Invalid fee-exemption PDA signer or seeds";
|
|
9759
9665
|
},
|
|
9760
9666
|
{
|
|
9761
|
-
"code":
|
|
9762
|
-
"name": "
|
|
9763
|
-
"msg": "
|
|
9667
|
+
"code": 6043;
|
|
9668
|
+
"name": "exceedsJuniorDepositCap";
|
|
9669
|
+
"msg": "Deposit would exceed the junior tranche deposit cap";
|
|
9764
9670
|
},
|
|
9765
9671
|
{
|
|
9766
|
-
"code":
|
|
9767
|
-
"name": "
|
|
9768
|
-
"msg": "
|
|
9672
|
+
"code": 6044;
|
|
9673
|
+
"name": "invalidShareSupply";
|
|
9674
|
+
"msg": "Physical share-mint supply does not match effective supply accounting";
|
|
9769
9675
|
}
|
|
9770
9676
|
];
|
|
9771
9677
|
"types": [
|
|
@@ -10146,9 +10052,7 @@ type Bankineco = {
|
|
|
10146
10052
|
"Holdings are addressed by their slot index (1 byte) to keep instruction data",
|
|
10147
10053
|
"small. To register a brand-new consensus holding, set `mint` to its mint",
|
|
10148
10054
|
"(and pass the matching `asset_mint` account); the created slot's index is used",
|
|
10149
|
-
"and `holding_index` is ignored. For existing holdings leave `mint` as `None`."
|
|
10150
|
-
"The price is authoritative only for ConsensusOracle holdings. Pyth and nested-vault",
|
|
10151
|
-
"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`."
|
|
10152
10056
|
];
|
|
10153
10057
|
"type": {
|
|
10154
10058
|
"kind": "struct";
|
|
@@ -11893,7 +11797,8 @@ type Bankineco = {
|
|
|
11893
11797
|
{
|
|
11894
11798
|
"name": "lossesEnabled";
|
|
11895
11799
|
"docs": [
|
|
11896
|
-
"Allows consensus-oracle NAV losses beyond the protocol's small-loss
|
|
11800
|
+
"Allows consensus-oracle NAV losses beyond the protocol's small-loss",
|
|
11801
|
+
"tolerance. Losses inside that tolerance settle without this flag."
|
|
11897
11802
|
];
|
|
11898
11803
|
"type": {
|
|
11899
11804
|
"defined": {
|
|
@@ -14558,11 +14463,12 @@ interface FulfillJuniorTrancheWithdrawIxArgs {
|
|
|
14558
14463
|
ownerInputAta: Address;
|
|
14559
14464
|
ownerOutputAta: Address;
|
|
14560
14465
|
vaultOutputAta: Address;
|
|
14561
|
-
feeCollector: Address;
|
|
14562
|
-
feeCollectorOutputAta: Address;
|
|
14563
14466
|
queueInputAta: Address;
|
|
14564
14467
|
assetTokenProgram: Address;
|
|
14565
14468
|
shareTokenProgram: Address;
|
|
14469
|
+
externalWithdrawIxRefs: InstructionRefs | null;
|
|
14470
|
+
externalLiquiditySource: number | null;
|
|
14471
|
+
externalWithdrawAccounts: CustomAccountMeta[];
|
|
14566
14472
|
/** PDA derivation seeds, including the bump, for the fee-exempt route. */
|
|
14567
14473
|
addressSeeds?: readonly Uint8Array[];
|
|
14568
14474
|
}
|
|
@@ -14578,9 +14484,17 @@ interface FulfillJuniorTrancheWithdrawTxArgs {
|
|
|
14578
14484
|
juniorShareMint: Address;
|
|
14579
14485
|
ownerInputAta?: Address;
|
|
14580
14486
|
queueId: number;
|
|
14581
|
-
feeCollector?: Address;
|
|
14582
14487
|
assetTokenProgram?: Address;
|
|
14583
14488
|
shareTokenProgram?: Address;
|
|
14489
|
+
externalWithdrawIxRefs?: InstructionRefs;
|
|
14490
|
+
externalLiquiditySource?: number;
|
|
14491
|
+
externalWithdrawAccounts?: CustomAccountMeta[];
|
|
14492
|
+
/**
|
|
14493
|
+
* When true, skips the automatic detection of on-chain Marginfi external
|
|
14494
|
+
* liquidity and always fulfills from local vault liquidity only.
|
|
14495
|
+
*/
|
|
14496
|
+
skipExternalLiquidity?: boolean;
|
|
14497
|
+
lookupTables?: Address[];
|
|
14584
14498
|
/** PDA derivation seeds, including the bump, for the fee-exempt route. */
|
|
14585
14499
|
addressSeeds?: readonly Uint8Array[];
|
|
14586
14500
|
}
|
|
@@ -15131,19 +15045,19 @@ declare class ExecuteTrancheWithdrawBuilder extends VaultBuilderBase<ExecuteTran
|
|
|
15131
15045
|
|
|
15132
15046
|
declare class ExecuteWithdrawBuilder extends VaultBuilderBase<ExecuteWithdrawIxArgs, ExecuteWithdrawTxArgs> {
|
|
15133
15047
|
getIxAccounts(args: ExecuteWithdrawIxArgs): {
|
|
15134
|
-
user: PublicKey;
|
|
15135
|
-
vault: PublicKey;
|
|
15136
|
-
vaultOracle: PublicKey;
|
|
15137
|
-
vaultTrancheState: PublicKey | null;
|
|
15138
|
-
assetMint: PublicKey;
|
|
15139
|
-
shareMint: PublicKey;
|
|
15140
|
-
userAssetAta: PublicKey;
|
|
15141
|
-
vaultAssetAta: PublicKey;
|
|
15142
|
-
feeVault: PublicKey;
|
|
15143
|
-
feeVaultAta: PublicKey;
|
|
15144
|
-
userShareAta: PublicKey;
|
|
15145
|
-
assetTokenProgram: PublicKey;
|
|
15146
|
-
shareTokenProgram: PublicKey;
|
|
15048
|
+
user: _solana_web3_js.PublicKey;
|
|
15049
|
+
vault: _solana_web3_js.PublicKey;
|
|
15050
|
+
vaultOracle: _solana_web3_js.PublicKey;
|
|
15051
|
+
vaultTrancheState: _solana_web3_js.PublicKey | null;
|
|
15052
|
+
assetMint: _solana_web3_js.PublicKey;
|
|
15053
|
+
shareMint: _solana_web3_js.PublicKey;
|
|
15054
|
+
userAssetAta: _solana_web3_js.PublicKey;
|
|
15055
|
+
vaultAssetAta: _solana_web3_js.PublicKey;
|
|
15056
|
+
feeVault: _solana_web3_js.PublicKey;
|
|
15057
|
+
feeVaultAta: _solana_web3_js.PublicKey;
|
|
15058
|
+
userShareAta: _solana_web3_js.PublicKey;
|
|
15059
|
+
assetTokenProgram: _solana_web3_js.PublicKey;
|
|
15060
|
+
shareTokenProgram: _solana_web3_js.PublicKey;
|
|
15147
15061
|
};
|
|
15148
15062
|
getIxData(args: ExecuteWithdrawIxArgs): {
|
|
15149
15063
|
shareAmount: BN;
|
|
@@ -15165,12 +15079,13 @@ declare class ExecuteWithdrawBuilder extends VaultBuilderBase<ExecuteWithdrawIxA
|
|
|
15165
15079
|
declare class FulfillJuniorTrancheWithdrawBuilder extends VaultBuilderBase<FulfillJuniorTrancheWithdrawIxArgs, FulfillJuniorTrancheWithdrawTxArgs> {
|
|
15166
15080
|
getIx(args: FulfillJuniorTrancheWithdrawIxArgs): Promise<_solana_kit.Instruction<string, readonly (_solana_kit.AccountLookupMeta<string, string> | _solana_kit.AccountMeta<string>)[]>>;
|
|
15167
15081
|
protected deriveIxArgs(txArgs: FulfillJuniorTrancheWithdrawTxArgs): Promise<FulfillJuniorTrancheWithdrawIxArgs>;
|
|
15082
|
+
protected buildLookupTables(_args: FulfillJuniorTrancheWithdrawIxArgs, txArgs: FulfillJuniorTrancheWithdrawTxArgs): Promise<readonly Address[] | undefined>;
|
|
15168
15083
|
protected buildPreambleInstructions(args: FulfillJuniorTrancheWithdrawIxArgs): Promise<_solana_kit.Instruction<string, readonly (_solana_kit.AccountLookupMeta<string, string> | _solana_kit.AccountMeta<string>)[]>[]>;
|
|
15169
15084
|
protected buildPlanExtras(args: FulfillJuniorTrancheWithdrawIxArgs): Promise<{
|
|
15170
15085
|
postSuccessCacheInvalidations: {
|
|
15171
|
-
vaultPda:
|
|
15172
|
-
vaultTrancheStatePda:
|
|
15173
|
-
withdrawalQueuePda:
|
|
15086
|
+
vaultPda: Address;
|
|
15087
|
+
vaultTrancheStatePda: Address;
|
|
15088
|
+
withdrawalQueuePda: Address;
|
|
15174
15089
|
}[];
|
|
15175
15090
|
}>;
|
|
15176
15091
|
}
|
|
@@ -15318,6 +15233,12 @@ declare class VaultClient {
|
|
|
15318
15233
|
* Pass `extraSigners` for accounts created in the same tx (e.g. a new share mint).
|
|
15319
15234
|
*/
|
|
15320
15235
|
sendTransaction(payer: Keypair, plan: VaultTransactionPlan, extraSigners?: Keypair[]): Promise<string>;
|
|
15236
|
+
/**
|
|
15237
|
+
* Build the same transaction {@link sendTransaction} would send, but run it
|
|
15238
|
+
* through `simulateTransaction` instead. Nothing is signed or submitted, so
|
|
15239
|
+
* this is safe to call with a keypair that is not the real signer.
|
|
15240
|
+
*/
|
|
15241
|
+
simulateTransaction(payer: Keypair, plan: VaultTransactionPlan): Promise<SimulatedTransactionResponse>;
|
|
15321
15242
|
applyCacheInvalidations(plan: VaultTransactionPlan): void;
|
|
15322
15243
|
clearAllCache(): void;
|
|
15323
15244
|
}
|
|
@@ -15355,7 +15276,9 @@ declare function resolveKeypairPath(keypairPath: string): string;
|
|
|
15355
15276
|
declare function loadKeypair(keypairPath: string): Keypair;
|
|
15356
15277
|
/**
|
|
15357
15278
|
* Default keypair location for a given role/env, e.g.
|
|
15358
|
-
* `~/.config/solana/vault-fulfiller-prod.json`.
|
|
15279
|
+
* `~/.config/solana/vault-fulfiller-prod.json`. Roles in
|
|
15280
|
+
* {@link ENV_AGNOSTIC_ROLES} share one key across envs, e.g.
|
|
15281
|
+
* `~/.config/solana/fulfiller.json`. Override per-invocation with
|
|
15359
15282
|
* the `--keypair` CLI flag or the `keypairPath` option.
|
|
15360
15283
|
*/
|
|
15361
15284
|
declare function defaultKeypairPath(env: VaultEnv, role?: string): string;
|
|
@@ -15908,6 +15831,15 @@ interface ConsensusOracleDeps {
|
|
|
15908
15831
|
/** Optional; omitted ⇒ no yield accrual is folded in. */
|
|
15909
15832
|
yieldTracker?: YieldTracker;
|
|
15910
15833
|
clock?: Clock;
|
|
15834
|
+
/**
|
|
15835
|
+
* How many times external position NAV is read before reporting, and how
|
|
15836
|
+
* many of those reads must succeed. Defaults to
|
|
15837
|
+
* `EXTERNAL_POSITION_SAMPLES` / `MIN_EXTERNAL_POSITION_SAMPLES`.
|
|
15838
|
+
*/
|
|
15839
|
+
externalPositionSampling?: {
|
|
15840
|
+
samples?: number;
|
|
15841
|
+
minSamples?: number;
|
|
15842
|
+
};
|
|
15911
15843
|
}
|
|
15912
15844
|
/** Per-holding breakdown of what the service computed (and would/did push). */
|
|
15913
15845
|
interface HoldingUpdatePreview {
|
|
@@ -16014,6 +15946,25 @@ interface ConsensusHoldingSimulation {
|
|
|
16014
15946
|
wouldUpdateHolding: boolean;
|
|
16015
15947
|
reason?: string;
|
|
16016
15948
|
}
|
|
15949
|
+
/**
|
|
15950
|
+
* Per-holding NAV attribution: what each holding contributed to gross NAV
|
|
15951
|
+
* before and after consensus landed. `delta` sums to the gross-NAV change.
|
|
15952
|
+
*/
|
|
15953
|
+
interface HoldingNavContribution {
|
|
15954
|
+
holdingIndex: number;
|
|
15955
|
+
mint: Address;
|
|
15956
|
+
decimals: number;
|
|
15957
|
+
/** Vault-owned token-account balance (base units); unchanged by consensus. */
|
|
15958
|
+
localAmount: bigint;
|
|
15959
|
+
externalAmountBefore: bigint;
|
|
15960
|
+
externalAmountAfter: bigint;
|
|
15961
|
+
priceBefore: bigint;
|
|
15962
|
+
priceAfter: bigint;
|
|
15963
|
+
/** localAmount + external, priced at `price`, in the vault's accounting unit. */
|
|
15964
|
+
valueBefore: bigint;
|
|
15965
|
+
valueAfter: bigint;
|
|
15966
|
+
delta: bigint;
|
|
15967
|
+
}
|
|
16017
15968
|
interface SimulatedShareClass {
|
|
16018
15969
|
value: bigint;
|
|
16019
15970
|
totalSupply: bigint;
|
|
@@ -16041,6 +15992,8 @@ interface SettlementSimulation {
|
|
|
16041
15992
|
blockers: string[];
|
|
16042
15993
|
warnings: string[];
|
|
16043
15994
|
consensus: ConsensusHoldingSimulation[];
|
|
15995
|
+
/** Per-holding attribution of the gross-NAV change consensus would cause. */
|
|
15996
|
+
navContributions: HoldingNavContribution[];
|
|
16044
15997
|
grossNav?: bigint;
|
|
16045
15998
|
settledAccountingNav?: bigint;
|
|
16046
15999
|
current: SettlementSimulationSnapshot;
|
|
@@ -16073,44 +16026,258 @@ interface VaultPricingInputs {
|
|
|
16073
16026
|
configByMint: Map<string, ConsensusOracleHoldingConfig>;
|
|
16074
16027
|
}
|
|
16075
16028
|
|
|
16029
|
+
declare const SYSTEM_PROGRAM = "11111111111111111111111111111111";
|
|
16030
|
+
/** `PriceOracleType` discriminants, in on-chain declaration order. */
|
|
16031
|
+
declare const PRICE_ORACLE_TYPES_BY_INDEX: string[];
|
|
16032
|
+
declare const CONSENSUS_ORACLE_VARIANT = "consensusoracle";
|
|
16033
|
+
/** Oracle types priced by a permissionless on-chain source, not by this service. */
|
|
16034
|
+
declare const LIVE_ORACLE_VARIANTS: Set<string>;
|
|
16035
|
+
/** Every oracle type whose external amount this service reports. */
|
|
16036
|
+
declare const REPORTABLE_ORACLE_VARIANTS: Set<string>;
|
|
16037
|
+
/** Live (Pyth / nested-vault) prices are refreshed at least this often. */
|
|
16038
|
+
declare const LIVE_PRICE_REFRESH_INTERVAL_SECS: bigint;
|
|
16039
|
+
/**
|
|
16040
|
+
* Fallback when the vault does not configure `priceStalenessThresholdSecs`,
|
|
16041
|
+
* as a bigint for comparison against decoded on-chain values.
|
|
16042
|
+
*/
|
|
16043
|
+
declare const DEFAULT_PRICE_STALENESS_SECS: bigint;
|
|
16044
|
+
/**
|
|
16045
|
+
* External position NAV is read this many times back to back, and the most
|
|
16046
|
+
* frequent value per mint is reported. Matches the 5-of-which-4-must-succeed
|
|
16047
|
+
* shape used by the Kamino/Marginfi yield oracles in `bankineco-services`.
|
|
16048
|
+
*/
|
|
16049
|
+
declare const EXTERNAL_POSITION_SAMPLES = 5;
|
|
16050
|
+
declare const MIN_EXTERNAL_POSITION_SAMPLES = 4;
|
|
16051
|
+
declare const ORACLE_ENTRY_SIZE = 272;
|
|
16052
|
+
declare const ORACLE_ENTRIES_OFFSET = 40;
|
|
16053
|
+
declare const ORACLE_SETTLED_NAV_TS_OFFSET = 8;
|
|
16054
|
+
declare const MAX_CONSENSUS_SIGNERS = 4;
|
|
16055
|
+
|
|
16056
|
+
/** Read a little-endian i64 from a number[] byte array at the given offset. */
|
|
16057
|
+
declare function readI64LE(data: number[], offset: number): bigint;
|
|
16058
|
+
/** SPL Token and Token-2022 share the base Mint layout; supply is bytes 36..44. */
|
|
16059
|
+
declare function readSplMintSupply(data: Buffer | Uint8Array): bigint;
|
|
16060
|
+
/** True when `signerBytes` occupies one of the oracle's signer entry slots. */
|
|
16061
|
+
declare function signerInOracleData(data: number[], signerBytes: Uint8Array): boolean;
|
|
16062
|
+
|
|
16063
|
+
/** Name of an Anchor enum variant, e.g. `{ consensusOracle: {} }` → "consensusOracle". */
|
|
16064
|
+
declare function variantName(value: unknown): string;
|
|
16065
|
+
/** Decode a PodBool (which arrives in a few shapes depending on the codec). */
|
|
16066
|
+
declare function coerceBool(value: unknown): boolean;
|
|
16067
|
+
declare function toBigInt(value: unknown): bigint;
|
|
16068
|
+
|
|
16069
|
+
/** Oracle-priced holdings whose external amount can be consensus-reported. */
|
|
16070
|
+
declare function selectReportableHoldings(holdings: readonly DecodedHolding[], excludedMints?: ReadonlySet<string>): ConsensusHoldingEntry[];
|
|
16071
|
+
/** Drop per-holding sourcing config for receipt mints as well as their updates. */
|
|
16072
|
+
declare function filterTargetHoldings(target: ConsensusOracleTarget, excludedMints: ReadonlySet<string>): ConsensusOracleTarget;
|
|
16073
|
+
/** Index per-holding config by mint (base58). */
|
|
16074
|
+
declare function indexConfigByMint(holdings?: ConsensusOracleHoldingConfig[]): Map<string, ConsensusOracleHoldingConfig>;
|
|
16075
|
+
/** Sum external positions by mint (base58 → base units). */
|
|
16076
|
+
declare function sumPositionsByMint(positions: ExternalPosition[]): Map<string, bigint>;
|
|
16076
16077
|
/**
|
|
16077
|
-
*
|
|
16078
|
+
* Parse the vault's on-chain ExternalLiquiditySlot array into ExternalPositionRefs.
|
|
16079
|
+
* Layout (C repr / bytemuck):
|
|
16080
|
+
* byte 0 : discriminant (0 = None, 1 = Marginfi)
|
|
16081
|
+
* bytes 8–40 : userAccount pubkey
|
|
16078
16082
|
*
|
|
16079
|
-
*
|
|
16080
|
-
*
|
|
16081
|
-
* self-contained so `vault_sdk` keeps its lean dependency set.
|
|
16083
|
+
* No mint is specified here — the MarginfiPositionProvider will iterate all
|
|
16084
|
+
* active balances on the account and return positions keyed by bank mint.
|
|
16082
16085
|
*/
|
|
16086
|
+
declare function parseExternalLiquidityRefs(vaultState: DecodedVault): ExternalPositionRef[];
|
|
16087
|
+
|
|
16088
|
+
/** Price conversions between USD spot and the vault's accounting unit. */
|
|
16089
|
+
/** Re-denominate a USD price into the vault's accounting unit, fixed-point. */
|
|
16090
|
+
declare function priceInAccountingUnit(usd: number, baseUsd: number, assetDecimals: number): bigint;
|
|
16091
|
+
/** Inverse of {@link priceInAccountingUnit}, for logging live-oracle holdings. */
|
|
16092
|
+
declare function accountingUnitPriceToUsd(price: bigint, baseUsd: number, assetDecimals: number): number;
|
|
16083
16093
|
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16094
|
+
/**
|
|
16095
|
+
* Repeated-read sampling.
|
|
16096
|
+
*
|
|
16097
|
+
* Live protocol reads (Kamino/Marginfi position NAV) can come back mid-update
|
|
16098
|
+
* or against a lagging RPC node, so a single read is not trustworthy enough to
|
|
16099
|
+
* report on-chain. The fix used elsewhere in this repo — see
|
|
16100
|
+
* `bankineco-services/src/oracle/updateKaminoVaultPendingYield.ts` — is to read
|
|
16101
|
+
* the value several times back to back and keep the most frequent answer,
|
|
16102
|
+
* failing closed when no value is observed more than once.
|
|
16103
|
+
*/
|
|
16104
|
+
/**
|
|
16105
|
+
* The most frequently occurring value. Throws when `values` is empty or when
|
|
16106
|
+
* every value is distinct — a single unrepeated reading is not consensus.
|
|
16107
|
+
*/
|
|
16108
|
+
declare function mostFrequent<T>(values: readonly T[], keyOf?: (value: T) => string): T;
|
|
16109
|
+
interface CollectSamplesOptions {
|
|
16110
|
+
/** How many reads to attempt, back to back. */
|
|
16111
|
+
samples: number;
|
|
16112
|
+
/** Minimum successful reads required, else the whole read fails. */
|
|
16113
|
+
minSamples: number;
|
|
16114
|
+
/** Called with each failed attempt; failures are otherwise skipped. */
|
|
16115
|
+
onError?: (err: unknown, attempt: number) => void;
|
|
16091
16116
|
}
|
|
16117
|
+
/**
|
|
16118
|
+
* Run `read` `samples` times in sequence, discarding failures. Throws when
|
|
16119
|
+
* fewer than `minSamples` reads succeed.
|
|
16120
|
+
*/
|
|
16121
|
+
declare function collectSamples<T>(read: () => Promise<T>, { samples, minSamples, onError }: CollectSamplesOptions): Promise<T[]>;
|
|
16122
|
+
|
|
16123
|
+
/**
|
|
16124
|
+
* Dry-run counterpart to `settlement.ts`: read the canonical share supplies and
|
|
16125
|
+
* replay the exact on-chain settlement path locally, without sending anything.
|
|
16126
|
+
*/
|
|
16127
|
+
|
|
16128
|
+
interface SimulateDryRunSettlementParams {
|
|
16129
|
+
client: VaultClient;
|
|
16130
|
+
signer: Keypair;
|
|
16131
|
+
vault: Address;
|
|
16132
|
+
vaultState: DecodedVault;
|
|
16133
|
+
updates: HoldingUpdatePreview[];
|
|
16134
|
+
nowSecs: bigint;
|
|
16135
|
+
}
|
|
16136
|
+
declare function simulateDryRunSettlement({ client, signer, vault, vaultState, updates, nowSecs, }: SimulateDryRunSettlementParams): Promise<SettlementSimulation>;
|
|
16137
|
+
|
|
16138
|
+
declare function buildUpdates(yieldTracker: YieldTracker | undefined, reportableHoldings: ConsensusHoldingEntry[], inputs: VaultPricingInputs): Promise<HoldingUpdatePreview[]>;
|
|
16139
|
+
declare function buildHoldingUpdate(yieldTracker: YieldTracker | undefined, entry: ConsensusHoldingEntry, inputs: VaultPricingInputs): Promise<HoldingUpdatePreview>;
|
|
16140
|
+
/** Tracked external principal + outstanding yield attributed to a holding. */
|
|
16141
|
+
declare function resolveTrackedAmounts(yieldTracker: YieldTracker | undefined, cfg: ConsensusOracleHoldingConfig | undefined, decimals: number): Promise<{
|
|
16142
|
+
principalAmount: bigint;
|
|
16143
|
+
yieldAmount: bigint;
|
|
16144
|
+
}>;
|
|
16145
|
+
|
|
16146
|
+
/**
|
|
16147
|
+
* Step 1 of a pass: keep active permissionless price sources warm so they
|
|
16148
|
+
* cannot block the NAV crank after the consensus report lands. Prices are
|
|
16149
|
+
* refreshed at least once per hour, or at the vault's shorter staleness
|
|
16150
|
+
* interval when configured.
|
|
16151
|
+
*/
|
|
16152
|
+
|
|
16153
|
+
interface RefreshLiveOraclePricesParams {
|
|
16154
|
+
oracle: OracleService;
|
|
16155
|
+
signer: Keypair;
|
|
16156
|
+
vault: Address;
|
|
16157
|
+
vaultState: DecodedVault;
|
|
16158
|
+
nowSecs: bigint;
|
|
16159
|
+
log: (msg: string) => void;
|
|
16160
|
+
dryRun: boolean;
|
|
16161
|
+
}
|
|
16162
|
+
/** Returns true when at least one price was actually refreshed on-chain. */
|
|
16163
|
+
declare function refreshLiveOraclePrices({ oracle, signer, vault, vaultState, nowSecs, log, dryRun, }: RefreshLiveOraclePricesParams): Promise<boolean>;
|
|
16164
|
+
|
|
16165
|
+
/**
|
|
16166
|
+
* Sourcing step: fetch every external input the per-holding updates draw on —
|
|
16167
|
+
* USD spot prices, manager wallet balances, and live external LP positions.
|
|
16168
|
+
*/
|
|
16169
|
+
|
|
16170
|
+
declare function gatherPricingInputs(deps: ConsensusOracleDeps, target: ConsensusOracleTarget, vaultState: DecodedVault, reportableHoldings: ConsensusHoldingEntry[], log?: (msg: string) => void): Promise<VaultPricingInputs>;
|
|
16171
|
+
/**
|
|
16172
|
+
* Live-LP balances for the target, summed by mint (empty if no provider).
|
|
16173
|
+
*
|
|
16174
|
+
* The provider is read {@link EXTERNAL_POSITION_SAMPLES} times back to back and
|
|
16175
|
+
* the most frequent amount per mint is kept — a single read can land mid-update
|
|
16176
|
+
* or hit a lagging RPC node, and this value is reported on-chain as
|
|
16177
|
+
* `external_amount`.
|
|
16178
|
+
*/
|
|
16179
|
+
declare function fetchExternalPositions(deps: ConsensusOracleDeps, target: ConsensusOracleTarget, manager: Address, vaultState: DecodedVault, log?: (msg: string) => void): Promise<Map<string, bigint>>;
|
|
16180
|
+
|
|
16181
|
+
/**
|
|
16182
|
+
* Receipt mints issued by a vault are liabilities/shares, not underlying assets
|
|
16183
|
+
* for its own NAV. They are excluded from reporting even when registered as
|
|
16184
|
+
* consensus-priced holdings.
|
|
16185
|
+
*/
|
|
16186
|
+
|
|
16187
|
+
declare function fetchReceiptMints(client: VaultClient, vault: Address, vaultState: DecodedVault): Promise<Set<string>>;
|
|
16188
|
+
|
|
16189
|
+
/**
|
|
16190
|
+
* Settlement step: push the consensus report for all holdings, then crank NAV.
|
|
16191
|
+
*/
|
|
16192
|
+
|
|
16193
|
+
interface SettleVaultResult {
|
|
16194
|
+
updateSignature: string;
|
|
16195
|
+
crankSignature?: string;
|
|
16196
|
+
crankSkippedReason?: string;
|
|
16197
|
+
}
|
|
16198
|
+
interface SettleVaultParams {
|
|
16199
|
+
client: VaultClient;
|
|
16200
|
+
oracle: OracleService;
|
|
16201
|
+
yieldTracker: YieldTracker | undefined;
|
|
16202
|
+
signer: Keypair;
|
|
16203
|
+
target: ConsensusOracleTarget;
|
|
16204
|
+
updates: HoldingUpdatePreview[];
|
|
16205
|
+
vaultState: DecodedVault;
|
|
16206
|
+
nowSecs: bigint;
|
|
16207
|
+
log: (msg: string) => void;
|
|
16208
|
+
}
|
|
16209
|
+
/** Push the consensus report for all holdings, then settle NAV. */
|
|
16210
|
+
declare function settleVault({ client, oracle, yieldTracker, signer, target, updates, vaultState, nowSecs, log, }: SettleVaultParams): Promise<SettleVaultResult>;
|
|
16211
|
+
interface LogProspectiveApyParams {
|
|
16212
|
+
client: VaultClient;
|
|
16213
|
+
vault: Address;
|
|
16214
|
+
updates: HoldingUpdatePreview[];
|
|
16215
|
+
vaultState: DecodedVault;
|
|
16216
|
+
nowSecs: bigint;
|
|
16217
|
+
log: (msg: string) => void;
|
|
16218
|
+
}
|
|
16219
|
+
/**
|
|
16220
|
+
* Fetch the current settlement timestamp and log the APY implied by the
|
|
16221
|
+
* prospective update, so MaxApyExceeded failures are diagnosable.
|
|
16222
|
+
*
|
|
16223
|
+
* NAV is expressed in the vault's accounting unit (scaled by assetDecimals).
|
|
16224
|
+
* Mirrors `gross_nav_from_holdings`: consensus updates overlay their target
|
|
16225
|
+
* slots, while live-priced and otherwise unchanged holdings retain their
|
|
16226
|
+
* current price/external amount.
|
|
16227
|
+
*/
|
|
16228
|
+
declare function logProspectiveApy({ client, vault, updates, vaultState, nowSecs, log, }: LogProspectiveApyParams): Promise<void>;
|
|
16229
|
+
|
|
16230
|
+
/**
|
|
16231
|
+
* Discover which on-chain vaults a given keypair is a registered consensus
|
|
16232
|
+
* oracle signer for.
|
|
16233
|
+
*/
|
|
16234
|
+
|
|
16235
|
+
/**
|
|
16236
|
+
* Fetches every vault and its oracle account, then filters by signer
|
|
16237
|
+
* membership. Returns minimal `ConsensusOracleTarget` entries (no per-holding
|
|
16238
|
+
* config); callers can overlay config from `targets.ts` if needed.
|
|
16239
|
+
*/
|
|
16240
|
+
declare function discoverVaultsForSigner(client: VaultClient, signer: Keypair, opts?: {
|
|
16241
|
+
log?: (msg: string) => void;
|
|
16242
|
+
}): Promise<ConsensusOracleTarget[]>;
|
|
16243
|
+
|
|
16244
|
+
/**
|
|
16245
|
+
* Fail closed while any configured yield account has an unsettled payment.
|
|
16246
|
+
* The payout must be confirmed only after it is visible in the same wallet
|
|
16247
|
+
* balance source used by this service. Until then, no oracle update is safe.
|
|
16248
|
+
*/
|
|
16249
|
+
declare function assertNoUnconfirmedYieldPayments(yieldTracker: YieldTracker | undefined, target: ConsensusOracleTarget): Promise<void>;
|
|
16250
|
+
/**
|
|
16251
|
+
* In production, yield accounts are tagged with their vault address. Attach
|
|
16252
|
+
* newly discovered accounts to the base holding, while preserving explicit
|
|
16253
|
+
* per-mint mappings supplied by config or CLI flags.
|
|
16254
|
+
*/
|
|
16255
|
+
declare function withDiscoveredYieldAccounts(yieldTracker: YieldTracker | undefined, target: ConsensusOracleTarget, vaultState: DecodedVault, excludedMints: ReadonlySet<string>, log: (msg: string) => void): Promise<ConsensusOracleTarget>;
|
|
16256
|
+
|
|
16257
|
+
/**
|
|
16258
|
+
* {@link PriceSource} adapter over the `jupiter` package's price API.
|
|
16259
|
+
*
|
|
16260
|
+
* The HTTP client (batching, retries, response shape) lives in
|
|
16261
|
+
* `jupiter/src/priceApi.ts`; this file only binds it to the consensus-oracle
|
|
16262
|
+
* interface.
|
|
16263
|
+
*/
|
|
16264
|
+
|
|
16265
|
+
type JupiterPriceSourceOptions = FetchJupiterUsdPricesOptions;
|
|
16092
16266
|
declare class JupiterPriceSource implements PriceSource {
|
|
16093
|
-
private readonly
|
|
16094
|
-
private readonly retries;
|
|
16095
|
-
private readonly fetchFn;
|
|
16267
|
+
private readonly opts;
|
|
16096
16268
|
constructor(opts?: JupiterPriceSourceOptions);
|
|
16097
16269
|
fetchUsdPrices(mints: Address[]): Promise<Record<string, number>>;
|
|
16098
16270
|
}
|
|
16099
16271
|
|
|
16100
|
-
/**
|
|
16272
|
+
/**
|
|
16273
|
+
* {@link PriceSource} adapter over the `nest` package's price API, bound to the
|
|
16274
|
+
* Perena vault's Nest slug and share mint.
|
|
16275
|
+
*/
|
|
16101
16276
|
|
|
16102
|
-
declare const NEST_API_BASE_URL = "https://api.nest.credit/v1";
|
|
16103
16277
|
declare const NEST_VAULT_SLUG = "nest-perena-vault";
|
|
16104
16278
|
declare const NEST_RWA_SHARE_MINT: Address;
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
fetchFn?: typeof fetch;
|
|
16108
|
-
}
|
|
16109
|
-
/**
|
|
16110
|
-
* Fetch the USD price of one Nest vault share. This is the price reader that
|
|
16111
|
-
* historically lived in bankineco-sdk's `nestUtils`; the vault SDK owns it now
|
|
16112
|
-
* because nested Nest shares are a consensus-oracle price source.
|
|
16113
|
-
*/
|
|
16279
|
+
type FetchNestTokenPriceOptions = FetchNestVaultSharePriceOptions;
|
|
16280
|
+
/** Fetch the USD price of one share of the Perena vault on Nest. */
|
|
16114
16281
|
declare function fetchNestTokenPrice(nestVaultSlug?: string, opts?: FetchNestTokenPriceOptions): Promise<number>;
|
|
16115
16282
|
interface NestPriceSourceOptions extends FetchNestTokenPriceOptions {
|
|
16116
16283
|
nestVaultSlug?: string;
|
|
@@ -16139,35 +16306,25 @@ declare class LivePriceSource implements PriceSource {
|
|
|
16139
16306
|
}
|
|
16140
16307
|
|
|
16141
16308
|
/**
|
|
16142
|
-
* {@link WalletBalanceSource}
|
|
16143
|
-
* API, with an on-chain RPC fallback.
|
|
16144
|
-
*
|
|
16145
|
-
* Primary: GET https://lite-api.jup.ag/ultra/v1/balances/{owner}
|
|
16146
|
-
* → { "<mint>": { amount, uiAmount, slot, isFrozen }, "SOL": {…} }
|
|
16147
|
-
* Fallback: `getParsedTokenAccountsByOwner` over the SPL Token and Token-2022
|
|
16148
|
-
* programs, summed per mint.
|
|
16309
|
+
* {@link WalletBalanceSource} adapter over the `jupiter` package's balances API.
|
|
16149
16310
|
*
|
|
16150
|
-
*
|
|
16151
|
-
* `
|
|
16311
|
+
* The Jupiter call and the RPC fallback both live in
|
|
16312
|
+
* `jupiter/src/balancesApi.ts`; this file owns the policy — try Jupiter first,
|
|
16313
|
+
* fall back to RPC on failure or an empty result — plus logging.
|
|
16152
16314
|
*/
|
|
16153
16315
|
|
|
16154
|
-
interface JupiterBalanceSourceOptions {
|
|
16155
|
-
baseUrl?: string;
|
|
16156
|
-
fetchFn?: typeof fetch;
|
|
16316
|
+
interface JupiterBalanceSourceOptions extends FetchJupiterBalancesOptions {
|
|
16157
16317
|
/** Skip the Jupiter call and read straight from RPC. */
|
|
16158
16318
|
rpcOnly?: boolean;
|
|
16159
16319
|
log?: (msg: string) => void;
|
|
16160
16320
|
}
|
|
16161
16321
|
declare class JupiterBalanceSource implements WalletBalanceSource {
|
|
16162
16322
|
private readonly connection;
|
|
16163
|
-
private readonly baseUrl;
|
|
16164
|
-
private readonly fetchFn;
|
|
16165
16323
|
private readonly rpcOnly;
|
|
16166
16324
|
private readonly log;
|
|
16325
|
+
private readonly apiOptions;
|
|
16167
16326
|
constructor(connection: Connection, opts?: JupiterBalanceSourceOptions);
|
|
16168
16327
|
fetchBalances(owner: Address): Promise<Record<string, bigint>>;
|
|
16169
|
-
private fetchFromJupiter;
|
|
16170
|
-
private fetchFromRpc;
|
|
16171
16328
|
}
|
|
16172
16329
|
|
|
16173
16330
|
/**
|
|
@@ -16203,6 +16360,16 @@ declare class KaminoPositionProvider implements ExternalPositionProvider {
|
|
|
16203
16360
|
positionsFor(ctx: ExternalPositionContext): Promise<ExternalPosition[]>;
|
|
16204
16361
|
}
|
|
16205
16362
|
|
|
16363
|
+
/**
|
|
16364
|
+
* {@link ExternalPositionProvider} adapter over the `marginfi` package's
|
|
16365
|
+
* position readers.
|
|
16366
|
+
*
|
|
16367
|
+
* The Marginfi SDK usage and account layout parsing live in
|
|
16368
|
+
* `marginfi/src/positions.ts`; this file maps `ExternalPositionRef`s onto them:
|
|
16369
|
+
* a ref with an explicit `marginfiBank` reads that one bank, while a ref with
|
|
16370
|
+
* only a `marginfiAccount` reports every non-zero balance on the account.
|
|
16371
|
+
*/
|
|
16372
|
+
|
|
16206
16373
|
declare class MarginfiPositionProvider implements ExternalPositionProvider {
|
|
16207
16374
|
private readonly connection;
|
|
16208
16375
|
private readonly log;
|
|
@@ -16210,31 +16377,6 @@ declare class MarginfiPositionProvider implements ExternalPositionProvider {
|
|
|
16210
16377
|
positionsFor(ctx: ExternalPositionContext): Promise<ExternalPosition[]>;
|
|
16211
16378
|
}
|
|
16212
16379
|
|
|
16213
|
-
interface LiveConsensusOracleDepsOptions {
|
|
16214
|
-
log?: (msg: string) => void;
|
|
16215
|
-
rpcOnly?: boolean;
|
|
16216
|
-
includeExternalPositions?: boolean;
|
|
16217
|
-
}
|
|
16218
|
-
declare function createLiveConsensusOracleDeps(connection: Connection, opts?: LiveConsensusOracleDepsOptions): ConsensusOracleDeps;
|
|
16219
|
-
|
|
16220
|
-
interface RunLiveConsensusOracleOptions extends RunOptions {
|
|
16221
|
-
/** Override the RPC endpoint used for vault discovery, price updates, and NAV cranks. */
|
|
16222
|
-
rpcUrl?: string;
|
|
16223
|
-
/** Override the vault program id. Defaults to the environment's configured program. */
|
|
16224
|
-
programId?: Address;
|
|
16225
|
-
/** Skip Jupiter balances and use RPC token-account balances only. */
|
|
16226
|
-
rpcOnly?: boolean;
|
|
16227
|
-
/** Include live Kamino/Marginfi positions in external amount updates. Defaults to true. */
|
|
16228
|
-
includeExternalPositions?: boolean;
|
|
16229
|
-
}
|
|
16230
|
-
/**
|
|
16231
|
-
* Full live consensus-oracle pass for one signer.
|
|
16232
|
-
*
|
|
16233
|
-
* Builds the vault client for `env`, discovers every vault where `oracleSigner`
|
|
16234
|
-
* is registered, updates consensus prices/external allocations, and cranks NAV.
|
|
16235
|
-
*/
|
|
16236
|
-
declare function runLiveConsensusOracle(env: VaultEnv, oracleSigner: Keypair, opts?: RunLiveConsensusOracleOptions): Promise<RunSummary>;
|
|
16237
|
-
|
|
16238
16380
|
/**
|
|
16239
16381
|
* In-memory mock of the bankineco yield tracker.
|
|
16240
16382
|
*
|
|
@@ -16330,6 +16472,31 @@ declare function applyEffectiveApy(anchor: bigint, apyBps: number, elapsedSecs:
|
|
|
16330
16472
|
/** Human-readable CLI lines for a raw settlement projection. */
|
|
16331
16473
|
declare function formatSettlementSimulation(simulation: SettlementSimulation): string[];
|
|
16332
16474
|
|
|
16475
|
+
interface LiveConsensusOracleDepsOptions {
|
|
16476
|
+
log?: (msg: string) => void;
|
|
16477
|
+
rpcOnly?: boolean;
|
|
16478
|
+
includeExternalPositions?: boolean;
|
|
16479
|
+
}
|
|
16480
|
+
declare function createLiveConsensusOracleDeps(connection: Connection, opts?: LiveConsensusOracleDepsOptions): ConsensusOracleDeps;
|
|
16481
|
+
|
|
16482
|
+
interface RunLiveConsensusOracleOptions extends RunOptions {
|
|
16483
|
+
/** Override the RPC endpoint used for vault discovery, price updates, and NAV cranks. */
|
|
16484
|
+
rpcUrl?: string;
|
|
16485
|
+
/** Override the vault program id. Defaults to the environment's configured program. */
|
|
16486
|
+
programId?: Address;
|
|
16487
|
+
/** Skip Jupiter balances and use RPC token-account balances only. */
|
|
16488
|
+
rpcOnly?: boolean;
|
|
16489
|
+
/** Include live Kamino/Marginfi positions in external amount updates. Defaults to true. */
|
|
16490
|
+
includeExternalPositions?: boolean;
|
|
16491
|
+
}
|
|
16492
|
+
/**
|
|
16493
|
+
* Full live consensus-oracle pass for one signer.
|
|
16494
|
+
*
|
|
16495
|
+
* Builds the vault client for `env`, discovers every vault where `oracleSigner`
|
|
16496
|
+
* is registered, updates consensus prices/external allocations, and cranks NAV.
|
|
16497
|
+
*/
|
|
16498
|
+
declare function runLiveConsensusOracle(env: VaultEnv, oracleSigner: Keypair, opts?: RunLiveConsensusOracleOptions): Promise<RunSummary>;
|
|
16499
|
+
|
|
16333
16500
|
declare class ConsensusOracleService {
|
|
16334
16501
|
private readonly client;
|
|
16335
16502
|
private readonly deps;
|
|
@@ -16338,20 +16505,6 @@ declare class ConsensusOracleService {
|
|
|
16338
16505
|
constructor(client: VaultClient, deps: ConsensusOracleDeps);
|
|
16339
16506
|
/** Drive one vault: source prices/balances, push consensus update, crank NAV. */
|
|
16340
16507
|
runOnce(signer: Keypair, target: ConsensusOracleTarget, opts?: RunOptions): Promise<VaultOracleResult>;
|
|
16341
|
-
/** Read canonical supplies and replay the exact on-chain settlement path. */
|
|
16342
|
-
private simulateDryRunSettlement;
|
|
16343
|
-
/**
|
|
16344
|
-
* Fail closed while any configured yield account has an unsettled payment.
|
|
16345
|
-
* The payout must be confirmed only after it is visible in the same wallet
|
|
16346
|
-
* balance source used by this service. Until then, no oracle update is safe.
|
|
16347
|
-
*/
|
|
16348
|
-
private assertNoUnconfirmedYieldPayments;
|
|
16349
|
-
/**
|
|
16350
|
-
* In production, yield accounts are tagged with their vault address. Attach
|
|
16351
|
-
* newly discovered accounts to the base holding, while preserving explicit
|
|
16352
|
-
* per-mint mappings supplied by config or CLI flags.
|
|
16353
|
-
*/
|
|
16354
|
-
private withDiscoveredYieldAccounts;
|
|
16355
16508
|
/**
|
|
16356
16509
|
* Drive several vaults in sequence. Non-fatal: a failure on one vault is
|
|
16357
16510
|
* recorded and the rest still run (mirrors the oracle-updater daemon).
|
|
@@ -16361,46 +16514,13 @@ declare class ConsensusOracleService {
|
|
|
16361
16514
|
runDiscoveredForSigner(signer: Keypair, opts?: RunOptions): Promise<RunSummary>;
|
|
16362
16515
|
/**
|
|
16363
16516
|
* Discover all on-chain vaults for which `signer` is a registered consensus
|
|
16364
|
-
* oracle signer.
|
|
16365
|
-
* signer membership. Returns minimal `ConsensusOracleTarget` entries (no
|
|
16366
|
-
* per-holding config); callers can overlay config from `targets.ts` if needed.
|
|
16517
|
+
* oracle signer.
|
|
16367
16518
|
*/
|
|
16368
16519
|
discoverVaultsForSigner(signer: Keypair, opts?: {
|
|
16369
16520
|
log?: (msg: string) => void;
|
|
16370
16521
|
}): Promise<ConsensusOracleTarget[]>;
|
|
16522
|
+
private nowSecs;
|
|
16371
16523
|
private fetchDecodedVault;
|
|
16372
|
-
/**
|
|
16373
|
-
* Keep active permissionless price sources warm so they cannot block the NAV
|
|
16374
|
-
* crank after the consensus report lands. Prices are refreshed at least once
|
|
16375
|
-
* per hour, or at the vault's shorter staleness interval when configured.
|
|
16376
|
-
*/
|
|
16377
|
-
private refreshLiveOraclePrices;
|
|
16378
|
-
/**
|
|
16379
|
-
* Receipt mints issued by this vault are liabilities/shares, not underlying
|
|
16380
|
-
* assets for its own NAV. Exclude them even if they were registered as
|
|
16381
|
-
* consensus-priced holdings.
|
|
16382
|
-
*/
|
|
16383
|
-
private fetchReceiptMints;
|
|
16384
|
-
/** Fetch every external input the per-holding updates draw on, in parallel-ish. */
|
|
16385
|
-
private gatherPricingInputs;
|
|
16386
|
-
/** Live-LP balances for the target, summed by mint (empty if no provider). */
|
|
16387
|
-
private fetchExternalPositions;
|
|
16388
|
-
/** Tracked external principal + outstanding yield attributed to a holding. */
|
|
16389
|
-
private resolveTrackedAmounts;
|
|
16390
|
-
private buildUpdates;
|
|
16391
|
-
private buildHoldingUpdate;
|
|
16392
|
-
/** Push the consensus report for all holdings, then settle NAV. */
|
|
16393
|
-
private settleVault;
|
|
16394
|
-
/**
|
|
16395
|
-
* Fetch the current settlement timestamp and log the APY implied by the
|
|
16396
|
-
* prospective update, so MaxApyExceeded failures are diagnosable.
|
|
16397
|
-
*
|
|
16398
|
-
* NAV is expressed in the vault's accounting unit (scaled by assetDecimals).
|
|
16399
|
-
* Mirrors `gross_nav_from_holdings`: consensus updates overlay their target
|
|
16400
|
-
* slots, while live-priced and otherwise unchanged holdings retain their
|
|
16401
|
-
* current price/external amount.
|
|
16402
|
-
*/
|
|
16403
|
-
private logProspectiveApy;
|
|
16404
16524
|
}
|
|
16405
16525
|
|
|
16406
16526
|
/**
|
|
@@ -16420,6 +16540,7 @@ interface ExternalLiquidityIntegrityResult {
|
|
|
16420
16540
|
deposited: number;
|
|
16421
16541
|
skipped: number;
|
|
16422
16542
|
failed: number;
|
|
16543
|
+
/** Signatures of sent deposits (empty in dry-run mode). */
|
|
16423
16544
|
signatures: string[];
|
|
16424
16545
|
}
|
|
16425
16546
|
interface ExternalLiquidityIntegritySummary {
|
|
@@ -16427,8 +16548,22 @@ interface ExternalLiquidityIntegritySummary {
|
|
|
16427
16548
|
totalDeposited: number;
|
|
16428
16549
|
totalSkipped: number;
|
|
16429
16550
|
totalFailed: number;
|
|
16551
|
+
/** True when deposits were simulated rather than sent. */
|
|
16552
|
+
dryRun: boolean;
|
|
16430
16553
|
}
|
|
16431
16554
|
type LogFn = (msg: string) => void;
|
|
16555
|
+
interface ExternalLiquidityIntegrityOptions {
|
|
16556
|
+
log?: LogFn;
|
|
16557
|
+
/** Simulate each deposit instead of sending it. Nothing is submitted. */
|
|
16558
|
+
dryRun?: boolean;
|
|
16559
|
+
/**
|
|
16560
|
+
* Skip holdings worth less than this many UI tokens. Every mint with a
|
|
16561
|
+
* Marginfi bank is a USD stablecoin, so the default of 1 means "ignore
|
|
16562
|
+
* dust below ~$1" and keeps the tx fee from exceeding the deposit.
|
|
16563
|
+
*/
|
|
16564
|
+
minAmountUi?: number;
|
|
16565
|
+
}
|
|
16566
|
+
declare const DEFAULT_MIN_AMOUNT_UI = 1;
|
|
16432
16567
|
declare class ExternalLiquidityIntegrityService {
|
|
16433
16568
|
private readonly client;
|
|
16434
16569
|
constructor(client: VaultClient);
|
|
@@ -16436,15 +16571,16 @@ declare class ExternalLiquidityIntegrityService {
|
|
|
16436
16571
|
* Scan all vaults and deposit any idle local balance into configured external
|
|
16437
16572
|
* liquidity positions. Non-fatal per vault — errors are logged and counted.
|
|
16438
16573
|
*/
|
|
16439
|
-
runAll(hwManager: Keypair, opts?:
|
|
16440
|
-
log?: LogFn;
|
|
16441
|
-
}): Promise<ExternalLiquidityIntegritySummary>;
|
|
16574
|
+
runAll(hwManager: Keypair, opts?: ExternalLiquidityIntegrityOptions): Promise<ExternalLiquidityIntegritySummary>;
|
|
16442
16575
|
/**
|
|
16443
16576
|
* Process a single vault: for each active external liquidity slot, deposit
|
|
16444
16577
|
* any holdings that have a non-zero local_amount.
|
|
16445
16578
|
*/
|
|
16446
|
-
processVault(vault: Address, vaultState: VaultAccountData, hwManager: Keypair, log: LogFn
|
|
16579
|
+
processVault(vault: Address, vaultState: VaultAccountData, hwManager: Keypair, log: LogFn, opts?: {
|
|
16580
|
+
dryRun?: boolean;
|
|
16581
|
+
minAmountUi?: number;
|
|
16582
|
+
}): Promise<ExternalLiquidityIntegrityResult>;
|
|
16447
16583
|
private depositIntoMarginfi;
|
|
16448
16584
|
}
|
|
16449
16585
|
|
|
16450
|
-
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, CancelJuniorTrancheWithdrawBuilder, type CancelJuniorTrancheWithdrawIxArgs, type CancelJuniorTrancheWithdrawTxArgs, type Clock, 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_ORACLE_STALENESS_THRESHOLD_SECS, DEFAULT_PRICE_ORACLE_ACCOUNT, DEFAULT_PRICE_STALENESS_THRESHOLD_SECS, DEFAULT_VAULT_ID, type DecodedHolding, type DecodedVault, type DecodedVaultTrancheState, type DeleteAccountParams, DisableCircuitBreakerBuilder, type DisableCircuitBreakerIxArgs, type DisableCircuitBreakerTxArgs, 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 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 HoldingUpdatePreview, IDL, InitializeVaultRolesBuilder, type InitializeVaultRolesIxArgs, type InitializeVaultRolesTxArgs, type JuniorWithdrawalMode, JupiterBalanceSource, type JupiterBalanceSourceOptions, JupiterPriceSource, type JupiterPriceSourceOptions, JupiterSwapBuilder, type JupiterSwapIxArgs, type JupiterSwapTxArgs, KaminoPositionProvider, LOCAL_PROTOCOL_ADMIN, type LiveConsensusOracleDepsOptions, LivePriceSource, type LivePriceSourceOptions, MAX_PRICE_STALENESS_THRESHOLD_SECS, ManagerRedepositAssetBuilder, type ManagerRedepositAssetIxArgs, type ManagerRedepositAssetTxArgs, ManagerWithdrawAssetBuilder, type ManagerWithdrawAssetIxArgs, type ManagerWithdrawAssetTxArgs, MarginfiPositionProvider, type MockYieldAccountConfig, MockYieldTracker, type MockYieldTrackerOptions,
|
|
16586
|
+
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 };
|