Overview
TheMarketFetcher handles market discovery, individual market lookups, user-order lookup, and orderbook retrieval. It also caches venue contract addresses used by the order-signing flow.
Setup
Fetching Active Markets
Useget_active_markets() to retrieve a paginated list of active markets:
Sort options
Fetching a Single Market
Useget_market() to retrieve full details for a specific market:
market.tokens and market.venue are optional in the Rust models, so unwrap them only after checking they are present.Fetching the Orderbook
Useget_order_book() to retrieve bids and asks for a market:
Fetching User Orders
Useget_user_orders() to retrieve your orders on a market. This requires authentication:
Market instance:
Venue Caching
Every call toget_market() caches the market venue (exchange and adapter addresses). The OrderClient reads from this cache when resolving the correct EIP-712 verifying contract.
1
Fetch the market
Calling
get_market() retrieves and caches the venue:2
Check the cache
Access the cached venue directly:
3
Place an order
The
OrderClient will use the cached venue for signing: