Skip to main content
PMXT’s error hierarchy is designed so the same except/catch clause works in both hosted and self-hosted modes. Hosted errors descend from HostedTradingError and from a semantic parent (InsufficientFunds, InvalidOrder, AuthenticationError, etc.). Self-hosted errors raise the semantic parent directly. Catch the parent and you cover both paths. For recovery patterns and the five most-common errors with code, see Handling hosted errors.

Hierarchy

In Python this is implemented via multi-inheritance: class InsufficientEscrowBalance(InsufficientFunds, HostedTradingError). In TypeScript, JS single-inheritance means each hosted leaf extends only its semantic parent, and the HostedTradingError membership is carried by a static isHostedError = true flag. Use the isHostedError(e) helper to test for membership.

HostedTradingError

Root of all errors returned by trade.pmxt.dev.

InsufficientEscrowBalance

Escrow free balance is below the order’s USDC requirement. Recovery: top up via client.escrow.deposit_tx(...).

OrderSizeTooSmall

Resolved share count is below the venue’s minimum (Polymarket: 5 shares).

InvalidApiKey

pmxt_api_key is missing, malformed, revoked, or expired. Recovery: rotate the key in the dashboard. Do not retry with the same key.

OutcomeNotFound

The hosted resolver could not resolve the requested outcome target. Most often: the backend could not resolve either a catalog UUID or a venue + venue_outcome_id pair. Common causes are a bare venue-native ID sent without the venue tuple, a mismatch between the outcome’s venue and the client exchange, or an outcome removed from the catalog. See Catalog UUID vs venue ID.

CatalogUnavailable

The hosted catalog is temporarily unavailable. Recovery: retry with exponential backoff.

BuiltOrderExpired

The built_order_id or cancel_id TTL elapsed before submit/cancel. Re-call build_order, re-sign, re-submit. Common cause: slow hardware-wallet confirmations.

InvalidSignature

The hosted trading API rejected the EIP-712 signature or typed-data shape. Most often: signing the wrong domain (chain ID, verifying contract). See Signing.

NoLiquidity

Empty book on the side you’re crossing.

MissingWalletAddress

Local validation — client.escrow.* was called without a wallet_address. Pass wallet_address to the exchange constructor.

Catching by intent

See also