Skip to content

Errors

Shared custom errors for AVM interfaces.

Identifier-bearing errors use branded ID types where possible so callers cannot mix domains accidentally.

Reverts when an object with the given identifier already exists.

error AlreadyExists(bytes32 id)

Reverts when borrowed proceeds exceed the trade cost in an exact-output leverage flow.

error BorrowProceedsExceedTradeCost(RawTokenQuantity borrowProceeds, RawTokenQuantity tradeCost)

Reverts when a curve input cannot be represented in signed math.

error CurveFieldOutOfSignedRange(bytes32 field, uint256 value)

Reverts when exact-net reserve fee math cannot reproduce the requested net amount.

error ExactReserveNetAmountMismatch(RawTokenQuantity expectedNet, RawTokenQuantity actualNet)

Reverts when token balance deltas break exact reserve-token accounting assumptions.

error FeeOnTransferNotSupported(address token, address account, uint256 expectedDelta, uint256 actualDelta)

Reverts when a fee rate exceeds a maximum.

error FeeRateExceedsMaximum(MicroBps fee, MicroBps maximum)

Reverts when a fee rate leaves no possible net output amount.

error FeeRateLeavesNoNetAmount(RawTokenQuantity requestedNetAmount, MicroBps feeRate)

Reverts when a collateral removal exceeds deposited collateral.

error InsufficientCollateralBalance(RawTokenQuantity requested, RawTokenQuantity available)

Reverts when requested debt exceeds the collateral-based borrowing limit.

error InsufficientCollateralForBorrow(RawTokenQuantity requestedDebt, RawTokenQuantity maxDebt)

Reverts when a repay or close request exceeds repayable outstanding debt.

error InsufficientDebtForRepay(RawTokenQuantity requested, RawTokenQuantity available)

Reverts when market reserve liquidity cannot fund a debit.

error InsufficientReserveLiquidity(RawTokenQuantity requested, RawTokenQuantity available)

Reverts when the AVM market-token address is invalid.

error InvalidAvmToken(address token)

Reverts when a token decimal precision is unsupported.

error InvalidDecimals(uint8 decimals)

Reverts when an engine address is invalid for a market kind or market.

This means an engine pointer exists but is zero, has no code, or does

not support IPricingCurve.

error InvalidEngine(address engine)

Reverts when opaque engine-state bytes are invalid for an engine.

error InvalidEngineState(address engine)

Reverts when registration group id does not match the market proxy’s group.

error InvalidMarketGroup(GroupId groupId)

Reverts when a market ID is invalid.

error InvalidMarketId(MarketId marketId)

Reverts when a market kind has no configured pricing-engine route.

This means the directory cannot route the kind at all; an address

that is configured but is not an IPricingCurve uses InvalidEngine.

error InvalidMarketKind(MarketKind kind)

Reverts when the option market-token address is invalid.

error InvalidOptionToken(address token)

Reverts when the external reserve token address is invalid.

error InvalidReserveToken(address token)

Reverts when a market already exists.

error MarketAddressAlreadyExists(address marketAddress)

Reverts when a market group already exists.

error MarketGroupAlreadyExists(GroupId groupId)

Reverts when a market-group lookup fails.

error MarketGroupNotFound(GroupId groupId)

Reverts when a market ID already exists.

error MarketIdAlreadyExists(MarketId marketId)

Reverts when a market lookup fails.

error MarketNotFound(MarketId marketId)

Reverts when a market flag disables the requested operation.

error MarketOperationDisabled(MarketId marketId)

Reverts when an input is above a caller-provided ceiling.

error MaximumInputExceeded(uint256 maximum, uint256 actual)

Reverts when an output is below a caller-provided floor.

error MinimumOutputNotMet(uint256 minimum, uint256 actual)

Reverts when the supply offset exceeds total supply, which would

make net-issued (curve) supply negative.

error NegativeNetIssuedSupply(uint256 totalSupply, int256 supplyOffset)

Reverts when a revenue collection is attempted against an empty bucket.

error NothingToCollect(MarketId marketId, address token)

Reverts for declared but intentionally unavailable functionality.

error NotImplemented()

Reverts when not the authorized Market Factory

error NotMarketFactory(address caller)

Reverts when not the authorized Market Group Admin

error NotMarketGroupAdmin(address caller)

Reverts when a proposed-admin acceptance is attempted by a non-proposed caller.

error NotProposedAdmin(address caller)

Reverts when a tenant lookup fails.

error TenantNotFound(TenantId tenantId)

Reverts when caller lacks permission for the requested action.

error Unauthorized(address caller)

Reverts when a required address argument is zero.

error ZeroAddress()