use thiserror::Error;

#[derive(Error, Debug)]
pub enum ErrorCodes {
    #[error("Vault next tick not found")]
    VaultNextTickNotFound,
    #[error("Vault invalid position mint")]
    VaultInvalidPositionMint,
    #[error("Vault tick id liquidation mismatch")]
    VaultTickIdLiquidationMismatch,
    #[error("Vault invalid position token amount")]
    VaultInvalidPositionTokenAmount,
    #[error("Vault invalid remaining accounts indices")]
    VaultInvalidRemainingAccountsIndices,
    #[error("Vault tick has debt vault id mismatch")]
    VaultTickHasDebtVaultIdMismatch,
    #[error("Vault branch vault id mismatch")]
    VaultBranchVaultIdMismatch,
    #[error("Vault tick vault id mismatch")]
    VaultTickVaultIdMismatch,
    #[error("Vault invalid decimals")]
    VaultInvalidDecimals,
    #[error("Vault invalid operate amount")]
    VaultInvalidOperateAmount,
    #[error("Vault tick is empty")]
    VaultTickIsEmpty,
    #[error("Vault position above CF")]
    VaultPositionAboveCF,
    #[error("Vault top tick does not exist")]
    VaultTopTickDoesNotExist,
    #[error("Vault excess slippage liquidation")]
    VaultExcessSlippageLiquidation,
    #[error("Vault not rebalancer")]
    VaultNotRebalancer,
    #[error("Vault token not initialized")]
    VaultTokenNotInitialized,
    #[error("Vault user collateral debt exceed")]
    VaultUserCollateralDebtExceed,
    #[error("Vault excess collateral withdrawal")]
    VaultExcessCollateralWithdrawal,
    #[error("Vault excess debt payback")]
    VaultExcessDebtPayback,
    #[error("Vault withdraw more than operate limit")]
    VaultWithdrawMoreThanOperateLimit,
    #[error("Vault invalid liquidation amount")]
    VaultInvalidLiquidationAmt,
    #[error("Vault liquidation result")]
    VaultLiquidationResult,
    #[error("Vault branch debt too low")]
    VaultBranchDebtTooLow,
    #[error("Vault tick debt too low")]
    VaultTickDebtTooLow,
    #[error("Vault liquidity exchange price unexpected")]
    VaultLiquidityExchangePriceUnexpected,
    #[error("Vault user debt too low")]
    VaultUserDebtTooLow,
    #[error("Vault invalid payback or deposit")]
    VaultInvalidPaybackOrDeposit,
    #[error("Vault invalid liquidation")]
    VaultInvalidLiquidation,
    #[error("Vault nothing to rebalance")]
    VaultNothingToRebalance,
    #[error("Vault liquidation reverts")]
    VaultLiquidationReverts,
    #[error("Vault invalid oracle price")]
    VaultInvalidOraclePrice,
    #[error("Vault branch not found")]
    VaultBranchNotFound,
    #[error("Vault tick not found")]
    VaultTickNotFound,
    #[error("Vault tick has debt not found")]
    VaultTickHasDebtNotFound,
    #[error("Vault tick mismatch")]
    VaultTickMismatch,
    #[error("Vault invalid vault id")]
    VaultInvalidVaultId,
    #[error("Vault invalid next position id")]
    VaultInvalidNextPositionId,
    #[error("Vault invalid supply mint")]
    VaultInvalidSupplyMint,
    #[error("Vault invalid borrow mint")]
    VaultInvalidBorrowMint,
    #[error("Vault invalid oracle")]
    VaultInvalidOracle,
    #[error("Vault invalid tick")]
    VaultInvalidTick,
    #[error("Vault invalid liquidity program")]
    VaultInvalidLiquidityProgram,
    #[error("Vault invalid position authority")]
    VaultInvalidPositionAuthority,
    #[error("Vault oracle not valid")]
    VaultOracleNotValid,
    #[error("Vault branch owner not valid")]
    VaultBranchOwnerNotValid,
    #[error("Vault tick has debt owner not valid")]
    VaultTickHasDebtOwnerNotValid,
    #[error("Vault tick owner not valid")]
    VaultTickOwnerNotValid,
    #[error("Vault liquidate remaining accounts too short")]
    VaultLiquidateRemainingAccountsTooShort,
    #[error("Vault operate remaining accounts too short")]
    VaultOperateRemainingAccountsTooShort,
    #[error("Vault invalid zeroth branch")]
    VaultInvalidZerothBranch,
    #[error("Vault CPI to liquidity failed")]
    VaultCpiToLiquidityFailed,
    #[error("Vault CPI to oracle failed")]
    VaultCpiToOracleFailed,
    #[error("Vault only authority")]
    VaultOnlyAuthority,
    #[error("Vault new branch invalid")]
    VaultNewBranchInvalid,
    #[error("Vault tick has debt index mismatch")]
    VaultTickHasDebtIndexMismatch,
    #[error("Vault tick has debt out of range")]
    VaultTickHasDebtOutOfRange,
    #[error("Vault user supply position required")]
    VaultUserSupplyPositionRequired,
    #[error("Vault claim account required")]
    VaultClaimAccountRequired,
    #[error("Vault recipient withdraw account required")]
    VaultRecipientWithdrawAccountRequired,
    #[error("Vault recipient borrow account required")]
    VaultRecipientBorrowAccountRequired,
    #[error("Vault position above liquidation threshold")]
    VaultPositionAboveLiquidationThreshold,
    #[error("Vault admin value above limit")]
    VaultAdminValueAboveLimit,
    #[error("Vault admin only auths")]
    VaultAdminOnlyAuths,
    #[error("Vault admin address zero not allowed")]
    VaultAdminAddressZeroNotAllowed,
    #[error("Vault admin vault id mismatch")]
    VaultAdminVaultIdMismatch,
    #[error("Vault admin total ids mismatch")]
    VaultAdminTotalIdsMismatch,
    #[error("Vault admin tick mismatch")]
    VaultAdminTickMismatch,
    #[error("Vault admin liquidity program mismatch")]
    VaultAdminLiquidityProgramMismatch,
    #[error("Vault admin max auth count reached")]
    VaultAdminMaxAuthCountReached,
    #[error("Vault admin invalid params")]
    VaultAdminInvalidParams,
    #[error("Vault admin only authority")]
    VaultAdminOnlyAuthority,
    #[error("Vault admin oracle program mismatch")]
    VaultAdminOracleProgramMismatch,
}
