1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum LbClmmError {
13 #[error("Invalid start bin index")]
15 InvalidStartBinIndex = 0x1770,
16 #[error("Invalid bin id")]
18 InvalidBinId = 0x1771,
19 #[error("Invalid input data")]
21 InvalidInput = 0x1772,
22 #[error("Exceeded amount slippage tolerance")]
24 ExceededAmountSlippageTolerance = 0x1773,
25 #[error("Exceeded bin slippage tolerance")]
27 ExceededBinSlippageTolerance = 0x1774,
28 #[error("Composition factor flawed")]
30 CompositionFactorFlawed = 0x1775,
31 #[error("Non preset bin step")]
33 NonPresetBinStep = 0x1776,
34 #[error("Zero liquidity")]
36 ZeroLiquidity = 0x1777,
37 #[error("Invalid position")]
39 InvalidPosition = 0x1778,
40 #[error("Bin array not found")]
42 BinArrayNotFound = 0x1779,
43 #[error("Invalid token mint")]
45 InvalidTokenMint = 0x177A,
46 #[error("Invalid account for single deposit")]
48 InvalidAccountForSingleDeposit = 0x177B,
49 #[error("Pair insufficient liquidity")]
51 PairInsufficientLiquidity = 0x177C,
52 #[error("Invalid fee owner")]
54 InvalidFeeOwner = 0x177D,
55 #[error("Invalid fee withdraw amount")]
57 InvalidFeeWithdrawAmount = 0x177E,
58 #[error("Invalid admin")]
60 InvalidAdmin = 0x177F,
61 #[error("Identical fee owner")]
63 IdenticalFeeOwner = 0x1780,
64 #[error("Invalid basis point")]
66 InvalidBps = 0x1781,
67 #[error("Math operation overflow")]
69 MathOverflow = 0x1782,
70 #[error("Type cast error")]
72 TypeCastFailed = 0x1783,
73 #[error("Invalid reward index")]
75 InvalidRewardIndex = 0x1784,
76 #[error("Invalid reward duration")]
78 InvalidRewardDuration = 0x1785,
79 #[error("Reward already initialized")]
81 RewardInitialized = 0x1786,
82 #[error("Reward not initialized")]
84 RewardUninitialized = 0x1787,
85 #[error("Identical funder")]
87 IdenticalFunder = 0x1788,
88 #[error("Reward campaign in progress")]
90 RewardCampaignInProgress = 0x1789,
91 #[error("Reward duration is the same")]
93 IdenticalRewardDuration = 0x178A,
94 #[error("Invalid bin array")]
96 InvalidBinArray = 0x178B,
97 #[error("Bin arrays must be continuous")]
99 NonContinuousBinArrays = 0x178C,
100 #[error("Invalid reward vault")]
102 InvalidRewardVault = 0x178D,
103 #[error("Position is not empty")]
105 NonEmptyPosition = 0x178E,
106 #[error("Unauthorized access")]
108 UnauthorizedAccess = 0x178F,
109 #[error("Invalid fee parameter")]
111 InvalidFeeParameter = 0x1790,
112 #[error("Missing oracle account")]
114 MissingOracle = 0x1791,
115 #[error("Insufficient observation sample")]
117 InsufficientSample = 0x1792,
118 #[error("Invalid lookup timestamp")]
120 InvalidLookupTimestamp = 0x1793,
121 #[error("Bitmap extension account is not provided")]
123 BitmapExtensionAccountIsNotProvided = 0x1794,
124 #[error("Cannot find non-zero liquidity binArrayId")]
126 CannotFindNonZeroLiquidityBinArrayId = 0x1795,
127 #[error("Bin id out of bound")]
129 BinIdOutOfBound = 0x1796,
130 #[error("Insufficient amount in for minimum out")]
132 InsufficientOutAmount = 0x1797,
133 #[error("Invalid position width")]
135 InvalidPositionWidth = 0x1798,
136 #[error("Excessive fee update")]
138 ExcessiveFeeUpdate = 0x1799,
139 #[error("Pool disabled")]
141 PoolDisabled = 0x179A,
142 #[error("Invalid pool type")]
144 InvalidPoolType = 0x179B,
145 #[error("Whitelist for wallet is full")]
147 ExceedMaxWhitelist = 0x179C,
148 #[error("Invalid index")]
150 InvalidIndex = 0x179D,
151 #[error("Reward not ended")]
153 RewardNotEnded = 0x179E,
154 #[error("Must withdraw ineligible reward")]
156 MustWithdrawnIneligibleReward = 0x179F,
157 #[error("Unauthorized address")]
159 UnauthorizedAddress = 0x17A0,
160 #[error("Cannot update because operators are the same")]
162 OperatorsAreTheSame = 0x17A1,
163 #[error("Withdraw to wrong token account")]
165 WithdrawToWrongTokenAccount = 0x17A2,
166 #[error("Wrong rent receiver")]
168 WrongRentReceiver = 0x17A3,
169 #[error("Already activated")]
171 AlreadyPassActivationPoint = 0x17A4,
172 #[error("Swapped amount is exceeded max swapped amount")]
174 ExceedMaxSwappedAmount = 0x17A5,
175 #[error("Invalid strategy parameters")]
177 InvalidStrategyParameters = 0x17A6,
178 #[error("Liquidity locked")]
180 LiquidityLocked = 0x17A7,
181 #[error("Bin range is not empty")]
183 BinRangeIsNotEmpty = 0x17A8,
184 #[error("Amount out is not matched with exact amount out")]
186 NotExactAmountOut = 0x17A9,
187 #[error("Invalid activation type")]
189 InvalidActivationType = 0x17AA,
190 #[error("Invalid activation duration")]
192 InvalidActivationDuration = 0x17AB,
193 #[error("Missing token amount as token launch owner proof")]
195 MissingTokenAmountAsTokenLaunchProof = 0x17AC,
196 #[error("Quote token must be SOL or USDC")]
198 InvalidQuoteToken = 0x17AD,
199 #[error("Invalid bin step")]
201 InvalidBinStep = 0x17AE,
202 #[error("Invalid base fee")]
204 InvalidBaseFee = 0x17AF,
205 #[error("Invalid pre-activation duration")]
207 InvalidPreActivationDuration = 0x17B0,
208 #[error("Already pass pre-activation swap point")]
210 AlreadyPassPreActivationSwapPoint = 0x17B1,
211 #[error("Invalid status")]
213 InvalidStatus = 0x17B2,
214 #[error("Exceed max oracle length")]
216 ExceededMaxOracleLength = 0x17B3,
217 #[error("Invalid minimum liquidity")]
219 InvalidMinimumLiquidity = 0x17B4,
220 #[error("Not support token_2022 mint extension")]
222 NotSupportMint = 0x17B5,
223 #[error("Unsupported mint extension")]
225 UnsupportedMintExtension = 0x17B6,
226 #[error("Unsupported native mint token2022")]
228 UnsupportNativeMintToken2022 = 0x17B7,
229 #[error("Unmatch token mint")]
231 UnmatchTokenMint = 0x17B8,
232 #[error("Unsupported token mint")]
234 UnsupportedTokenMint = 0x17B9,
235 #[error("Insufficient remaining accounts")]
237 InsufficientRemainingAccounts = 0x17BA,
238 #[error("Invalid remaining account slice")]
240 InvalidRemainingAccountSlice = 0x17BB,
241 #[error("Duplicated remaining account types")]
243 DuplicatedRemainingAccountTypes = 0x17BC,
244 #[error("Missing remaining account for transfer hook")]
246 MissingRemainingAccountForTransferHook = 0x17BD,
247 #[error("Remaining account was passed for transfer hook but there's no hook program")]
249 NoTransferHookProgram = 0x17BE,
250 #[error("Zero funded amount")]
252 ZeroFundedAmount = 0x17BF,
253 #[error("Invalid side")]
255 InvalidSide = 0x17C0,
256 #[error("Invalid resize length")]
258 InvalidResizeLength = 0x17C1,
259 #[error("Not support at the moment")]
261 NotSupportAtTheMoment = 0x17C2,
262}
263
264#[allow(deprecated)]
265impl solana_program_error::PrintProgramError for LbClmmError {
266 fn print<E>(&self) {
267 solana_msg::msg!(&self.to_string());
268 }
269}
270
271#[allow(deprecated)]
272impl<T> solana_decode_error::DecodeError<T> for LbClmmError {
273 fn type_of() -> &'static str {
274 "LbClmmError"
275 }
276}