Overview
TheMarketFetcher class handles market discovery, individual market lookups, and orderbook retrieval. It also automatically caches venue contract addresses needed for order signing.
Setup
Fetching active markets
Useget_active_markets() to retrieve a paginated list of all active markets:
Fetching a single market
Useget_market(slug) to retrieve full details for a specific market:
Market object is a Pydantic model with the following key fields:
Token IDs are returned as strings. Pass them directly to
OrderClient.create_order() as token_id.Fetching the orderbook
Useget_orderbook(slug) to retrieve current bids and asks for a market:
Venue caching
Every call toget_market() automatically caches the venue contract addresses (exchange and adapter) for that market. The OrderClient reads from this cache when signing orders, so you do not need to manage venues manually.
1
Fetch the market
Calling
get_market(slug) retrieves and caches the venue:2
Place an order
The
OrderClient automatically looks up the cached venue when you pass market_slug:Debugging venue cache
EnableDEBUG logging to see venue cache operations: