@kamino-finance/kliquidity-sdk
Version:
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
367 lines (361 loc) • 49.9 kB
text/typescript
/**
* This code was AUTOGENERATED using the Codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun Codama to update it.
*
* @see https://github.com/codama-idl/codama
*/
import { isProgramError, type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/kit';
import { YVAULTS_PROGRAM_ADDRESS } from '../programs';
/** IntegerOverflow: Integer overflow */
export const YVAULTS_ERROR__INTEGER_OVERFLOW = 0x1770; // 6000
/** OperationForbidden: Operation Forbidden */
export const YVAULTS_ERROR__OPERATION_FORBIDDEN = 0x1771; // 6001
/** ZeroAmount: [DEPRECATED] Zero amount */
export const YVAULTS_ERROR__ZERO_AMOUNT = 0x1772; // 6002
/** UnableToDeserializeAccount: Unable to deserialize account */
export const YVAULTS_ERROR__UNABLE_TO_DESERIALIZE_ACCOUNT = 0x1773; // 6003
/** VaultBalanceDoesNotMatchTokenA: [DEPRECATED] Vault balance does not match for token A */
export const YVAULTS_ERROR__VAULT_BALANCE_DOES_NOT_MATCH_TOKEN_A = 0x1774; // 6004
/** VaultBalanceDoesNotMatchTokenB: [DEPRECATED] Vault balance does not match for token B */
export const YVAULTS_ERROR__VAULT_BALANCE_DOES_NOT_MATCH_TOKEN_B = 0x1775; // 6005
/** SharesIssuedAmountDoesNotMatch: [DEPRECATED] Shares issued amount does not match */
export const YVAULTS_ERROR__SHARES_ISSUED_AMOUNT_DOES_NOT_MATCH = 0x1776; // 6006
/** GlobalConfigKeyError: Key is not present in global config */
export const YVAULTS_ERROR__GLOBAL_CONFIG_KEY_ERROR = 0x1777; // 6007
/** SystemInEmergencyMode: [DEPRECATED] System is in emergency mode */
export const YVAULTS_ERROR__SYSTEM_IN_EMERGENCY_MODE = 0x1778; // 6008
/** GlobalDepositBlocked: Global deposit is currently blocked */
export const YVAULTS_ERROR__GLOBAL_DEPOSIT_BLOCKED = 0x1779; // 6009
/** GlobalWithdrawBlocked: Global withdraw is currently blocked */
export const YVAULTS_ERROR__GLOBAL_WITHDRAW_BLOCKED = 0x177a; // 6010
/** GlobalInvestBlocked: Global invest is currently blocked */
export const YVAULTS_ERROR__GLOBAL_INVEST_BLOCKED = 0x177b; // 6011
/** OutOfRangeIntegralConversion: Out of range integral conversion attempted */
export const YVAULTS_ERROR__OUT_OF_RANGE_INTEGRAL_CONVERSION = 0x177c; // 6012
/** MathOverflow: [DEPRECATED] Mathematical operation with overflow */
export const YVAULTS_ERROR__MATH_OVERFLOW = 0x177d; // 6013
/** TooMuchLiquidityToWithdraw: Unable to withdraw more liquidity than available in position */
export const YVAULTS_ERROR__TOO_MUCH_LIQUIDITY_TO_WITHDRAW = 0x177e; // 6014
/** DepositAmountsZero: Deposit amounts must be greater than zero */
export const YVAULTS_ERROR__DEPOSIT_AMOUNTS_ZERO = 0x177f; // 6015
/** SharesZero: Number of shares to withdraw must be greater than zero */
export const YVAULTS_ERROR__SHARES_ZERO = 0x1780; // 6016
/** StrategyNotActive: Strategy not active */
export const YVAULTS_ERROR__STRATEGY_NOT_ACTIVE = 0x1781; // 6017
/** UnharvestedAmounts: There are unharvested gains */
export const YVAULTS_ERROR__UNHARVESTED_AMOUNTS = 0x1782; // 6018
/** InvalidRewardMapping: Reward mapping incorrect */
export const YVAULTS_ERROR__INVALID_REWARD_MAPPING = 0x1783; // 6019
/** InvalidRewardIndex: Reward index incorrect */
export const YVAULTS_ERROR__INVALID_REWARD_INDEX = 0x1784; // 6020
/** OwnRewardUninitialized: Cannot use uninitialized reward vault */
export const YVAULTS_ERROR__OWN_REWARD_UNINITIALIZED = 0x1785; // 6021
/** PriceNotValid: Price is not valid */
export const YVAULTS_ERROR__PRICE_NOT_VALID = 0x1786; // 6022
/** SwapRewardImbalanced: Must provide almost equal amounts of tokens */
export const YVAULTS_ERROR__SWAP_REWARD_IMBALANCED = 0x1787; // 6023
/** SwapRewardTooSmall: Swap reward is zero or less than requested */
export const YVAULTS_ERROR__SWAP_REWARD_TOO_SMALL = 0x1788; // 6024
/** SwapRewardLessThanRequested: Swap reward is less than what user requested as minimum */
export const YVAULTS_ERROR__SWAP_REWARD_LESS_THAN_REQUESTED = 0x1789; // 6025
/** SwapRewardLessThanMinimum: Swap reward is less than minimum acceptable */
export const YVAULTS_ERROR__SWAP_REWARD_LESS_THAN_MINIMUM = 0x178a; // 6026
/** WrongDiscriminator: Wrong discriminator */
export const YVAULTS_ERROR__WRONG_DISCRIMINATOR = 0x178b; // 6027
/** WrongMint: Wrong mint */
export const YVAULTS_ERROR__WRONG_MINT = 0x178c; // 6028
/** WrongVault: Wrong vault */
export const YVAULTS_ERROR__WRONG_VAULT = 0x178d; // 6029
/** SwapAmountsZero: Swap amounts must be greater than zero */
export const YVAULTS_ERROR__SWAP_AMOUNTS_ZERO = 0x178e; // 6030
/** PriceTooOld: Price too old */
export const YVAULTS_ERROR__PRICE_TOO_OLD = 0x178f; // 6031
/** CannotInvestZeroAmount: Cannot invest zero amount */
export const YVAULTS_ERROR__CANNOT_INVEST_ZERO_AMOUNT = 0x1790; // 6032
/** MaxInvestableZero: Cannot have zero investable amount */
export const YVAULTS_ERROR__MAX_INVESTABLE_ZERO = 0x1791; // 6033
/** CollectFeesBlocked: Collect fees is blocked */
export const YVAULTS_ERROR__COLLECT_FEES_BLOCKED = 0x1792; // 6034
/** CollectRewardsBlocked: Collect rewards is blocked */
export const YVAULTS_ERROR__COLLECT_REWARDS_BLOCKED = 0x1793; // 6035
/** SwapRewardsBlocked: Swap rewards is blocked */
export const YVAULTS_ERROR__SWAP_REWARDS_BLOCKED = 0x1794; // 6036
/** WrongRewardCollateralID: Reward collateral ID is incorrect for strategy */
export const YVAULTS_ERROR__WRONG_REWARD_COLLATERAL_I_D = 0x1795; // 6037
/** InvalidPositionAccount: Position account doesn't match internal records */
export const YVAULTS_ERROR__INVALID_POSITION_ACCOUNT = 0x1796; // 6038
/** CouldNotDeserializeScope: Scope account could not be deserialized */
export const YVAULTS_ERROR__COULD_NOT_DESERIALIZE_SCOPE = 0x1797; // 6039
/** WrongCollateralID: [DEPRECATED] Collateral ID invalid for strategy */
export const YVAULTS_ERROR__WRONG_COLLATERAL_I_D = 0x1798; // 6040
/** CollateralTokensExceedDepositCap: Collaterals exceed deposit cap */
export const YVAULTS_ERROR__COLLATERAL_TOKENS_EXCEED_DEPOSIT_CAP = 0x1799; // 6041
/** SwapUnevenVaultsBlocked: Swap uneven vaults is blocked */
export const YVAULTS_ERROR__SWAP_UNEVEN_VAULTS_BLOCKED = 0x179a; // 6042
/** VaultsAreAlreadyBalanced: Cannot swap as vaults are already balanced */
export const YVAULTS_ERROR__VAULTS_ARE_ALREADY_BALANCED = 0x179b; // 6043
/** CannotSwapUnevenOutOfRange: Cannot swap uneven vaults when position is out of range */
export const YVAULTS_ERROR__CANNOT_SWAP_UNEVEN_OUT_OF_RANGE = 0x179c; // 6044
/** DivideByZero: Cannot divide by zero */
export const YVAULTS_ERROR__DIVIDE_BY_ZERO = 0x179d; // 6045
/** DeltaATooLarge: [DEPRECATED] Delta A too large */
export const YVAULTS_ERROR__DELTA_A_TOO_LARGE = 0x179e; // 6046
/** DeltaBTooLarge: [DEPRECATED] Delta B too large */
export const YVAULTS_ERROR__DELTA_B_TOO_LARGE = 0x179f; // 6047
/** CannotExecutiveWithdrawZeroAmount: [DEPRECATED] Cannot executive withdraw zero amount */
export const YVAULTS_ERROR__CANNOT_EXECUTIVE_WITHDRAW_ZERO_AMOUNT = 0x17a0; // 6048
/** CannotWithdrawZeroAmount: Cannot withdraw zero amount */
export const YVAULTS_ERROR__CANNOT_WITHDRAW_ZERO_AMOUNT = 0x17a1; // 6049
/** CannotCollectFeesOnZeroLiquidityPosition: [DEPRECATED] Cannot collect fees on zero liquidity position */
export const YVAULTS_ERROR__CANNOT_COLLECT_FEES_ON_ZERO_LIQUIDITY_POSITION = 0x17a2; // 6050
/** StrategyNotActiveWhenDepositing: Cannot deposit inactive position */
export const YVAULTS_ERROR__STRATEGY_NOT_ACTIVE_WHEN_DEPOSITING = 0x17a3; // 6051
/** CannotOpenPositionWithExistingPosition: Cannot open position with existing opened position */
export const YVAULTS_ERROR__CANNOT_OPEN_POSITION_WITH_EXISTING_POSITION = 0x17a4; // 6052
/** CollateralTokensExceedDepositCapPerIxn: Collaterals exceed deposit ixn cap */
export const YVAULTS_ERROR__COLLATERAL_TOKENS_EXCEED_DEPOSIT_CAP_PER_IXN = 0x17a5; // 6053
/** CannotDepositOutOfRange: Cannot deposit when strategy out of range */
export const YVAULTS_ERROR__CANNOT_DEPOSIT_OUT_OF_RANGE = 0x17a6; // 6054
/** CannotInvestOutOfRange: Cannot invest when strategy out of range */
export const YVAULTS_ERROR__CANNOT_INVEST_OUT_OF_RANGE = 0x17a7; // 6055
/** WithdrawalCapReached: Withdrawal cap is reached */
export const YVAULTS_ERROR__WITHDRAWAL_CAP_REACHED = 0x17a8; // 6056
/** TimestampDecrease: Timestamp decrease */
export const YVAULTS_ERROR__TIMESTAMP_DECREASE = 0x17a9; // 6057
/** CPINotAllowed: CPI not allowed */
export const YVAULTS_ERROR__C_P_I_NOT_ALLOWED = 0x17aa; // 6058
/** OrcaPriceTooDifferentFromScope: Cannot use orca price as it is too different from scope price */
export const YVAULTS_ERROR__ORCA_PRICE_TOO_DIFFERENT_FROM_SCOPE = 0x17ab; // 6059
/** LowerTickLargerThanUpperTick: Lower tick larger than upper tick */
export const YVAULTS_ERROR__LOWER_TICK_LARGER_THAN_UPPER_TICK = 0x17ac; // 6060
/** LowerTickTooLow: Lower tick is lower than the minimal supported low tick */
export const YVAULTS_ERROR__LOWER_TICK_TOO_LOW = 0x17ad; // 6061
/** UpperTickTooLarge: Upper tick is larger than the maximum supported tick */
export const YVAULTS_ERROR__UPPER_TICK_TOO_LARGE = 0x17ae; // 6062
/** LowerTickNotMultipleOfTickSpacing: Lower tick is not a multiple of tick spacing */
export const YVAULTS_ERROR__LOWER_TICK_NOT_MULTIPLE_OF_TICK_SPACING = 0x17af; // 6063
/** UpperTickNotMultipleOfTickSpacing: Upper tick is not a multiple of tick spacing */
export const YVAULTS_ERROR__UPPER_TICK_NOT_MULTIPLE_OF_TICK_SPACING = 0x17b0; // 6064
/** CannotChangeAdminAuthority: Cannot change admin authority */
export const YVAULTS_ERROR__CANNOT_CHANGE_ADMIN_AUTHORITY = 0x17b1; // 6065
/** CannotResizeAccount: Cannot resize with smaller new size */
export const YVAULTS_ERROR__CANNOT_RESIZE_ACCOUNT = 0x17b2; // 6066
/** ScopeChainUpdateFailed: Scope chain update failed */
export const YVAULTS_ERROR__SCOPE_CHAIN_UPDATE_FAILED = 0x17b3; // 6067
/** PriceTooDivergentFromTwap: Price too divergent from twap */
export const YVAULTS_ERROR__PRICE_TOO_DIVERGENT_FROM_TWAP = 0x17b4; // 6068
/** ExistingRewardOverride: [DEPRECATED] Can not override the existing reward */
export const YVAULTS_ERROR__EXISTING_REWARD_OVERRIDE = 0x17b5; // 6069
/** WrongKaminoRewardId: Kamino reward id exceeds the available slots */
export const YVAULTS_ERROR__WRONG_KAMINO_REWARD_ID = 0x17b6; // 6070
/** KaminoRewardNotExist: Kamino reward is not initialized */
export const YVAULTS_ERROR__KAMINO_REWARD_NOT_EXIST = 0x17b7; // 6071
/** KaminoRewardAlreadyExists: Kamino reward is already initialized */
export const YVAULTS_ERROR__KAMINO_REWARD_ALREADY_EXISTS = 0x17b8; // 6072
/** KaminoCollateralNotValid: Kamino collateral is not valid */
export const YVAULTS_ERROR__KAMINO_COLLATERAL_NOT_VALID = 0x17b9; // 6073
/** KaminoRewardExceedsAvailableAmount: [DEPRECATED] Expected kamino reward is bigger then the available amount within the vault */
export const YVAULTS_ERROR__KAMINO_REWARD_EXCEEDS_AVAILABLE_AMOUNT = 0x17ba; // 6074
/** SwapUnevenVaultsOvershoot: Swap uneven vaults result in the opposite unbalance of the vaults */
export const YVAULTS_ERROR__SWAP_UNEVEN_VAULTS_OVERSHOOT = 0x17bb; // 6075
/** BpsNotInRange: Bps parameter passed to instruction is not in range */
export const YVAULTS_ERROR__BPS_NOT_IN_RANGE = 0x17bc; // 6076
/** EmergencySwapBlocked: Emergency Swap is blocked */
export const YVAULTS_ERROR__EMERGENCY_SWAP_BLOCKED = 0x17bd; // 6077
/** StrategyNotFrozen: Strategy is expected to be frozen for this operation */
export const YVAULTS_ERROR__STRATEGY_NOT_FROZEN = 0x17be; // 6078
/** UnexpectedTokenAmountsPostSwap: Token left in vault post swap are lower than expected */
export const YVAULTS_ERROR__UNEXPECTED_TOKEN_AMOUNTS_POST_SWAP = 0x17bf; // 6079
/** AccountNotBelongToDEX: Account doesn't belong to the DEX */
export const YVAULTS_ERROR__ACCOUNT_NOT_BELONG_TO_D_E_X = 0x17c0; // 6080
/** WrongDEXProgramID: Wrong DEX program ID */
export const YVAULTS_ERROR__WRONG_D_E_X_PROGRAM_I_D = 0x17c1; // 6081
/** OrcaRewardUninitialized: Cannot use uninitialized orca reward vault */
export const YVAULTS_ERROR__ORCA_REWARD_UNINITIALIZED = 0x17c2; // 6082
/** InvalidAdminAuthority: Invalid admin authority */
export const YVAULTS_ERROR__INVALID_ADMIN_AUTHORITY = 0x17c3; // 6083
/** PriceIsBiggerThanHeuristic: Token price is bigger than heuristic */
export const YVAULTS_ERROR__PRICE_IS_BIGGER_THAN_HEURISTIC = 0x17c4; // 6084
/** PriceIsLowerThanHeuristic: Token price is lower than heuristic */
export const YVAULTS_ERROR__PRICE_IS_LOWER_THAN_HEURISTIC = 0x17c5; // 6085
/** AccountDifferentThanExpected: Account different than expected */
export const YVAULTS_ERROR__ACCOUNT_DIFFERENT_THAN_EXPECTED = 0x17c6; // 6086
/** SwapAmountsTooSmall: Swap amount below the minimum value */
export const YVAULTS_ERROR__SWAP_AMOUNTS_TOO_SMALL = 0x17c7; // 6087
/** InvalidDexProgramId: Invalid dex program id */
export const YVAULTS_ERROR__INVALID_DEX_PROGRAM_ID = 0x17c8; // 6088
/** StrategyDepositBlocked: Strategy deposit is currently blocked */
export const YVAULTS_ERROR__STRATEGY_DEPOSIT_BLOCKED = 0x17c9; // 6089
/** StrategyInvestBlocked: Strategy invest is currently blocked */
export const YVAULTS_ERROR__STRATEGY_INVEST_BLOCKED = 0x17ca; // 6090
/** StrategyWithdrawBlocked: Strategy withdraw is currently blocked */
export const YVAULTS_ERROR__STRATEGY_WITHDRAW_BLOCKED = 0x17cb; // 6091
/** WrongSwapVaultDirection: Vault swap can't be performed in the required direction */
export const YVAULTS_ERROR__WRONG_SWAP_VAULT_DIRECTION = 0x17cc; // 6092
/** SwapVaultsTooBig: Provided amount for vault swap is over the limit */
export const YVAULTS_ERROR__SWAP_VAULTS_TOO_BIG = 0x17cd; // 6093
/** SwapVaultsCashOutputBelowMinimum: Token out for cash based vault swap is below minimum expected */
export const YVAULTS_ERROR__SWAP_VAULTS_CASH_OUTPUT_BELOW_MINIMUM = 0x17ce; // 6094
/** FlashIxsNotEnded: Flash ixs initiated without the closing ix in the transaction */
export const YVAULTS_ERROR__FLASH_IXS_NOT_ENDED = 0x17cf; // 6095
/** FlashTxWithUnexpectedIxs: Some unexpected instructions are present in the tx. Either before or after the flash ixs, or some ix target the same program between */
export const YVAULTS_ERROR__FLASH_TX_WITH_UNEXPECTED_IXS = 0x17d0; // 6096
/** FlashIxsAccountMismatch: Some accounts differ between the two flash ixs */
export const YVAULTS_ERROR__FLASH_IXS_ACCOUNT_MISMATCH = 0x17d1; // 6097
/** FlashIxsIncludeScope: A scope ix is present in a flash tx */
export const YVAULTS_ERROR__FLASH_IXS_INCLUDE_SCOPE = 0x17d2; // 6098
/** FlashVaultSwapBlocked: Flash vault swap is blocked on this strategy */
export const YVAULTS_ERROR__FLASH_VAULT_SWAP_BLOCKED = 0x17d3; // 6099
/** FlashVaultSwapWrongAmountToLeave: Unexpected amount of tokens in ata prior flash vault swap (wrong amount_to_leave_to_user) */
export const YVAULTS_ERROR__FLASH_VAULT_SWAP_WRONG_AMOUNT_TO_LEAVE = 0x17d4; // 6100
/** DepositLessThanMinimum: Deposit amount less than minimal allowed */
export const YVAULTS_ERROR__DEPOSIT_LESS_THAN_MINIMUM = 0x17d5; // 6101
/** DepositWithoutInvestDisallowed: Cannot deposit without invest */
export const YVAULTS_ERROR__DEPOSIT_WITHOUT_INVEST_DISALLOWED = 0x17d6; // 6102
/** InvalidScopeChain: Invalid Scope Chain */
export const YVAULTS_ERROR__INVALID_SCOPE_CHAIN = 0x17d7; // 6103
/** InvalidScopeTWAPChain: Invalid Scope TWAP Chain */
export const YVAULTS_ERROR__INVALID_SCOPE_T_W_A_P_CHAIN = 0x17d8; // 6104
/** PositionHasRemainingLiquidity: Existent position has liquidity, new position creation is forbidden */
export const YVAULTS_ERROR__POSITION_HAS_REMAINING_LIQUIDITY = 0x17d9; // 6105
/** PoolRebalancing: Deposit is not allowed as pool is rebalancing */
export const YVAULTS_ERROR__POOL_REBALANCING = 0x17da; // 6106
/** PermissionlessRebalancingDisabled: Permissionless rebalancing is disabled */
export const YVAULTS_ERROR__PERMISSIONLESS_REBALANCING_DISABLED = 0x17db; // 6107
/** ManualRebalanceInvalidOwner: Only the owner of the strategy can manually rebalance it */
export const YVAULTS_ERROR__MANUAL_REBALANCE_INVALID_OWNER = 0x17dc; // 6108
/** InvalidRebalanceType: Invalid rebalance type for the strategy */
export const YVAULTS_ERROR__INVALID_REBALANCE_TYPE = 0x17dd; // 6109
/** NoRebalanceNecessary: No rebalance necessary based on current rebalance type/parameters */
export const YVAULTS_ERROR__NO_REBALANCE_NECESSARY = 0x17de; // 6110
/** TickArraysDoNotMatchRebalance: The given tick arrays do not match the rebalance result */
export const YVAULTS_ERROR__TICK_ARRAYS_DO_NOT_MATCH_REBALANCE = 0x17df; // 6111
/** StrategyPositionNotValid: Expected strategy position to be initialized */
export const YVAULTS_ERROR__STRATEGY_POSITION_NOT_VALID = 0x17e0; // 6112
/** CouldNotDeserializeRebalanceState: Rebalance state could not be deserialized */
export const YVAULTS_ERROR__COULD_NOT_DESERIALIZE_REBALANCE_STATE = 0x17e1; // 6113
/** CouldNotSerializeRebalanceState: Rebalance state could not be serialized */
export const YVAULTS_ERROR__COULD_NOT_SERIALIZE_REBALANCE_STATE = 0x17e2; // 6114
/** CouldNotDeserializeRebalanceParams: Rebalance params could not be deserialized */
export const YVAULTS_ERROR__COULD_NOT_DESERIALIZE_REBALANCE_PARAMS = 0x17e3; // 6115
/** NotEnoughTokensForRatio: Deposit is not allowed as token amounts are not enough to match our holdings ratio */
export const YVAULTS_ERROR__NOT_ENOUGH_TOKENS_FOR_RATIO = 0x17e4; // 6116
/** AmountsRepresentZeroShares: The provided amounts are too small */
export const YVAULTS_ERROR__AMOUNTS_REPRESENT_ZERO_SHARES = 0x17e5; // 6117
/** MaxLossExceeded: Rouding errors exceed the maximal loss tolerance */
export const YVAULTS_ERROR__MAX_LOSS_EXCEEDED = 0x17e6; // 6118
/** RewardNotStrategyToken: Reward does not match strategy token */
export const YVAULTS_ERROR__REWARD_NOT_STRATEGY_TOKEN = 0x17e7; // 6119
/** DecimalToU64ConversionFailed: Decimal to u64 conversion failed */
export const YVAULTS_ERROR__DECIMAL_TO_U64_CONVERSION_FAILED = 0x17e8; // 6120
/** DecimalOperationFailed: Decimal operation failed */
export const YVAULTS_ERROR__DECIMAL_OPERATION_FAILED = 0x17e9; // 6121
/** VaultBalancesCausesWrongSharesIssuance: Deposit is not allowed as the strategy is not fully invested in the pool */
export const YVAULTS_ERROR__VAULT_BALANCES_CAUSES_WRONG_SHARES_ISSUANCE = 0x17ea; // 6122
/** TokenDisabled: Token cannot be used in strategy creation */
export const YVAULTS_ERROR__TOKEN_DISABLED = 0x17eb; // 6123
/** InvalidReferencePriceType: Invalid reference price type */
export const YVAULTS_ERROR__INVALID_REFERENCE_PRICE_TYPE = 0x17ec; // 6124
/** TokenToSwapNotEnough: Token amount to be swapped is not enough */
export const YVAULTS_ERROR__TOKEN_TO_SWAP_NOT_ENOUGH = 0x17ed; // 6125
/** TokenAccountBalanceMismatch: Token amount in ata is different than the expected amount */
export const YVAULTS_ERROR__TOKEN_ACCOUNT_BALANCE_MISMATCH = 0x17ee; // 6126
/** UnexpectedProgramIdForPrerequisiteIx: Unexpected programID for prerequisite ix */
export const YVAULTS_ERROR__UNEXPECTED_PROGRAM_ID_FOR_PREREQUISITE_IX = 0x17ef; // 6127
/** ComputeFeesAndRewardsUpdateError: Got an error from the dex specific function while computing the fees/rewards update */
export const YVAULTS_ERROR__COMPUTE_FEES_AND_REWARDS_UPDATE_ERROR = 0x17f0; // 6128
/** SharesNotZero: There must be no shares issued when closing a strategy */
export const YVAULTS_ERROR__SHARES_NOT_ZERO = 0x17f1; // 6129
/** InvalidScopeStakingRateChain: Invalid Scope staking rate Chain */
export const YVAULTS_ERROR__INVALID_SCOPE_STAKING_RATE_CHAIN = 0x17f2; // 6130
/** StakingRateNotValid: Staking rate (provided by Scope) is not valid */
export const YVAULTS_ERROR__STAKING_RATE_NOT_VALID = 0x17f3; // 6131
/** DecimalToU128ConversionFailed: Decimal to u128 conversion failed */
export const YVAULTS_ERROR__DECIMAL_TO_U128_CONVERSION_FAILED = 0x17f4; // 6132
/** DecimalNegativeSqrtRoot: Decimal sqrt on negative number */
export const YVAULTS_ERROR__DECIMAL_NEGATIVE_SQRT_ROOT = 0x17f5; // 6133
/** DriftingOppositeDirection: Drifting strategy is moving in the opposite direction */
export const YVAULTS_ERROR__DRIFTING_OPPOSITE_DIRECTION = 0x17f6; // 6134
/** WrongRewardCollateralId: Wrong reward collateral_id */
export const YVAULTS_ERROR__WRONG_REWARD_COLLATERAL_ID = 0x17f7; // 6135
/** CollateralInfoAlreadyExists: Collateral info already exists for given index */
export const YVAULTS_ERROR__COLLATERAL_INFO_ALREADY_EXISTS = 0x17f8; // 6136
/** InvestTooEarly: Invest is too early after the position was opened */
export const YVAULTS_ERROR__INVEST_TOO_EARLY = 0x17f9; // 6137
/** SwapUnevenTooEarly: Swap uneven is too early after the position was opened */
export const YVAULTS_ERROR__SWAP_UNEVEN_TOO_EARLY = 0x17fa; // 6138
/** FlashSwapTooEarly: Flash swap is too early after the position was opened */
export const YVAULTS_ERROR__FLASH_SWAP_TOO_EARLY = 0x17fb; // 6139
/** RebalancesCapReached: Rebalance caps reached, no rebalances are allowed until the end of the current interval */
export const YVAULTS_ERROR__REBALANCES_CAP_REACHED = 0x17fc; // 6140
/** SwapUnevenInvalidAuthority: Cannot swap uneven because authority is set and the given signer does not correspond */
export const YVAULTS_ERROR__SWAP_UNEVEN_INVALID_AUTHORITY = 0x17fd; // 6141
/** InvalidTick: Invalid tick requested */
export const YVAULTS_ERROR__INVALID_TICK = 0x17fe; // 6142
/** MeteoraMathOverflow: Meteora math overflowed */
export const YVAULTS_ERROR__METEORA_MATH_OVERFLOW = 0x17ff; // 6143
/** StrategyTickArrayNotValid: Expected strategy tick arrays to be initialized */
export const YVAULTS_ERROR__STRATEGY_TICK_ARRAY_NOT_VALID = 0x1800; // 6144
/** WrongEventAuthority: Wrong event authority */
export const YVAULTS_ERROR__WRONG_EVENT_AUTHORITY = 0x1801; // 6145
/** StrategyFieldUpdateNotAllowed: Strategy field update is not allowed */
export const YVAULTS_ERROR__STRATEGY_FIELD_UPDATE_NOT_ALLOWED = 0x1802; // 6146
/** UnsupportedDex: DEX is not supported for this operation */
export const YVAULTS_ERROR__UNSUPPORTED_DEX = 0x1803; // 6147
/** InvalidBPSValue: Invalid BPS value provided */
export const YVAULTS_ERROR__INVALID_B_P_S_VALUE = 0x1804; // 6148
/** RewardVaultOverrideNotAllowed: Reward vault override not allowed */
export const YVAULTS_ERROR__REWARD_VAULT_OVERRIDE_NOT_ALLOWED = 0x1805; // 6149
/** ComputeFeesAndRewardsInvalidReward: Got invalid reward from the dex specific function while computing the fees/rewards update */
export const YVAULTS_ERROR__COMPUTE_FEES_AND_REWARDS_INVALID_REWARD = 0x1806; // 6150
/** EmptyTreasury: No tokens to withdraw from treasury fee vault */
export const YVAULTS_ERROR__EMPTY_TREASURY = 0x1807; // 6151
/** ChangingPoolRewardMintMismatch: New pool reward mint does not match the old pool reward mint */
export const YVAULTS_ERROR__CHANGING_POOL_REWARD_MINT_MISMATCH = 0x1808; // 6152
/** ProvidedRewardVaultMismatch: The provided reward vault does not match the strategy state */
export const YVAULTS_ERROR__PROVIDED_REWARD_VAULT_MISMATCH = 0x1809; // 6153
/** RepeatedMint: The provided reward vault does not match the strategy state */
export const YVAULTS_ERROR__REPEATED_MINT = 0x180a; // 6154
/** UnsupportedTokenExtension: The token extension is not supported by the program */
export const YVAULTS_ERROR__UNSUPPORTED_TOKEN_EXTENSION = 0x180b; // 6155
/** UnsupportedDexForToken22: Cannot initialize strategy with this dex while having a mint with token22 */
export const YVAULTS_ERROR__UNSUPPORTED_DEX_FOR_TOKEN22 = 0x180c; // 6156
/** GlobalConfigInvalidScopePriceIndex: Scope price index is not present in global config */
export const YVAULTS_ERROR__GLOBAL_CONFIG_INVALID_SCOPE_PRICE_INDEX = 0x180d; // 6157
/** GlobalConfigScopePricesIdsFull: Scope prices ids array in global config is full */
export const YVAULTS_ERROR__GLOBAL_CONFIG_SCOPE_PRICES_IDS_FULL = 0x180e; // 6158
/** GlobalConfigAlreadyContainsScopePriceId: Scope prices ids array already contains given scope price id */
export const YVAULTS_ERROR__GLOBAL_CONFIG_ALREADY_CONTAINS_SCOPE_PRICE_ID = 0x180f; // 6159
/** GlobalConfigExpectedScopePricesAccount: Expected scope prices account being passed in when adding or updating a scope prices feed */
export const YVAULTS_ERROR__GLOBAL_CONFIG_EXPECTED_SCOPE_PRICES_ACCOUNT = 0x1810; // 6160
/** RewardScopePriceAccountNotPresent: A reward scope price account should have been passed in, but it is missing */
export const YVAULTS_ERROR__REWARD_SCOPE_PRICE_ACCOUNT_NOT_PRESENT = 0x1811; // 6161
/** IncorrectScopePricesAccountID: Incorrect scope prices account id passed in */
export const YVAULTS_ERROR__INCORRECT_SCOPE_PRICES_ACCOUNT_I_D = 0x1812; // 6162
/** CouldNotCalculatePriceTwap: Could not calculate get_price_usd_unchecked() */
export const YVAULTS_ERROR__COULD_NOT_CALCULATE_PRICE_TWAP = 0x1813; // 6163
/** ReferencePriceTooFarFromPoolPrice: Reference price is too far from the current pool price */
export const YVAULTS_ERROR__REFERENCE_PRICE_TOO_FAR_FROM_POOL_PRICE = 0x1814; // 6164
/** InvestCooldownNotElapsed: Invest cooldown has not elapsed */
export const YVAULTS_ERROR__INVEST_COOLDOWN_NOT_ELAPSED = 0x1815; // 6165
/** InvestAmountBelowMinimum: Uninvested value is below the minimum invest trigger */
export const YVAULTS_ERROR__INVEST_AMOUNT_BELOW_MINIMUM = 0x1816; // 6166
export type YvaultsError = typeof YVAULTS_ERROR__ACCOUNT_DIFFERENT_THAN_EXPECTED | typeof YVAULTS_ERROR__ACCOUNT_NOT_BELONG_TO_D_E_X | typeof YVAULTS_ERROR__AMOUNTS_REPRESENT_ZERO_SHARES | typeof YVAULTS_ERROR__BPS_NOT_IN_RANGE | typeof YVAULTS_ERROR__CANNOT_CHANGE_ADMIN_AUTHORITY | typeof YVAULTS_ERROR__CANNOT_COLLECT_FEES_ON_ZERO_LIQUIDITY_POSITION | typeof YVAULTS_ERROR__CANNOT_DEPOSIT_OUT_OF_RANGE | typeof YVAULTS_ERROR__CANNOT_EXECUTIVE_WITHDRAW_ZERO_AMOUNT | typeof YVAULTS_ERROR__CANNOT_INVEST_OUT_OF_RANGE | typeof YVAULTS_ERROR__CANNOT_INVEST_ZERO_AMOUNT | typeof YVAULTS_ERROR__CANNOT_OPEN_POSITION_WITH_EXISTING_POSITION | typeof YVAULTS_ERROR__CANNOT_RESIZE_ACCOUNT | typeof YVAULTS_ERROR__CANNOT_SWAP_UNEVEN_OUT_OF_RANGE | typeof YVAULTS_ERROR__CANNOT_WITHDRAW_ZERO_AMOUNT | typeof YVAULTS_ERROR__CHANGING_POOL_REWARD_MINT_MISMATCH | typeof YVAULTS_ERROR__COLLATERAL_INFO_ALREADY_EXISTS | typeof YVAULTS_ERROR__COLLATERAL_TOKENS_EXCEED_DEPOSIT_CAP | typeof YVAULTS_ERROR__COLLATERAL_TOKENS_EXCEED_DEPOSIT_CAP_PER_IXN | typeof YVAULTS_ERROR__COLLECT_FEES_BLOCKED | typeof YVAULTS_ERROR__COLLECT_REWARDS_BLOCKED | typeof YVAULTS_ERROR__COMPUTE_FEES_AND_REWARDS_INVALID_REWARD | typeof YVAULTS_ERROR__COMPUTE_FEES_AND_REWARDS_UPDATE_ERROR | typeof YVAULTS_ERROR__COULD_NOT_CALCULATE_PRICE_TWAP | typeof YVAULTS_ERROR__COULD_NOT_DESERIALIZE_REBALANCE_PARAMS | typeof YVAULTS_ERROR__COULD_NOT_DESERIALIZE_REBALANCE_STATE | typeof YVAULTS_ERROR__COULD_NOT_DESERIALIZE_SCOPE | typeof YVAULTS_ERROR__COULD_NOT_SERIALIZE_REBALANCE_STATE | typeof YVAULTS_ERROR__C_P_I_NOT_ALLOWED | typeof YVAULTS_ERROR__DECIMAL_NEGATIVE_SQRT_ROOT | typeof YVAULTS_ERROR__DECIMAL_OPERATION_FAILED | typeof YVAULTS_ERROR__DECIMAL_TO_U128_CONVERSION_FAILED | typeof YVAULTS_ERROR__DECIMAL_TO_U64_CONVERSION_FAILED | typeof YVAULTS_ERROR__DELTA_A_TOO_LARGE | typeof YVAULTS_ERROR__DELTA_B_TOO_LARGE | typeof YVAULTS_ERROR__DEPOSIT_AMOUNTS_ZERO | typeof YVAULTS_ERROR__DEPOSIT_LESS_THAN_MINIMUM | typeof YVAULTS_ERROR__DEPOSIT_WITHOUT_INVEST_DISALLOWED | typeof YVAULTS_ERROR__DIVIDE_BY_ZERO | typeof YVAULTS_ERROR__DRIFTING_OPPOSITE_DIRECTION | typeof YVAULTS_ERROR__EMERGENCY_SWAP_BLOCKED | typeof YVAULTS_ERROR__EMPTY_TREASURY | typeof YVAULTS_ERROR__EXISTING_REWARD_OVERRIDE | typeof YVAULTS_ERROR__FLASH_IXS_ACCOUNT_MISMATCH | typeof YVAULTS_ERROR__FLASH_IXS_INCLUDE_SCOPE | typeof YVAULTS_ERROR__FLASH_IXS_NOT_ENDED | typeof YVAULTS_ERROR__FLASH_SWAP_TOO_EARLY | typeof YVAULTS_ERROR__FLASH_TX_WITH_UNEXPECTED_IXS | typeof YVAULTS_ERROR__FLASH_VAULT_SWAP_BLOCKED | typeof YVAULTS_ERROR__FLASH_VAULT_SWAP_WRONG_AMOUNT_TO_LEAVE | typeof YVAULTS_ERROR__GLOBAL_CONFIG_ALREADY_CONTAINS_SCOPE_PRICE_ID | typeof YVAULTS_ERROR__GLOBAL_CONFIG_EXPECTED_SCOPE_PRICES_ACCOUNT | typeof YVAULTS_ERROR__GLOBAL_CONFIG_INVALID_SCOPE_PRICE_INDEX | typeof YVAULTS_ERROR__GLOBAL_CONFIG_KEY_ERROR | typeof YVAULTS_ERROR__GLOBAL_CONFIG_SCOPE_PRICES_IDS_FULL | typeof YVAULTS_ERROR__GLOBAL_DEPOSIT_BLOCKED | typeof YVAULTS_ERROR__GLOBAL_INVEST_BLOCKED | typeof YVAULTS_ERROR__GLOBAL_WITHDRAW_BLOCKED | typeof YVAULTS_ERROR__INCORRECT_SCOPE_PRICES_ACCOUNT_I_D | typeof YVAULTS_ERROR__INTEGER_OVERFLOW | typeof YVAULTS_ERROR__INVALID_ADMIN_AUTHORITY | typeof YVAULTS_ERROR__INVALID_B_P_S_VALUE | typeof YVAULTS_ERROR__INVALID_DEX_PROGRAM_ID | typeof YVAULTS_ERROR__INVALID_POSITION_ACCOUNT | typeof YVAULTS_ERROR__INVALID_REBALANCE_TYPE | typeof YVAULTS_ERROR__INVALID_REFERENCE_PRICE_TYPE | typeof YVAULTS_ERROR__INVALID_REWARD_INDEX | typeof YVAULTS_ERROR__INVALID_REWARD_MAPPING | typeof YVAULTS_ERROR__INVALID_SCOPE_CHAIN | typeof YVAULTS_ERROR__INVALID_SCOPE_STAKING_RATE_CHAIN | typeof YVAULTS_ERROR__INVALID_SCOPE_T_W_A_P_CHAIN | typeof YVAULTS_ERROR__INVALID_TICK | typeof YVAULTS_ERROR__INVEST_AMOUNT_BELOW_MINIMUM | typeof YVAULTS_ERROR__INVEST_COOLDOWN_NOT_ELAPSED | typeof YVAULTS_ERROR__INVEST_TOO_EARLY | typeof YVAULTS_ERROR__KAMINO_COLLATERAL_NOT_VALID | typeof YVAULTS_ERROR__KAMINO_REWARD_ALREADY_EXISTS | typeof YVAULTS_ERROR__KAMINO_REWARD_EXCEEDS_AVAILABLE_AMOUNT | typeof YVAULTS_ERROR__KAMINO_REWARD_NOT_EXIST | typeof YVAULTS_ERROR__LOWER_TICK_LARGER_THAN_UPPER_TICK | typeof YVAULTS_ERROR__LOWER_TICK_NOT_MULTIPLE_OF_TICK_SPACING | typeof YVAULTS_ERROR__LOWER_TICK_TOO_LOW | typeof YVAULTS_ERROR__MANUAL_REBALANCE_INVALID_OWNER | typeof YVAULTS_ERROR__MATH_OVERFLOW | typeof YVAULTS_ERROR__MAX_INVESTABLE_ZERO | typeof YVAULTS_ERROR__MAX_LOSS_EXCEEDED | typeof YVAULTS_ERROR__METEORA_MATH_OVERFLOW | typeof YVAULTS_ERROR__NO_REBALANCE_NECESSARY | typeof YVAULTS_ERROR__NOT_ENOUGH_TOKENS_FOR_RATIO | typeof YVAULTS_ERROR__OPERATION_FORBIDDEN | typeof YVAULTS_ERROR__ORCA_PRICE_TOO_DIFFERENT_FROM_SCOPE | typeof YVAULTS_ERROR__ORCA_REWARD_UNINITIALIZED | typeof YVAULTS_ERROR__OUT_OF_RANGE_INTEGRAL_CONVERSION | typeof YVAULTS_ERROR__OWN_REWARD_UNINITIALIZED | typeof YVAULTS_ERROR__PERMISSIONLESS_REBALANCING_DISABLED | typeof YVAULTS_ERROR__POOL_REBALANCING | typeof YVAULTS_ERROR__POSITION_HAS_REMAINING_LIQUIDITY | typeof YVAULTS_ERROR__PRICE_IS_BIGGER_THAN_HEURISTIC | typeof YVAULTS_ERROR__PRICE_IS_LOWER_THAN_HEURISTIC | typeof YVAULTS_ERROR__PRICE_NOT_VALID | typeof YVAULTS_ERROR__PRICE_TOO_DIVERGENT_FROM_TWAP | typeof YVAULTS_ERROR__PRICE_TOO_OLD | typeof YVAULTS_ERROR__PROVIDED_REWARD_VAULT_MISMATCH | typeof YVAULTS_ERROR__REBALANCES_CAP_REACHED | typeof YVAULTS_ERROR__REFERENCE_PRICE_TOO_FAR_FROM_POOL_PRICE | typeof YVAULTS_ERROR__REPEATED_MINT | typeof YVAULTS_ERROR__REWARD_NOT_STRATEGY_TOKEN | typeof YVAULTS_ERROR__REWARD_SCOPE_PRICE_ACCOUNT_NOT_PRESENT | typeof YVAULTS_ERROR__REWARD_VAULT_OVERRIDE_NOT_ALLOWED | typeof YVAULTS_ERROR__SCOPE_CHAIN_UPDATE_FAILED | typeof YVAULTS_ERROR__SHARES_ISSUED_AMOUNT_DOES_NOT_MATCH | typeof YVAULTS_ERROR__SHARES_NOT_ZERO | typeof YVAULTS_ERROR__SHARES_ZERO | typeof YVAULTS_ERROR__STAKING_RATE_NOT_VALID | typeof YVAULTS_ERROR__STRATEGY_DEPOSIT_BLOCKED | typeof YVAULTS_ERROR__STRATEGY_FIELD_UPDATE_NOT_ALLOWED | typeof YVAULTS_ERROR__STRATEGY_INVEST_BLOCKED | typeof YVAULTS_ERROR__STRATEGY_NOT_ACTIVE | typeof YVAULTS_ERROR__STRATEGY_NOT_ACTIVE_WHEN_DEPOSITING | typeof YVAULTS_ERROR__STRATEGY_NOT_FROZEN | typeof YVAULTS_ERROR__STRATEGY_POSITION_NOT_VALID | typeof YVAULTS_ERROR__STRATEGY_TICK_ARRAY_NOT_VALID | typeof YVAULTS_ERROR__STRATEGY_WITHDRAW_BLOCKED | typeof YVAULTS_ERROR__SWAP_AMOUNTS_TOO_SMALL | typeof YVAULTS_ERROR__SWAP_AMOUNTS_ZERO | typeof YVAULTS_ERROR__SWAP_REWARD_IMBALANCED | typeof YVAULTS_ERROR__SWAP_REWARD_LESS_THAN_MINIMUM | typeof YVAULTS_ERROR__SWAP_REWARD_LESS_THAN_REQUESTED | typeof YVAULTS_ERROR__SWAP_REWARDS_BLOCKED | typeof YVAULTS_ERROR__SWAP_REWARD_TOO_SMALL | typeof YVAULTS_ERROR__SWAP_UNEVEN_INVALID_AUTHORITY | typeof YVAULTS_ERROR__SWAP_UNEVEN_TOO_EARLY | typeof YVAULTS_ERROR__SWAP_UNEVEN_VAULTS_BLOCKED | typeof YVAULTS_ERROR__SWAP_UNEVEN_VAULTS_OVERSHOOT | typeof YVAULTS_ERROR__SWAP_VAULTS_CASH_OUTPUT_BELOW_MINIMUM | typeof YVAULTS_ERROR__SWAP_VAULTS_TOO_BIG | typeof YVAULTS_ERROR__SYSTEM_IN_EMERGENCY_MODE | typeof YVAULTS_ERROR__TICK_ARRAYS_DO_NOT_MATCH_REBALANCE | typeof YVAULTS_ERROR__TIMESTAMP_DECREASE | typeof YVAULTS_ERROR__TOKEN_ACCOUNT_BALANCE_MISMATCH | typeof YVAULTS_ERROR__TOKEN_DISABLED | typeof YVAULTS_ERROR__TOKEN_TO_SWAP_NOT_ENOUGH | typeof YVAULTS_ERROR__TOO_MUCH_LIQUIDITY_TO_WITHDRAW | typeof YVAULTS_ERROR__UNABLE_TO_DESERIALIZE_ACCOUNT | typeof YVAULTS_ERROR__UNEXPECTED_PROGRAM_ID_FOR_PREREQUISITE_IX | typeof YVAULTS_ERROR__UNEXPECTED_TOKEN_AMOUNTS_POST_SWAP | typeof YVAULTS_ERROR__UNHARVESTED_AMOUNTS | typeof YVAULTS_ERROR__UNSUPPORTED_DEX | typeof YVAULTS_ERROR__UNSUPPORTED_DEX_FOR_TOKEN22 | typeof YVAULTS_ERROR__UNSUPPORTED_TOKEN_EXTENSION | typeof YVAULTS_ERROR__UPPER_TICK_NOT_MULTIPLE_OF_TICK_SPACING | typeof YVAULTS_ERROR__UPPER_TICK_TOO_LARGE | typeof YVAULTS_ERROR__VAULT_BALANCE_DOES_NOT_MATCH_TOKEN_A | typeof YVAULTS_ERROR__VAULT_BALANCE_DOES_NOT_MATCH_TOKEN_B | typeof YVAULTS_ERROR__VAULT_BALANCES_CAUSES_WRONG_SHARES_ISSUANCE | typeof YVAULTS_ERROR__VAULTS_ARE_ALREADY_BALANCED | typeof YVAULTS_ERROR__WITHDRAWAL_CAP_REACHED | typeof YVAULTS_ERROR__WRONG_COLLATERAL_I_D | typeof YVAULTS_ERROR__WRONG_D_E_X_PROGRAM_I_D | typeof YVAULTS_ERROR__WRONG_DISCRIMINATOR | typeof YVAULTS_ERROR__WRONG_EVENT_AUTHORITY | typeof YVAULTS_ERROR__WRONG_KAMINO_REWARD_ID | typeof YVAULTS_ERROR__WRONG_MINT | typeof YVAULTS_ERROR__WRONG_REWARD_COLLATERAL_ID | typeof YVAULTS_ERROR__WRONG_REWARD_COLLATERAL_I_D | typeof YVAULTS_ERROR__WRONG_SWAP_VAULT_DIRECTION | typeof YVAULTS_ERROR__WRONG_VAULT | typeof YVAULTS_ERROR__ZERO_AMOUNT;
let yvaultsErrorMessages: Record<YvaultsError, string> | undefined;
if (process.env.NODE_ENV !== 'production') {
yvaultsErrorMessages = { [YVAULTS_ERROR__ACCOUNT_DIFFERENT_THAN_EXPECTED]: `Account different than expected`, [YVAULTS_ERROR__ACCOUNT_NOT_BELONG_TO_D_E_X]: `Account doesn't belong to the DEX`, [YVAULTS_ERROR__AMOUNTS_REPRESENT_ZERO_SHARES]: `The provided amounts are too small`, [YVAULTS_ERROR__BPS_NOT_IN_RANGE]: `Bps parameter passed to instruction is not in range`, [YVAULTS_ERROR__CANNOT_CHANGE_ADMIN_AUTHORITY]: `Cannot change admin authority`, [YVAULTS_ERROR__CANNOT_COLLECT_FEES_ON_ZERO_LIQUIDITY_POSITION]: `[DEPRECATED] Cannot collect fees on zero liquidity position`, [YVAULTS_ERROR__CANNOT_DEPOSIT_OUT_OF_RANGE]: `Cannot deposit when strategy out of range`, [YVAULTS_ERROR__CANNOT_EXECUTIVE_WITHDRAW_ZERO_AMOUNT]: `[DEPRECATED] Cannot executive withdraw zero amount`, [YVAULTS_ERROR__CANNOT_INVEST_OUT_OF_RANGE]: `Cannot invest when strategy out of range`, [YVAULTS_ERROR__CANNOT_INVEST_ZERO_AMOUNT]: `Cannot invest zero amount`, [YVAULTS_ERROR__CANNOT_OPEN_POSITION_WITH_EXISTING_POSITION]: `Cannot open position with existing opened position`, [YVAULTS_ERROR__CANNOT_RESIZE_ACCOUNT]: `Cannot resize with smaller new size`, [YVAULTS_ERROR__CANNOT_SWAP_UNEVEN_OUT_OF_RANGE]: `Cannot swap uneven vaults when position is out of range`, [YVAULTS_ERROR__CANNOT_WITHDRAW_ZERO_AMOUNT]: `Cannot withdraw zero amount`, [YVAULTS_ERROR__CHANGING_POOL_REWARD_MINT_MISMATCH]: `New pool reward mint does not match the old pool reward mint`, [YVAULTS_ERROR__COLLATERAL_INFO_ALREADY_EXISTS]: `Collateral info already exists for given index`, [YVAULTS_ERROR__COLLATERAL_TOKENS_EXCEED_DEPOSIT_CAP]: `Collaterals exceed deposit cap`, [YVAULTS_ERROR__COLLATERAL_TOKENS_EXCEED_DEPOSIT_CAP_PER_IXN]: `Collaterals exceed deposit ixn cap`, [YVAULTS_ERROR__COLLECT_FEES_BLOCKED]: `Collect fees is blocked`, [YVAULTS_ERROR__COLLECT_REWARDS_BLOCKED]: `Collect rewards is blocked`, [YVAULTS_ERROR__COMPUTE_FEES_AND_REWARDS_INVALID_REWARD]: `Got invalid reward from the dex specific function while computing the fees/rewards update`, [YVAULTS_ERROR__COMPUTE_FEES_AND_REWARDS_UPDATE_ERROR]: `Got an error from the dex specific function while computing the fees/rewards update`, [YVAULTS_ERROR__COULD_NOT_CALCULATE_PRICE_TWAP]: `Could not calculate get_price_usd_unchecked()`, [YVAULTS_ERROR__COULD_NOT_DESERIALIZE_REBALANCE_PARAMS]: `Rebalance params could not be deserialized`, [YVAULTS_ERROR__COULD_NOT_DESERIALIZE_REBALANCE_STATE]: `Rebalance state could not be deserialized`, [YVAULTS_ERROR__COULD_NOT_DESERIALIZE_SCOPE]: `Scope account could not be deserialized`, [YVAULTS_ERROR__COULD_NOT_SERIALIZE_REBALANCE_STATE]: `Rebalance state could not be serialized`, [YVAULTS_ERROR__C_P_I_NOT_ALLOWED]: `CPI not allowed`, [YVAULTS_ERROR__DECIMAL_NEGATIVE_SQRT_ROOT]: `Decimal sqrt on negative number`, [YVAULTS_ERROR__DECIMAL_OPERATION_FAILED]: `Decimal operation failed`, [YVAULTS_ERROR__DECIMAL_TO_U128_CONVERSION_FAILED]: `Decimal to u128 conversion failed`, [YVAULTS_ERROR__DECIMAL_TO_U64_CONVERSION_FAILED]: `Decimal to u64 conversion failed`, [YVAULTS_ERROR__DELTA_A_TOO_LARGE]: `[DEPRECATED] Delta A too large`, [YVAULTS_ERROR__DELTA_B_TOO_LARGE]: `[DEPRECATED] Delta B too large`, [YVAULTS_ERROR__DEPOSIT_AMOUNTS_ZERO]: `Deposit amounts must be greater than zero`, [YVAULTS_ERROR__DEPOSIT_LESS_THAN_MINIMUM]: `Deposit amount less than minimal allowed`, [YVAULTS_ERROR__DEPOSIT_WITHOUT_INVEST_DISALLOWED]: `Cannot deposit without invest`, [YVAULTS_ERROR__DIVIDE_BY_ZERO]: `Cannot divide by zero`, [YVAULTS_ERROR__DRIFTING_OPPOSITE_DIRECTION]: `Drifting strategy is moving in the opposite direction`, [YVAULTS_ERROR__EMERGENCY_SWAP_BLOCKED]: `Emergency Swap is blocked`, [YVAULTS_ERROR__EMPTY_TREASURY]: `No tokens to withdraw from treasury fee vault`, [YVAULTS_ERROR__EXISTING_REWARD_OVERRIDE]: `[DEPRECATED] Can not override the existing reward`, [YVAULTS_ERROR__FLASH_IXS_ACCOUNT_MISMATCH]: `Some accounts differ between the two flash ixs`, [YVAULTS_ERROR__FLASH_IXS_INCLUDE_SCOPE]: `A scope ix is present in a flash tx`, [YVAULTS_ERROR__FLASH_IXS_NOT_ENDED]: `Flash ixs initiated without the closing ix in the transaction`, [YVAULTS_ERROR__FLASH_SWAP_TOO_EARLY]: `Flash swap is too early after the position was opened`, [YVAULTS_ERROR__FLASH_TX_WITH_UNEXPECTED_IXS]: `Some unexpected instructions are present in the tx. Either before or after the flash ixs, or some ix target the same program between`, [YVAULTS_ERROR__FLASH_VAULT_SWAP_BLOCKED]: `Flash vault swap is blocked on this strategy`, [YVAULTS_ERROR__FLASH_VAULT_SWAP_WRONG_AMOUNT_TO_LEAVE]: `Unexpected amount of tokens in ata prior flash vault swap (wrong amount_to_leave_to_user)`, [YVAULTS_ERROR__GLOBAL_CONFIG_ALREADY_CONTAINS_SCOPE_PRICE_ID]: `Scope prices ids array already contains given scope price id`, [YVAULTS_ERROR__GLOBAL_CONFIG_EXPECTED_SCOPE_PRICES_ACCOUNT]: `Expected scope prices account being passed in when adding or updating a scope prices feed`, [YVAULTS_ERROR__GLOBAL_CONFIG_INVALID_SCOPE_PRICE_INDEX]: `Scope price index is not present in global config`, [YVAULTS_ERROR__GLOBAL_CONFIG_KEY_ERROR]: `Key is not present in global config`, [YVAULTS_ERROR__GLOBAL_CONFIG_SCOPE_PRICES_IDS_FULL]: `Scope prices ids array in global config is full`, [YVAULTS_ERROR__GLOBAL_DEPOSIT_BLOCKED]: `Global deposit is currently blocked`, [YVAULTS_ERROR__GLOBAL_INVEST_BLOCKED]: `Global invest is currently blocked`, [YVAULTS_ERROR__GLOBAL_WITHDRAW_BLOCKED]: `Global withdraw is currently blocked`, [YVAULTS_ERROR__INCORRECT_SCOPE_PRICES_ACCOUNT_I_D]: `Incorrect scope prices account id passed in`, [YVAULTS_ERROR__INTEGER_OVERFLOW]: `Integer overflow`, [YVAULTS_ERROR__INVALID_ADMIN_AUTHORITY]: `Invalid admin authority`, [YVAULTS_ERROR__INVALID_B_P_S_VALUE]: `Invalid BPS value provided`, [YVAULTS_ERROR__INVALID_DEX_PROGRAM_ID]: `Invalid dex program id`, [YVAULTS_ERROR__INVALID_POSITION_ACCOUNT]: `Position account doesn't match internal records`, [YVAULTS_ERROR__INVALID_REBALANCE_TYPE]: `Invalid rebalance type for the strategy`, [YVAULTS_ERROR__INVALID_REFERENCE_PRICE_TYPE]: `Invalid reference price type`, [YVAULTS_ERROR__INVALID_REWARD_INDEX]: `Reward index incorrect`, [YVAULTS_ERROR__INVALID_REWARD_MAPPING]: `Reward mapping incorrect`, [YVAULTS_ERROR__INVALID_SCOPE_CHAIN]: `Invalid Scope Chain`, [YVAULTS_ERROR__INVALID_SCOPE_STAKING_RATE_CHAIN]: `Invalid Scope staking rate Chain`, [YVAULTS_ERROR__INVALID_SCOPE_T_W_A_P_CHAIN]: `Invalid Scope TWAP Chain`, [YVAULTS_ERROR__INVALID_TICK]: `Invalid tick requested`, [YVAULTS_ERROR__INVEST_AMOUNT_BELOW_MINIMUM]: `Uninvested value is below the minimum invest trigger`, [YVAULTS_ERROR__INVEST_COOLDOWN_NOT_ELAPSED]: `Invest cooldown has not elapsed`, [YVAULTS_ERROR__INVEST_TOO_EARLY]: `Invest is too early after the position was opened`, [YVAULTS_ERROR__KAMINO_COLLATERAL_NOT_VALID]: `Kamino collateral is not valid`, [YVAULTS_ERROR__KAMINO_REWARD_ALREADY_EXISTS]: `Kamino reward is already initialized`, [YVAULTS_ERROR__KAMINO_REWARD_EXCEEDS_AVAILABLE_AMOUNT]: `[DEPRECATED] Expected kamino reward is bigger then the available amount within the vault`, [YVAULTS_ERROR__KAMINO_REWARD_NOT_EXIST]: `Kamino reward is not initialized`, [YVAULTS_ERROR__LOWER_TICK_LARGER_THAN_UPPER_TICK]: `Lower tick larger than upper tick`, [YVAULTS_ERROR__LOWER_TICK_NOT_MULTIPLE_OF_TICK_SPACING]: `Lower tick is not a multiple of tick spacing`, [YVAULTS_ERROR__LOWER_TICK_TOO_LOW]: `Lower tick is lower than the minimal supported low tick`, [YVAULTS_ERROR__MANUAL_REBALANCE_INVALID_OWNER]: `Only the owner of the strategy can manually rebalance it`, [YVAULTS_ERROR__MATH_OVERFLOW]: `[DEPRECATED] Mathematical operation with overflow`, [YVAULTS_ERROR__MAX_INVESTABLE_ZERO]: `Cannot have zero investable amount`, [YVAULTS_ERROR__MAX_LOSS_EXCEEDED]: `Rouding errors exceed the maximal loss tolerance`, [YVAULTS_ERROR__METEORA_MATH_OVERFLOW]: `Meteora math overflowed`, [YVAULTS_ERROR__NO_REBALANCE_NECESSARY]: `No rebalance necessary based on current rebalance type/parameters`, [YVAULTS_ERROR__NOT_ENOUGH_TOKENS_FOR_RATIO]: `Deposit is not allowed as token amounts are not enough to match our holdings ratio`, [YVAULTS_ERROR__OPERATION_FORBIDDEN]: `Operation Forbidden`, [YVAULTS_ERROR__ORCA_PRICE_TOO_DIFFERENT_FROM_SCOPE]: `Cannot use orca price as it is too different from scope price`, [YVAULTS_ERROR__ORCA_REWARD_UNINITIALIZED]: `Cannot use uninitialized orca reward vault`, [YVAULTS_ERROR__OUT_OF_RANGE_INTEGRAL_CONVERSION]: `Out of range integral conversion attempted`, [YVAULTS_ERROR__OWN_REWARD_UNINITIALIZED]: `Cannot use uninitialized reward vault`, [YVAULTS_ERROR__PERMISSIONLESS_REBALANCING_DISABLED]: `Permissionless rebalancing is disabled`, [YVAULTS_ERROR__POOL_REBALANCING]: `Deposit is not allowed as pool is rebalancing`, [YVAULTS_ERROR__POSITION_HAS_REMAINING_LIQUIDITY]: `Existent position has liquidity, new position creation is forbidden`, [YVAULTS_ERROR__PRICE_IS_BIGGER_THAN_HEURISTIC]: `Token price is bigger than heuristic`, [YVAULTS_ERROR__PRICE_IS_LOWER_THAN_HEURISTIC]: `Token price is lower than heuristic`, [YVAULTS_ERROR__PRICE_NOT_VALID]: `Price is not valid`, [YVAULTS_ERROR__PRICE_TOO_DIVERGENT_FROM_TWAP]: `Price too divergent from twap`, [YVAULTS_ERROR__PRICE_TOO_OLD]: `Price too old`, [YVAULTS_ERROR__PROVIDED_REWARD_VAULT_MISMATCH]: `The provided reward vault does not match the strategy state`, [YVAULTS_ERROR__REBALANCES_CAP_REACHED]: `Rebalance caps reached, no rebalances are allowed until the end of the current interval`, [YVAULTS_ERROR__REFERENCE_PRICE_TOO_FAR_FROM_POOL_PRICE]: `Reference price is too far from the current pool price`, [YVAULTS_ERROR__REPEATED_MINT]: `The provided reward vault does not match the strategy state`, [YVAULTS_ERROR__REWARD_NOT_STRATEGY_TOKEN]: `Reward does not match strategy token`, [YVAULTS_ERROR__REWARD_SCOPE_PRICE_ACCOUNT_NOT_PRESENT]: `A reward scope price account should have been passed in, but it is missing`, [YVAULTS_ERROR__REWARD_VAULT_OVERRIDE_NOT_ALLOWED]: `Reward vault override not allowed`, [YVAULTS_ERROR__SCOPE_CHAIN_UPDATE_FAILED]: `Scope chain update failed`, [YVAULTS_ERROR__SHARES_ISSUED_AMOUNT_DOES_NOT_MATCH]: `[DEPRECATED] Shares issued amount does not match`, [YVAULTS_ERROR__SHARES_NOT_ZERO]: `There must be no shares issued when closing a strategy`, [YVAULTS_ERROR__SHARES_ZERO]: `Number of shares to withdraw must be greater than zero`, [YVAULTS_ERROR__STAKING_RATE_NOT_VALID]: `Staking rate (provided by Scope) is not valid`, [YVAULTS_ERROR__STRATEGY_DEPOSIT_BLOCKED]: `Strategy deposit is currently blocked`, [YVAULTS_ERROR__STRATEGY_FIELD_UPDATE_NOT_ALLOWED]: `Strategy field update is not allowed`, [YVAULTS_ERROR__STRATEGY_INVEST_BLOCKED]: `Strategy invest is currently blocked`, [YVAULTS_ERROR__STRATEGY_NOT_ACTIVE]: `Strategy not active`, [YVAULTS_ERROR__STRATEGY_NOT_ACTIVE_WHEN_DEPOSITING]: `Cannot deposit inactive position`, [YVAULTS_ERROR__STRATEGY_NOT_FROZEN]: `Strategy is expected to be frozen for this operation`, [YVAULTS_ERROR__STRATEGY_POSITION_NOT_VALID]: `Expected strategy position to be initialized`, [YVAULTS_ERROR__STRATEGY_TICK_ARRAY_NOT_VALID]: `Expected strategy tick arrays to be initialized`, [YVAULTS_ERROR__STRATEGY_WITHDRAW_BLOCKED]: `Strategy withdraw is currently blocked`, [YVAULTS_ERROR__SWAP_AMOUNTS_TOO_SMALL]: `Swap amount below the minimum value`, [YVAULTS_ERROR__SWAP_AMOUNTS_ZERO]: `Swap amounts must be greater than zero`, [YVAULTS_ERROR__SWAP_REWARD_IMBALANCED]: `Must provide almost equal amounts of tokens`, [YVAULTS_ERROR__SWAP_REWARD_LESS_THAN_MINIMUM]: `Swap reward is less than minimum acceptable`, [YVAULTS_ERROR__SWAP_REWARD_LESS_THAN_REQUESTED]: `Swap reward is less than what user requested as minimum`, [YVAULTS_ERROR__SWAP_REWARDS_BLOCKED]: `Swap rewards is blocked`, [YVAULTS_ERROR__SWAP_REWARD_TOO_SMALL]: `Swap reward is zero or less than requested`, [YVAULTS_ERROR__SWAP_UNEVEN_INVALID_AUTHORITY]: `Cannot swap uneven because authority is set and the given signer does not correspond`, [YVAULTS_ERROR__SWAP_UNEVEN_TOO_EARLY]: `Swap uneven is too early after the position was opened`, [YVAULTS_ERROR__SWAP_UNEVEN_VAULTS_BLOCKED]: `Swap uneven vaults is blocked`, [YVAULTS_ERROR__SWAP_UNEVEN_VAULTS_OVERSHOOT]: `Swap uneven vaults result in the opposite unbalance of the vaults`, [YVAULTS_ERROR__SWAP_VAULTS_CASH_OUTPUT_BELOW_MINIMUM]: `Token out for cash based vault swap is below minimum expected`, [YVAULTS_ERROR__SWAP_VAULTS_TOO_BIG]: `Provided amount for vault swap is over the limit`, [YVAULTS_ERROR__SYSTEM_IN_EMERGENCY_MODE]: `[DEPRECATED] System is in emergency mode`, [YVAULTS_ERROR__TICK_ARRAYS_DO_NOT_MATCH_REBALANCE]: `The given tick arrays do not match the rebalance result`, [YVAULTS_ERROR__TIMESTAMP_DECREASE]: `Timestamp decrease`, [YVAULTS_ERROR__TOKEN_ACCOUNT_BALANCE_MISMATCH]: `Token amount in ata is different than the expected amount`, [YVAULTS_ERROR__TOKEN_DISABLED]: `Token cannot be used in strategy creation`, [YVAULTS_ERROR__TOKEN_TO_SWAP_NOT_ENOUGH]: `Token amount to be swapped is not enough`, [YVAULTS_ERROR__TOO_MUCH_LIQUIDITY_TO_WITHDRAW]: `Unable to withdraw more liquidity than available in position`, [YVAULTS_ERROR__UNABLE_TO_DESERIALIZE_ACCOUNT]: `Unable to deserialize account`, [YVAULTS_ERROR__UNEXPECTED_PROGRAM_ID_FOR_PREREQUISITE_IX]: `Unexpected programID for prerequisite ix`, [YVAULTS_ERROR__UNEXPECTED_TOKEN_AMOUNTS_POST_SWAP]: `Token left in vault post swap are lower than expected`, [YVAULTS_ERROR__UNHARVESTED_AMOUNTS]: `There are unharvested gains`, [YVAULTS_ERROR__UNSUPPORTED_DEX]: `DEX is not supported for this operation`, [YVAULTS_ERROR__UNSUPPORTED_DEX_FOR_TOKEN22]: `Cannot initialize strategy with this dex while having a mint with token22`, [YVAULTS_ERROR__UNSUPPORTED_TOKEN_EXTENSION]: `The token extension is not supported by the program`, [YVAULTS_ERROR__UPPER_TICK_NOT_MULTIPLE_OF_TICK_SPACING]: `Upper tick is not a multiple of tick spacing`, [YVAULTS_ERROR__UPPER_TICK_TOO_LARGE]: `Upper tick is larger than the maximum supported tick`, [YVAULTS_ERROR__VAULT_BALANCE_DOES_NOT_MATCH_TOKEN_A]: `[DEPRECATED] Vault balance does not match for token A`, [YVAULTS_ERROR__VAULT_BALANCE_DOES_NOT_MATCH_TOKEN_B]: `[DEPRECATED] Vault balance does not match for token B`, [YVAULTS_ERROR__VAULT_BALANCES_CAUSES_WRONG_SHARES_ISSUANCE]: `Deposit is not allowed as the strategy is not fully invested in the pool `, [YVAULTS_ERROR__VAULTS_ARE_ALREADY_BALANCED]: `Cannot swap as vaults are already balanced`, [YVAULTS_ERROR__WITHDRAWAL_CAP_REACHED]: `Withdrawal cap is reached`, [YVAULTS_ERROR__WRONG_COLLATERAL_I_D]: `[DEPRECATED] Collateral ID invalid for strategy`, [YVAULTS_ERROR__WRONG_D_E_X_PROGRAM_I_D]: `Wrong DEX program ID`, [YVAULTS_ERROR__WRONG_DISCRIMINATOR]: `Wrong discriminator`, [YVAULTS_ERROR__WRONG_EVENT_AUTHORITY]: `Wrong event authority`, [YVAULTS_ERROR__WRONG_KAMINO_REWARD_ID]: `Kamino reward id exceeds the available slots`, [YVAULTS_ERROR__WRONG_MINT]: `Wrong mint`, [YVAULTS_ERROR__WRONG_REWARD_COLLATERAL_ID]: `Wrong reward collateral_id`, [YVAULTS_ERROR__WRONG_REWARD_COLLATERAL_I_D]: `Reward collateral ID is incorrect for strategy`, [YVAULTS_ERROR__WRONG_SWAP_VAULT_DIRECTION]: `Vault swap can't be performed in the required direction`, [YVAULTS_ERROR__WRONG_VAULT]: `Wrong vault`, [YVAULTS_ERROR__ZERO_AMOUNT]: `[DEPRECATED] Zero amount` };
}
export function getYvaultsErrorMessage(code: YvaultsError): string {
if (process.env.NODE_ENV !== 'production') {
return (yvaultsErrorMessages as Record<YvaultsError, string>)[code];
}
return 'Error message not available in production bundles.';
}
export function isYvaultsError<TProgramErrorCode extends YvaultsError>(
error: unknown,
transactionMessage: { instructions: Record<number, { programAddress: Address }> },
code?: TProgramErrorCode,
): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {
return isProgramError<TProgramErrorCode>(error, transactionMessage, YVAULTS_PROGRAM_ADDRESS, code);
}