Skip to main content

Errors

Git Source

Title: Custom Errors library.

Author: Axicon Labs Limited

Contains all custom error messages used in Panoptic.

Errors

AccountInsolvent

PanopticPool: The account is not solvent enough to perform the desired action

error AccountInsolvent(uint256 solvent, uint256 numberOfTicks);

CastingError

Casting error

e.g. uint128(uint256(a)) fails

error CastingError();

BelowMinimumRedemption

CollateralTracker: Attempted to withdraw/redeem less than a single asset

error BelowMinimumRedemption();

ChunkHasZeroLiquidity

SFPM: Mints/burns of zero-liquidity chunks in Uniswap are not supported

error ChunkHasZeroLiquidity();

AlreadyInitialized

Smart contract has already been initialized

error AlreadyInitialized();

DepositTooLarge

CollateralTracker: The amount of shares (or assets) deposited is larger than the maximum permitted

error DepositTooLarge();

DuplicateTokenId

PanopticPool: The list of provided TokenIds has a duplicate entry

error DuplicateTokenId();

EffectiveLiquidityAboveThreshold

PanopticPool: The effective liquidity (X32) is greater than min(MAX_SPREAD, USER_PROVIDED_THRESHOLD) during a long mint or short burn

Effective liquidity measures how much new liquidity is minted relative to how much is already in the pool

error EffectiveLiquidityAboveThreshold();

ExceedsMaximumRedemption

CollateralTracker: Attempted to withdraw/redeem more than available liquidity, owned shares, or open positions would allow for

error ExceedsMaximumRedemption();

InputListFail

PanopticPool: The provided list of option positions is incorrect or invalid

error InputListFail();

InvalidTick

Tick is not between MIN_TICK and MAX_TICK

error InvalidTick();

LiquidityTooHigh

Liquidity in a chunk is above 2**128

error LiquidityTooHigh();

InsufficientCreditLiquidity

CollateralTracker: There is not enough available liquidity to fulfill a credit in the PanopticPool

error InsufficientCreditLiquidity();

InvalidBuilderCode

RiskEngine: invalid builder code

error InvalidBuilderCode();

InvalidTokenIdParameter

The TokenId provided by the user is malformed or invalid

error InvalidTokenIdParameter(uint256 parameterType);

Parameters

NameTypeDescription
parameterTypeuint256poolId=0, ratio=1, tokenType=2, risk_partner=3, strike=4, width=5, two identical strike/width/tokenType chunks=6

InvalidUniswapCallback

A mint or swap callback was attempted from an address that did not match the canonical Uniswap V3 pool with the claimed features

error InvalidUniswapCallback();

LengthMismatch

RiskEngine: There is a mismatch between the length of the positionIdList and positionBalanceArray

error LengthMismatch();

NetLiquidityZero

PanopticPool: The Net Liquidity is zero due to small positions and cannot be used to compute the liquiditySpread

error NetLiquidityZero();

NoLegsExercisable

PanopticPool: None of the legs in a position are force-exercisable (they are all either short or ATM long)

error NoLegsExercisable();

NotALongLeg

PanopticPool: The leg is not long, so premium cannot be settled through settleLongPremium

error NotALongLeg();

NotBuilder

builderWallet: can only be called by the Builder

error NotBuilder();

NotEnoughLiquidityInChunk

PanopticPool: There is not enough available liquidity in the chunk for one of the long legs to be created (or for one of the short legs to be closed)

error NotEnoughLiquidityInChunk();

NotEnoughTokens

CollateralTracker: The user does not own enough assets to open/close a position

error NotEnoughTokens(address tokenAddress, uint256 assetsRequested, uint256 assetBalance);

NotGuardian

RiskEngine: can only be called by the guardian

error NotGuardian();

NotMarginCalled

PanopticPool: Position is still solvent and cannot be liquidated

error NotMarginCalled();

NotPanopticPool

CollateralTracker: The caller for a permissioned function is not the Panoptic Pool

error NotPanopticPool();

PoolNotInitialized

The Uniswap Pool has not been created, so it cannot be used in the SFPM or have a PanopticPool created for it by the factory

error PoolNotInitialized();

PositionCountNotZero

CollateralTracker: The user has open/active option positions, so they cannot transfer collateral shares

error PositionCountNotZero();

PositionNotOwned

PanopticPool: A position with the given token ID is not owned by the user and has positionSize=0

error PositionNotOwned();

PositionTooLarge

SFPM: The maximum token deltas (excluding swaps) for a position exceed (2^127 - 5) at some valid price

error PositionTooLarge();

PriceBoundFail

The current tick in the pool (post-ITM-swap) has fallen outside a user-defined open interval slippage range

error PriceBoundFail(int24 currentTick);

PriceImpactTooLarge

The Price impact of that trade is too large

error PriceImpactTooLarge();

StaleOracle

An oracle price is too far away from another oracle price or the current tick

This is a safeguard against price manipulation during option mints, burns, liquidations, force exercises, and premium settlements

error StaleOracle();

TooManyLegsOpen

PanopticPool: The position being minted would increase the total amount of legs open for the account above the maximum

error TooManyLegsOpen();

TransferFailed

ERC20 or SFPM (ERC1155) token transfer did not complete successfully

error TransferFailed(address token, address from, uint256 amount, uint256 balance);

InvalidTickBound

The tick range given by the strike price and width is invalid because the upper and lower ticks are not initializable multiples of tickSpacing or one of the ticks exceeds the MIN_TICK or MAX_TICK bounds

error InvalidTickBound();

UnauthorizedUniswapCallback

An unlock callback was attempted from an address other than the canonical Uniswap V4 pool manager

error UnauthorizedUniswapCallback();

UnderOverFlow

An operation in a library has failed due to an underflow or overflow

error UnderOverFlow();

Reentrancy

The function has triggered a reentrancy check

error Reentrancy();

WrongPoolId

PanopticPool: The supplied poolId does not match the poolId for that Uniswap Pool

error WrongPoolId();

WrongUniswapPool

SFPM: The poolId's don't match

error WrongUniswapPool();

ZeroAddress

PanopticFactory: the zero address was supplied as a parameter

error ZeroAddress();

ZeroCollateralRequirement

CollateralTracker: Mints/burns of a position returns no collateral requirement

error ZeroCollateralRequirement();

TokenIdHasZeroLegs

PanopticMath: The supplied tokenId has no valid legs

error TokenIdHasZeroLegs();