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("InvalidMarketMaker")]
33 InvalidMarketMaker = 0x1776,
34 #[error("Provided SqrtPriceLimit not in the same direction as the swap.")]
36 InvalidSqrtPriceLimitDirection = 0x1777,
37 #[error("InvalidTickArraySequence")]
39 InvalidTickArraySequence = 0x1778,
40 #[error("InsufficientLiquidity")]
42 InsufficientLiquidity = 0x1779,
43 #[error("InterestRateIsOutOfRange")]
45 InterestRateIsOutOfRange = 0x177A,
46 #[error("LeverageIsOutOfRange")]
48 LeverageIsOutOfRange = 0x177B,
49 #[error("LeftoversExceeded")]
51 LeftoversExceeded = 0x177C,
52 #[error("LimitOrderExecutionFeeIsOutOfRange")]
54 LimitOrderExecutionFeeIsOutOfRange = 0x177D,
55 #[error("LiquidationFeeIsOutOfRange")]
57 LiquidationFeeIsOutOfRange = 0x177E,
58 #[error("LiquidationThresholdIsOutOfRange")]
60 LiquidationThresholdIsOutOfRange = 0x177F,
61 #[error("Liquidity amount must be greater than zero.")]
63 LiquidityZero = 0x1780,
64 #[error("MarketDisabled")]
66 MarketDisabled = 0x1781,
67 #[error("MarketDebtLimitExceeded")]
69 MarketDebtLimitExceeded = 0x1782,
70 #[error("MathOverflow")]
72 MathOverflow = 0x1783,
73 #[error("MathUnderflow")]
75 MathUnderflow = 0x1784,
76 #[error("Unable to call transfer hook without extra accounts")]
78 NoExtraAccountsForTransferHook = 0x1785,
79 #[error("OracleStalePrice")]
81 OracleStalePrice = 0x1786,
82 #[error("OraclePriceDeviationThresholdExceeded")]
84 OraclePriceDeviationThresholdExceeded = 0x1787,
85 #[error("OraclePriceDeviationThresholdOutOfRange")]
87 OraclePriceDeviationThresholdOutOfRange = 0x1788,
88 #[error("Trade resulted in partial fill")]
90 PartialFillError = 0x1789,
91 #[error("PositionIsHealthy")]
93 PositionIsHealthy = 0x178A,
94 #[error("PositionIsLiquidated")]
96 PositionIsLiquidated = 0x178B,
97 #[error("PositionIsUnhealthy")]
99 PositionIsUnhealthy = 0x178C,
100 #[error("PositionNotEmpty")]
102 PositionNotEmpty = 0x178D,
103 #[error("ProtocolFeeIsOutOfRange")]
105 ProtocolFeeIsOutOfRange = 0x178E,
106 #[error("Same accounts type is provided more than once")]
108 RemainingAccountsDuplicatedAccountsType = 0x178F,
109 #[error("Invalid remaining accounts")]
111 RemainingAccountsInvalidSlice = 0x1790,
112 #[error("Invalid remaining accounts slice length")]
114 RemainingAccountsInvalidSliceLength = 0x1791,
115 #[error("Insufficient remaining accounts")]
117 RemainingAccountsInsufficient = 0x1792,
118 #[error("Required remaining account is not provided")]
120 RequiredRemainingAccountNotProvided = 0x1793,
121 #[error("SolverFailedToFindRoot")]
123 SolverFailedToFindRoot = 0x1794,
124 #[error("SqrtPriceOutOfBounds")]
126 SqrtPriceOutOfBounds = 0x1795,
127 #[error("SupplyLimitExceeded")]
129 SupplyLimitExceeded = 0x1796,
130 #[error("Suspended")]
132 Suspended = 0x1797,
133 #[error("SwapSlippageExceeded")]
135 SwapSlippageExceeded = 0x1798,
136 #[error("SwapSlippageIsOutOfRange")]
138 SwapSlippageIsOutOfRange = 0x1799,
139 #[error("TickIndexOfBounds")]
141 TickIndexOfBounds = 0x179A,
142 #[error("Transfer fee calculation failed")]
144 TransferFeeCalculationError = 0x179B,
145 #[error("TypeCastOverflow")]
147 TypeCastOverflow = 0x179C,
148 #[error("UnexpectedValue")]
150 UnexpectedValue = 0x179D,
151 #[error("Token mint has unsupported attributes")]
153 UnsupportedTokenMint = 0x179E,
154 #[error("VaultNotInitialized")]
156 VaultNotInitialized = 0x179F,
157 #[error("WithdrawRequestExceedsUserBalance")]
159 WithdrawRequestExceedsUserBalance = 0x17A0,
160 #[error("ZeroPriceRange")]
162 ZeroPriceRange = 0x17A1,
163 #[error("There are no tradable amount to swap.")]
165 ZeroTradableAmount = 0x17A2,
166 #[error("ZeroYield")]
168 ZeroYield = 0x17A3,
169 #[error("RaydiumInvalidFirstTickArrayAccount")]
171 RaydiumInvalidFirstTickArrayAccount = 0x17A4,
172 #[error("RaydiumInvalidTickArray")]
174 RaydiumInvalidTickArray = 0x17A5,
175 #[error("RaydiumInvaildTickIndex")]
177 RaydiumInvaildTickIndex = 0x17A6,
178 #[error("RaydiumMaxTokenOverflow")]
180 RaydiumMaxTokenOverflow = 0x17A7,
181 #[error("RaydiumNotEnoughTickArrayAccount")]
183 RaydiumNotEnoughTickArrayAccount = 0x17A8,
184 #[error("RaydiumSqrtPriceLimitOverflow")]
186 RaydiumSqrtPriceLimitOverflow = 0x17A9,
187 #[error("RaydiumZeroAmountSpecified")]
189 RaydiumZeroAmountSpecified = 0x17AA,
190 #[error("UnableToLoadAccountData")]
192 UnableToLoadAccountData = 0x17AB,
193 #[error("UnableToDeserializeAccountData")]
195 UnableToDeserializeAccountData = 0x17AC,
196}
197
198impl solana_program::program_error::PrintProgramError for TunaError {
199 fn print<E>(&self) {
200 solana_program::msg!(&self.to_string());
201 }
202}
203
204impl<T> solana_program::decode_error::DecodeError<T> for TunaError {
205 fn type_of() -> &'static str {
206 "TunaError"
207 }
208}
209