Overview
TheMarketFetcher handles market discovery, individual market lookups, and orderbook retrieval. It also automatically caches venue contract addresses needed for order signing.
Setup
Fetching Active Markets
UseGetActiveMarkets() to retrieve a paginated list of all active markets:
Sort Options
Fetching a Single Market
UseGetMarket() to retrieve full details for a specific market:
Market struct has the following key fields:
Token IDs are returned as strings. Pass them directly to
OrderClient.CreateOrder() via FOKOrderArgs or GTCOrderArgs.Fetching the Orderbook
UseGetOrderBook() to retrieve current bids and asks for a market:
Fetching User Orders
UseGetUserOrders() to retrieve your open orders on a market (requires authentication):
Venue Caching
Every call toGetMarket() 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
GetMarket() retrieves and caches the venue:2
Check the cache
You can also access the venue cache directly:
3
Place an order
The
OrderClient automatically looks up the cached venue when you pass MarketSlug:Debugging Venue Cache
EnableLogLevelDebug logging to see venue cache operations: