1use anchor_lang::prelude::*;
3
4#[error_code]
6pub enum PoolError {
7 #[msg("Math operation overflow")]
9 MathOverflow,
10
11 #[msg("Invalid fee setup")]
13 InvalidFee,
14
15 #[msg("Invalid invariant d")]
17 InvalidInvariant,
18
19 #[msg("Fee calculation failure")]
21 FeeCalculationFailure,
22
23 #[msg("Exceeded slippage tolerance")]
25 ExceededSlippage,
26
27 #[msg("Invalid curve calculation")]
29 InvalidCalculation,
30
31 #[msg("Given pool token amount results in zero trading tokens")]
33 ZeroTradingTokens,
34
35 #[msg("Math conversion overflow")]
37 ConversionError,
38
39 #[msg("LP mint authority must be 'A' vault lp, without freeze authority, and 0 supply")]
41 FaultyLpMint,
42
43 #[msg("Token mint mismatched")]
45 MismatchedTokenMint,
46
47 #[msg("LP mint mismatched")]
49 MismatchedLpMint,
50
51 #[msg("Invalid lp token owner")]
53 MismatchedOwner,
54
55 #[msg("Invalid vault account")]
57 InvalidVaultAccount,
58
59 #[msg("Invalid vault lp account")]
61 InvalidVaultLpAccount,
62
63 #[msg("Invalid pool lp mint account")]
65 InvalidPoolLpMintAccount,
66
67 #[msg("Pool disabled")]
69 PoolDisabled,
70
71 #[msg("Invalid admin account")]
73 InvalidAdminAccount,
74
75 #[msg("Invalid admin fee account")]
78 InvalidAdminFeeAccount,
79
80 #[msg("Same admin account")]
82 SameAdminAccount,
83
84 #[msg("Identical user source and destination token account")]
86 IdenticalSourceDestination,
87
88 #[msg("Apy calculation error")]
90 ApyCalculationError,
91
92 #[msg("Insufficient virtual price snapshot")]
94 InsufficientSnapshot,
95
96 #[msg("Current curve is non-updatable")]
98 NonUpdatableCurve,
99
100 #[msg("New curve is mismatched with old curve")]
102 MisMatchedCurve,
103
104 #[msg("Amplification is invalid")]
106 InvalidAmplification,
107
108 #[msg("Operation is not supported")]
110 UnsupportedOperation,
111
112 #[msg("Exceed max amplification changes")]
114 ExceedMaxAChanges,
115
116 #[msg("Invalid remaining accounts length")]
118 InvalidRemainingAccountsLen,
119
120 #[msg("Invalid remaining account")]
122 InvalidRemainingAccounts,
123
124 #[msg("Token mint B doesn't matches depeg type token mint")]
126 MismatchedDepegMint,
127
128 #[msg("Invalid APY account")]
130 InvalidApyAccount,
131
132 #[msg("Invalid token multiplier")]
134 InvalidTokenMultiplier,
135
136 #[msg("Invalid depeg information")]
138 InvalidDepegInformation,
139
140 #[msg("Update time constraint violated")]
142 UpdateTimeConstraint,
143
144 #[msg("Exceeded max fee bps")]
146 ExceedMaxFeeBps,
147
148 #[msg("Owner fee exceed half of trade fee")]
150 OwnerFeeOverHalfOfTradeFee,
151
152 #[msg("Invalid admin")]
154 InvalidAdmin,
155
156 #[msg("Pool is not permissioned")]
158 PoolIsNotPermissioned,
159
160 #[msg("Invalid deposit amount")]
162 InvalidDepositAmount,
163
164 #[msg("Invalid fee owner")]
166 InvalidFeeOwner,
167
168 #[msg("Pool is not depleted")]
170 NonDepletedPool,
171
172 #[msg("Token amount is not 1:1")]
174 AmountNotPeg,
175}