IPrimitiveEngineErrors.sol
Custom errors are encoded with their selector and arguments
Details
Peripheral smart contracts should try catch and check if data matches another custom error
Errors
BalanceError
Thrown when the balanceOf function is not successful and does not return data
error BalanceError()
CalibrationError
Thrown when the parameters of a new pool are invalid, causing initial reserves to be 0
error CalibrationError(uint256 delRisky, uint256 delStable)
Parameters
Name | Type | Description |
---|---|---|
delRisky | uint256 | undefined |
delStable | uint256 | undefined |
DeltaInError
Thrown when the deltaIn parameter is 0
error DeltaInError()
DeltaOutError
Thrown when the deltaOut parameter is 0
error DeltaOutError()
GammaError
Thrown when gamma, equal to 1 - fee %, is outside its bounds: 9_000 <= gamma <= 10_000; 1_000 = 10% fee
error GammaError(uint256 value)
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | undefined |
InvariantError
Thrown when the invariant check fails
error InvariantError(int128 invariant, int128 nextInvariant)
Details
Most important check as it verifies the validity of a desired swap
Parameters
Name | Type | Description |
---|---|---|
invariant | int128 | Pre-swap invariant updated with new tau |
nextInvariant | int128 | Post-swap invariant after the swap amounts are applied to reserves |
LockedError
Thrown on attempted re-entrancy on a function with a re-entrancy guard
error LockedError()
MinLiquidityError
Thrown when liquidity is lower than or equal to the minimum amount of liquidity
error MinLiquidityError(uint256 value)
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | undefined |
PoolDuplicateError
Thrown in create when a pool with computed poolId already exists
error PoolDuplicateError()
PoolExpiredError
Thrown when calling an expired pool, where block.timestamp > maturity, + BUFFER if swap
error PoolExpiredError()
RiskyBalanceError
Thrown when the expected risky balance is less than the actual balance
error RiskyBalanceError(uint256 expected, uint256 actual)
Parameters
Name | Type | Description |
---|---|---|
expected | uint256 | Expected risky balance |
actual | uint256 | Actual risky balance |
RiskyPerLpError
Thrown when riskyPerLp is outside the range of acceptable values, 0 < riskyPerLp <= 1eRiskyDecimals
error RiskyPerLpError(uint256 value)
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | undefined |
SigmaError
Thrown when sigma is outside the range of acceptable values, 1 <= sigma <= 1e7 with 4 precision
error SigmaError(uint256 value)
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | undefined |
StableBalanceError
Thrown when the expected stable balance is less than the actual balance
error StableBalanceError(uint256 expected, uint256 actual)
Parameters
Name | Type | Description |
---|---|---|
expected | uint256 | Expected stable balance |
actual | uint256 | Actual stable balance |
StrikeError
Thrown when strike is not valid, i.e. equal to 0 or greater than 2^128
error StrikeError(uint256 value)
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | undefined |
UninitializedError
Thrown when the pool with poolId has not been created
error UninitializedError()
ZeroDeltasError
Thrown when the risky or stable amount is 0
error ZeroDeltasError()
ZeroLiquidityError
Thrown when the liquidity parameter is 0
error ZeroLiquidityError()