Developers
Search…
Error Codes
Vault exceptions will revert with "BAL#" instead of text; see below for the interpretation of the number.
All error codes for the Balancer V2 core contracts are defined in the BalancerErrors.sol contract.

Math

Code
Error
Comment
0
ADD_OVERFLOW
1
SUB_OVERFLOW
2
SUB_UNDERFLOW
3
MUL_OVERFLOW
4
ZERO_DIVISION
5
DIV_INTERNAL
Multiplication overflow during FixedPoint Division
6
X_OUT_OF_BOUNDS
Invalid x in ExpMath.pow(x, y)
7
Y_OUT_OF_BOUNDS
Invalid y in ExpMath.pow(x, y)
8
PRODUCT_OUT_OF_BOUNDS
In LogExpMath.pow(x, y), error computing x^y as exp(y * ln(x))
9
INVALID_EXPONENT
In LogExpMath.exp(x) = e^x; x out of bounds

Input

Code
Error
Comment
100
OUT_OF_BOUNDS
101
UNSORTED_ARRAY
See UNSORTED_TOKENS
102
UNSORTED_TOKENS
Tokens must be sorted in address order on pool registration
103
INPUT_LENGTH_MISMATCH
Used to ensure array inputs intended to be parallel have the same length
104
ZERO_TOKEN
Address to be interpreted as a token cannot be 0

Shared pools

Code
Error
Comment
200
MIN_TOKENS
All pools must contain at least two tokens
201
MAX_TOKENS
Token count exceeds the maximum for a given pool type
202
MAX_SWAP_FEE_PERCENTAGE
203
MIN_SWAP_FEE_PERCENTAGE
204
MINIMUM_BPT
On pool initialization, a small amount of BPT is minted to the zero address (keeps math well behaved). If initial balances are too small, initialization can fail
205
CALLER_NOT_VAULT
Certain pool callbacks need to be external, but could be exploited if called by anyone but the Vault
206
UNINITIALIZED
Pools must be initialized with a special "Init" join, before they can be joined by LPs
207
BPT_IN_MAX_AMOUNT
Slippage/front-running protection check failed on a pool exit
208
BPT_OUT_MIN_AMOUNT
Slippage/front-running protection check failed on a pool join
209
EXPIRED_PERMIT
210
NOT_TWO_TOKENS
Pools with oracles are limited to two tokens (e.g., WeightedPool2Tokens and MetastablePools). A pool with the TWO_TOKEN specialization must have exactly two tokens

Pools

Code
Error
Comment
300
MIN_AMP
Amplification factor out of range (Stable/Metastable pools)
301
MAX_AMP
302
MIN_WEIGHT
Weighted Pool minimum weight
303
MAX_STABLE_TOKENS
304
MAX_IN_RATIO
Token in unbalanced the pool too much on a swap
305
MAX_OUT_RATIO
Token out unbalanced the pool too much on a swap
306
MIN_BPT_IN_FOR_TOKEN_OUT
Disproportionate exit unbalanced the pool too much
307
MAX_OUT_BPT_FOR_TOKEN_IN
Disproportionate join unbalanced the pool too much
308
NORMALIZED_WEIGHT_INVARIANT
Weighted Pool normalized weights must add to 1.0
309
INVALID_TOKEN
310
UNHANDLED_JOIN_KIND
Some joins are pool type-specific
311
ZERO_INVARIANT
Pool balances must be > 0
312
ORACLE_INVALID_SECONDS_QUERY
The "ago" timestamp when querying the oracle must be in the past
313
ORACLE_NOT_INITIALIZED
Cannot query an oracle with no data
314
ORACLE_QUERY_TOO_OLD
Cannot query before the oracle's earliest data sample
315
ORACLE_INVALID_INDEX
Cannot query a sample outside the buffer (1024)
316
ORACLE_BAD_SECS
Oracle query window must have non-zero duration
317
AMP_END_TIME_TOO_CLOSE
Amplification parameter change has less than the minimum duration
318
AMP_ONGOING_UPDATE
Cannot start an amplification parameter update if one is already ongoing

Lib

Code
Error
Comment
400
REENTRANCY
401
SENDER_NOT_ALLOWED
402
PAUSED
403
PAUSE_WINDOW_EXPIRED
404
MAX_PAUSE_WINDOW_DURATION
405
MAX_BUFFER_PERIOD_DURATION
406
INSUFFICIENT_BALANCE
407
INSUFFICIENT_ALLOWANCE
408
ERC20_TRANSFER_FROM_ZERO_ADDRESS
409
ERC20_TRANSFER_TO_ZERO_ADDRESS
410
ERC20_MINT_TO_ZERO_ADDRESS
411
ERC20_BURN_FROM_ZERO_ADDRESS
412
ERC20_APPROVE_FROM_ZERO_ADDRESS
413
ERC20_APPROVE_TO_ZERO_ADDRESS
414
ERC20_TRANSFER_EXCEEDS_ALLOWANCE
415
ERC20_DECREASED_ALLOWANCE_BELOW_ZERO
416
ERC20_TRANSFER_EXCEEDS_BALANCE
417
ERC20_BURN_EXCEEDS_ALLOWANCE
418
SAFE_ERC20_CALL_FAILED

Vault

Code
Error
Comment
500
INVALID_POOL_ID
501
CALLER_NOT_POOL
Some Vault hooks can only be called by the pool (e.g., register tokens)
502
SENDER_NOT_ASSET_MANAGER
503
USER_DOESNT_ALLOW_RELAYER
Relayers must be allowed by both governance and the user account
504
INVALID_SIGNATURE
505
EXIT_BELOW_MIN
Exit would yield fewer than the user-supplied minimum tokens out
506
JOIN_ABOVE_MAX
Join would cost more than the user-supplied maximum tokens in
507
SWAP_LIMIT
Swap violates user-supplied limits (min out or max in)
508
SWAP_DEADLINE
Swap transaction not mined within the specified deadline
509
CANNOT_SWAP_SAME_TOKEN
510
UNKNOWN_AMOUNT_IN_FIRST_SWAP
A batch swap must start with a non-zero amount in
511
MALCONSTRUCTED_MULTIHOP_SWAP
512
INTERNAL_BALANCE_OVERFLOW
Unused in current code
513
INSUFFICIENT_INTERNAL_BALANCE
514
INVALID_ETH_INTERNAL_BALANCE
Cannot transfer native ETH to/from internal balance
515
INVALID_POST_LOAN_BALANCE
Flashloan transactions must repay the loan in the same transaction
516
INSUFFICIENT_ETH
517
UNALLOCATED_ETH
Unused in current code
518
ETH_TRANSFER
Relayers cannot receive ETH directly (only through the Vault)

Fees

Code
Error
Comment
600
SWAP_FEE_PERCENTAGE_TOO_HIGH
601
FLASH_LOAN_FEE_PERCENTAGE_TOO_HIGH
602
INSUFFICIENT_FLASH_LOAN_FEE_AMOUNT