Skip to main content

Overview

The MarketFetcher 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

Use get_active_markets() to retrieve a paginated list of active markets:

Sort options

Fetching a Single Market

Use get_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

Use get_order_book() to retrieve bids and asks for a market:

Fetching User Orders

Use get_user_orders() to retrieve your orders on a market. This requires authentication:
You can also call it from a fetched Market instance:

Venue Caching

Every call to get_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:
Calling get_market() before create_order() is still the recommended pattern. The Rust SDK will fetch venue data on demand if the cache is empty, but prefetching avoids an extra API roundtrip.