Skip to content

Error Codes

All error codes are declared once in contracts/sources/errors.move and reused across modules, so they are stable and discoverable. Codes 1–33 are currently assigned.

CodeNameMeaningCommon trigger
1ENotAuthorizedCaller lacks required authorityNon-admin calls admin-only fn
2EMarketNotFoundMarket/object does not existBad id in ProposalRegistry lookup
3EInvalidMarketStateMarket not in required statusTrade on a resolved market
4EInvalidOutcomeOutcome index out of boundsoutcome >= n
5EInsufficientBalanceInsufficient collateral/balanceSell more than held; withdraw too much
6EInvariantViolatedShare backing invariant brokenBurn would underflow a reserve
7EInvalidLiquidityLiquidity op would leave pool invalidlp_shares yields 0 out; min_lp not met
8EAlreadyResolvedMarket already resolvedRe-propose/finalize
9ENotResolvedMarket not yet resolvedRedeem before resolution
10EInvalidOracleOutcomeOracle outcome invalidoutcome >= n; bad feed id in price resolve
11EDisputeWindowClosedDispute raised after windownow > dispute_deadline
12EInsufficientBondDispute bond too smallbond < required_bond
13EAlreadyRedeemedDouble redemption attemptWinning balance already 0
14EInvalidFeeFee param out of boundsprotocol_fee_bps != 75; out-of-range dispute_bond_bps / maker_rebate_bps
15EMathOverflowMath overflow in AMM/utilExtreme reserves; divide by zero
16EMissingCapabilityMissing admin capabilityAdmin registry mismatch
17EZeroAmountAmount must be > 00 payment / 0 liquidity
18EInvalidTimestampClock timestamp invalid for opends_at <= now; dispute window out of range
19ENotOracleOnly oracle may do thisNon-oracle calls resolve_market
20EQuorumNotMetGovernance quorum/threshold not metProposal fails; bad vote weight
21EAlreadyDisputedAlready disputedWindow re-extend handled in module
22EInvalidReferralReferral code invalidReferrer argument ignored
23EOrderBookDisabledOrder book disabled for marketCLOB not enabled
24EInvalidDisputantOracle/creator self-dealingOracle or creator raises dispute / resolves own market
25EClosingOnlyClosing-only window activeBuy would open new position near expiry
26EInvalidCloseOutTrade would open new exposureClosing-only buy exceeds held balance
27EIncentivesDisabledLP incentives not enabledClaim when stream disabled
28EIncentiveNotAccruedNo reward accruedClaim with 0 debt
29EBondTooLargeDispute bond exceeds capbond > required_bond × 100
30EUnverifiedPricePrice reading not attested on-chainresolve_market_price with unverified Pyth reading
31EPriceResolutionDisabledPrice resolution disabledCreating/using price market before Pyth wiring
32EInvalidFeedIdMalformed / non-allowlisted Pyth feedfeed_id ≠ 32 bytes or not on allowlist
33EInvalidParamWrong seed amount (must be exactly 10,000) or other bad argumentset_param / propose / create_market with invalid value
34EAlreadyVotedGovernance share already voted on this proposalSwitching sides or double-voting

Helper accessors

Each code has a public fun returning it (e.g. errors::not_authorized()), used by assert! sites. errors::all_codes() (test-only) returns the full vector for completeness checks.

Last updated:

OddsZero — Fully on-chain prediction markets on Sui.