degenbot.exceptions.arbitrage¶
Arbitrage-specific exceptions (solver, encoding, incompatible invariant).
Module Contents¶
- class degenbot.exceptions.arbitrage.ArbitrageError¶
Bases:
degenbot.exceptions.base.DegenbotErrorException raised inside arbitrage helpers.
- class degenbot.exceptions.arbitrage.ArbCalculationError¶
Bases:
ArbitrageErrorRaised when an arbitrage calculation fails.
- class degenbot.exceptions.arbitrage.RateOfExchangeBelowMinimum(rate: fractions.Fraction)¶
Bases:
ArbitrageErrorThe rate of exchange for the path is below the minimum.
- rate¶
- class degenbot.exceptions.arbitrage.InvalidSwapPathError¶
Bases:
ArbitrageErrorRaised in arbitrage helper constructors when the provided path is invalid.
- class degenbot.exceptions.arbitrage.DirectionResolutionError¶
Bases:
ArbitrageErrorA discovered path’s hop directions could not be resolved to a closed token cycle.
The pathfinder contract guarantees every yielded path starts and ends at one of the requested boundary tokens ({WETH, native}), so a failure here is an invariant violation between the DB subgraph edges and the constructed pool objects (e.g. a pool built with different token0/token1 than the subgraph edge used) — a bug, not a skippable condition.
- class degenbot.exceptions.arbitrage.PathRejectedError¶
Bases:
ArbitrageErrorA path candidate was rejected by a path-composition policy predicate.
Policy rejection is distinct from the Rust core’s pool admission floor (
HookedPoolRejectedError/DynamicFeePoolRejectedError, which subclassValueError). Policy rejects by deployment rule (token denylist/allowlist, hop-count, min-liquidity, duplicate-pool); admission rejects by correctness floor. Callers classify by type so the two hierarchies (ArbitrageErrorvsValueError) stay separable.
- class degenbot.exceptions.arbitrage.TokenDenylistedError(*, token: str)¶
Bases:
PathRejectedErrorAn intermediate or profit token is not permitted by the policy.
Covers both denylist membership and allowlist absence.
tokenis the checksummed offending token address.- token¶
- class degenbot.exceptions.arbitrage.HopCountExceededError(*, hop_count: int, max_hops: int)¶
Bases:
PathRejectedErrorThe path exceeds the configured maximum hop count.
- hop_count¶
- max_hops¶
- class degenbot.exceptions.arbitrage.HopCountInsufficientError(*, hop_count: int, min_hops: int)¶
Bases:
PathRejectedErrorThe path is below the configured minimum hop count.
- hop_count¶
- min_hops¶
- class degenbot.exceptions.arbitrage.InsufficientLiquidityError(*, liquidity: int, min_liquidity: int)¶
Bases:
PathRejectedErrorA pool’s liquidity proxy is below the configured minimum.
liquidityis the value returned by the caller-suppliedliquidity_ofextractor (the library does not encode pool-type-specific liquidity math).- liquidity¶
- min_liquidity¶
- class degenbot.exceptions.arbitrage.DuplicatePoolError(*, pool: str)¶
Bases:
PathRejectedErrorThe same pool appears more than once in the path.
A degenerate, non-executable cycle. V2/V3 pools are keyed by address; V4 pools by
pool_idhex.poolis the duplicated pool’s identity key.- pool¶
- class degenbot.exceptions.arbitrage.NoLiquidity¶
Bases:
ArbitrageErrorRaised if a pool has no liquidity for the requested operation.
- class degenbot.exceptions.arbitrage.InvalidForwardAmount¶
Bases:
ArbitrageErrorInvalidForwardAmount class.
- class degenbot.exceptions.arbitrage.IncompatiblePoolInvariant¶
Bases:
ArbitrageErrorRaised when a pool’s invariant type is not supported for.
arbitrage path construction (e.g. Aerodrome stable pools).
- class degenbot.exceptions.arbitrage.Unprofitable¶
Bases:
ArbitrageErrorUnprofitable class.
- class degenbot.exceptions.arbitrage.NoSolverSolution(message: str = 'Solver failed to converge on a solution.')¶
Bases:
ArbitrageErrorNoSolverSolution class.
- message = 'Solver failed to converge on a solution.'¶