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: