Errors
Shared custom errors for AVM interfaces.
Identifier-bearing errors use branded ID types where possible so callers cannot mix domains accidentally.
AlreadyExists
Section titled “AlreadyExists”Reverts when an object with the given identifier already exists.
error AlreadyExists(bytes32 id)BorrowProceedsExceedTradeCost
Section titled “BorrowProceedsExceedTradeCost”Reverts when borrowed proceeds exceed the trade cost in an exact-output leverage flow.
error BorrowProceedsExceedTradeCost(RawTokenQuantity borrowProceeds, RawTokenQuantity tradeCost)CurveFieldOutOfSignedRange
Section titled “CurveFieldOutOfSignedRange”Reverts when a curve input cannot be represented in signed math.
error CurveFieldOutOfSignedRange(bytes32 field, uint256 value)ExactReserveNetAmountMismatch
Section titled “ExactReserveNetAmountMismatch”Reverts when exact-net reserve fee math cannot reproduce the requested net amount.
error ExactReserveNetAmountMismatch(RawTokenQuantity expectedNet, RawTokenQuantity actualNet)FeeOnTransferNotSupported
Section titled “FeeOnTransferNotSupported”Reverts when token balance deltas break exact reserve-token accounting assumptions.
error FeeOnTransferNotSupported(address token, address account, uint256 expectedDelta, uint256 actualDelta)FeeRateExceedsMaximum
Section titled “FeeRateExceedsMaximum”Reverts when a fee rate exceeds a maximum.
error FeeRateExceedsMaximum(MicroBps fee, MicroBps maximum)FeeRateLeavesNoNetAmount
Section titled “FeeRateLeavesNoNetAmount”Reverts when a fee rate leaves no possible net output amount.
error FeeRateLeavesNoNetAmount(RawTokenQuantity requestedNetAmount, MicroBps feeRate)InsufficientCollateralBalance
Section titled “InsufficientCollateralBalance”Reverts when a collateral removal exceeds deposited collateral.
error InsufficientCollateralBalance(RawTokenQuantity requested, RawTokenQuantity available)InsufficientCollateralForBorrow
Section titled “InsufficientCollateralForBorrow”Reverts when requested debt exceeds the collateral-based borrowing limit.
error InsufficientCollateralForBorrow(RawTokenQuantity requestedDebt, RawTokenQuantity maxDebt)InsufficientDebtForRepay
Section titled “InsufficientDebtForRepay”Reverts when a repay or close request exceeds repayable outstanding debt.
error InsufficientDebtForRepay(RawTokenQuantity requested, RawTokenQuantity available)InsufficientReserveLiquidity
Section titled “InsufficientReserveLiquidity”Reverts when market reserve liquidity cannot fund a debit.
error InsufficientReserveLiquidity(RawTokenQuantity requested, RawTokenQuantity available)InvalidAvmToken
Section titled “InvalidAvmToken”Reverts when the AVM market-token address is invalid.
error InvalidAvmToken(address token)InvalidDecimals
Section titled “InvalidDecimals”Reverts when a token decimal precision is unsupported.
error InvalidDecimals(uint8 decimals)InvalidEngine
Section titled “InvalidEngine”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)InvalidEngineState
Section titled “InvalidEngineState”Reverts when opaque engine-state bytes are invalid for an engine.
error InvalidEngineState(address engine)InvalidMarketGroup
Section titled “InvalidMarketGroup”Reverts when registration group id does not match the market proxy’s group.
error InvalidMarketGroup(GroupId groupId)InvalidMarketId
Section titled “InvalidMarketId”Reverts when a market ID is invalid.
error InvalidMarketId(MarketId marketId)InvalidMarketKind
Section titled “InvalidMarketKind”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)InvalidOptionToken
Section titled “InvalidOptionToken”Reverts when the option market-token address is invalid.
error InvalidOptionToken(address token)InvalidReserveToken
Section titled “InvalidReserveToken”Reverts when the external reserve token address is invalid.
error InvalidReserveToken(address token)MarketAddressAlreadyExists
Section titled “MarketAddressAlreadyExists”Reverts when a market already exists.
error MarketAddressAlreadyExists(address marketAddress)MarketGroupAlreadyExists
Section titled “MarketGroupAlreadyExists”Reverts when a market group already exists.
error MarketGroupAlreadyExists(GroupId groupId)MarketGroupNotFound
Section titled “MarketGroupNotFound”Reverts when a market-group lookup fails.
error MarketGroupNotFound(GroupId groupId)MarketIdAlreadyExists
Section titled “MarketIdAlreadyExists”Reverts when a market ID already exists.
error MarketIdAlreadyExists(MarketId marketId)MarketNotFound
Section titled “MarketNotFound”Reverts when a market lookup fails.
error MarketNotFound(MarketId marketId)MarketOperationDisabled
Section titled “MarketOperationDisabled”Reverts when a market flag disables the requested operation.
error MarketOperationDisabled(MarketId marketId)MaximumInputExceeded
Section titled “MaximumInputExceeded”Reverts when an input is above a caller-provided ceiling.
error MaximumInputExceeded(uint256 maximum, uint256 actual)MinimumOutputNotMet
Section titled “MinimumOutputNotMet”Reverts when an output is below a caller-provided floor.
error MinimumOutputNotMet(uint256 minimum, uint256 actual)NegativeNetIssuedSupply
Section titled “NegativeNetIssuedSupply”Reverts when the supply offset exceeds total supply, which would
make net-issued (curve) supply negative.
error NegativeNetIssuedSupply(uint256 totalSupply, int256 supplyOffset)NothingToCollect
Section titled “NothingToCollect”Reverts when a revenue collection is attempted against an empty bucket.
error NothingToCollect(MarketId marketId, address token)NotImplemented
Section titled “NotImplemented”Reverts for declared but intentionally unavailable functionality.
error NotImplemented()NotMarketFactory
Section titled “NotMarketFactory”Reverts when not the authorized Market Factory
error NotMarketFactory(address caller)NotMarketGroupAdmin
Section titled “NotMarketGroupAdmin”Reverts when not the authorized Market Group Admin
error NotMarketGroupAdmin(address caller)NotProposedAdmin
Section titled “NotProposedAdmin”Reverts when a proposed-admin acceptance is attempted by a non-proposed caller.
error NotProposedAdmin(address caller)TenantNotFound
Section titled “TenantNotFound”Reverts when a tenant lookup fails.
error TenantNotFound(TenantId tenantId)Unauthorized
Section titled “Unauthorized”Reverts when caller lacks permission for the requested action.
error Unauthorized(address caller)ZeroAddress
Section titled “ZeroAddress”Reverts when a required address argument is zero.
error ZeroAddress()