defituna_client/generated/errors/
tuna.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum TunaError {
13 #[error("AmountSlippageExceeded")]
15 AmountSlippageExceeded = 0x1770,
16 #[error("BadDebt")]
18 BadDebt = 0x1771,
19 #[error("InvalidRemainingAccountsLength")]
21 InvalidRemainingAccountsLength = 0x1772,
22 #[error("InvalidAccounts")]
24 InvalidTickArrayAccounts = 0x1773,
25 #[error("InvalidAccountOwner")]
27 InvalidAccountOwner = 0x1774,
28 #[error("InvalidInstructionArguments")]
30 InvalidInstructionArguments = 0x1775,
31 #[error("Provided SqrtPriceLimit not in the same direction as the swap.")]
33 InvalidSqrtPriceLimitDirection = 0x1776,
34 #[error("InvalidTickArraySequence")]
36 InvalidTickArraySequence = 0x1777,
37 #[error("InsufficientLiquidity")]
39 InsufficientLiquidity = 0x1778,
40 #[error("InterestRateIsOutOfRange")]
42 InterestRateIsOutOfRange = 0x1779,
43 #[error("LeverageIsOutOfRange")]
45 LeverageIsOutOfRange = 0x177A,
46 #[error("LeftoversExceeded")]
48 LeftoversExceeded = 0x177B,
49 #[error("LimitOrderExecutionFeeIsOutOfRange")]
51 LimitOrderExecutionFeeIsOutOfRange = 0x177C,
52 #[error("LiquidationFeeIsOutOfRange")]
54 LiquidationFeeIsOutOfRange = 0x177D,
55 #[error("LiquidationThresholdIsOutOfRange")]
57 LiquidationThresholdIsOutOfRange = 0x177E,
58 #[error("Liquidity amount must be greater than zero.")]
60 LiquidityZero = 0x177F,
61 #[error("MarketDisabled")]
63 MarketDisabled = 0x1780,
64 #[error("MarketDebtLimitExceeded")]
66 MarketDebtLimitExceeded = 0x1781,
67 #[error("MathOverflow")]
69 MathOverflow = 0x1782,
70 #[error("MathUnderflow")]
72 MathUnderflow = 0x1783,
73 #[error("Unable to call transfer hook without extra accounts")]
75 NoExtraAccountsForTransferHook = 0x1784,
76 #[error("OracleStalePrice")]
78 OracleStalePrice = 0x1785,
79 #[error("OraclePriceDeviationThresholdExceeded")]
81 OraclePriceDeviationThresholdExceeded = 0x1786,
82 #[error("OraclePriceDeviationThresholdOutOfRange")]
84 OraclePriceDeviationThresholdOutOfRange = 0x1787,
85 #[error("Trade resulted in partial fill")]
87 PartialFillError = 0x1788,
88 #[error("PositionIsHealthy")]
90 PositionIsHealthy = 0x1789,
91 #[error("PositionIsLiquidated")]
93 PositionIsLiquidated = 0x178A,
94 #[error("PositionIsUnhealthy")]
96 PositionIsUnhealthy = 0x178B,
97 #[error("PositionNotEmpty")]
99 PositionNotEmpty = 0x178C,
100 #[error("ProtocolFeeIsOutOfRange")]
102 ProtocolFeeIsOutOfRange = 0x178D,
103 #[error("SolverFailedToFindRoot")]
105 SolverFailedToFindRoot = 0x178E,
106 #[error("SqrtPriceOutOfBounds")]
108 SqrtPriceOutOfBounds = 0x178F,
109 #[error("SupplyLimitExceeded")]
111 SupplyLimitExceeded = 0x1790,
112 #[error("Suspended")]
114 Suspended = 0x1791,
115 #[error("SwapSlippageExceeded")]
117 SwapSlippageExceeded = 0x1792,
118 #[error("SwapSlippageIsOutOfRange")]
120 SwapSlippageIsOutOfRange = 0x1793,
121 #[error("TickIndexOfBounds")]
123 TickIndexOfBounds = 0x1794,
124 #[error("Transfer fee calculation failed")]
126 TransferFeeCalculationError = 0x1795,
127 #[error("TypeCastOverflow")]
129 TypeCastOverflow = 0x1796,
130 #[error("UnexpectedValue")]
132 UnexpectedValue = 0x1797,
133 #[error("Token mint has unsupported attributes")]
135 UnsupportedTokenMint = 0x1798,
136 #[error("VaultNotInitialized")]
138 VaultNotInitialized = 0x1799,
139 #[error("WithdrawRequestExceedsUserBalance")]
141 WithdrawRequestExceedsUserBalance = 0x179A,
142 #[error("ZeroPriceRange")]
144 ZeroPriceRange = 0x179B,
145 #[error("There are no tradable amount to swap.")]
147 ZeroTradableAmount = 0x179C,
148 #[error("ZeroYield")]
150 ZeroYield = 0x179D,
151 #[error("RaydiumInvalidFirstTickArrayAccount")]
153 RaydiumInvalidFirstTickArrayAccount = 0x179E,
154 #[error("RaydiumInvalidTickArray")]
156 RaydiumInvalidTickArray = 0x179F,
157 #[error("RaydiumInvaildTickIndex")]
159 RaydiumInvaildTickIndex = 0x17A0,
160 #[error("RaydiumMaxTokenOverflow")]
162 RaydiumMaxTokenOverflow = 0x17A1,
163 #[error("RaydiumNotEnoughTickArrayAccount")]
165 RaydiumNotEnoughTickArrayAccount = 0x17A2,
166 #[error("RaydiumSqrtPriceLimitOverflow")]
168 RaydiumSqrtPriceLimitOverflow = 0x17A3,
169 #[error("RaydiumZeroAmountSpecified")]
171 RaydiumZeroAmountSpecified = 0x17A4,
172 #[error("UnableToLoadAccountData")]
174 UnableToLoadAccountData = 0x17A5,
175 #[error("UnableToDeserializeAccountData")]
177 UnableToDeserializeAccountData = 0x17A6,
178}
179
180impl solana_program::program_error::PrintProgramError for TunaError {
181 fn print<E>(&self) {
182 solana_program::msg!(&self.to_string());
183 }
184}
185
186impl<T> solana_program::decode_error::DecodeError<T> for TunaError {
187 fn type_of() -> &'static str {
188 "TunaError"
189 }
190}
191