@perena/vault-sdk 1.0.64 → 1.0.65
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 +12 -2
- package/dist/index.js +89 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -14867,6 +14867,8 @@ declare const MANAGER_WALLET_NAV_DROP_TRIGGER_BPS = 10n;
|
|
|
14867
14867
|
declare const MANAGER_WALLET_NAV_TOLERANCE_BPS = 5n;
|
|
14868
14868
|
/** Wallet USDC must match pending Nest value within ±5%, inclusively. */
|
|
14869
14869
|
declare const NEST_WITHDRAWAL_MATCH_TOLERANCE_BPS = 500n;
|
|
14870
|
+
/** Maximum per-holding external-value drift while preparing a report. */
|
|
14871
|
+
declare const RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS = 3n;
|
|
14870
14872
|
/** Previous physical NAV, including banked APY, adjusted for recorded cash flows. */
|
|
14871
14873
|
declare function previousPhysicalNav(state: DecodedVault): bigint;
|
|
14872
14874
|
/** Same per-holding integer valuation as the program's gross_nav_from_holdings. */
|
|
@@ -14895,8 +14897,16 @@ declare function reconcileManagerWalletBalances({ vault, vaultState, updates, so
|
|
|
14895
14897
|
}): Promise<ManagerWalletReconciliation>;
|
|
14896
14898
|
/** Exempt only the matched Nest-to-USDC conversion from the per-asset guard. */
|
|
14897
14899
|
declare function walletReconciliationGuardUpdates(state: DecodedVault, reconciliation: ManagerWalletReconciliation): HoldingUpdatePreview[];
|
|
14898
|
-
/**
|
|
14900
|
+
/** Holding identities and local token balances must still match exactly. */
|
|
14899
14901
|
declare function managerReconciliationStateKey(state: DecodedVault): string;
|
|
14902
|
+
/**
|
|
14903
|
+
* Capture immutable external amount × price numerators, optionally overlaying
|
|
14904
|
+
* the report. Decimal scales cancel in a per-holding comparison; keeping the
|
|
14905
|
+
* numerators avoids rounding away changes in small or high-precision holdings.
|
|
14906
|
+
*/
|
|
14907
|
+
declare function reconciliationExternalValues(state: DecodedVault, updates?: readonly HoldingUpdatePreview[]): bigint[];
|
|
14908
|
+
/** Inclusive ±3 bps against each initial value; zero must remain zero. */
|
|
14909
|
+
declare function assertReconciliationExternalValues(initial: readonly bigint[], current: readonly bigint[], errorPrefix: string): void;
|
|
14900
14910
|
|
|
14901
14911
|
declare function gatherPricingInputs(deps: ConsensusOracleDeps, target: ConsensusOracleTarget, vaultState: DecodedVault, reportableHoldings: ConsensusHoldingEntry[], log?: (msg: string) => void): Promise<VaultPricingInputs>;
|
|
14902
14912
|
/**
|
|
@@ -15779,4 +15789,4 @@ declare function collectVaultLookupTableAccounts(client: VaultClient, vault: Add
|
|
|
15779
15789
|
extraAccounts?: Address[];
|
|
15780
15790
|
}): Promise<Address[]>;
|
|
15781
15791
|
|
|
15782
|
-
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_EXTERNAL_WEIGHT_BAND_BPS, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MARGINFI_WEIGHT_BPS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, 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, type EvmCallArg, type EvmContractCall, type EvmContractNavPriceConfig, 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, type HttpJsonNavPriceConfig, 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, KaminoLendPositionProvider, 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_LUT_ADDRESSES, MAX_MANAGER_WITHDRAW_DESTINATIONS, MAX_ORACLE_IMPLIED_APY_BPS, 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, NEST_WITHDRAWAL_MATCH_TOLERANCE_BPS, type NavAccountBalanceResponse, type NavAccountValueResponse, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, type NavPriceConfig, type NavPricePreview, type NavPriceProvenance, 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, PST_TO_USDC_MAX_SLIPPAGE_BPS, PdaClient, type PendingConsensusSignerSet, type PreparedDirectTransaction, type PreparedSquadsTransaction, type PreparedVaultTransaction, type PreviewNavPriceParams, 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_LOOKUP_TABLES, 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 VaultLookupTableMap, VaultLutManager, 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, type WithdrawalLeg, type WithdrawalPlan, type WithdrawalPricing, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldCashflow, type YieldPaymentResponse, type YieldPaymentSnapshot, type YieldTracker, type YieldValuationModel, accountingUnitPriceToUsd, addCashflowUpdate, applyEffectiveApy, assertNoLargeBalanceChanges, assertNoUnconfirmedYieldPayments, assertOracleImpliedApy, buildHoldingUpdate, buildKaminoDepositInteraction, buildKaminoWithdrawInteraction, buildMarginfiWithdrawInteraction, buildNestDepositRequest, buildNestWithdrawalRequest, buildUpdates, candidateGrossNav, coerceBool, collectSamples, collectVaultLookupTableAccounts, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, decodeNestDepositRequest, decodeNestWithdrawalRequest, decodePendingConsensusSigners, defaultKeypairPath, deleteAccount, discoverVaultsForSigner, externalWithdrawComputeBudget, externalWithdrawLookupTables, 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, getVaultLookupTables, getVaultProgramId, getYield, getYieldPayments, indexConfigByMint, isEvmNavPriceConfig, isNavAccountBalance, isNavAccountValue, isNavYieldAccount, isVaultEnv, keypairAddress, loadKaminoDeposit, loadKaminoWithdrawal, loadKeypair, logProspectiveApy, makeProvider, managerReconciliationStateKey, mintTokensTo, mints, mostFrequent, parseExternalLiquidityRefs, planExternalAllocation, planRebalance, planWithdrawalLegs, prepareSquadsProposalUpload, prepareVaultTransaction, previewNavPrice, previousPhysicalNav, priceInAccountingUnit, publishedConsensusBlockers, readI64LE, readSplMintSupply, reconcileManagerWalletBalances, refreshLiveOraclePrices, resolveExternalWithdraw, resolveKeypairPath, resolveSquadsWalletRoute, resolveTrackedAmounts, resolveWithdrawalPlan, roundToNextUtcMidnight, runLiveConsensusOracle, selectReportableHoldings, settleVault, signerInOracleData, simulateConsensusOracleSettlement, simulateDryRunSettlement, simulateOraclePublication, simulateSquadsProposalExecution, sumPositionsByMint, systemClock, toBigInt, toUiAmount, toWeb3AccountMeta, trackedValueFromResponse, uniqueLutAddresses, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, variantName, vaultAuthorityForWallet, walletReconciliationGuardUpdates, withDiscoveredYieldAccounts, withVaultLookupTables, withdrawalComputeBudget };
|
|
15792
|
+
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_EXTERNAL_WEIGHT_BAND_BPS, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MARGINFI_WEIGHT_BPS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, 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, type EvmCallArg, type EvmContractCall, type EvmContractNavPriceConfig, 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, type HttpJsonNavPriceConfig, 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, KaminoLendPositionProvider, 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_LUT_ADDRESSES, MAX_MANAGER_WITHDRAW_DESTINATIONS, MAX_ORACLE_IMPLIED_APY_BPS, 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, NEST_WITHDRAWAL_MATCH_TOLERANCE_BPS, type NavAccountBalanceResponse, type NavAccountValueResponse, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, type NavPriceConfig, type NavPricePreview, type NavPriceProvenance, 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, PST_TO_USDC_MAX_SLIPPAGE_BPS, PdaClient, type PendingConsensusSignerSet, type PreparedDirectTransaction, type PreparedSquadsTransaction, type PreparedVaultTransaction, type PreviewNavPriceParams, type PriceOracleTypeArgs, type PriceSource, ProtocolInteractionBuilder, type ProtocolInteractionIxArgs, type ProtocolInteractionTxArgs, type QuoteFeeUnit, RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS, 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_LOOKUP_TABLES, 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 VaultLookupTableMap, VaultLutManager, 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, type WithdrawalLeg, type WithdrawalPlan, type WithdrawalPricing, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldCashflow, type YieldPaymentResponse, type YieldPaymentSnapshot, type YieldTracker, type YieldValuationModel, accountingUnitPriceToUsd, addCashflowUpdate, applyEffectiveApy, assertNoLargeBalanceChanges, assertNoUnconfirmedYieldPayments, assertOracleImpliedApy, assertReconciliationExternalValues, buildHoldingUpdate, buildKaminoDepositInteraction, buildKaminoWithdrawInteraction, buildMarginfiWithdrawInteraction, buildNestDepositRequest, buildNestWithdrawalRequest, buildUpdates, candidateGrossNav, coerceBool, collectSamples, collectVaultLookupTableAccounts, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, decodeNestDepositRequest, decodeNestWithdrawalRequest, decodePendingConsensusSigners, defaultKeypairPath, deleteAccount, discoverVaultsForSigner, externalWithdrawComputeBudget, externalWithdrawLookupTables, 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, getVaultLookupTables, getVaultProgramId, getYield, getYieldPayments, indexConfigByMint, isEvmNavPriceConfig, isNavAccountBalance, isNavAccountValue, isNavYieldAccount, isVaultEnv, keypairAddress, loadKaminoDeposit, loadKaminoWithdrawal, loadKeypair, logProspectiveApy, makeProvider, managerReconciliationStateKey, mintTokensTo, mints, mostFrequent, parseExternalLiquidityRefs, planExternalAllocation, planRebalance, planWithdrawalLegs, prepareSquadsProposalUpload, prepareVaultTransaction, previewNavPrice, previousPhysicalNav, priceInAccountingUnit, publishedConsensusBlockers, readI64LE, readSplMintSupply, reconcileManagerWalletBalances, reconciliationExternalValues, refreshLiveOraclePrices, resolveExternalWithdraw, resolveKeypairPath, resolveSquadsWalletRoute, resolveTrackedAmounts, resolveWithdrawalPlan, roundToNextUtcMidnight, runLiveConsensusOracle, selectReportableHoldings, settleVault, signerInOracleData, simulateConsensusOracleSettlement, simulateDryRunSettlement, simulateOraclePublication, simulateSquadsProposalExecution, sumPositionsByMint, systemClock, toBigInt, toUiAmount, toWeb3AccountMeta, trackedValueFromResponse, uniqueLutAddresses, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, variantName, vaultAuthorityForWallet, walletReconciliationGuardUpdates, withDiscoveredYieldAccounts, withVaultLookupTables, withdrawalComputeBudget };
|
package/dist/index.js
CHANGED
|
@@ -2147,6 +2147,7 @@ __export(index_exports, {
|
|
|
2147
2147
|
PST_TO_USDC_MAX_SLIPPAGE_BPS: () => PST_TO_USDC_MAX_SLIPPAGE_BPS,
|
|
2148
2148
|
PdaClient: () => PdaClient,
|
|
2149
2149
|
ProtocolInteractionBuilder: () => ProtocolInteractionBuilder,
|
|
2150
|
+
RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS: () => RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS,
|
|
2150
2151
|
REPORTABLE_ORACLE_VARIANTS: () => REPORTABLE_ORACLE_VARIANTS,
|
|
2151
2152
|
RemoveAssetHoldingBuilder: () => RemoveAssetHoldingBuilder,
|
|
2152
2153
|
ReportIncentiveV3Builder: () => ReportIncentiveV3Builder,
|
|
@@ -2203,6 +2204,7 @@ __export(index_exports, {
|
|
|
2203
2204
|
assertNoLargeBalanceChanges: () => assertNoLargeBalanceChanges,
|
|
2204
2205
|
assertNoUnconfirmedYieldPayments: () => assertNoUnconfirmedYieldPayments,
|
|
2205
2206
|
assertOracleImpliedApy: () => assertOracleImpliedApy,
|
|
2207
|
+
assertReconciliationExternalValues: () => assertReconciliationExternalValues,
|
|
2206
2208
|
buildHoldingUpdate: () => buildHoldingUpdate,
|
|
2207
2209
|
buildKaminoDepositInteraction: () => buildKaminoDepositInteraction,
|
|
2208
2210
|
buildKaminoWithdrawInteraction: () => buildKaminoWithdrawInteraction,
|
|
@@ -2294,6 +2296,7 @@ __export(index_exports, {
|
|
|
2294
2296
|
readI64LE: () => readI64LE,
|
|
2295
2297
|
readSplMintSupply: () => readSplMintSupply,
|
|
2296
2298
|
reconcileManagerWalletBalances: () => reconcileManagerWalletBalances,
|
|
2299
|
+
reconciliationExternalValues: () => reconciliationExternalValues,
|
|
2297
2300
|
refreshLiveOraclePrices: () => refreshLiveOraclePrices,
|
|
2298
2301
|
resolveExternalWithdraw: () => resolveExternalWithdraw,
|
|
2299
2302
|
resolveKeypairPath: () => resolveKeypairPath,
|
|
@@ -21494,6 +21497,7 @@ var NestPriceSource = class {
|
|
|
21494
21497
|
var MANAGER_WALLET_NAV_DROP_TRIGGER_BPS = 10n;
|
|
21495
21498
|
var MANAGER_WALLET_NAV_TOLERANCE_BPS = 5n;
|
|
21496
21499
|
var NEST_WITHDRAWAL_MATCH_TOLERANCE_BPS = 500n;
|
|
21500
|
+
var RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS = 3n;
|
|
21497
21501
|
var BPS = 10000n;
|
|
21498
21502
|
var U64_MAX2 = 0xffffffffffffffffn;
|
|
21499
21503
|
function previousPhysicalNav(state) {
|
|
@@ -21670,18 +21674,48 @@ function walletReconciliationGuardUpdates(state, reconciliation) {
|
|
|
21670
21674
|
function managerReconciliationStateKey(state) {
|
|
21671
21675
|
return JSON.stringify({
|
|
21672
21676
|
manager: (0, import_common55.fromWeb3Pk)(state.roles.manager),
|
|
21673
|
-
|
|
21677
|
+
assetDecimals: state.config.assetDecimals,
|
|
21674
21678
|
holdings: state.holdings.map((holding) => [
|
|
21675
21679
|
(0, import_common55.fromWeb3Pk)(holding.mint),
|
|
21676
21680
|
holding.decimals,
|
|
21677
21681
|
variantName2(holding.priceOracleType),
|
|
21682
|
+
holding.priceOracleAccount ? (0, import_common55.fromWeb3Pk)(holding.priceOracleAccount) : void 0,
|
|
21678
21683
|
coerceBool3(holding.isBase),
|
|
21679
|
-
toBigInt2(holding.localAmount).toString()
|
|
21680
|
-
toBigInt2(holding.externalAmount).toString(),
|
|
21681
|
-
toBigInt2(holding.price).toString()
|
|
21684
|
+
toBigInt2(holding.localAmount).toString()
|
|
21682
21685
|
])
|
|
21683
21686
|
});
|
|
21684
21687
|
}
|
|
21688
|
+
function reconciliationExternalValues(state, updates = []) {
|
|
21689
|
+
const byIndex = new Map(
|
|
21690
|
+
updates.map((update) => [update.holdingIndex, update])
|
|
21691
|
+
);
|
|
21692
|
+
return state.holdings.map((holding, index) => {
|
|
21693
|
+
const update = byIndex.get(index);
|
|
21694
|
+
const amount = update?.externalAmount ?? toBigInt2(holding.externalAmount);
|
|
21695
|
+
const price = update && variantName2(holding.priceOracleType).toLowerCase() === CONSENSUS_ORACLE_VARIANT ? update.price : toBigInt2(holding.price);
|
|
21696
|
+
if (amount < 0n || amount > U64_MAX2 || price < 0n || amount > 0n && price === 0n) {
|
|
21697
|
+
throw new Error(`Invalid external value for holding #${index}`);
|
|
21698
|
+
}
|
|
21699
|
+
return amount * price;
|
|
21700
|
+
});
|
|
21701
|
+
}
|
|
21702
|
+
function assertReconciliationExternalValues(initial, current, errorPrefix) {
|
|
21703
|
+
if (initial.length !== current.length) {
|
|
21704
|
+
throw new Error(
|
|
21705
|
+
`${errorPrefix}: holding count changed; retry with fresh inputs`
|
|
21706
|
+
);
|
|
21707
|
+
}
|
|
21708
|
+
for (let index = 0; index < initial.length; index++) {
|
|
21709
|
+
const before = initial[index];
|
|
21710
|
+
const after = current[index];
|
|
21711
|
+
const delta = after >= before ? after - before : before - after;
|
|
21712
|
+
if (before < 0n || after < 0n || delta * BPS > before * RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS) {
|
|
21713
|
+
throw new Error(
|
|
21714
|
+
`${errorPrefix}: holding #${index} external value changed by more than ${RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS} bps; retry with fresh inputs`
|
|
21715
|
+
);
|
|
21716
|
+
}
|
|
21717
|
+
}
|
|
21718
|
+
}
|
|
21685
21719
|
|
|
21686
21720
|
// src/services/consensusOracle/pipeline/pricingInputs.ts
|
|
21687
21721
|
var import_common56 = __toESM(require_dist());
|
|
@@ -23930,6 +23964,8 @@ var ConsensusOracleService = class {
|
|
|
23930
23964
|
const needsRevalidation = reconciliation.walletBalancesChecked || // A new withdrawal can be queued after the first vault read, too.
|
|
23931
23965
|
updates.some((update) => update.mint === NEST_RWA_SHARE_MINT);
|
|
23932
23966
|
const reconciliationStateKey = needsRevalidation ? managerReconciliationStateKey(vaultState) : void 0;
|
|
23967
|
+
const initialExternalValues = needsRevalidation ? reconciliationExternalValues(vaultState) : [];
|
|
23968
|
+
const initialReportExternalValues = needsRevalidation ? reconciliationExternalValues(vaultState, updates) : [];
|
|
23933
23969
|
assertNoLargeBalanceChanges(
|
|
23934
23970
|
target.vault,
|
|
23935
23971
|
vaultState,
|
|
@@ -24000,21 +24036,56 @@ var ConsensusOracleService = class {
|
|
|
24000
24036
|
"Vault changed during manager-wallet reconciliation; retry with fresh inputs"
|
|
24001
24037
|
);
|
|
24002
24038
|
}
|
|
24003
|
-
|
|
24004
|
-
|
|
24039
|
+
assertReconciliationExternalValues(
|
|
24040
|
+
initialExternalValues,
|
|
24041
|
+
reconciliationExternalValues(freshState),
|
|
24042
|
+
"Vault changed during manager-wallet reconciliation"
|
|
24043
|
+
);
|
|
24044
|
+
if (reconciliation.walletBalancesChecked) {
|
|
24045
|
+
const fresh = await reconcileManagerWalletBalances({
|
|
24046
|
+
vault: target.vault,
|
|
24047
|
+
vaultState: freshState,
|
|
24048
|
+
updates: sourcedUpdates,
|
|
24049
|
+
source: this.deps.managerWalletBalances,
|
|
24050
|
+
mpcSource: this.deps.mpcWalletBalances
|
|
24051
|
+
});
|
|
24052
|
+
if (!fresh.walletBalancesChecked || fresh.accepted !== reconciliation.accepted) {
|
|
24053
|
+
throw new Error(
|
|
24054
|
+
"Manager wallet changed or MPC balances changed during reconciliation; retry with fresh inputs"
|
|
24055
|
+
);
|
|
24056
|
+
}
|
|
24057
|
+
assertReconciliationExternalValues(
|
|
24058
|
+
initialReportExternalValues,
|
|
24059
|
+
reconciliationExternalValues(freshState, fresh.updates),
|
|
24060
|
+
"Manager wallet changed or MPC balances changed during reconciliation"
|
|
24061
|
+
);
|
|
24062
|
+
}
|
|
24063
|
+
assertNoLargeBalanceChanges(
|
|
24064
|
+
target.vault,
|
|
24065
|
+
freshState,
|
|
24066
|
+
walletReconciliationGuardUpdates(freshState, reconciliation),
|
|
24067
|
+
this.nowSecs(),
|
|
24068
|
+
log
|
|
24069
|
+
);
|
|
24070
|
+
const simulations = await simulateOraclePublication({
|
|
24071
|
+
client: this.client,
|
|
24072
|
+
signer,
|
|
24005
24073
|
vault: target.vault,
|
|
24006
24074
|
vaultState: freshState,
|
|
24007
|
-
updates
|
|
24008
|
-
|
|
24009
|
-
mpcSource: this.deps.mpcWalletBalances
|
|
24075
|
+
updates,
|
|
24076
|
+
nowSecs: this.nowSecs()
|
|
24010
24077
|
});
|
|
24011
|
-
|
|
24012
|
-
|
|
24013
|
-
|
|
24014
|
-
|
|
24015
|
-
|
|
24078
|
+
assertOracleImpliedApy(
|
|
24079
|
+
target.vault,
|
|
24080
|
+
simulations.proposed,
|
|
24081
|
+
"proposed report"
|
|
24082
|
+
);
|
|
24083
|
+
if (simulations.consensus.realizedApy)
|
|
24084
|
+
assertOracleImpliedApy(
|
|
24085
|
+
target.vault,
|
|
24086
|
+
simulations.consensus,
|
|
24087
|
+
"current consensus"
|
|
24016
24088
|
);
|
|
24017
|
-
}
|
|
24018
24089
|
} : void 0
|
|
24019
24090
|
});
|
|
24020
24091
|
return {
|
|
@@ -26130,6 +26201,7 @@ var import_common68 = __toESM(require_dist());
|
|
|
26130
26201
|
PST_TO_USDC_MAX_SLIPPAGE_BPS,
|
|
26131
26202
|
PdaClient,
|
|
26132
26203
|
ProtocolInteractionBuilder,
|
|
26204
|
+
RECONCILIATION_EXTERNAL_VALUE_TOLERANCE_BPS,
|
|
26133
26205
|
REPORTABLE_ORACLE_VARIANTS,
|
|
26134
26206
|
RemoveAssetHoldingBuilder,
|
|
26135
26207
|
ReportIncentiveV3Builder,
|
|
@@ -26186,6 +26258,7 @@ var import_common68 = __toESM(require_dist());
|
|
|
26186
26258
|
assertNoLargeBalanceChanges,
|
|
26187
26259
|
assertNoUnconfirmedYieldPayments,
|
|
26188
26260
|
assertOracleImpliedApy,
|
|
26261
|
+
assertReconciliationExternalValues,
|
|
26189
26262
|
buildHoldingUpdate,
|
|
26190
26263
|
buildKaminoDepositInteraction,
|
|
26191
26264
|
buildKaminoWithdrawInteraction,
|
|
@@ -26277,6 +26350,7 @@ var import_common68 = __toESM(require_dist());
|
|
|
26277
26350
|
readI64LE,
|
|
26278
26351
|
readSplMintSupply,
|
|
26279
26352
|
reconcileManagerWalletBalances,
|
|
26353
|
+
reconciliationExternalValues,
|
|
26280
26354
|
refreshLiveOraclePrices,
|
|
26281
26355
|
resolveExternalWithdraw,
|
|
26282
26356
|
resolveKeypairPath,
|