@perena/vault-sdk 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +343 -121
  2. package/dist/index.js +3508 -1433
  3. 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;
@@ -15318,6 +15321,12 @@ declare class VaultClient {
15318
15321
  * Pass `extraSigners` for accounts created in the same tx (e.g. a new share mint).
15319
15322
  */
15320
15323
  sendTransaction(payer: Keypair, plan: VaultTransactionPlan, extraSigners?: Keypair[]): Promise<string>;
15324
+ /**
15325
+ * Build the same transaction {@link sendTransaction} would send, but run it
15326
+ * through `simulateTransaction` instead. Nothing is signed or submitted, so
15327
+ * this is safe to call with a keypair that is not the real signer.
15328
+ */
15329
+ simulateTransaction(payer: Keypair, plan: VaultTransactionPlan): Promise<SimulatedTransactionResponse>;
15321
15330
  applyCacheInvalidations(plan: VaultTransactionPlan): void;
15322
15331
  clearAllCache(): void;
15323
15332
  }
@@ -15908,6 +15917,15 @@ interface ConsensusOracleDeps {
15908
15917
  /** Optional; omitted ⇒ no yield accrual is folded in. */
15909
15918
  yieldTracker?: YieldTracker;
15910
15919
  clock?: Clock;
15920
+ /**
15921
+ * How many times external position NAV is read before reporting, and how
15922
+ * many of those reads must succeed. Defaults to
15923
+ * `EXTERNAL_POSITION_SAMPLES` / `MIN_EXTERNAL_POSITION_SAMPLES`.
15924
+ */
15925
+ externalPositionSampling?: {
15926
+ samples?: number;
15927
+ minSamples?: number;
15928
+ };
15911
15929
  }
15912
15930
  /** Per-holding breakdown of what the service computed (and would/did push). */
