-
Notifications
You must be signed in to change notification settings - Fork 80
/
errors.go
192 lines (188 loc) · 4.71 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
package types
// DONTCOVER
import (
sdkerrors "cosmossdk.io/errors"
)
// x/dex module sentinel errors
var (
ErrInvalidTradingPair = sdkerrors.Register(
ModuleName,
1102,
"Invalid token pair:",
) // "%s<>%s", tokenA, tokenB
ErrInsufficientShares = sdkerrors.Register(
ModuleName,
1104,
"Insufficient shares:",
) // "%s does not have %s shares of type %s", address, shares, sharesID
ErrUnbalancedTxArray = sdkerrors.Register(
ModuleName,
1110,
"Transaction input arrays are not of the same length.",
)
ErrValidLimitOrderTrancheNotFound = sdkerrors.Register(
ModuleName,
1111,
"Limit order trache not found:",
) // "%d", trancheKey
ErrCancelEmptyLimitOrder = sdkerrors.Register(
ModuleName,
1112,
"Cannot cancel additional liquidity from limit order tranche:",
) // "%d", tranche.TrancheKey
ErrInsufficientLiquidity = sdkerrors.Register(
ModuleName,
1114,
"Not enough liquidity to complete trade",
)
ErrTickOutsideRange = sdkerrors.Register(
ModuleName,
1117,
"abs(tick) + fee must be < 559,680",
)
ErrInvalidPoolDenom = sdkerrors.Register(
ModuleName,
1118,
"Denom is not an instance of Neutron PoolDenom",
)
ErrInvalidPairIDStr = sdkerrors.Register(
ModuleName,
1119,
"PairID does not conform to pattern TokenA<>TokenB",
)
ErrZeroDeposit = sdkerrors.Register(
ModuleName,
1120,
"At least one deposit amount must be > 0.",
)
ErrZeroTrueDeposit = sdkerrors.Register(
ModuleName,
1121,
"Cannot deposit double-sided liquidity in tick with prexisting single-sided liquidity.",
)
ErrWithdrawEmptyLimitOrder = sdkerrors.Register(
ModuleName,
1124,
"Cannot withdraw additional liqudity from this limit order at this time.",
)
ErrZeroSwap = sdkerrors.Register(
ModuleName,
1125,
"MaxAmountIn in must be > 0 for swap.",
)
ErrActiveLimitOrderNotFound = sdkerrors.Register(
ModuleName,
1128,
"No active limit found. It does not exist or has already been filled",
)
ErrZeroWithdraw = sdkerrors.Register(
ModuleName,
1129,
"Withdraw amount must be > 0.",
)
ErrZeroLimitOrder = sdkerrors.Register(
ModuleName,
1130,
"Limit order amount must be > 0.",
)
ErrDepositShareUnderflow = sdkerrors.Register(
ModuleName,
1133,
"Deposit amount is too small to issue shares",
)
ErrFoKLimitOrderNotFilled = sdkerrors.Register(
ModuleName,
1134,
"Fill Or Kill limit order couldn't be executed in its entirety.",
)
ErrInvalidTimeString = sdkerrors.Register(
ModuleName,
1135,
"Time string must be formatted as MM/dd/yyyy HH:mm:ss (ex. 02/05/2023 15:34:56) ",
)
ErrGoodTilOrderWithoutExpiration = sdkerrors.Register(
ModuleName,
1136,
"Limit orders of type GOOD_TIL_TIME must supply an ExpirationTime.",
)
ErrExpirationOnWrongOrderType = sdkerrors.Register(
ModuleName,
1137,
"Only Limit orders of type GOOD_TIL_TIME can supply an ExpirationTime.",
)
ErrInvalidOrderType = sdkerrors.Register(
ModuleName,
1138,
"Order type must be one of: GOOD_TIL_CANCELLED, FILL_OR_KILL, IMMEDIATE_OR_CANCEL, JUST_IN_TIME, or GOOD_TIL_TIME.",
)
ErrExpirationTimeInPast = sdkerrors.Register(
ModuleName,
1139,
"Limit order expiration time must be greater than current block time:",
)
ErrExitLimitPriceHit = sdkerrors.Register(
ModuleName,
1140,
"ExitLimitPrice cannot be satisfied.",
)
ErrAllMultiHopRoutesFailed = sdkerrors.Register(
ModuleName,
1141,
"All multihop routes failed limitPrice check or had insufficient liquidity",
)
ErrMultihopExitTokensMismatch = sdkerrors.Register(
ModuleName,
1142,
"All multihop routes must have the same exit token",
)
ErrMissingMultihopRoute = sdkerrors.Register(
ModuleName,
1143,
"Must supply at least 1 route for multihop swap",
)
ErrZeroMaxAmountOut = sdkerrors.Register(
ModuleName,
1144,
"MaxAmountOut must be nil or > 0.",
)
ErrInvalidMaxAmountOutForMaker = sdkerrors.Register(
ModuleName,
1145,
"MaxAmountOut can only be set for taker only limit orders.",
)
ErrInvalidFee = sdkerrors.Register(
ModuleName,
1148,
"Fee must must a legal fee amount:",
)
ErrInvalidAddress = sdkerrors.Register(
ModuleName,
1149,
"Invalid Address",
)
ErrRouteWithoutExitToken = sdkerrors.Register(
ModuleName,
1150,
"Each route should specify at least two hops - input and output tokens",
)
ErrCycleInHops = sdkerrors.Register(
ModuleName,
1151,
"Hops cannot have cycles",
)
ErrZeroExitPrice = sdkerrors.Register(
ModuleName,
1152,
"Cannot have negative or zero exit price",
)
ErrDuplicatePoolDeposit = sdkerrors.Register(
ModuleName,
1153,
"Can only provide a single deposit amount for each tick, fee pair",
)
ErrSwapAmountTooSmall = sdkerrors.Register(
ModuleName,
1154,
"Swap amount too small; creates unfair spread for liquidity providers",
)
)