@perena/vault-sdk 1.0.52 → 1.0.53
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 +16 -1
- package/dist/index.js +70 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13793,6 +13793,8 @@ interface ManagerWalletReconciliation {
|
|
|
13793
13793
|
previousNav: bigint;
|
|
13794
13794
|
candidateNav: bigint;
|
|
13795
13795
|
adjustedNav?: bigint;
|
|
13796
|
+
/** Diagnostic candidate only; never publish this unless accepted is true. */
|
|
13797
|
+
walletUpdates?: HoldingUpdatePreview[];
|
|
13796
13798
|
}
|
|
13797
13799
|
/**
|
|
13798
13800
|
* Rebuild from sourced external amounts every pass. Never carry forward a prior
|
|
@@ -14197,6 +14199,19 @@ interface SimulateSettlementArgs {
|
|
|
14197
14199
|
physicalJuniorSupply?: bigint;
|
|
14198
14200
|
physicalSeniorSupply?: bigint;
|
|
14199
14201
|
}
|
|
14202
|
+
/**
|
|
14203
|
+
* Check the reports actually published on chain, without overlaying a proposed
|
|
14204
|
+
* report. A crank must wait until every submitted balance has reached consensus
|
|
14205
|
+
* and its aggregate is reflected in the holdings. Otherwise it can settle the
|
|
14206
|
+
* old holdings and change the NAV baseline before the second signer reports.
|
|
14207
|
+
*/
|
|
14208
|
+
declare function publishedConsensusBlockers(args: {
|
|
14209
|
+
vault: DecodedVault;
|
|
14210
|
+
oracleData: readonly number[];
|
|
14211
|
+
updates: readonly HoldingUpdatePreview[];
|
|
14212
|
+
signer: Address;
|
|
14213
|
+
nowTs: bigint;
|
|
14214
|
+
}): string[];
|
|
14200
14215
|
/** Replay consensus aggregation and NAV settlement without sending a transaction. */
|
|
14201
14216
|
declare function simulateConsensusOracleSettlement(args: SimulateSettlementArgs): SettlementSimulation;
|
|
14202
14217
|
/** Exact bigint port of common::utils::number::apply_effective_apy. */
|
|
@@ -14620,4 +14635,4 @@ declare function decodeNestDepositRequest(args: {
|
|
|
14620
14635
|
txBase64: string;
|
|
14621
14636
|
}): Promise<NestDepositPlan>;
|
|
14622
14637
|
|
|
14623
|
-
export { ASSET_DECIMALS, ASSET_REBALANCE_COOLDOWN_SECS, type AccountBalanceResponse, AccountClient, type AccountYieldResponse, ActivateCircuitBreakerBuilder, type ActivateCircuitBreakerIxArgs, type ActivateCircuitBreakerTxArgs, type AddAprCashflowUpdateParams, type AddCashflowUpdateParams, type AddIncentiveRecipientArgs, AddIncentiveRecipientBuilder, type AddIncentiveRecipientIxArgs, AddIncentiveRecipientV3Builder, type AddIncentiveRecipientV3IxArgs, type AddIncentiveRecipientV3TxArgs, type AddNavCashflowUpdateParams, type AprAccountBalanceResponse, type AprAccountYieldResponse, type AssetPriceOracleConfigIxArgs, type AssetPriceOracleConfigTxArgs, type AssetPriceRefreshTarget, type AssetRefreshResult, type AssetType, BALANCE_CHANGE_BASELINE_MAX_AGE_SECS, type Bankineco, type BasicAuthCredentials, type Bigintish, type BuildMarginfiWithdrawInteractionArgs, CONSENSUS_ORACLE_VARIANT, type CancelIncentiveProposalArgs, CancelIncentiveProposalBuilder, CancelJuniorTrancheWithdrawBuilder, type CancelJuniorTrancheWithdrawIxArgs, type CancelJuniorTrancheWithdrawTxArgs, ClaimIncentiveBuilder, type ClaimIncentiveIxArgs, type ClaimIncentiveTxArgs, ClaimIncentiveV3Builder, type ClaimIncentiveV3IxArgs, type ClaimIncentiveV3TxArgs, 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, CreateIncentiveBuilder, type CreateIncentiveIxArgs, type CreateIncentiveTxArgs, CreateIncentiveV3Builder, type CreateIncentiveV3IxArgs, type CreateIncentiveV3TxArgs, type CreateTokenMintIxs, CreateTrancheStateBuilder, type CreateTrancheStateIxArgs, type CreateTrancheStateTxArgs, CreateVaultBuilder, type CreateVaultClientOptions, type CreateVaultIxArgs, type CreateVaultParams, type CreateVaultTxArgs, type CreateYieldPaymentParams, DEFAULT_CU_PRICE_MICRO_LAMPORTS, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, DEFAULT_MAX_ACCOUNTS, DEFAULT_MINTS, DEFAULT_MIN_AMOUNT_UI, DEFAULT_ORACLE_STALENESS_THRESHOLD_SECS, DEFAULT_PRICE_ORACLE_ACCOUNT, DEFAULT_PRICE_STALENESS_SECS, DEFAULT_PRICE_STALENESS_THRESHOLD_SECS, DEFAULT_REBALANCE_BAND_BPS, DEFAULT_SLIPPAGE_BPS, DEFAULT_TARGET_LOCAL_BPS, DEFAULT_TARGET_LOCAL_USDC_TVL_BPS, DEFAULT_VAULT_ID, type DecodedHolding, type DecodedVault, type DecodedVaultTrancheState, type DeleteAccountParams, DepositCuratorFeesBuilder, type DepositCuratorFeesIxArgs, type DepositCuratorFeesTxArgs, DisableCircuitBreakerBuilder, type DisableCircuitBreakerIxArgs, type DisableCircuitBreakerTxArgs, DistributeIncentiveBuilder, type DistributeIncentiveIxArgs, type DistributeIncentiveTxArgs, DistributeIncentiveV3Builder, type DistributeIncentiveV3IxArgs, type DistributeIncentiveV3TxArgs, EXTERNAL_POSITION_SAMPLES, ExecuteDepositBuilder, type ExecuteDepositIxArgs, type ExecuteDepositTxArgs, ExecuteShareSwapBuilder, type ExecuteShareSwapIxArgs, type ExecuteShareSwapTxArgs, ExecuteTrancheDepositBuilder, type ExecuteTrancheDepositIxArgs, type ExecuteTrancheDepositTxArgs, ExecuteTrancheWithdrawBuilder, type ExecuteTrancheWithdrawIxArgs, type ExecuteTrancheWithdrawTxArgs, ExecuteWithdrawBuilder, type ExecuteWithdrawIxArgs, type ExecuteWithdrawTxArgs, type ExternalLiquidityIntegrityOptions, type ExternalLiquidityIntegrityResult, ExternalLiquidityIntegrityService, type ExternalLiquidityIntegritySummary, type ExternalLiquiditySlot, type ExternalLiquiditySourceArgs, type ExternalPosition, type ExternalPositionContext, type ExternalPositionProvider, type ExternalPositionRef, ExternalPositionRegistry, FEE_VAULT_CACHE_CATEGORY, type FeeVaultAccountData, type FetchNestTokenPriceOptions, FulfillJuniorTrancheWithdrawBuilder, type FulfillJuniorTrancheWithdrawIxArgs, type FulfillJuniorTrancheWithdrawTxArgs, type FulfillSummary, type HoldingNavContribution, type HoldingUpdatePreview, IDL, IDLE_RESERVE_FLOOR_BPS, IDLE_RESERVE_TARGET_BPS, type IdleLiquidityOptions, type IdleLiquidityResult, IdleLiquidityService, type IdleLiquidityStatus, type IncentiveRecipient, type IncentiveTotals, type IncentiveUsdUpdateArgs, type IncentiveV3OracleState, type IncentiveV3Recipient, type IncentiveV3Totals, InitializeVaultRolesBuilder, type InitializeVaultRolesIxArgs, type InitializeVaultRolesTxArgs, type JuniorWithdrawalMode, JupiterPriceSource, type JupiterPriceSourceOptions, JupiterSwapBuilder, type JupiterSwapIxArgs, type JupiterSwapTxArgs, KaminoPositionProvider, LIVE_ORACLE_VARIANTS, LIVE_PRICE_REFRESH_INTERVAL_SECS, LOCAL_PROTOCOL_ADMIN, LargeBalanceChangeError, type LargeBalanceChangeViolation, type LiveConsensusOracleDepsOptions, LivePriceSource, type LivePriceSourceOptions, MANAGER_WALLET_NAV_DROP_TRIGGER_BPS, MANAGER_WALLET_NAV_TOLERANCE_BPS, MAX_APY_ANCHOR_WINDOW_SECS, MAX_APY_PREVIOUS_ANCHOR_AGE_SECS, MAX_BALANCE_CHANGE_BPS, MAX_CONSENSUS_SIGNERS, MAX_INCENTIVE_RECIPIENTS, MAX_INCENTIVE_REPORT_TTL, MAX_MANAGER_WITHDRAW_DESTINATIONS, MAX_PRICE_STALENESS_THRESHOLD_SECS, MIN_EXTERNAL_POSITION_SAMPLES, ManagerRedepositAssetBuilder, type ManagerRedepositAssetIxArgs, type ManagerRedepositAssetTxArgs, type ManagerWalletBalanceSource, type ManagerWalletReconciliation, ManagerWithdrawAssetBuilder, type ManagerWithdrawAssetIxArgs, type ManagerWithdrawAssetTxArgs, MarginfiPositionProvider, type MaxApyAnchorSnapshot, type MintConfig, type MintIdentifier, type MintInfo, MintRegistry, type MintRegistryOptions, type MockYieldAccountConfig, MockYieldTracker, type MockYieldTrackerOptions, type MpcWalletBalanceSource, type MpcWalletBalances, type MpcWalletConfig, NEST_API_BASE_URL, NEST_RWA_SHARE_MINT, NEST_VAULT_SLUG, type NavAccountBalanceResponse, type NavAccountValueResponse, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, type NavPriceConfig, type NavYieldAccount, NestApiError, type NestApiOptions, type NestDepositPlan, NestPriceSource, type NestPriceSourceOptions, type NestRedemptionQuote, type NestRedemptionStatus, 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 PendingConsensusSignerSet, type PreparedDirectTransaction, type PreparedSquadsTransaction, type PreparedVaultTransaction, type PriceOracleTypeArgs, type PriceSource, ProtocolInteractionBuilder, type ProtocolInteractionIxArgs, type ProtocolInteractionTxArgs, type QuoteFeeUnit, REPORTABLE_ORACLE_VARIANTS, type RealizedApySimulation, type RefreshLiveOraclePricesParams, RemoveAssetHoldingBuilder, type RemoveAssetHoldingIxArgs, type RemoveAssetHoldingTxArgs, ReportIncentiveV3Builder, type ReportIncentiveV3IxArgs, type ReportIncentiveV3TxArgs, RequestJuniorTrancheWithdrawBuilder, type RequestJuniorTrancheWithdrawIxArgs, type RequestJuniorTrancheWithdrawTxArgs, type ResolveExternalWithdrawArgs, type ResolvedExternalWithdraw, type ResolvedSquadsWalletRoute, type RollingLimitConfig, type RollingRebalanceLimitConfig, RpcManagerWalletBalanceSource, RpcMpcWalletBalanceSource, type RunLiveConsensusOracleOptions, type RunOptions, type RunSummary, SHARE_DECIMALS, SYSTEM_PROGRAM, SetAssetPriceOracleBuilder, type SetAssetPriceOracleIxArgs, type SetAssetPriceOracleTxArgs, SetExternalLiquidityBuilder, type SetExternalLiquidityIxArgs, type SetExternalLiquidityTxArgs, type SetIncentiveLimitsArgs, SetIncentiveLimitsBuilder, type SetIncentiveLimitsV3Args, SetIncentiveLimitsV3Builder, SetManagerWithdrawDestinationBuilder, type SetManagerWithdrawDestinationIxArgs, type SetManagerWithdrawDestinationTxArgs, SetProtocolFeeBuilder, type SetProtocolFeeIxArgs, type SetProtocolFeeTxArgs, SetVaultConfigBuilder, type SetVaultConfigIxArgs, type SetVaultConfigTxArgs, SettleIncentiveV3Builder, type SettleIncentiveV3IxArgs, type SettleIncentiveV3TxArgs, type SettleVaultParams, type SettleVaultResult, type SettlementSimulation, type SettlementSimulationSnapshot, type SimulateDryRunSettlementParams, type SimulateSettlementArgs, type SimulatedShareClass, SquadsProposalExecutionSimulationError, type SquadsProposalUpload, type SquadsWalletRouteConfig, type StaleBalanceChangeBypass, StaticPositionProvider, SubmitIncentiveBuilder, type SubmitIncentiveIxArgs, type SubmitIncentiveTxArgs, TOKEN_PROGRAM, TOKEN_PROGRAM_ID, type TimelockSettlementKind, type TimelockSettlementOptions, type TimelockSettlementRecord, TimelockSettlementService, type TimelockSettlementSummary, type TrackedAccountValue, 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 VaultIncentiveAccount, type VaultIncentiveAccountData, type VaultIncentiveV3Account, type VaultIncentiveV3AccountData, 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, WITHDRAWABLE_RESERVE_FLOOR_BPS, type WithdrawProtocolFeesIxArgs, type WithdrawProtocolFeesTxArgs, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldCashflow, type YieldPaymentResponse, type YieldPaymentSnapshot, type YieldTracker, type YieldValuationModel, accountingUnitPriceToUsd, addCashflowUpdate, applyEffectiveApy, assertNoLargeBalanceChanges, assertNoUnconfirmedYieldPayments, buildHoldingUpdate, buildMarginfiWithdrawInteraction, buildNestDepositRequest, buildNestWithdrawalRequest, buildUpdates, candidateGrossNav, coerceBool, collectSamples, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, decodeNestDepositRequest, decodeNestWithdrawalRequest, decodePendingConsensusSigners, defaultKeypairPath, deleteAccount, discoverVaultsForSigner, fetchExternalPositions, fetchNestRedemptionQuote, fetchNestRedemptionStatus, fetchNestTokenPrice, fetchReceiptMints, filterTargetHoldings, findLargeBalanceChanges, findSquadsWalletRoute, formatSettlementSimulation, fromUiAmount, gatherPricingInputs, getAccount, getAccounts, getAprYield, getBalance, getCashflows, getIncentiveRecipientShareAtas, getIncentiveRecipients, getIncentiveReportRecipients, getIncentiveTotals, getIncentiveV3OracleState, getIncentiveV3RecipientShareAtas, getIncentiveV3Recipients, getIncentiveV3Totals, getNavValue, getRpcUrl, getTotalOutstandingYield, getTotalTrackedValue, getTotalYield, getTrackedValue, getVaultProgramId, getYield, getYieldPayments, indexConfigByMint, isNavAccountBalance, isNavAccountValue, isNavYieldAccount, isVaultEnv, keypairAddress, loadKeypair, logProspectiveApy, makeProvider, managerReconciliationStateKey, mintTokensTo, mints, mostFrequent, parseExternalLiquidityRefs, planRebalance, prepareSquadsProposalUpload, prepareVaultTransaction, previousPhysicalNav, priceInAccountingUnit, readI64LE, readSplMintSupply, reconcileManagerWalletBalances, refreshLiveOraclePrices, resolveExternalWithdraw, resolveKeypairPath, resolveSquadsWalletRoute, resolveTrackedAmounts, roundToNextUtcMidnight, runLiveConsensusOracle, selectReportableHoldings, settleVault, signerInOracleData, simulateConsensusOracleSettlement, simulateDryRunSettlement, simulateSquadsProposalExecution, sumPositionsByMint, systemClock, toBigInt, toUiAmount, toWeb3AccountMeta, trackedValueFromResponse, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, variantName, vaultAuthorityForWallet, withDiscoveredYieldAccounts };
|
|
14638
|
+
export { ASSET_DECIMALS, ASSET_REBALANCE_COOLDOWN_SECS, type AccountBalanceResponse, AccountClient, type AccountYieldResponse, ActivateCircuitBreakerBuilder, type ActivateCircuitBreakerIxArgs, type ActivateCircuitBreakerTxArgs, type AddAprCashflowUpdateParams, type AddCashflowUpdateParams, type AddIncentiveRecipientArgs, AddIncentiveRecipientBuilder, type AddIncentiveRecipientIxArgs, AddIncentiveRecipientV3Builder, type AddIncentiveRecipientV3IxArgs, type AddIncentiveRecipientV3TxArgs, type AddNavCashflowUpdateParams, type AprAccountBalanceResponse, type AprAccountYieldResponse, type AssetPriceOracleConfigIxArgs, type AssetPriceOracleConfigTxArgs, type AssetPriceRefreshTarget, type AssetRefreshResult, type AssetType, BALANCE_CHANGE_BASELINE_MAX_AGE_SECS, type Bankineco, type BasicAuthCredentials, type Bigintish, type BuildMarginfiWithdrawInteractionArgs, CONSENSUS_ORACLE_VARIANT, type CancelIncentiveProposalArgs, CancelIncentiveProposalBuilder, CancelJuniorTrancheWithdrawBuilder, type CancelJuniorTrancheWithdrawIxArgs, type CancelJuniorTrancheWithdrawTxArgs, ClaimIncentiveBuilder, type ClaimIncentiveIxArgs, type ClaimIncentiveTxArgs, ClaimIncentiveV3Builder, type ClaimIncentiveV3IxArgs, type ClaimIncentiveV3TxArgs, 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, CreateIncentiveBuilder, type CreateIncentiveIxArgs, type CreateIncentiveTxArgs, CreateIncentiveV3Builder, type CreateIncentiveV3IxArgs, type CreateIncentiveV3TxArgs, type CreateTokenMintIxs, CreateTrancheStateBuilder, type CreateTrancheStateIxArgs, type CreateTrancheStateTxArgs, CreateVaultBuilder, type CreateVaultClientOptions, type CreateVaultIxArgs, type CreateVaultParams, type CreateVaultTxArgs, type CreateYieldPaymentParams, DEFAULT_CU_PRICE_MICRO_LAMPORTS, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, DEFAULT_MAX_ACCOUNTS, DEFAULT_MINTS, DEFAULT_MIN_AMOUNT_UI, DEFAULT_ORACLE_STALENESS_THRESHOLD_SECS, DEFAULT_PRICE_ORACLE_ACCOUNT, DEFAULT_PRICE_STALENESS_SECS, DEFAULT_PRICE_STALENESS_THRESHOLD_SECS, DEFAULT_REBALANCE_BAND_BPS, DEFAULT_SLIPPAGE_BPS, DEFAULT_TARGET_LOCAL_BPS, DEFAULT_TARGET_LOCAL_USDC_TVL_BPS, DEFAULT_VAULT_ID, type DecodedHolding, type DecodedVault, type DecodedVaultTrancheState, type DeleteAccountParams, DepositCuratorFeesBuilder, type DepositCuratorFeesIxArgs, type DepositCuratorFeesTxArgs, DisableCircuitBreakerBuilder, type DisableCircuitBreakerIxArgs, type DisableCircuitBreakerTxArgs, DistributeIncentiveBuilder, type DistributeIncentiveIxArgs, type DistributeIncentiveTxArgs, DistributeIncentiveV3Builder, type DistributeIncentiveV3IxArgs, type DistributeIncentiveV3TxArgs, EXTERNAL_POSITION_SAMPLES, ExecuteDepositBuilder, type ExecuteDepositIxArgs, type ExecuteDepositTxArgs, ExecuteShareSwapBuilder, type ExecuteShareSwapIxArgs, type ExecuteShareSwapTxArgs, ExecuteTrancheDepositBuilder, type ExecuteTrancheDepositIxArgs, type ExecuteTrancheDepositTxArgs, ExecuteTrancheWithdrawBuilder, type ExecuteTrancheWithdrawIxArgs, type ExecuteTrancheWithdrawTxArgs, ExecuteWithdrawBuilder, type ExecuteWithdrawIxArgs, type ExecuteWithdrawTxArgs, type ExternalLiquidityIntegrityOptions, type ExternalLiquidityIntegrityResult, ExternalLiquidityIntegrityService, type ExternalLiquidityIntegritySummary, type ExternalLiquiditySlot, type ExternalLiquiditySourceArgs, type ExternalPosition, type ExternalPositionContext, type ExternalPositionProvider, type ExternalPositionRef, ExternalPositionRegistry, FEE_VAULT_CACHE_CATEGORY, type FeeVaultAccountData, type FetchNestTokenPriceOptions, FulfillJuniorTrancheWithdrawBuilder, type FulfillJuniorTrancheWithdrawIxArgs, type FulfillJuniorTrancheWithdrawTxArgs, type FulfillSummary, type HoldingNavContribution, type HoldingUpdatePreview, IDL, IDLE_RESERVE_FLOOR_BPS, IDLE_RESERVE_TARGET_BPS, type IdleLiquidityOptions, type IdleLiquidityResult, IdleLiquidityService, type IdleLiquidityStatus, type IncentiveRecipient, type IncentiveTotals, type IncentiveUsdUpdateArgs, type IncentiveV3OracleState, type IncentiveV3Recipient, type IncentiveV3Totals, InitializeVaultRolesBuilder, type InitializeVaultRolesIxArgs, type InitializeVaultRolesTxArgs, type JuniorWithdrawalMode, JupiterPriceSource, type JupiterPriceSourceOptions, JupiterSwapBuilder, type JupiterSwapIxArgs, type JupiterSwapTxArgs, KaminoPositionProvider, LIVE_ORACLE_VARIANTS, LIVE_PRICE_REFRESH_INTERVAL_SECS, LOCAL_PROTOCOL_ADMIN, LargeBalanceChangeError, type LargeBalanceChangeViolation, type LiveConsensusOracleDepsOptions, LivePriceSource, type LivePriceSourceOptions, MANAGER_WALLET_NAV_DROP_TRIGGER_BPS, MANAGER_WALLET_NAV_TOLERANCE_BPS, MAX_APY_ANCHOR_WINDOW_SECS, MAX_APY_PREVIOUS_ANCHOR_AGE_SECS, MAX_BALANCE_CHANGE_BPS, MAX_CONSENSUS_SIGNERS, MAX_INCENTIVE_RECIPIENTS, MAX_INCENTIVE_REPORT_TTL, MAX_MANAGER_WITHDRAW_DESTINATIONS, MAX_PRICE_STALENESS_THRESHOLD_SECS, MIN_EXTERNAL_POSITION_SAMPLES, ManagerRedepositAssetBuilder, type ManagerRedepositAssetIxArgs, type ManagerRedepositAssetTxArgs, type ManagerWalletBalanceSource, type ManagerWalletReconciliation, ManagerWithdrawAssetBuilder, type ManagerWithdrawAssetIxArgs, type ManagerWithdrawAssetTxArgs, MarginfiPositionProvider, type MaxApyAnchorSnapshot, type MintConfig, type MintIdentifier, type MintInfo, MintRegistry, type MintRegistryOptions, type MockYieldAccountConfig, MockYieldTracker, type MockYieldTrackerOptions, type MpcWalletBalanceSource, type MpcWalletBalances, type MpcWalletConfig, NEST_API_BASE_URL, NEST_RWA_SHARE_MINT, NEST_VAULT_SLUG, type NavAccountBalanceResponse, type NavAccountValueResponse, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, type NavPriceConfig, type NavYieldAccount, NestApiError, type NestApiOptions, type NestDepositPlan, NestPriceSource, type NestPriceSourceOptions, type NestRedemptionQuote, type NestRedemptionStatus, 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 PendingConsensusSignerSet, type PreparedDirectTransaction, type PreparedSquadsTransaction, type PreparedVaultTransaction, type PriceOracleTypeArgs, type PriceSource, ProtocolInteractionBuilder, type ProtocolInteractionIxArgs, type ProtocolInteractionTxArgs, type QuoteFeeUnit, REPORTABLE_ORACLE_VARIANTS, type RealizedApySimulation, type RefreshLiveOraclePricesParams, RemoveAssetHoldingBuilder, type RemoveAssetHoldingIxArgs, type RemoveAssetHoldingTxArgs, ReportIncentiveV3Builder, type ReportIncentiveV3IxArgs, type ReportIncentiveV3TxArgs, RequestJuniorTrancheWithdrawBuilder, type RequestJuniorTrancheWithdrawIxArgs, type RequestJuniorTrancheWithdrawTxArgs, type ResolveExternalWithdrawArgs, type ResolvedExternalWithdraw, type ResolvedSquadsWalletRoute, type RollingLimitConfig, type RollingRebalanceLimitConfig, RpcManagerWalletBalanceSource, RpcMpcWalletBalanceSource, type RunLiveConsensusOracleOptions, type RunOptions, type RunSummary, SHARE_DECIMALS, SYSTEM_PROGRAM, SetAssetPriceOracleBuilder, type SetAssetPriceOracleIxArgs, type SetAssetPriceOracleTxArgs, SetExternalLiquidityBuilder, type SetExternalLiquidityIxArgs, type SetExternalLiquidityTxArgs, type SetIncentiveLimitsArgs, SetIncentiveLimitsBuilder, type SetIncentiveLimitsV3Args, SetIncentiveLimitsV3Builder, SetManagerWithdrawDestinationBuilder, type SetManagerWithdrawDestinationIxArgs, type SetManagerWithdrawDestinationTxArgs, SetProtocolFeeBuilder, type SetProtocolFeeIxArgs, type SetProtocolFeeTxArgs, SetVaultConfigBuilder, type SetVaultConfigIxArgs, type SetVaultConfigTxArgs, SettleIncentiveV3Builder, type SettleIncentiveV3IxArgs, type SettleIncentiveV3TxArgs, type SettleVaultParams, type SettleVaultResult, type SettlementSimulation, type SettlementSimulationSnapshot, type SimulateDryRunSettlementParams, type SimulateSettlementArgs, type SimulatedShareClass, SquadsProposalExecutionSimulationError, type SquadsProposalUpload, type SquadsWalletRouteConfig, type StaleBalanceChangeBypass, StaticPositionProvider, SubmitIncentiveBuilder, type SubmitIncentiveIxArgs, type SubmitIncentiveTxArgs, TOKEN_PROGRAM, TOKEN_PROGRAM_ID, type TimelockSettlementKind, type TimelockSettlementOptions, type TimelockSettlementRecord, TimelockSettlementService, type TimelockSettlementSummary, type TrackedAccountValue, 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 VaultIncentiveAccount, type VaultIncentiveAccountData, type VaultIncentiveV3Account, type VaultIncentiveV3AccountData, 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, WITHDRAWABLE_RESERVE_FLOOR_BPS, type WithdrawProtocolFeesIxArgs, type WithdrawProtocolFeesTxArgs, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldCashflow, type YieldPaymentResponse, type YieldPaymentSnapshot, type YieldTracker, type YieldValuationModel, accountingUnitPriceToUsd, addCashflowUpdate, applyEffectiveApy, assertNoLargeBalanceChanges, assertNoUnconfirmedYieldPayments, buildHoldingUpdate, buildMarginfiWithdrawInteraction, buildNestDepositRequest, buildNestWithdrawalRequest, buildUpdates, candidateGrossNav, coerceBool, collectSamples, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, decodeNestDepositRequest, decodeNestWithdrawalRequest, decodePendingConsensusSigners, defaultKeypairPath, deleteAccount, discoverVaultsForSigner, fetchExternalPositions, fetchNestRedemptionQuote, fetchNestRedemptionStatus, fetchNestTokenPrice, fetchReceiptMints, filterTargetHoldings, findLargeBalanceChanges, findSquadsWalletRoute, formatSettlementSimulation, fromUiAmount, gatherPricingInputs, getAccount, getAccounts, getAprYield, getBalance, getCashflows, getIncentiveRecipientShareAtas, getIncentiveRecipients, getIncentiveReportRecipients, getIncentiveTotals, getIncentiveV3OracleState, getIncentiveV3RecipientShareAtas, getIncentiveV3Recipients, getIncentiveV3Totals, getNavValue, getRpcUrl, getTotalOutstandingYield, getTotalTrackedValue, getTotalYield, getTrackedValue, getVaultProgramId, getYield, getYieldPayments, indexConfigByMint, isNavAccountBalance, isNavAccountValue, isNavYieldAccount, isVaultEnv, keypairAddress, loadKeypair, logProspectiveApy, makeProvider, managerReconciliationStateKey, mintTokensTo, mints, mostFrequent, parseExternalLiquidityRefs, planRebalance, prepareSquadsProposalUpload, prepareVaultTransaction, previousPhysicalNav, priceInAccountingUnit, publishedConsensusBlockers, readI64LE, readSplMintSupply, reconcileManagerWalletBalances, refreshLiveOraclePrices, resolveExternalWithdraw, resolveKeypairPath, resolveSquadsWalletRoute, resolveTrackedAmounts, roundToNextUtcMidnight, runLiveConsensusOracle, selectReportableHoldings, settleVault, signerInOracleData, simulateConsensusOracleSettlement, simulateDryRunSettlement, simulateSquadsProposalExecution, sumPositionsByMint, systemClock, toBigInt, toUiAmount, toWeb3AccountMeta, trackedValueFromResponse, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, variantName, vaultAuthorityForWallet, withDiscoveredYieldAccounts };
|
package/dist/index.js
CHANGED
|
@@ -3499,6 +3499,7 @@ __export(index_exports, {
|
|
|
3499
3499
|
prepareVaultTransaction: () => prepareVaultTransaction,
|
|
3500
3500
|
previousPhysicalNav: () => previousPhysicalNav,
|
|
3501
3501
|
priceInAccountingUnit: () => priceInAccountingUnit,
|
|
3502
|
+
publishedConsensusBlockers: () => publishedConsensusBlockers,
|
|
3502
3503
|
readI64LE: () => readI64LE,
|
|
3503
3504
|
readSplMintSupply: () => readSplMintSupply,
|
|
3504
3505
|
reconcileManagerWalletBalances: () => reconcileManagerWalletBalances,
|
|
@@ -19515,6 +19516,47 @@ var EXTERNAL_OFFSET = PRICE_OFFSET + MAX_HOLDINGS * 8;
|
|
|
19515
19516
|
var APY_SCALE = 1000000000000000000n;
|
|
19516
19517
|
var APY_LN_2 = 693147180559945309n;
|
|
19517
19518
|
var APY_SERIES_TERMS = 32;
|
|
19519
|
+
function publishedConsensusBlockers(args) {
|
|
19520
|
+
const oracle = decodeOracleData(args.oracleData, args.nowTs);
|
|
19521
|
+
const holdings = args.vault.holdings.map(decodeHolding);
|
|
19522
|
+
const consensus = applyConsensus(
|
|
19523
|
+
holdings.map((holding) => ({ ...holding })),
|
|
19524
|
+
oracle.entries,
|
|
19525
|
+
args.nowTs,
|
|
19526
|
+
oracle.stalenessThresholdSecs
|
|
19527
|
+
);
|
|
19528
|
+
const own = oracle.entries.find((entry) => entry.signer === args.signer);
|
|
19529
|
+
const blockers = [];
|
|
19530
|
+
for (const update of args.updates) {
|
|
19531
|
+
const holding = holdings[update.holdingIndex];
|
|
19532
|
+
if (holding?.cleared && update.externalAmount === 0n) continue;
|
|
19533
|
+
if (!holding || holding.mint !== update.mint) {
|
|
19534
|
+
blockers.push(
|
|
19535
|
+
`holding #${update.holdingIndex} changed after publication`
|
|
19536
|
+
);
|
|
19537
|
+
continue;
|
|
19538
|
+
}
|
|
19539
|
+
if (!own || !isFresh(own.lastUpdateTs, args.nowTs, oracle.stalenessThresholdSecs) || own.prices[update.holdingIndex] !== update.price || own.externalAmounts[update.holdingIndex] !== update.externalAmount) {
|
|
19540
|
+
blockers.push(
|
|
19541
|
+
`holding #${update.holdingIndex} submitted report is not current`
|
|
19542
|
+
);
|
|
19543
|
+
continue;
|
|
19544
|
+
}
|
|
19545
|
+
const result = consensus.find(
|
|
19546
|
+
(item) => item.holdingIndex === update.holdingIndex
|
|
19547
|
+
);
|
|
19548
|
+
if (result?.settledExternalAmount === void 0) {
|
|
19549
|
+
blockers.push(
|
|
19550
|
+
`holding #${update.holdingIndex}: ${result?.reason ?? "no consensus"}`
|
|
19551
|
+
);
|
|
19552
|
+
} else if (holding.externalAmount !== result.settledExternalAmount || result.settledPrice !== void 0 && holding.price !== result.settledPrice) {
|
|
19553
|
+
blockers.push(
|
|
19554
|
+
`holding #${update.holdingIndex} consensus has not been applied to holdings`
|
|
19555
|
+
);
|
|
19556
|
+
}
|
|
19557
|
+
}
|
|
19558
|
+
return blockers;
|
|
19559
|
+
}
|
|
19518
19560
|
function simulateConsensusOracleSettlement(args) {
|
|
19519
19561
|
const warnings = [];
|
|
19520
19562
|
const blockers = [];
|
|
@@ -21064,7 +21106,8 @@ async function reconcileManagerWalletBalances({
|
|
|
21064
21106
|
updates: accepted ? adjusted : pendingUpdates,
|
|
21065
21107
|
previousNav,
|
|
21066
21108
|
candidateNav,
|
|
21067
|
-
adjustedNav
|
|
21109
|
+
adjustedNav,
|
|
21110
|
+
walletUpdates: adjusted
|
|
21068
21111
|
};
|
|
21069
21112
|
}
|
|
21070
21113
|
function managerReconciliationStateKey(state) {
|
|
@@ -21324,6 +21367,31 @@ async function settleVault2({
|
|
|
21324
21367
|
},
|
|
21325
21368
|
log
|
|
21326
21369
|
);
|
|
21370
|
+
let crankSkippedReason;
|
|
21371
|
+
try {
|
|
21372
|
+
const [publishedVault, publishedOracle, publishedAt] = await Promise.all([
|
|
21373
|
+
client.account.fetchVault(vault, { fresh: true }),
|
|
21374
|
+
client.account.fetchVaultOracleForVault(vault, { fresh: true }),
|
|
21375
|
+
client.account.fetchClockUnixTimestamp()
|
|
21376
|
+
]);
|
|
21377
|
+
const blockers = publishedConsensusBlockers({
|
|
21378
|
+
vault: publishedVault,
|
|
21379
|
+
oracleData: publishedOracle.data,
|
|
21380
|
+
updates,
|
|
21381
|
+
signer: (0, import_common56.fromWeb3Pk)(signer.publicKey),
|
|
21382
|
+
nowTs: publishedAt
|
|
21383
|
+
});
|
|
21384
|
+
if (blockers.length)
|
|
21385
|
+
crankSkippedReason = `waiting for published consensus: ${blockers.join(
|
|
21386
|
+
"; "
|
|
21387
|
+
)}`;
|
|
21388
|
+
} catch (error) {
|
|
21389
|
+
crankSkippedReason = `could not verify published consensus: ${error instanceof Error ? error.message : String(error)}`;
|
|
21390
|
+
}
|
|
21391
|
+
if (crankSkippedReason) {
|
|
21392
|
+
log(`skip crank nav ${vault}: ${crankSkippedReason}`);
|
|
21393
|
+
return { updateSignature, crankSkippedReason };
|
|
21394
|
+
}
|
|
21327
21395
|
const crankResult = await oracle.crankNavIfReady(signer, { vault }, log);
|
|
21328
21396
|
return {
|
|
21329
21397
|
updateSignature,
|
|
@@ -23803,6 +23871,7 @@ var import_common63 = __toESM(require_dist());
|
|
|
23803
23871
|
prepareVaultTransaction,
|
|
23804
23872
|
previousPhysicalNav,
|
|
23805
23873
|
priceInAccountingUnit,
|
|
23874
|
+
publishedConsensusBlockers,
|
|
23806
23875
|
readI64LE,
|
|
23807
23876
|
readSplMintSupply,
|
|
23808
23877
|
reconcileManagerWalletBalances,
|