15913
15931
  interface HoldingUpdatePreview {
@@ -16014,6 +16032,25 @@ interface ConsensusHoldingSimulation {
16014
16032
  wouldUpdateHolding: boolean;
16015
16033
  reason?: string;
16016
16034
  }
16035
+ /**
16036
+ * Per-holding NAV attribution: what each holding contributed to gross NAV
16037
+ * before and after consensus landed. `delta` sums to the gross-NAV change.
16038
+ */
16039
+ interface HoldingNavContribution {
16040
+ holdingIndex: number;
16041
+ mint: Address;
16042
+ decimals: number;
16043
+ /** Vault-owned token-account balance (base units); unchanged by consensus. */
16044
+ localAmount: bigint;
16045
+ externalAmountBefore: bigint;
16046
+ externalAmountAfter: bigint;
16047
+ priceBefore: bigint;
16048
+ priceAfter: bigint;
16049
+ /** localAmount + external, priced at `price`, in the vault's accounting unit. */
16050
+ valueBefore: bigint;
16051
+ valueAfter: bigint;
16052
+ delta: bigint;
16053
+ }
16017
16054
  interface SimulatedShareClass {
16018
16055
  value: bigint;
16019
16056
  totalSupply: bigint;
@@ -16041,6 +16078,8 @@ interface SettlementSimulation {
16041
16078
  blockers: string[];
16042
16079
  warnings: string[];
16043
16080
  consensus: ConsensusHoldingSimulation[];
16081
+ /** Per-holding attribution of the gross-NAV change consensus would cause. */
16082
+ navContributions: HoldingNavContribution[];
16044
16083
  grossNav?: bigint;
16045
16084
  settledAccountingNav?: bigint;
16046
16085
  current: SettlementSimulationSnapshot;
@@ -16073,44 +16112,258 @@ interface VaultPricingInputs {
16073
16112
  configByMint: Map<string, ConsensusOracleHoldingConfig>;
16074
16113
  }
16075
16114
 
16115
+ declare const SYSTEM_PROGRAM = "11111111111111111111111111111111";
16116
+ /** `PriceOracleType` discriminants, in on-chain declaration order. */
16117
+ declare const PRICE_ORACLE_TYPES_BY_INDEX: string[];
16118
+ declare const CONSENSUS_ORACLE_VARIANT = "consensusoracle";
16119
+ /** Oracle types priced by a permissionless on-chain source, not by this service. */
16120
+ declare const LIVE_ORACLE_VARIANTS: Set<string>;
16121
+ /** Every oracle type whose external amount this service reports. */
16122
+ declare const REPORTABLE_ORACLE_VARIANTS: Set<string>;
16123
+ /** Live (Pyth / nested-vault) prices are refreshed at least this often. */
16124
+ declare const LIVE_PRICE_REFRESH_INTERVAL_SECS: bigint;
16125
+ /**
16126
+ * Fallback when the vault does not configure `priceStalenessThresholdSecs`,
16127
+ * as a bigint for comparison against decoded on-chain values.
16128
+ */
16129
+ declare const DEFAULT_PRICE_STALENESS_SECS: bigint;
16130
+ /**
16131
+ * External position NAV is read this many times back to back, and the most
16132
+ * frequent value per mint is reported. Matches the 5-of-which-4-must-succeed
16133
+ * shape used by the Kamino/Marginfi yield oracles in `bankineco-services`.
16134
+ */
16135
+ declare const EXTERNAL_POSITION_SAMPLES = 5;
16136
+ declare const MIN_EXTERNAL_POSITION_SAMPLES = 4;
16137
+ declare const ORACLE_ENTRY_SIZE = 272;
16138
+ declare const ORACLE_ENTRIES_OFFSET = 40;
16139
+ declare const ORACLE_SETTLED_NAV_TS_OFFSET = 8;
16140
+ declare const MAX_CONSENSUS_SIGNERS = 4;
16141
+
16142
+ /** Read a little-endian i64 from a number[] byte array at the given offset. */
16143
+ declare function readI64LE(data: number[], offset: number): bigint;
16144
+ /** SPL Token and Token-2022 share the base Mint layout; supply is bytes 36..44. */
16145
+ declare function readSplMintSupply(data: Buffer | Uint8Array): bigint;
16146
+ /** True when `signerBytes` occupies one of the oracle's signer entry slots. */
16147
+ declare function signerInOracleData(data: number[], signerBytes: Uint8Array): boolean;
16148
+
16149
+ /** Name of an Anchor enum variant, e.g. `{ consensusOracle: {} }` → "consensusOracle". */
16150
+ declare function variantName(value: unknown): string;
16151
+ /** Decode a PodBool (which arrives in a few shapes depending on the codec). */
16152
+ declare function coerceBool(value: unknown): boolean;
16153
+ declare function toBigInt(value: unknown): bigint;
16154
+
16155
+ /** Oracle-priced holdings whose external amount can be consensus-reported. */
16156
+ declare function selectReportableHoldings(holdings: readonly DecodedHolding[], excludedMints?: ReadonlySet<string>): ConsensusHoldingEntry[];
16157
+ /** Drop per-holding sourcing config for receipt mints as well as their updates. */
16158
+ declare function filterTargetHoldings(target: ConsensusOracleTarget, excludedMints: ReadonlySet<string>): ConsensusOracleTarget;
16159
+ /** Index per-holding config by mint (base58). */
16160
+ declare function indexConfigByMint(holdings?: ConsensusOracleHoldingConfig[]): Map<string, ConsensusOracleHoldingConfig>;
16161
+ /** Sum external positions by mint (base58 → base units). */
16162
+ declare function sumPositionsByMint(positions: ExternalPosition[]): Map<string, bigint>;
16163
+ /**
16164
+ * Parse the vault's on-chain ExternalLiquiditySlot array into ExternalPositionRefs.
16165
+ * Layout (C repr / bytemuck):
16166
+ * byte 0 : discriminant (0 = None, 1 = Marginfi)
16167
+ * bytes 8–40 : userAccount pubkey
16168
+ *
16169
+ * No mint is specified here — the MarginfiPositionProvider will iterate all
16170
+ * active balances on the account and return positions keyed by bank mint.
16171
+ */
16172
+ declare function parseExternalLiquidityRefs(vaultState: DecodedVault): ExternalPositionRef[];
16173
+
16174
+ /** Price conversions between USD spot and the vault's accounting unit. */
16175
+ /** Re-denominate a USD price into the vault's accounting unit, fixed-point. */
16176
+ declare function priceInAccountingUnit(usd: number, baseUsd: number, assetDecimals: number): bigint;
16177
+ /** Inverse of {@link priceInAccountingUnit}, for logging live-oracle holdings. */
16178
+ declare function accountingUnitPriceToUsd(price: bigint, baseUsd: number, assetDecimals: number): number;
16179
+
16076
16180
  /**
16077
- * {@link PriceSource} backed by the Jupiter price API.
16181
+ * Repeated-read sampling.
16078
16182
  *
16079
- * Mirrors the existing feed in `oracle-service/src/feeds/jupiter.ts`
16080
- * (`GET /price/v3`, batched at 50 ids, small retry, reads `usdPrice`) but is
16081
- * self-contained so `vault_sdk` keeps its lean dependency set.
16183
+ * Live protocol reads (Kamino/Marginfi position NAV) can come back mid-update
16184
+ * or against a lagging RPC node, so a single read is not trustworthy enough to
16185
+ * report on-chain. The fix used elsewhere in this repo — see
16186
+ * `bankineco-services/src/oracle/updateKaminoVaultPendingYield.ts` — is to read
16187
+ * the value several times back to back and keep the most frequent answer,
16188
+ * failing closed when no value is observed more than once.
16189
+ */
16190
+ /**
16191
+ * The most frequently occurring value. Throws when `values` is empty or when
16192
+ * every value is distinct — a single unrepeated reading is not consensus.
16082
16193
  */
16194
+ declare function mostFrequent<T>(values: readonly T[], keyOf?: (value: T) => string): T;
16195
+ interface CollectSamplesOptions {
16196
+ /** How many reads to attempt, back to back. */
16197
+ samples: number;
16198
+ /** Minimum successful reads required, else the whole read fails. */
16199
+ minSamples: number;
16200
+ /** Called with each failed attempt; failures are otherwise skipped. */
16201
+ onError?: (err: unknown, attempt: number) => void;
16202
+ }
16203
+ /**
16204
+ * Run `read` `samples` times in sequence, discarding failures. Throws when
16205
+ * fewer than `minSamples` reads succeed.
16206
+ */
16207
+ declare function collectSamples<T>(read: () => Promise<T>, { samples, minSamples, onError }: CollectSamplesOptions): Promise<T[]>;
16083
16208
 
16084
- interface JupiterPriceSourceOptions {
16085
- /** Override the price endpoint (e.g. the keyed `api.jup.ag` host). */
16086
- baseUrl?: string;
16087
- /** Retry attempts per batch request. */
16088
- retries?: number;
16089
- /** Injectable fetch (for tests); defaults to global `fetch`. */
16090
- fetchFn?: typeof fetch;
16209
+ /**
16210
+ * Dry-run counterpart to `settlement.ts`: read the canonical share supplies and
16211
+ * replay the exact on-chain settlement path locally, without sending anything.
16212
+ */
16213
+
16214
+ interface SimulateDryRunSettlementParams {
16215
+ client: VaultClient;
16216
+ signer: Keypair;
16217
+ vault: Address;
16218
+ vaultState: DecodedVault;
16219
+ updates: HoldingUpdatePreview[];
16220
+ nowSecs: bigint;
16091
16221
  }
16222
+ declare function simulateDryRunSettlement({ client, signer, vault, vaultState, updates, nowSecs, }: SimulateDryRunSettlementParams): Promise<SettlementSimulation>;
16223
+
16224
+ declare function buildUpdates(yieldTracker: YieldTracker | undefined, reportableHoldings: ConsensusHoldingEntry[], inputs: VaultPricingInputs): Promise<HoldingUpdatePreview[]>;
16225
+ declare function buildHoldingUpdate(yieldTracker: YieldTracker | undefined, entry: ConsensusHoldingEntry, inputs: VaultPricingInputs): Promise<HoldingUpdatePreview>;
16226
+ /** Tracked external principal + outstanding yield attributed to a holding. */
16227
+ declare function resolveTrackedAmounts(yieldTracker: YieldTracker | undefined, cfg: ConsensusOracleHoldingConfig | undefined, decimals: number): Promise<{
16228
+ principalAmount: bigint;
16229
+ yieldAmount: bigint;
16230
+ }>;
16231
+
16232
+ /**
16233
+ * Step 1 of a pass: keep active permissionless price sources warm so they
16234
+ * cannot block the NAV crank after the consensus report lands. Prices are
16235
+ * refreshed at least once per hour, or at the vault's shorter staleness
16236
+ * interval when configured.
16237
+ */
16238
+
16239
+ interface RefreshLiveOraclePricesParams {
16240
+ oracle: OracleService;
16241
+ signer: Keypair;
16242
+ vault: Address;
16243
+ vaultState: DecodedVault;
16244
+ nowSecs: bigint;
16245
+ log: (msg: string) => void;
16246
+ dryRun: boolean;
16247
+ }
16248
+ /** Returns true when at least one price was actually refreshed on-chain. */
16249
+ declare function refreshLiveOraclePrices({ oracle, signer, vault, vaultState, nowSecs, log, dryRun, }: RefreshLiveOraclePricesParams): Promise<boolean>;
16250
+
16251
+ /**
16252
+ * Sourcing step: fetch every external input the per-holding updates draw on —
16253
+ * USD spot prices, manager wallet balances, and live external LP positions.
16254
+ */
16255
+
16256
+ declare function gatherPricingInputs(deps: ConsensusOracleDeps, target: ConsensusOracleTarget, vaultState: DecodedVault, reportableHoldings: ConsensusHoldingEntry[], log?: (msg: string) => void): Promise<VaultPricingInputs>;
16257
+ /**
16258
+ * Live-LP balances for the target, summed by mint (empty if no provider).
16259
+ *
16260
+ * The provider is read {@link EXTERNAL_POSITION_SAMPLES} times back to back and
16261
+ * the most frequent amount per mint is kept — a single read can land mid-update
16262
+ * or hit a lagging RPC node, and this value is reported on-chain as
16263
+ * `external_amount`.
16264
+ */
16265
+ declare function fetchExternalPositions(deps: ConsensusOracleDeps, target: ConsensusOracleTarget, manager: Address, vaultState: DecodedVault, log?: (msg: string) => void): Promise<Map<string, bigint>>;
16266
+
16267
+ /**
16268
+ * Receipt mints issued by a vault are liabilities/shares, not underlying assets
16269
+ * for its own NAV. They are excluded from reporting even when registered as
16270
+ * consensus-priced holdings.
16271
+ */
16272
+
16273
+ declare function fetchReceiptMints(client: VaultClient, vault: Address, vaultState: DecodedVault): Promise<Set<string>>;
16274
+
16275
+ /**
16276
+ * Settlement step: push the consensus report for all holdings, then crank NAV.
16277
+ */
16278
+
16279
+ interface SettleVaultResult {
16280
+ updateSignature: string;
16281
+ crankSignature?: string;
16282
+ crankSkippedReason?: string;
16283
+ }
16284
+ interface SettleVaultParams {
16285
+ client: VaultClient;
16286
+ oracle: OracleService;
16287
+ yieldTracker: YieldTracker | undefined;
16288
+ signer: Keypair;
16289
+ target: ConsensusOracleTarget;
16290
+ updates: HoldingUpdatePreview[];
16291
+ vaultState: DecodedVault;
16292
+ nowSecs: bigint;
16293
+ log: (msg: string) => void;
16294
+ }
16295
+ /** Push the consensus report for all holdings, then settle NAV. */
16296
+ declare function settleVault({ client, oracle, yieldTracker, signer, target, updates, vaultState, nowSecs, log, }: SettleVaultParams): Promise<SettleVaultResult>;
16297
+ interface LogProspectiveApyParams {
16298
+ client: VaultClient;
16299
+ vault: Address;
16300
+ updates: HoldingUpdatePreview[];
16301
+ vaultState: DecodedVault;
16302
+ nowSecs: bigint;
16303
+ log: (msg: string) => void;
16304
+ }
16305
+ /**
16306
+ * Fetch the current settlement timestamp and log the APY implied by the
16307
+ * prospective update, so MaxApyExceeded failures are diagnosable.
16308
+ *
16309
+ * NAV is expressed in the vault's accounting unit (scaled by assetDecimals).
16310
+ * Mirrors `gross_nav_from_holdings`: consensus updates overlay their target
16311
+ * slots, while live-priced and otherwise unchanged holdings retain their
16312
+ * current price/external amount.
16313
+ */
16314
+ declare function logProspectiveApy({ client, vault, updates, vaultState, nowSecs, log, }: LogProspectiveApyParams): Promise<void>;
16315
+
16316
+ /**
16317
+ * Discover which on-chain vaults a given keypair is a registered consensus
16318
+ * oracle signer for.
16319
+ */
16320
+
16321
+ /**
16322
+ * Fetches every vault and its oracle account, then filters by signer
16323
+ * membership. Returns minimal `ConsensusOracleTarget` entries (no per-holding
16324
+ * config); callers can overlay config from `targets.ts` if needed.
16325
+ */
16326
+ declare function discoverVaultsForSigner(client: VaultClient, signer: Keypair, opts?: {
16327
+ log?: (msg: string) => void;
16328
+ }): Promise<ConsensusOracleTarget[]>;
16329
+
16330
+ /**
16331
+ * Fail closed while any configured yield account has an unsettled payment.
16332
+ * The payout must be confirmed only after it is visible in the same wallet
16333
+ * balance source used by this service. Until then, no oracle update is safe.
16334
+ */
16335
+ declare function assertNoUnconfirmedYieldPayments(yieldTracker: YieldTracker | undefined, target: ConsensusOracleTarget): Promise<void>;
16336
+ /**
16337
+ * In production, yield accounts are tagged with their vault address. Attach
16338
+ * newly discovered accounts to the base holding, while preserving explicit
16339
+ * per-mint mappings supplied by config or CLI flags.
16340
+ */
16341
+ declare function withDiscoveredYieldAccounts(yieldTracker: YieldTracker | undefined, target: ConsensusOracleTarget, vaultState: DecodedVault, excludedMints: ReadonlySet<string>, log: (msg: string) => void): Promise<ConsensusOracleTarget>;
16342
+
16343
+ /**
16344
+ * {@link PriceSource} adapter over the `jupiter` package's price API.
16345
+ *
16346
+ * The HTTP client (batching, retries, response shape) lives in
16347
+ * `jupiter/src/priceApi.ts`; this file only binds it to the consensus-oracle
16348
+ * interface.
16349
+ */
16350
+
16351
+ type JupiterPriceSourceOptions = FetchJupiterUsdPricesOptions;
16092
16352
  declare class JupiterPriceSource implements PriceSource {
16093
- private readonly baseUrl;
16094
- private readonly retries;
16095
- private readonly fetchFn;
16353
+ private readonly opts;
16096
16354
  constructor(opts?: JupiterPriceSourceOptions);
16097
16355
  fetchUsdPrices(mints: Address[]): Promise<Record<string, number>>;
16098
16356
  }
16099
16357
 
16100
- /** Nest's Perena vault-share price feed. */
16358
+ /**
16359
+ * {@link PriceSource} adapter over the `nest` package's price API, bound to the
16360
+ * Perena vault's Nest slug and share mint.
16361
+ */
16101
16362
 
16102
- declare const NEST_API_BASE_URL = "https://api.nest.credit/v1";
16103
16363
  declare const NEST_VAULT_SLUG = "nest-perena-vault";
16104
16364
  declare const NEST_RWA_SHARE_MINT: Address;
16105
- interface FetchNestTokenPriceOptions {
16106
- baseUrl?: string;
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
- */
16365
+ type FetchNestTokenPriceOptions = FetchNestVaultSharePriceOptions;
16366
+ /** Fetch the USD price of one share of the Perena vault on Nest. */
16114
16367
  declare function fetchNestTokenPrice(nestVaultSlug?: string, opts?: FetchNestTokenPriceOptions): Promise<number>;
16115
16368
  interface NestPriceSourceOptions extends FetchNestTokenPriceOptions {
16116
16369
  nestVaultSlug?: string;
@@ -16139,35 +16392,25 @@ declare class LivePriceSource implements PriceSource {
16139
16392
  }
16140
16393
 
16141
16394
  /**
16142
- * {@link WalletBalanceSource} backed by the Jupiter "portfolio" / Ultra balances
16143
- * API, with an on-chain RPC fallback.
16395
+ * {@link WalletBalanceSource} adapter over the `jupiter` package's balances API.
16144
16396
  *
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.
16149
- *
16150
- * `amount` from Jupiter is already in raw base units, matching the on-chain
16151
- * `external_amount` unit, so no decimal conversion is applied here.
16397
+ * The Jupiter call and the RPC fallback both live in
16398
+ * `jupiter/src/balancesApi.ts`; this file owns the policy try Jupiter first,
16399
+ * fall back to RPC on failure or an empty result — plus logging.
16152
16400
  */
16153
16401
 
16154
- interface JupiterBalanceSourceOptions {
16155
- baseUrl?: string;
16156
- fetchFn?: typeof fetch;
16402
+ interface JupiterBalanceSourceOptions extends FetchJupiterBalancesOptions {
16157
16403
  /** Skip the Jupiter call and read straight from RPC. */
16158
16404
  rpcOnly?: boolean;
16159
16405
  log?: (msg: string) => void;
16160
16406
  }
16161
16407
  declare class JupiterBalanceSource implements WalletBalanceSource {
16162
16408
  private readonly connection;
16163
- private readonly baseUrl;
16164
- private readonly fetchFn;
16165
16409
  private readonly rpcOnly;
16166
16410
  private readonly log;
16411
+ private readonly apiOptions;
16167
16412
  constructor(connection: Connection, opts?: JupiterBalanceSourceOptions);
16168
16413
  fetchBalances(owner: Address): Promise<Record<string, bigint>>;
16169
- private fetchFromJupiter;
16170
- private fetchFromRpc;
16171
16414
  }
16172
16415
 
16173
16416
  /**
@@ -16203,6 +16446,16 @@ declare class KaminoPositionProvider implements ExternalPositionProvider {
16203
16446
  positionsFor(ctx: ExternalPositionContext): Promise<ExternalPosition[]>;
16204
16447
  }
16205
16448
 
16449
+ /**
16450
+ * {@link ExternalPositionProvider} adapter over the `marginfi` package's
16451
+ * position readers.
16452
+ *
16453
+ * The Marginfi SDK usage and account layout parsing live in
16454
+ * `marginfi/src/positions.ts`; this file maps `ExternalPositionRef`s onto them:
16455
+ * a ref with an explicit `marginfiBank` reads that one bank, while a ref with
16456
+ * only a `marginfiAccount` reports every non-zero balance on the account.
16457
+ */
16458
+
16206
16459
  declare class MarginfiPositionProvider implements ExternalPositionProvider {
16207
16460
  private readonly connection;
16208
16461
  private readonly log;
@@ -16210,31 +16463,6 @@ declare class MarginfiPositionProvider implements ExternalPositionProvider {
16210
16463
  positionsFor(ctx: ExternalPositionContext): Promise<ExternalPosition[]>;
16211
16464
  }
16212
16465
 
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
16466
  /**
16239
16467
  * In-memory mock of the bankineco yield tracker.
16240
16468
  *
@@ -16330,6 +16558,31 @@ declare function applyEffectiveApy(anchor: bigint, apyBps: number, elapsedSecs:
16330
16558
  /** Human-readable CLI lines for a raw settlement projection. */
16331
16559
  declare function formatSettlementSimulation(simulation: SettlementSimulation): string[];
16332
16560
 
16561
+ interface LiveConsensusOracleDepsOptions {
16562
+ log?: (msg: string) => void;
16563
+ rpcOnly?: boolean;
16564
+ includeExternalPositions?: boolean;
16565
+ }
16566
+ declare function createLiveConsensusOracleDeps(connection: Connection, opts?: LiveConsensusOracleDepsOptions): ConsensusOracleDeps;
16567
+
16568
+ interface RunLiveConsensusOracleOptions extends RunOptions {
16569
+ /** Override the RPC endpoint used for vault discovery, price updates, and NAV cranks. */
16570
+ rpcUrl?: string;
16571
+ /** Override the vault program id. Defaults to the environment's configured program. */
16572
+ programId?: Address;
16573
+ /** Skip Jupiter balances and use RPC token-account balances only. */
16574
+ rpcOnly?: boolean;
16575
+ /** Include live Kamino/Marginfi positions in external amount updates. Defaults to true. */
16576
+ includeExternalPositions?: boolean;
16577
+ }
16578
+ /**
16579
+ * Full live consensus-oracle pass for one signer.
16580
+ *
16581
+ * Builds the vault client for `env`, discovers every vault where `oracleSigner`
16582
+ * is registered, updates consensus prices/external allocations, and cranks NAV.
16583
+ */
16584
+ declare function runLiveConsensusOracle(env: VaultEnv, oracleSigner: Keypair, opts?: RunLiveConsensusOracleOptions): Promise<RunSummary>;
16585
+
16333
16586
  declare class ConsensusOracleService {
16334
16587
  private readonly client;
16335
16588
  private readonly deps;
@@ -16338,20 +16591,6 @@ declare class ConsensusOracleService {
16338
16591
  constructor(client: VaultClient, deps: ConsensusOracleDeps);
16339
16592
  /** Drive one vault: source prices/balances, push consensus update, crank NAV. */
16340
16593
  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
16594
  /**
16356
16595
  * Drive several vaults in sequence. Non-fatal: a failure on one vault is
16357
16596
  * recorded and the rest still run (mirrors the oracle-updater daemon).
@@ -16361,46 +16600,13 @@ declare class ConsensusOracleService {
16361
16600
  runDiscoveredForSigner(signer: Keypair, opts?: RunOptions): Promise<RunSummary>;
16362
16601
  /**
16363
16602
  * Discover all on-chain vaults for which `signer` is a registered consensus
16364
- * oracle signer. Fetches every vault and its oracle account, then filters by
16365
- * signer membership. Returns minimal `ConsensusOracleTarget` entries (no
16366
- * per-holding config); callers can overlay config from `targets.ts` if needed.
16603
+ * oracle signer.
16367
16604
  */
16368
16605
  discoverVaultsForSigner(signer: Keypair, opts?: {
16369
16606
  log?: (msg: string) => void;
16370
16607
  }): Promise<ConsensusOracleTarget[]>;
16608
+ private nowSecs;
16371
16609
  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
16610
  }
16405
16611
 
16406
16612
  /**
@@ -16420,6 +16626,7 @@ interface ExternalLiquidityIntegrityResult {
16420
16626
  deposited: number;
16421
16627
  skipped: number;
16422
16628
  failed: number;
16629
+ /** Signatures of sent deposits (empty in dry-run mode). */
16423
16630
  signatures: string[];
16424
16631
  }
16425
16632
  interface ExternalLiquidityIntegritySummary {
@@ -16427,8 +16634,22 @@ interface ExternalLiquidityIntegritySummary {
16427
16634
  totalDeposited: number;
16428
16635
  totalSkipped: number;
16429
16636
  totalFailed: number;
16637
+ /** True when deposits were simulated rather than sent. */
16638
+ dryRun: boolean;
16430
16639
  }
16431
16640
  type LogFn = (msg: string) => void;
16641
+ interface ExternalLiquidityIntegrityOptions {
16642
+ log?: LogFn;
16643
+ /** Simulate each deposit instead of sending it. Nothing is submitted. */
16644
+ dryRun?: boolean;
16645
+ /**
16646
+ * Skip holdings worth less than this many UI tokens. Every mint with a
16647
+ * 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.
16649
+ */
16650
+ minAmountUi?: number;
16651
+ }
16652
+ declare const DEFAULT_MIN_AMOUNT_UI = 1;
16432
16653
  declare class ExternalLiquidityIntegrityService {
16433
16654
  private readonly client;
16434
16655
  constructor(client: VaultClient);
@@ -16436,15 +16657,16 @@ declare class ExternalLiquidityIntegrityService {
16436
16657
  * Scan all vaults and deposit any idle local balance into configured external
16437
16658
  * liquidity positions. Non-fatal per vault — errors are logged and counted.
16438
16659
  */
16439
- runAll(hwManager: Keypair, opts?: {
16440
- log?: LogFn;
16441
- }): Promise<ExternalLiquidityIntegritySummary>;
16660
+ runAll(hwManager: Keypair, opts?: ExternalLiquidityIntegrityOptions): Promise<ExternalLiquidityIntegritySummary>;
16442
16661
  /**
16443
16662
  * Process a single vault: for each active external liquidity slot, deposit
16444
16663
  * any holdings that have a non-zero local_amount.
16445
16664
  */
16446
- processVault(vault: Address, vaultState: VaultAccountData, hwManager: Keypair, log: LogFn): Promise<ExternalLiquidityIntegrityResult>;
16665
+ processVault(vault: Address, vaultState: VaultAccountData, hwManager: Keypair, log: LogFn, opts?: {
16666
+ dryRun?: boolean;
16667
+ minAmountUi?: number;
16668
+ }): Promise<ExternalLiquidityIntegrityResult>;
16447
16669
  private depositIntoMarginfi;
16448
16670
  }
16449
16671
 
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, NEST_API_BASE_URL, NEST_RWA_SHARE_MINT, NEST_VAULT_SLUG, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, NestPriceSource, type NestPriceSourceOptions, OracleService, 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, RemoveAssetHoldingBuilder, type RemoveAssetHoldingIxArgs, type RemoveAssetHoldingTxArgs, RequestJuniorTrancheWithdrawBuilder, type RequestJuniorTrancheWithdrawIxArgs, type RequestJuniorTrancheWithdrawTxArgs, type ResolvedSquadsWalletRoute, type RollingLimitConfig, type RunLiveConsensusOracleOptions, type RunOptions, type RunSummary, SHARE_DECIMALS, SetAssetPriceOracleBuilder, type SetAssetPriceOracleIxArgs, type SetAssetPriceOracleTxArgs, SetExternalLiquidityBuilder, type SetExternalLiquidityIxArgs, type SetExternalLiquidityTxArgs, SetProtocolFeeBuilder, type SetProtocolFeeIxArgs, type SetProtocolFeeTxArgs, SetVaultConfigBuilder, type SetVaultConfigIxArgs, type SetVaultConfigTxArgs, type SettlementSimulation, type SettlementSimulationSnapshot, 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, addCashflowUpdate, applyEffectiveApy, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, defaultKeypairPath, deleteAccount, fetchNestTokenPrice, findSquadsWalletRoute, formatSettlementSimulation, fromUiAmount, getAccounts, getBalance, getCashflows, getRpcUrl, getTotalOutstandingYield, getTotalYield, getVaultProgramId, getYield, getYieldPayments, isVaultEnv, keypairAddress, loadKeypair, makeProvider, mintTokensTo, prepareVaultTransaction, resolveKeypairPath, resolveSquadsWalletRoute, roundToNextUtcMidnight, runLiveConsensusOracle, simulateConsensusOracleSettlement, systemClock, toUiAmount, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, vaultAuthorityForWallet };
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 };